//////////////////////////////////////////////////////////////////// /// \class RAT::PedCut /// /// \brief Flags events that took place within 1 second of a pedestal event /// /// \author Eric Marzec /// \contact Eric Marzec /// /// REVISION HISTORY:\n /// 20 Dec 2017 : Eric Marzec - First version /// \details This is a data cleaning cut for flagging events between and /// around pedestal evens. Nominally it will flag all events within one /// second (before or after) a pedestal event. Though the exact time window /// can be changed via ratdb file /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_PedCut__ #define __RAT_PedCut__ #include #include #include #include namespace RAT { class PedCut : public DataCleaningProc { public: PedCut() : DataCleaningProc("pedcut",1){}; virtual ~PedCut(){}; virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); void BeginOfRun(DS::Run&); void EndOfRun(DS::Run& run); protected: double fLastPedestalTime; // Time at which the last pedestal event ocurred double fTimeWindow; // Length of time before & after pedestals to flag events unsigned int fCounter; // Counter of how many "pedestal windows" have been processed bool fInWindow; // Indicates if the previous event was in a "pedestal window" or not std::vector fInitialPedestalTimes; // array of start times for pedestal windows std::vector fFinalPedestalTimes; // array of end times for pedestal windows virtual Processor::Result Event(DS::Entry& ds, DS::EV& ev); // Processes a single EV std::string fDBName; // Name of file that pass 1 results should be saved to std::string fDBTableName; // Name of DB table that results should saved to or taken from std::string fDBInitialTimeColumnName; // Column name to store ped window start times std::string fDBFinalTimeColumnName; // Column name to store ped window end times }; } // namespace RAT #endif