GRUTinizer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TDetectorHit.h
Go to the documentation of this file.
1 #ifndef _TDETECTORHIT_H_
2 #define _TDETECTORHIT_H_
3 
4 #include "TObject.h"
5 #include "TVector3.h"
6 
7 class TDetectorHit : public TObject {
8 public:
9  TDetectorHit();
10  virtual ~TDetectorHit();
11 
12  virtual Int_t Compare(const TObject *obj) const; //needed for root containers
13  virtual bool IsSortable() const { return true; }
14 
15  virtual void Copy(TObject&) const;
16  virtual void Clear(Option_t *opt = "" );
17  virtual void Print(Option_t *opt = "" ) const;
18 
19  Int_t Address() const { return fAddress; }
20  double GetEnergy() const;
21  virtual Int_t Charge() const = 0; //const { return fCharge; }
22 
23  Int_t GetSystem() const { return ((fAddress&0xff000000)>>24); }
24  Int_t GetType() const { return ((fAddress&0x00ff0000)>>16); }
25  Int_t GetChannel() const { return ((fAddress&0x0000ffff) ); }
26 
27  Int_t GetHole() const { return ((fAddress&0xff000000)>>24); }
28  Int_t GetCrystal() const { return ((fAddress&0x00ff0000)>>16); }
29  Int_t GetSegmentId() const { return ((fAddress&0x0000ffff) ); }
30 
31  void SetAddress(unsigned char system,unsigned char type,unsigned short channel) {
32  fAddress =
33  (((unsigned int)system ) << 24) +
34  (((unsigned int)type ) << 16) +
35  (((unsigned int)channel) << 0);
36  }
37  //void SetCharge(Int_t chg) { fCharge = chg; }
38 
39  static const TVector3 BeamUnitVec;
40 
41 private: // System | Type | Element
42  Int_t fAddress; // 0x ff | ff | ffff
43  //Int_t fCharge;
44 
45 
47 
48 };
49 
50 #endif