NeutrinoEnergyRecoAlg.cc
Go to the documentation of this file.
1 /**
2 * @file dunereco/FDSensOpt/NeutrinoEnergyRecoAlg/NeutrinoEnergyRecoAlg.cc
3 
4 * @brief Implementation file for the neutrino energy reconstruction algorithm. A heavily refactored version of Nick Grant's module
5 *
6 * $Log: $
7 */
8 
9 //STL
10 #include <limits>
11 #include <algorithm>
12 //ROOT
13 //ART
16 //LArSoft
23 //DUNE
28 
30 
31 namespace dune
32 {
34  const std::string &showerLabel, const std::string &hitLabel, const std::string wireLabel,
35  const std::string &trackToHitLabel, const std::string &showerToHitLabel, const std::string &hitToSpacePointLabel) :
36  fCalorimetryAlg(pset.get<fhicl::ParameterSet>("CalorimetryAlg")),
37  fGradTrkMomRange(pset.get<double>("GradTrkMomRange")),
38  fIntTrkMomRange(pset.get<double>("IntTrkMomRange")),
39  fGradTrkMomMCS(pset.get<double>("GradTrkMomMCS")),
40  fIntTrkMomMCS(pset.get<double>("IntTrkMomMCS")),
41  fGradNuMuHadEnCont(pset.get<double>("GradNuMuHadEnCont")),
42  fIntNuMuHadEnCont(pset.get<double>("IntNuMuHadEnCont")),
43  fGradNuMuHadEnExit(pset.get<double>("GradNuMuHadEnExit")),
44  fIntNuMuHadEnExit(pset.get<double>("IntNuMuHadEnExit")),
45  fGradShwEnergy(pset.get<double>("GradShwEnergy")),
46  fIntShwEnergy(pset.get<double>("IntShwEnergy")),
47  fGradNuEHadEn(pset.get<double>("GradNuEHadEn")),
48  fIntNuEHadEn(pset.get<double>("IntNuEHadEn")),
49  fDistanceToWallThreshold(pset.get<double>("DistanceToWallThreshold")),
50  fMuonRangeToMCSThreshold(pset.get<double>("MuonRangeToMCSThreshold")),
51  fRecombFactor(pset.get<double>("RecombFactor")),
52  fTrackLabel(trackLabel),
53  fShowerLabel(showerLabel),
54  fHitLabel(hitLabel),
55  fWireLabel(wireLabel),
56  fTrackToHitLabel(trackToHitLabel),
57  fShowerToHitLabel(showerToHitLabel),
58  fHitToSpacePointLabel(hitToSpacePointLabel)
59 {
60 }
61 
62 //------------------------------------------------------------------------------------------------------------------------------------------
63 
65 {
66  if (!pMuonTrack.isAvailable() || pMuonTrack.isNull())
67  {
68  mf::LogWarning("NeutrinoEnergyRecoAlg") << " Cannot access the muon track which is needed for this energy reconstructio method.\n"
69  << "Swapping to energy reconstruction method " << kAllCharges << " for this calculation." << std::endl;
70  return this->CalculateNeutrinoEnergy(event);
71  }
72 
73  Point_t vertex(pMuonTrack->Start().X(), pMuonTrack->Start().Y(), pMuonTrack->Start().Z());
74 
75  const std::vector<art::Ptr<recob::Hit> > muonHits(dune_ana::DUNEAnaHitUtils::GetHitsOnPlane(dune_ana::DUNEAnaTrackUtils::GetHits(pMuonTrack, event, fTrackToHitLabel),2));
76  bool isContained(this->IsContained(muonHits, event));
77  const double uncorrectedMuonMomentumMCS(this->CalculateUncorrectedMuonMomentumByMCS(pMuonTrack));
78  const double muonMomentumMCS(this->CalculateLinearlyCorrectedValue(uncorrectedMuonMomentumMCS, fGradTrkMomMCS, fIntTrkMomMCS));
79  if (!isContained)
80  {
81  if (uncorrectedMuonMomentumMCS > std::numeric_limits<double>::epsilon())
82  {
83  EnergyRecoInputHolder energyRecoInputHolder(vertex,
84  this->CalculateParticle4Momentum(kMuonMass, muonMomentumMCS, pMuonTrack->VertexDirection().X(), pMuonTrack->VertexDirection().Y(), pMuonTrack->VertexDirection().Z()),
86  return this->CalculateNeutrinoEnergy(muonHits, event, energyRecoInputHolder);
87  }
88  else
89  {
90  return this->CalculateNeutrinoEnergy(event);
91  }
92  }
93  else
94  {
95  const double muonMomentumRange(CalculateMuonMomentumByRange(pMuonTrack));
96  if (uncorrectedMuonMomentumMCS > std::numeric_limits<double>::epsilon()
97  && muonMomentumRange/muonMomentumMCS - fMuonRangeToMCSThreshold < -1.*std::numeric_limits<double>::epsilon())
98  {
99  EnergyRecoInputHolder energyRecoInputHolder(vertex,
100  this->CalculateParticle4Momentum(kMuonMass, muonMomentumMCS, pMuonTrack->VertexDirection().X(), pMuonTrack->VertexDirection().Y(), pMuonTrack->VertexDirection().Z()),
102 
103  return this->CalculateNeutrinoEnergy(muonHits, event, energyRecoInputHolder);
104  }
105  else
106  {
107  EnergyRecoInputHolder energyRecoInputHolder(vertex,
108  this->CalculateParticle4Momentum(kMuonMass, muonMomentumRange, pMuonTrack->VertexDirection().X(), pMuonTrack->VertexDirection().Y(), pMuonTrack->VertexDirection().Z()),
110 
111  return this->CalculateNeutrinoEnergy(muonHits, event, energyRecoInputHolder);
112  }
113  }
114 
115  throw art::Exception(art::errors::LogicError) << "Unable to determine how to calculate neutrino energy using muon track! \n";
116 }
117 
118 //------------------------------------------------------------------------------------------------------------------------------------------
119 
121  const art::Event &event)
122 {
123  if (!pElectronShower.isAvailable() || pElectronShower.isNull())
124  {
125  mf::LogWarning("NeutrinoEnergyRecoAlg")
126  << " Cannot access the electron shower which is needed for this energy reconstructio method.\n"
127  << "Swapping to energy reconstruction method " << kAllCharges << " for this calculation." << std::endl;
128  return this->CalculateNeutrinoEnergy(event);
129  }
130 
131 
132  Point_t vertex(pElectronShower->ShowerStart().X(), pElectronShower->ShowerStart().Y(), pElectronShower->ShowerStart().Z());
133 
134  const std::vector<art::Ptr<recob::Hit> > electronHits(dune_ana::DUNEAnaHitUtils::GetHitsOnPlane(dune_ana::DUNEAnaShowerUtils::GetHits(pElectronShower, event, fShowerToHitLabel),2));
135  const double electronEnergy(this->CalculateElectronEnergy(pElectronShower, event));
136  //ATTN yep this line is bugged. It's deliberately bugged to maintain how the original code functioned
137  //Because of the small electron mass vs total energy deposition, this bug will have a very very small effect on the 4vector
138  const Momentum4_t electron4Momentum(this->CalculateParticle4Momentum(kElectronMass, electronEnergy,
139  pElectronShower->Direction().X(), pElectronShower->Direction().Y(), pElectronShower->Direction().Z()));
140 
141  EnergyRecoInputHolder energyRecoInputHolder(vertex, electron4Momentum,
143 
144  return this->CalculateNeutrinoEnergy(electronHits, event, energyRecoInputHolder);
145 }
146 
147 //------------------------------------------------------------------------------------------------------------------------------------------
148 
150 {
152  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
153  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
154  const double triggerTme(clockData.TriggerTime());
155 
156  const std::vector<art::Ptr<recob::Wire> > wires(dune_ana::DUNEAnaEventUtils::GetWires(event, fWireLabel));
157  double wireCharge(0);
158 
159  for (unsigned int iWire = 0; iWire < wires.size(); ++iWire)
160  {
161  if (fGeometry->SignalType(wires[iWire]->Channel()) != geo::kCollection)
162  continue;
163 
164  const recob::Wire::RegionsOfInterest_t& signalROI(wires[iWire]->SignalROI());
165  for (const lar::sparse_vector<float>::datarange_t& range : signalROI.get_ranges())
166  {
167  const std::vector<float>& signal(range.data());
168  const raw::TDCtick_t binFirstTickROI(range.begin_index());
169  for (unsigned int iSignal = 0; iSignal < signal.size(); ++iSignal)
170  wireCharge += signal[iSignal]*dune_ana::DUNEAnaHitUtils::LifetimeCorrection(clockData, detProp, iSignal+binFirstTickROI, triggerTme);
171  }
172  }
173  const double totalEnergy(this->CalculateEnergyFromCharge(wireCharge));
174 
176  output.recoMethodUsed = static_cast<int>(kAllCharges);
177  output.fRecoVertex.SetXYZ(0.,0.,0.);
178  output.fNuLorentzVector.SetXYZT(0.,0.,0.,totalEnergy);
179  output.fLepLorentzVector.SetXYZT(0.,0.,0.,0.);
180  output.fHadLorentzVector.SetXYZT(0.,0.,0.,0.);
181  output.longestTrackContained = static_cast<int>(kContainmentNotSet);
182  output.trackMomMethod = static_cast<int>(kTrackMethodNotSet);
183  return output;
184 }
185 
186 //------------------------------------------------------------------------------------------------------------------------------------------
187 
189  const art::Event &event)
190 {
191  Point_t vertex(pMuonTrack->Start().X(), pMuonTrack->Start().Y(), pMuonTrack->Start().Z());
192 
193  const std::vector<art::Ptr<recob::Hit> > muonHits(dune_ana::DUNEAnaHitUtils::GetHitsOnPlane(dune_ana::DUNEAnaTrackUtils::GetHits(pMuonTrack, event, fTrackToHitLabel),2));
194  bool isContained(this->IsContained(muonHits, event));
195  const double muonMomentumRange(this->CalculateMuonMomentumByRange(pMuonTrack));
196 
197  EnergyRecoInputHolder energyRecoInputHolder(vertex,
198  this->CalculateParticle4Momentum(kMuonMass, muonMomentumRange, pMuonTrack->VertexDirection().X(), pMuonTrack->VertexDirection().Y(), pMuonTrack->VertexDirection().Z()),
199  kMuonAndHadronic, kContained, static_cast<MuonContainmentStatus>(isContained), fGradNuMuHadEnCont, fIntNuMuHadEnCont);
200 
201  return this->CalculateNeutrinoEnergy(muonHits, event, energyRecoInputHolder);
202 }
203 
204 //------------------------------------------------------------------------------------------------------------------------------------------
205 
207  const art::Event &event)
208 {
209  Point_t vertex(pMuonTrack->Start().X(), pMuonTrack->Start().Y(), pMuonTrack->Start().Z());
210 
211  const std::vector<art::Ptr<recob::Hit> > muonHits(dune_ana::DUNEAnaHitUtils::GetHitsOnPlane(dune_ana::DUNEAnaTrackUtils::GetHits(pMuonTrack, event, fTrackToHitLabel),2));
212  bool isContained(this->IsContained(muonHits, event));
213  const double muonMomentumMCS(this->CalculateMuonMomentumByMCS(pMuonTrack));
214 
215  EnergyRecoInputHolder energyRecoInputHolder(vertex,
216  this->CalculateParticle4Momentum(kMuonMass, muonMomentumMCS, pMuonTrack->VertexDirection().X(), pMuonTrack->VertexDirection().Y(), pMuonTrack->VertexDirection().Z()),
217  kMuonAndHadronic, kMCS, static_cast<MuonContainmentStatus>(isContained), fGradNuMuHadEnExit, fIntNuMuHadEnExit);
218 
219  return this->CalculateNeutrinoEnergy(muonHits, event, energyRecoInputHolder);
220 }
221 
222 //------------------------------------------------------------------------------------------------------------------------------------------
223 
225  const double directionX, const double directionY, const double directionZ)
226 {
227  const double E(std::sqrt(momentum*momentum + mass*mass));
228  const double pX(directionX * momentum);
229  const double pY(directionY * momentum);
230  const double pZ(directionZ * momentum);
231  return Momentum4_t(pX, pY, pZ, E);
232 }
233 
234 //------------------------------------------------------------------------------------------------------------------------------------------
235 
237 {
239 }
240 
241 //------------------------------------------------------------------------------------------------------------------------------------------
242 
244 {
245  const double uncorrectedMomentum(this->CalculateUncorrectedMuonMomentumByMCS(pMuonTrack));
246  return this->CalculateLinearlyCorrectedValue(uncorrectedMomentum, fGradTrkMomMCS, fIntTrkMomMCS);
247 }
248 
249 //------------------------------------------------------------------------------------------------------------------------------------------
250 
252 {
253  const std::vector<art::Ptr<recob::Hit> > electronHits(dune_ana::DUNEAnaHitUtils::GetHitsOnPlane(dune_ana::DUNEAnaShowerUtils::GetHits(pElectronShower, event, fShowerToHitLabel),2));
254  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
255  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
256  const double electronObservedCharge(dune_ana::DUNEAnaHitUtils::LifetimeCorrectedTotalHitCharge(clockData, detProp, electronHits));
257  const double uncorrectedElectronEnergy(this->CalculateEnergyFromCharge(electronObservedCharge));
258 
259  return this->CalculateLinearlyCorrectedValue(uncorrectedElectronEnergy, fGradShwEnergy, fIntShwEnergy);
260 }
261 
262 //------------------------------------------------------------------------------------------------------------------------------------------
263 
265 {
267 }
268 
269 //------------------------------------------------------------------------------------------------------------------------------------------
270 
272 {
273  for (unsigned int iHit = 0; iHit < hits.size(); ++iHit)
274  {
275  const std::vector<art::Ptr<recob::SpacePoint> > spacePoints(dune_ana::DUNEAnaHitUtils::GetSpacePoints(hits[iHit],
277  for (unsigned int iSpacePoint = 0; iSpacePoint < spacePoints.size(); ++iSpacePoint)
278  {
279  const art::Ptr<recob::SpacePoint> spacePoint(spacePoints[iSpacePoint]);
280  if (!(this->IsPointContained(spacePoint->XYZ()[0],spacePoint->XYZ()[1],spacePoint->XYZ()[2])))
281  return false;
282  }
283  }
284  return true;
285 }
286 
287 //------------------------------------------------------------------------------------------------------------------------------------------
288 
289 double NeutrinoEnergyRecoAlg::CalculateLinearlyCorrectedValue(const double value, const double correctionGradient,
290  const double correctionIntercept)
291 {
292  return (value - correctionIntercept) / correctionGradient;
293 }
294 
295 //------------------------------------------------------------------------------------------------------------------------------------------
296 
298 {
299  trkf::TrackMomentumCalculator TrackMomCalc;
300  return (TrackMomCalc.GetMomentumMultiScatterChi2(pMuonTrack));
301 }
302 
303 //------------------------------------------------------------------------------------------------------------------------------------------
304 
306  const art::Event &event, const EnergyRecoInputHolder &energyRecoInputHolder)
307 {
308  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
309  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
310  const double leptonObservedCharge(dune_ana::DUNEAnaHitUtils::LifetimeCorrectedTotalHitCharge(clockData, detProp, leptonHits));
311 
312  const std::vector<art::Ptr<recob::Hit> > eventHits(dune_ana::DUNEAnaHitUtils::GetHitsOnPlane(dune_ana::DUNEAnaEventUtils::GetHits(event, fHitLabel),2));
313  const double eventObservedCharge(dune_ana::DUNEAnaHitUtils::LifetimeCorrectedTotalHitCharge(clockData, detProp, eventHits));
314 
315  const double hadronicObservedCharge(eventObservedCharge-leptonObservedCharge);
316  const double uncorrectedHadronicEnergy(this->CalculateEnergyFromCharge(hadronicObservedCharge));
317  const double correctedHadronicEnergy(
318  this->CalculateLinearlyCorrectedValue(uncorrectedHadronicEnergy,energyRecoInputHolder.fHadronicCorrectionGradient,
319  energyRecoInputHolder.fHadronicCorrectionIntercept));
320 
321  const double neutrinoEnergy(energyRecoInputHolder.fLeptonMomentum.E()+correctedHadronicEnergy);
322 
324  output.recoMethodUsed = static_cast<int>(energyRecoInputHolder.fEnergyRecoMethod);
325  output.fRecoVertex = energyRecoInputHolder.fVertex;
326  output.fNuLorentzVector.SetE(neutrinoEnergy);
327  output.fLepLorentzVector = energyRecoInputHolder.fLeptonMomentum;
328  output.fHadLorentzVector.SetE(correctedHadronicEnergy);
329  output.longestTrackContained = static_cast<int>(energyRecoInputHolder.fMuonContainmentStatus);
330  output.trackMomMethod = static_cast<int>(energyRecoInputHolder.fMuonTrackMethod);
331  return output;
332 }
333 
334 //------------------------------------------------------------------------------------------------------------------------------------------
335 
336 bool NeutrinoEnergyRecoAlg::IsPointContained(const double x, const double y, const double z)
337 {
338  double position[3] = {x,y,z};
340 
341  geo::TPCID tpcID(fGeometry->FindTPCAtPosition(position));
342  if (!(fGeometry->HasTPC(tpcID)))
343  return false;
344 
345  double minX(std::numeric_limits<double>::max());
346  double maxX(std::numeric_limits<double>::lowest());
347  double minY(std::numeric_limits<double>::max());
348  double maxY(std::numeric_limits<double>::lowest());
349  double minZ(std::numeric_limits<double>::max());
350  double maxZ(std::numeric_limits<double>::lowest());
351  for (unsigned int iCryostat = 0; iCryostat < fGeometry->Ncryostats(); ++iCryostat)
352  {
353  const geo::CryostatGeo& cryostat(fGeometry->Cryostat(iCryostat));
354  for (unsigned int iTPC = 0; iTPC < cryostat.NTPC(); ++iTPC)
355  {
356  const geo::TPCGeo& tpc(cryostat.TPC(iTPC));
357  minX = std::min(minX,tpc.MinX());
358  maxX = std::max(maxX,tpc.MaxX());
359  minY = std::min(minY,tpc.MinY());
360  maxY = std::max(maxY,tpc.MaxY());
361  minZ = std::min(minZ,tpc.MinZ());
362  maxZ = std::max(maxZ,tpc.MaxZ());
363  }
364  }
365 
366  minX += fDistanceToWallThreshold;
367  maxX -= fDistanceToWallThreshold;
368  minY += fDistanceToWallThreshold;
369  maxY -= fDistanceToWallThreshold;
370  minZ += fDistanceToWallThreshold;
371  maxZ -= fDistanceToWallThreshold;
372 
373  if (x - minX < -1.*std::numeric_limits<double>::epsilon() ||
374  x - maxX > std::numeric_limits<double>::epsilon())
375  return false;
376  if (y - minY < -1.*std::numeric_limits<double>::epsilon() ||
377  y - maxY > std::numeric_limits<double>::epsilon())
378  return false;
379  if (z - minZ < -1.*std::numeric_limits<double>::epsilon() ||
380  z - maxZ > std::numeric_limits<double>::epsilon())
381  return false;
382 
383  return true;
384 }
385 
386 } //dune
Momentum4_t CalculateParticle4Momentum(const double mass, const double momentum, const double directionX, const double directionY, const double directionZ)
Calculates a particle&#39;s four-momentum vector.
double fGradNuMuHadEnExit
the hadronic energy correction gradient for numu+exiting muon
const double fHadronicCorrectionIntercept
the hadronic energy reconstruction linear correction intercept
Utility containing helpful functions for end users to access information about Hits.
const TVector3 & ShowerStart() const
Definition: Shower.h:192
double CalculateEnergyFromCharge(const double charge)
Converts deposited charge into energy by converting to number of electrons and correcting for average...
double fIntShwEnergy
the electron shower energy correction intercept
double kMuonMass
the muon mass (hardcoded unfortunately)
std::string fHitLabel
the hit label
double GetMomentumMultiScatterChi2(art::Ptr< recob::Track > const &trk)
double CalculateLinearlyCorrectedValue(const double value, const double correctionGradient, const double correctionIntercept)
Linearly corrects a value.
std::string fShowerToHitLabel
the associated shower-to-hit label
Utility containing helpful functions for end users to access information about Tracks.
std::string string
Definition: nybbler.cc:12
double fGradNuMuHadEnCont
the hqdronic energy correction gradient for numu+contained muon
static std::vector< art::Ptr< recob::SpacePoint > > GetSpacePoints(const art::Ptr< recob::Hit > &pHit, const art::Event &evt, const std::string &hitLabel, const std::string &hitToSpacePointLabel)
Get the space points associated with the hit.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >> Point_t
Geometry information for a single TPC.
Definition: TPCGeo.h:38
std::string fWireLabel
the wire label
struct vector vector
const EnergyRecoMethod fEnergyRecoMethod
the neutrino energy reconstruction method
Vector_t VertexDirection() const
Definition: Track.h:132
static std::vector< art::Ptr< recob::Hit > > GetHits(const art::Event &evt, const std::string &label)
Get the hits from the event.
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
double fIntNuMuHadEnExit
the hadronic energy correction intercept for numu+exiting muon
static std::vector< art::Ptr< recob::Wire > > GetWires(const art::Event &evt, const std::string &label)
Get the wires from the event.
double CalculateMuonMomentumByRange(const art::Ptr< recob::Track > pMuonTrack)
Calculates muon momentum by range.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
static std::vector< art::Ptr< recob::Hit > > GetHits(const art::Ptr< recob::Track > &pTrack, const art::Event &evt, const std::string &label)
Get the hits associated with the track.
const MuonContainmentStatus fMuonContainmentStatus
the muon containment status
double CalculateMuonMomentumByMCS(const art::Ptr< recob::Track > pMuonTrack)
Calculates muon momentum by multiple coulomb scattering.
art framework interface to geometry description
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:25
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
const MuonTrackMethod fMuonTrackMethod
the muon momentum reconstruction method
muon momentum and hadronic deposited energy method
double ElectronsFromADCArea(double area, unsigned short plane) const
NeutrinoEnergyRecoAlg(const fhicl::ParameterSet &pset, const std::string &trackLabel, const std::string &showerLabel, const std::string &hitLabel, const std::string wireLabel, const std::string &trackToHitLabel, const std::string &showerToHitLabel, const std::string &hitToSpacePointLabel)
Constructor.
double CalculateUncorrectedMuonMomentumByMCS(const art::Ptr< recob::Track > &pMuonTrack)
Calculates the raw muon momentum by multiple coulomb scattering.
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
double fRecombFactor
the average reccombination factor
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
Point_t const & Start() const
Access to track position at different points.
Definition: Track.h:123
Utility containing helpful functions for end users to access information about Showers.
static double LifetimeCorrection(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::Ptr< recob::Hit > &pHit)
get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0 ...
double fGradTrkMomRange
the correction gradient for muon momentum by range
const double fHadronicCorrectionGradient
the hadronic energy reconstruction linear correction gradient
bool isNull() const noexcept
Definition: Ptr.h:173
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
bool IsContained(const std::vector< art::Ptr< recob::Hit > > &hits, const art::Event &event)
Checks if a set of track hits are contained within a central volume of the detector.
Utility containing helpful functions for end users to access products from events.
const TVector3 & Direction() const
Definition: Shower.h:189
electron deposited energy and hadronic deposited energy method
double CalculateElectronEnergy(const art::Ptr< recob::Shower > &pElectronShower, const art::Event &event)
Calculates an electron shower&#39;s deposited energy by converting its deposited charge.
double fDistanceToWallThreshold
the min distance from a detector wall to be considered contained
static int max(int a, int b)
static double LifetimeCorrectedTotalHitCharge(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &hits)
get the total hit charge, corrected for lifetime
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
double fIntTrkMomMCS
the correction intercept for muon momentum by MCS
double fIntTrkMomRange
the correction intercept for muon momentum by range
bool HasTPC(geo::TPCID const &tpcid) const
Returns whether we have the specified TPC.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Header file for the neutrino energy reconstruction algorithm. A heavily refactored version of Nick Gr...
Declaration of signal hit object.
dune::EnergyRecoOutput CalculateNeutrinoEnergyViaMuonRanging(const art::Ptr< recob::Track > &pMuonTrack, const art::Event &event)
Calculates neutrino energy explicitly using muon momentum by range.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
static std::vector< art::Ptr< recob::Hit > > GetHits(const art::Ptr< recob::Shower > &pShower, const art::Event &evt, const std::string &label)
Get the hits associated with the shower.
double fIntNuEHadEn
the hadronic energy correction intercept for nue
double fGradShwEnergy
the electron shower energy correction gradient
E
Definition: 018_def.c:13
double fMuonRangeToMCSThreshold
the ratio threshold at which MCS is used for contained muons
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
const Point_t fVertex
the reconstructed vertex
const Double32_t * XYZ() const
Definition: SpacePoint.h:76
bool isAvailable() const
Definition: Ptr.h:204
Range class, with range and data.
Declaration of basic channel signal object.
list x
Definition: train.py:276
dune::EnergyRecoOutput CalculateNeutrinoEnergyViaMuonMCS(const art::Ptr< recob::Track > &pMuonTrack, const art::Event &event)
Calculates neutrino energy explicitly using muon multiple scattering.
double fGradNuEHadEn
the hadronic energy correction gradient for nue
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
const Momentum4_t fLeptonMomentum
the reconstructed lepton four-momentum
std::string fHitToSpacePointLabel
the associated hit-to-space point label
def momentum(x1, x2, x3, scale=1.)
double fGradTrkMomMCS
the correction gradient for muom momentum by MCS
calo::CalorimetryAlg fCalorimetryAlg
the calorimetry algorithm
muon momentum by multiple scattering
QTextStream & endl(QTextStream &s)
double kElectronMass
the electron mass (hardcoded unfortunately);
Event finding and building.
bool IsPointContained(const double x, const double y, const double z)
Check&#39;s if a point is contained within a central detector volume.
Signal from collection planes.
Definition: geo_types.h:146
dune::EnergyRecoOutput CalculateNeutrinoEnergy(const art::Ptr< recob::Track > &pMuonTrack, const art::Event &event)
Calculates neutrino energy using a muon track (the muon track may be ignored if it isn&#39;t of a suitabl...
std::string fTrackToHitLabel
the associated track-to-hit label
double fIntNuMuHadEnCont
the hadronic energy correction intercept for numu+contained muon
static std::vector< art::Ptr< recob::Hit > > GetHitsOnPlane(const std::vector< art::Ptr< recob::Hit >> &hits, const geo::PlaneID::PlaneID_t planeID)
Get all hits on a specific plane.
vertex reconstruction