LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PmaHit3D.h
Go to the documentation of this file.
1 
12 #ifndef PmaHit3D_h
13 #define PmaHit3D_h
14 
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();
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& Hit2DPtr() const { return fHit; }
49 
50  TVector3 const& Point3D() const { return fPoint3D; }
51 
52  void SetPoint3D(const TVector3& p3d) { fPoint3D = p3d; }
53  void SetPoint3D(double x, double y, double z) { fPoint3D.SetXYZ(x, y, z); }
54 
55  TVector2 const& Point2D() const noexcept { return fPoint2D; }
56  TVector2 const& Projection2D() const noexcept { return fProjection2D; }
57 
58  unsigned int Cryo() const noexcept { return fCryo; }
59  unsigned int TPC() const noexcept { return fTPC; }
60  unsigned int View2D() const noexcept { return fPlane; }
61  unsigned int Wire() const noexcept { return fWire; }
62  float PeakTime() const noexcept { return fPeakTime; }
63 
64  float SummedADC() const noexcept { return fArea; }
65  float GetAmplitude() const noexcept { return fAmpl; }
66  float GetSigmaFactor() const noexcept { return fSigmaFactor; }
67  void SetSigmaFactor(float value) noexcept { fSigmaFactor = value; }
68 
69  double Dx() const noexcept { return fDx; }
70 
71  double GetDistToProj() const { return sqrt(GetDist2ToProj()); }
72  double GetDist2ToProj() const;
73 
74  float GetSegFraction() const noexcept { return fSegFraction; }
75  void SetProjection(const TVector2& p, float b)
76  {
77  fProjection2D.Set(p);
78  fSegFraction = b;
79  }
80  void SetProjection(double x, double y, float b)
81  {
82  fProjection2D.Set(x, y);
83  fSegFraction = b;
84  }
85 
86  bool IsEnabled() const noexcept { return (fEnabled && !fOutlier); }
87  void SetEnabled(bool state) noexcept { fEnabled = state; }
88 
89  bool IsOutlier() const noexcept { return fOutlier; }
90  void TagOutlier(bool state) noexcept { fOutlier = state; }
91 
92 private:
93  art::Ptr<recob::Hit> fHit; // source 2D hit
94 
95  unsigned int fCryo, fTPC, fPlane, fWire;
96  float fPeakTime, fAmpl, fArea;
97 
98  TVector3 fPoint3D; // hit position in 3D space
99  TVector2 fPoint2D; // hit position in 2D wire view, scaled to [cm]
100  TVector2 fProjection2D; // projection to polygonal line in 2D wire view, scaled to [cm]
101  float fSegFraction; // segment fraction set by the projection
102  float fSigmaFactor; // impact factor on the objective function
103 
104  double fDx; // dx seen by corresponding 2D hit, set during dQ/dx sequece calculation
105 
106  bool fEnabled; // used or not in the optimisation - due to various reasons
107  bool fOutlier; // tagged as a not really hit of this track (like delta ray)
108 
109  pma::Track3D* fParent; // track which contains this hit
110 };
111 
112 #endif
Float_t x
Definition: compare.C:6
TVector2 const & Projection2D() const noexcept
Definition: PmaHit3D.h:56
float GetSigmaFactor() const noexcept
Definition: PmaHit3D.h:66
TVector2 const & Point2D() const noexcept
Definition: PmaHit3D.h:55
void SetProjection(double x, double y, float b)
Definition: PmaHit3D.h:80
pma::Track3D * fParent
Definition: PmaHit3D.h:109
TVector2 fProjection2D
Definition: PmaHit3D.h:100
Declaration of signal hit object.
Float_t y
Definition: compare.C:6
bool IsEnabled() const noexcept
Definition: PmaHit3D.h:86
Double_t z
Definition: plot.C:276
unsigned int Cryo() const noexcept
Definition: PmaHit3D.h:58
float fSegFraction
Definition: PmaHit3D.h:101
void SetPoint3D(double x, double y, double z)
Definition: PmaHit3D.h:53
TVector3 const & Point3D() const
Definition: PmaHit3D.h:50
void TagOutlier(bool state) noexcept
Definition: PmaHit3D.h:90
TVector3 fPoint3D
Definition: PmaHit3D.h:98
unsigned int Wire() const noexcept
Definition: PmaHit3D.h:61
float GetAmplitude() const noexcept
Definition: PmaHit3D.h:65
float PeakTime() const noexcept
Definition: PmaHit3D.h:62
double fDx
Definition: PmaHit3D.h:104
bool fOutlier
Definition: PmaHit3D.h:107
float fPeakTime
Definition: PmaHit3D.h:96
float SummedADC() const noexcept
Definition: PmaHit3D.h:64
void SetEnabled(bool state) noexcept
Definition: PmaHit3D.h:87
void SetSigmaFactor(float value) noexcept
Definition: PmaHit3D.h:67
General LArSoft Utilities.
void SetProjection(const TVector2 &p, float b)
Definition: PmaHit3D.h:75
float GetSegFraction() const noexcept
Definition: PmaHit3D.h:74
double value
Definition: spectrum.C:18
art::Ptr< recob::Hit > fHit
Definition: PmaHit3D.h:93
unsigned int View2D() const noexcept
Definition: PmaHit3D.h:60
float fSigmaFactor
Definition: PmaHit3D.h:102
double Dx() const noexcept
Definition: PmaHit3D.h:69
double GetDistToProj() const
Definition: PmaHit3D.h:71
bool IsOutlier() const noexcept
Definition: PmaHit3D.h:89
void SetPoint3D(const TVector3 &p3d)
Definition: PmaHit3D.h:52
art::Ptr< recob::Hit > const & Hit2DPtr() const
Definition: PmaHit3D.h:48
bool fEnabled
Definition: PmaHit3D.h:106
unsigned int TPC() const noexcept
Definition: PmaHit3D.h:59
TVector2 fPoint2D
Definition: PmaHit3D.h:99
unsigned int fWire
Definition: PmaHit3D.h:95