eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ND::TAnalysisLoop Class Reference

Generate an analysis tree to summarize the event reconstruction. More...

#include <TAnalysisLoop.hxx>

+ Inheritance diagram for ND::TAnalysisLoop:
+ Collaboration diagram for ND::TAnalysisLoop:

Public Member Functions

 TAnalysisLoop ()
 Initialize any class specific variables. More...
 
virtual ~TAnalysisLoop ()
 
virtual void BeginFile (ND::TVInputFile *input)
 Called before the first event of a file is read, but you should prefer TAnalysisLoop::Initialize for general initialization. More...
 
virtual void EndFile (ND::TVInputFile *)
 Called after the last event of a file is read, but you should prefer TAnalysisLoop: Finalize() for general finalization. More...
 
virtual void Finalize (ND::TND280Output *const output)
 
virtual void Initialize (void)
 Called after the arguments are processes by before reading the first event. More...
 
bool operator() (ND::TND280Event &event)
 Called for each event inside the event loop, and returns true if the event should be saved to the output file. More...
 
virtual bool SetOption (std::string, std::string)
 Set an option and return true if it is valid. More...
 
void Usage (void)
 Print a usage message. More...
 

Private Types

typedef std::vector
< ModDescriptor >
::const_iterator 
CModDescripterator
 Private typedef which makes talking to fAnalysisModules slightly nicer. More...
 
typedef std::vector
< ModDescriptor >::iterator 
ModDescripterator
 Private typedef which makes talking to fAnalysisModules slightly nicer. More...
 
typedef std::pair< std::string,
ND::TAnalysisModuleBase * > 
ModDescriptor
 Private typedef which makes talking to fAnalysisModules slightly nicer. More...
 

Private Member Functions

ModDescripterator FindNamedModule (std::vector< TAnalysisLoop::ModDescriptor > &ModMap, std::string ModuleName)
 Searches through TAnalysisLoop::fAnalysisModules for a street module named Bob. More...
 
CModDescripterator FindNamedModule (std::vector< TAnalysisLoop::ModDescriptor > const &ModMap, std::string ModuleName)
 Searches through TAnalysisLoop::fAnalysisModules for a street module named Bob. More...
 
void SetModuleDefaults ()
 Method to set the the default enable/disable values for all modules in fAnalysisModules map. More...
 

Private Attributes

std::vector< ModDescriptorfAnalysisModules
 Internal map of all modules. More...
 
bool fDisableAll
 This is overridden by fEnableAll. More...
 
bool fEnableAll
 Enables All modules, if a given module isn't disabled in fUserEnabled. More...
 
int fEventCount
 Keep track of the events that have been read. More...
 
bool fExit
 If set to true during execution will result in execution termination at the end of the next event. More...
 
TGeoManager * fGeom
 The ND280 geometry to be saved. More...
 
bool fGeometry
 Flag to control saving ND280 geometry. More...
 
bool fProduction
 Controls production mode. More...
 
bool fSaveOriginalFullEvent
 Flag if the full event (not the analysis format) is also to be saved This overrides any -preselection=<<moduleclass>> settings. More...
 
bool fSaveOutputOaEventTree
 Set automatically if the oaEvent tree needs to be saved in output file. More...
 
std::map< std::string, bool > fUserEnabled
 Store whether a module has been set to disabled/enables by user as well as whether the disable/enable all options have been set. More...
 
bool fValidation
 Control validation mode. More...
 

Detailed Description

Generate an analysis tree to summarize the event reconstruction.

This should be replaced by the general eventAnalysis tree, but that's not ready.

Definition at line 30 of file TAnalysisLoop.hxx.

Member Typedef Documentation

typedef std::vector<ModDescriptor>::const_iterator ND::TAnalysisLoop::CModDescripterator
private

Private typedef which makes talking to fAnalysisModules slightly nicer.

Definition at line 92 of file TAnalysisLoop.hxx.

typedef std::vector<ModDescriptor>::iterator ND::TAnalysisLoop::ModDescripterator
private

Private typedef which makes talking to fAnalysisModules slightly nicer.

Definition at line 90 of file TAnalysisLoop.hxx.

typedef std::pair<std::string, ND::TAnalysisModuleBase*> ND::TAnalysisLoop::ModDescriptor
private

Private typedef which makes talking to fAnalysisModules slightly nicer.

Definition at line 88 of file TAnalysisLoop.hxx.

Constructor & Destructor Documentation

ND::TAnalysisLoop::TAnalysisLoop ( )

Initialize any class specific variables.

Most of the work can be done in ND::TAnalysisLoop::Initialize.

Warning
Don't create histograms here!

Definition at line 65 of file TAnalysisLoop.cxx.

References fAnalysisModules, and SetModuleDefaults().

ND::TAnalysisLoop::~TAnalysisLoop ( )
virtual

Definition at line 121 of file TAnalysisLoop.cxx.

Member Function Documentation

void ND::TAnalysisLoop::BeginFile ( ND::TVInputFile *  input)
virtual

Called before the first event of a file is read, but you should prefer TAnalysisLoop::Initialize for general initialization.

This method will be called once for each input file.

Definition at line 514 of file TAnalysisLoop.cxx.

References fAnalysisModules, and FindNamedModule().

void ND::TAnalysisLoop::EndFile ( ND::TVInputFile *  )
virtual

Called after the last event of a file is read, but you should prefer TAnalysisLoop: Finalize() for general finalization.

This method will be called once for each input file.

Definition at line 538 of file TAnalysisLoop.cxx.

TAnalysisLoop::ModDescripterator ND::TAnalysisLoop::FindNamedModule ( std::vector< TAnalysisLoop::ModDescriptor > &  ModMap,
std::string  ModuleName 
)
private

Searches through TAnalysisLoop::fAnalysisModules for a street module named Bob.

Returns
std::vector::end if none is found.

Definition at line 643 of file TAnalysisLoop.cxx.

Referenced by BeginFile(), operator()(), and SetOption().

TAnalysisLoop::CModDescripterator ND::TAnalysisLoop::FindNamedModule ( std::vector< TAnalysisLoop::ModDescriptor > const &  ModMap,
std::string  ModuleName 
)
private

Searches through TAnalysisLoop::fAnalysisModules for a street module named Bob.

Returns
std::vector::end if none is found.

Definition at line 631 of file TAnalysisLoop.cxx.

bool ND::TAnalysisLoop::operator() ( ND::TND280Event &  event)
void ND::TAnalysisLoop::SetModuleDefaults ( )
private

Method to set the the default enable/disable values for all modules in fAnalysisModules map.

Definition at line 624 of file TAnalysisLoop.cxx.

References fAnalysisModules.

Referenced by TAnalysisLoop().

bool ND::TAnalysisLoop::SetOption ( std::string  option,
std::string  value 
)
virtual

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.

Definition at line 165 of file TAnalysisLoop.cxx.

References fAnalysisModules, fDisableAll, fEnableAll, fGeometry, FindNamedModule(), fProduction, fSaveOriginalFullEvent, fSaveOutputOaEventTree, fUserEnabled, fValidation, ND::TAnalysisModuleBase::SetEnabled(), and ND::TAnalysisModuleBase::SetUsedForPreselection().

void ND::TAnalysisLoop::Usage ( void  )

Print a usage message.

Note
This is generally called when there is a command line input error.

Definition at line 123 of file TAnalysisLoop.cxx.

References fAnalysisModules.

Member Data Documentation

std::vector<ModDescriptor> ND::TAnalysisLoop::fAnalysisModules
private

Internal map of all modules.

Definition at line 126 of file TAnalysisLoop.hxx.

Referenced by BeginFile(), Finalize(), Initialize(), operator()(), SetModuleDefaults(), SetOption(), TAnalysisLoop(), and Usage().

bool ND::TAnalysisLoop::fDisableAll
private

This is overridden by fEnableAll.

Definition at line 135 of file TAnalysisLoop.hxx.

Referenced by Initialize(), and SetOption().

bool ND::TAnalysisLoop::fEnableAll
private

Enables All modules, if a given module isn't disabled in fUserEnabled.

Definition at line 138 of file TAnalysisLoop.hxx.

Referenced by Initialize(), and SetOption().

int ND::TAnalysisLoop::fEventCount
private

Keep track of the events that have been read.

Definition at line 115 of file TAnalysisLoop.hxx.

Referenced by Finalize(), and operator()().

bool ND::TAnalysisLoop::fExit
private

If set to true during execution will result in execution termination at the end of the next event.

Definition at line 144 of file TAnalysisLoop.hxx.

Referenced by operator()().

TGeoManager* ND::TAnalysisLoop::fGeom
private

The ND280 geometry to be saved.

Definition at line 150 of file TAnalysisLoop.hxx.

Referenced by Finalize(), and operator()().

bool ND::TAnalysisLoop::fGeometry
private

Flag to control saving ND280 geometry.

Definition at line 152 of file TAnalysisLoop.hxx.

Referenced by Finalize(), and SetOption().

bool ND::TAnalysisLoop::fProduction
private

Controls production mode.

Definition at line 141 of file TAnalysisLoop.hxx.

Referenced by operator()(), and SetOption().

bool ND::TAnalysisLoop::fSaveOriginalFullEvent
private

Flag if the full event (not the analysis format) is also to be saved This overrides any -preselection=<<moduleclass>> settings.

Definition at line 119 of file TAnalysisLoop.hxx.

Referenced by operator()(), and SetOption().

bool ND::TAnalysisLoop::fSaveOutputOaEventTree
private

Set automatically if the oaEvent tree needs to be saved in output file.

Definition at line 123 of file TAnalysisLoop.hxx.

Referenced by Finalize(), and SetOption().

std::map<std::string, bool> ND::TAnalysisLoop::fUserEnabled
private

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 takes highest precidence over fDisableAll and fEnableAll.

Definition at line 132 of file TAnalysisLoop.hxx.

Referenced by Initialize(), and SetOption().

bool ND::TAnalysisLoop::fValidation
private

Control validation mode.

Definition at line 147 of file TAnalysisLoop.hxx.

Referenced by operator()(), and SetOption().


The documentation for this class was generated from the following files:

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:44:00 for eventAnalysis by doxygen 1.8.5