// // File : AnalysedFadcData.hh // // Purpose: Declaration of class TAnalysedFADCData // // $Id: AnalysedFadcData.hh 9725 2010-09-28 07:31:17Z mathes $ // /** @file AnalysedFadcData.hh * Declaration of the class TAnalysedFADCData. * @author H.-J. Mathes, FzK */ #ifndef _AnalysedFadcData_hh_ #define _AnalysedFadcData_hh_ #include #include #include /** Class to describe the (partly) analysed FADC data. * * The FADC pulses are analyzed with a pulse finder (interface VPulseFinder) * and some pulse characteristics are stored. */ class TAnalysedFADCData : public TFADCData { public: static const Int_t kMaxPulses = 20; public: /** Constructor of the class TAnalysedFADCData. * * Initialize the internal variables and setup the pulse finder by * cloning the default pulse finder. If the default pulse finder is not * defined, a pulse finder of the type PFPedro is used instead. */ TAnalysedFADCData(TFADCData*); /** Destructor of the class TAnalysedFADCData. * * Internally hold resources are released. */ ~TAnalysedFADCData(); /** Perform the analysis of the TFADCData object. * * This includes: * @li pulse analysis, pedestal and integral * @li calculation of the pulses time. * @li ... */ void Analyse(); /** Calculate the time of the pulses in nano seconds * @param timestamp is the time in nano secs of the trace start, if it is * negative it was in the previous second. */ void CalculatePulseTime(Int_t timestamp = 0); /** Print some information of the pulse analysis to the specified stream. */ void Show(std::ostream& ostr=std::cout) const; public: // getters ... /** Get the number of pulses reconstructed by the pulse finder. */ int GetNPulses() const { return fPulseFinder->GetNPulses(); } /** Get the pedestal value which was either calculated by the pulse finder * or taken from the hardware calculated value. */ float GetPedestal() const { return fPulseFinder->GetPedestal(); } /** Get the length of the i-th pulse. If i is not specified, the value * for the first pulse is returned which is often (but not always) the * largest pulse. */ int GetPulseLength(int i = 0) const { return fPulseFinder->GetPulseLength( i ); } /** Get the (charge) integral of the i-th pulse. */ float GetPulseIntegral(int i = 0) const { return fPulseFinder->GetPulseIntegral( i ); } /** Get the pulse start position (in ADC channels) for the i-th pulse. */ int GetPulseStart(int i = 0) const { return fPulseFinder->GetPulseStart( i ); } /** Get the absolute time (in nano secs) for the reconstructed pulse. The * absolute time of the pulse is calculated through the method * CalculatePulseTime(). */ int GetPulseTime() const { return fCalculatedPulseTime; } /** Get the calculated or stored value for the variance of the pedestal. */ float GetSigmaPedestal() const { return fPulseFinder->GetPedestal(); } /** Return true if a pulse was found. */ bool PulseFound() const { return fPulseFound; } public: // setters /** Set the debug print level, the higher the level, the more output. * We have: * @li debug >= 1 : print only results * @li debug >= 2 : print intermediate results * @li debug >= 3 : print almost everything */ static void SetPrintLevel(Int_t level = 1) { fgPrintLevel = level; } /** Externally preset the pedestal value. These value could result * from the hardware level FLT algorithm. The Internal calculation of * pedestal and its variance will take place if either preset 'pedestal' * or 'variance' or both are <= 0.0 ! */ void SetPedestal(float ped) { fPulseFinder->SetPedestal( ped ); } /** Set the pulse finder used by this class (by all instances of this * class). * * If a pulse finder is already defined, the old one will be deleted. */ static void SetPulseFinder(VPulseFinder*); /** Externally preset the value for the variance of the pedestal. */ void SetSigmaPedestal(float sigped) { fPulseFinder->SetSigmaPedestal( sigped ); } protected: /** Find the largest (integral) pulse in an ADC trace. */ void FindPulse(); private: // these ones don't exist TAnalysedFADCData(); TAnalysedFADCData(TAnalysedFADCData&); TAnalysedFADCData& operator=(TAnalysedFADCData&); static int fgPrintLevel; // verbose print level static VPulseFinder *fgDefaultPulseFinder; VPulseFinder *fPulseFinder; unsigned int fCalculatedPulseTime; bool fPulseFound; }; #endif // _AnalysedFadcData_hh_