#ifndef TClcChannel_hh #define TClcChannel_hh #include #include class TClcChannel: public TObject { public: Short_t* fAdcData; Char_t fNTdcHits; Char_t fBad; // bad channel flag TTdcWord* fTdcWord; Float_t fT0; // T0[ns] to be subtracted Float_t fT1W; // norm factor in exp Float_t fA0W; // exponent term Float_t fB1W; // linear term Float_t fB2W; // quadratic term Float_t fSlope; // stretcher slope [TDC counts/ns] Float_t fT0W; // T0 for width-based procedure Float_t fSpp; // single particle peak Float_t fPedestal; // pedestal Short_t fIsolated; // 1 if channel is isolated // 0 otherwise public: TClcChannel(); ~TClcChannel(); // ****** accessors Int_t AdcCounts () const { Int_t x = (*fAdcData) & 0x7fff; if ((*fAdcData) & 0x8000) return (x << 3); else return x; } Int_t NTdcHits () const { return fNTdcHits; } Int_t Bad () const { return fBad; } // returns isolation flag Int_t IsIsolated () const { return fIsolated; } Float_t T0 () const { return fT0; } Float_t T1W () const { return fT1W; } Float_t A0W () const { return fA0W; } Float_t B1W () const { return fB1W; } Float_t B2W () const { return fB2W; } Float_t Slope () const { return fSlope; } Float_t T0W () const { return fT0W; } Float_t Spp () const { return fSpp;} Float_t Pedestal () const { return fPedestal;} // amplitude in units of single part // peak, after pedestal substruction Float_t Energy () const; TTdcWord* TdcWord(int i) const { return (TTdcWord*) ( ((Int_t*)fTdcWord)+i); } // time, corrected for the difference // in T0 for different channels Float_t Time (int i) const { return (fTdcWord+i)->LeadingEdge()+fT0 ; } Float_t Width(int i) const { return (fTdcWord+i)->Width() ; } // should be constant with the accuracy // given by the resolution Float_t T1 (int i) const { return (fTdcWord+i)->LeadingEdge()+fT0+(fTdcWord+i)->Width()/fSlope; } // width corrected for the threshold // effect Float_t W2 (int i) const ; // time as measured by the width // (to be corrected for the delays) Float_t T2 (int i) const { return 100.-Width(i)/fSlope; } // best estimate of the time // (to be corrected for the delays) Float_t T3 (int i) const { return 100.-W2(i)/fSlope; } // best estimate of the time // (corrected for the delays) Float_t BestTime (int i) const { return T3(i)+fT0W; } // ****** setters void SetBad (Int_t bad ) { fBad = bad; } void SetT0 (Float_t t0 ) { fT0 = t0; } void SetA0W (Float_t a0 ) { fA0W = a0; } void SetB1W (Float_t b1 ) { fB1W = b1; } void SetB2W (Float_t b2 ) { fB2W = b2; } void SetT1W (Float_t t1 ) { fT1W = t1; } void SetSlope(Float_t slope) { fSlope = slope; } void SetT0W (Float_t t0 ) { fT0W = t0; } void SetSpp (Float_t spp ) { fSpp = spp;} void SetPedestal (Float_t pedestal) { fPedestal = pedestal;} void SetIsolated (Int_t isolation ) { fIsolated = isolation;} // ****** overloaded methods of TObject void Clear(Option_t* opt="") { fNTdcHits = 0; fIsolated = 1;} void Print(Option_t* opt="") const; ClassDef(TClcChannel,0) }; #endif