//////////////////////////////////////////////////////////////////// // // This processor creates RUN tables for a given set of files // This table contain critical information for processing and // data analysis, like the run type word or the run duration. // // Author: Javier Caravaca // // REVISION HISTORY: // 2017-09-12 : J Caravaca - Creation // //////////////////////////////////////////////////////////////////// #ifndef __RATProduceRunTableProc___ #define __RATProduceRunTableProc___ #include #include #include #include class TFile; class TTree; namespace RAT { class ProduceRunTableProc : public Processor { public: // Constructor, initialises pointers to NULL ProduceRunTableProc(); // Destructor, close file and finalise ~ProduceRunTableProc(){}; // Called when a procset string is set on the command line // // The option is, // `zdabs` which fills the vector with the processed zdab files // // param: parameter or command // value: value to set // Throws ParamUnknown if the param is not file or updatefile void SetS( const std::string& param, const std::string& value ); // Begin of run, load from the database // // run: Data structure for the run void BeginOfRun( DS::Run& run ); // New event, write it out // // run: Data structure for the run // ds: Data structure for the event Processor::Result DSEvent( DS::Run& /*run*/, DS::Entry& ds ); // End of run, write out the run // // run: Data structure for the run void EndOfRun( DS::Run& /*run*/ ); // Get run type word from DetectorDB void getRunTypeAndLengthFromDetectorDB(); // Check extracted times are not crazy void checkTimes(); // Print run features void printSummary(); // Set run start and stop times to invalid void setInvalidTimes(int log=0); private: double fStart_times[3]; /// Time of the first valid GTID double fStop_times[3]; /// Time of the last valid GTID int fFirstValidGTID; /// First valid GTID UInt_t fRunTypeWord; /// Run type word UInt_t fRunTypeWordDB; /// Run type word double fRunLength; /// Calculated Run length double fRunLengthDB; /// Run length as in DetectorDB int fRunNumber; /// Run number std::vector fZdabFilenames; /// Processed zdab files std::string fRunTableName; /// Name of the output file for the RUN table }; } // namespace RAT #endif