17 #include <TLorentzVector.h>
32 using namespace genie;
33 using namespace genie::constants;
59 <<
"No nuclear target found - Not subtracting any binding energy";
65 TIter stdhep_iter(evrec);
74 bool handle = is_nucleon && in_fin_state && had_bind_e;
79 LOG(
"Nuclear",
pINFO) <<
"Binding energy = " << bindE;
83 <<
"Subtracting the binding energy from the escaped nucleon";
89 LOG(
"Nuclear",
pINFO) <<
"Kinetic energy before subtraction = " << KE;
92 LOG(
"Nuclear",
pINFO) <<
"Kinetic energy after subtraction = " << KE;
97 double pmag_old = p->
P4()->P();
99 double scale = pmag_new / pmag_old;
101 <<
"|pnew| = " << pmag_new <<
", |pold| = " << pmag_old
102 <<
", scale = " << scale;
104 double pxn = scale * p->
Px();
105 double pyn = scale * p->
Py();
106 double pzn = scale * p->
Pz();
108 double pxb = (1-scale) * p->
Px();
109 double pyb = (1-scale) * p->
Py();
110 double pzb = (1-scale) * p->
Pz();
121 <<
"Adding a [BindingE] to account for nuclear binding energy";
124 -1,-1,-1,-1, pxb,pyb,pzb,bindE, 0,0,0,0);
127 <<
"Nucleon is above the Fermi sea but can't escape the nucleus";
129 <<
"Recombining remnant nucleus + f/s nucleon";
152 double pxnuc = rnucl->
Px() + p->
Px();
153 double pynuc = rnucl->
Py() + p->
Py();
154 double pznuc = rnucl->
Pz() + p->
Pz();
155 double Enuc = rnucl->
E() + p->
E();
158 rnucpos,-1,-1,-1, pxnuc,pynuc,pznuc,Enuc, 0,0,0,0);
165 if (hblob ==
nullptr)
return;
169 double pxhblob = hblob->
Px() + p->
Px();
170 double pyhblob = hblob->
Py() + p->
Py();
171 double pzhblob = hblob->
Pz() + p->
Pz();
172 double Ehblob = hblob->
E() + p->
E();
173 hblob->
SetMomentum(pxhblob, pyhblob, pzhblob, Ehblob);
virtual GHepParticle * Particle(int position) const
double E(void) const
Get energy.
virtual GHepParticle * FindParticle(int pdg, GHepStatus_t ist, int start) const
const TLorentzVector * P4(void) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
const int kPdgHadronicBlob
virtual int RemnantNucleusPosition(void) const
void SetMomentum(const TLorentzVector &p4)
double RemovalEnergy(void) const
Get removal energy.
double Mass(void) const
Mass that corresponds to the PDG code.
double Pz(void) const
Get Pz.
GHepStatus_t Status(void) const
double Energy(void) const
Get energy.
double Px(void) const
Get Px.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double A
virtual void Configure(const Registry &config)
void Configure(const Registry &config)
virtual GHepParticle * TargetNucleus(void) const
NucBindEnergyAggregator()
void SetRemovalEnergy(double Erm)
~NucBindEnergyAggregator()
A registry. Provides the container for algorithm configuration parameters.
bool IsNeutronOrProton(int pdgc)
int IonPdgCode(int A, int Z)
virtual void AddParticle(const GHepParticle &p)
double NonNegative(double x)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
GENIE's GHEP MC event record.
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
void ProcessEventRecord(GHepRecord *event_rec) const
double Py(void) const
Get Py.