MCDumperUtils.cxx
Go to the documentation of this file.
1 /**
2  * @file garsoft/Utilities/MCDumperUtils.cxx
3  * @brief Utility functions to print MC truth information (implementation).
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date November 2, 2017
6  * @see garsoft/Utilities/MCDumpersUtils.h
7  *
8  */
9 
10 // library header
11 #include "MCDumperUtils.h"
12 
13 // ROOT
14 #include "TDatabasePDG.h"
15 #include "TParticlePDG.h"
16 
17 
18 //------------------------------------------------------------------------------
20  switch (origin) {
21  case simb::kUnknown : return "unknown origin";
22  case simb::kBeamNeutrino : return "neutrinos from beam";
23  case simb::kCosmicRay : return "cosmic rays";
24  case simb::kSuperNovaNeutrino: return "supernova neutrinos";
25  case simb::kSingleParticle : return "single particle";
26  default: return "unsupported (" + std::to_string((int)origin) + ")";
27  } // switch
28 } // sim::TruthOriginName()
29 
30 
31 //------------------------------------------------------------------------------
33  switch (ccnc) {
34  case simb::kCC: return "charged weak current";
35  case simb::kNC: return "neutral weak current";
36  default: return "unsupported (" + std::to_string(ccnc) + ")";
37  } // switch
38 } // sim::TruthCCNCname()
39 
40 
41 //------------------------------------------------------------------------------
43 
44  switch (mode) {
45  case 0: return "quasi-elastic";
46  case 1: return "resonant";
47  case 2: return "deep inelastic";
48  case 3: return "coherent";
49  default: return "unknown mode";
50  } // switch
51 
52 } // sim::TruthReactionMode()
53 
54 
55 //------------------------------------------------------------------------------
57  switch (type) {
58  case simb::kUnknownInteraction : return "unknown interaction";
59  case simb::kQE : return "quasi-elastic scattering";
60  case simb::kRes : return "resonant scattering";
61  case simb::kDIS : return "deep inelastic scattering";
62  case simb::kCoh : return "coherent scattering";
63  case simb::kCohElastic : return "coherent elastic scattering";
64  case simb::kElectronScattering : return "electron scattering";
65  case simb::kIMDAnnihilation : return "inverse muon decay annihilation";
66  case simb::kInverseBetaDecay : return "inverse beta decay";
67  case simb::kGlashowResonance : return "Glashow resonance";
68  case simb::kAMNuGamma : return "anomalous neutrino-photon interaction";
69  case simb::kMEC : return "meson exchange current";
70  case simb::kDiffractive : return "diffractive";
71  case simb::kEM : return "electromagnetic";
72  case simb::kWeakMix : return "weak mixing";
73  case simb::kNuanceOffset : return "<nuance offset>";
74  case simb::kCCQE : return "charged current quasi-elastic scattering";
75  case simb::kNCQE : return "neutral current quasi-elastic scattering";
76  case simb::kResCCNuProtonPiPlus : return "resonant charged current neutrino proton pi+";
77  case simb::kResCCNuNeutronPi0 : return "resonant charged current neutrino neutron pi0";
78  case simb::kResCCNuNeutronPiPlus : return "resonant charged current neutrino neutron pi+";
79  case simb::kResNCNuProtonPi0 : return "resonant neutral current neutrino proton pi0";
80  case simb::kResNCNuProtonPiPlus : return "resonant neutral current neutrino proton pi+";
81  case simb::kResNCNuNeutronPi0 : return "resonant neutral current neutrino neutron pi0";
82  case simb::kResNCNuNeutronPiMinus : return "resonant neutral current neutrino neutron pi-";
83  case simb::kResCCNuBarNeutronPiMinus : return "resonant charged current antineutrino neutron pi-";
84  case simb::kResCCNuBarProtonPi0 : return "resonant charged current antineutrino proton pi0";
85  case simb::kResCCNuBarProtonPiMinus : return "resonant charged current antineutrino proton pi-";
86  case simb::kResNCNuBarProtonPi0 : return "resonant neutral current antineutrino proton pi0";
87  case simb::kResNCNuBarProtonPiPlus : return "resonant neutral current antineutrino proton pi+";
88  case simb::kResNCNuBarNeutronPi0 : return "resonant neutral current antineutrino neutron pi0";
89  case simb::kResNCNuBarNeutronPiMinus : return "resonant neutral current antineutrino neutron pi-";
90  case simb::kResCCNuDeltaPlusPiPlus : return "resonant charged current neutrino Delta+ pi+";
91  case simb::kResCCNuDelta2PlusPiMinus : return "resonant charged current neutrino Delta++ pi-";
92  case simb::kResCCNuBarDelta0PiMinus : return "resonant charged current antineutrino Delta0 pi-";
93  case simb::kResCCNuBarDeltaMinusPiPlus : return "resonant charged current antineutrino Delta- pi+";
94  case simb::kResCCNuProtonRhoPlus : return "resonant charged current neutrino proton rho+";
95  case simb::kResCCNuNeutronRhoPlus : return "resonant charged current neutrino neutron rho+";
96  case simb::kResCCNuBarNeutronRhoMinus : return "resonant charged current antineutrino neutron rho-";
97  case simb::kResCCNuBarNeutronRho0 : return "resonant charged current antineutrino neutron rho0";
98  case simb::kResCCNuSigmaPlusKaonPlus : return "resonant charged current neutrino Sigma+ kaon+";
99  case simb::kResCCNuSigmaPlusKaon0 : return "resonant charged current neutrino Sigma+ kaon0";
100  case simb::kResCCNuBarSigmaMinusKaon0 : return "resonant charged current antineutrino Sigma- kaon0";
101  case simb::kResCCNuBarSigma0Kaon0 : return "resonant charged current antineutrino Sigma0 kaon0";
102  case simb::kResCCNuProtonEta : return "resonant charged current neutrino proton eta";
103  case simb::kResCCNuBarNeutronEta : return "resonant charged current antineutrino neutron eta";
104  case simb::kResCCNuKaonPlusLambda0 : return "resonant charged current neutrino Kaon+ Lambda0";
105  case simb::kResCCNuBarKaon0Lambda0 : return "resonant charged current antineutrino kaon0 Lambda0";
106  case simb::kResCCNuProtonPiPlusPiMinus : return "resonant charged current neutrino proton pi+ pi-";
107  case simb::kResCCNuProtonPi0Pi0 : return "resonant charged current neutrino proton pi0 pi0";
108  case simb::kResCCNuBarNeutronPiPlusPiMinus: return "resonant charged current antineutrino neutron pi+ pi-";
109  case simb::kResCCNuBarNeutronPi0Pi0 : return "resonant charged current antineutrino neutron pi0 pi0";
110  case simb::kResCCNuBarProtonPi0Pi0 : return "resonant charged current antineutrino proton pi0 pi0";
111  case simb::kCCDIS : return "charged current deep inelastic scattering";
112  case simb::kNCDIS : return "neutral current deep inelastic scattering";
113  case simb::kUnUsed1 : return "unused (1)";
114  case simb::kUnUsed2 : return "unused (2)";
115  case simb::kCCQEHyperon : return "charged current quasi-elastic scattering with hyperon";
116  case simb::kNCCOH : return "neutral current coherent scattering";
117  case simb::kCCCOH : return "charged current coherent scattering";
118  case simb::kNuElectronElastic : return "electron neutrino elastic";
119  case simb::kInverseMuDecay : return "inverse muon decay";
120  default : return "unsupported (" + std::to_string(type) + ")";
121  } // switch
122 } // sim::TruthInteractionTypeName()
123 
124 
125 //------------------------------------------------------------------------------
127 
128  switch(code) {
129  case -1: return "undefined";
130  case 0: return "initial state";
131  case 1: return "stable final state";
132  case 2: return "intermediate";
133  case 3: return "decayed";
134  case 11: return "nucleon target";
135  case 12: return "pre-fragmentation hadronic state";
136  case 13: return "pre-decay resonant state";
137  case 14: return "hadron in nucleus";
138  case 15: return "final state nuclear remnant";
139  case 16: return "nucleon cluster target";
140  default: return "unknown";
141  } // switch
142 
143 } // sim::ParticleStatusName
144 
145 
146 //------------------------------------------------------------------------------
148  TParticlePDG const* PDGinfo = TDatabasePDG::Instance()->GetParticle(pigid);
149  return PDGinfo? PDGinfo->GetTitle(): ("PDG ID " + std::to_string(pigid));
150 } // sim::ParticleName()
151 
152 
153 //------------------------------------------------------------------------------
neutral current quasi-elastic
Definition: MCNeutrino.h:97
resonant charged current, nubar p -> nubar n pi+
Definition: MCNeutrino.h:109
resonant neutral current, nu p -> nu p pi0
Definition: MCNeutrino.h:101
charged current deep inelastic scatter
Definition: MCNeutrino.h:134
std::string TruthInteractionTypeName(int type)
resonant charged current, nubar p -> l+ p pi-
Definition: MCNeutrino.h:107
neutrino electron elastic scatter
Definition: MCNeutrino.h:140
std::string string
Definition: nybbler.cc:12
resonant charged current, nubar p -> l+ n pi0
Definition: MCNeutrino.h:106
enum simb::_ev_origin Origin_t
event origin types
offset to account for adding in Nuance codes to this enum
Definition: MCNeutrino.h:95
std::string TruthCCNCname(int ccnc)
charged current quasi-elastic
Definition: MCNeutrino.h:96
resonant charged current, nubar p -> nubar p pi0
Definition: MCNeutrino.h:108
resonant charged current, nu n -> l- p pi0
Definition: MCNeutrino.h:99
std::string TruthReactionMode(int mode)
Returns the "mode" of the reaction (a lesser version of interaction type).
resonant neutral current, nu n -> nu n pi0
Definition: MCNeutrino.h:103
resonant charged current, nu n -> l- n pi+
Definition: MCNeutrino.h:100
single particles thrown at the detector
Definition: MCTruth.h:26
resonant charged current, nubar n -> nubar p pi-
Definition: MCNeutrino.h:111
std::string ParticleName(int pigid)
Returns a string with the name of particle the specified with PDG ID.
CodeOutputInterface * code
charged current deep inelastic scatter
Definition: MCNeutrino.h:133
resonant charged current, nu p -> l- p pi+
Definition: MCNeutrino.h:98
n.b.: this group is similar but not quite, entirely unlike GENIE ScatteringType convention ...
Definition: MCNeutrino.h:80
std::string TruthOriginName(simb::Origin_t origin)
Returns a string representing the specified process origin.
charged current coherent pion
Definition: MCNeutrino.h:139
resonant neutral current, nu n -> nu p pi-
Definition: MCNeutrino.h:104
inverse muon decay
Definition: MCNeutrino.h:141
resonant charged current, nubar n -> l+ n pi-
Definition: MCNeutrino.h:105
Supernova neutrinos.
Definition: MCTruth.h:25
resonant charged current, nubar n -> nubar n pi0
Definition: MCNeutrino.h:110
std::string ParticleStatusName(int code)
Describes the status of a particle (simb::MCParticle::StatusCode()).
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
resonant neutral current, nu p -> nu p pi+
Definition: MCNeutrino.h:102
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
Cosmic rays.
Definition: MCTruth.h:24
Beam neutrinos.
Definition: MCTruth.h:23