16 #include "TLorentzVector.h" 20 #include "Conventions/Units.h" 21 #include "EVGCore/EventRecord.h" 22 #include "GHEP/GHepUtils.h" 24 #include "ReWeight/GReWeightI.h" 25 #include "ReWeight/GSystSet.h" 26 #include "ReWeight/GSyst.h" 27 #include "ReWeight/GReWeight.h" 28 #include "ReWeight/GReWeightNuXSecNCEL.h" 29 #include "ReWeight/GReWeightNuXSecCCQE.h" 30 #include "ReWeight/GReWeightNuXSecCCRES.h" 31 #include "ReWeight/GReWeightNuXSecCOH.h" 32 #include "ReWeight/GReWeightNonResonanceBkg.h" 33 #include "ReWeight/GReWeightFGM.h" 34 #include "ReWeight/GReWeightDISNuclMod.h" 35 #include "ReWeight/GReWeightResonanceDecay.h" 36 #include "ReWeight/GReWeightFZone.h" 37 #include "ReWeight/GReWeightINuke.h" 38 #include "ReWeight/GReWeightAGKY.h" 39 #include "ReWeight/GReWeightNuXSecCCQEvec.h" 40 #include "ReWeight/GReWeightNuXSecNCRES.h" 41 #include "ReWeight/GReWeightNuXSecDIS.h" 42 #include "ReWeight/GReWeightNuXSecNC.h" 43 #include "ReWeight/GSystUncertainty.h" 44 #include "ReWeight/GReWeightUtils.h" 46 #include "Geo/ROOTGeomAnalyzer.h" 47 #include "Geo/GeomVolSelectorFiducial.h" 48 #include "Geo/GeomVolSelectorRockBox.h" 49 #include "Utils/StringUtils.h" 50 #include "Utils/XmlParserUtils.h" 51 #include "Interaction/InitialState.h" 52 #include "Interaction/Interaction.h" 53 #include "Interaction/Kinematics.h" 54 #include "Interaction/KPhaseSpace.h" 55 #include "Interaction/ProcessInfo.h" 56 #include "Interaction/XclsTag.h" 57 #include "GHEP/GHepParticle.h" 58 #include "PDG/PDGCodeList.h" 59 #include "Conventions/Constants.h" 81 genie::EventRecord evr = this->
RetrieveGHEP(truth, gtruth);
88 genie::EventRecord newEvent;
89 newEvent.SetWeight(gtruth.
fweight);
91 newEvent.SetXSec(gtruth.
fXsec);
92 #ifndef SETDIFFXSEC_1ARG 97 genie::KinePhaseSpace_t space = genie::kPSNull;
98 newEvent.SetDiffXSec(gtruth.
fDiffXsec,space);
102 TLorentzVector vtx = gtruth.
fVertex;
103 newEvent.SetVertex(vtx);
109 genie::GHepStatus_t gmst = (genie::GHepStatus_t)mcpart.
StatusCode();
110 int gmmo = mcpart.
Mother();
117 if(ndaughters == 1) {
120 else if(ndaughters >1) {
121 fdtrkid = mcpart.
Daughter(ndaughters-1);
130 if(temp.
TrackId() == fdtrkid) {
133 if(temp.
TrackId() == ldtrkid) {
138 double gmpx = mcpart.
Px(0);
139 double gmpy = mcpart.
Py(0);
140 double gmpz = mcpart.
Pz(0);
141 double gme = mcpart.
E(0);
142 double gmvx = mcpart.
Gvx();
143 double gmvy = mcpart.
Gvy();
144 double gmvz = mcpart.
Gvz();
145 double gmvt = mcpart.
Gvt();
148 genie::GHepParticle gpart(gmid, gmst, gmmo, -1, gmfd, gmld, gmpx, gmpy, gmpz, gme, gmvx, gmvy, gmvz, gmvt);
149 gpart.SetRescatterCode(gmri);
151 if(polz.x() !=0 || polz.y() !=0 || polz.z() !=0) {
152 gpart.SetPolarization(polz);
154 newEvent.AddParticle(gpart);
158 genie::ProcessInfo proc_info;
159 genie::ScatteringType_t gscty = (genie::ScatteringType_t)gtruth.
fGscatter;
160 genie::InteractionType_t ginty = (genie::InteractionType_t)gtruth.
fGint;
162 proc_info.Set(gscty,ginty);
167 genie::Resonance_t gres = (genie::Resonance_t)gtruth.
fResNum;
168 gxt.SetResonance(gres);
180 genie::Kinematics gkin;
181 gkin.Setx(gtruth.
fgX,
true);
182 gkin.Sety(gtruth.
fgY,
true);
183 gkin.Sett(gtruth.
fgT,
true);
184 gkin.SetW(gtruth.
fgW,
true);
185 gkin.SetQ2(gtruth.
fgQ2,
true);
186 gkin.Setq2(gtruth.
fgq2,
true);
189 gkin.SetFSLeptonP4(lep.
Px(), lep.
Py(), lep.
Pz(), lep.
E());
193 genie::Interaction * p_gint =
new genie::Interaction;
194 genie::InitialState * p_ginstate = p_gint->InitStatePtr();
197 int targetNucleon = nu.
HitNuc();
200 p_ginstate->SetProbePdg(incoming);
202 genie::Target* target123 = p_ginstate->TgtPtr();
204 target123->SetId(gtruth.
ftgtPDG);
213 target123->SetHitNucPdg(targetNucleon);
214 target123->SetHitQrkPdg(struckQuark);
217 if(newEvent.HitNucleonPosition()> 0) {
218 genie::GHepParticle * hitnucleon = newEvent.HitNucleon();
219 std::unique_ptr<TLorentzVector> p4hitnucleon(hitnucleon->GetP4());
220 target123->SetHitNucP4(*p4hitnucleon);
223 TLorentzVector dummy(0.,0.,0.,0.);
224 target123->SetHitNucP4(dummy);
227 genie::GHepParticle * probe = newEvent.Probe();
228 std::unique_ptr<TLorentzVector> p4probe(probe->GetP4());
229 p_ginstate->SetProbeP4(*p4probe);
230 if(newEvent.TargetNucleusPosition()> 0) {
231 genie::GHepParticle *
target = newEvent.TargetNucleus();
232 std::unique_ptr<TLorentzVector> p4target(target->GetP4());
233 p_ginstate->SetTgtP4(*p4target);
235 TLorentzVector dummy(0.,0.,0.,0.);
236 p_ginstate->SetTgtP4(dummy);
238 p_gint->SetProcInfo(proc_info);
239 p_gint->SetKine(gkin);
240 p_gint->SetExclTag(gxt);
241 newEvent.AttachSummary(p_gint);
double E(const int i=0) const
int fGint
interaction code
const TVector3 & Polarization() const
const simb::MCNeutrino & GetNeutrino() const
double Py(const int i=0) const
cout<< "-> Edep in the target
double Px(const int i=0) const
int fNumNeutron
number of neutrons after reaction, before FSI
double CalculateWeight(const genie::EventRecord &evr) const
double fXsec
cross section of interaction
int fNumPiPlus
number of pi pluses after reaction, before FSI
int fNumPiMinus
number of pi minuses after reaction, before FSI
int NumberDaughters() const
int Daughter(const int i) const
int fResNum
resonance number
int fNumProton
number of protons after reaction, before FSI
double fprobability
interaction probability
const simb::MCParticle & Lepton() const
int fGscatter
neutrino scattering code
int fNumPi0
number of pi0 after reaction, before FSI
bool fIsCharm
did the interaction produce a charmed hadron?
double fweight
event interaction weight (genie internal)
const simb::MCParticle & GetParticle(int i) const
int ftgtPDG
PDG of Target Nucleus, nucleon only if free.
double fgQ2
< these are for the internal (on shell) genie kinematics
TLorentzVector fFShadSystP4
double Pz(const int i=0) const
genie::EventRecord RetrieveGHEP(const simb::MCTruth &truth, const simb::GTruth >ruth) const
Event generator information.
Event generator information.
double CalcWeight(const simb::MCTruth &truth, const simb::GTruth >ruth) const
double fDiffXsec
differential cross section of interaction
Wrapper for reweightings neutrino interactions within the ART framework.