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