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

Diff of /gp2root/pDetector.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23