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

A base class for classes which specify how to set up an Analysis format output tree, and fill it. More...

#include <TAnalysisModuleBase.hxx>

+ Inheritance diagram for ND::TAnalysisModuleBase:
+ Collaboration diagram for ND::TAnalysisModuleBase:

Public Member Functions

 TAnalysisModuleBase ()
 
virtual ~TAnalysisModuleBase ()
 
virtual Bool_t Configure (std::string &option)
 A function that allows the module to be configured from an external class without any dependencies. More...
 
virtual void FillConfigTree (TTree *)
 
Int_t GetBufferSize ()
 ROOT output parameters, usually no need to touch. More...
 
std::string const GetCVSID () const
 
std::string const GetCVSTagName () const
 
std::string const GetDescription () const
 
std::string const GetDirectoryName () const
 Returns the name of the directory which the output of a particular module will be saved in. More...
 
char const * GetName ()
 
TTree const * GetOutputTree () const
 The output tree. More...
 
Int_t GetSplitLevel ()
 ROOT output parameters, usually no need to touch. More...
 
char const * GetTitle ()
 
virtual EType GetTreeType () const =0
 Returns the type of tree, header, truth, or recon. More...
 
void Initialize (TTree *tree)
 
virtual Bool_t IsEnabled () const
 Whether the module is enable or not. More...
 
virtual Bool_t IsEnabledByDefault () const
 Is the module is enabled by default. More...
 
virtual bool IsFullEventWorthSaving (ND::TND280Event &event)
 Whether the module thinks it is worth saving the entire oaEvent event tree entry for this event. More...
 
virtual Bool_t IsUsedForPreselection () const
 Whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output. More...
 
void KillOutputTree ()
 
virtual void Print ()
 Prints a simple message describing the module. More...
 
virtual bool Process (ND::TND280Event &event)
 Gets the run and event IDs and calls FillTree with the event, and then actually calls fOutputTree->Fill. More...
 
virtual Bool_t ProcessFirstEvent (ND::TND280Event &)=0
 Is called after the first event is loaded in. More...
 
virtual void SayAvailableOpts (std::string indent="")
 Subclasses should override this to let a user know what options are available. More...
 
void SetBufferSize (Int_t buffersize)
 ROOT output parameters, usually no need to touch. More...
 
virtual void SetDisabled ()
 Disables the module. More...
 
virtual void SetEnabled (Bool_t isenabled=true)
 Sets whether the module is enabled. More...
 
void SetInputDirectory (std::string dir)
 
void SetNameTitle (char const *name, char const *title)
 
void SetSplitLevel (Int_t splitlevel)
 ROOT output parameters, usually no need to touch. More...
 
virtual void SetUsedForPreselection (Bool_t isused=true)
 Sets whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output. More...
 

Protected Types

enum  EType {
  kHeader = 0, kTruth, kRecon, kLowLevel,
  kNTypes
}
 

Protected Member Functions

virtual bool FillTree (ND::TND280Event &)=0
 Fill all the stuff that goes in the output tree. More...
 
virtual void InitializeBranches ()=0
 Initialize Branches. Don't do anything else in this function. More...
 
virtual void InitializeModule ()
 Initialize Module, override if necessary. More...
 

Protected Attributes

Int_t fBufferSize
 Buffer Size for TBranch. More...
 
std::string fCVSID
 Defined if an official tagged version. More...
 
std::string fCVSTagName
 Defined if an official tagged version. More...
 
std::string fDescription
 A longish descrition of the analysis. More...
 
Int_t fEventID
 
Bool_t fFilledConfigTree
 
std::string fInputDirectory
 An input directory where analysis modules can search for extra files. More...
 
Bool_t fIsEnabled
 
Bool_t fIsMC
 
Bool_t fIsUsedForPreselection
 
std::string fName
 
TTree * fOutputTree
 
Int_t fPreselected
 
Int_t fRunID
 
Int_t fSplitLevel
 Split Level for TBranch. More...
 
Int_t fSubrunID
 
std::string fTitle
 

Detailed Description

A base class for classes which specify how to set up an Analysis format output tree, and fill it.

These classes will be read in and run by the eventAnalysis package software, namely by TAnalysisLoop. The classes must be accompanied by tests to check that they work, and runtime tests to see if they are appropriate for the input root files being used.

A note on naming of data members in analysis modules classes and their sub-classes:

The names of members belonging to the modules themselves all start with an 'f', to indicate that they are fields in the classes. These names are used in coding up the modules, so it is better that they follow the convention.

The members of storages sub-classes to the modules, which get saved in TTrees within TClonesArrays, DO NOT get an 'f' at the beginning, because they represent names that get used directly in analysis macros. This was always implemented consistently.

The modules themselves get saved in the output files, including their data members (except those with a comment with an exclamation mark "//!" after them, which tells ROOT not to save them). These can be accessed in the analysis macros, but since they are explicitly members of the module classes, it is consistent to have them start with 'f' too.

Definition at line 44 of file TAnalysisModuleBase.hxx.

Member Enumeration Documentation

Enumerator
kHeader 
kTruth 
kRecon 
kLowLevel 
kNTypes 

Definition at line 54 of file TAnalysisModuleBase.hxx.

Constructor & Destructor Documentation

ND::TAnalysisModuleBase::TAnalysisModuleBase ( )

Definition at line 4 of file TAnalysisModuleBase.cxx.

ND::TAnalysisModuleBase::~TAnalysisModuleBase ( )
virtual

Definition at line 15 of file TAnalysisModuleBase.cxx.

Member Function Documentation

Bool_t ND::TAnalysisModuleBase::Configure ( std::string &  option)
virtual

A function that allows the module to be configured from an external class without any dependencies.

Should be overridden with a function that responds to the string option, and returns true if configuration succedded. Used in TAnalysisLoop.cxx (and RunEventAnalysis.exe) for options of the form: -O TTruthTrajectoriesModule=SaveAll

Reimplemented in ND::TTrackerECALReconModule::OutputManager, ND::TGlobalReconModule, ND::TBeamSummaryDataModule, ND::TTruthTrajectoriesModule, ND::TBasicHeaderModule, and ND::TTagsModule.

Definition at line 17 of file TAnalysisModuleBase.cxx.

Int_t ND::TAnalysisModuleBase::GetBufferSize ( )

ROOT output parameters, usually no need to touch.

Definition at line 123 of file TAnalysisModuleBase.hxx.

References fBufferSize.

std::string const ND::TAnalysisModuleBase::GetCVSID ( ) const

Definition at line 136 of file TAnalysisModuleBase.hxx.

References fCVSID.

std::string const ND::TAnalysisModuleBase::GetCVSTagName ( ) const

Definition at line 135 of file TAnalysisModuleBase.hxx.

References fCVSTagName.

std::string const ND::TAnalysisModuleBase::GetDescription ( ) const

Definition at line 134 of file TAnalysisModuleBase.hxx.

References fDescription.

std::string const ND::TAnalysisModuleBase::GetDirectoryName ( ) const

Returns the name of the directory which the output of a particular module will be saved in.

Definition at line 22 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

TTree const* ND::TAnalysisModuleBase::GetOutputTree ( ) const

The output tree.

Definition at line 139 of file TAnalysisModuleBase.hxx.

References fOutputTree.

Int_t ND::TAnalysisModuleBase::GetSplitLevel ( )

ROOT output parameters, usually no need to touch.

Definition at line 129 of file TAnalysisModuleBase.hxx.

References fSplitLevel.

char const * ND::TAnalysisModuleBase::GetTitle ( )

Definition at line 118 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

virtual EType ND::TAnalysisModuleBase::GetTreeType ( ) const
pure virtual

Returns the type of tree, header, truth, or recon.

This is overridden in the derived base classes such as TAnalysisReconModuleBase, so users do not need to override it explicitly

Implemented in ND::TP0DReconModule, ND::TSFGReconModule, ND::TLowLevelInfoModule, ND::TAnalysisHeaderModuleBase, ND::TAnalysisReconModuleBase, and ND::TAnalysisTruthModuleBase.

void ND::TAnalysisModuleBase::Initialize ( TTree *  tree)

Definition at line 37 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

virtual Bool_t ND::TAnalysisModuleBase::IsEnabled ( ) const
virtual

Whether the module is enable or not.

Definition at line 84 of file TAnalysisModuleBase.hxx.

References fIsEnabled.

Referenced by ND::TAnalysisLoop::Initialize(), and ND::TAnalysisLoop::operator()().

virtual Bool_t ND::TAnalysisModuleBase::IsEnabledByDefault ( ) const
virtual
bool ND::TAnalysisModuleBase::IsFullEventWorthSaving ( ND::TND280Event &  event)
virtual

Whether the module thinks it is worth saving the entire oaEvent event tree entry for this event.

eventAnalysis can be used for event pre-selection in this way. Activated with the –oaEvent-preselection=<moduleclass>> command- line argument

Reimplemented in ND::TTrackerECALReconModule::OutputManager, ND::TReconPerformanceEvalModule, and ND::TTRExReconModule.

Definition at line 90 of file TAnalysisModuleBase.cxx.

virtual Bool_t ND::TAnalysisModuleBase::IsUsedForPreselection ( ) const
virtual

Whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output.

Definition at line 93 of file TAnalysisModuleBase.hxx.

References fIsUsedForPreselection.

Referenced by ND::TAnalysisLoop::Initialize(), and ND::TAnalysisLoop::operator()().

void ND::TAnalysisModuleBase::KillOutputTree ( )

Definition at line 140 of file TAnalysisModuleBase.hxx.

References fOutputTree.

void ND::TAnalysisModuleBase::Print ( )
virtual

Prints a simple message describing the module.

Should be overridden for more detail

Definition at line 99 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

bool ND::TAnalysisModuleBase::Process ( ND::TND280Event &  event)
virtual

Gets the run and event IDs and calls FillTree with the event, and then actually calls fOutputTree->Fill.

Definition at line 77 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::operator()().

Bool_t ND::TAnalysisModuleBase::ProcessFirstEvent ( ND::TND280Event &  )
pure virtual

Is called after the first event is loaded in.

This is a good time to save persistent quantities in the module's data members, which will be retrievable from the eventAnalysis output file. Not intended for filling in the tree with the first event, as Process() will also be called.

Implemented in ND::TP0DReconModule, ND::TTrackerECALReconModule::OutputManager, ND::TGlobalReconModule, ND::TReconPerformanceEvalModule, ND::TTrackerReconModule, ND::TSmrdReconModule, ND::TP0DECALReconModule, ND::TFgdOnlyModule, ND::TTRExReconModule, ND::TBeamSummaryDataModule, ND::TTruthTrajectoriesModule, ND::TGeometrySummaryModule, ND::TSFGReconModule, ND::TRooTrackerVtxModuleBase, ND::TTruthVerticesModule, ND::TBasicDataQualityModule, ND::TBasicHeaderModule, ND::TTagsModule, ND::TLowLevelInfoModule, and ND::TECALTestbeamModule.

Definition at line 95 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::operator()().

virtual void ND::TAnalysisModuleBase::SayAvailableOpts ( std::string  indent = "")
virtual

Subclasses should override this to let a user know what options are available.

Reimplemented in ND::TTrackerECALReconModule::OutputManager, ND::TGlobalReconModule, ND::TTagsModule, and ND::TBasicHeaderModule.

Definition at line 156 of file TAnalysisModuleBase.hxx.

void ND::TAnalysisModuleBase::SetBufferSize ( Int_t  buffersize)

ROOT output parameters, usually no need to touch.

Definition at line 126 of file TAnalysisModuleBase.hxx.

References fBufferSize.

virtual void ND::TAnalysisModuleBase::SetDisabled ( )
virtual

Disables the module.

Is called when an exception is thrown inside the module.

Definition at line 74 of file TAnalysisModuleBase.hxx.

References SetEnabled().

Referenced by ND::TAnalysisLoop::Initialize(), and ND::TAnalysisLoop::operator()().

virtual void ND::TAnalysisModuleBase::SetEnabled ( Bool_t  isenabled = true)
virtual

Sets whether the module is enabled.

This only refer to modules which have been included for consideration by being instantiated in TAnalysisLoop.cxx or similar.

Definition at line 70 of file TAnalysisModuleBase.hxx.

References fIsEnabled.

Referenced by ND::TAnalysisLoop::Initialize(), SetDisabled(), and ND::TAnalysisLoop::SetOption().

void ND::TAnalysisModuleBase::SetInputDirectory ( std::string  dir)

Definition at line 158 of file TAnalysisModuleBase.hxx.

References fInputDirectory.

void ND::TAnalysisModuleBase::SetSplitLevel ( Int_t  splitlevel)

ROOT output parameters, usually no need to touch.

Definition at line 132 of file TAnalysisModuleBase.hxx.

References fSplitLevel.

Referenced by ND::TTrackerReconModule::InitializeBranches(), ND::TGlobalReconModule::InitializeBranches(), and ND::TP0DECALReconModule::TP0DECALReconModule().

virtual void ND::TAnalysisModuleBase::SetUsedForPreselection ( Bool_t  isused = true)
virtual

Sets whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output.

Definition at line 79 of file TAnalysisModuleBase.hxx.

References fIsUsedForPreselection.

Referenced by ND::TAnalysisLoop::SetOption().

Member Data Documentation

Int_t ND::TAnalysisModuleBase::fEventID
protected

Definition at line 198 of file TAnalysisModuleBase.hxx.

Bool_t ND::TAnalysisModuleBase::fFilledConfigTree
protected
std::string ND::TAnalysisModuleBase::fInputDirectory
protected

An input directory where analysis modules can search for extra files.

Definition at line 201 of file TAnalysisModuleBase.hxx.

Referenced by SetInputDirectory().

Bool_t ND::TAnalysisModuleBase::fIsUsedForPreselection
protected

Definition at line 178 of file TAnalysisModuleBase.hxx.

Referenced by IsUsedForPreselection(), and SetUsedForPreselection().

std::string ND::TAnalysisModuleBase::fName
protected

Definition at line 203 of file TAnalysisModuleBase.hxx.

Int_t ND::TAnalysisModuleBase::fPreselected
protected

Definition at line 199 of file TAnalysisModuleBase.hxx.

Int_t ND::TAnalysisModuleBase::fRunID
protected

Definition at line 196 of file TAnalysisModuleBase.hxx.

Int_t ND::TAnalysisModuleBase::fSubrunID
protected

Definition at line 197 of file TAnalysisModuleBase.hxx.

std::string ND::TAnalysisModuleBase::fTitle
protected

Definition at line 204 of file TAnalysisModuleBase.hxx.


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