#include #include #include #include #include #include #include "IAnalysisModuleBase.hxx" #include "IGRooTrackerVtxModule.hxx" #include "INRooTrackerVtxModule.hxx" namespace COMET { class IAnalysisLoop; OA_EXCEPTION(EProductionException, EoaAnalysis); } /// Generate an analysis tree to summarize the event reconstruction. This /// should be replaced by the general oaAnalysis tree, but that's not ready. class COMET::IAnalysisLoop: public COMET::ICOMETEventLoopFunction { public: /// Initialize any class specific variables, but most of the work can be /// done in Initialize. Don't create histograms here! IAnalysisLoop(); virtual ~IAnalysisLoop(); /// Print a usage message. This is generally called when there is a /// command line input error. void Usage(void); /// Set an option and return true if it is valid. This is called by the /// event loop command line argument processing code for each "-O /// [name]=[value]" option found on the command line. If the command line /// has "-O [name]" without a value, then the value string will be equal /// to "". This must return false if the option was not correctly /// processed. virtual bool SetOption(std::string,std::string); /// Called for each event inside the event loop, and returns true if the /// event should be saved to the output file. If the remainder of the /// current file should be skipped, this should through the /// ENextEventLoopFile exception. bool operator () (COMET::ICOMETEvent& event); /// Called after the arguments are processes by before reading the first /// event. The output file is open so any histograms will be added to the /// output file. virtual void Initialize(void); /// Called before the first event of a file is read, but you should prefer /// Initialize() for general initialization. This method will be called /// once for each input file. virtual void BeginFile(COMET::IVInputFile *input); /// Called after the last event of a file is read, but you should prefer /// Finalize() for general finalization. This method will be called once /// for each input file. virtual void EndFile(COMET::IVInputFile *); /// Called after reading the last event. The output file is still open, /// so you can add extra information. Because of an idiosyncrasy in the /// way root handles histograms, objects created in Initialize() will /// already be stored in the output file. virtual void Finalize(COMET::ICOMETOutput* const output); private: /// Mehod to set the the default enable/disable values for all modules /// in fAnalysisModules list. void SetModuleDefaults(); /// Keep track of the events that have been read. int fEventCount; /// Flag if the full event (not the analysis format) is also to be saved /// This overrides any -preselection= settings bool fSaveOriginalFullEvent; /// Set automatically if the oaEvent tree needs to be saved in output /// file. bool fSaveOutputOaEventTree; /// Internal list of all modules. std::list fAnalysisModules; /// Store whether a module has been set to disabled/enables by user /// as well as whether the disable/enable all options have been set. /// fUserEnabled overrides fDisableAll and fDisableAll overrides /// fEnableAll. std::map fUserEnabled; ///< This overrides fDisable(Enable)All. bool fDisableAll; ///< This overrides fEnableAll. bool fEnableAll; // Booleans to control production mode bool fProduction; bool fExit; IGRooTrackerVtxModule *fGRooTracker; INRooTrackerVtxModule *fNRooTracker; };