//////////////////////////////////////////////////////////////////// /// \class RAT::TriggerPulse /// /// \brief Simulate the trigger pulses for NHITs and ESUMs /// /// \author Josh Klein /// /// REVISION HISTORY:\n /// 28 Apr 2010 : Josh Klein --- added in all types of trigger pulses, /// including a `generic' type which holds additional information so /// that the other trigger pulses can be built from it (for example, /// including a charge member so that the ESUMs can be built). /// The parameters used for the pulses (risetime, pulsewidth, etc.) can /// be set in DAQ.ratdb. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_TriggerPulse__ #define __RAT_TriggerPulse__ #include #include namespace RAT { class TriggerPulse { public: TriggerPulse(); virtual ~TriggerPulse(); virtual void SetStartTime(double time){fStartTime = time;}; virtual void SetPulseWidth(double width){fPulseWidth=width;}; virtual void SetPulseHeight(double height){fPulseHeight=height;}; virtual void SetPMTID(int _fPMTID){fPMTID = _fPMTID;}; virtual void SetCharge(double _fCharge){fCharge = _fCharge;}; virtual double GetStartTime() const {return fStartTime;}; virtual float GetPulseWidth(){return fPulseWidth;}; virtual double GetPulseHeight(double time)=0; virtual int GetPMTID(){return fPMTID;}; virtual double GetCharge(){return fCharge;}; protected: double fStartTime; double fPulseWidth; double fPulseHeight; int fPMTID; double fCharge; }; class GenericTrigPulse : public TriggerPulse { //This class is used to hold information about the PMT samples associated with //each trigger pulse, so this information can be then used by the real trigger //pulses (like charge for the ESUMs) public: GenericTrigPulse(){}; virtual ~GenericTrigPulse(){}; virtual void SetPulseHeight(double _fPulseHeight){fPulseHeight = _fPulseHeight;}; virtual double GetPulseHeight(double time); private: double fPulseHeight; }; class SquareTrigPulse : public TriggerPulse { public: SquareTrigPulse(){}; virtual ~SquareTrigPulse(){}; virtual void SetPulseHeight(double _fPulseHeight){fPulseHeight = _fPulseHeight;}; virtual double GetPulseHeight(double time); private: double fPulseHeight; }; class NHITTrigPulse : public TriggerPulse { public: NHITTrigPulse(){}; virtual ~NHITTrigPulse(){}; virtual void SetPulseHeight(double _fPulseHeight){fPulseHeight = _fPulseHeight;}; virtual void SetPulseRisetime(double _fRisetime){fRisetime = _fRisetime;}; virtual double GetPulseHeight(const double time); private: double fPulseHeight; double fRisetime; }; class EsumTrigPulse : public TriggerPulse { public: EsumTrigPulse(){fEsumDelay=20.0;}; virtual ~EsumTrigPulse(){}; virtual void SetPulseHeight(double charge); virtual void SetmVperPE(float mvperpe){fmVperPE=mvperpe;} virtual void SetADCperPE(float adcperpe){fADCperPE=adcperpe;} virtual double GetPulseHeight(const double time); private: double fPulseHeight; float fmVperPE; //conversion from photoelectrons to mV float fADCperPE; //conversion from ADC counts to photoelectrons double fEsumDelay; }; } // namespace RAT #endif