29#include "Framework/Conventions/GBuild.h"
51using std::ostringstream;
87 LOG(
"Intranuke2025",
pINFO) <<
"No nuclear target found - INTRANUKE exits";
129 TVector3 vtx(999999.,999999.,999999.);
134 double x=999999., y=999999.,
epsilon = 0.001;
136 double rp2 = TMath::Power(x,2.) + TMath::Power(y,2.);
141 rp2 = TMath::Power(x,2.) + TMath::Power(y,2.);
143 vtx.SetXYZ(x,y, -1.*TMath::Sqrt(TMath::Max(0.,R2-rp2)) +
epsilon);
146 TVector3 direction = evrec->
Probe()->
P4()->Vect().Unit();
149 vtx.RotateUz(direction);
152 <<
"Generated vtx @ R = " << vtx.Mag() <<
" fm / "
155 TObjArrayIter piter(evrec);
247 <<
"Propagating hadrons within nucleus found in position = " << inucl;
251 <<
"No nucleus found in position = " << inucl;
261 <<
"Nucleus (A,Z) = (" <<
fRemnA <<
", " <<
fRemnZ <<
")";
263 const TLorentzVector & p4nucl = *(nucl->
P4());
267 TObjArrayIter piter(evrec);
279 <<
" >> Stepping a " << p->
Name()
280 <<
" with kinetic E = " << p->
KinE() <<
" GeV";
293 <<
"... Current version can't rescatter a " << sp->
Name();
302 bool has_interacted =
false;
311 if(has_interacted)
break;
314 if(has_interacted &&
fRemnA>0) {
317 <<
"Particle has interacted at location: "
320 }
else if(has_interacted &&
fRemnA<=0) {
323 <<
"*** Nothing left to interact with, escaping.";
330 <<
"*** Hadron escaped the nucleus! Done with it.";
344 TLorentzVector v4(0.,0.,0.,0.);
384 LOG(
"Intranuke2025",
pDEBUG) <<
"mode= " << fINukeModeGen;
387 double d = -1.*L * TMath::Log(rnd->
RndFsi().Rndm());
#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)
STDHEP-like event record entry that can fit a particle or a nucleus.
string Name(void) const
Name that corresponds to the PDG code.
int FirstMother(void) const
void SetPosition(const TLorentzVector &v4)
void SetRescatterCode(int code)
void SetFirstMother(int m)
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
GHepStatus_t Status(void) const
GENIE's GHEP MC event record.
virtual GHepParticle * Probe(void) const
virtual GHepParticle * TargetNucleus(void) const
GEvGenMode_t EventGenerationMode(void) const
virtual void AddParticle(const GHepParticle &p)
virtual int TargetNucleusPosition(void) const
virtual int RemnantNucleusPosition(void) const
virtual GHepParticle * Particle(int position) const
virtual void Configure(const Registry &config)
double fChPionMFPScale
tweaking factors for tuning
double fDelRPion
factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement
bool NeedsRescattering(const GHepParticle *p) const
virtual string GetINukeMode() const
double GenerateStep(GHepRecord *ev, GHepParticle *p) const
int fRemnA
remnant nucleus A
virtual string GetGenINukeMode() const
int fRemnZ
remnant nucleus Z
double fHadStep
step size for intranuclear hadron transport
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...
GEvGenMode_t fGMode
event generation mode (lepton+A, hadron+A, ...)
virtual void SimulateHadronicFinalState(GHepRecord *ev, GHepParticle *p) const =0
bool fUseOset
Oset model for low energy pion in hN.
bool CanRescatter(const GHepParticle *p) const
bool fAltOset
NuWro's table-based implementation (not recommended)
double fTrackingRadius
tracking radius for the nucleus in the current event
double fNeutralPionMFPScale
TLorentzVector fRemnP4
P4 of remnant system.
void GenerateVertex(GHepRecord *ev) const
bool fXsecNNCorr
use nuclear medium correction for NN cross section
bool IsInNucleus(const GHepParticle *p) const
void TransportHadrons(GHepRecord *ev) const
double fDelRNucleon
factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement
virtual void ProcessEventRecord(GHepRecord *event_rec) const
void SetTrackingRadius(const GHepParticle *p) const
double fR0
effective nuclear size param
virtual void LoadConfig(void)=0
A singleton holding random number generator classes. All random number generation in GENIE should tak...
static RandomGen * Instance()
Access instance.
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
A registry. Provides the container for algorithm configuration parameters.
Misc GENIE control constants.
bool IsPseudoParticle(int pdgc)
Simple functions for loading and reading nucleus dependent keys from config files.
double MeanFreePath(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A, double Z, double nRpi=0.5, double nRnuc=1.0, const bool useOset=false, const bool altOset=false, const bool xsecNNCorr=false, string INukeMode="XX2025")
Mean free path (pions, nucleons)
void StepParticle(GHepParticle *p, double step, double nuclear_radius=-1.)
Step particle.
string Vec3AsString(const TVector3 *vec)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE
@ kIStFinalStateNuclearRemnant
const int kPdgHadronicBlob