FairRoot/PandaRoot
PndTrkHit.h
Go to the documentation of this file.
1 
9 #ifndef PNDTRKHIT_H
10 #define PNDTRKHIT_H 1
11 
12 #include "FairTimeStamp.h"
13 #include "TVector3.h"
14 #include "PndTrkParameters.h"
15 /* #include "TObject.h" */
16 
17 class PndTrkHit : public FairTimeStamp
18 {
19 
20  public:
21 
22 
23  PndTrkHit();
24  PndTrkHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, Int_t sensorID, TVector3& pos, Double_t isochrone, Double_t sortvar);
25  // PndTrkHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, Int_t sensorID, TVector3& pos);
26  PndTrkHit(const PndTrkHit &hit);
27 
28  ~PndTrkHit();
29 
30  virtual Bool_t IsEqual(const TObject* obj) const {
31  return (((PndTrkHit *) obj)->fDetectorID == fDetectorID) && (((PndTrkHit *) obj)->fHitID == fHitID);
32  }
33 
34  virtual Bool_t IsSortable() { return !(fSortVariable == -1); }
35  Int_t Compare(const TObject *hit) const;
36 
37  Bool_t operator==(const PndTrkHit & hit1);
38  Bool_t operator<(const PndTrkHit & hit1);
39  /* friend Bool_t operator==(const PndTrkHit & hit1, const PndTrkHit & hit2); */
40  // friend Bool_t operator<(const PndTrkHit &hit1, const PndTrkHit &hit2) ;
41 
42  // CHECK add other set
43  void SetIsochrone(Double_t isochrone) { fIsochrone = isochrone; }
44  void SetSortVariable(Double_t sortvar) { fSortVariable = sortvar; }
45 
46 
47  void SetPosition(TVector3 pos) {fPosition = pos; }
48  void SetPhi(Double_t phi) { fPhi = phi; }
49 
50  void SetUsedFlag(Bool_t used) { fUsed = used; }
51  void SetRefHitFlag(Bool_t used) { fUsedAsRefHit = used; }
52 
53  void SetRegion(Int_t iregion) { fIRegion = iregion; }
54 
55  // inline get
56  inline Int_t GetHitID() { return fHitID; }
57  inline Int_t GetDetectorID() { return fDetectorID; }
58  inline Bool_t IsUsed() { return fUsed; }
59  inline Bool_t WasRefHit() { return fUsedAsRefHit; }
60  inline Int_t GetSensorID() { return fSensorID; }
61  inline Int_t GetTubeID() { return fSensorID; }
62  inline TVector3 GetPosition() { return fPosition; }
63  inline Double_t GetIsochrone() { return fIsochrone; }
64  inline Int_t GetIRegion() { return fIRegion ; }
65  inline Bool_t IsRegion(Int_t iregion) { return iregion == fIRegion; }
66  inline Double_t GetSortVariable() { return fSortVariable; }
67  inline Double_t GetPhi() { return fPhi; }
68 
69  // is stt
71  inline Bool_t IsSttSkew() { return fIRegion == SKEW_LEFT || fIRegion == SKEW_RIGHT; }
72  inline Bool_t IsStt() { return IsSttParallel() || IsSttSkew(); }
73 
74  // is mvd
75  inline Bool_t IsMvdPixel() { return fIRegion == MVDPIXEL; }
76  inline Bool_t IsMvdStrip() { return fIRegion == MVDSTRIP; }
77  inline Bool_t IsMvd() { return IsMvdStrip() || IsMvdPixel(); }
78 
79  // is gem
80  inline Bool_t IsGem() { return fIRegion == GEM; }
81 
82  // is scitil
83  inline Bool_t IsSciTil() { return fIRegion == SCIT; }
84 
85  Double_t GetDistance(PndTrkHit *fromhit);
86  Double_t GetDistance(TVector3 frompoint);
88  Double_t GetXYDistance(TVector3 frompoint);
89  Double_t GetXYDistanceFromTrack(double x0, double y0, double R);
90  // info
91  void Draw(Color_t color);
92  void DrawTube(Color_t color);
93  void Print();
94 
95  int GetSector() { return fSector; }
96 
97 
98  // variables
102  TVector3 fPosition;
104  Double_t fSortVariable; // variable for sorting
107  ClassDef(PndTrkHit,1);
108 };
109 
110 
111 #endif
TVector3 pos
Double_t x0
Definition: checkhelixhit.C:70
void SetRegion(Int_t iregion)
Definition: PndTrkHit.h:53
#define SKEW_RIGHT
Double_t GetPhi()
Definition: PndTrkHit.h:67
Bool_t IsSciTil()
Definition: PndTrkHit.h:83
Int_t Compare(const TObject *hit) const
Definition: PndTrkHit.cxx:69
Int_t fDetectorID
Definition: PndTrkHit.h:99
Double_t fIsochrone
Definition: PndTrkHit.h:103
virtual Bool_t IsEqual(const TObject *obj) const
Definition: PndTrkHit.h:30
Int_t fSensorID
Definition: PndTrkHit.h:99
void SetPhi(Double_t phi)
Definition: PndTrkHit.h:48
void SetSortVariable(Double_t sortvar)
Definition: PndTrkHit.h:44
Bool_t IsMvdPixel()
Definition: PndTrkHit.h:75
#define INNER_LEFT
Bool_t fUsedAsRefHit
Definition: PndTrkHit.h:101
#define SKEW_LEFT
Double_t fPhi
Definition: PndTrkHit.h:105
Bool_t IsMvdStrip()
Definition: PndTrkHit.h:76
Int_t GetHitID()
Definition: PndTrkHit.h:56
ClassDef(PndTrkHit, 1)
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
Bool_t IsMvd()
Definition: PndTrkHit.h:77
Int_t GetSensorID()
Definition: PndTrkHit.h:60
#define GEM
#define SCIT
Int_t GetIRegion()
Definition: PndTrkHit.h:64
Int_t fHitID
Definition: PndTrkHit.h:99
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
#define MVDSTRIP
void Print()
Definition: PndTrkHit.cxx:230
void SetUsedFlag(Bool_t used)
Definition: PndTrkHit.h:50
Double_t
void SetIsochrone(Double_t isochrone)
Definition: PndTrkHit.h:43
Double_t GetDistance(PndTrkHit *fromhit)
Definition: PndTrkHit.cxx:83
Double_t y0
Definition: checkhelixhit.C:71
TVector3 GetPosition()
Definition: PndTrkHit.h:62
void SetRefHitFlag(Bool_t used)
Definition: PndTrkHit.h:51
virtual Bool_t IsSortable()
Definition: PndTrkHit.h:34
void SetPosition(TVector3 pos)
Definition: PndTrkHit.h:47
Double_t fSortVariable
Definition: PndTrkHit.h:104
Bool_t IsGem()
Definition: PndTrkHit.h:80
#define INNER_RIGHT
void DrawTube(Color_t color)
Definition: PndTrkHit.cxx:178
Bool_t IsUsed()
Definition: PndTrkHit.h:58
Int_t fIRegion
Definition: PndTrkHit.h:99
Double_t GetXYDistanceFromTrack(double x0, double y0, double R)
Definition: PndTrkHit.cxx:105
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
Bool_t operator<(const PndTrkHit &hit1)
Definition: PndTrkHit.cxx:32
TVector3 fPosition
Definition: PndTrkHit.h:102
void Draw(Color_t color)
Definition: PndTrkHit.cxx:109
Double_t fSector
Definition: PndTrkHit.h:106
Double_t GetXYDistance(PndTrkHit *fromhit)
Definition: PndTrkHit.cxx:94
Bool_t IsStt()
Definition: PndTrkHit.h:72
Double_t GetSortVariable()
Definition: PndTrkHit.h:66
Bool_t fUsed
Definition: PndTrkHit.h:100
Bool_t WasRefHit()
Definition: PndTrkHit.h:59
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
#define MVDPIXEL
#define OUTER_RIGHT
PndAnaPidSelector *& obj
int GetSector()
Definition: PndTrkHit.h:95
Int_t GetTubeID()
Definition: PndTrkHit.h:61
Double_t R
Definition: checkhelixhit.C:61
Bool_t operator==(const PndTrkHit &hit1)
Definition: PndTrkHit.cxx:28
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
Bool_t IsRegion(Int_t iregion)
Definition: PndTrkHit.h:65
#define OUTER_LEFT