1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // Reconstruction module |
---|
3 | // $Id: RecoModule.hh 2633 2006-03-28 09:13:43Z thea $ |
---|
4 | // Marco Pallavicini created Oct, 16 2003 |
---|
5 | // data container added Feb, 16,2004 |
---|
6 | |
---|
7 | #ifndef __RECOMODULE_HH_ |
---|
8 | #define __RECOMODULE_HH_ |
---|
9 | |
---|
10 | #include <string> |
---|
11 | |
---|
12 | #include "euso.hh" |
---|
13 | #include "EsafConfigurable.hh" |
---|
14 | #include "RecoModuleData.hh" |
---|
15 | #include "EsafMsgSource.hh" |
---|
16 | |
---|
17 | class RecoEvent; |
---|
18 | class RecoRootEvent; |
---|
19 | |
---|
20 | class RecoModule : public EsafConfigurable, public EsafMsgSource { |
---|
21 | public: |
---|
22 | |
---|
23 | // ctor |
---|
24 | RecoModule( const string&); |
---|
25 | |
---|
26 | // dtor |
---|
27 | virtual ~RecoModule(); |
---|
28 | |
---|
29 | // module name |
---|
30 | inline const string& GetName() const { return fName; } |
---|
31 | |
---|
32 | // Init method: called at the beginning of a run |
---|
33 | virtual Bool_t Init() = 0; |
---|
34 | |
---|
35 | // called before each event process |
---|
36 | virtual Bool_t PreProcess() = 0; |
---|
37 | |
---|
38 | // event processing |
---|
39 | virtual Bool_t Process( RecoEvent* ) = 0; |
---|
40 | |
---|
41 | // called after processing an event |
---|
42 | virtual Bool_t PostProcess() = 0; |
---|
43 | |
---|
44 | // called at the end of each run |
---|
45 | virtual Bool_t Done() = 0; |
---|
46 | |
---|
47 | virtual Bool_t SaveRootData(RecoRootEvent*) = 0; |
---|
48 | |
---|
49 | // clean memory after each event |
---|
50 | // each module has the responbility to clean the data container |
---|
51 | // from its own data in method UserMemoryClean() |
---|
52 | // UserMemoryClean() and StandardMemoryClean() are called |
---|
53 | // by the framework |
---|
54 | virtual void UserMemoryClean() {} |
---|
55 | |
---|
56 | virtual void TmpMemoryClean() {}; |
---|
57 | |
---|
58 | // user SHOULD NOT override this |
---|
59 | inline void StandardMemoryClean() {MyData()->CleanMaps();} |
---|
60 | |
---|
61 | public: |
---|
62 | EsafConfigClass(Reco,RecoModule) |
---|
63 | |
---|
64 | protected: |
---|
65 | // get RecoModuleData object for child classes |
---|
66 | RecoModuleData* MyData() { return fData; } |
---|
67 | |
---|
68 | public: |
---|
69 | // get RecoModuleData object for public: read only! |
---|
70 | const RecoModuleData* GetData() const { return fData;} |
---|
71 | |
---|
72 | private: |
---|
73 | // name of this module |
---|
74 | string fName; |
---|
75 | |
---|
76 | // container object with output data of this module |
---|
77 | RecoModuleData *fData; |
---|
78 | ClassDef(RecoModule,0) |
---|
79 | }; |
---|
80 | |
---|
81 | #endif /* __RECOMODULE_HH_ */ |
---|
82 | |
---|