FairRoot/PandaRoot
PndLmdHitPair.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Header for PndLmdHitPair
7 // It has fields for exactly two sensor hits (after cluster finder),
8 // each hit has one row and col. It also has exactly two TVector3 for
9 // hit coordinate in the LMD coordinate system. This info must be
10 // supplied by LmdPairFinderTask (or user) and cannot be decoded in
11 // this class itsel.
12 //
13 // Environment:
14 // Software developed for the PANDA Luminosity Detector at FAIR.
15 //
16 // Author List:
17 // Roman Klasen (roklasen@uni-mainz.de or klasen@kph.uni-mainz.de) by a template from Tobias Stockmanns (IKP - Juelich)
18 //
19 //
20 //-----------------------------------------------------------
21 
22 #ifndef PNDLMDHITPAIR_HH
23 #define PNDLMDHITPAIR_HH
24 
25 // Root Class Headers ----------------
26 //#include "FairTimeStamp.h"
27 
28 #include "TVector3.h"
29 #include <TObject.h>
30 #include <iostream>
31 
32 class PndLmdHitPair : public TObject { //: public FairTimeStamp {
33 public:
34 
35  // Constructors/Destructors ---------
36  PndLmdHitPair();
37  PndLmdHitPair(Double_t col1, Double_t row1, Int_t id1, Double_t col2, Double_t row2, Int_t id2);
38  PndLmdHitPair(const TVector3 &hit1, const TVector3 &hit2, Int_t id1, Int_t id2);
40 
41  // operators
42  bool operator== (const PndLmdHitPair& rhs);
43  void PrintPair() const;
44 
45 private:
46 
47  // Private Data Members ------------
49  TVector3 _hit1, _hit2;
50  Int_t _id1, _id2;
53 
54 public:
56 
57  Int_t getId1() const {
58  return _id1;
59  }
60  Int_t getId2() const {
61  return _id2;
62  }
63 
64  void setId1(Int_t ID1) {
65  _id1 = ID1;
66  checked = false;
67  }
68 
69  void setId2(Int_t ID2) {
70  _id2 = ID2;
71  checked = false;
72  }
73 
74  //sanity check applies only to valid numeric entries, so no entries are nan. or the like
75  bool isSane() const{
76  return sane;
77  }
78 
79  const TVector3& getHit1() const {
80  return _hit1;
81  }
82 
83  void setHit1(const TVector3& hit1) {
84  _hit1 = hit1;
85  checked = false;
86  hit1present=true;
87  }
88 
89  const TVector3& getHit2() const {
90  return _hit2;
91  }
92 
93  void setHit2(const TVector3& hit2) {
94  _hit2 = hit2;
95  checked = false;
96  hit2present=true;
97  }
98 
99  void setPixelHits(double col1, double row1, double col2, double row2){
100  _row1 = row1;
101  _col1 = col1;
102 
103  _row2 = row2;
104  _col2 = col2;
105  }
106 
107  void check();
108 
109  bool hitSensors(Int_t first, Int_t second);
110 
111  Double_t getCol1() const {
112  return _col1;
113  }
114 
115  void setCol1(Double_t col1) {
116  _col1 = col1;
117  checked = false;
118  }
119 
120  Double_t getCol2() const {
121  return _col2;
122  }
123 
124  void setCol2(Double_t col2) {
125  _col2 = col2;
126  checked = false;
127  }
128 
129  Double_t getRow1() const {
130  return _row1;
131  }
132 
133  void setRow1(Double_t row1) {
134  _row1 = row1;
135  checked = false;
136  }
137 
138  Double_t getRow2() const {
139  return _row2;
140  }
141 
142  void setRow2(Double_t row2) {
143  _row2 = row2;
144  checked = false;
145  }
146 
147  Int_t getModuleId() const {
148  return _moduleId;
149  }
150 
151  void setModuleId(Int_t moduleId) {
152  _moduleId = moduleId;
153  checked = false;
154  }
155 
156  bool isHit1present() const {
157  return hit1present;
158  }
159 
160  bool isHit2present() const {
161  return hit2present;
162  }
163 
165  return _distance;
166  }
167 
168  void calculateDistance();
169 
170  void setDistance(Double_t distance) {
171  _distance = distance;
172  checked = false;
173  }
174 
175  Int_t getOverlapId() const {
176  return _overlapID;
177  }
178 
179  void setOverlapId(Int_t overlapId) {
180  _overlapID = overlapId;
181  checked = false;
182  }
183  void swapHits();
184 };
185 
186 #endif
187 
188 //--------------------------------------------------------------
189 // $Log$
190 //--------------------------------------------------------------
Double_t getCol2() const
void setHit2(const TVector3 &hit2)
Definition: PndLmdHitPair.h:93
Int_t getModuleId() const
void setDistance(Double_t distance)
Double_t _col2
Definition: PndLmdHitPair.h:48
void setModuleId(Int_t moduleId)
void setHit1(const TVector3 &hit1)
Definition: PndLmdHitPair.h:83
Double_t getRow2() const
bool hitSensors(Int_t first, Int_t second)
Double_t _row1
Definition: PndLmdHitPair.h:48
void setCol1(Double_t col1)
void setId1(Int_t ID1)
Definition: PndLmdHitPair.h:64
ClassDef(PndLmdHitPair, 16)
const TVector3 & getHit1() const
Definition: PndLmdHitPair.h:79
void setRow2(Double_t row2)
Int_t getOverlapId() const
Double_t getDistance() const
bool isSane() const
Definition: PndLmdHitPair.h:75
Double_t _distance
Definition: PndLmdHitPair.h:48
Double_t
bool isHit2present() const
Double_t _row2
Definition: PndLmdHitPair.h:48
Int_t getId2() const
Definition: PndLmdHitPair.h:60
const TVector3 & getHit2() const
Definition: PndLmdHitPair.h:89
bool isHit1present() const
void setCol2(Double_t col2)
TVector3 _hit1
Definition: PndLmdHitPair.h:49
Int_t getId1() const
Definition: PndLmdHitPair.h:57
void setId2(Int_t ID2)
Definition: PndLmdHitPair.h:69
void setRow1(Double_t row1)
void setPixelHits(double col1, double row1, double col2, double row2)
Definition: PndLmdHitPair.h:99
void setOverlapId(Int_t overlapId)
void calculateDistance()
Double_t _col1
Definition: PndLmdHitPair.h:48
TVector3 _hit2
Definition: PndLmdHitPair.h:49
bool operator==(const PndLmdHitPair &rhs)
void PrintPair() const
Double_t getRow1() const
Double_t getCol1() const