ROOTANA
Loading...
Searching...
No Matches
manalyzer_v0.h
Go to the documentation of this file.
1// manalyzer.h
2
3#ifndef MANALYZER_H
4#define MANALYZER_H
5
6#include <string>
7#include <vector>
8
9#include "rootana_config.h"
10#include "midasio.h"
11#include "VirtualOdb.h"
12
13class TARootHelper;
14
15class TARunInfo
16{
17 public:
18 int fRunNo;
19 std::string fFileName;
22
23 public:
24 TARunInfo(int runno, const char* filename);
26
27 private:
28 TARunInfo() {}; // hidden default constructor
29};
30
31class TAFlowEvent
32{
33 public:
35
36 public:
38 virtual ~TAFlowEvent();
39
40 template<class T> T* Find()
41 {
42 TAFlowEvent* f = this;
43 while (f) {
44 T *ptr = dynamic_cast<T*>(f);
45 if (ptr) return ptr;
46 f = f->fNext;
47 }
48 return NULL;
49 }
50
51 private:
52 TAFlowEvent() {}; // hidden default constructor
53};
54
55typedef int TAFlags;
56
57#define TAFlag_OK 0
58#define TAFlag_SKIP (1<<0)
59#define TAFlag_QUIT (1<<1)
60#define TAFlag_WRITE (1<<2)
61#define TAFlag_DISPLAY (1<<3)
62
64{
65 public:
66 TARunInterface(TARunInfo* runinfo); // ctor
67 virtual ~TARunInterface() {}; // dtor
68
69 public:
70 virtual void BeginRun(TARunInfo* runinfo); // begin of run
71 virtual void EndRun(TARunInfo* runinfo); // end of run
72
73 virtual void PauseRun(TARunInfo* runinfo); // pause of run (if online)
74 virtual void ResumeRun(TARunInfo* runinfo); // resume of run (if online)
75
76 virtual TAFlowEvent* Analyze(TARunInfo* runinfo, TMEvent* event, TAFlags* flags, TAFlowEvent* flow);
77 virtual void AnalyzeSpecialEvent(TARunInfo* runinfo, TMEvent* event);
78
79 private:
80 TARunInterface(); // hidden default constructor
81};
82
84{
85 public:
86 TAModuleInterface() {}; // ctor
87 virtual ~TAModuleInterface() {}; // dtor
88
89 public:
90 virtual TARunInterface* NewRun(TARunInfo* runinfo) = 0; // factory for module-specific Run objects
91
92 public:
93 virtual void Init(const std::vector<std::string> &args); // start of analysis
94 virtual void Finish(); // end of analysis
95};
96
98{
99 public:
101 //static void Register(TAModuleInterface* m);
102 //static std::vector<TAModuleInterface*>* fgModules;
103 //static std::vector<TAModuleInterface*>* Get() const;
104};
105
106#ifdef HAVE_ROOT
107
108#include "TFile.h"
109#include "TDirectory.h"
110#include "TApplication.h"
111
112class XmlServer;
113class THttpServer;
114
115class TARootHelper
116{
117 public:
118 TFile* fOutputFile;
119 static TDirectory* fgDir;
120 static TApplication* fgApp;
122 static THttpServer* fgHttpServer;
123
124 public:
126 ~TARootHelper(); // dtor
127
128 private:
129 TARootHelper() { }; // hidden default constructor
130};
131#endif
132
133int manalyzer_main(int argc, char* argv[]);
134
135#endif
136
137/* emacs
138 * Local Variables:
139 * tab-width: 8
140 * c-basic-offset: 3
141 * indent-tabs-mode: nil
142 * End:
143 */
144
TAFlowEvent(TAFlowEvent *)
virtual ~TAFlowEvent()
TAFlowEvent * fNext
Definition manalyzer.h:51
virtual void Finish()
virtual void Init(const std::vector< std::string > &args)
virtual TARunInterface * NewRun(TARunInfo *runinfo)=0
virtual ~TAModuleInterface()
TARootHelper(const TARunInfo *)
static TApplication * fgApp
Definition manalyzer.h:156
static THttpServer * fgHttpServer
Definition manalyzer.h:157
static XmlServer * fgXmlServer
TFile * fOutputFile
Definition manalyzer.h:154
static TDirectory * fgDir
Definition manalyzer.h:155
std::string fFileName
Definition manalyzer.h:25
VirtualOdb * fOdb
int fRunNo
Definition manalyzer.h:24
TARootHelper * fRoot
Definition manalyzer.h:27
virtual void EndRun(TARunInfo *runinfo)
virtual void PauseRun(TARunInfo *runinfo)
virtual TAFlowEvent * Analyze(TARunInfo *runinfo, TMEvent *event, TAFlags *flags, TAFlowEvent *flow)
virtual void AnalyzeSpecialEvent(TARunInfo *runinfo, TMEvent *event)
virtual void ResumeRun(TARunInfo *runinfo)
virtual ~TARunInterface()
virtual void BeginRun(TARunInfo *runinfo)
int TAFlags
Definition manalyzer.h:72
int TAFlags
int manalyzer_main(int argc, char *argv[])