LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
NuReweight.cxx
Go to the documentation of this file.
1 
8 // C/C++ includes
9 #include <math.h>
10 #include <map>
11 #include <fstream>
12 #include <memory>
13 
14 //ROOT includes
15 #include "TVector3.h"
16 #include "TLorentzVector.h"
17 #include "TSystem.h"
18 
19 //GENIE includes
20 #ifdef GENIE_PRE_R3
21  #include "Conventions/Units.h"
22  #include "EVGCore/EventRecord.h"
23  #include "GHEP/GHepUtils.h"
24 
25 #include "ReWeight/GReWeightI.h"
26 #include "ReWeight/GSystSet.h"
27 #include "ReWeight/GSyst.h"
28 #include "ReWeight/GReWeight.h"
29 #include "ReWeight/GReWeightNuXSecNCEL.h"
30 #include "ReWeight/GReWeightNuXSecCCQE.h"
31 #include "ReWeight/GReWeightNuXSecCCRES.h"
32 #include "ReWeight/GReWeightNuXSecCOH.h"
33 #include "ReWeight/GReWeightNonResonanceBkg.h"
34 #include "ReWeight/GReWeightFGM.h"
35 #include "ReWeight/GReWeightDISNuclMod.h"
36 #include "ReWeight/GReWeightResonanceDecay.h"
37 #include "ReWeight/GReWeightFZone.h"
38 #include "ReWeight/GReWeightINuke.h"
39 #include "ReWeight/GReWeightAGKY.h"
40 #include "ReWeight/GReWeightNuXSecCCQEvec.h"
41 #include "ReWeight/GReWeightNuXSecNCRES.h"
42 #include "ReWeight/GReWeightNuXSecDIS.h"
43 #include "ReWeight/GReWeightNuXSecNC.h"
44 #include "ReWeight/GSystUncertainty.h"
45 #include "ReWeight/GReWeightUtils.h"
46 
47  #include "Interaction/InitialState.h"
48  #include "Interaction/Interaction.h"
49  #include "Interaction/Kinematics.h"
50  #include "Interaction/KPhaseSpace.h"
51  #include "Interaction/ProcessInfo.h"
52  #include "Interaction/XclsTag.h"
53  #include "GHEP/GHepParticle.h"
54  #include "PDG/PDGCodeList.h"
55  #include "Conventions/Constants.h" //for calculating event kinematics
56 
57 #else
58  // GENIE includes R-3 and beyond
59  #include "GENIE/Framework/Messenger/Messenger.h"
60  #include "GENIE/Framework/Conventions/Units.h"
61  #include "GENIE/Framework/Conventions/Constants.h"
62  #include "GENIE/Framework/GHEP/GHepUtils.h"
63  #include "GENIE/Framework/EventGen/EventRecord.h"
64 
65  #include "GENIE/Framework/GHEP/GHepParticle.h"
66 
67  #include "RwFramework/GReWeightI.h"
68  #include "RwFramework/GSystSet.h"
69  #include "RwFramework/GSyst.h"
70  #include "RwFramework/GReWeight.h"
71  #include "RwFramework/GSystUncertainty.h"
72  #include "RwCalculators/GReWeightNuXSecNCEL.h"
73  #include "RwCalculators/GReWeightNuXSecCCQE.h"
74  #include "RwCalculators/GReWeightNuXSecCCRES.h"
75  #include "RwCalculators/GReWeightNuXSecCOH.h"
76  #include "RwCalculators/GReWeightNonResonanceBkg.h"
77  #include "RwCalculators/GReWeightFGM.h"
78  #include "RwCalculators/GReWeightDISNuclMod.h"
79  #include "RwCalculators/GReWeightResonanceDecay.h"
80  #include "RwCalculators/GReWeightFZone.h"
81  #include "RwCalculators/GReWeightINuke.h"
82  #include "RwCalculators/GReWeightAGKY.h"
83  #include "RwCalculators/GReWeightNuXSecCCQEvec.h"
84  #include "RwCalculators/GReWeightNuXSecNCRES.h"
85  #include "RwCalculators/GReWeightNuXSecDIS.h"
86  #include "RwCalculators/GReWeightNuXSecNC.h"
87  #include "RwCalculators/GReWeightUtils.h"
88 
89 #endif
90 
92 
93 // NuGen includes
99 
100 namespace rwgt {
101 
104  //mf::LogVerbatim("GENIEReweight") << "Create GENIEReweight object";
105  }
106 
109  // Don't delete fWcalc here. The GENIEReweight parent class handles it.
110  }
111 
112  double NuReweight::CalcWeight(const simb::MCTruth & truth, const simb::GTruth & gtruth) const {
113 
114  genie::EventRecord* evr = evgb::RetrieveGHEP(truth, gtruth);
115 
116  double wgt = this->CalculateWeight(*evr);
117 
118  delete evr;
119  //mf::LogVerbatim("GENIEReweight") << "New Event Weight is: " << wgt;
120  return wgt;
121  }
122 
123 
124 }
genie::EventRecord * RetrieveGHEP(const simb::MCTruth &truth, const simb::GTruth &gtruth, bool useFirstTrajPosition=true)
return genie::EventRecord pointer; callee takes possession
Definition: GENIE2ART.cxx:540
double CalculateWeight(const genie::EventRecord &evr) const
Functions for transforming GENIE objects into ART objects (and back)
Particle class.
NuReweight()
<constructor
Definition: NuReweight.cxx:103
Event generator information.
Definition: MCTruth.h:32
double CalcWeight(const simb::MCTruth &truth, const simb::GTruth &gtruth) const
Definition: NuReweight.cxx:112
Wrapper for reweightings neutrino interactions within the ART framework.