//----------------------------------------------------------------------------- //Oct 18, 2003 RLC: EMT data block includes EMTD, CSPD //----------------------------------------------------------------------------- #ifndef TEmtDataBlock_hh #define TEmtDataBlock_hh #include "Stntuple/data/TEmtTdcHeader.hh" #include "Stntuple/data/TEmtTdcWord.hh" #include #include #include class TEmtDataBlock : public TStnDataBlock { friend Int_t StntupleInitEmtDataBlock(TStnDataBlock* block, AbsEvent* event, int mode); public: enum { kEmtTdcs = 12 }; //----------------------------------------------------------------------------- // data members: //----------------------------------------------------------------------------- protected: Int_t fNEmtdHits; // total number of EMTD hit data words TTdcModule fEmtTdc[kEmtTdcs]; // EMTD TDC's (transient) TStnArrayI fEmtd; // EMTD buffer //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: TEmtDataBlock(); virtual ~TEmtDataBlock(); // ****** init methods Int_t InitTdcChannels(); // ****** accessors TTdcModule& EmtTdc(Int_t i) { return fEmtTdc[i]; } Int_t NEmtdHits () const { return fNEmtdHits; } TStnArrayI& GetEmtd () { return fEmtd; } Int_t ReadCalibrations(int run_number); // i is the TDC number TEmtTdcHeader& GetEmtTdcHeader(Int_t i); // i is the TDC number. j=hit number TEmtTdcWord& GetEmtTdcWord(Int_t i, Int_t j); // get eta and phi indicies from header and word // this returns 0->23 in phi even in the plug region with 48 towers // since those towers are ganged by 2 static Int_t GetEtaPhi(TEmtTdcHeader& h, TEmtTdcWord& w, Int_t& phi, Int_t& eta); // get data for eta and phi indicies // user must check return value to see if the hit was present // this returns 0->23 in phi even in the plug region with 48 towers // since those towers are ganged by 2 Int_t GetDataEtaPhi(TEmtTdcHeader& h, TEmtTdcWord& w, Int_t phi, Int_t eta); // ****** overloaded functions of // TObject void Clear(Option_t* opt=""); void Print(Option_t* opt="") const; //----------------------------------------------------------------------------- // schema evolution : for V1 - 10 words, V2 - 12 words //----------------------------------------------------------------------------- ClassDef(TEmtDataBlock,2) // EMT data }; #endif