/[PAMELA software]/gp2root/pEvent.h
ViewVC logotype

Annotation of /gp2root/pEvent.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sun Oct 22 08:26:52 2006 UTC (18 years, 1 month ago) by cafagna
Branch: MAIN
CVS Tags: v0r9, v0r10, HEAD
Changes since 1.1: +25 -9 lines
File MIME type: text/plain
Stable version, lot of changes, ROOT support included, persistency not yet activated

1 pamela 1.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 cafagna 1.2 //#ifndef __GNUC__
15     #include "TObject.h"
16     //#endif
17    
18 pamela 1.1 using std::string;
19    
20 cafagna 1.2 //#ifndef __GNUC__
21     class pEvent: public TObject {
22     // #else
23     // class pEvent {
24     // #endif
25 pamela 1.1 public:
26    
27     pEvent( ){
28     _pphitmgr = pPhitMgr::Get();
29     _ppdetmgr = pPdetMgr::Get();
30     _ppheamgr = pPheaMgr::Get();
31 cafagna 1.2 _pheader=0;
32    
33 pamela 1.1 }
34    
35     void AddDetector(const string &name, pDetector *pd){
36     _pdetmap[name]=pd;
37     }
38    
39     void AddDetector(const string &name){
40 cafagna 1.2 pDetector *temp=_ppdetmgr->GetpDet(name);
41     if(temp!=0) _pdetmap[name]=temp;
42    
43 pamela 1.1 }
44    
45     void AddHit(const string &name, const char *c){
46     _pdetmap[name]->
47     AddHit(_pphitmgr->GetpHit(name,c));
48     }
49    
50     void AddHit(const string &name, pHit *ph){
51     _pdetmap[name]->
52     AddHit(ph);
53     }
54    
55     // void AddHeader(const string &name, const int &type, const char *c){
56     // _pheamap[name]->
57     // AddHeader(_ppheamgr->GetpHea(name,c));
58     // }
59    
60     void AddHeader(const string &name, pHeader *ph){
61     _pheader->SetHeader(ph);
62     }
63    
64    
65     void Print(){
66 cafagna 1.2 if(_pheader!=0) _pheader->Print();
67 pamela 1.1 for(pDetMap::iterator i=_pdetmap.begin(); i!=_pdetmap.end();++i){
68     (*i->second).Print();
69     }
70     }
71    
72 cafagna 1.2 //#ifndef __GNUC__
73     ClassDef(pEvent,1);
74     //#endif
75 pamela 1.1
76 cafagna 1.2 private:
77     pDetMap _pdetmap;
78     pHeader *_pheader;
79     pPhitMgr *_pphitmgr; //!
80     pPdetMgr *_ppdetmgr; //!
81     pPheaMgr *_ppheamgr; //!
82 pamela 1.1
83     };
84    
85     #endif //PEVENT_H
86 cafagna 1.2

  ViewVC Help
Powered by ViewVC 1.1.23