//////////////////////////////////////////////////////////////////// /// \class RAT::SanityCheckProc /// /// \brief Sanity checks on the processed data (/MC) /// /// \author Gabriel D. Orebi Gann /// /// REVISION HISTORY:\n /// 14 May 2010 : Gabriel Orebi Gann - first version /// 10 Nov 2016 : Nuno Barros - Moved the RATDB access code to BeginOfRun /// /// \details This processor applies some sanity checks to /// processed data and MC events, to ensure things are /// running smoothly. /// Current implemented checks: /// 1. PMT ID is in the range 0-9727 /// 2. No PMT is hit twice within a single triggered event /// 3. Event ID is in the range 0 - (2^24 - 1) /// 4. Event ID is not one of those that should be skipped /// /// /// /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_SanityCheckProc__ #define __RAT_SanityCheckProc__ #include #include #include #include #include #include "dprintf.hpp" #include "fileio.hpp" #include "multiio.hpp" #include "TFile.h" #include "TMath.h" #include namespace RAT { class SanityCheckProc : public Processor { public: SanityCheckProc(); virtual ~SanityCheckProc(); virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); virtual void BeginOfRun(DS::Run& run); virtual void EndOfRun(DS::Run& run) {(void)run;}; protected: void EventID(int eventID); void PMTID(int pmtID); // Output and status methods void Die(std::string message, int flag_err, int info1, int info2, int return_code=1); void DontDie(std::string message, int flag_err, int info1, int info2); std::vector fHitPMTs; int nPMTs; }; } // namespace RAT #endif