#ifndef MidasTpcPulse_hxx_seen #define MidasTpcPulse_hxx_seen // $Id: IMidasTpcPulse.hxx,v 1.4 2010/02/19 16:42:31 fsanchez Exp $ // #include "rawtpc_format.h" #include "IMidasObj.hxx" #include "IMidasItr.hxx" //Needed for LinkDef namespace COMET { class IMidasTpcPulse; class IMidasBank; }; /// This class represents a single raw TPC Pulse class COMET::IMidasTpcPulse: public COMET::IMidasObj { private: public: IMidasTpcPulse(UShort_t version, const UShort_t* data, const UShort_t* eod, const COMET::IMidasBank* parent); IMidasTpcPulse(UShort_t version, UShort_t invalid_code); virtual ~IMidasTpcPulse() {}; virtual void Print(const Option_t* opt = "") const; /// Return the ADC of the first or nth sample Short_t GetADC(UInt_t sampleNo = 0) const; /// Return the number of ADC samples UInt_t GetNumberSamples() const {return fNumSamples;} /// Return the size occupied by the pulse in MIDAS bank in bytes. Int_t GetSize() const; /// Return the time of the first or nth sample Short_t GetTime(UInt_t sampleNo = 0) const; /// Return true if pulse starts with a time Bool_t HasStartTime() const {return fHasStartTime;} /// Return true if there is need for a new channel Bool_t NeedNewChan() const {return fNeedNewChan;} /// Return FEC number Int_t ComputeFECNumber() const {return fPulseFEC;} /// Return ASIC number Int_t ComputeAsicNumber() const {return fPulseASIC;} /// Return Channel number Int_t ComputeChannelNumber() const {return fPulseCHAN;} private: /// Number of ADC samples UInt_t fNumSamples; /// Pointer to the first ADC sample const UShort_t* fFirstSample; /// Time of first sample Short_t fStartTime; /// True if pulse starts with a time Bool_t fHasStartTime; /// True if we need to create new channel Bool_t fNeedNewChan; /// FEC number we need to create Int_t fPulseFEC; /// ASIC number we need to create Int_t fPulseASIC; /// CHAN number we need to create Int_t fPulseCHAN; }; #endif