LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
ShowerTrajPointdEdx_tool.cc
Go to the documentation of this file.
1 //############################################################################
2 //### Name: ShowerTrajPointdEdx ###
3 //### Author: Dominic Barker (dominic.barker@sheffield.ac.uk) ###
4 //### Date: 13.05.19 ###
5 //### Description: Tool for finding the dEdx of the start track of the ###
6 //### shower using the standard calomitry module. This ###
7 //### takes the sliding fit trajectory to make a 3D dEdx. ###
8 //### This module is best used with the sliding linear fit ###
9 //### and ShowerTrackTrajToSpacePoint ###
10 //############################################################################
11 
12 //Framework Includes
14 
15 //LArSoft Includes
26 
27 //ROOT
28 #include "Math/VectorUtil.h"
29 
30 using ROOT::Math::VectorUtil::Angle;
31 
32 namespace ShowerRecoTools {
33 
35 
36  public:
38 
39  //Physics Function. Calculate the dEdx.
40  int CalculateElement(const art::Ptr<recob::PFParticle>& pfparticle,
41  art::Event& Event,
42  reco::shower::ShowerElementHolder& ShowerEleHolder) override;
43 
44  void FinddEdxLength(std::vector<double>& dEdx_vec, std::vector<double>& dEdx_val);
45 
46  private:
47  //Servcies and Algorithms
51 
52  //fcl parameters
53  float fMinAngleToWire; //Minimum angle between the wire direction and the shower
54  //direction for the spacepoint to be used. Default means
55  //the cut has no effect. In radians.
56  float fShapingTime; //Shaping time of the ASIC defualt so we don't cut on track
57  //going too much into the plane. In Microseconds
58  float fMinDistCutOff; //Distance in wires a hit has to be from the start position
59  //to be used
60  float fMaxDist, MaxDist; //Distance in wires a that a trajectory point can be from a
61  //spacepoint to match to it.
63  dEdxTrackLength; //Max Distance a spacepoint can be away from the start of the
64  //track. In cm
65  float fdEdxCut;
66  bool fUseMedian; //Use the median value as the dEdx rather than the mean.
67  bool fCutStartPosition; //Remove hits using MinDistCutOff from the vertex as well.
68 
69  bool fT0Correct; // Whether to look for a T0 associated to the PFP
70  bool fSCECorrectPitch; // Whether to correct the "squeezing" of pitch, requires corrected input
71  bool
72  fSCECorrectEField; // Whether to use the local electric field, from SpaceChargeService, in recombination calc.
73  bool
74  fSCEInputCorrected; // Whether the input has already been corrected for spatial SCE distortions
75 
76  bool fSumHitSnippets; // Whether to treat hits individually or only one hit per snippet
77 
79  int fVerbose;
80 
88  };
89 
91  : IShowerTool(pset.get<fhicl::ParameterSet>("BaseTools"))
92  , fCalorimetryAlg(pset.get<fhicl::ParameterSet>("CalorimetryAlg"))
93  , fMinAngleToWire(pset.get<float>("MinAngleToWire"))
94  , fShapingTime(pset.get<float>("ShapingTime"))
95  , fMinDistCutOff(pset.get<float>("MinDistCutOff"))
96  , fMaxDist(pset.get<float>("MaxDist"))
97  , fdEdxTrackLength(pset.get<float>("dEdxTrackLength"))
98  , fdEdxCut(pset.get<float>("dEdxCut"))
99  , fUseMedian(pset.get<bool>("UseMedian"))
100  , fCutStartPosition(pset.get<bool>("CutStartPosition"))
101  , fT0Correct(pset.get<bool>("T0Correct"))
102  , fSCECorrectPitch(pset.get<bool>("SCECorrectPitch"))
103  , fSCECorrectEField(pset.get<bool>("SCECorrectEField"))
104  , fSCEInputCorrected(pset.get<bool>("SCEInputCorrected"))
105  , fSumHitSnippets(pset.get<bool>("SumHitSnippets"))
106  , fPFParticleLabel(pset.get<art::InputTag>("PFParticleLabel"))
107  , fVerbose(pset.get<int>("Verbose"))
108  , fShowerStartPositionInputLabel(pset.get<std::string>("ShowerStartPositionInputLabel"))
109  , fInitialTrackHitsInputLabel(pset.get<std::string>("InitialTrackHitsInputLabel"))
110  , fInitialTrackSpacePointsInputLabel(pset.get<std::string>("InitialTrackSpacePointsInputLabel"))
111  , fInitialTrackInputLabel(pset.get<std::string>("InitialTrackInputLabel"))
112  , fShowerdEdxOutputLabel(pset.get<std::string>("ShowerdEdxOutputLabel"))
113  , fShowerBestPlaneOutputLabel(pset.get<std::string>("ShowerBestPlaneOutputLabel"))
114  , fShowerdEdxVecOutputLabel(pset.get<std::string>("ShowerdEdxVecOutputLabel"))
115  {
117  throw cet::exception("ShowerTrajPointdEdx")
118  << "Can only correct for SCE if input is already corrected" << std::endl;
119  }
120  }
121 
123  art::Event& Event,
124  reco::shower::ShowerElementHolder& ShowerEleHolder)
125  {
126 
127  MaxDist = fMaxDist;
129 
130  // Shower dEdx calculation
131  if (!ShowerEleHolder.CheckElement(fShowerStartPositionInputLabel)) {
132  if (fVerbose)
133  mf::LogError("ShowerTrajPointdEdx") << "Start position not set, returning " << std::endl;
134  return 1;
135  }
136  if (!ShowerEleHolder.CheckElement(fInitialTrackSpacePointsInputLabel)) {
137  if (fVerbose)
138  mf::LogError("ShowerTrajPointdEdx")
139  << "Initial Track Spacepoints is not set returning" << std::endl;
140  return 1;
141  }
142  if (!ShowerEleHolder.CheckElement(fInitialTrackInputLabel)) {
143  if (fVerbose) mf::LogError("ShowerTrajPointdEdx") << "Initial Track is not set" << std::endl;
144  return 1;
145  }
146 
147  //Get the initial track hits
148  std::vector<art::Ptr<recob::SpacePoint>> tracksps;
149  ShowerEleHolder.GetElement(fInitialTrackSpacePointsInputLabel, tracksps);
150 
151  if (tracksps.empty()) {
152  if (fVerbose)
153  mf::LogWarning("ShowerTrajPointdEdx") << "no spacepointsin the initial track" << std::endl;
154  return 0;
155  }
156 
157  // Get the spacepoints
158  auto const spHandle = Event.getValidHandle<std::vector<recob::SpacePoint>>(fPFParticleLabel);
159 
160  // Get the hits associated with the space points
161  const art::FindManyP<recob::Hit>& fmsp =
162  ShowerEleHolder.GetFindManyP<recob::Hit>(spHandle, Event, fPFParticleLabel);
163 
164  //Only consider hits in the same tpcs as the vertex.
165  geo::Point_t ShowerStartPosition = {-999, -999, -999};
166  ShowerEleHolder.GetElement(fShowerStartPositionInputLabel, ShowerStartPosition);
167  geo::TPCID vtxTPC = fGeom->FindTPCAtPosition(ShowerStartPosition);
168 
169  //Get the initial track
170  recob::Track InitialTrack;
171  ShowerEleHolder.GetElement(fInitialTrackInputLabel, InitialTrack);
172 
173  double pfpT0Time(0); // If no T0 found, assume the particle happened at trigger time (0)
174  if (fT0Correct) {
175  auto const pfpHandle = Event.getValidHandle<std::vector<recob::PFParticle>>(fPFParticleLabel);
176  const art::FindManyP<anab::T0>& fmpfpt0 =
177  ShowerEleHolder.GetFindManyP<anab::T0>(pfpHandle, Event, fPFParticleLabel);
178  std::vector<art::Ptr<anab::T0>> pfpT0Vec = fmpfpt0.at(pfparticle.key());
179  if (pfpT0Vec.size() == 1) { pfpT0Time = pfpT0Vec.front()->Time(); }
180  }
181 
182  //Don't care that I could use a vector.
183  std::map<int, std::vector<double>> dEdx_vec;
184  std::map<int, std::vector<double>> dEdx_vecErr;
185  std::map<int, int> num_hits;
186 
187  for (unsigned i = 0; i != fChannelMap.MaxPlanes(); ++i) {
188  dEdx_vec[i] = {};
189  dEdx_vecErr[i] = {};
190  num_hits[i] = 0;
191  }
192 
193  auto const clockData =
195  auto const detProp =
197 
198  std::map<art::Ptr<recob::Hit>, std::vector<art::Ptr<recob::Hit>>> hitSnippets;
199  if (fSumHitSnippets) {
200  std::vector<art::Ptr<recob::Hit>> trackHits;
201  ShowerEleHolder.GetElement(fInitialTrackHitsInputLabel, trackHits);
202 
203  hitSnippets = IShowerTool::GetLArPandoraShowerAlg().OrganizeHits(trackHits);
204  }
205 
206  //Loop over the spacepoints
207  for (auto const& sp : tracksps) {
208 
209  //Get the associated hit
210  std::vector<art::Ptr<recob::Hit>> hits = fmsp.at(sp.key());
211  if (hits.empty()) {
212  if (fVerbose)
213  mf::LogWarning("ShowerTrajPointdEdx")
214  << "no hit for the spacepoint. This suggest the find many is wrong." << std::endl;
215  continue;
216  }
217  const art::Ptr<recob::Hit> hit = hits[0];
218 
219  if (fSumHitSnippets && !hitSnippets.count(hit)) continue;
220 
221  double wirepitch = fChannelMap.Plane(hit->WireID()).WirePitch();
222 
223  //Only consider hits in the same tpc
224  geo::PlaneID planeid = hit->WireID();
225  geo::TPCID TPC = planeid.asTPCID();
226  if (TPC != vtxTPC) { continue; }
227 
228  //Ignore spacepoints within a few wires of the vertex.
229  auto const pos = sp->position();
230  double dist_from_start = (pos - ShowerStartPosition).R();
231 
232  if (fCutStartPosition) {
233  if (dist_from_start < fMinDistCutOff * wirepitch) { continue; }
234 
235  if (dist_from_start > dEdxTrackLength) { continue; }
236  }
237 
238  //Find the closest trajectory point of the track. These should be in order if the user has used ShowerTrackTrajToSpacePoint_tool but the sake of gernicness I'll get the cloest sp.
239  unsigned int index = 999;
240  double MinDist = 999;
241  for (unsigned int traj = 0; traj < InitialTrack.NumberTrajectoryPoints(); ++traj) {
242 
243  //ignore bogus info.
244  auto flags = InitialTrack.FlagsAtPoint(traj);
245  if (flags.isSet(recob::TrajectoryPointFlagTraits::NoPoint)) { continue; }
246 
247  geo::Point_t const TrajPosition = InitialTrack.LocationAtPoint(traj);
248 
249  auto const dist = (pos - TrajPosition).R();
250 
251  if (dist < MinDist && dist < MaxDist * wirepitch) {
252  MinDist = dist;
253  index = traj;
254  }
255  }
256 
257  //If there is no matching trajectory point then bail.
258  if (index == 999) { continue; }
259 
260  geo::Point_t const TrajPosition = InitialTrack.LocationAtPoint(index);
261  geo::Point_t const TrajPositionStart = InitialTrack.LocationAtPoint(0);
262 
263  //Ignore values with 0 mag from the start position
264  if ((TrajPosition - TrajPositionStart).R() == 0) { continue; }
265  if ((TrajPosition - ShowerStartPosition).R() == 0) { continue; }
266 
267  if ((TrajPosition - TrajPositionStart).R() < fMinDistCutOff * wirepitch) { continue; }
268 
269  //Get the direction of the trajectory point
270  geo::Vector_t const TrajDirection = InitialTrack.DirectionAtPoint(index);
271 
272  //If the direction is in the same direction as the wires within some tolerance the hit finding struggles. Let remove these.
273  // Note that we project in the YZ plane to make sure we are not cutting on
274  // the angle into the wire planes, that should be done by the shaping time cut
275  geo::Vector_t const TrajDirectionYZ{0, TrajDirection.Y(), TrajDirection.Z()};
276  auto const PlaneDirection = fChannelMap.Plane(planeid).GetIncreasingWireDirection();
277 
278  if (std::abs((TMath::Pi() / 2 - Angle(TrajDirectionYZ, PlaneDirection))) < fMinAngleToWire) {
279  if (fVerbose) mf::LogWarning("ShowerTrajPointdEdx") << "remove from angle cut" << std::endl;
280  continue;
281  }
282 
283  //If the direction is too much into the wire plane then the shaping amplifer cuts the charge. Lets remove these events.
284  double velocity = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
285  double distance_in_x = TrajDirection.X() * (wirepitch / TrajDirection.Dot(PlaneDirection));
286  double time_taken = std::abs(distance_in_x / velocity);
287 
288  //Shaping time doesn't seem to exist in a global place so add it as a fcl.
289  if (fShapingTime < time_taken) {
290  if (fVerbose) mf::LogWarning("ShowerTrajPointdEdx") << "move for shaping time" << std::endl;
291  continue;
292  }
293 
294  if ((TrajPosition - TrajPositionStart).R() > dEdxTrackLength) { continue; }
295 
296  //Iterate the number of hits on the plane
297  ++num_hits[planeid.Plane];
298 
299  //If we still exist then we can be used in the calculation. Calculate the 3D pitch
300  double trackpitch = (TrajDirection * (wirepitch / TrajDirection.Dot(PlaneDirection))).R();
301 
302  if (fSCECorrectPitch) {
304  trackpitch, pos, TrajDirection.Unit(), hit->WireID().TPC);
305  }
306 
307  //Calculate the dQdx
308  double dQdx = hit->Integral();
309  if (fSumHitSnippets) {
310  for (const art::Ptr<recob::Hit> secondaryHit : hitSnippets[hit])
311  dQdx += secondaryHit->Integral();
312  }
313  dQdx /= trackpitch;
314 
315  //Calculate the dEdx
316  double localEField = detProp.Efield();
317  if (fSCECorrectEField) {
318  localEField = IShowerTool::GetLArPandoraShowerAlg().SCECorrectEField(localEField, pos);
319  }
320  double dEdx = fCalorimetryAlg.dEdx_AREA(
321  clockData, detProp, dQdx, hit->PeakTime(), planeid.Plane, pfpT0Time, localEField);
322 
323  //Add the value to the dEdx
324  dEdx_vec[planeid.Plane].push_back(dEdx);
325  }
326 
327  //Choose max hits based on hitnum
328  int max_hits = 0;
329  int best_plane = -std::numeric_limits<int>::max();
330  for (auto const& [plane, numHits] : num_hits) {
331  if (fVerbose > 2) std::cout << "Plane: " << plane << " with size: " << numHits << std::endl;
332  if (numHits > max_hits) {
333  best_plane = plane;
334  max_hits = numHits;
335  }
336  }
337 
338  if (best_plane < 0) {
339  if (fVerbose)
340  mf::LogError("ShowerTrajPointdEdx") << "No hits in any plane, returning " << std::endl;
341  return 1;
342  }
343 
344  //Search for blow ups and gradient changes.
345  //Electrons have a very flat dEdx as function of energy till ~10MeV.
346  //If there is a sudden jump particle has probably split
347  //If there is very large dEdx we have either calculated it wrong (probably) or the Electron is coming to end.
348  //Assumes hits are ordered!
349  std::map<int, std::vector<double>> dEdx_vec_cut;
350  for (geo::PlaneID plane_id : fChannelMap.Iterate<geo::PlaneID>()) {
351  dEdx_vec_cut[plane_id.Plane] = {};
352  }
353 
354  for (auto& dEdx_plane : dEdx_vec) {
355  FinddEdxLength(dEdx_plane.second, dEdx_vec_cut[dEdx_plane.first]);
356  }
357 
358  //Never have the stats to do a landau fit and get the most probable value. User decides if they want the median value or the mean.
359  std::vector<double> dEdx_val;
360  std::vector<double> dEdx_valErr;
361  for (auto const& dEdx_plane : dEdx_vec_cut) {
362 
363  if ((dEdx_plane.second).empty()) {
364  dEdx_val.push_back(-999);
365  dEdx_valErr.push_back(-999);
366  continue;
367  }
368 
369  if (fUseMedian) {
370  dEdx_val.push_back(TMath::Median((dEdx_plane.second).size(), &(dEdx_plane.second)[0]));
371  }
372  else {
373  //Else calculate the mean value.
374  double dEdx_mean = 0;
375  for (auto const& dEdx : dEdx_plane.second) {
376  if (dEdx > 10 || dEdx < 0) { continue; }
377  dEdx_mean += dEdx;
378  }
379  dEdx_val.push_back(dEdx_mean / (float)(dEdx_plane.second).size());
380  }
381  }
382 
383  if (fVerbose > 1) {
384  std::cout << "#Best Plane: " << best_plane << std::endl;
385  for (unsigned int plane = 0; plane < dEdx_vec.size(); plane++) {
386  std::cout << "#Plane: " << plane << " #" << std::endl;
387  std::cout << "#Median: " << dEdx_val[plane] << " #" << std::endl;
388  if (fVerbose > 2) {
389  for (auto const& dEdx : dEdx_vec_cut[plane]) {
390  std::cout << "dEdx: " << dEdx << std::endl;
391  }
392  }
393  }
394  }
395 
396  //Need to sort out errors sensibly.
397  ShowerEleHolder.SetElement(dEdx_val, dEdx_valErr, fShowerdEdxOutputLabel);
398  ShowerEleHolder.SetElement(best_plane, fShowerBestPlaneOutputLabel);
399  ShowerEleHolder.SetElement(dEdx_vec_cut, fShowerdEdxVecOutputLabel);
400  return 0;
401  }
402 
403  void ShowerTrajPointdEdx::FinddEdxLength(std::vector<double>& dEdx_vec,
404  std::vector<double>& dEdx_val)
405  {
406 
407  //As default do not apply this cut.
408  if (fdEdxCut > 10) {
409  dEdx_val = dEdx_vec;
410  return;
411  }
412 
413  //Can only do this with 4 hits.
414  if (dEdx_vec.size() < 4) {
415  dEdx_val = dEdx_vec;
416  return;
417  }
418 
419  bool upperbound = false;
420 
421  //See if we are in the upper bound or upper bound defined by the cut.
422  int upperbound_int = 0;
423  if (dEdx_vec[0] > fdEdxCut) { ++upperbound_int; }
424  if (dEdx_vec[1] > fdEdxCut) { ++upperbound_int; }
425  if (dEdx_vec[2] > fdEdxCut) { ++upperbound_int; }
426  if (upperbound_int > 1) { upperbound = true; }
427 
428  dEdx_val.push_back(dEdx_vec[0]);
429  dEdx_val.push_back(dEdx_vec[1]);
430  dEdx_val.push_back(dEdx_vec[2]);
431 
432  for (unsigned int dEdx_iter = 2; dEdx_iter < dEdx_vec.size(); ++dEdx_iter) {
433 
434  //The Function of dEdx as a function of E is flat above ~10 MeV.
435  //We are looking for a jump up (or down) above the ladau width in the dEx
436  //to account account for pair production.
437  //Dom Estimates that the somwhere above 0.28 MeV will be a good cut but 999 will prevent this stage.
438  double dEdx = dEdx_vec[dEdx_iter];
439 
440  //We are really poo at physics and so attempt to find the pair production
441  if (upperbound) {
442  if (dEdx > fdEdxCut) {
443  dEdx_val.push_back(dEdx);
444  if (fVerbose > 1) std::cout << "Adding dEdx: " << dEdx << std::endl;
445  continue;
446  }
447  else {
448  //Maybe its a landau fluctation lets try again.
449  if (dEdx_iter < dEdx_vec.size() - 1) {
450  if (dEdx_vec[dEdx_iter + 1] > fdEdxCut) {
451  if (fVerbose > 1)
452  std::cout << "Next dEdx hit is good removing hit" << dEdx << std::endl;
453  continue;
454  }
455  }
456  //I'll let one more value
457  if (dEdx_iter < dEdx_vec.size() - 2) {
458  if (dEdx_vec[dEdx_iter + 2] > fdEdxCut) {
459  if (fVerbose > 1)
460  std::cout << "Next Next dEdx hit is good removing hit" << dEdx << std::endl;
461  continue;
462  }
463  }
464  //We are hopefully we have one of our electrons has died.
465  break;
466  }
467  }
468  else {
469  if (dEdx < fdEdxCut) {
470  dEdx_val.push_back(dEdx);
471  if (fVerbose > 1) std::cout << "Adding dEdx: " << dEdx << std::endl;
472  continue;
473  }
474  else {
475  //Maybe its a landau fluctation lets try again.
476  if (dEdx_iter < dEdx_vec.size() - 1) {
477  if (dEdx_vec[dEdx_iter + 1] > fdEdxCut) {
478  if (fVerbose > 1)
479  std::cout << "Next dEdx hit is good removing hit " << dEdx << std::endl;
480  continue;
481  }
482  }
483  //I'll let one more value
484  if (dEdx_iter < dEdx_vec.size() - 2) {
485  if (dEdx_vec[dEdx_iter + 2] > fdEdxCut) {
486  if (fVerbose > 1)
487  std::cout << "Next Next dEdx hit is good removing hit " << dEdx << std::endl;
488  continue;
489  }
490  }
491  //We are hopefully in the the pair production zone.
492  break;
493  }
494  }
495  }
496  return;
497  }
498 
499 }
500 
double SCECorrectPitch(double const &pitch, geo::Point_t const &pos, geo::Vector_t const &dir, unsigned int const &TPC) const
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:160
static constexpr Flag_t NoPoint
The trajectory point is not defined.
Point_t const & LocationAtPoint(size_t i) const
Access to track position at different points.
Definition: Track.h:160
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:136
constexpr auto abs(T v)
Returns the absolute value of the argument.
STL namespace.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:254
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:290
Definition: T0.h:16
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
art::ServiceHandle< geo::Geometry > fGeom
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
void hits()
Definition: readHits.C:15
TPCID FindTPCAtPosition(Point_t const &point) const
Returns the ID of the TPC at specified location.
Interface for a class providing readout channel mapping to geometry.
parameter set interface
key_type key() const noexcept
Definition: Ptr.h:166
std::map< art::Ptr< recob::Hit >, std::vector< art::Ptr< recob::Hit > > > OrganizeHits(const std::vector< art::Ptr< recob::Hit >> &hits) const
bool CheckElement(const std::string &Name) const
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:373
int GetElement(const std::string &Name, T &Element) const
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2671
int CalculateElement(const art::Ptr< recob::PFParticle > &pfparticle, art::Event &Event, reco::shower::ShowerElementHolder &ShowerEleHolder) override
Detector simulation of raw signals on wires.
const shower::LArPandoraShowerAlg & GetLArPandoraShowerAlg() const
Definition: IShowerTool.h:80
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:226
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Definition: StdUtils.h:120
double dist(const TReal *x, const TReal *y, const unsigned int dimension)
Provides recob::Track data product.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
range_type< T > Iterate() const
Definition: Iterable.h:121
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
void FinddEdxLength(std::vector< double > &dEdx_vec, std::vector< double > &dEdx_val)
Vector_t const & GetIncreasingWireDirection() const
Returns the direction of increasing wires.
Definition: PlaneGeo.h:350
Definition: MVAAlg.h:12
PointFlags_t const & FlagsAtPoint(size_t i) const
Access to i-th TrajectoryPoint or its Flags.
Definition: Track.h:152
Vector_t DirectionAtPoint(size_t i) const
Access to track direction at different points.
Definition: Track.h:168
double SCECorrectEField(double const &EField, geo::Point_t const &pos) const
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:315
const art::FindManyP< T1 > & GetFindManyP(const art::ValidHandle< std::vector< T2 >> &handle, const art::Event &evt, const art::InputTag &moduleTag)
art framework interface to geometry description
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
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
constexpr TPCID const & asTPCID() const
Conversion to PlaneID (for convenience of notation).
Definition: geo_types.h:409
ShowerTrajPointdEdx(const fhicl::ParameterSet &pset)