///////////////////////////////////////////////////////////////////////////// #ifndef __EEsmdProfile_h__ #define __EEsmdProfile_h__ #include #include #include #include #include #include "StEEmcUtil/EEfeeRaw/EEmcEventHeader.h" #include #include #include #include "EEezCluster.h" #include class EEezClAnalysis; class EEezClusterQA; //$$$class EEsmdProfile : public TObject { class EEsmdProfile : public TDirectory { public: EEsmdProfile(); EEsmdProfile( const Char_t *name, const Char_t *title = "EEsmdProfiler" ); ~EEsmdProfile(){ /* nada */ }; // Returns the SMD distribution beneath the "ith" cluster TH1F *getProfileU( Int_t i ) { return (TH1F *)m_UProfile.At(i); } TH1F *getProfileV( Int_t i ) { return (TH1F *)m_VProfile.At(i); } TH1F *getProfileU( const Char_t *c ) { return getProfileU( m_Name2IndexU[ TString(c) ] ); } TH1F *getProfileV( const Char_t *c ) { return getProfileV( m_Name2IndexV[ TString(c) ] ); } TH1F *getProfileU( EEezCluster *c ) { return getProfileU( c -> Hash() ); } TH1F *getProfileV( EEezCluster *c ) { return getProfileV( c -> Hash() ); } TH1F *getProfileSum5U( Int_t i ) { return (TH1F *)m_UProfileSum5.At(i); } TH1F *getProfileSum5V( Int_t i ) { return (TH1F *)m_VProfileSum5.At(i); } TH1F *getProfileSum5U( const Char_t *c ) { return getProfileSum5U( m_Name2IndexU[ TString(c) ] ); } TH1F *getProfileSum5V( const Char_t *c ) { return getProfileSum5V( m_Name2IndexV[ TString(c) ] ); } TH1F *getProfileSum5U( EEezCluster *c ) { return getProfileSum5U( c -> Hash() ); } TH1F *getProfileSum5V( EEezCluster *c ) { return getProfileSum5V( c -> Hash() ); } TH1F *getProfileSum9U( Int_t i ) { return (TH1F *)m_UProfileSum9.At(i); } TH1F *getProfileSum9V( Int_t i ) { return (TH1F *)m_VProfileSum9.At(i); } TH1F *getProfileSum9U( const Char_t *c ) { return getProfileSum9U( m_Name2IndexU[ TString(c) ] ); } TH1F *getProfileSum9V( const Char_t *c ) { return getProfileSum9V( m_Name2IndexV[ TString(c) ] ); } TH1F *getProfileSum9U( EEezCluster *c ) { return getProfileSum9U( c -> Hash() ); } TH1F *getProfileSum9V( EEezCluster *c ) { return getProfileSum9V( c -> Hash() ); } TH1F *getProfileChi2U( Int_t i ) { return (TH1F *)m_UProfileChi2.At(i); } TH1F *getProfileChi2V( Int_t i ) { return (TH1F *)m_VProfileChi2.At(i); } TH1F *getProfileChi2U( const Char_t *c ) { return getProfileChi2U( m_Name2IndexU[ TString(c) ] ); } TH1F *getProfileChi2V( const Char_t *c ) { return getProfileChi2V( m_Name2IndexV[ TString(c) ] ); } TH1F *getProfileChi2U( EEezCluster *c ) { return getProfileChi2U( c -> Hash() ); } TH1F *getProfileChi2V( EEezCluster *c ) { return getProfileChi2V( c -> Hash() ); } TH1F *getProfileInitU( Int_t i ) { return (TH1F *)m_UProfileInit.At(i); } TH1F *getProfileInitV( Int_t i ) { return (TH1F *)m_VProfileInit.At(i); } TH1F *getProfileInitU( const Char_t *c ) { return getProfileInitU( m_Name2IndexU[ TString(c) ] ); } TH1F *getProfileInitV( const Char_t *c ) { return getProfileInitV( m_Name2IndexV[ TString(c) ] ); } TH1F *getProfileInitU( EEezCluster *c ) { return getProfileInitU( c -> Hash() ); } TH1F *getProfileInitV( EEezCluster *c ) { return getProfileInitV( c -> Hash() ); } TF1 *getFitU( Int_t i ) { return (TF1 *)getProfileU(i)->GetListOfFunctions() -> At(0); } TF1 *getFitV( Int_t i ) { return (TF1 *)getProfileV(i)->GetListOfFunctions() -> At(0); } TF1 *getFitU( const Char_t *c ) { return getFitU( m_Name2IndexU[ TString(c) ] ); } TF1 *getFitV( const Char_t *c ) { return getFitV( m_Name2IndexV[ TString(c) ] ); } TF1 *getFitU( EEezCluster *c ) { return getFitU( c -> Hash() ); } TF1 *getFitV( EEezCluster *c ) { return getFitV( c -> Hash() ); } TF1 *getSinglePeak(); TF1 *getDoublePeak(); // Residual histogram after fit has been performed TH1F *getResidualU( Int_t i ); // TH1F *getResidualV( Int_t i ); // // Return pointers to the U and V lists of histograms TList *getListU() { return &m_UProfile; } TList *getListV() { return &m_VProfile; } // Perform a fit to the U or V profile void fitProfiles ( Int_t icluster ) { for ( Int_t iuv=0;iuv<2;iuv++ )fitProfile(icluster,iuv); } void fitProfile ( Int_t iprofile, Int_t iuv ); void fitSinglePeak ( Int_t icluster, Int_t iuv, Float_t mean, Float_t min=0., Float_t max=-1., Option_t *opts="RQ0" ); void fitDoublePeak ( Int_t icluster, Int_t iuv, Float_t mean1, Float_t mean2, Float_t min=0., Float_t max=-1., Option_t *opts="RQO" ); Int_t Make( EEezClAnalysis *cl, EEmcEventHeader *header ); Int_t Init(); void Clear( Option_t *opts="" ); void MakeFits(Option_t *opts="RQ0L"); void MakeQA(); void setEnergyThreshold( Float_t min, Float_t max=999999. ) { m_MinEnergy = min; m_MaxEnergy = max; } // Sets a pointer to the function used to fit the shower shape void setShowerShape ( TF1 *shape ) { m_ShowerShape = shape; } TH1F *getSumOverStrips ( EEezCluster *cluster, Int_t nstrip, Int_t iuv ); void estimateSinglePeak ( EEezCluster *cluster, Int_t iuv ); private: EEezClAnalysis *m_EEezClust; TH1F *m_Converge; EEezClusterQA *m_EEClusterQA[12]; protected: TList m_UProfile; // TMap used to associate an SMD profile TList m_VProfile; // with each (tower only) cluster in the event TList m_UProfileSum9; // Sum over 9 strips vs i start + 4 TList m_VProfileSum9; // Sum over 9 strips vs i start + 4 TList m_UProfileSum5; // Sum over 9 strips vs i start + 2; TList m_VProfileSum5; // Sum over 9 strips vs i start + 2; TList m_UProfileChi2; // Chi2/ndf for each strip +/- 4.5 strips from mean TList m_VProfileChi2; // Chi2/ndf for each strip +/- 4.5 strips from mean TList m_UProfileInit; // Initial parameterization of U profile fit TList m_VProfileInit; // Initial parameterization of V profile fit TList m_UResidual; TList m_VResidual; Float_t m_MinEnergy, m_MaxEnergy; // Shower-shape functions TF1 *m_ShowerShape; TF1 *m_SinglePeak; TF1 *m_DoublePeak; // Store the index for each histogram in a map, mapped // by the name of the cluster. This will make retrival // of the profiles fairly simple. std::map m_Name2IndexU, m_Name2IndexV; ClassDef(EEsmdProfile,1); // EEMC smd histograming/fitting }; #endif #if 0 // QA histograms for (single-peak) fits. In future may // consdider doing separate directories for single- and // double-peak fit QA histograms. TH1F *m_DiffPar[5]; TProfile *m_DiffParVsChi2[5]; TH1F *m_Par[5]; TH2F *m_Chi2VsRMS; TH1F *m_NDF; #endif