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  // Constructors/Destructors ---------
35  PndLmdHitPair();
36  PndLmdHitPair(Double_t col1, Double_t row1, Int_t id1, Double_t col2, Double_t row2, Int_t id2);
37  PndLmdHitPair(const TVector3 &hit1, const TVector3 &hit2, Int_t id1, Int_t id2);
39 
40  // operators
41  bool operator==(const PndLmdHitPair &rhs);
42  void PrintPair() const;
43 
44  private:
45  // Private Data Members ------------
46  Double_t _col1, _col2, _row1, _row2, _distance;
47  TVector3 _hit1, _hit2;
48  Int_t _id1, _id2;
49  Int_t _moduleId, _overlapID;
50  bool sane, checked, hit1present, hit2present;
51 
52  public:
54 
55  Int_t getId1() const { return _id1; }
56  Int_t getId2() const { return _id2; }
57 
58  void setId1(Int_t ID1)
59  {
60  _id1 = ID1;
61  checked = false;
62  }
63 
64  void setId2(Int_t ID2)
65  {
66  _id2 = ID2;
67  checked = false;
68  }
69 
70  // sanity check applies only to valid numeric entries, so no entries are nan. or the like
71  bool isSane() const { return sane; }
72 
73  const TVector3 &getHit1() const { return _hit1; }
74 
75  void setHit1(const TVector3 &hit1)
76  {
77  _hit1 = hit1;
78  checked = false;
79  hit1present = true;
80  }
81 
82  const TVector3 &getHit2() const { return _hit2; }
83 
84  void setHit2(const TVector3 &hit2)
85  {
86  _hit2 = hit2;
87  checked = false;
88  hit2present = true;
89  }
90 
91  void setPixelHits(double col1, double row1, double col2, double row2)
92  {
93  _row1 = row1;
94  _col1 = col1;
95 
96  _row2 = row2;
97  _col2 = col2;
98  }
99 
100  bool check();
101 
102  bool hitSensors(Int_t first, Int_t second);
103 
104  Double_t getCol1() const { return _col1; }
105 
106  void setCol1(Double_t col1)
107  {
108  _col1 = col1;
109  checked = false;
110  }
111 
112  Double_t getCol2() const { return _col2; }
113 
114  void setCol2(Double_t col2)
115  {
116  _col2 = col2;
117  checked = false;
118  }
119 
120  Double_t getRow1() const { return _row1; }
121 
122  void setRow1(Double_t row1)
123  {
124  _row1 = row1;
125  checked = false;
126  }
127 
128  Double_t getRow2() const { return _row2; }
129 
130  void setRow2(Double_t row2)
131  {
132  _row2 = row2;
133  checked = false;
134  }
135 
136  Int_t getModuleId() const { return _moduleId; }
137 
138  void setModuleId(Int_t moduleId)
139  {
140  _moduleId = moduleId;
141  checked = false;
142  }
143 
144  bool isHit1present() const { return hit1present; }
145 
146  bool isHit2present() const { return hit2present; }
147 
148  Double_t getDistance() const { return _distance; }
149 
150  void calculateDistance();
151 
152  void setDistance(Double_t distance)
153  {
154  _distance = distance;
155  checked = false;
156  }
157 
158  Int_t getOverlapId() const { return _overlapID; }
159 
160  void setOverlapId(Int_t overlapId)
161  {
162  _overlapID = overlapId;
163  checked = false;
164  }
165  void swapHits();
166 };
167 
168 #endif
169 
170 //--------------------------------------------------------------
171 // $Log$
172 //--------------------------------------------------------------
Double_t getRow2() const
void setHit2(const TVector3 &hit2)
Definition: PndLmdHitPair.h:84
const TVector3 & getHit2() const
Definition: PndLmdHitPair.h:82
void setDistance(Double_t distance)
Int_t getId1() const
Definition: PndLmdHitPair.h:55
void setModuleId(Int_t moduleId)
void setHit1(const TVector3 &hit1)
Definition: PndLmdHitPair.h:75
bool hitSensors(Int_t first, Int_t second)
Int_t getOverlapId() const
void setCol1(Double_t col1)
void setId1(Int_t ID1)
Definition: PndLmdHitPair.h:58
ClassDef(PndLmdHitPair, 16)
bool isSane() const
Definition: PndLmdHitPair.h:71
void setRow2(Double_t row2)
Double_t getCol1() const
bool isHit2present() const
void PrintPair() const
void setCol2(Double_t col2)
Int_t getModuleId() const
void setId2(Int_t ID2)
Definition: PndLmdHitPair.h:64
void setRow1(Double_t row1)
void setPixelHits(double col1, double row1, double col2, double row2)
Definition: PndLmdHitPair.h:91
Double_t getRow1() const
void setOverlapId(Int_t overlapId)
void calculateDistance()
Double_t getDistance() const
bool operator==(const PndLmdHitPair &rhs)
bool isHit1present() const
Double_t getCol2() const
Int_t getId2() const
Definition: PndLmdHitPair.h:56
const TVector3 & getHit1() const
Definition: PndLmdHitPair.h:73