All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PmaHit3D.h
Go to the documentation of this file.
1 /**
2  * @file PmaHit3D.h
3  *
4  * @author D.Stefan and R.Sulej
5  *
6  * @brief Implementation of the Projection Matching Algorithm
7  *
8  * Hit 3D wrapped around recob::Hit. Adds support for PMA optimizations.
9  * See PmaTrack3D.h file for details.
10  */
11 
12 #ifndef PmaHit3D_h
13 #define PmaHit3D_h
14 
15 #include "canvas/Persistency/Common/Ptr.h"
17 namespace detinfo {
18  class DetectorPropertiesData;
19 }
20 
21 #include <cmath>
22 
23 #include "TVector2.h"
24 #include "TVector3.h"
25 
26 namespace pma {
27  class Hit3D;
28  class Track3D;
29 }
30 
31 class pma::Hit3D {
32  friend class Track3D;
33  friend struct bTrajectory3DOrderLess;
34 
35 public:
36  Hit3D();
37  Hit3D(detinfo::DetectorPropertiesData const& detProp, art::Ptr<recob::Hit> src);
39  unsigned int wire,
40  unsigned int view,
41  unsigned int tpc,
42  unsigned int cryo,
43  float peaktime,
44  float ampl,
45  float area);
46  Hit3D(const pma::Hit3D& src);
47 
48  art::Ptr<recob::Hit> const&
49  Hit2DPtr() const
50  {
51  return fHit;
52  }
53 
54  TVector3 const&
55  Point3D() const
56  {
57  return fPoint3D;
58  }
59 
60  void
61  SetPoint3D(const TVector3& p3d)
62  {
63  fPoint3D = p3d;
64  }
65  void
66  SetPoint3D(double x, double y, double z)
67  {
68  fPoint3D.SetXYZ(x, y, z);
69  }
70 
71  TVector2 const&
72  Point2D() const noexcept
73  {
74  return fPoint2D;
75  }
76  TVector2 const&
77  Projection2D() const noexcept
78  {
79  return fProjection2D;
80  }
81 
82  unsigned int
83  Cryo() const noexcept
84  {
85  return fCryo;
86  }
87  unsigned int
88  TPC() const noexcept
89  {
90  return fTPC;
91  }
92  unsigned int
93  View2D() const noexcept
94  {
95  return fPlane;
96  }
97  unsigned int
98  Wire() const noexcept
99  {
100  return fWire;
101  }
102  float
103  PeakTime() const noexcept
104  {
105  return fPeakTime;
106  }
107 
108  float
109  SummedADC() const noexcept
110  {
111  return fArea;
112  }
113  float
114  GetAmplitude() const noexcept
115  {
116  return fAmpl;
117  }
118  float
120  {
121  return fSigmaFactor;
122  }
123  void
124  SetSigmaFactor(float value) noexcept
125  {
127  }
128 
129  double
130  Dx() const noexcept
131  {
132  return fDx;
133  }
134 
135  double
137  {
138  return sqrt(GetDist2ToProj());
139  }
140  double GetDist2ToProj() const;
141 
142  float
144  {
145  return fSegFraction;
146  }
147  void
148  SetProjection(const TVector2& p, float b)
149  {
150  fProjection2D.Set(p);
151  fSegFraction = b;
152  }
153  void
154  SetProjection(double x, double y, float b)
155  {
156  fProjection2D.Set(x, y);
157  fSegFraction = b;
158  }
159 
160  bool
161  IsEnabled() const noexcept
162  {
163  return (fEnabled && !fOutlier);
164  }
165  void
166  SetEnabled(bool state) noexcept
167  {
168  fEnabled = state;
169  }
170 
171  bool
172  IsOutlier() const noexcept
173  {
174  return fOutlier;
175  }
176  void
177  TagOutlier(bool state) noexcept
178  {
179  fOutlier = state;
180  }
181 
182 private:
183  art::Ptr<recob::Hit> fHit; // source 2D hit
184 
185  unsigned int fCryo, fTPC, fPlane, fWire;
187 
188  TVector3 fPoint3D; // hit position in 3D space
189  TVector2 fPoint2D; // hit position in 2D wire view, scaled to [cm]
190  TVector2 fProjection2D; // projection to polygonal line in 2D wire view, scaled to [cm]
191  float fSegFraction; // segment fraction set by the projection
192  float fSigmaFactor; // impact factor on the objective function
193 
194  double fDx; // dx seen by corresponding 2D hit, set during dQ/dx sequece calculation
195 
196  bool fEnabled; // used or not in the optimisation - due to various reasons
197  bool fOutlier; // tagged as a not really hit of this track (like delta ray)
198 
199  pma::Track3D* fParent; // track which contains this hit
200 };
201 
202 #endif
process_name opflash particleana ie ie ie z
double Dx() const noexcept
Definition: PmaHit3D.h:130
unsigned int fCryo
Definition: PmaHit3D.h:185
process_name opflash particleana ie x
void SetProjection(double x, double y, float b)
Definition: PmaHit3D.h:154
pma::Track3D * fParent
Definition: PmaHit3D.h:199
TVector2 fProjection2D
Definition: PmaHit3D.h:190
float fArea
Definition: PmaHit3D.h:186
float PeakTime() const noexcept
Definition: PmaHit3D.h:103
Declaration of signal hit object.
float GetSegFraction() const noexcept
Definition: PmaHit3D.h:143
pdgs p
Definition: selectors.fcl:22
float GetSigmaFactor() const noexcept
Definition: PmaHit3D.h:119
float fSegFraction
Definition: PmaHit3D.h:191
void SetPoint3D(double x, double y, double z)
Definition: PmaHit3D.h:66
TVector3 const & Point3D() const
Definition: PmaHit3D.h:55
void TagOutlier(bool state) noexcept
Definition: PmaHit3D.h:177
TVector3 fPoint3D
Definition: PmaHit3D.h:188
double GetDist2ToProj() const
Definition: PmaHit3D.cxx:110
float GetAmplitude() const noexcept
Definition: PmaHit3D.h:114
process_name opflash particleana ie ie y
unsigned int fTPC
Definition: PmaHit3D.h:185
double fDx
Definition: PmaHit3D.h:194
bool fOutlier
Definition: PmaHit3D.h:197
unsigned int fPlane
Definition: PmaHit3D.h:185
unsigned int View2D() const noexcept
Definition: PmaHit3D.h:93
unsigned int TPC() const noexcept
Definition: PmaHit3D.h:88
float fAmpl
Definition: PmaHit3D.h:186
float fPeakTime
Definition: PmaHit3D.h:186
void SetEnabled(bool state) noexcept
Definition: PmaHit3D.h:166
void SetSigmaFactor(float value) noexcept
Definition: PmaHit3D.h:124
void SetProjection(const TVector2 &p, float b)
Definition: PmaHit3D.h:148
art::Ptr< recob::Hit > fHit
Definition: PmaHit3D.h:183
bool IsOutlier() const noexcept
Definition: PmaHit3D.h:172
TVector2 const & Point2D() const noexcept
Definition: PmaHit3D.h:72
unsigned int Cryo() const noexcept
Definition: PmaHit3D.h:83
float fSigmaFactor
Definition: PmaHit3D.h:192
double GetDistToProj() const
Definition: PmaHit3D.h:136
void SetPoint3D(const TVector3 &p3d)
Definition: PmaHit3D.h:61
art::Ptr< recob::Hit > const & Hit2DPtr() const
Definition: PmaHit3D.h:49
bool fEnabled
Definition: PmaHit3D.h:196
bool IsEnabled() const noexcept
Definition: PmaHit3D.h:161
unsigned int Wire() const noexcept
Definition: PmaHit3D.h:98
temporary value
TVector2 fPoint2D
Definition: PmaHit3D.h:189
auto const detProp
float SummedADC() const noexcept
Definition: PmaHit3D.h:109
unsigned int fWire
Definition: PmaHit3D.h:185
TVector2 const & Projection2D() const noexcept
Definition: PmaHit3D.h:77