All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
ana::SBNOsc::TrackProfiles Struct Reference

#include <Profile.h>

Inheritance diagram for ana::SBNOsc::TrackProfiles:
ana::SBNOsc::HistoList

Public Member Functions

void Initialize (const std::string &postfix, unsigned nbinsx, double xlo, double xhi)
 
void Fill (float val, const numu::RecoTrack &track, const numu::RecoEvent &event)
 
- Public Member Functions inherited from ana::SBNOsc::HistoList
void Scale (double scale)
 
void Add (const HistoList &other)
 
void Write ()
 
void StoreHisto (TH1 *histo)
 
void Merge (const HistoList &merge)
 

Public Attributes

TH3D * range_minus_true
 
TH3D * range_v_true_mom
 
TH3D * mcs_minus_true
 
TH3D * mcs_v_true_mom
 
TH3D * pid_confusion_tr
 
- Public Attributes inherited from ana::SBNOsc::HistoList
std::vector< TH1 * > fAllHistos
 
std::vector< TDirectory * > fLocations
 

Detailed Description

Definition at line 13 of file Profile.h.

Member Function Documentation

void ana::SBNOsc::TrackProfiles::Fill ( float  val,
const numu::RecoTrack track,
const numu::RecoEvent event 
)

Definition at line 24 of file Profile.cc.

24  {
25 
26  if (track.match.has_match) {
27  const numu::TrueParticle &true_particle = event.particles.at(track.match.mcparticle_id);
28 
29  range_v_true_mom->Fill(val, true_particle.start_momentum.Mag(), numu::RangeMomentum(track));
30  mcs_v_true_mom->Fill(val, true_particle.start_momentum.Mag(), numu::MCSMomentum(track));
31 
32  range_minus_true->Fill(val, true_particle.start_momentum.Mag(), (numu::RangeMomentum(track) - true_particle.start_momentum.Mag()) / true_particle.start_momentum.Mag());
33  mcs_minus_true->Fill(val, true_particle.start_momentum.Mag(), (numu::MCSMomentum(track) - true_particle.start_momentum.Mag()) / true_particle.start_momentum.Mag());
34  }
35  if (track.min_chi2 > 0) {
36  bool is_proton_reco = track.chi2_proton < track.chi2_muon;
37  if (track.match.has_match) {
38  bool is_proton_true = abs(track.match.match_pdg) == 2212;
39  bool is_muon_true = abs(track.match.match_pdg) == 13;
40  if (is_proton_true || is_muon_true) {
41  pid_confusion_tr->Fill(val, is_proton_true, is_proton_reco);
42  }
43  }
44  }
45 }
TVector3 start_momentum
Particle directional momentum for first trajectory point inside TPC AV [GeV].
Definition: TrueParticle.h:24
float chi2_muon
Chi2 of dE/dx to muon hypotheis. Combined agaisnt all planes.
Definition: RecoTrack.h:43
int mcparticle_id
MCParticle ID of the particle this track matches to (same as the ID of the RecoTrack of that particle...
float min_chi2
Minimum chi2 value across all hypotheses.
Definition: RecoTrack.h:44
T abs(T value)
float RangeMomentum(const numu::RecoTrack &track)
Definition: TrackAlgo.cc:15
float MCSMomentum(const numu::RecoTrack &track)
Definition: TrackAlgo.cc:20
bool has_match
Whether a track match exists.
TrackTruthMatch match
Truth matching information.
Definition: RecoTrack.h:57
int match_pdg
PDG of the MCParticle this track matches to.
float chi2_proton
Chi2 of dE/dx to proton hypothesis. Combined against all planes.
Definition: RecoTrack.h:40
void ana::SBNOsc::TrackProfiles::Initialize ( const std::string &  postfix,
unsigned  nbinsx,
double  xlo,
double  xhi 
)

Definition at line 10 of file Profile.cc.

10  {
11 #define TRACK_PROFILE(name, nbinsy, ylo, yhi) name = new TH2D((#name + postfix).c_str(), #name, nbinsx, xlo, xhi, nbinsy, ylo, yhi); StoreHisto(name);
12 #define TRACK_PROFILE3D(name, nbinsy, ylo, yhi, nbinsz, zlo, zhi) name = new TH3D((#name + postfix).c_str(), #name, nbinsx, xlo, xhi, nbinsy, ylo, yhi, nbinsz, zlo, zhi); StoreHisto(name)
13  TRACK_PROFILE3D(range_v_true_mom, 50, 0., 2.5, 50, 0., 2.5);
14  TRACK_PROFILE3D(mcs_v_true_mom, 50, 0., 2.5, 50, 0., 2.5);
15 
16  TRACK_PROFILE3D(range_minus_true, 50, 0., 2.5, 50, -1., 1.);
17  TRACK_PROFILE3D(mcs_minus_true, 50, 0., 2.5, 50, -1., 1.);
18  TRACK_PROFILE3D(pid_confusion_tr, 2, -0.5, 1.5, 2, -0.5, 1.5);
19 #undef TRACK_PROFILE3D
20 #undef TRACK_PROFILE
21 }
#define TRACK_PROFILE3D(name, nbinsy, ylo, yhi, nbinsz, zlo, zhi)

Member Data Documentation

TH3D* ana::SBNOsc::TrackProfiles::mcs_minus_true

Definition at line 16 of file Profile.h.

TH3D* ana::SBNOsc::TrackProfiles::mcs_v_true_mom

Definition at line 17 of file Profile.h.

TH3D* ana::SBNOsc::TrackProfiles::pid_confusion_tr

Definition at line 18 of file Profile.h.

TH3D* ana::SBNOsc::TrackProfiles::range_minus_true

Definition at line 14 of file Profile.h.

TH3D* ana::SBNOsc::TrackProfiles::range_v_true_mom

Definition at line 15 of file Profile.h.


The documentation for this struct was generated from the following files: