/*! * @file SSaffron.h * @author Dan Saunders, on behalf of the SoLid collaboration. * @date 16 Feb 2016 */ #ifndef SSaffron_h_ #define SSaffron_h_ // ROOT & Misc #include #include #include #include "SDetector/SDetector.h" #include "SClipboard/SClipboard.h" #include "TFile.h" #include #include #include // Algorithms. #include "algoHeaders.h" #include "SRunStatus/SRunStatus.h" //! Executes saffron. /*! The lower most level in saffron. This class controls the initialisation of * reconstruction objects, and their execution. Options are passed via this * class. Two other objects are introduced: a clipboard (SClipboard) for * passing objects between algorithms (analysis and/or reconsturction), and * an object for storing information about the current detector configuration * (SDetector). */ class SSaffron { private: //! Container for all execution algorithms for this run. /*! List is specified in options file. */ std::vector m_algorithms; //! See the clipboard getter cb() SClipboard * m_clipboard; //! See the detector getter dtr() SDetector * m_detector; //! See histosFile() TFile * m_histosFile; //! See histosFileName() std::string m_histosFileName; //! See scriptMode() bool m_scriptMode; //! See outputExtension() std::string m_outputExtension; //! See hCycleExecutionTime() TH1D * h_cycleExecutionTime; //! See nCycleLimit long long m_nCycleLimit; //! Total execution time taken for this saffron run (ms). double m_totExecutionTime; public: SSaffron(); ~SSaffron(); void prep(std::string opsFileName, std::vector * commandLineOps); void run(); void finish(); void prepClipBoard(); void prepDetector(); void prepHistosFile(); void evalConfigFile(std::string opsFileName); void evalConfigFileLine(std::string arg); void evalCommandLineOps(std::vector * commandLineOps); void appendAlgorithm(std::string algoName); void maskChannel(uint safChanIndex); void passAlgorithmOption(std::string algoOption); // Setters and getters _______________________________________________________ //! Clipboard for passing objects between algorithms. SClipboard * cb() {return m_clipboard;} //! Object for storing detector information. SDetector * dtr() {return m_detector;} //! Output histogram file. All histograms should be saved here. TFile * histosFile() {return m_histosFile;} //! Name of histogram output file. /*! Defaults to Saffron-histos.root. Can be specified in options file. An * extension for all output files can be specified using the OutputExtension * option - see outputExtension(). */ std::string histosFileName() {return m_histosFileName;} //! Extension to all output file names. /*! Default to nothing. Can be set in the options text file */ std::string outputExtension() {return m_outputExtension;} //! Distribution of algorithm execution time. TH1D * hCycleExecutionTime() {return h_cycleExecutionTime;} //! Upper limit on number of cycles to execute (can be set in options file). long long nCycleLimit() {return m_nCycleLimit;} //! Flag for script mode /* Initialize and execute functions are skipped - only finalize methods are * called */ bool scriptMode() {return m_scriptMode;} }; #endif /* SSaffron_h_ */