//////////////////////////////////////////////////////////////////// /// \class RAT::AtmosphericCut /// /// \brief Flags the atmospheric event using the michel tag /// /// \author Tanner Kaptanoglu /// \contact Tanner Kaptanoglu /// /// REVISION HISTORY:\n /// 26 Aug 2017 : Tanner Kaptanoglu - first version /// /// \details This cut will tag any high nhit events with few /// owl hits that have an additonal high nhit event /// close in time. The first pass is designed to /// identify the atmospheric event and the second /// pass is designed to cut for some time after the /// atmospheric to remove potential followers (including /// the Michel electrons) from the dataset. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_AtmosphericCut__ #define __RAT_AtmosphericCut__ #include #include #include #include #include namespace RAT { class AtmosphericCut : public DataCleaningProc { public: AtmosphericCut() : DataCleaningProc("atmospheric",1){}; virtual ~AtmosphericCut(){}; virtual Processor::Result DSEvent(DS::Run& run, DS::Entry& ds); void BeginOfRun(DS::Run& run); void EndOfRun(DS::Run& run); protected: virtual Processor::Result Event(DS::Entry& ds, DS::EV& ev); double TimeDiff(DS::UniversalTime time_a, DS::UniversalTime time_b); double TimeDiff(DS::UniversalTime time, unsigned int day, unsigned int sec, unsigned int nsec); std::vector fEventStore; ///< stores gtids of events to be flagged std::vector fDaysTimeStore; ///< stores day of events to be flagged std::vector fSecsTimeStore; ///< stores seconds of events to be flagged std::vector fNSecsTimeStore; ///< stores nano-seconds of events to be flagged std::vector fFollowerCountStore; ///< stores the follower count of events to be flagged int fLastEventStore; ///< storess gtid of last atmospheric int fLastDayStore; ///< stores day of last atmospheric int fLastSecStore; ///< stores seconds of last atmospheric int fLastNSecStore; ///< stores nano-seconds of last atmospheric unsigned int fNhitMin; ///< min nhit for an atmospheric unsigned int fOwlNhitMax; ///< max owl nhit for an atmospheric unsigned int fSecondaryNhitMin; ///< min nhit for michel electron follower unsigned int fFollowerCount; ///< count the number of followers in the follower window double fFlatTacCut; ///< cut on the spread on the TAC (for flat TAC events) double fTimeWindow; ///< time window after high nhit event (ns) double fTimeDeadWindow; ///< time window after high nhit event with owls (ns) double fCutTimeWindow; ///< time window to cut after atmospherics (s) int fLastHighNHitGTID; ///< most recent high nhit event bool fInWindow; ///< indicates if you've recently seen a high nhit event bool fInDeadWindow; ///< indicated you've recently seen a high nhit event with several owls bool fFoundLastFile; ///< found the ratdb file indicating the last atmospheric in the previous run DS::UniversalTime fTimeOfLastHighNhit; ///< time of last high nhit event DS::UniversalTime fMuonTime; ///< time of potential muon event // A bunch of strings to specify the various DB table/column names // required by this cut std::string fDBName; ///< name of RATDB/JSON file to load/save info std::string fLastDBName; ///< name of the RATDB/JSON file to load/save info std::string fDBTableName; ///< name of table used by this cut std::string fLastDBTableName; ///< name of table used for last atmospheric in the run std::string fDBGTIDColumnName; ///< name of column that stores relevant gtids std::string fDBDaysColumnName; ///< name of column that stores days for relevant events std::string fDBSecondsColumnName; ///< name of column that stores seconds of relevant events std::string fDBNanoSecondsColumnName; ///< name of column that stores seconds of relevant events std::string fNumberOfFollowersName; ///< name of column that stores number of followers std::string fLastGTIDName; ///< name of column that stores the gtid of the last atmospheric in the run std::string fLastDayName; ///< name of column that stores the day of the last atmospheric in the run std::string fLastSecName; ///< name of column that stores the sec of the last atmospheric in the run std::string fLastNsecName; ///< name of column that stores the nsec of the last atmospheric in the run }; } // namespace RAT #endif