//////////////////////////////////////////////////////////////////// /// \class RAT::CAEN /// /// \brief Simulate the CAEN Digitiser board /// /// \author Gabriel Orebi Gann /// /// REVISION HISTORY:\n /// 02 April 2015 - GD Orebi Gann - modify to read run-level DAQ /// settings from new table (DAQ_RUN_LEVEL) /// 10 Nov 2016 - N Barros - Move RATDB access to newly added BeginOfRun /// /// \details /// ////////////////////////////////////////////////////////////////////// // #ifndef __RAT_CAEN__ #define __RAT_CAEN__ #include #include #include #include #include namespace RAT { class CAEN{ public: CAEN(); virtual ~CAEN(); virtual void BeginOfRun(); virtual void EndOfRun() { }; void TriggerEvent(); void SetIO(bool isSYNC, bool isSYNC24); void Digitise(AnalogSignal *sum, int i); virtual void SetEventID(int _this){fEventID = _this;}; virtual int GetEventID(){return fEventID;}; virtual void IncrementEventID(); virtual void SetBoardID(int _this){fBoardID = _this;}; virtual int GetBoardID(){return fBoardID;}; virtual void SetNSamples(UShort_t _this){fSamples = _this;}; virtual void SetNPreSamples(UShort_t _this){fPreSamples = _this;}; virtual int GetWordCount(){return fNWords;}; virtual void SetFormat(UShort_t _this){fFormat = _this;}; virtual UShort_t GetFormat(){return fFormat;}; virtual void SetBit24(UShort_t _this){fBit24 = _this;}; virtual UShort_t GetBit24(){return fBit24;}; virtual void SetMCEventTime(double mctime){fMCEventTime=mctime;}; virtual void SetTrigTime(double time){fTrigTime=time;}; virtual void SetSigDelay(double mctime){fSigDelay=mctime;}; virtual int GetTriggerTime(){return fTrigTagTime;}; virtual int GetIOPins(){return fIOPins;}; virtual void SetChannelMask(UShort_t _this){fChannelMask = _this;}; virtual UShort_t GetChannelMask(){return fChannelMask;}; virtual bool TestChannelMask(int bit){return BitManip::TestBit(fChannelMask,bit);}; virtual void SetClock(); virtual ULong64_t GetClockCount(){return fTrigClock->GetCount();}; virtual ULong64_t GetClockCount(EventTime gTrigTime){return fTrigClock->GetCount(gTrigTime);}; std::vector GetChannelInfo(int i){return fChannelInfo[i];}; private: int fEventID; int fBoardID; UShort_t fBit24; UShort_t fFormat; UShort_t fChannelMask; int fSamples; int fLatency; int fPreSamples; int fNWords; clock *fTrigClock; double fMCEventTime; double fTrigTime; double fSigDelay; ULong64_t fTrigTagTime; double fStartTime; bool fSYNC; bool fSYNC24; int fIOPins; std::vector< std::vector > fChannelInfo; //The waveforms // CAEN calibration i.e. Q <-> ADC counts int fNBits; // number of bits per sample std::vector fScale; // scaling applied to trigger sum. // This factor is responsible for changing the RAT internal arbitrary units // for the analog trigger sums to realistic values like what you'd see in data. std::vector fOffset; // offset applied to trigsum (on CAEN) }; } // namespace RAT #endif