#ifndef __EEezTower_h__ #define __EEezTower_h__ #include #include #include #include #include // Declare types for a vector of EEezTower pointers and an iterator class EEezTower; typedef std::vector EEezTowerPtrVec_t; typedef EEezTowerPtrVec_t::iterator EEezTowerPtrVecIter_t; typedef std::map EEezTowerPtrMap_t; typedef EEezTowerPtrMap_t::iterator EEezTowerPtrMapIter_t; // SMD strips #include "EEezStrip.h" ///////////////////////////////////////////////////////////////////////////// class EEezTower : public TObject { public: EEezTower(); ~EEezTower(){ /* nada */ }; Float_t getAdc( Int_t det=0 ); Float_t getRawAdc(Int_t det=0); Float_t getEnergy( Int_t det=0 ); EEezTowerPtrVec_t getNeighbors(); EEezTowerPtrVec_t getNeighborSeeds(); Int_t getNNeighborSeeds(); Int_t getNNeighbors(); EEezTower *getNeighbor(Int_t n); // Set ADC and energy... no default detector specified // 0 = towers, 1 = pre1, 2 = pre2, 3 = post void setAdc( Float_t a, Int_t det ) { m_Adc[det] = a; } void setRawAdc( Float_t a, Int_t det ) { m_RawAdc[det] = a; } void setEnergy( Float_t e, Int_t det ) { m_Energy[det] = e; } // // NOTE: Every index, i.e. tower number, sector number, subsector // and etabin number, are numbered from zero in this code. // void addNeighbor( EEezTower *n ){ m_Neighbors.push_back(n); } void setIndex( Int_t idx );// { m_Index = idx; } void setIndex( Int_t phibin, Int_t etabin ) { m_Index = 12 * phibin + etabin; } void setSeed(); void addNeighborSeed( EEezTower *n ) { m_NeighborSeeds.push_back(n); } // // Pointers to strips which are w/in the fiducial // volume of the tower // void addUStrip ( EEezStrip *strip ); void addVStrip ( EEezStrip *strip ); EEezStripPtrVec_t *getUStrips(); EEezStripPtrVec_t *getVStrips(); Int_t getNUStrips(); Int_t getNVStrips(); EEezStrip *getUStrip( Int_t i ); EEezStrip *getVStrip( Int_t i ); Float_t getSumMipU(); Float_t getSumMipV(); Float_t getMeanU(); Float_t getMeanV(); Float_t getMomentU( Int_t n ); // returns nth moment of SMD strips beneath tower Float_t getMomentV( Int_t n ); // returns nth moment of SMD strips beneath tower Int_t getNUHitStrips(); Int_t getNVHitStrips(); void clear(); Int_t getIndex(){ return m_Index; } // Returns the index of the tower 0 to 719 Int_t getEtabin() { return m_Index % 12; } // Returns the etabin of the tower 0 to 11 Int_t getPhibin() { return m_Index / 12; } // Returns the phibin of the tower 0 to 59 Int_t getSubSector() { return getPhibin() % 5; } // Returns the subsector index 0 to 4, for A to E Int_t getSector() { return getPhibin() / 5; } // Returns the sector of the tower 0 to 11 void printNeighbors(); void print(); void printLine(); const Char_t *getName(); Float_t getSumNeighbors( Int_t split = 0 ); // returns sum over neighboring tower energies Float_t getSumNeighborSeeds(); // sum over neighboring seed towers void removeFrom( EEezTowerPtrVec_t *list ); // removes self from list void getRangeU( Int_t &umin, Int_t &umax ) { umin = mUMin; umax = mUMax; } void getRangeV( Int_t &vmin, Int_t &vmax ) { vmin = mVMin; vmax = mVMax; } private: // Raw ADC Float_t m_Adc[4]; // ped subtracted Float_t m_RawAdc[4]; // raw // Energy Float_t m_Energy[4]; // Index in array Int_t m_Index; // Pointers to neighboring towers EEezTowerPtrVec_t m_Neighbors; // Pointers to neighboring seed towers EEezTowerPtrVec_t m_NeighborSeeds; // A vector of pointers to strips which // are w/in the fiducial volume of the // tower EEezStripPtrVec_t m_UStrips; EEezStripPtrVec_t m_VStrips; // Pointers to towers which share U and // V strips with this tower EEezTowerPtrVec_t m_UShareSmd; EEezTowerPtrVec_t m_VShareSmd; Int_t mUMin; Int_t mUMax; Int_t mVMin; Int_t mVMax; TString m_Name; ClassDef(EEezTower,1); // EEMC tower representation class }; #endif