class THaAnalyzer: public TObject


 THaAnalyzer

 THaAnalyzer is the base class for a "Hall A analyzer" class.
 An analyzer defines the basic actions to perform during analysis.
 THaAnalyzer is the default analyzer that is used if no user class is
 defined.  It performs a standard analysis consisting of

   1. Decoding/Calibrating
   2. Track Reconstruction
   3. Physics variable processing

 At the end of each step, testing and histogramming are done for
 the appropriate block defined in the global test/histogram lists.


Function Members (Methods)

public:
THaAnalyzer()
virtual~THaAnalyzer()
voidTObject::AbstractMethod(const char* method) const
virtual Int_tAddPostProcess(THaPostProcess* module)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual voidClose()
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
voidEnableBenchmarks(Bool_t b = kTRUE)
voidEnableHelicity(Bool_t b = kTRUE)
voidEnableOtherEvents(Bool_t b = kTRUE)
voidEnableOverwrite(Bool_t b = kTRUE)
voidEnablePhysicsEvents(Bool_t b = kTRUE)
voidEnableRunUpdate(Bool_t b = kTRUE)
voidEnableScalers(Bool_t b = kTRUE)
voidEnableSlowControl(Bool_t b = kTRUE)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TList*GetApps() const
Int_tGetCompressionLevel() const
const char*GetCutFileName() const
THaEvData*GetDecoder() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
THaEvent*GetEvent() const
virtual const char*TObject::GetIconName() const
static THaAnalyzer*GetInstance()
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
const char*GetOdefFileName() const
virtual Option_t*TObject::GetOption() const
TFile*GetOutFile() const
const char*GetOutFileName() const
TList*GetPhysics() const
TList*GetPostProcess() const
TList*GetScalers() const
const char*GetSummaryFileName() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
Bool_tHasStarted() const
Bool_tHelicityEnabled() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual Int_tInit(THaRunBase* run)
Int_tInit(THaRunBase& run)
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
Bool_tOtherEventsEnabled() const
virtual voidTObject::Paint(Option_t* option = "")
Bool_tPhysicsEnabled() const
virtual voidTObject::Pop()
virtual voidPrint(Option_t* opt = "") const
virtual Int_tProcess(THaRunBase* run = 0)
Int_tProcess(THaRunBase& run)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
Bool_tScalersEnabled() const
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCompressionLevel(Int_t level)
virtual Int_tSetCountMode(Int_t mode)
voidSetCrateMapFileName(const char* name)
voidSetCutFile(const char* name)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetEvent(THaEvent* event)
voidSetMarkInterval(UInt_t interval)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetOdefFile(const char* name)
voidSetOutFile(const char* name)
voidSetSummaryFile(const char* name)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVerbosity(Int_t level)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
Bool_tSlowControlEnabled() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual Int_tBeginAnalysis()
voidClearCounters()
THaAnalyzer::Counter_t*DefineCounter(const THaAnalyzer::Counter_t* counter)
THaAnalyzer::Stage_t*DefineStage(const THaAnalyzer::Stage_t* stage)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual Int_tDoInit(THaRunBase* run)
virtual Int_tEndAnalysis()
virtual boolEvalStage(int n)
UInt_tGetCount(Int_t i) const
UInt_tIncr(Int_t i)
virtual voidInitCounters()
virtual voidInitCuts()
virtual Int_tInitModules(const TList* module_list, TDatime& time, Int_t erroff, const char* baseclass = 0)
virtual Int_tInitOutput(const TList* module_list, Int_t erroff, const char* baseclass = 0)
virtual voidInitStages()
virtual Int_tMainAnalysis()
voidTObject::MakeZombie()
virtual Int_tOtherAnalysis(Int_t code)
virtual Int_tPhysicsAnalysis(Int_t code)
virtual Int_tPostProcess(Int_t code)
virtual voidPrintCounters() const
virtual voidPrintCutSummary() const
virtual voidPrintScalers() const
virtual Int_tReadOneEvent()
virtual Int_tScalerAnalysis(Int_t code)
virtual Int_tSlowControlAnalysis(Int_t code)
private:
THaAnalyzer(const THaAnalyzer&)
THaAnalyzer&operator=(const THaAnalyzer&)

Data Members

public:
enum ERetVal { kOK
kSkip
kTerminate
kFatal
};
enum { kRawDecode
kDecode
kCoarseTrack
kCoarseRecon
kTracking
kReconstruct
kPhysics
kNevRead
kNevGood
kNevPhysics
kNevScaler
kNevEpics
kNevOther
kNevPostProcess
kNevAnalyzed
kNevAccepted
kEvFileTrunc
kCodaErr
kRawDecodeTest
kDecodeTest
kCoarseTrackTest
kCoarseReconTest
kTrackTest
kReconstructTest
kPhysicsTest
};
enum ECountMode { kCountPhysics
kCountAll
kCountRaw
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Bool_tfAnalysisStartedProcess() run and output file open
TList*fAppsList of apparatuses
THaBenchmark*fBenchCounters for timing statistics
Int_tfCompressCompression level for ROOT output file
Int_tfCountModeEvent counting mode (see ECountMode)
THaAnalyzer::Counter_t*fCounters[fNCounters] Statistics counters
TStringfCutFileNameName of cut definition file to load
Bool_tfDoBenchCollect detailed timing statistics
Bool_tfDoHelicityEnable helicity decoding
Bool_tfDoOtherEventsEnable other event processing
Bool_tfDoPhysicsEnable physics event processing
Bool_tfDoScalersEnable scaler processing
Bool_tfDoSlowControlEnable slow control processing
THaEvData*fEvDataInstance of decoder used by us
THaEvent*fEventThe event structure to be written to file.
TFile*fFileThe ROOT output file.
Bool_tfFirstPhysicsStatus flag for physics analysis
Bool_tfIsInitInit() called successfully
TStringfLoadedCutFileNameName of last loaded cut definition file
Bool_tfLocalEventfEvent allocated by this object
UInt_tfMarkIntervalInterval for printing event numbers
Int_tfNCountersNumber of counters
Int_tfNStagesNumber of analysis stages
UInt_tfNevNumber of events read during most recent replay
TStringfOdefFileNameName of output definition file
TStringfOutFileNameName of output ROOT file.
THaOutput*fOutputFlexible ROOT output (tree, histograms)
Bool_tfOverwriteOverwrite existing output files
TList*fPhysicsList of physics modules
TList*fPostProcessList of post-processing modules
THaEvent*fPrevEventEvent structure from last Init()
THaRunBase*fRunPointer to current run
TList*fScalersList of scaler groups
THaAnalyzer::Stage_t*fStages[fNStages] Parameters for analysis stages
TStringfSummaryFileNameName of test/cut statistics output file
Bool_tfUpdateRunUpdate run parameters during replay
Int_tfVerboseVerbosity level
static THaAnalyzer*fgAnalyzerPointer to instance of this class
static const char *constkDefaultOdefFile
static const char *constkMasterCutName

Class Charts

Inheritance Chart:
TObject
THaAnalyzer

Function documentation

THaAnalyzer(const THaAnalyzer& )
 Default constructor.
~THaAnalyzer()
 Destructor.
Int_t AddPostProcess(THaPostProcess* module)
 Add 'module' to the list of post-processing modules. This can only
 be done if no analysis is in progress. If the Analyzer has been
 initialized, the module will be initialized immediately for the current
 run time.
void ClearCounters()
 Clear statistics counters
void Close()
 Close output files and delete fOutput, fFile, and fRun objects.
 Also delete fEvent if it was allocated automatically by us.
void EnableBenchmarks(Bool_t b = kTRUE)
void EnableHelicity(Bool_t b = kTRUE)
void EnableRunUpdate(Bool_t b = kTRUE)
void EnableOtherEvents(Bool_t b = kTRUE)
void EnableOverwrite(Bool_t b = kTRUE)
void EnablePhysicsEvents(Bool_t b = kTRUE)
void EnableScalers(Bool_t b = kTRUE)
void EnableSlowControl(Bool_t b = kTRUE)
bool EvalStage(int n)
 Fill histogram block for analysis stage 'n', then evaluate cut block.
 Return 'false' if master cut is not true, 'true' otherwise.
 The result can be used to skip further processing of the current event.
 If event is skipped, increment associated statistics counter.
 Call InitCuts() before using!  This is an internal function.
void InitStages()
 Define analysis stages. Called from Init(). Does nothing if called again.
 Derived classes can override this method to define their own
 stages or additional stages. This should be done with caution.
void InitCounters()
 Allocate statistics counters.
 See notes for InitStages() for additional information.
void InitCuts()
 Internal function that sets up structures to handle cuts more efficiently:

 - Find pointers to the THaNamedList lists that hold the cut blocks.
 - find pointer to each block's master cut
Int_t InitModules(const TList* module_list, TDatime& time, Int_t erroff, const char* baseclass = 0)
 Initialize a list of THaAnalysisObjects for time 'run_time'.
 If 'baseclass' given, ensure that each object in the list inherits
 from 'baseclass'.
Int_t Init( THaRunBase* run )
 Initialize the analyzer.
Int_t DoInit(THaRunBase* run)
 Internal function called by Init(). This is where the actual work is done.
Int_t InitOutput(const TList* module_list, Int_t erroff, const char* baseclass = 0)
 Initialize a list of THaAnalysisObject's for output
 If 'baseclass' given, ensure that each object in the list inherits
 from 'baseclass'.
Int_t ReadOneEvent()
 Read one event from current run (fRun) and raw-decode it using the
 current decoder (fEvData)
Int_t SetCountMode(Int_t mode)
 Set event counting mode. The default mode is kCountPhysics.
 If mode >= 0 and mode is one of kCountAll, kCountPhysics, or kCountRaw,
 then set the mode. If mode >= 0 but unknown, return -mode.
 If mode < 0, don't change the mode but return the current count mode.

 Changing the counting mode should only be necessary in special cases.
void SetCrateMapFileName(const char* name)
 Set name of file from which to read the crate map. Unless already
 specified, the name will be automatically prefixed with "db_" and
 terminated with ".dat", so SetCrateMapFileName("mymap") will get
 the crate map from db_mymap.dat
void Print(Option_t* opt = "") const
 Report status of the analyzer.
void PrintCounters()
 Print statistics counters
void PrintScalers()
 Print scaler statistics
void PrintCutSummary()
 Print summary of cuts etc.
 Only print to screen if fVerbose>1, but always print to
 the summary file if a summary file is requested.
Int_t BeginAnalysis()
 Internal function called right before the start of the event loop
 for each run.
 Initializes subroutine-specific variables.
 Executes Begin() for all Apparatus and Physics modules.
Int_t EndAnalysis()
 Execute End() for all Apparatus and Physics modules. Internal function
 called right after event loop is finished for each run.
Int_t PhysicsAnalysis(Int_t code)
 Analysis of physics events
Int_t SlowControlAnalysis(Int_t code)
 Analyze slow control (EPICS) data and write then to output.
 Ignores RawDecode results and requested event range, so EPICS
 data are always analyzed continuously from the beginning of the run.
Int_t ScalerAnalysis(Int_t code)
--- Loop over all defined scalers and execute THaScaler::LoadData()
    Also, output scaler data to output file.

 NB: we ignore 'code' and fNev and always return kOK. In this way,
scalers are always analyzed even if RawDecode tests fail and/or the event
 is before the first requested event number. This is necessary because
 LoadData() works incrementally and must see the entire stream of
 scaler data starting from the beginning of the run.
Int_t OtherAnalysis(Int_t code)
 Analysis of other events (i.e. events that are not physics, scaler, or
 slow control events).

 This default version does nothing. Returns 'code'.
Int_t PostProcess(Int_t code)
 Post-processing via generic PostProcess modules
 May be used for event filtering etc.
 'code' (status of the preceding analysis) is passed to the
 THaPostProcess::Process() function for optional evaluation,
 e.g. skipping events that fail analysis stage cuts.
Int_t MainAnalysis()
 Main analysis carried out for each event
Int_t Process( THaRunBase* run )
 Process the given run. Loop over all events in the event range and
 analyze all apparatuses defined in the global apparatus list.
 Fill Event structure if it is defined.
 If Event and Filename are defined, then fill the output tree with Event
 and write the file.
UInt_t GetCount(Int_t i) const
inlines
UInt_t Incr(Int_t i)
THaAnalyzer(const THaAnalyzer& )
Int_t Init( THaRunBase* run )
Int_t Process( THaRunBase* run=NULL )
const char* GetOutFileName()
{ return fOutFileName.Data(); }
const char* GetCutFileName()
{ return fCutFileName.Data(); }
const char* GetOdefFileName()
{ return fOdefFileName.Data(); }
const char* GetSummaryFileName()
{ return fSummaryFileName.Data(); }
TFile* GetOutFile()
{ return fFile; }
Int_t GetCompressionLevel()
{ return fCompress; }
THaEvent* GetEvent()
{ return fEvent; }
THaEvData* GetDecoder()
{ return fEvData; }
TList* GetApps()
{ return fApps; }
TList* GetPhysics()
{ return fPhysics; }
TList* GetScalers()
{ return fScalers; }
TList* GetPostProcess()
{ return fPostProcess; }
Bool_t HasStarted()
{ return fAnalysisStarted; }
Bool_t HelicityEnabled()
{ return fDoHelicity; }
Bool_t PhysicsEnabled()
{ return fDoPhysics; }
Bool_t OtherEventsEnabled()
{ return fDoOtherEvents; }
Bool_t ScalersEnabled()
{ return fDoScalers; }
Bool_t SlowControlEnabled()
{ return fDoSlowControl; }
void SetEvent(THaEvent* event)
{ fEvent = event; }
void SetOutFile(const char* name)
{ fOutFileName = name; }
void SetCutFile(const char* name)
{ fCutFileName = name; }
void SetOdefFile(const char* name)
{ fOdefFileName = name; }
void SetSummaryFile(const char* name)
{ fSummaryFileName = name; }
void SetCompressionLevel(Int_t level)
{ fCompress = level; }
void SetMarkInterval(UInt_t interval)
{ fMarkInterval = interval; }
void SetVerbosity(Int_t level)
{ fVerbose = level; }
THaAnalyzer* GetInstance()
{ return fgAnalyzer; }
Stage_t* DefineStage(const THaAnalyzer::Stage_t* stage)
Counter_t* DefineCounter(const THaAnalyzer::Counter_t* counter)
THaAnalyzer& operator=(const THaAnalyzer& )

Last change: Sat Nov 7 21:26:42 2009
Last generated: 2009-11-07 21:26

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.