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

Annotation of /gp2root/pDetector.h

Parent Directory Parent Directory | Revision Log Revision Log


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

1 pamela 1.1 #ifndef PDETECTOR_H
2     #define PDETECTOR_H
3     #include <string>
4     #include <iostream>
5     #include <map>
6     #include "pHit.h"
7 cafagna 1.2 #include "TObject.h"
8 pamela 1.1
9     using std::cout;
10     using std::endl;
11     using std::string;
12     using std::map;
13    
14 cafagna 1.2 class pDetector : public TObject {
15 pamela 1.1
16     public:
17    
18    
19 cafagna 1.2 pDetector(const string & s=0, pHit *p=0): _name(s)
20     {
21     if(p!=0)AddHit(p);
22     };
23    
24     virtual ~pDetector(){};
25    
26     void AddHit(pHit *p){_hits.push_back(p); Print();}
27 pamela 1.1 // void AddHit(const char *c){
28     // _hits.push_back(pUtil::GetpHit(_name,c));
29     // }
30     void Print() const {
31 cafagna 1.2 cout << " pDetector: " << GetDetName() << endl;
32 pamela 1.1 cout << " pHit stored: " << endl;
33     for( pHitColl::const_iterator p=_hits.begin(); p!= _hits.end();++p)
34     (*p)->Print();
35     }
36    
37     pHit* GetHit(const int n) {return _hits[n];}
38     pHitColl* GetHitColl() {return &_hits;}
39 cafagna 1.2 string GetDetName() const {return _name;}
40     void SetDetName(const string & s){_name=s;}
41 pamela 1.1
42     private:
43     string _name;
44     pHitColl _hits;
45 cafagna 1.2
46     public:
47    
48     //#ifndef __GNUC__
49     ClassDef(pDetector,1);
50     //#endif
51 pamela 1.1 };
52    
53     typedef map<string,pDetector*> pDetMap;
54    
55     #endif //PDETECTOR_H
56 cafagna 1.2

  ViewVC Help
Powered by ViewVC 1.1.23