#ifndef ROOT_THaAnalyzer
#define ROOT_THaAnalyzer
#include "TObject.h"
#include "TString.h"
class THaEvent;
class THaRunBase;
class THaOutput;
class TList;
class TIter;
class TFile;
class TDatime;
class THaCut;
class THaBenchmark;
class THaEvData;
class THaPostProcess;
class THaCrateMap;
class THaAnalyzer : public TObject {
public:
THaAnalyzer();
virtual ~THaAnalyzer();
virtual Int_t AddPostProcess( THaPostProcess* module );
virtual void Close();
virtual Int_t Init( THaRunBase* run );
Int_t Init( THaRunBase& run ) { return Init( &run ); }
virtual Int_t Process( THaRunBase* run=NULL );
Int_t Process( THaRunBase& run ) { return Process(&run); }
virtual void Print( Option_t* opt="" ) const;
void EnableBenchmarks( Bool_t b = kTRUE );
void EnableHelicity( Bool_t b = kTRUE );
void EnableOtherEvents( Bool_t b = kTRUE );
void EnableOverwrite( Bool_t b = kTRUE );
void EnablePhysicsEvents( Bool_t b = kTRUE );
void EnableRunUpdate( Bool_t b = kTRUE );
void EnableScalers( Bool_t b = kTRUE );
void EnableSlowControl( Bool_t b = kTRUE );
const char* GetOutFileName() const { return fOutFileName.Data(); }
const char* GetCutFileName() const { return fCutFileName.Data(); }
const char* GetOdefFileName() const { return fOdefFileName.Data(); }
const char* GetSummaryFileName() const { return fSummaryFileName.Data(); }
TFile* GetOutFile() const { return fFile; }
Int_t GetCompressionLevel() const { return fCompress; }
THaEvent* GetEvent() const { return fEvent; }
THaEvData* GetDecoder() const { return fEvData; }
TList* GetApps() const { return fApps; }
TList* GetPhysics() const { return fPhysics; }
TList* GetScalers() const { return fScalers; }
TList* GetPostProcess() const { return fPostProcess; }
Bool_t HasStarted() const { return fAnalysisStarted; }
Bool_t HelicityEnabled() const { return fDoHelicity; }
Bool_t PhysicsEnabled() const { return fDoPhysics; }
Bool_t OtherEventsEnabled() const { return fDoOtherEvents; }
Bool_t ScalersEnabled() const { return fDoScalers; }
Bool_t SlowControlEnabled() const { return fDoSlowControl; }
virtual Int_t SetCountMode( Int_t mode );
void SetCrateMapFileName( const char* name );
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; }
static THaAnalyzer* GetInstance() { return fgAnalyzer; }
enum ERetVal { kOK, kSkip, kTerminate, kFatal };
protected:
enum {
kRawDecode = 0, kDecode, kCoarseTrack, kCoarseRecon,
kTracking, kReconstruct, kPhysics
};
struct Stage_t {
Int_t key;
Int_t countkey;
const char* name;
TList* cut_list;
TList* hist_list;
THaCut* master_cut;
};
enum {
kNevRead = 0, kNevGood, kNevPhysics, kNevScaler, kNevEpics, kNevOther,
kNevPostProcess, kNevAnalyzed, kNevAccepted,
kEvFileTrunc, kCodaErr, kRawDecodeTest, kDecodeTest, kCoarseTrackTest,
kCoarseReconTest, kTrackTest, kReconstructTest, kPhysicsTest
};
struct Counter_t {
Int_t key;
const char* description;
UInt_t count;
};
enum ECountMode { kCountPhysics, kCountAll, kCountRaw };
TFile* fFile;
THaOutput* fOutput;
TString fOutFileName;
TString fCutFileName;
TString fLoadedCutFileName;
TString fOdefFileName;
TString fSummaryFileName;
THaEvent* fEvent;
Int_t fNStages;
Int_t fNCounters;
Stage_t* fStages;
Counter_t* fCounters;
UInt_t fNev;
UInt_t fMarkInterval;
Int_t fCompress;
Int_t fVerbose;
Int_t fCountMode;
THaBenchmark* fBench;
THaEvent* fPrevEvent;
THaRunBase* fRun;
THaEvData* fEvData;
TList* fApps;
TList* fPhysics;
TList* fScalers;
TList* fPostProcess;
Bool_t fIsInit;
Bool_t fAnalysisStarted;
Bool_t fLocalEvent;
Bool_t fUpdateRun;
Bool_t fOverwrite;
Bool_t fDoBench;
Bool_t fDoHelicity;
Bool_t fDoPhysics;
Bool_t fDoOtherEvents;
Bool_t fDoScalers;
Bool_t fDoSlowControl;
Bool_t fFirstPhysics;
virtual Int_t BeginAnalysis();
virtual Int_t DoInit( THaRunBase* run );
virtual Int_t EndAnalysis();
virtual Int_t MainAnalysis();
virtual Int_t PhysicsAnalysis( Int_t code );
virtual Int_t ScalerAnalysis( Int_t code );
virtual Int_t SlowControlAnalysis( Int_t code );
virtual Int_t OtherAnalysis( Int_t code );
virtual Int_t PostProcess( Int_t code );
virtual Int_t ReadOneEvent();
void ClearCounters();
Stage_t* DefineStage( const Stage_t* stage );
Counter_t* DefineCounter( const Counter_t* counter );
UInt_t GetCount( Int_t which ) const;
UInt_t Incr( Int_t which );
virtual bool EvalStage( int n );
virtual void InitCounters();
virtual void InitCuts();
virtual void InitStages();
virtual Int_t InitModules( const TList* module_list, TDatime& time,
Int_t erroff, const char* baseclass = NULL );
virtual Int_t InitOutput( const TList* module_list, Int_t erroff,
const char* baseclass = NULL );
virtual void PrintCounters() const;
virtual void PrintScalers() const;
virtual void PrintCutSummary() const;
static THaAnalyzer* fgAnalyzer;
static const char* const kMasterCutName;
static const char* const kDefaultOdefFile;
private:
THaAnalyzer( const THaAnalyzer& );
THaAnalyzer& operator=( const THaAnalyzer& );
ClassDef(THaAnalyzer,0)
};
inline UInt_t THaAnalyzer::GetCount( Int_t i ) const
{
return fCounters[i].count;
}
inline UInt_t THaAnalyzer::Incr( Int_t i )
{
return ++(fCounters[i].count);
}
#endif
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.