TrackCalorimetryAlg.h
Go to the documentation of this file.
1 #ifndef TRACKCALORIMETRYALG_H
2 #define TRACKCALORIMETRYALG_H
3 /*!
4  * Title: Track Calorimetry Algorithim Class
5  * Author: Wes Ketchum (wketchum@lanl.gov), based on code the Calorimetry_module
6  *
7  * Description: Algorithm that produces a calorimetry object given a track
8  * Input: recob::Track, Assn<recob::Spacepoint,recob::Track>, Assn<recob::Hit,recob::Track>
9  * Output: anab::Calorimetry, (and Assn<anab::Calorimetry,recob::Track>)
10 */
11 #include <iostream>
12 
15 
17 
18 #include "TVector3.h"
19 #include <set>
20 
21 namespace anab {
22  class Calorimetry;
23 }
24 namespace detinfo {
25  class DetectorClocksData;
26  class DetectorPropertiesData;
27  class LArProperties;
28 }
29 namespace fhicl {
30  class ParameterSet;
31 }
32 namespace geo {
33  struct PlaneID;
34  struct WireID;
35 }
36 namespace recob {
37  class Hit;
38  class Track;
39 }
40 
41 namespace calo {
42  class TrackCalorimetryAlg;
43 }
44 
46 public:
48 
50 
51  void ExtractCalorimetry(detinfo::DetectorClocksData const& clock_data,
52  detinfo::DetectorPropertiesData const& det_prop,
53  std::vector<recob::Track> const&,
54  std::vector<recob::Hit> const&,
55  std::vector<std::vector<size_t>> const&,
56  std::vector<anab::Calorimetry>&,
57  std::vector<size_t>&,
58  Providers_t providers);
59 
60 private:
62  unsigned int fNHitsToDetermineStart;
63 
64  struct HitProperties {
65  HitProperties() = default;
66  HitProperties(float q, float dqdx, float dedx, float p, TVector3 pos, float pf)
67  : charge(q), dQdx(dqdx), dEdx(dedx), pitch(p), xyz(pos), path_fraction(pf)
68  {}
69  float charge;
70  float dQdx;
71  float dEdx;
72  float pitch;
73  TVector3 xyz;
75  void
76  Print() const
77  {
78  std::cout << "\tCharge " << charge << " dQdx " << dQdx << " dEdx " << dEdx << " pitch "
79  << pitch << " (x,y,z) (" << xyz.X() << "," << xyz.Y() << "," << xyz.Z() << ")"
80  << " path_fraction " << path_fraction << std::endl;
81  }
82  };
84  bool
85  operator()(HitProperties const& i, HitProperties const& j) const
86  {
87  return i.path_fraction < j.path_fraction;
88  }
89  };
90 
91  using HitPropertiesMultiset_t = std::multiset<HitProperties, HitPropertySorter>;
92 
93  void
95  {}
96  void
98  {}
99 
100  std::vector<float> CreatePathLengthFractionVector(recob::Track const& track);
101 
102  void AnalyzeHit(detinfo::DetectorClocksData const&,
104  recob::Hit const&,
105  recob::Track const&,
106  std::vector<std::pair<geo::WireID, float>> const&,
107  std::vector<float> const&,
109  geo::GeometryCore const&);
110 
111  bool IsInvertedTrack(HitPropertiesMultiset_t const&);
112 
113  void MakeCalorimetryObject(HitPropertiesMultiset_t const& hpm,
114  recob::Track const& track,
115  size_t const& i_track,
116  std::vector<anab::Calorimetry>& caloVector,
117  std::vector<size_t>& assnTrackCaloVector,
118  geo::PlaneID const& planeID);
119 
120  void PrintHitPropertiesMultiset(HitPropertiesMultiset_t const& hpm);
121 };
122 
123 #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:472
struct vector vector
Data structure containing constant pointers to classes.
std::multiset< HitProperties, HitPropertySorter > HitPropertiesMultiset_t
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
p
Definition: test.py:223
void ReserveInternalVectors(size_t s)
General LArSoft Utilities.
Description of geometry of one entire detector.
Contains all timing reference information for the detector.
Container for a list of pointers to providers.
Definition: ProviderPack.h:114
Access the description of detector geometry.
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:1036
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
HitProperties(float q, float dqdx, float dedx, float p, TVector3 pos, float pf)
LArSoft geometry interface.
Definition: ChannelGeo.h:16
static QCString * s
Definition: config.cpp:1042
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
QTextStream & endl(QTextStream &s)