FairRoot/PandaRoot
Public Member Functions | Private Attributes | List of all members
PndLmdHitPair Class Reference

#include <PndLmdHitPair.h>

Inheritance diagram for PndLmdHitPair:

Public Member Functions

 PndLmdHitPair ()
 
 PndLmdHitPair (Double_t col1, Double_t row1, Int_t id1, Double_t col2, Double_t row2, Int_t id2)
 
 PndLmdHitPair (const TVector3 &hit1, const TVector3 &hit2, Int_t id1, Int_t id2)
 
 ~PndLmdHitPair ()
 
bool operator== (const PndLmdHitPair &rhs)
 
void PrintPair () const
 
 ClassDef (PndLmdHitPair, 16)
 
Int_t getId1 () const
 
Int_t getId2 () const
 
void setId1 (Int_t ID1)
 
void setId2 (Int_t ID2)
 
bool isSane () const
 
const TVector3 & getHit1 () const
 
void setHit1 (const TVector3 &hit1)
 
const TVector3 & getHit2 () const
 
void setHit2 (const TVector3 &hit2)
 
void setPixelHits (double col1, double row1, double col2, double row2)
 
void check ()
 
bool hitSensors (Int_t first, Int_t second)
 
Double_t getCol1 () const
 
void setCol1 (Double_t col1)
 
Double_t getCol2 () const
 
void setCol2 (Double_t col2)
 
Double_t getRow1 () const
 
void setRow1 (Double_t row1)
 
Double_t getRow2 () const
 
void setRow2 (Double_t row2)
 
Int_t getModuleId () const
 
void setModuleId (Int_t moduleId)
 
bool isHit1present () const
 
bool isHit2present () const
 
Double_t getDistance () const
 
void calculateDistance ()
 
void setDistance (Double_t distance)
 
Int_t getOverlapId () const
 
void setOverlapId (Int_t overlapId)
 
void swapHits ()
 

Private Attributes

Double_t _col1
 
Double_t _col2
 
Double_t _row1
 
Double_t _row2
 
Double_t _distance
 
TVector3 _hit1
 
TVector3 _hit2
 
Int_t _id1
 
Int_t _id2
 
Int_t _moduleId
 
Int_t _overlapID
 
bool sane
 
bool checked
 
bool hit1present
 
bool hit2present
 

Detailed Description

Definition at line 32 of file PndLmdHitPair.h.

Constructor & Destructor Documentation

PndLmdHitPair::PndLmdHitPair ( )

Definition at line 148 of file PndLmdHitPair.cxx.

References _col1, _col2, _distance, _id1, _id2, _moduleId, _overlapID, _row1, _row2, checked, hit1present, hit2present, and sane.

148  {
149  _id1 = _id2 = _row1 = _row2 = _col1 = _col2 = -1;
150  checked=false;
151  sane=false;
152  _moduleId=-1;
153  hit1present=false;
154  hit2present=false;
155  _distance = -1;
156  _overlapID = -1;
157 }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _distance
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
Double_t _col1
Definition: PndLmdHitPair.h:48
PndLmdHitPair::PndLmdHitPair ( Double_t  col1,
Double_t  row1,
Int_t  id1,
Double_t  col2,
Double_t  row2,
Int_t  id2 
)

Definition at line 132 of file PndLmdHitPair.cxx.

References _col1, _col2, _distance, _id1, _id2, _moduleId, _overlapID, _row1, _row2, checked, hit1present, hit2present, and sane.

132  {
133  _row1 = row1;
134  _row2 = row2;
135  _col1 = col1;
136  _col2 = col2;
137  _id1=id1;
138  _id2=id2;
139  checked=false;
140  sane=false;
141  _moduleId=-1;
142  hit1present=false;
143  hit2present=false;
144  _distance = -1;
145  _overlapID = -1;
146 }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _distance
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
Double_t _col1
Definition: PndLmdHitPair.h:48
PndLmdHitPair::PndLmdHitPair ( const TVector3 &  hit1,
const TVector3 &  hit2,
Int_t  id1,
Int_t  id2 
)

Definition at line 117 of file PndLmdHitPair.cxx.

References _col1, _col2, _distance, _hit1, _hit2, _id1, _id2, _moduleId, _overlapID, _row1, _row2, checked, hit1present, hit2present, and sane.

117  {
118  _row1 = _row2 = _col1 = _col2 = -1;
119  _hit1=hit1;
120  _hit2=hit2;
121  _id1=id1;
122  _id2=id2;
123  checked=false;
124  sane=false;
125  _moduleId=-1;
126  hit1present=true;
127  hit2present=true;
128  _distance = -1;
129  _overlapID = -1;
130 }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _distance
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
TVector3 _hit1
Definition: PndLmdHitPair.h:49
Double_t _col1
Definition: PndLmdHitPair.h:48
TVector3 _hit2
Definition: PndLmdHitPair.h:49
PndLmdHitPair::~PndLmdHitPair ( )

Definition at line 33 of file PndLmdHitPair.cxx.

33  {
34 
35 }

Member Function Documentation

void PndLmdHitPair::calculateDistance ( )

Definition at line 174 of file PndLmdHitPair.cxx.

References _distance, _hit1, _hit2, hit1present, and hit2present.

Referenced by PndLmdPairFinderTask::Exec().

174  {
175 
176 // calculate absolute distance between hit1 and hit2, keeping the z distance of 250 present.
177  if(hit1present && hit2present){
178  TVector3 distV = _hit1 - _hit2;
179  _distance = distV.Mag();
180  }
181  else{
182  _distance = -1;
183  }
184 }
Double_t _distance
Definition: PndLmdHitPair.h:48
TVector3 _hit1
Definition: PndLmdHitPair.h:49
TVector3 _hit2
Definition: PndLmdHitPair.h:49
void PndLmdHitPair::check ( )

Definition at line 66 of file PndLmdHitPair.cxx.

References _col1, _col2, _id1, _id2, _row1, _row2, checked, and sane.

Referenced by PndLmdAlignManager::addPairAndStartAligner(), and PndLmdPairFinderTask::Exec().

66  {
67 
68  bool colSane=false, rowSane=false, idsane=false, allVarsSet=false; //, distanceOk=false; //[R.K. 9/2018] unused
69  if(std::isinf(_col1) || std::isinf(_col2) || std::isnan(_col1) || std::isnan (_col2)){
70  colSane=false;
71  }
72  else{
73  colSane=true;
74  }
75  if(std::isinf(_row1) || std::isinf(_row2) || std::isnan(_row1) || std::isnan (_row2)){
76  rowSane=false;
77  }
78  else{
79  rowSane=true;
80  }
81  if(std::isinf(_id1) || std::isinf(_id2) || std::isnan(_id1) || std::isnan (_id2)){
82  idsane=false;
83  }
84  else{
85  idsane=true;
86  }
87 
88  //no row and col info, no valid pair
89  if(_row1 < 0 || _row2 < 0 || _col1 < 0 || _col2 < 0){
90  rowSane=false;
91  colSane=false;
92  return;
93  }
94 
95 // if(_id1 > -1 && _id2 > -1 && _moduleId > -1 && _overlapID > -1){
96 // allVarsSet = true;
97 // }
98 // else{
99 // allVarsSet = false;
100 // }
101 
102 // if(colSane && rowSane && idsane && allVarsSet){
103 // sane=true;
104 // checked = true;
105 // return;
106 // }
107  if(colSane && rowSane && idsane){
108  sane=true;
109  checked = true;
110  return;
111  }
112  else{
113  std::cerr << "colsane " << colSane << ", rowsane " << rowSane << ", idsane " << idsane << ", allVArsSet " << allVarsSet << std::endl;
114  }
115 }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
Double_t _col1
Definition: PndLmdHitPair.h:48
PndLmdHitPair::ClassDef ( PndLmdHitPair  ,
16   
)
Double_t PndLmdHitPair::getCol1 ( ) const
inline

Definition at line 111 of file PndLmdHitPair.h.

References _col1.

Referenced by PndLmdSensorAligner::addSimplePair().

111  {
112  return _col1;
113  }
Double_t _col1
Definition: PndLmdHitPair.h:48
Double_t PndLmdHitPair::getCol2 ( ) const
inline

Definition at line 120 of file PndLmdHitPair.h.

References _col2.

Referenced by PndLmdSensorAligner::addSimplePair().

120  {
121  return _col2;
122  }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t PndLmdHitPair::getDistance ( ) const
inline

Definition at line 164 of file PndLmdHitPair.h.

References _distance.

Referenced by PndLmdSensorAligner::addSimplePair(), and PndLmdPairFinderTask::pairDistanceValid().

164  {
165  return _distance;
166  }
Double_t _distance
Definition: PndLmdHitPair.h:48
const TVector3& PndLmdHitPair::getHit1 ( ) const
inline

Definition at line 79 of file PndLmdHitPair.h.

References _hit1.

Referenced by PndLmdSensorAligner::addSimplePair().

79  {
80  return _hit1;
81  }
TVector3 _hit1
Definition: PndLmdHitPair.h:49
const TVector3& PndLmdHitPair::getHit2 ( ) const
inline

Definition at line 89 of file PndLmdHitPair.h.

References _hit2.

Referenced by PndLmdSensorAligner::addSimplePair().

89  {
90  return _hit2;
91  }
TVector3 _hit2
Definition: PndLmdHitPair.h:49
Int_t PndLmdHitPair::getId1 ( ) const
inline

Definition at line 57 of file PndLmdHitPair.h.

References _id1.

Referenced by PndLmdPairFinderTask::candHitsOverlappingArea(), PndLmdPairFinderTask::Exec(), and PndLmdPairFinderTask::getStatistics().

57  {
58  return _id1;
59  }
Int_t PndLmdHitPair::getId2 ( ) const
inline

Definition at line 60 of file PndLmdHitPair.h.

References _id2.

Referenced by PndLmdPairFinderTask::candHitsOverlappingArea(), and PndLmdPairFinderTask::Exec().

60  {
61  return _id2;
62  }
Int_t PndLmdHitPair::getModuleId ( ) const
inline

Definition at line 147 of file PndLmdHitPair.h.

References _moduleId.

147  {
148  return _moduleId;
149  }
Int_t PndLmdHitPair::getOverlapId ( ) const
inline

Definition at line 175 of file PndLmdHitPair.h.

References _overlapID.

Referenced by PndLmdAlignManager::addPairAndStartAligner().

175  {
176  return _overlapID;
177  }
Double_t PndLmdHitPair::getRow1 ( ) const
inline

Definition at line 129 of file PndLmdHitPair.h.

References _row1.

Referenced by PndLmdSensorAligner::addSimplePair().

129  {
130  return _row1;
131  }
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t PndLmdHitPair::getRow2 ( ) const
inline

Definition at line 138 of file PndLmdHitPair.h.

References _row2.

Referenced by PndLmdSensorAligner::addSimplePair().

138  {
139  return _row2;
140  }
Double_t _row2
Definition: PndLmdHitPair.h:48
bool PndLmdHitPair::hitSensors ( Int_t  first,
Int_t  second 
)

Definition at line 159 of file PndLmdHitPair.cxx.

References _id1, and _id2.

159  {
160 
161  if(first == _id1){
162  if(second == _id2){
163  return true;
164  }
165  }
166  else if(first == _id2){
167  if(second == _id1){
168  return true;
169  }
170  }
171  return false;
172 }
bool PndLmdHitPair::isHit1present ( ) const
inline

Definition at line 156 of file PndLmdHitPair.h.

References hit1present.

156  {
157  return hit1present;
158  }
bool PndLmdHitPair::isHit2present ( ) const
inline

Definition at line 160 of file PndLmdHitPair.h.

References hit2present.

160  {
161  return hit2present;
162  }
bool PndLmdHitPair::isSane ( ) const
inline

Definition at line 75 of file PndLmdHitPair.h.

References sane.

Referenced by PndLmdAlignManager::addPairAndStartAligner(), and PndLmdPairFinderTask::Exec().

75  {
76  return sane;
77  }
bool PndLmdHitPair::operator== ( const PndLmdHitPair rhs)

Definition at line 37 of file PndLmdHitPair.cxx.

References _hit1, _hit2, _id1, and _id2.

37  {
38  if(_hit1==rhs._hit1 && _hit2 == rhs._hit2 && _id1 == rhs._id1 && _id2 == rhs._id2){
39  return true;
40  }
41  if(_hit1==rhs._hit2 && _hit2 == rhs._hit1 && _id1 == rhs._id2 && _id2 == rhs._id1){
42  return true;
43  }
44  return false;
45 }
TVector3 _hit1
Definition: PndLmdHitPair.h:49
TVector3 _hit2
Definition: PndLmdHitPair.h:49
void PndLmdHitPair::PrintPair ( ) const

Definition at line 48 of file PndLmdHitPair.cxx.

References _col1, _col2, _distance, _hit1, _hit2, _id1, _id2, _moduleId, _overlapID, _row1, and _row2.

Referenced by PndLmdPairFinderTask::Exec().

48  {
49  std::cout << "=========== PndLmdHitPair::Print() ==========" << std::endl;
50  std::cout << "=hitPair= col1: " << _col1 << ", col2: " << _col2 << ", row1: " << _row1 << ", row2: ";
51  std::cout << _row2 << ", id1: " << _id1 << ", id2: " << _id2 << "\n moduleID: " << _moduleId << ", overlap ID: " << _overlapID << ", distance " << _distance << std::endl;
52  std::cout << "------ hit 1 ------ " << std::endl;
53  std::cout << "x: " << _hit1.x() << std::endl;
54  std::cout << "y: " << _hit1.y() << std::endl;
55  std::cout << "z: " << _hit1.z() << std::endl;
56  std::cout << "------ hit 2 ------ " << std::endl;
57  std::cout << "x: " << _hit2.x() << std::endl;
58  std::cout << "y: " << _hit2.y() << std::endl;
59  std::cout << "z: " << _hit2.z() << std::endl;
60 }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _distance
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
TVector3 _hit1
Definition: PndLmdHitPair.h:49
Double_t _col1
Definition: PndLmdHitPair.h:48
TVector3 _hit2
Definition: PndLmdHitPair.h:49
void PndLmdHitPair::setCol1 ( Double_t  col1)
inline

Definition at line 115 of file PndLmdHitPair.h.

115  {
116  _col1 = col1;
117  checked = false;
118  }
Double_t _col1
Definition: PndLmdHitPair.h:48
void PndLmdHitPair::setCol2 ( Double_t  col2)
inline

Definition at line 124 of file PndLmdHitPair.h.

124  {
125  _col2 = col2;
126  checked = false;
127  }
Double_t _col2
Definition: PndLmdHitPair.h:48
void PndLmdHitPair::setDistance ( Double_t  distance)
inline

Definition at line 170 of file PndLmdHitPair.h.

170  {
171  _distance = distance;
172  checked = false;
173  }
Double_t _distance
Definition: PndLmdHitPair.h:48
void PndLmdHitPair::setHit1 ( const TVector3 &  hit1)
inline

Definition at line 83 of file PndLmdHitPair.h.

Referenced by BOOST_AUTO_TEST_CASE().

83  {
84  _hit1 = hit1;
85  checked = false;
86  hit1present=true;
87  }
TVector3 _hit1
Definition: PndLmdHitPair.h:49
void PndLmdHitPair::setHit2 ( const TVector3 &  hit2)
inline

Definition at line 93 of file PndLmdHitPair.h.

Referenced by BOOST_AUTO_TEST_CASE().

93  {
94  _hit2 = hit2;
95  checked = false;
96  hit2present=true;
97  }
TVector3 _hit2
Definition: PndLmdHitPair.h:49
void PndLmdHitPair::setId1 ( Int_t  ID1)
inline

Definition at line 64 of file PndLmdHitPair.h.

64  {
65  _id1 = ID1;
66  checked = false;
67  }
void PndLmdHitPair::setId2 ( Int_t  ID2)
inline

Definition at line 69 of file PndLmdHitPair.h.

69  {
70  _id2 = ID2;
71  checked = false;
72  }
void PndLmdHitPair::setModuleId ( Int_t  moduleId)
inline

Definition at line 151 of file PndLmdHitPair.h.

151  {
152  _moduleId = moduleId;
153  checked = false;
154  }
void PndLmdHitPair::setOverlapId ( Int_t  overlapId)
inline

Definition at line 179 of file PndLmdHitPair.h.

Referenced by PndLmdPairFinderTask::Exec().

179  {
180  _overlapID = overlapId;
181  checked = false;
182  }
void PndLmdHitPair::setPixelHits ( double  col1,
double  row1,
double  col2,
double  row2 
)
inline

Definition at line 99 of file PndLmdHitPair.h.

Referenced by PndLmdPairFinderTask::Exec().

99  {
100  _row1 = row1;
101  _col1 = col1;
102 
103  _row2 = row2;
104  _col2 = col2;
105  }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
Double_t _col1
Definition: PndLmdHitPair.h:48
void PndLmdHitPair::setRow1 ( Double_t  row1)
inline

Definition at line 133 of file PndLmdHitPair.h.

133  {
134  _row1 = row1;
135  checked = false;
136  }
Double_t _row1
Definition: PndLmdHitPair.h:48
void PndLmdHitPair::setRow2 ( Double_t  row2)
inline

Definition at line 142 of file PndLmdHitPair.h.

142  {
143  _row2 = row2;
144  checked = false;
145  }
Double_t _row2
Definition: PndLmdHitPair.h:48
void PndLmdHitPair::swapHits ( )

Definition at line 186 of file PndLmdHitPair.cxx.

References _col1, _col2, _hit1, _hit2, _id1, _id2, _row1, _row2, and checked.

186  {
187 
188  checked = false;
189  std::swap(_id1, _id2);
190  std::swap(_hit1, _hit2);
191  std::swap(_row1, _row2);
192  std::swap(_col1, _col2);
193 }
Double_t _col2
Definition: PndLmdHitPair.h:48
Double_t _row1
Definition: PndLmdHitPair.h:48
Double_t _row2
Definition: PndLmdHitPair.h:48
TVector3 _hit1
Definition: PndLmdHitPair.h:49
Double_t _col1
Definition: PndLmdHitPair.h:48
TVector3 _hit2
Definition: PndLmdHitPair.h:49

Member Data Documentation

Double_t PndLmdHitPair::_col1
private

Definition at line 48 of file PndLmdHitPair.h.

Referenced by check(), getCol1(), PndLmdHitPair(), PrintPair(), and swapHits().

Double_t PndLmdHitPair::_col2
private

Definition at line 48 of file PndLmdHitPair.h.

Referenced by check(), getCol2(), PndLmdHitPair(), PrintPair(), and swapHits().

Double_t PndLmdHitPair::_distance
private

Definition at line 48 of file PndLmdHitPair.h.

Referenced by calculateDistance(), getDistance(), PndLmdHitPair(), and PrintPair().

TVector3 PndLmdHitPair::_hit1
private
TVector3 PndLmdHitPair::_hit2
private
Int_t PndLmdHitPair::_id1
private

Definition at line 50 of file PndLmdHitPair.h.

Referenced by check(), getId1(), hitSensors(), operator==(), PndLmdHitPair(), PrintPair(), and swapHits().

Int_t PndLmdHitPair::_id2
private

Definition at line 50 of file PndLmdHitPair.h.

Referenced by check(), getId2(), hitSensors(), operator==(), PndLmdHitPair(), PrintPair(), and swapHits().

Int_t PndLmdHitPair::_moduleId
private

Definition at line 51 of file PndLmdHitPair.h.

Referenced by getModuleId(), PndLmdHitPair(), and PrintPair().

Int_t PndLmdHitPair::_overlapID
private

Definition at line 51 of file PndLmdHitPair.h.

Referenced by getOverlapId(), PndLmdHitPair(), and PrintPair().

Double_t PndLmdHitPair::_row1
private

Definition at line 48 of file PndLmdHitPair.h.

Referenced by check(), getRow1(), PndLmdHitPair(), PrintPair(), and swapHits().

Double_t PndLmdHitPair::_row2
private

Definition at line 48 of file PndLmdHitPair.h.

Referenced by check(), getRow2(), PndLmdHitPair(), PrintPair(), and swapHits().

bool PndLmdHitPair::checked
private

Definition at line 52 of file PndLmdHitPair.h.

Referenced by check(), PndLmdHitPair(), and swapHits().

bool PndLmdHitPair::hit1present
private

Definition at line 52 of file PndLmdHitPair.h.

Referenced by calculateDistance(), isHit1present(), and PndLmdHitPair().

bool PndLmdHitPair::hit2present
private

Definition at line 52 of file PndLmdHitPair.h.

Referenced by calculateDistance(), isHit2present(), and PndLmdHitPair().

bool PndLmdHitPair::sane
private

Definition at line 52 of file PndLmdHitPair.h.

Referenced by check(), isSane(), and PndLmdHitPair().


The documentation for this class was generated from the following files: