1 |
#ifndef PEVENT_H |
2 |
#define PEVENT_H |
3 |
|
4 |
#include <vector> |
5 |
#include <functional> |
6 |
#include <string> |
7 |
#include "pDetector.h" |
8 |
#include "pHit.h" |
9 |
#include "pHeader.h" |
10 |
#include "pPhitMgr.h" |
11 |
#include "pPdetMgr.h" |
12 |
#include "pPheaMgr.h" |
13 |
|
14 |
using std::string; |
15 |
|
16 |
class pEvent { |
17 |
public: |
18 |
|
19 |
pEvent( ){ |
20 |
_pphitmgr = pPhitMgr::Get(); |
21 |
_ppdetmgr = pPdetMgr::Get(); |
22 |
_ppheamgr = pPheaMgr::Get(); |
23 |
} |
24 |
|
25 |
void AddDetector(const string &name, pDetector *pd){ |
26 |
_pdetmap[name]=pd; |
27 |
} |
28 |
|
29 |
void AddDetector(const string &name){ |
30 |
_pdetmap[name]=_ppdetmgr->GetpDet(name); |
31 |
} |
32 |
|
33 |
void AddHit(const string &name, const char *c){ |
34 |
_pdetmap[name]-> |
35 |
AddHit(_pphitmgr->GetpHit(name,c)); |
36 |
} |
37 |
|
38 |
void AddHit(const string &name, pHit *ph){ |
39 |
_pdetmap[name]-> |
40 |
AddHit(ph); |
41 |
} |
42 |
|
43 |
// void AddHeader(const string &name, const int &type, const char *c){ |
44 |
// _pheamap[name]-> |
45 |
// AddHeader(_ppheamgr->GetpHea(name,c)); |
46 |
// } |
47 |
|
48 |
void AddHeader(const string &name, pHeader *ph){ |
49 |
_pheader->SetHeader(ph); |
50 |
} |
51 |
|
52 |
|
53 |
void Print(){ |
54 |
_pheader->Print(); |
55 |
for(pDetMap::iterator i=_pdetmap.begin(); i!=_pdetmap.end();++i){ |
56 |
(*i->second).Print(); |
57 |
} |
58 |
} |
59 |
|
60 |
|
61 |
private: |
62 |
|
63 |
pDetMap _pdetmap; |
64 |
pHeader *_pheader; |
65 |
pPhitMgr *_pphitmgr; |
66 |
pPdetMgr *_ppdetmgr; |
67 |
pPheaMgr *_ppheamgr; |
68 |
}; |
69 |
|
70 |
#endif //PEVENT_H |