LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
TrackCalorimetryAlg.h
Go to the documentation of this file.
1 #ifndef TRACKCALORIMETRYALG_H
2 #define TRACKCALORIMETRYALG_H
3 
14 
15 #include "fhiclcpp/ParameterSet.h"
16 
17 #include "TVector3.h"
18 
19 #include <iostream>
20 #include <set>
21 
22 namespace anab {
23  class Calorimetry;
24 }
25 namespace detinfo {
26  class DetectorClocksData;
27  class DetectorPropertiesData;
28 }
29 namespace geo {
30  struct PlaneID;
31  struct WireID;
32 }
33 namespace recob {
34  class Hit;
35  class Track;
36 }
37 
38 namespace calo {
39  class TrackCalorimetryAlg;
40 }
41 
43 public:
45 
46  void ExtractCalorimetry(detinfo::DetectorClocksData const& clock_data,
47  detinfo::DetectorPropertiesData const& det_prop,
48  std::vector<recob::Track> const&,
49  std::vector<recob::Hit> const&,
50  std::vector<std::vector<size_t>> const&,
51  std::vector<anab::Calorimetry>&,
52  std::vector<size_t>&,
53  geo::WireReadoutGeom const&);
54 
55 private:
57  unsigned int fNHitsToDetermineStart;
58 
59  struct HitProperties {
60  HitProperties() = default;
61  HitProperties(float q, float dqdx, float dedx, float p, TVector3 pos, float pf)
62  : charge(q), dQdx(dqdx), dEdx(dedx), pitch(p), xyz(pos), path_fraction(pf)
63  {}
64  float charge;
65  float dQdx;
66  float dEdx;
67  float pitch;
68  TVector3 xyz;
70  void Print() const
71  {
72  std::cout << "\tCharge " << charge << " dQdx " << dQdx << " dEdx " << dEdx << " pitch "
73  << pitch << " (x,y,z) (" << xyz.X() << "," << xyz.Y() << "," << xyz.Z() << ")"
74  << " path_fraction " << path_fraction << std::endl;
75  }
76  };
78  bool operator()(HitProperties const& i, HitProperties const& j) const
79  {
80  return i.path_fraction < j.path_fraction;
81  }
82  };
83 
84  using HitPropertiesMultiset_t = std::multiset<HitProperties, HitPropertySorter>;
85 
86  std::vector<float> CreatePathLengthFractionVector(recob::Track const& track);
87 
88  void AnalyzeHit(detinfo::DetectorClocksData const&,
90  recob::Hit const&,
91  recob::Track const&,
92  std::vector<std::pair<geo::WireID, float>> const&,
93  std::vector<float> const&,
95  geo::WireReadoutGeom const&);
96 
97  bool IsInvertedTrack(HitPropertiesMultiset_t const&);
98 
99  void MakeCalorimetryObject(HitPropertiesMultiset_t const& hpm,
100  recob::Track const& track,
101  size_t const& i_track,
102  std::vector<anab::Calorimetry>& caloVector,
103  std::vector<size_t>& assnTrackCaloVector,
104  geo::PlaneID const& planeID);
105 
106  void PrintHitPropertiesMultiset(HitPropertiesMultiset_t const& hpm);
107 };
108 
109 #endif
bool operator()(HitProperties const &i, HitProperties const &j) const
Reconstruction base classes.
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
std::multiset< HitProperties, HitPropertySorter > HitPropertiesMultiset_t
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
Interface for a class providing readout channel mapping to geometry.
General LArSoft Utilities.
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2671
Contains all timing reference information for the detector.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
HitProperties(float q, float dqdx, float dedx, float p, TVector3 pos, float pf)
ROOT libraries.
Float_t track
Definition: plot.C:35
Definition: Track.hh:42
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
calorimetry