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