// // File : VPulseFinder.hh // // Purpose: Declaration of the class VPulseFinder // // $Id: VPulseFinder.hh 9725 2010-09-28 07:31:17Z mathes $ // /** @file VPulseFinder.hh * Declaration of the partly abstract base class VPulseFinder. */ #ifndef _VPulseFinder_hh_ #define _VPulseFinder_hh_ #include // --- forward declaration(s) class TFADCData; /** Base class which describes the interface of all pulse finder * implementations. This class contains also a few typical variables of a pulse * finding algorithm. */ class VPulseFinder : public TNamed { public: /** Constructor of the class VPulseFinder(). The internal variables are * initialized to some defaults. */ VPulseFinder() : TNamed("Illegal Pulse Finder","Pulse finder algorithm"), fPedestal(-1.), fSigmaPedestal(-1.) {} /** Virtual destructor for the class VPulseFinder. */ virtual ~VPulseFinder() {} /** Create and return a copy of the present object. */ virtual VPulseFinder* Clone(const char *newname="") const = 0; /** Find one or more pulses. The pulse finders itself decide if the are * able to calculate one ore more pulses and which one the will return. */ virtual void FindPulse(TFADCData*) = 0; /** Get the number of pulses reconstructed by the pulse finder. */ virtual int GetNPulses() = 0; /** Get the pedestal value which was either calculated by the pulse finder * or taken from the hardware calculated value. */ float GetPedestal() { return fPedestal; } /** Get the length of the i-th pulse in ADC channels. * * If i is not specified, the value for the first pulse is returned. */ virtual int GetPulseLength(int i = 0) = 0; /** Get the (charge) integral of the i-th pulse. */ virtual float GetPulseIntegral(int i = 0) = 0; /** Get the pulse start position (in ADC channels) for the i-th pulse. */ virtual int GetPulseStart(int i = 0) = 0; /** Get the calculated or stored value for the variance of the pedestal. */ virtual float GetSigmaPedestal() { return fPedestal; } /** Return true, if the pulse finder found at least one pulse. */ virtual bool PulseFound() = 0; /** Externally preset the pedestal value. * * These value could be the 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) { fPedestal = ped; } /** Externally preset the value for the variance of the pedestal. */ void SetSigmaPedestal(float sigped) { fSigmaPedestal = sigped; } protected: // protected to be accessible by the derived classes /** The calculated or externally preset value for the pedestal. */ float fPedestal; /** The calculated or externally preset sigma of the pedestal. */ float fSigmaPedestal; }; #endif // _VPulseFinder_hh_