#include <FillHistBase.h>
Public Member Functions | |
FillHistBase (const char *module_name, modules::options *opts=NULL, TSetupData *setup=NULL) | |
Constructor of a module class. Provides several virtual methods that should be overloaded in the derived class. Derived classes should hard-code their name as the first argument to the constructor. | |
virtual | ~FillHistBase () |
int | ProcessGenericEntry (TGlobalData *gData, TSetupData *gSetup) |
virtual int | BeforeFirstEntry (TGlobalData *gData, TSetupData *setup) |
virtual int | AfterLastEntry (TGlobalData *gData, TSetupData *setup) |
void | SetAlias (const std::string &alias) |
std::string | GetAlias () const |
const char * | GetName () const |
Get the name of this module as given to the constructor of the base class. | |
Protected Member Functions | |
bool | Debug () const |
Protected Attributes | |
TDirectory * | dir |
TSetupData * | fSetup |
Private Member Functions | |
virtual int | ProcessEntry (TGlobalData *gData, TSetupData *gSetup) |
The big kahuna. Overload this in the derived class and it will be called for each event. | |
Private Attributes | |
bool | fDebug |
std::string | fAlias |
Base class for a generic analysis module. Provides several virtual methods for the derived class to overload. Also sets up a directory where all histograms and other ROOT objects created by the module will be saved in the output root file.
Definition at line 17 of file FillHistBase.h.
FillHistBase::FillHistBase | ( | const char * | module_name, | |
modules::options * | opts = NULL , |
|||
TSetupData * | setup = NULL | |||
) |
Constructor of a module class. Provides several virtual methods that should be overloaded in the derived class. Derived classes should hard-code their name as the first argument to the constructor.
module_name | The name of the module | |
opts | Options given to the module from the modules file | |
setup | [To be removed soon] |
Definition at line 5 of file FillHistBase.cpp.
References dir, fDebug, modules::options::GetBool(), modules::options::GetOption(), and modules::options::HasOption().
00005 : 00006 fSetup(setup),fDebug(false){ 00007 if(opts){ 00008 fDebug=(opts->HasOption("debug") && (opts->GetOption("debug").empty() || opts->GetBool("debug"))); 00009 //std::cout<<"Should we debug module: "<<HistogramDirectoryName<<": "<<(fDebug?"yes":"no")<<std::endl; 00010 } 00011 dir = gDirectory->mkdir(HistogramDirectoryName); 00012 dir->cd(); 00013 }
FillHistBase::~FillHistBase | ( | ) | [virtual] |
Definition at line 15 of file FillHistBase.cpp.
virtual int FillHistBase::AfterLastEntry | ( | TGlobalData * | gData, | |
TSetupData * | setup | |||
) | [inline, virtual] |
Optional method which is called once after the main event loop Can be used to dump a summary or finalise a histogram
Reimplemented in PulseViewer.
Definition at line 44 of file FillHistBase.h.
virtual int FillHistBase::BeforeFirstEntry | ( | TGlobalData * | gData, | |
TSetupData * | setup | |||
) | [inline, virtual] |
Optional method which is called once before the main event loop Can be used to parse options and setup histograms.
Reimplemented in ExportPulse, PulseViewer, MakeAnalysedPulses, MakeDetectorPulses, and MakeMuonEvents.
Definition at line 39 of file FillHistBase.h.
bool FillHistBase::Debug | ( | ) | const [inline, protected] |
Check whether this module was asked to print extra debug information
Definition at line 60 of file FillHistBase.h.
References fDebug.
Referenced by MakeAnalysedPulses::AddGenerator(), ExportPulse::AddToExportList(), PulseViewer::AfterLastEntry(), MakeMuonEvents::BeforeFirstEntry(), PulseViewer::ConsiderDrawing(), MakeDetectorPulses::MakeGenerator(), ExportPulse::PlotTPI(), MakeAnalysedPulses::ProcessEntry(), and PulseViewer::ProcessEntry().
00060 {return fDebug;};
std::string FillHistBase::GetAlias | ( | ) | const [inline] |
Returns a string for the alias of this module. May be empty if no alias was given in the modules file.
Definition at line 52 of file FillHistBase.h.
References fAlias.
00052 {return fAlias;};
const char* FillHistBase::GetName | ( | ) | const [inline] |
Get the name of this module as given to the constructor of the base class.
Definition at line 55 of file FillHistBase.h.
References dir.
Referenced by PlotTime::ProcessEntry(), and PlotAmplitude::ProcessEntry().
00055 {return dir->GetName();};
int FillHistBase::ProcessEntry | ( | TGlobalData * | gData, | |
TSetupData * | gSetup | |||
) | [private, virtual] |
The big kahuna. Overload this in the derived class and it will be called for each event.
gData | Pointer to current map of all TPIs [ WILL CHANGE SHORTLY ] | |
gSetup | Pointer to TSetupData for this run [ WILL CHANGE SHORTLY ] |
Reimplemented in ExportPulse, PlotAmplitude, PlotAmpVsTDiff, PlotTime, PulseViewer, MakeAnalysedPulses, MakeTemplate, MakeDetectorPulses, and MakeMuonEvents.
Definition at line 19 of file FillHistBase.cpp.
Referenced by ProcessGenericEntry().
int FillHistBase::ProcessGenericEntry | ( | TGlobalData * | gData, | |
TSetupData * | gSetup | |||
) |
Method called by the main event loop for each entry in the input root tree. Does some simple work, then hooks into the derived class through ProcessEntry.
Definition at line 24 of file FillHistBase.cpp.
References dir, and ProcessEntry().
00024 { 00025 // This is called by our main routine and would allow later to split into different 00026 // process routines if we have more than one Tree and hence different tpyes of data input. 00027 00028 if(dir) dir->cd(); 00029 int ret = ProcessEntry(gData, gSetup); 00030 gDirectory->cd("/"); 00031 00032 return ret; 00033 }
void FillHistBase::SetAlias | ( | const std::string & | alias | ) | [inline] |
Sets the alias for this module, which should be provided in the modules file
Definition at line 48 of file FillHistBase.h.
References fAlias.
Referenced by modules::factory::createModule().
00048 {fAlias=alias;};
TDirectory* FillHistBase::dir [protected] |
Definition at line 73 of file FillHistBase.h.
Referenced by ExportPulse::ExportPulse(), FillHistBase(), GetName(), MakeAnalysedPulses::MakeAnalysedPulses(), MakeMuonEvents::MakeMuonEvents(), PlotAmplitude::PlotAmplitude(), PlotAmpVsTDiff::PlotAmpVsTDiff(), PlotTime::PlotTime(), and ProcessGenericEntry().
std::string FillHistBase::fAlias [private] |
Definition at line 78 of file FillHistBase.h.
Referenced by GetAlias(), and SetAlias().
bool FillHistBase::fDebug [private] |
Definition at line 77 of file FillHistBase.h.
Referenced by Debug(), and FillHistBase().
TSetupData* FillHistBase::fSetup [protected] |
Reimplemented in ExportPulse.
Definition at line 74 of file FillHistBase.h.