//////////////////////////////////////////////////////////////////// /// \class RAT::EventBuilderProc /// /// \brief Event builder /// /// \author Josh Klein /// /// REVISION HISTORY:\n /// 24 Mar 2010 : Gabriel Orebi Gann - Correct code to write /// to PMTCal objects instead of PMTUnCal /// - Remove pedestal smearing /// (this will go in to the `uncalibrator') \n /// 25 Mar 2010 : Gabriel Orebi Gann - Remove digitisation /// from `truth' PMTCal MC \n /// 26 Mar 2010 : Gabriel Orebi Gann - Set ChanFlags to 0 for each /// new PMTCal object, and randomly select CellID /// from 0-15. \n /// 29 Mar 2010 : Gabriel Orebi Gann - Add call to uncalibrator /// - Move digitisation of PMTUnCal to /// Uncal.UnCalibrateEvent routine \n /// 27 Apr 2010 : G Orebi Gann - Write to PMTTruth objects, instead /// of PMTCal \n /// 28 Apr 2010 : G Orebi Gann - Correct PMT hit times \n /// 12 May 2010 : G Orebi Gann - Use 50MHz clock time for GT \n /// 03 Mar 2011 : G Orebi Gann - Create PMT objects by type /// (normal, owl etc) \n /// 30 Sep 2016 : W Heintzelman - Add code to tabulate photoelectron /// generation in special runs to calculate PMT /// effectiveness tables /// 22 Oct 2016 : N Barros - Added check that there there is a MC branch to apply the /// processor, otherwise the processor would silently crash. /// 09 Nov 2016 : N Barros - Moved everything RATDB related from constructor to BeginofRun /// 01 Apr 2022 : T Kroupova - Use individual channel GTValid /// /// /// \details /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_EventBuilderProc__ #define __RAT_EventBuilderProc__ #include #include #include #include #include #include #include namespace RAT { class EventBuilderProc : public Processor { public: EventBuilderProc(); virtual ~EventBuilderProc(); // Allowed parameters: // "update" - integer, number of events between updates // virtual void SetI(std::string param, int value); virtual void BeginOfRun(DS::Run &run); virtual void EndOfRun(DS::Run &run); virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); protected: void SetI( const std::string& param, const int value ); void Die(std::string message, int flag_err, int info1, int info2, int /*return_code=0*/); DBLinkPtr fLdaq; UnCal fUnCal; double fTriggerGateDB; bool fUseRealisticGTValid; //whether to use channel-dependent GTValids std::vector fGTValids0; // GTValids for individual channels (TAC0) std::vector fGTValids1; // GTValids for individual channels (TAC1) double fTriggerDelayDB; double fFECDelay; double fGTDelay; EventTime fEVTime; EventTime fMCTime; EventTime fDiffTime; bool fCountPEs; bool fStore; }; } // namespace RAT #endif