MaCh3 DUNE 1.0.0
Reference Guide
Loading...
Searching...
No Matches
StructsDUNE.h
Go to the documentation of this file.
1#ifndef _StructsDUNE_h_
2#define _StructsDUNE_h_
3
4#include <iostream>
5
6#include "TVector3.h"
7#include "TLorentzVector.h"
8
9struct dunemc_base {
10
11 int nEvents; // how many MC events are there
12 int *Target; //Target the interaction was on
13
14 int *nupdg;
16
17 double *rw_erec;
19 double *rw_erec_had;
20 double *rw_erec_lep;
21 double *rw_yrec;
22 double *rw_eRecoP;
23 double *rw_eRecoPip;
24 double *rw_eRecoPim;
25 double *rw_eRecoPi0;
26 double *rw_eRecoN;
27
28 double *rw_LepE;
29 double *rw_eP;
30 double *rw_ePip;
31 double *rw_ePim;
32 double *rw_ePi0;
33 double *rw_eN;
34
35 double *rw_etru;
36 double *rw_mom;
37 double *rw_theta;
38 double *rw_Q2;
39
40 double *rw_cvnnumu;
41 double *rw_cvnnue;
47 int *rw_isCC;
50 int *rw_run;
51 bool *rw_isFHC;
52 double *rw_vtx_x;
53 double *rw_vtx_y;
54 double *rw_vtx_z;
55 double dummy_y;
56 double *rw_reco_q;
57 double *reco_numu;
58
59 double pot_s;
60 double norm_s;
61
62 double *beam_w;
63 double *flux_w;
64
65 double *mode;
66 int *isbound;
67
68 double *rw_truecz;
69
70 int *nproton;
71 int *nneutron;
72 int *npip;
73 int *npim;
74 int *npi0;
75
76 int *ntruemuon; //number of true muons
77 int *ntruemuonprim; //number of true primary muons
78 int *nrecomuon; //number of reconstructed muons
79 double *nmuonsratio; //number of reco muons divided by number of true muons
80
81 double *rw_lep_pT; //transverse lepton momentum
82 double *rw_lep_pZ; //parallel lepton momentum
86 double *rw_reco_rad;
87 double *rw_rad;
88
89 double *rw_elep_reco;
90 double *rw_elep_true;
91
93 bool *in_fdv;
94};
95
96// ********************************
97// ND Detector Systematic Functions
98// ********************************
99
100// -------------------------------------------------------------------------
101// Global ND Energy Scale Systematics - Essentially Calibration Uncertainty
102// Don't shift muon energy since that isn't calculated calorimetrically
103// -------------------------------------------------------------------------
104
105
106// Total Energy Scale
107inline void TotalEScaleND(const double * par, double * erec, double erecHad, double erecLep, bool NotCCnumu) {
108
109 (*erec) += (*par) * erecHad;
110
111 //if not true CC numu event AND reco nue event
112 if (NotCCnumu)
113 {
114 (*erec) += (*par) * erecLep;
115 }
116
117}
118
119// Total Energy Scale Sqrt
120inline void TotalEScaleSqrtND(const double * par, double * erec, double erecHad, double erecLep, double sqrtErecHad, double sqrtErecLep, bool NotCCnumu) {
121
122 (*erec) += (*par) * sqrtErecHad * erecHad ;
123
124 //if not true CC numu AND reco nue event
125 if (NotCCnumu)
126 {
127 (*erec) += (*par) * sqrtErecLep * erecLep;
128 }
129
130}
131
132// Total Energy Scale Inverse Sqrt
133inline void TotalEScaleInvSqrtND(const double * par, double * erec, double erecHad, double erecLep, double invSqrtErecHad, double invSqrtErecLep, bool NotCCnumu) {
134
135 (*erec) += (*par) * invSqrtErecHad * erecHad ;
136
137 //if not true CC numu AND reco nue event
138 if (NotCCnumu)
139 {
140 (*erec) += (*par) * invSqrtErecLep * erecLep;
141 }
142
143}
144
145// ---------------------------------------------------------------
146// Particle-Specific Uncertainties - Essentially Particle Response
147// ---------------------------------------------------------------
148
149
150// ---------------------------------------------------------------
151// CHARGED HADRONS
152// ---------------------------------------------------------------
153
154
155// Charged Hadron Energy Scale
156inline void HadEScaleND(const double * par, double * erec, double sumEhad) {
157
158 // Protons + Positive Pions + Negative Pions
159 (*erec) += (*par) * sumEhad;
160
161}
162
163// Charged Hadron Energy Scale Sqrt
164inline void HadEScaleSqrtND(const double * par, double * erec, double sumEhad, double sqrtSumEhad) {
165
166 // Protons + Positive Pions + Negative Pions
167 (*erec) += (*par) * sqrtSumEhad * sumEhad;
168
169}
170
171// Charged Hadron Energy Scale Inv Sqrt
172inline void HadEScaleInvSqrtND(const double * par, double * erec, double sumEhad, double invSqrtSumEhad) {
173
174 // Protons + Positive Pions + Negative Pions
175 (*erec) += (*par) * invSqrtSumEhad * sumEhad;
176
177}
178
179
180// ---------------------------------------------------------------
181// Muons
182// ---------------------------------------------------------------
183
184
185// Muon Energy Scale
186inline void MuEScaleND(const double * par, double * erec, double erecLep, bool CCnumu) {
187
188 //if true CC numu AND reco numu event
189 if (CCnumu)
190 {
191 (*erec) += (*par) * erecLep;
192 }
193
194}
195
196// Muon Energy Scale Sqrt
197inline void MuEScaleSqrtND(const double * par, double * erec, double erecLep, double sqrtErecLep, bool CCnumu) {
198
199 //if true CC numu AND reco numu event
200 if (CCnumu)
201 {
202 (*erec) += (*par) * sqrtErecLep * erecLep;
203 }
204
205}
206
207// Muon Energy Scale Inverse Sqrt
208inline void MuEScaleInvSqrtND(const double * par, double * erec, double erecLep, double invSqrtErecLep, bool CCnumu) {
209
210 //if true CC numu AND reco numu event
211 if (CCnumu)
212 {
213 (*erec) += (*par) * invSqrtErecLep * erecLep;
214 }
215
216}
217
218// ---------------------------------------------------------------
219// Neutrons
220// ---------------------------------------------------------------
221
222
223// Neutron Energy Scale
224inline void NEScaleND(const double * par, double * erec, double eRecoN) {
225
226 (*erec) += (*par) * eRecoN;
227
228}
229
230// Neutron Energy Scale Sqrt
231inline void NEScaleSqrtND(const double * par, double * erec, double eRecoN, double sqrteRecoN) {
232
233 (*erec) += (*par) * sqrteRecoN * eRecoN;
234
235}
236
237// Neutron Energy Scale Inverse Sqrt
238inline void NEScaleInvSqrtND(const double * par, double * erec, double eRecoN, double invSqrteRecoN) {
239
240 (*erec) += (*par) * invSqrteRecoN * eRecoN;
241
242}
243
244// ---------------------------------------------------------------
245// Electromagnetic Shower
246// ---------------------------------------------------------------
247
248
249// Electromagnetic Shower Energy Scale
250inline void EMEScaleND(const double * par, double * erec, double eRecoPi0, double erecLep, bool CCnue) {
251
252 (*erec) += (*par) * eRecoPi0;
253
254 //if true CC nue AND reco nue event
255 if (CCnue)
256 {
257 (*erec) += (*par) * erecLep;
258 }
259
260}
261
262// Electromagnetic Shower Energy Scale Sqrt
263inline void EMEScaleSqrtND(const double * par, double * erec, double eRecoPi0, double erecLep, double sqrtErecLep, double sqrteRecoPi0, bool CCnue) {
264
265 (*erec) += (*par) * sqrteRecoPi0 * eRecoPi0;
266
267 //if true CC nue AND reco nue event
268 if (CCnue)
269 {
270 (*erec) += (*par) * sqrtErecLep * erecLep;
271 }
272
273}
274
275// Electromagnetic Shower Energy Scale Inverse Sqrt
276inline void EMEScaleInvSqrtND(const double * par, double * erec, double eRecoPi0, double erecLep, double invSqrtErecLep, double invSqrteRecoPi0, bool CCnue) {
277
278 (*erec) += (*par) * invSqrteRecoPi0 * eRecoPi0;
279
280 //if true CC nue AND reco nue event
281 if (CCnue)
282 {
283 (*erec) += (*par) * invSqrtErecLep * erecLep;
284 }
285
286}
287
288// ---------------------------------------------------------------
289// Resolution Uncertainties
290// ---------------------------------------------------------------
291
292// ---------------------------------------------------------------
293// CHARGED HADRONS
294// ---------------------------------------------------------------
295inline void HadResND(const double * par, double * erec, double eRecoP, double eRecoPip, double eRecoPim, double eP, double ePip, double ePim) {
296
297 // Reco Sum: Protons + Positive Pions + Negative Pions
298 double recoSum = eRecoP + eRecoPip + eRecoPim;
299
300 // True Sum: Protons + Positive Pions + Negative Pions
301 double trueSum = eP + ePip + ePim;
302
303 (*erec) += (*par) * (trueSum - recoSum);
304
305}
306
307// ---------------------------------------------------------------
308// Muons
309// ---------------------------------------------------------------
310inline void MuResND(const double * par, double * erec, double erecLep, double LepE, bool CCnumu) {
311
312 //if true CC numu AND reco numu event
313 if (CCnumu)
314 {
315 (*erec) += (*par) * (LepE - erecLep);
316 }
317
318}
319
320
321// ---------------------------------------------------------------
322// Neutron
323// ---------------------------------------------------------------
324inline void NResND(const double * par, double * erec, double eRecoN, double eN) {
325
326 (*erec) += (*par) * (eN - eRecoN);
327
328}
329
330// ---------------------------------------------------------------
331// Electromagnetic Shower
332// ---------------------------------------------------------------
333
334inline void EMResND(const double * par, double * erec, double eRecoPi0, double ePi0, double erecLep, double LepE, bool CCnue) {
335
336 (*erec) += (*par) * (ePi0 - eRecoPi0);
337
338 //if true CC nue AND reco nue event
339 if (CCnue)
340 {
341 (*erec) += (*par) * (LepE - erecLep);
342 }
343
344}
345
346// ********************************
347// FD Detector Systematic Functions
348// ********************************
349
350// -------------------------------------------------------------------------
351// Global FD Energy Scale Systematics - Essentially Calibration Uncertainty
352// Don't shift muon energy since that isn't calculated calorimetrically
353// -------------------------------------------------------------------------
354
355
356// Total Energy Scale
357inline void TotalEScaleFD(const double * par, double * erec, double erecHad, double erecLep, bool NotCCnumu) {
358
359 (*erec) += (*par) * erecHad;
360
361 //if not true CC numu event AND reco nue event
362 if (NotCCnumu)
363 {
364 (*erec) += (*par) * erecLep;
365 }
366
367}
368
369// Total Energy Scale Sqrt
370inline void TotalEScaleSqrtFD(const double * par, double * erec, double erecHad, double erecLep, double sqrtErecHad, double sqrtErecLep, bool NotCCnumu) {
371
372 (*erec) += (*par) * sqrtErecHad * erecHad ;
373
374 //if not true CC numu AND reco nue event
375 if (NotCCnumu)
376 {
377 (*erec) += (*par) * sqrtErecLep * erecLep;
378 }
379
380}
381
382// Total Energy Scale Inverse Sqrt
383inline void TotalEScaleInvSqrtFD(const double * par, double * erec, double erecHad, double erecLep, double invSqrtErecHad, double invSqrtErecLep, bool NotCCnumu) {
384
385 (*erec) += (*par) * invSqrtErecHad * erecHad ;
386
387 //if not true CC numu AND reco nue event
388 if (NotCCnumu)
389 {
390 (*erec) += (*par) * invSqrtErecLep * erecLep;
391 }
392
393}
394
395// ---------------------------------------------------------------
396// Particle-Specific Uncertainties - Essentially Particle Response
397// ---------------------------------------------------------------
398
399
400// ---------------------------------------------------------------
401// CHARGED HADRONS
402// ---------------------------------------------------------------
403
404
405// Charged Hadron Energy Scale
406inline void HadEScaleFD(const double * par, double * erec, double sumEhad) {
407
408 // Protons + Positive Pions + Negative Pions
409 (*erec) += (*par) * sumEhad;
410
411}
412
413// Charged Hadron Energy Scale Sqrt
414inline void HadEScaleSqrtFD(const double * par, double * erec, double sumEhad, double sqrtSumEhad) {
415
416 // Protons + Positive Pions + Negative Pions
417 (*erec) += (*par) * sqrtSumEhad * sumEhad;
418
419}
420
421// Charged Hadron Energy Scale Inv Sqrt
422inline void HadEScaleInvSqrtFD(const double * par, double * erec, double sumEhad, double invSqrtSumEhad) {
423
424 // Protons + Positive Pions + Negative Pions
425 (*erec) += (*par) * invSqrtSumEhad * sumEhad;
426
427}
428
429
430// ---------------------------------------------------------------
431// Muons
432// ---------------------------------------------------------------
433
434
435// Muon Energy Scale
436inline void MuEScaleFD(const double * par, double * erec, double erecLep, bool CCnumu) {
437
438 //if true CC numu AND reco numu event
439 if (CCnumu)
440 {
441 (*erec) += (*par) * erecLep;
442 }
443
444}
445
446// Muon Energy Scale Sqrt
447inline void MuEScaleSqrtFD(const double * par, double * erec, double erecLep, double sqrtErecLep, bool CCnumu) {
448
449 //if true CC numu AND reco numu event
450 if (CCnumu)
451 {
452 (*erec) += (*par) * sqrtErecLep * erecLep;
453 }
454
455}
456
457// Muon Energy Scale Inverse Sqrt
458inline void MuEScaleInvSqrtFD(const double * par, double * erec, double erecLep, double invSqrtErecLep, bool CCnumu) {
459
460 //if true CC numu AND reco numu event
461 if (CCnumu)
462 {
463 (*erec) += (*par) * invSqrtErecLep * erecLep;
464 }
465
466}
467
468// ---------------------------------------------------------------
469// Neutrons
470// ---------------------------------------------------------------
471
472
473// Neutron Energy Scale
474inline void NEScaleFD(const double * par, double * erec, double eRecoN) {
475
476 (*erec) += (*par) * eRecoN;
477
478}
479
480// Neutron Energy Scale Sqrt
481inline void NEScaleSqrtFD(const double * par, double * erec, double eRecoN, double sqrteRecoN) {
482
483 (*erec) += (*par) * sqrteRecoN * eRecoN;
484
485}
486
487// Neutron Energy Scale Inverse Sqrt
488inline void NEScaleInvSqrtFD(const double * par, double * erec, double eRecoN, double invSqrteRecoN) {
489
490 (*erec) += (*par) * invSqrteRecoN * eRecoN;
491
492}
493
494// ---------------------------------------------------------------
495// Electromagnetic Shower
496// ---------------------------------------------------------------
497
498
499// Electromagnetic Shower Energy Scale
500inline void EMEScaleFD(const double * par, double * erec, double eRecoPi0, double erecLep, bool CCnue) {
501
502 (*erec) += (*par) * eRecoPi0;
503
504 //if true CC nue AND reco nue event
505 if (CCnue)
506 {
507 (*erec) += (*par) * erecLep;
508 }
509
510}
511
512// Electromagnetic Shower Energy Scale Sqrt
513inline void EMEScaleSqrtFD(const double * par, double * erec, double eRecoPi0, double erecLep, double sqrtErecLep, double sqrteRecoPi0, bool CCnue) {
514
515 (*erec) += (*par) * sqrteRecoPi0 * eRecoPi0;
516
517 //if true CC nue AND reco nue event
518 if (CCnue)
519 {
520 (*erec) += (*par) * sqrtErecLep * erecLep;
521 }
522
523}
524
525// Electromagnetic Shower Energy Scale Inverse Sqrt
526inline void EMEScaleInvSqrtFD(const double * par, double * erec, double eRecoPi0, double erecLep, double invSqrtErecLep, double invSqrteRecoPi0, bool CCnue) {
527
528 (*erec) += (*par) * invSqrteRecoPi0 * eRecoPi0;
529
530 //if true CC nue AND reco nue event
531 if (CCnue)
532 {
533 (*erec) += (*par) * invSqrtErecLep * erecLep;
534 }
535
536}
537
538// ---------------------------------------------------------------
539// Resolution Uncertainties
540// ---------------------------------------------------------------
541
542// ---------------------------------------------------------------
543// CHARGED HADRONS
544// ---------------------------------------------------------------
545inline void HadResFD(const double * par, double * erec, double eRecoP, double eRecoPip, double eRecoPim, double eP, double ePip, double ePim) {
546
547 // Reco Sum: Protons + Positive Pions + Negative Pions
548 double recoSum = eRecoP + eRecoPip + eRecoPim;
549
550 // True Sum: Protons + Positive Pions + Negative Pions
551 double trueSum = eP + ePip + ePim;
552
553 (*erec) += (*par) * (trueSum - recoSum);
554
555}
556
557// ---------------------------------------------------------------
558// Muons
559// ---------------------------------------------------------------
560inline void MuResFD(const double * par, double * erec, double erecLep, double LepE, bool CCnumu) {
561
562 //if true CC numu AND reco numu event
563 if (CCnumu)
564 {
565 (*erec) += (*par) * (LepE - erecLep);
566 }
567
568}
569
570
571// ---------------------------------------------------------------
572// Neutron
573// ---------------------------------------------------------------
574inline void NResFD(const double * par, double * erec, double eRecoN, double eN) {
575
576 (*erec) += (*par) * (eN - eRecoN);
577
578}
579
580// ---------------------------------------------------------------
581// Electromagnetic Shower
582// ---------------------------------------------------------------
583
584inline void EMResFD(const double * par, double * erec, double eRecoPi0, double ePi0, double erecLep, double LepE, bool CCnue) {
585
586 (*erec) += (*par) * (ePi0 - eRecoPi0);
587
588 //if true CC nue AND reco nue event
589 if (CCnue)
590 {
591 (*erec) += (*par) * (LepE - erecLep);
592 }
593
594}
595
596// ---------------------------------------------------------------
597// FD Reconstruction Uncertainties - Shift on CVN Scores
598// ---------------------------------------------------------------
599
600//CVN Numu
601inline void CVNNumuFD(const double * par, double * cvnnumu) {
602
603 (*cvnnumu) += (*par);
604
605}
606
607//CVN Nue
608inline void CVNNueFD(const double * par, double * cvnnue) {
609
610 (*cvnnue) += (*par);
611
612}
613
614// ***************************
615// Struct to describe the GENIE interaction modes that will be used during the fit
616// Note: these modes can be found in https://github.com/GENIE-MC/Generator/blob/R-2_12_10/src/Interaction/ScatteringType.h
618 // ***************************
619
620 // CCQE
622 // 1 Kaon
624 // CC DIS
626 // CC RES
628 // CC COH
630 // CC Diffractive
632 // CC Electron EL
634 // CC Inverse Muon Decay
636 // CC Atmospheric Neutrino Gamma
638 // CC MEC (aka 2p2h)
640 // CC Coherent Elastic
642 // CC Inverse Beta Decay
644 // CC GlashowRES
646 // CC IMD Annihilation
648
649 // NCQE
651 // NC DIS
653 // NC RES
655 // NC COH
657 // CC Diffractive
659 // NC Electron EL
661 // NC Inverse Muon Decay
663 // NC Atmospheric Neutrino Gamma
665 // NC MEC (aka 2p2h)
667 // NC Coherent Elastic
669 // NC Inverse Beta Decay
671 // NC GlashowRES
673 // NC IMD Annihilation
675
676 // Keep a counter of the number of MaCh3 modes we have
679
680
681// ***************************
682// Struct to describe the SIMB interaction modes which are found inside the FD CAF files
683// Note: this modes can be found in https://nusoft.fnal.gov/larsoft/doxsvn/html/namespacesimb.html
685 // ***************************
686
687 // Unknown
689 // QE
690 kQE = 0,
691 // Resonant
692 kRes = 1,
693 // DIS
694 kDIS = 2,
695 // Coherent
696 kCoh = 3,
697 // Coherent Elastic
699 // Electron Scattering
701 // Inverse Muon Decay Annihliation
703 // Inverse Beta Decay
705 // Glasgow Resonance
707 // Atmospheric Muon Nu Gamma
709 // MEC aka 2p2h
710 kMEC = 10,
711 // Diffractive
713 //
714 kEM = 12,
715 //
717 // Just keep a counter of the number of modes
720
721// ***************************
722// Struct to describe the GENIE interaction modes which are found inside the ND CAF files
723// Note: this modes can be found in https://github.com/GENIE-MC/Generator/blob/R-2_12_10/src/Interaction/ScatteringType.N
725 // ***************************
726
727 // Unknown
729 // QE
730 gQE = 1,
731 // Single Kaon
733 // DIS
734 gDIS = 3,
735 // RES
736 gRes = 4,
737 // Coherent
738 gCoh = 5,
739 // Diffractive
741 // Nu-e Elastic
743 // Inverse Muon Decay
744 gIMD = 8,
745 // Atmospheric Muon Nu Gamma
747 // MEC aka 2p2h
748 gMEC = 10,
749 // Coherent Elastic
751 // Inverse Beta Decay
753 // Glasgow Resonance
755 // Inverse Muon Decay Annihliation
757 // Just keep a counter of the number of modes
760
761// **********************
762// Convert an input SIMB mode to the MaCh3 (GENIE) modes
763inline int SIMBMode_ToMaCh3Mode(int SIMB_mode, int isCC) {
764 // **********************
765
766 int ReturnMode = kMaCh3_nModes;
767
768 if (isCC == 1) {
769 switch (SIMB_mode) {
770 //Unknown
772 std::cerr << "Unknown Interaction mode:" << SIMB_mode << std::endl;
773 throw;
774 //QE
775 case kQE:
776 ReturnMode = kMaCh3_CCQE; // CC QE in MaCh3 DUNE
777 break;
778 // DIS
779 case kDIS:
780 ReturnMode = kMaCh3_CC_DIS; //CC DIS in MaCh3 DUNE
781 break;
782 // RES
783 case kRes:
784 ReturnMode = kMaCh3_CC_RES; // CC RES in MaCh3 DUNE
785 break;
786 // Coherent
787 case kCoh:
788 ReturnMode = kMaCh3_CC_COH; // CC Coh in MaCh3 DUNE
789 break;
790 // Diffractive
791 case kDiffractive:
792 ReturnMode = kMaCh3_CC_Diffractive; // CC multi-pi in MaCh3
793 break;
794 // Nue Elastic
796 ReturnMode = kMaCh3_CC_Nue_EL; // CC Nue scattering in MaCh3 DUNE
797 break;
798 // Atmospheric Mu Gamma
799 case kAMNuGamma:
800 ReturnMode = kMaCh3_CC_AMnuGamma; // CC Am Nu Mu in MaCh3 DUNE
801 break;
802 // MEC
803 case kMEC:
804 ReturnMode = kMaCh3_CC_MEC; // CC MEC in MaCh3 DUNE
805 break;
806 // Coherent Elastic
807 case kCohElastic:
808 ReturnMode = kMaCh3_CC_COHEL; // CC Coherent Elastic in MaCh3 DUNE
809 break;
810 // Inverse Beta Decay
812 ReturnMode = kMaCh3_CC_IBD; // CC Inverse Beta Decay in MaCh3 DUNE
813 break;
814 // Glashow Resonance
816 ReturnMode = kMaCh3_CC_GlashowRES; // CC Glashow Reaonance in DUNE
817 break;
818 // IMD Annihilation
819 case kIMDAnnihilation:
820 ReturnMode = kMaCh3_CC_IMDAnnihalation; // CC Inverse Muon Decay Annihalation in DUNE
821 break;
822 default:
823 std::cerr << "Invalid mode:" << SIMB_mode << std::endl;
824 throw;
825 }
826
827 }
828
829
830 if (isCC == 0) {
831 switch (SIMB_mode) {
832 //Unknown
834 std::cerr << "Unknown Interaction mode:" << SIMB_mode << std::endl;
835 throw;
836 //QE
837 case kQE:
838 ReturnMode = kMaCh3_NCQE; // NC QE in MaCh3 DUNE
839 break;
840 // DIS
841 case kDIS:
842 ReturnMode = kMaCh3_NC_DIS; // NC DIS in MaCh3 DUNE
843 break;
844 // RES
845 case kRes:
846 ReturnMode = kMaCh3_NC_RES; // NC RES in MaCh3 DUNE
847 break;
848 // Coherent
849 case kCoh:
850 ReturnMode = kMaCh3_NC_COH; // NC Coh in MaCh3 DUNE
851 break;
852 // Diffractive
853 case kDiffractive:
854 ReturnMode = kMaCh3_NC_Diffractive; // CC multi-pi in MaCh3
855 break;
856 // Nue Elastic
858 ReturnMode = kMaCh3_NC_Nue_EL; // NC Nue scattering in MaCh3 DUNE
859 break;
860 // Atmospheric Mu Gamma
861 case kAMNuGamma:
862 ReturnMode = kMaCh3_NC_AMnuGamma; // NC Am Nu Mu in MaCh3 DUNE
863 break;
864 // MEC
865 case kMEC:
866 ReturnMode = kMaCh3_NC_MEC; // NC MEC in MaCh3 DUNE
867 break;
868 // Coherent Elastic
869 case kCohElastic:
870 ReturnMode = kMaCh3_NC_COHEL; // NC Coherent Elastic in MaCh3 DUNE
871 break;
872 // Inverse Beta Decay
874 ReturnMode = kMaCh3_NC_IBD; // Inverse Beta Decay in MaCh3 DUNE
875 break;
876 // Glashow Resonance
878 ReturnMode = kMaCh3_NC_GlashowRES;
879 break;
880 // IMD Annihilation
881 case kIMDAnnihilation:
882 ReturnMode = kMaCh3_NC_IMDAnnihalation;
883 break;
884 default:
885 std::cerr << "Invalid mode:" << SIMB_mode << std::endl;
886 throw;
887 }
888
889 }
890
891 return ReturnMode;
892};
893
894// **********************
895// Convert an input SIMB mode to the MaCh3 (GENIE) modes
896inline int GENIEMode_ToMaCh3Mode(int GENIE_mode, int isCC) {
897 // **********************
898
899 int ReturnMode = kMaCh3_nModes;
900
901 if (isCC == 1) {
902 switch (GENIE_mode) {
903 //Unknown
905 ReturnMode = kMaCh3_nModes;
906 break;
907 //QE
908 case gQE:
909 ReturnMode = kMaCh3_CCQE; // CC QE in MaCh3 DUNE
910 break;
911 // DIS
912 case gDIS:
913 ReturnMode = kMaCh3_CC_DIS; //CC DIS in MaCh3 DUNE
914 break;
915 // RES
916 case gRes:
917 ReturnMode = kMaCh3_CC_RES; // CC RES in MaCh3 DUNE
918 break;
919 // Coherent
920 case gCoh:
921 ReturnMode = kMaCh3_CC_COH; // CC Coh in MaCh3 DUNE
922 break;
923 // Diffractive
924 case gDiffractive:
925 ReturnMode = kMaCh3_CC_Diffractive; // CC multi-pi in MaCh3
926 break;
927 // Nue Elastic
929 ReturnMode = kMaCh3_CC_Nue_EL; // CC Nue scattering in MaCh3 DUNE
930 break;
931 // Atmospheric Mu Gamma
932 case gAMNuGamma:
933 ReturnMode = kMaCh3_CC_AMnuGamma; // CC Am Nu Mu in MaCh3 DUNE
934 break;
935 // MEC
936 case gMEC:
937 ReturnMode = kMaCh3_CC_MEC; // CC MEC in MaCh3 DUNE
938 break;
939 // Coherent Elastic
940 case gCohElastic:
941 ReturnMode = kMaCh3_CC_COHEL; // CC Coherent Elastic in MaCh3 DUNE
942 break;
943 // Inverse Beta Decay
945 ReturnMode = kMaCh3_CC_IBD; // CC Inverse Beta Decay in MaCh3 DUNE
946 break;
947 // Glashow Resonance
949 ReturnMode = kMaCh3_CC_GlashowRES; // NC 1 gamma
950 break;
951 // IMD Annihilation
952 case gIMDAnnihilation:
953 ReturnMode = kMaCh3_CC_IMDAnnihalation; // NC other in MaCh3
954 break;
955 case gIMD:
956 ReturnMode = kMaCh3_CC_IMDAnnihalation; // Stick Inverse Muon Decay into above
957 break;
958 case gSingleKaon:
959 ReturnMode = kMaCh3_CC_IMDAnnihalation; // Stick Single Kaon into above
960 break;
961 default:
962 ReturnMode = kMaCh3_nModes; // Something else in MaCh3 (sand?)
963 break;
964 }
965
966 }
967
968
969 if (isCC == 0) {
970 switch (GENIE_mode) {
971 //Unknown
973 ReturnMode = kMaCh3_nModes;
974 break;
975 //QE
976 case gQE:
977 ReturnMode = kMaCh3_NCQE; // NC QE in MaCh3 DUNE
978 break;
979 // DIS
980 case gDIS:
981 ReturnMode = kMaCh3_NC_DIS; // NC DIS in MaCh3 DUNE
982 break;
983 // RES
984 case gRes:
985 ReturnMode = kMaCh3_NC_RES; // NC RES in MaCh3 DUNE
986 break;
987 // Coherent
988 case gCoh:
989 ReturnMode = kMaCh3_NC_COH; // NC Coh in MaCh3 DUNE
990 break;
991 // Diffractive
992 case gDiffractive:
993 ReturnMode = kMaCh3_NC_Diffractive; // CC multi-pi in MaCh3
994 break;
995 // Nue Elastic
997 ReturnMode = kMaCh3_NC_Nue_EL; // NC Nue scattering in MaCh3 DUNE
998 break;
999 // Atmospheric Mu Gamma
1000 case gAMNuGamma:
1001 ReturnMode = kMaCh3_NC_AMnuGamma; // NC Am Nu Mu in MaCh3 DUNE
1002 break;
1003 // MEC
1004 case gMEC:
1005 ReturnMode = kMaCh3_NC_MEC; // NC MEC in MaCh3 DUNE
1006 break;
1007 // Coherent Elastic
1008 case gCohElastic:
1009 ReturnMode = kMaCh3_NC_COHEL; // NC Coherent Elastic in MaCh3 DUNE
1010 break;
1011 // Inverse Beta Decay
1012 case gInverseBetaDecay:
1013 ReturnMode = kMaCh3_NC_IBD; // Inverse Beta Decay in MaCh3 DUNE
1014 break;
1015 // Glashow Resonance
1016 case gGlashowResonance:
1017 ReturnMode = kMaCh3_NC_GlashowRES;
1018 break;
1019 // IMD Annihilation
1020 case gIMDAnnihilation:
1021 ReturnMode = kMaCh3_NC_IMDAnnihalation;
1022 break;
1023 case gIMD:
1024 ReturnMode = kMaCh3_NC_IMDAnnihalation;
1025 break;
1026 case gSingleKaon:
1027 ReturnMode = kMaCh3_NC_IMDAnnihalation;
1028 break;
1029 default:
1030 ReturnMode = kMaCh3_nModes; // Something else in MaCh3 (sand?)
1031 break;
1032 }
1033
1034 }
1035
1036 return ReturnMode;
1037};
1038
1039// *******************************
1040// Convert MaCh3 mode to SK name
1041inline std::string MaCh3mode_ToDUNEString(MaCh3_Mode i) {
1042 // *******************************
1043 std::string name;
1044
1045 switch(i) {
1046 case kMaCh3_CCQE:
1047 name = "ccqe";
1048 break;
1050 name = "unknown";
1051 break;
1052 case kMaCh3_CC_DIS:
1053 name = "ccdis";
1054 break;
1055 case kMaCh3_CC_RES:
1056 name = "ccres";
1057 break;
1058 case kMaCh3_CC_COH:
1059 name = "cccoh";
1060 break;
1061 case kMaCh3_CC_COHEL:
1062 name = "cccohel";
1063 break;
1065 name = "ccdiff";
1066 break;
1067 case kMaCh3_CC_Nue_EL:
1068 name = "ccnueel";
1069 break;
1070 case kMaCh3_CC_MEC:
1071 name = "ccmec";
1072 break;
1073 case kMaCh3_CC_IMD:
1074 name = "ccIMD";
1075 break;
1077 name = "ccglasres";
1078 break;
1080 name = "ccimdannihilation";
1081 break;
1083 name = "ccamnugamma";
1084 break;
1085 case kMaCh3_CC_IBD:
1086 name = "ccibd";
1087 break;
1088 case kMaCh3_NCQE:
1089 name = "ncqe";
1090 break;
1091 case kMaCh3_NC_DIS:
1092 name = "ncdis";
1093 break;
1094 case kMaCh3_NC_RES:
1095 name = "ncres";
1096 break;
1097 case kMaCh3_NC_COH:
1098 name = "nccoh";
1099 break;
1100 case kMaCh3_NC_COHEL:
1101 name = "nccohel";
1102 break;
1104 name = "ncdiff";
1105 break;
1106 case kMaCh3_NC_Nue_EL:
1107 name = "ncnueel";
1108 break;
1109 case kMaCh3_NC_MEC:
1110 name = "ncmec";
1111 break;
1112 case kMaCh3_NC_IMD:
1113 name = "ncIMD";
1114 break;
1116 name = "ncglasres";
1117 break;
1119 name = "ncimdannihilation";
1120 break;
1122 name = "ncamnugamma";
1123 break;
1124 case kMaCh3_NC_IBD:
1125 name = "ncibd";
1126 break;
1127 case kMaCh3_nModes:
1128 name = "unknown";
1129 break;
1130 default:
1131 std::cerr << "Did not find the MaCh3 mode you specified " << i << std::endl;
1132 name = "UNKNOWN_BAD";
1133 }
1134
1135 return name;
1136}
1137
1139
1140 // ***************************
1141 // CCQE
1143 // 1 Kaon
1145 // CC DIS
1147 // CC RES
1149 // CC COH
1151 // CC Diffractive
1153 // CC Electron EL
1155 // CC Inverse Muon Decay
1157 // CC Atmospheric Neutrino Gamma
1159 // CC MEC (aka 2p2h)
1161 // CC Coherent Elastic
1163 // CC Inverse Beta Decay
1165 // CC GlashowRES
1167 // CC IMD Annihilation
1169
1170 // NCQE
1172 // NC DIS
1174 // NC RES
1176 // NC COH
1178 // CC Diffractive
1180 // NC Electron EL
1182 // NC Inverse Muon Decay
1184 // NC Atmospheric Neutrino Gamma
1186 // NC MEC (aka 2p2h)
1188 // NC Coherent Elastic
1190 // NC Inverse Beta Decay
1192 // NC GlashowRES
1194 // NC IMD Annihilation
1196
1197 // Keep a counter of the number of MaCh3 modes we have
1199
1201
1202inline int MaCh3Mode_to_SplineMode(int iMode){
1203 //No grouping of modes in MaCh3
1204 return iMode;
1205}
1206
1207#endif
void TotalEScaleInvSqrtFD(const double *par, double *erec, double erecHad, double erecLep, double invSqrtErecHad, double invSqrtErecLep, bool NotCCnumu)
void TotalEScaleFD(const double *par, double *erec, double erecHad, double erecLep, bool NotCCnumu)
void MuEScaleFD(const double *par, double *erec, double erecLep, bool CCnumu)
void TotalEScaleInvSqrtND(const double *par, double *erec, double erecHad, double erecLep, double invSqrtErecHad, double invSqrtErecLep, bool NotCCnumu)
void EMEScaleSqrtND(const double *par, double *erec, double eRecoPi0, double erecLep, double sqrtErecLep, double sqrteRecoPi0, bool CCnue)
SIMB_Mode
@ kDiffractive
@ kGlashowResonance
@ kCoh
@ kIMDAnnihilation
@ kInverseBetaDecay
@ kSIMB_nModes
@ kElectronScattering
@ kWeakMix
@ kAMNuGamma
@ kMEC
@ kRes
@ kUnknownInteraction
@ kDIS
@ kEM
@ kQE
@ kCohElastic
void MuEScaleSqrtND(const double *par, double *erec, double erecLep, double sqrtErecLep, bool CCnumu)
void EMResND(const double *par, double *erec, double eRecoPi0, double ePi0, double erecLep, double LepE, bool CCnue)
void NEScaleND(const double *par, double *erec, double eRecoN)
void EMEScaleSqrtFD(const double *par, double *erec, double eRecoPi0, double erecLep, double sqrtErecLep, double sqrteRecoPi0, bool CCnue)
void NEScaleFD(const double *par, double *erec, double eRecoN)
MaCh3_Spline_Modes
@ kMaCh3_Spline_NCQE
@ kMaCh3_Spline_nModes
@ kMaCh3_Spline_CC_IMDAnnihalation
@ kMaCh3_Spline_CC_COH
@ kMaCh3_Spline_CC_RES
@ kMaCh3_Spline_CC_IMD
@ kMaCh3_Spline_CC_DIS
@ kMaCh3_Spline_NC_IBD
@ kMaCh3_Spline_NC_AMnuGamma
@ kMaCh3_Spline_NC_MEC
@ kMaCh3_Spline_CC_Diffractive
@ kMaCh3_Spline_NC_DIS
@ kMaCh3_Spline_NC_RES
@ kMaCh3_Spline_NC_GlashowRES
@ kMaCh3_Spline_NC_IMD
@ kMaCh3_Spline_CC_IBD
@ kMaCh3_Spline_NC_Nue_EL
@ kMaCh3_Spline_CC_Nue_EL
@ kMaCh3_Spline_CC_GlashowRES
@ kMaCh3_Spline_CC_AMnuGamma
@ kMaCh3_Spline_CC_Single_Kaon
@ kMaCh3_Spline_NC_Diffractive
@ kMaCh3_Spline_CC_MEC
@ kMaCh3_Spline_NC_IMDAnnihalation
@ kMaCh3_Spline_NC_COH
@ kMaCh3_Spline_CCQE
@ kMaCh3_Spline_NC_COHEL
@ kMaCh3_Spline_CC_COHEL
std::string MaCh3mode_ToDUNEString(MaCh3_Mode i)
void MuResFD(const double *par, double *erec, double erecLep, double LepE, bool CCnumu)
int GENIEMode_ToMaCh3Mode(int GENIE_mode, int isCC)
int MaCh3Mode_to_SplineMode(int iMode)
void HadEScaleSqrtFD(const double *par, double *erec, double sumEhad, double sqrtSumEhad)
void NEScaleSqrtND(const double *par, double *erec, double eRecoN, double sqrteRecoN)
void EMEScaleND(const double *par, double *erec, double eRecoPi0, double erecLep, bool CCnue)
void TotalEScaleND(const double *par, double *erec, double erecHad, double erecLep, bool NotCCnumu)
void MuEScaleInvSqrtFD(const double *par, double *erec, double erecLep, double invSqrtErecLep, bool CCnumu)
void NEScaleInvSqrtFD(const double *par, double *erec, double eRecoN, double invSqrteRecoN)
void MuEScaleSqrtFD(const double *par, double *erec, double erecLep, double sqrtErecLep, bool CCnumu)
void HadEScaleND(const double *par, double *erec, double sumEhad)
void NResND(const double *par, double *erec, double eRecoN, double eN)
void CVNNumuFD(const double *par, double *cvnnumu)
void NEScaleSqrtFD(const double *par, double *erec, double eRecoN, double sqrteRecoN)
void HadResFD(const double *par, double *erec, double eRecoP, double eRecoPip, double eRecoPim, double eP, double ePip, double ePim)
void HadResND(const double *par, double *erec, double eRecoP, double eRecoPip, double eRecoPim, double eP, double ePip, double ePim)
void TotalEScaleSqrtND(const double *par, double *erec, double erecHad, double erecLep, double sqrtErecHad, double sqrtErecLep, bool NotCCnumu)
void EMEScaleFD(const double *par, double *erec, double eRecoPi0, double erecLep, bool CCnue)
void EMEScaleInvSqrtFD(const double *par, double *erec, double eRecoPi0, double erecLep, double invSqrtErecLep, double invSqrteRecoPi0, bool CCnue)
void HadEScaleFD(const double *par, double *erec, double sumEhad)
void CVNNueFD(const double *par, double *cvnnue)
void EMEScaleInvSqrtND(const double *par, double *erec, double eRecoPi0, double erecLep, double invSqrtErecLep, double invSqrteRecoPi0, bool CCnue)
void HadEScaleSqrtND(const double *par, double *erec, double sumEhad, double sqrtSumEhad)
void NResFD(const double *par, double *erec, double eRecoN, double eN)
void HadEScaleInvSqrtND(const double *par, double *erec, double sumEhad, double invSqrtSumEhad)
void EMResFD(const double *par, double *erec, double eRecoPi0, double ePi0, double erecLep, double LepE, bool CCnue)
void HadEScaleInvSqrtFD(const double *par, double *erec, double sumEhad, double invSqrtSumEhad)
void TotalEScaleSqrtFD(const double *par, double *erec, double erecHad, double erecLep, double sqrtErecHad, double sqrtErecLep, bool NotCCnumu)
MaCh3_Mode
@ kMaCh3_CC_Nue_EL
@ kMaCh3_CCQE
@ kMaCh3_NC_GlashowRES
@ kMaCh3_CC_GlashowRES
@ kMaCh3_CC_IMD
@ kMaCh3_NC_COHEL
@ kMaCh3_CC_IBD
@ kMaCh3_CC_Diffractive
@ kMaCh3_NCQE
@ kMaCh3_NC_Diffractive
@ kMaCh3_CC_IMDAnnihalation
@ kMaCh3_CC_DIS
@ kMaCh3_NC_AMnuGamma
@ kMaCh3_NC_IBD
@ kMaCh3_CC_AMnuGamma
@ kMaCh3_nModes
@ kMaCh3_NC_MEC
@ kMaCh3_CC_MEC
@ kMaCh3_NC_IMDAnnihalation
@ kMaCh3_CC_RES
@ kMaCh3_NC_Nue_EL
@ kMaCh3_CC_COHEL
@ kMaCh3_CC_COH
@ kMaCh3_NC_IMD
@ kMaCh3_NC_DIS
@ kMaCh3_NC_RES
@ kMaCh3_NC_COH
@ kMaCh3_CC_Single_Kaon
void MuResND(const double *par, double *erec, double erecLep, double LepE, bool CCnumu)
void MuEScaleND(const double *par, double *erec, double erecLep, bool CCnumu)
int SIMBMode_ToMaCh3Mode(int SIMB_mode, int isCC)
void MuEScaleInvSqrtND(const double *par, double *erec, double erecLep, double invSqrtErecLep, bool CCnumu)
void NEScaleInvSqrtND(const double *par, double *erec, double eRecoN, double invSqrteRecoN)
GENIE_Mode
@ gDIS
@ gMEC
@ gDiffractive
@ gGlashowResonance
@ gElectronScattering
@ gCohElastic
@ gUnknownInteraction
@ gSingleKaon
@ gIMD
@ gAMNuGamma
@ gCoh
@ gRes
@ gGENIE_nModes
@ gIMDAnnihilation
@ gQE
@ gInverseBetaDecay
double * rw_eRecoP
Definition StructsDUNE.h:22
double * rw_erec_had
Definition StructsDUNE.h:19
double * rw_eRecoPim
Definition StructsDUNE.h:24
int * nupdgUnosc
Definition StructsDUNE.h:15
double * rw_cvnnue_shifted
Definition StructsDUNE.h:43
int * rw_reco_numu
Definition StructsDUNE.h:45
double * rw_erec_lep
Definition StructsDUNE.h:20
double * rw_vtx_x
Definition StructsDUNE.h:52
double * rw_vtx_y
Definition StructsDUNE.h:53
double * reco_numu
Definition StructsDUNE.h:57
double * rw_cvnnumu_shifted
Definition StructsDUNE.h:42
double * rw_reco_rad
Definition StructsDUNE.h:86
int * rw_reco_nue
Definition StructsDUNE.h:44
double * mode
Definition StructsDUNE.h:65
double * rw_berpaacvwgt
Definition StructsDUNE.h:46
int * npip
number of (post-FSI) primary pi+
Definition StructsDUNE.h:72
double * rw_yrec
Definition StructsDUNE.h:21
double * rw_erec_shifted
Definition StructsDUNE.h:18
double * rw_ePip
Definition StructsDUNE.h:30
int * ntruemuon
Definition StructsDUNE.h:76
double pot_s
Definition StructsDUNE.h:59
double * nmuonsratio
Definition StructsDUNE.h:79
double * rw_reco_vtx_z
Definition StructsDUNE.h:85
int * nrecoparticles
Definition StructsDUNE.h:92
double * rw_erec
Definition StructsDUNE.h:17
int * rw_isCC
Definition StructsDUNE.h:47
double * rw_eP
Definition StructsDUNE.h:29
int * ntruemuonprim
Definition StructsDUNE.h:77
double * rw_ePim
Definition StructsDUNE.h:31
double dummy_y
Definition StructsDUNE.h:55
double * flux_w
Definition StructsDUNE.h:63
double * rw_eRecoN
Definition StructsDUNE.h:26
double * rw_eN
Definition StructsDUNE.h:33
int * npim
number of (post-FSI) primary pi-
Definition StructsDUNE.h:73
double * rw_cvnnumu
Definition StructsDUNE.h:40
double * rw_etru
Definition StructsDUNE.h:35
bool * rw_isFHC
Definition StructsDUNE.h:51
int * rw_nuPDGunosc
Definition StructsDUNE.h:48
double * rw_theta
Definition StructsDUNE.h:37
double * rw_truecz
Definition StructsDUNE.h:68
double * rw_eRecoPi0
Definition StructsDUNE.h:25
int * npi0
number of (post-FSI) primary pi0
Definition StructsDUNE.h:74
double * rw_elep_reco
Definition StructsDUNE.h:89
double * rw_Q2
Definition StructsDUNE.h:38
double * rw_cvnnue
Definition StructsDUNE.h:41
double * rw_reco_vtx_y
Definition StructsDUNE.h:84
int * isbound
Definition StructsDUNE.h:66
int * nrecomuon
Definition StructsDUNE.h:78
double norm_s
Definition StructsDUNE.h:60
double * rw_reco_vtx_x
Definition StructsDUNE.h:83
int * nproton
number of (post-FSI) primary protons
Definition StructsDUNE.h:70
double * rw_mom
Definition StructsDUNE.h:36
double * rw_lep_pT
Definition StructsDUNE.h:81
double * rw_lep_pZ
Definition StructsDUNE.h:82
double * rw_eRecoPip
Definition StructsDUNE.h:23
double * rw_LepE
Definition StructsDUNE.h:28
double * rw_vtx_z
Definition StructsDUNE.h:54
int * nneutron
number of (post-FSI) primary neutrons
Definition StructsDUNE.h:71
double * rw_elep_true
Definition StructsDUNE.h:90
double * rw_reco_q
Definition StructsDUNE.h:56
int * rw_nuPDG
Definition StructsDUNE.h:49
double * beam_w
Definition StructsDUNE.h:62
double * rw_rad
Definition StructsDUNE.h:87
double * rw_ePi0
Definition StructsDUNE.h:32
bool * in_fdv
Definition StructsDUNE.h:93