17#include <TLorentzVector.h>
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);
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
virtual void Configure(const Registry &config)
bool GetParamDef(const RgKey &name, T &p, const T &def) const
STDHEP-like event record entry that can fit a particle or a nucleus.
void SetMomentum(const TLorentzVector &p4)
void SetRemovalEnergy(double Erm)
const TLorentzVector * P4(void) const
double Mass(void) const
Mass that corresponds to the PDG code.
double RemovalEnergy(void) const
Get removal energy.
double Px(void) const
Get Px.
double E(void) const
Get energy.
double Pz(void) const
Get Pz.
double Py(void) const
Get Py.
double Energy(void) const
Get energy.
GHepStatus_t Status(void) const
GENIE's GHEP MC event record.
virtual GHepParticle * FindParticle(int pdg, GHepStatus_t ist, int start) const
virtual GHepParticle * TargetNucleus(void) const
virtual void AddParticle(const GHepParticle &p)
virtual int RemnantNucleusPosition(void) const
virtual GHepParticle * Particle(int position) const
void Configure(const Registry &config)
NucBindEnergyAggregator()
~NucBindEnergyAggregator()
void ProcessEventRecord(GHepRecord *event_rec) const
A registry. Provides the container for algorithm configuration parameters.
int IonPdgCode(int A, int Z)
bool IsNeutronOrProton(int pdgc)
double NonNegative(double x)
THE MAIN GENIE PROJECT NAMESPACE
@ kIStFinalStateNuclearRemnant
const int kPdgHadronicBlob