DUNE StandardRecord
Base object for DUNE analysis files (CAFs)
Loading...
Searching...
No Matches
SRTrueInteraction.h
Go to the documentation of this file.
1
5
6#ifndef DUNEANAOBJ_SRTRUEINTERACTION_H
7#define DUNEANAOBJ_SRTRUEINTERACTION_H
8
9#include <limits>
10
11#include "duneanaobj/StandardRecord/SREnums.h"
14
15// // This is pretty ugly. The proper fix is to get a new version of castxml that
16// // is built with at least clang v9.
17// // See https://github.com/CastXML/CastXML/issues/178
18// #ifndef __castxml__
19// #include <string>
20// #else
21// namespace std{class string{};}
22// #endif
23
24// a less ugly hack, works with castxml v0_4_2 and e20, c7 and e26 but not c14
25// not needed for castxml v0_5_1. Now e20, c7, c14 work but not e26
26
27//#ifdef __GNUC__
28//#undef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
29//#endif
30
31#include <string>
32
33#include <vector>
34
35namespace caf
36{
37
39 {
40 public:
41 std::vector<float> weights;
42 };
43
46 {
47 private:
48 // just to keep the typing under control below
49 static constexpr float NaN = std::numeric_limits<float>::signaling_NaN();
50
51 public:
54 long int id = -1;
55
59 long int genieIdx = -1;
60
61 int pdg = 0;
62 int pdgorig = 0;
63
64 bool iscc = false;
65 ScatteringMode mode = ScatteringMode::kUnknownMode;
66 int targetPDG = 0;
67
70 int hitnuc = 0;
71 float removalE = NaN;
72
73 float E = NaN;
76 bool isvtxcont = false;
77
78 float time = NaN;
79 float bjorkenX = NaN;
80 float inelasticity = NaN;
81 float Q2 = NaN;
82 float q0 = NaN;
83 float modq = NaN;
84 float W = NaN;
85 float t = NaN;
86
87 // GENIE truth stuff
88 bool ischarm = false;
89 bool isseaquark = false;
90 int resnum = 0;
91 float xsec = NaN;
92
93 float genweight = NaN;
94
95 float baseline = NaN;
98 int parent_dcy_mode = -1;
99 int parent_pdg = 0;
100 float parent_dcy_E = NaN;
101 float imp_weight = NaN;
102
103 Generator generator = Generator::kUnknownGenerator;
104 std::vector<unsigned int> genVersion;
105
106 // fixme: For unknown reasons, deserializing SRTrueInteractions with this branch sometimes (but not always) causes `free: invalid pointer` segfaults.
107 // For the moment, we just disable it, but we need to track down what's going wrong at some point.
108// std::string genConfigString; ///< String associated with generator configuration. (For GENIE 3+, this is the "Comprehensive Model Configuration".)
109
110 // shortcuts to avoid iterating through the particle stack for these simple quantities
111 int nproton = 0;
112 int nneutron = 0;
113 int npip = 0;
114 int npim = 0;
115 int npi0 = 0;
116
117 int nprim = 0;
118 std::vector<SRTrueParticle> prim;
119 int nprefsi = 0;
120 std::vector<SRTrueParticle> prefsi;
121 int nsec = 0;
122 std::vector<SRTrueParticle> sec;
123
124 float xsec_cvwgt = NaN;
125
126 std::vector<SRDialWeights> syst_dials;
127
128 };
129
130} // caf
131
132#endif //DUNEANAOBJ_SRTRUEINTERACTION_H
True particle coming out of a probe particle's interaction w/ detector.
3-vector class with more efficient storage than TVector3. Ported from NOvA StandardRecord.
Definition: SRTrueInteraction.h:39
True interaction of probe particle with detector. Usually neutrinos, but occasionally cosmics etc.
Definition: SRTrueInteraction.h:46
float genweight
Weight, if any, assigned by the generator.
Definition: SRTrueInteraction.h:93
SRVector3D parent_dcy_mom
Neutrino parent momentum at decay [GeV; beam coordinates].
Definition: SRTrueInteraction.h:97
float imp_weight
Importance weight from flux file.
Definition: SRTrueInteraction.h:101
float t
Kinematic t.
Definition: SRTrueInteraction.h:85
int pdg
PDG code of probe particle.
Definition: SRTrueInteraction.h:61
long int genieIdx
Definition: SRTrueInteraction.h:59
float bjorkenX
Bjorken x = (k-k')^2/(2*p.q) = Q^2/(2*Mnuc*q0) [Dimensionless].
Definition: SRTrueInteraction.h:79
Generator generator
The generator that created this neutrino interaction.
Definition: SRTrueInteraction.h:103
ScatteringMode mode
Interaction mode.
Definition: SRTrueInteraction.h:65
bool isvtxcont
Is true vertex is within detector? If not, might be a rock particle or cosmic.
Definition: SRTrueInteraction.h:76
int targetPDG
PDG code of struck target.
Definition: SRTrueInteraction.h:66
float inelasticity
Inelasticity y = (p.q) / (k.p) = q0 / Enu.
Definition: SRTrueInteraction.h:80
int hitnuc
Definition: SRTrueInteraction.h:70
int npi0
number of (post-FSI) primary pi0
Definition: SRTrueInteraction.h:115
int parent_dcy_mode
Parent hadron/muon decay mode.
Definition: SRTrueInteraction.h:98
std::vector< SRDialWeights > syst_dials
Reweights. Outer index = dial, inner index (SRDialWeights) = variation for that dial.
Definition: SRTrueInteraction.h:126
SRVector3D momentum
Neutrino three-momentum.
Definition: SRTrueInteraction.h:75
float q0
Energy transferred from lepton to nuclear system (in lab frame)
Definition: SRTrueInteraction.h:82
float parent_dcy_E
Neutrino parent energy at decay [GeV].
Definition: SRTrueInteraction.h:100
int resnum
Resonance number, straight from GENIE.
Definition: SRTrueInteraction.h:90
SRVector3D prod_vtx
Neutrino production vertex [cm; beam coordinates].
Definition: SRTrueInteraction.h:96
int npim
number of (post-FSI) primary pi-
Definition: SRTrueInteraction.h:114
float W
Hadronic invariant mass W [GeV^2]. "Experimental W" in GENIE parlance, W^2 = M^2 + 2*Mnuc*q0 +|q|^2.
Definition: SRTrueInteraction.h:84
bool isseaquark
Did neutrino scatter from a sea quark?
Definition: SRTrueInteraction.h:89
std::vector< SRTrueParticle > prim
Primary p. The lepton always comes first in this vector.
Definition: SRTrueInteraction.h:118
float removalE
energy expended to remove nucleon from the nucleus, from GENIE
Definition: SRTrueInteraction.h:71
float E
True energy [GeV].
Definition: SRTrueInteraction.h:73
int parent_pdg
PDG Code of parent particle ID.
Definition: SRTrueInteraction.h:99
int npip
number of (post-FSI) primary pi+
Definition: SRTrueInteraction.h:113
std::vector< SRTrueParticle > prefsi
Primary particles prior to FSI.
Definition: SRTrueInteraction.h:120
int nprefsi
How many primary particles there were prior to FSI (helps SRProxy)
Definition: SRTrueInteraction.h:119
float time
True interaction time.
Definition: SRTrueInteraction.h:78
bool ischarm
Did neutrino scatter from a charmed quark?
Definition: SRTrueInteraction.h:88
int nsec
How many secondaries are in this vector? (helps SRProxy)
Definition: SRTrueInteraction.h:121
std::vector< SRTrueParticle > sec
Secondary particles. Note that not all secondaries are kept, only those used in the reco branches.
Definition: SRTrueInteraction.h:122
int pdgorig
Initial (unoscillated) PDG code of probe neutrino (may be different than pdg if this file is a 'swap'...
Definition: SRTrueInteraction.h:62
std::vector< unsigned int > genVersion
Version of the generator that created this neutrino interaction.
Definition: SRTrueInteraction.h:104
float xsec_cvwgt
Central value weight for cross section model.
Definition: SRTrueInteraction.h:124
float xsec
xsec for thrown interaction, in 1/GeV^2, straight from GENIE
Definition: SRTrueInteraction.h:91
SRVector3D vtx
Interaction vertex position in detector coord. [cm].
Definition: SRTrueInteraction.h:74
float modq
Magnitude of three-momentum transferred from lepton to nuclear system, |q| (in lab frame)
Definition: SRTrueInteraction.h:83
int nneutron
number of (post-FSI) primary neutrons
Definition: SRTrueInteraction.h:112
int nprim
Number of primary particles (helps SRProxy)
Definition: SRTrueInteraction.h:117
bool iscc
CC (true) or NC/interference (false)
Definition: SRTrueInteraction.h:64
float Q2
Invariant four-momentum transfer from lepton to nuclear system, Q^2 = -(nu - lep)^2.
Definition: SRTrueInteraction.h:81
int nproton
number of (post-FSI) primary protons
Definition: SRTrueInteraction.h:111
float baseline
Distance from decay to interaction [m].
Definition: SRTrueInteraction.h:95
A 3-vector with more efficient storage than TVector3.
Definition: SRVector3D.h:26
Common Analysis Files.
Definition: Navigate.cxx:8
Generator
Known generators of neutrino interactions (extend as other generators are used)
Definition: SREnums.h:48
ScatteringMode
Neutrino interaction categories. Periodically synchronized to GENIE (last update: GENIE 3....
Definition: SREnums.h:75