//////////////////////////////////////////////////////////////////// /// \class RAT::FrontEndProc /// /// \brief Simulate the front end electronics (discriminators etc) /// /// \author Josh Klein /// /// REVISION HISTORY:\n /// 18 Feb 2010 : Gabriel Orebi Gann - Extend array of channel thresholds /// to include all tubes, giving the `abnormal' tubes /// a threshold of -1.0 for now \n /// 05 Mar 2010 : Gabriel Orebi Gann - Remove all reference to /// DAQTHRESH.ratdb file \n /// - Calculate channel thresholds from DQXX info /// directly. This means all tubes now have a value, /// so the array extension is no longer required \n /// - Include a test on DQXX word for each PMT to /// determine whether the DAQ is functional i.e. /// whether to store the hit. NB for now this mask is /// the same as the MC-side test for an online tube /// so this additional test will have no effect but /// this allows for the definition of `online' to be /// split between MC and DAQ-side simulation (where /// ``MC'' refers to everything up to and including /// an incident photon causing a hit on a PMT i.e. a /// cascade in the dynode stack) \n /// 03 May 2010 : Gabriel Orebi Gann - Add in handling for the case /// where sampling window > long integration time /// (i.e. some channel deadtime) \n /// 10 Sep 2010 : Gabriel Orebi Gann - Only test high-f noise once /// per pulse \n /// 31 Oct 2014 : I Coulter - Tidy and remove some unused code that /// was causing cppcheck rattest to fail. \n /// 19 May 2015 : J Walker - Adding flasher crosstalk. \n /// 22 Oct 2016 : N Barros - Added check that there there is a MC branch to apply the /// processor, otherwise the processor would silently crash. /// /// /// \details Initialise detector construction /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_FrontEndProc__ #define __RAT_FrontEndProc__ #include #include #include #include #include #include #include namespace RAT { class FrontEndProc : public Processor { public: FrontEndProc(); virtual ~FrontEndProc() {}; void BeginOfRun(DS::Run& run); // Allowed parameters: // "update" - integer, number of events between updates // virtual void SetI(std::string param, int value); virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); protected: double fSamplingTimeDB; ///< sampling time in ns --- this is the size of a PMT time window double fShortIntTimeDB; ///< short integration time in ns double fLongIntTimeDB; ///< long integration time in ns double fLowGainFactorDB; ///< factor that attenuates low gain charges int fPulseTypeDB; ///< Pulse type: 0=square pulses, 1=real pulses float fPulseWidthDB; ///< width of a PMT pulse in ns float fPulseOffsetDB; ///< offset of a PMT pulse in mV float fPulseMeanDB; ///< mean of a PMT pulse in ns float fStepTimeDB; ///< stepping time for discrimination float fPulseMinDB; ///< Minimum pulse height to consider float fNoiseAmplDB; ///< width of noise in adc counts double fGDelayDB; ///< time before discriminator fires that sampling gate opens FlasherCrossTalk fFlasherCrossTalk; DBLinkPtr fLdaq; DBLinkPtr fPmtCalib; }; } // namespace RAT #endif