All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Derived.cc
Go to the documentation of this file.
1 #include "Derived.h"
2 
3 float numu::dist2Match(const event::Interaction &truth, const std::vector<numu::RecoInteraction> &candidates) {
4  float dist = -1;
5  for (const numu::RecoInteraction &candidate: candidates) {
6  float this_dist = (candidate.position - truth.neutrino.position).Mag();
7  if (dist < 0 || this_dist < dist) dist = this_dist;
8  }
9  return dist;
10 
11 }
12 
13 float numu::trackMatchCompletion(unsigned truth_index, const numu::RecoEvent &event) {
14  for (const numu::RecoInteraction &reco: event.reco) {
15  const numu::RecoTrack &primary_track = event.tracks.at(reco.slice.primary_track_index);
16  if (reco.match.mctruth_track_id == truth_index && primary_track.match.is_primary) {
17  return primary_track.match.completion;
18  }
19  }
20  return -1;
21 }
TruthMatch match
Info for mathing to truth.
Definition: RecoEvent.h:42
int primary_track_index
Index of the primary track.
Definition: RecoEvent.h:27
Neutrino neutrino
The neutrino.
Definition: Event.hh:152
std::vector< RecoInteraction > reco
List of reconstructed vertices.
Definition: RecoEvent.h:50
process_name standard_reco_uboone reco
float completion
Fraction of energy deposits by true particle matched by this track.
float dist2Match(const event::Interaction &truth, const std::vector< numu::RecoInteraction > &candidates)
Definition: Derived.cc:3
bool is_primary
Whether this track was produced as the &quot;primary&quot; process.
TrackTruthMatch match
Truth matching information.
Definition: RecoTrack.h:57
RecoSlice slice
Particle content of the interaction.
Definition: RecoEvent.h:39
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
TVector3 position
Neutrino interaction position.
Definition: Event.hh:92
float trackMatchCompletion(unsigned truth_index, const numu::RecoEvent &event)
Definition: Derived.cc:13
int mctruth_track_id
index of the primary track into the list of MCTruths. -1 if no match.
All truth information associated with one neutrino interaction.
Definition: Event.hh:150