// class ChipGtuData // $Id: ChipGtuData.hh,v 1.11 2005/02/24 11:00:25 pesce Exp $ // describe the digital data coming out of the Front End Chip // (counters, internal memories, logical signals) // used by the MacroCell classes // M. Pallavicini - created #ifndef _CHIPGTUDATA_HH_ #define _CHIPGTUDATA_HH_ #include #include #include "euso.hh" #include "EsafMsgSource.hh" class FrontEndChip; class ChipGtuData : public EsafMsgSource{ public: // ctor ChipGtuData(FrontEndChip*,Int_t g); // dtor virtual ~ChipGtuData(); // pointer to FrontEndChip object inline FrontEndChip* FrontEnd() const {return pFrontEnd;} // gtu number id inline Int_t Gtu() const {return fGtu;} // reset data (counters, memory) void Reset(); // increment a counter during the GTU // allow disentagling signal and background inline void SetCounter(Int_t ch,Bool_t bck) {fCounts[ch]++;if(!bck) fPureSignal[ch]++;} // counter value inline Int_t GetCounter(Int_t ch) const {return fCounts[ch];} // get signal only (no night glow background) inline Int_t GetPureSignal(Int_t ch) const {return fPureSignal[ch];} // returns the total number of detected counts Int_t GetTotalCounts(); // returns the total number of detected signal counts (no night glow background here) Int_t GetTotalPureSignal(); // number of channels with at least one hit Int_t GetNumActivePixels(); // returns true if the counter is above threshold inline Bool_t CheckCounter(Int_t ch) const {return ( fCounts[ch] >= fThresh);} // returns number of fast or hits in this gtu inline Int_t FastOrHits() const { return fFastORHits.size();} // returns the X, Y and time at which the logic fired // returns false if it did not fire at all // if more than one, returns first only Bool_t GetXYLogic(Int_t&,Int_t&,Double_t&); // add a fast or hit to the list void AddFastOr(Double_t tm) { fFastORHits.push_back( tm );} // fire the X Y logic void SetRowCol(Int_t,Int_t,Double_t); // set the threhsold of the digital counters inline void SetThreshCounter(Int_t th) { fThresh=th; } // returns false if there was activity in this chip // at least one counter above threshold inline Bool_t IsEmpty() const { return fEmpty; } inline void SetEmpty( Bool_t val = kTRUE ) { fEmpty = val; } // Analog front end data (AFEE) void AddCharge(Int_t ch, Double_t charge, Int_t gtu); void AddDynodeCharge(Double_t charge, Int_t gtu); inline Double_t Charge(Int_t ch) const {return fCharge[ch];} inline Double_t DynodeCharge() const {return fDynode;} private: ChipGtuData(); // empty ctor needed by rootcint FrontEndChip* pFrontEnd; // pointer to its front end chip Int_t fGtu; // gtu Bool_t fEmpty; // true if empty Int_t fThresh; // digital threshold vector fCounts; // counter value vector fPureSignal; // pure signal counters (no background) vector fFastORHits; // fast or hits (with their time) vector fRowList; // row column logic; vector fColList; // time at which the wire is fired // (if positive, never fired if negative) Double_t fTime; // time of the first fire XY logic Int_t fRow, fCol; // coordinates of the first fire XY logic Double_t fDynode; // dynode charge vector fCharge; // channel charge ClassDef(ChipGtuData,0) }; #endif