#ifndef TClcDataBlock_hh #define TClcDataBlock_hh #include "Stntuple/base/TStnArrayI.hh" #include #include #include #include #include class TClcDataBlock : public TStnDataBlock { friend Int_t StntupleInitClcDataBlock(TStnDataBlock*, AbsEvent*, int); //----------------------------------------------------------------------------- // TArrayI is used "intelligently", i.e. only as a storage // : we are not relying on that that its length = N(hits), it rather is max // length of the hit array for all the event processed before //----------------------------------------------------------------------------- public: enum {kNChannels = 96}; enum {kNModules = 2}; protected: Int_t fEventNumber; // ! Int_t fRunNumber; // ! Int_t fInitialized; // ! TClcChannel fChannel[kNChannels];// ! run-time only convenience Int_t fCalibRun; // ! calib are used for run Int_t fCalibVersion; // ! version of the calib const to use Int_t fCalibDone; // ! flag Short_t fAdcData[kNChannels];// ADC data storage Int_t fAdcThreshold; // Int_t fNAdcHits; TTdcModule fTdc; // ! CLC has 96 channels = 1 TDC TStnArrayI fTdcData; // TDC data buffer TStnArrayI fListOfIsolatedChannels; // list of isolated channels // 2 modules - 0:west, 1:east TClcModule fModule[kNModules]; // reconstructed Z-coordinate of the // primary vertex (its default value) Float_t fZ0; //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: TClcDataBlock(); virtual ~TClcDataBlock(); // ****** initialization methods Int_t InitTdcChannels(); Int_t InitIsolatedChannels(); // ****** accessors Int_t NAdcHits () const { return fNAdcHits; } Int_t NTdcHits () const { return fTdc.NDataWords(); } TClcChannel* Channel(int i) { return &fChannel[i]; } TTdcModule& Tdc () { return fTdc; } TTdcWord* TdcWord(int i) { return fTdc.Data(i); } Int_t CalibRun () const { return fCalibRun; } Int_t CalibVersion() const { return fCalibVersion; } Int_t CalibDone () const { return fCalibDone; } Int_t NIsolatedChannels() { return fListOfIsolatedChannels.NDataWords(); } Int_t IsolatedChannel(int i) { return fListOfIsolatedChannels[i]; } TClcModule* Module (int i) { return &fModule[i]; } TClcLayer* Layer (int im,int il) { return Module(im)->Layer(il); } TClcChannel* Channel(int im,int il,int i) { return Layer(im,il)->Channel(i); } // ****** modifiers void SetCalibRun (int r) { fCalibRun = r; } void SetCalibVersion(int v) { fCalibVersion = v; } void SetCalibDone () { fCalibDone = 1; } // vertex reconstructed using the // CLC data Float_t Z0() const { return fZ0; } // ****** overloaded methods of TObject void Clear(Option_t* opt=""); void Print(Option_t* opt="") const; // ****** other methods int ReadCalibrations(int run_number); void ReadV1(TBuffer& R__b); ClassDef(TClcDataBlock,2) }; #endif