35 #include <TLorentzVector.h> 52 using namespace genie;
59 #ifdef _G_REWEIGHT_INUKE_DEBUG_NTP_ 60 fTestFile =
new TFile(
"./intranuke_reweight_test.root",
"recreate");
61 fTestNtp =
new TNtuple(
"testntp",
"",
"pdg:E:mfp_twk_dial:d:d_mfp:fate:interact:w_mfp:w_fate");
67 #ifdef _G_REWEIGHT_INUKE_DEBUG_NTP_ 127 if (!tgt)
return 1.0;
130 if (A<=1)
return 1.0;
131 if (Z<=1)
return 1.0;
133 double event_weight = 1.0;
139 TIter event_iter(&event);
140 while ( (p = dynamic_cast<GHepParticle *>(event_iter.Next())) ) {
147 if(!is_pion && !is_nucleon)
162 <<
"Attempting to reweight hadron at position = " << ip
163 <<
" with PDG code = " << pdgc
164 <<
" and FSI code = " << fsi_code
167 LOG(
"ReW",
pFATAL) <<
"INTRANUKE didn't set a valid rescattering code for event in position: " << ip;
168 LOG(
"ReW",
pFATAL) <<
"Here is the problematic event:";
173 bool interacted = !escaped;
176 TLorentzVector x4 (p->
Vx(), p->
Vy(), p->
Vz(), 0. );
177 TLorentzVector p4 (p->
Px(), p->
Py(), p->
Pz(), p->
E());
188 double mfp_scale_factor = 1.;
196 if(calc_w_fate && interacted)
198 double fate_fraction_scale_factor =
201 w_fate = fate_fraction_scale_factor;
205 double hadron_weight = w_mfp * w_fate;
208 <<
"Reweighted hadron at position = " << ip
209 <<
" with PDG code = " << pdgc
210 <<
", FSI code = " << fsi_code
212 <<
" w_mfp = " << w_mfp
213 <<
", w_fate = " << w_fate;
216 #ifdef _G_REWEIGHT_INUKE_DEBUG_NTP_ 220 double iflag = (interacted) ? 1 : 0;
221 fTestNtp->Fill(pdgc, Eh, mfp_scale_factor, d, d_mfp, fsi_code, iflag, w_mfp, w_fate);
225 event_weight *= hadron_weight;
enum genie::EINukeFateHA_t INukeFateHA_t
int RescatterCode(void) const
tweak inelastic probability for pions, for given total rescattering probability
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?
#include "Numerical/GSFunc.h"
double E(void) const
Get energy.
MFP * MeanFreePathParams(int pdgc) const
bool IsTweaked(GSyst_t s) const
is included & tweaked to non-def value?
tweak elastic probability for pions, for given total rescattering probability
enum genie::EGHepStatus GHepStatus_t
tweak charge exchange probability for nucleons, for given total rescattering probability ...
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
double CalcWeight(const EventRecord &event)
calculate a weight for the input event using the current nuisance param values
double Dist2ExitMFP(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A, double Z, double NR=3, double R0=1.4)
Distance to exit.
tweak pion production probability for pions, for given total rescattering probability ...
double Pz(void) const
Get Pz.
GHepStatus_t Status(void) const
double Px(void) const
Get Px.
tweak inelastic probability for nucleons, for given total rescattering probability ...
tweak absorption probability for nucleons, for given total rescattering probability ...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void Reset(void)
set all nuisance parameters to default values
tweak absorption probability for pions, for given total rescattering probability
void SetTwkDial(GSyst_t s, double val)
void SetSystematic(GSyst_t syst, double val)
update the value for the specified nuisance param
An enumeration of systematic parameters.
tweak elastic probability for nucleons, for given total rescattering probability
double MeanFreePathWeight(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A, double Z, double mfp_scale_factor, bool interacted, double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4)
GReWeightINukeParams fINukeRwParams
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
tweak mean free path for nucleons
tweak mean free path for pions
double Dist2Exit(const TLorentzVector &x4, const TLorentzVector &p4, double A, double NR=3, double R0=1.4)
Distance to exit.
double Vz(void) const
Get production z.
static string AsString(INukeFateHN_t fate)
double ScaleFactor(void) const
mean free path scale factor = 1 + twk_dial * fractional_err
tweak pion production probability for nucleons, for given total rescattering probability ...
double ScaleFactor(GSyst_t s, const TLorentzVector &p4) const
see next
bool IsTweaked(void) const
double Vy(void) const
Get production y.
tweak charge exchange probability for pions, for given total rescattering probability ...
STDHEP-like event record entry that can fit a particle or a nucleus.
static GSyst_t INukeFate2GSyst(INukeFateHA_t fate, int pdgc)
Event finding and building.
double Vx(void) const
Get production x.
GENIE event reweighting engine ABC.
Fates * FateParams(int pdgc) const
double Py(void) const
Get Py.