#ifndef __EEezPi0Analysis_h__ #define __EEezPi0Analysis_h__ #include #include #include #include #include #include #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h" #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h" #include "EEezAnalysis.h" #include "EEezClAnalysis.h" #include "EEezPi0nCandidate.h" class EEstarTrig; class EEezPi0Analysis : public TObject { public: void setNSmdSeed( Int_t n ) { mNSmdSeed = n; } Int_t mNSmdSeed; // Constructor and destructor EEezPi0Analysis ( const Char_t *name = "EEezPi0", Int_t trg_id = 0 ); ~EEezPi0Analysis(){ /* nada */ }; Int_t Init(); // Method used for analysing real data Int_t Make( EEezClAnalysis *c, EEstarTrig *e); void Clear( Option_t *opts = "" ); // Method used for analysing mixed-events Int_t Mix ( EEezClAnalysis *c, EEstarTrig *e); Int_t Mix ( EEezClAnalysis *c ); Int_t Mix ( EEezClusterVec_t c1, EEezClusterVec_t c2 ); // Methods for setting cuts void setRange ( Int_t r ) { m_Range = r; } void setCtbMultiplicityCut ( Int_t min = 0, Int_t max = 240 ) { Info("setCtbMultiplicityCut", "min = %d max = %d", min, max); m_CtbMinMultiplicity = min; m_CtbMaxMultiplicity = max; } void setCtbThreshold ( Int_t threshold = 3 ) { m_CtbThreshold = threshold; } void setCtbSumAdcCut ( Int_t min = 0, Int_t max = 256*240 ) { Info("setCtbSumAdcCut", "min = %d max = %d", min, max);m_CtbMinAdcSum = min; m_CtbMaxAdcSum = max; } void setMassRange( Float_t min=0.10, Float_t max=0.17 ) { m_MinMass = min; m_MaxMass = max; } void setMixedEventType ( Int_t type = EEezPi0Analysis::kRandom ) { m_MixedEventType = type; } void setSearchType ( Int_t type = EEezPi0Analysis::kAllPairs ) { m_SearchType = type; } void setSectorLimits ( Int_t sector_min = 0, Int_t sector_max = 11 ) { m_SectorMin = sector_min; m_SectorMax = sector_max; } void setUseSmd ( Int_t use = 1 ) { m_UseSmd = use; } void setSectors ( Int_t min, Int_t max ) { m_SectorMin = min; m_SectorMax = max; } void setAnalysis ( EEezAnalysis *a ) { m_Analysis = a; } private: EEmcGeomSimple *m_EEmcGeom; // Endcap towers geom... !!!!BREAKS GENERALITY!!!! // ------------------------------------------------------------------ // TDirectory *m_Directory; // Directory for storing histograms // Histograms of various kinematic variables, some of which we may want // to analyse in etabins, phibins and towers... TH1F *m_Mass, *m_Mass_DEta[12], *m_Mass_DPhi[60], *m_Mass_DTow[720]; TH1F *m_Mass1, *m_Mass2; TH1F *m_Energy, *m_Energy_DEta[12], *m_Energy_DPhi[60], *m_Energy_DTow[720]; TH1F *m_Z, *m_Z_DEta[12], *m_Z_DPhi[60], *m_Z_DTow[720]; TH1F *m_Eta; TH1F *m_Phi; TH1F *m_CtbAdc; TH2F *m_EndcapHits1; // Spatial dist. of larger seed TH2F *m_EndcapHits2; // Spatial dist. of smaller seed TH2F *m_Energy1_vs_Energy2; // Energy of seed 1 vs seed 2 TH1F *m_Preshower1_Adc1; // Preshower ADC spectrum, seed 1 TH1F *m_Preshower2_Adc1; // Preshower ADC spectrum, seed 1 TH1F *m_Postshower_Adc1; // Postshower ADC spectrum, seed 1 TH1F *m_Preshower1_Adc2; // Preshower ADC spectrum, seed 2 TH1F *m_Preshower2_Adc2; // Preshower ADC spectrum, seed 2 TH1F *m_Postshower_Adc2; // Postshower ADC spectrum, seed 2 TH1F *m_NumClusters; // N clusters in event vs N pi0 candidates TH2F *m_NumTowers; // N of active towers in pi0 vs E pi0 candidate TH1F *m_NumSmdSeed15; // Number of SMD seeds for clusters in mass range TH1F *m_NumSmdSeed25; TH1F *m_NumSmdSeed35; void InitHistograms(); void FillHistograms( EEezCluster *c1, EEezCluster *c2, Float_t weight = 1.0 ); Int_t m_Range; // Maximum separation between towers Int_t m_CtbMinMultiplicity; // Minimum CTB multiplicity Int_t m_CtbMaxMultiplicity; // Maximum CTB multiplicity Int_t m_CtbThreshold; // Minimum CTB ADC to count as a hit Int_t m_CtbMinAdcSum; // Minimum CTB sum Int_t m_CtbMaxAdcSum; // Maximum CTB sum Int_t acceptEvent(); Int_t acceptEvent( EEstarTrig *trig ); Float_t m_MinMass; // Minimum mass for binning energy, etc... Float_t m_MaxMass; // Maximum mass for binning energy, etc... // ------------------------------------------------------------------ // // The Pi0 finder can search all cluster pairs, or limit itself to // only examine the cluster associated with the high-tower trigger. // Consider adding a user-specified cluster search. // enum search_t { kAllPairs, kHighTowerOnly }; Int_t m_SearchType; // ------------------------------------------------------------------ // // Combinatoric background can be mixed in several ways // // kRandom -- a random cluster from the saved event replaces // first one, then the other cluster in the // candidate pi0 // kSortedRandom -- as above, except that we attempt to preserve // the energy-ordering of the nearby clusters // kHighTowerSubstituion -- The cluster associated with the high- // tower triggered event from one event is sub- // stituted for the high-tower cluster in this // event. // enum mixed_event_t { kRandom, kSortedRandom, kHighTowerSubstitution }; Int_t m_MixedEventType; TRandom *m_Random; EEezClusterVec_t m_OldClusters; // Vector of clusters from a previous event Int_t m_SectorMin; Int_t m_SectorMax; Int_t m_UseSmd; // Internally used to mix combinatoric background class ShuffleItem { public: TVector3 momentum; Int_t etaBin; Int_t phiBin; }; // // ------------------------------------------------------------------ // // ------------------------------------------------------------------ const Char_t *m_Name; Int_t m_TriggerId; EEezAnalysis *m_Analysis; EEezPi0nCandidatePtrVec_t m_Candidates; protected: // The _real_ method invoked by both public versions of Make, // takes only a (pointer to a) vector of clusters as an arguement Int_t Make( EEezClusterVec_t *clusters ); ClassDef(EEezPi0Analysis,1); }; #endif