///////////////////////////////////////////////////////////////////////////// // // EEezAnalysis // // The EEezAnalysis class is the main workhorse of the analysis code. // It is responsible for taking the raw data from the ezTree, making // the connection to the database to obtain and correct for pedestals // and gains, and packing the data into the EEezTower objects. To keep // the EEezTower class as simple as possible, all of the geometry // information carried by the towers is initialized from the EEezAnalysis // class. This has the side effect of making the cluster finder fairly // independent of the EEMC geometry. // // The EEezAnalysis class has privately-held arrays to hold all detector // elements:
// EEezTower m_Towers[720];
// EEezStrip m_Strips[12][2][288]; // // Several inline member functions are available which provide direct // access to the m_Towers array through pointers. Each element in // m_Towers contains pointers to neighboring towers, and to the // appropriate strips in the m_Strips array. // // One accesses the data stored in the m_Towers array by calling member // functions of EEezAnalysis. These member functions return pointers into // the m_Towers array. One should tread lightly, as any changes you make // to a tower will be made for all running code which uses this instance // of EEezAnalysis. (This is why I have not told you about all of the // "set" methods on towers and strips!) // /////////////////////////////////////////////////////////////////////////////// #ifndef __EEezAnalysis_h__ #define __EEezAnalysis_h__ // // EEmc EZ analysis // // Fills a 2D array of EEezTowers, which include pointers to // neighboring towers (i.e. an automatic cluster finder). // #include #include #include #include // Definitions of tower and strip data structures #include "EEezTower.h" #include "EEezStrip.h" #include #include #include // DANGER //-- Sector-based statistics in standalone mode for now -- #ifndef __ROOT__ #include "EEezSectorStats.h" #endif typedef std::map EETowerList_t; typedef EETowerList_t::iterator EETowerListIter_t; // Forward declarations of classes class EEmcSmdMap; class EEfeeRawEvent; class EEeventDst; class StMuEmcCollection; //-- //-- Define access method to EEMC database //-- #ifndef __ROOT__ class EEmcDb; typedef EEmcDb EEmcDb_t; #else class StEEmcDbMaker; typedef StEEmcDbMaker EEmcDb_t; #endif ///////////////////////////////////////////////////////////////////////////// class EEezAnalysis : public TObject { public: EEezAnalysis(); ~EEezAnalysis(){ /* nada */ } //////////////////////////////////////////// // Methods to fill, clear and initialize void Make(EEfeeRawEvent *eevent) { Fill(eevent); } void Fill(EEfeeRawEvent *eevent); void Make(EEeventDst *dst ) { Fill(dst); } void Fill(EEeventDst *dst ); Int_t Make(StMuEmcCollection *emc); void Clear( Option_t *opts="" ); // Clears histograms void Init(); // Books histograms void InitGeometry(); // Initializes geometry void RestoreIndices(); // Restores m_Index in each tower to default void Save( EEezAnalysis *analysis); void setDb( EEmcDb_t *db );//{ m_EEmcDb = db; } void setHotTower(const Char_t *tow="05TA01"){ m_HotTowers [std::string(tow)] = 1; } void setSeedEnergy( Float_t e = 0.7 ) { m_SeedEnergy = e; } Float_t getSeedEnergy() { return m_SeedEnergy; } // Returns a POINTER to the hit-towers vector (for speed) EEezTowerPtrVec_t *getHitTowers() { return &m_HitTowers; } Int_t getNHitTowers() { return (Int_t)m_HitTowers.size(); } EEezTower *getHitTower( Int_t ihit ) { return m_HitTowers[ihit]; } EEezTowerPtrVec_t *getSeedTowers() { return &m_SeedTowers; } Int_t getNSeedTowers() { return (Int_t)m_SeedTowers.size(); } EEezTower *getSeedTower( Int_t iseed ) { return m_SeedTowers[iseed]; } // Code to force values for specified tower... Useful as a // debugging tool... production should eliminate this // routine entirely for safety. void forceTower( const Char_t *tow, Float_t etow = 0., Float_t epre1 = 0., Float_t epre2 = 0., Float_t epost = 0. ); TH2F getHistogram(); EEezTower *getTower( Int_t index );//{ return &m_Towers[index]; } EEezTower *getTower( Int_t sec, Int_t sub, Int_t eta ); EEezStrip *getStrip( Int_t sector, Int_t plane, Int_t strip ){ return &m_Strips[sector][plane][strip]; } //broke? EEezTower *getHighTower() { return m_HighTower; } //broke? EEezStrip *getHighUStrip() { return m_HighUStrip; } //broke? EEezStrip *getHighVStrip() { return m_HighVStrip; } void print(); #ifndef __ROOT__ EEezSectorStats *getSectorStats( Int_t sec ) { assert( 0<=sec && sec<=11); return m_SectorStats[sec]; } #endif //-- //-- Methods to add tower, pre-, post-shower and strip hits //-- void addTowerHit ( Int_t sec, Int_t sub, Int_t eta, Float_t adc, Int_t idet=0 ); void addSmdHit ( Int_t sec, Int_t plane, Int_t strip, Float_t adc ); void addMask ( unsigned stat ); private: // Random number generator, for randomizing the event TRandom *m_Random; // Database EEmcDb_t *m_EEmcDb; //! // Geometries EEmcSmdMap *m_EEmcSmdMap; // Tower array for storing endcap data EEezTower m_Towers[720]; // Strip arrays for storing SMD strips EEezStrip m_Strips[12][2][288]; // Vector of pointers into said array for storing struck towers EEezTowerPtrVec_t m_HitTowers; // Towers above specifed seed energy Float_t m_SeedEnergy; EEezTowerPtrVec_t m_SeedTowers; // List of hot towers (preshower, postshower, etc...) to // be avoided when filling histograms EETowerList_t m_HotTowers; // Vectors storing pointers to struck SMD strips EEezStripPtrVec_t m_HitUStrips; EEezStripPtrVec_t m_HitVStrips; EEezTower *m_HighTower; // Tower w/ highest ADC response EEezStrip *m_HighUStrip; // U Strip w/ highest ADC response EEezStrip *m_HighVStrip; // V Strip w/ highest ADC response #ifndef __ROOT__ EEezSectorStats *m_SectorStats[12]; // Tracks sector-based statistics #endif // Some private initialization functions void InitTowers(); void InitStrips(); void InitTowerStrips(); EETowerList_t m_IndexFromName; // Status bits to mask out unsigned m_StatMask; protected: #ifdef __ROOT__ friend class StMuEEmcClusterMaker; #endif ClassDef(EEezAnalysis,1); // EEMC analysis class }; #endif