23{
24
25
26
27
28
29
30
31
32
33 if(!event) {
34 LOG(
"GHepUtils",
pWARN) <<
"Null event!";
35 return 0;
36 }
37
38 int evtype = 0;
39
41
47
56 bool is_mec = proc.
IsMEC();
64 bool W_gt_2 = kine.
KVSet(
kKVW) ? (kine.
W() > 2.0) :
false;
65
66
67
68 if (is_qel && !is_charm && is_cc && is_nu ) evtype = 1;
69 else if (is_qel && !is_charm && is_nc && is_nu && is_p ) evtype = 51;
70 else if (is_qel && !is_charm && is_nc && is_nu && is_n ) evtype = 52;
71 else if (is_qel && !is_charm && is_cc && is_nubar ) evtype = -1;
72 else if (is_qel && !is_charm && is_nc && is_nubar && is_p) evtype = -51;
73 else if (is_qel && !is_charm && is_nc && is_nubar && is_n) evtype = -52;
74
75
76 else if (is_mec && !is_charm && is_cc && is_nu ) evtype = 2;
77 else if (is_mec && !is_charm && is_cc && is_nubar ) evtype = -2;
78
79
80
81 else if (is_qel && is_charm && is_cc && is_nu ) evtype = 26;
82 else if (is_qel && is_charm && is_cc && is_nubar ) evtype = -26;
83
84
85
86 else if ( is_imd ) evtype = 9;
87 else if ( is_ve ) evtype = 59;
88
89
90
91 else if (is_coh_pr && is_cc && is_nu ) evtype = 16;
92 else if (is_coh_pr && is_cc && is_nubar) evtype = -16;
93 else if (is_coh_pr && is_nc && is_nu ) evtype = 36;
94 else if (is_coh_pr && is_nc && is_nubar) evtype = -36;
95
96
97
98
99 else if (is_dis && W_gt_2 && is_cc && is_nu ) evtype = 26;
100 else if (is_dis && W_gt_2 && is_nc && is_nu ) evtype = 46;
101 else if (is_dis && W_gt_2 && is_cc && is_nubar) evtype = -26;
102 else if (is_dis && W_gt_2 && is_nc && is_nubar) evtype = -46;
103
104
105
106 else if ( is_res || (is_dis && !W_gt_2) || is_ask ) {
107
108 LOG(
"GHepUtils",
pNOTICE) <<
"Current event is RES or DIS with W<2";
109
110
111
112
113 int nn=0, np=0, npi0=0, npip=0, npim=0, nKp=0, nKm=0, nK0=0, neta=0, nlambda=0, ngamma=0;
115
116 TIter event_iter(event);
118
119 while ( (p =
dynamic_cast<GHepParticle *
>(event_iter.Next())) )
120 {
122 int ghep_pdgc = p->
Pdg();
124 int ghep_fmpdgc = (ghep_fm==-1) ? 0 : event->Particle(ghep_fm)->Pdg();
125
126
127
128
129
130
132 bool parent_included = (ghep_fmpdgc==
kPdgPi0 || ghep_fmpdgc==
kPdgEta);
133
134 bool count_it =
136 (!nuclear_target && decayed) ||
138
139 if(!count_it) continue;
140
143 if(ghep_pdgc ==
kPdgPiP) npip++;
144 if(ghep_pdgc ==
kPdgPiM) npim++;
145 if(ghep_pdgc ==
kPdgPi0) npi0++;
146 if(ghep_pdgc ==
kPdgEta) neta++;
147 if(ghep_pdgc ==
kPdgKP) nKp++;
148 if(ghep_pdgc ==
kPdgKM) nKm++;
149 if(ghep_pdgc ==
kPdgK0) nK0++;
154 }
156 << "Num of primary particles: \n p = " << np << ", n = " << nn
157 << ", pi+ = " << npip << ", pi- = " << npim << ", pi0 = " << npi0
158 << ", eta = " << neta
159 << ", K+ = " << nKp << ", K- = " << nKm << ", K0 = " << nK0
160 << ", Lambda's = " << nlambda
161 << ", gamma's = " << ngamma;
162
163 int nnuc = np + nn;
164 int npi = npi0 + npip + npim;
165 int nK = nK0 + nKp + nKm;
166 int neKL = neta + nK + nlambda;
167
168 bool is_radiative_dec = (nnuc==1) && (npi==0) && (ngamma==1);
169
170
171
172
173
174 if (is_res && is_nu && is_cc && is_n && is_radiative_dec) evtype = 17;
175 else if (is_res && is_nu && is_nc && is_n && is_radiative_dec) evtype = 38;
176 else if (is_res && is_nu && is_nc && is_p && is_radiative_dec) evtype = 39;
177
178 else if (is_res && is_nubar && is_cc && is_p && is_radiative_dec) evtype = -17;
179 else if (is_res && is_nubar && is_nc && is_n && is_radiative_dec) evtype = -38;
180 else if (is_res && is_nubar && is_nc && is_p && is_radiative_dec) evtype = -39;
181
182
183
184
185
186
187 else if (is_nu && is_cc && is_p && np==1 && nn==0 && npip==1 && npim==0 && npi0==0 && neKL==0) evtype = 11;
188 else if (is_nu && is_cc && is_n && np==1 && nn==0 && npip==0 && npim==0 && npi0==1 && neKL==0) evtype = 12;
189 else if (is_nu && is_cc && is_n && np==0 && nn==1 && npip==1 && npim==0 && npi0==0 && neKL==0) evtype = 13;
190
191
192 else if (is_nu && is_nc && is_n && np==0 && nn==1 && npip==0 && npim==0 && npi0==1 && neKL==0) evtype = 31;
193 else if (is_nu && is_nc && is_p && np==1 && nn==0 && npip==0 && npim==0 && npi0==1 && neKL==0) evtype = 32;
194 else if (is_nu && is_nc && is_n && np==1 && nn==0 && npip==0 && npim==1 && npi0==0 && neKL==0) evtype = 33;
195 else if (is_nu && is_nc && is_p && np==0 && nn==1 && npip==1 && npim==0 && npi0==0 && neKL==0) evtype = 34;
196
197
198 else if (is_nubar && is_cc && is_n && np==0 && nn==1 && npip==0 && npim==1 && npi0==0 && neKL==0) evtype = -11;
199 else if (is_nubar && is_cc && is_p && np==0 && nn==1 && npip==0 && npim==0 && npi0==1 && neKL==0) evtype = -12;
200 else if (is_nubar && is_cc && is_p && np==1 && nn==0 && npip==0 && npim==1 && npi0==0 && neKL==0) evtype = -13;
201
202
203 else if (is_nubar && is_nc && is_n && np==0 && nn==1 && npip==0 && npim==0 && npi0==1 && neKL==0) evtype = -31;
204 else if (is_nubar && is_nc && is_p && np==1 && nn==0 && npip==0 && npim==0 && npi0==1 && neKL==0) evtype = -32;
205 else if (is_nubar && is_nc && is_n && np==1 && nn==0 && npip==0 && npim==1 && npi0==0 && neKL==0) evtype = -33;
206 else if (is_nubar && is_nc && is_p && np==0 && nn==1 && npip==1 && npim==0 && npi0==0 && neKL==0) evtype = -34;
207
208
209
210
211
212 else if (is_res && is_nu && is_cc && is_n && np==1 && nn==0 && npi==0 && nK==0 && nlambda==0 && neta==1) evtype = 22;
213 else if (is_res && is_nu && is_nc && is_n && np==0 && nn==1 && npi==0 && nK==0 && nlambda==0 && neta==1) evtype = 42;
214 else if (is_res && is_nu && is_nc && is_p && np==1 && nn==0 && npi==0 && nK==0 && nlambda==0 && neta==1) evtype = 43;
215
216 else if (is_res && is_nubar && is_cc && is_p && np==0 && nn==1 && npi==0 && nK==0 && nlambda==0 && neta==1) evtype = -22;
217 else if (is_res && is_nubar && is_nc && is_n && np==0 && nn==1 && npi==0 && nK==0 && nlambda==0 && neta==1) evtype = -42;
218 else if (is_res && is_nubar && is_nc && is_p && np==1 && nn==0 && npi==0 && nK==0 && nlambda==0 && neta==1) evtype = -43;
219
220
221
222
223
224 else if (is_res && is_nu && is_cc && is_n && nnuc==0 && npi==0 && nK==1 && nlambda==1 && neta==0) evtype = 23;
225 else if (is_res && is_nu && is_nc && is_n && nnuc==0 && npi==0 && nK==1 && nlambda==1 && neta==0) evtype = 44;
226 else if (is_res && is_nu && is_nc && is_p && nnuc==0 && npi==0 && nK==1 && nlambda==1 && neta==0) evtype = 45;
227
228 else if (is_res && is_nubar && is_cc && is_p && nnuc==0 && npi==0 && nK==1 && nlambda==1 && neta==0) evtype = -23;
229 else if (is_res && is_nubar && is_nc && is_n && nnuc==0 && npi==0 && nK==1 && nlambda==1 && neta==0) evtype = -44;
230 else if (is_res && is_nubar && is_nc && is_p && nnuc==0 && npi==0 && nK==1 && nlambda==1 && neta==0) evtype = -45;
231
232
233
234
235
236 else if (is_ask && is_nu && is_cc && is_n && nn==1 && np==0 && nKp==1 && neKL==1) evtype = 18;
237 else if (is_ask && is_nu && is_cc && is_n && nn==0 && np==1 && nK0==1 && neKL==1) evtype = 19;
238 else if (is_ask && is_nu && is_cc && is_p && nn==0 && np==1 && nKp==1 && neKL==1) evtype = 20;
239
240
241
242
243
244
245
246
247
248
249
250 else if (is_nu && is_cc && npi>1) evtype = 21;
251 else if (is_nu && is_nc && npi>1) evtype = 41;
252 else if (is_nubar && is_cc && npi>1) evtype = -21;
253 else if (is_nubar && is_nc && npi>1) evtype = -41;
254
255
256
257
258
259
260 else {
262 << "Rare RES/low-W DIS final state: Bundled-in with multi-pi events";
263
264 if (is_nu && is_cc) evtype = 21;
265 else if (is_nu && is_nc) evtype = 41;
266 else if (is_nubar && is_cc) evtype = -21;
267 else if (is_nubar && is_nc) evtype = -41;
268 }
269 }
270
271
272 else if ( is_diff && is_cc ) {
273 if ( is_nu ) evtype = 15;
274 else if ( is_nubar ) evtype = -15;
275 }
276 else if ( is_diff && is_nc ) {
277 if ( is_nu ) evtype = 35;
278 else if ( is_nubar ) evtype = -35;
279 }
280
281 return evtype;
282}
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
STDHEP-like event record entry that can fit a particle or a nucleus.
int FirstMother(void) const
GHepStatus_t Status(void) const
Initial State information.
const Target & Tgt(void) const
Summary information for an interaction.
const XclsTag & ExclTag(void) const
const Kinematics & Kine(void) const
const ProcessInfo & ProcInfo(void) const
const InitialState & InitState(void) const
Generated/set kinematical variables for an event.
bool KVSet(KineVar_t kv) const
double W(bool selected=false) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
bool IsWeakNC(void) const
bool IsNuElectronElastic(void) const
bool IsDiffractive(void) const
bool IsDeepInelastic(void) const
bool IsInverseMuDecay(void) const
bool IsWeakCC(void) const
bool IsCoherentProduction(void) const
bool IsQuasiElastic(void) const
bool IsResonant(void) const
bool IsSingleKaon(void) const
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
int HitNucPdg(void) const
bool IsNucleus(void) const
bool HitNucIsSet(void) const
Contains minimal information for tagging exclusive processes.
bool IsCharmEvent(void) const
bool IsNeutrino(int pdgc)
bool IsAntiNeutrino(int pdgc)
enum genie::EGHepStatus GHepStatus_t