46 #include "Conventions/GBuild.h" 70 using std::ostringstream;
72 using namespace genie;
103 <<
"************ Running HN MODE INTRANUKE ************";
107 "Experimental code (INTRANUKE/hN model) - Run at your own risk");
111 LOG(
"HNIntranuke",
pINFO) <<
"Done with this event";
120 LOG(
"HNIntranuke",
pERROR) <<
"** Null input!";
130 if(!(is_pion || is_baryon || is_gamma))
132 LOG(
"HNIntranuke",
pERROR) <<
"** Cannot handle particle: " << p->
Name();
145 LOG(
"HNIntranuke",
pERROR) <<
"** Couldn't select a fate";
148 LOG(
"HNIntranuke",
pERROR) <<
"** Particle: " <<
"\n" << (*p);
167 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 169 <<
"Invoking InelasticHN() for a : " << p->
Name()
187 <<
"retry call to SimulateHadronicFinalState ";
204 <<
"Selecting hN fate for " << p->
Name() <<
" with KE = " << ke <<
" MeV";
207 unsigned int iter = 0;
225 if(pdgc==
kPdgPi0) frac_abs*= 0.665;
234 double tf = frac_cex +
239 double r = tf * rnd->
RndFsi().Rndm();
240 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 241 LOG(
"HNIntranuke",
pDEBUG) <<
"r = " << r <<
" (max = " << tf <<
")";
246 if(r < (cf += frac_cex ))
return kIHNFtCEx;
249 if(r < (cf += frac_abs ))
return kIHNFtAbs;
252 <<
"No selection after going through all fates! " 253 <<
"Total fraction = " << tf <<
" (r = " << r <<
")";
271 double tf = frac_elas +
274 double r = tf * rnd->
RndFsi().Rndm();
276 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 277 LOG(
"HNIntranuke",
pDEBUG) <<
"r = " << r <<
" (max = " << tf <<
")";
285 <<
"No selection after going through all fates! " 286 <<
"Total fraction = " << tf <<
" (r = " << r <<
")";
310 if (np < 1 && nn < 1)
312 LOG(
"HNIntranuke",
pERROR) <<
"** Nothing left in nucleus!!! **";
319 if (fate ==
kIHNFtAbs) {
return ((nn>=1) && (np>=1)) ? 1. : 0.; }
332 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 334 <<
"AbsorbHN() is invoked for a : " << p->
Name()
359 int pcode, t1code, t2code, scode, s2code;
360 double M1, M2_1, M2_2, M3, M4;
361 double E1L, P1L, E2L, P2L, E3L, P3L, E4L, P4L;
366 double Theta1, Theta2, theta5;
368 double E1CM, E3CM, E4CM, P3CM;
369 double P3zL, P3tL, P4zL, P4tL;
371 TVector3 tP2_1L, tP2_2L, tP1L, tP2L, tPtot, P1zCM, P2zCM;
373 TVector3 bDir, tTrans, tbeta, tVect;
410 <<
"AbsorbHN() cannot handle probe: " << pdgc;
415 M1 = pLib->
Find(pcode) ->Mass();
416 M2_1 = pLib->
Find(t1code)->Mass();
417 M2_2 = pLib->
Find(t2code)->Mass();
418 M3 = pLib->
Find(scode) ->Mass();
419 M4 = pLib->
Find(s2code)->Mass();
424 target.SetHitNucPdg(t1code);
427 E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1);
429 target.SetHitNucPdg(t2code);
432 E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2);
436 tP2_1L.SetXYZ(0.0, 0.0, 0.0);
439 tP2_2L.SetXYZ(0.0, 0.0, 0.0);
454 S3CM = TMath::Sqrt(1.0 - C3CM*C3CM);
458 if(E1L<0.001) E1L=0.001;
459 P1L = TMath::Sqrt(E1L*E1L - M1*M1);
460 tP1L = p->
P4()->Vect();
461 tP2L = tP2_1L + tP2_2L;
467 Theta1 = tP1L.Angle(bDir);
468 Theta2 = tP2L.Angle(bDir);
471 P1zL = P1L*TMath::Cos(Theta1);
472 P2zL = P2L*TMath::Cos(Theta2);
474 if(TMath::Abs((tVect - bDir).Mag())<.01) tVect.SetXYZ(0,1,0);
475 theta5 = tVect.Angle(bDir);
476 tTrans = (tVect - TMath::Cos(theta5)*bDir).Unit();
479 tbeta = tPtot * (1.0 / (E1L + E2L));
481 gm = 1.0 / TMath::Sqrt(1.0 - beta*beta);
484 E1CM = gm*E1L - gm*beta*P1zL;
485 P1zCM = gm*P1zL*bDir - gm*tbeta*E1L;
486 E2CM = gm*E2L - gm*beta*P2zL;
487 P2zCM = gm*P2zL*bDir - gm*tbeta*E2L;
489 E3CM = (Et*Et + (M3*M3) - (M4*M4)) / (2.0*Et);
491 P3CM = TMath::Sqrt(E3CM*E3CM - M3*M3);
494 P3zL = gm*beta*E3CM + gm*P3CM*C3CM;
496 P4zL = gm*beta*E4CM + gm*P3CM*(-C3CM);
499 P3L = TMath::Sqrt(P3zL*P3zL + P3tL*P3tL);
500 P4L = TMath::Sqrt(P4zL*P4zL + P4tL*P4tL);
504 if(!(TMath::Finite(P3L))||P3L<.001)
507 <<
"Particle 3 " << M3 <<
" momentum small or non-finite: " << P3L
508 <<
"\n" <<
"--> Assigning .001 as new momentum";
512 E3L = TMath::Sqrt(P3L*P3L + M3*M3);
515 if(!(TMath::Finite(P4L))||P4L<.001)
518 <<
"Particle 4 " << M4 <<
" momentum small or non-finite: " << P4L
519 <<
"\n" <<
"--> Assigning .001 as new momentum";
523 E4L = TMath::Sqrt(P4L*P4L + M4*M4);
529 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 530 LOG(
"HNIntranuke",
pINFO) <<
"AbsorbHN failed: Pauli blocking";
541 fRemnP4 -= TLorentzVector(tP2_1L,E2_1L);
542 fRemnP4 -= TLorentzVector(tP2_2L,E2_2L);
547 tP3L = P3zL*bDir + P3tL*tTrans;
548 tP4L = P4zL*bDir + P4tL*tTrans;
550 tP3L.Rotate(PHI3,bDir);
551 tP4L.Rotate(PHI3,bDir);
553 E3L = TMath::Sqrt(P3L*P3L + M3*M3);
554 E4L = TMath::Sqrt(P4L*P4L + M4*M4);
562 TLorentzVector t4P4L(tP4L,E4L);
568 TLorentzVector t4P3L(tP3L,E3L);
573 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 575 <<
"|p3| = " << (P3L) <<
", E3 = " << (E3L);
577 <<
"|p4| = " << (P4L) <<
", E4 = " << (E4L);
591 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 593 <<
"ElasHN() is invoked for a : " << p->
Name()
608 int pcode = p->
Pdg();
609 int tcode, scode, s2code;
647 double Mt = t->
Mass();
656 target.SetHitNucPdg(tcode);
659 double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt);
670 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 672 <<
"|p3| = " << P3L <<
", E3 = " << E3L;
674 <<
"|p4| = " << P4L <<
", E4 = " << E4L;
689 LOG(
"HNIntranuke",
pINFO) <<
"Elastic in hN failed calling TwoBodyCollision";
691 exception.
SetReason(
"hN scattering kinematics through TwoBodyCollision failed");
708 if (
utils::intranuke::PionProduction(ev,p,s1,s2,s3,
fRemnA,
fRemnZ,
fRemnP4,
fDoFermi,
fFermiFac,
fFermiMomentum,
fNuclmodel))
727 LOG(
"HNIntranuke",
pNOTICE) <<
"Error: could not create pion production final state";
729 exception.
SetReason(
"PionProduction in hN failed");
744 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 746 <<
"GammaInelasticHN() is invoked for a : " << p->
Name()
762 int pcode = p->
Pdg();
768 <<
"Particle code: " << pcode <<
", target: " << tcode;
786 <<
"Error: could not determine particle final states";
794 <<
" final state: " << scode <<
" and " << s2code;
796 <<
" scattering angle: " << C3CM;
800 double Mt = t->
Mass();
808 target.SetHitNucPdg(tcode);
811 double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt);
822 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 824 <<
"|p3| = " << P3L <<
", E3 = " << E3L;
826 <<
"|p4| = " << P4L <<
", E4 = " << E4L;
853 double rpreeq = rnd->
RndFsi().Rndm();
870 <<
"*** Nothing left to interact with, escaping.";
916 LOG(
"HNIntranuke",
pWARN) <<
"R0 = " <<
fR0 <<
" fermi";
double fFermiMomentum
whether or not particle collision is pauli blocked
static string AsString(INukeMode_t mode)
bool HandleCompoundNucleus(GHepRecord *ev, GHepParticle *p, int mom) const
RgDbl GetDoubleDef(RgKey key, RgDbl def_opt, bool set_def=true)
An exception thrown by SimulateHadronState for kinematics problems. TwoBodyCollision/Kinematics used ...
void SetFirstMother(int m)
virtual GHepParticle * Particle(int position) const
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
#include "Numerical/GSFunc.h"
INukeHadroData * fHadroData
a collection of h+N,h+A data & calculations
double E(void) const
Get energy.
TLorentzVector fRemnP4
P4 of remnant system.
static RandomGen * Instance()
Access instance.
void GammaInelasticHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
The INTRANUKE intranuclear hadron transport MC. Is a concrete implementation of the EventRecordVisito...
double fHadStep
step size for intranuclear hadron transport
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
double fFreeStep
produced particle free stem, in fm
void ElasHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
double fTrackingRadius
tracking radius for the nucleus in the current event
virtual void ProcessEventRecord(GHepRecord *event_rec) const
void SetMomentum(const TLorentzVector &p4)
void ProcessEventRecord(GHepRecord *event_rec) const
double Mass(void) const
Mass that corresponds to the PDG code.
RgDbl GetDouble(RgKey key) const
AlgFactory * fAlgf
algorithm factory instance
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double Frac(int hpdgc, INukeFateHA_t fate, double ke) const
int LastMother(void) const
double fDelRNucleon
factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement ...
int FirstMother(void) const
string Name(void) const
Name that corresponds to the PDG code.
double fDelRPion
factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement ...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void SimulateHadronicFinalState(GHepRecord *ev, GHepParticle *p) const
bool PionProduction(GHepRecord *ev, GHepParticle *p, GHepParticle *s1, GHepParticle *s2, GHepParticle *s3, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, bool DoFermi, double FermiFac, double FermiMomentum, const NuclearModelI *Nuclmodel)
void SetReason(string reason)
static INukeHadroData * Instance(void)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
const Algorithm * GetAlgorithm(const AlgId &algid)
bool fDoCompoundNucleus
whether or not to do compound nucleus considerations
double fR0
effective nuclear size param
virtual GHepParticle * TargetNucleus(void) const
double FateWeight(int pdgc, INukeFateHN_t fate) const
int fRemnA
remnant nucleus A
Misc GENIE control constants.
enum genie::EINukeFateHN_t INukeFateHN_t
Registry * GlobalParameterList(void) const
void AbsorbHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
double fNucRmvE
binding energy to subtract from cascade nucleons
void InelasticHN(GHepRecord *ev, GHepParticle *p) const
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
double fNucAbsFac
absorption xsec correction factor (hN Mode)
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
static PDGLibrary * Instance(void)
static AlgFactory * Instance()
void SetLastMother(int m)
double fEPreEq
threshold for pre-equilibrium reaction
void StepParticle(GHepParticle *p, double step, double nuclear_radius=-1.)
Step particle.
Singleton class to load & serve a TDatabasePDG.
void SetStatus(GHepStatus_t s)
virtual TVector3 Momentum3(void) const
static string AsString(INukeFateHN_t fate)
A registry. Provides the container for algorithm configuration parameters.
bool IsNeutronOrProton(int pdgc)
TParticlePDG * Find(int pdgc)
RgBool GetBool(RgKey key) const
double fNucCEXFac
charge exchange xsec correction factor (hN Mode)
int fRemnZ
remnant nucleus Z
bool fDoFermi
whether or not to do fermi mom.
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
virtual bool GenerateNucleon(const Target &) const =0
Registry * fConfig
config. (either owned or pointing to config pool)
virtual void AddParticle(const GHepParticle &p)
double fFermiFac
testing parameter to modify fermi momentum
static const unsigned int kRjMaxIterations
TLorentzVector * P4(void) const
INukeFateHN_t HadronFateHN(const GHepParticle *p) 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...
void PreEquilibrium(GHepRecord *ev, GHepParticle *p, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, bool DoFermi, double FermiFac, const NuclearModelI *Nuclmodel, double NucRmvE, EINukeMode mode=kIMdHN)
STDHEP-like event record entry that can fit a particle or a nucleus.
RgBool GetBoolDef(RgKey key, RgBool def_opt, bool set_def=true)
bool TwoBodyCollision(GHepRecord *ev, int pcode, int tcode, int scode, int s2code, double C3CM, GHepParticle *p, GHepParticle *t, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, EINukeMode mode=kIMdHA)
Intranuke utility functions.
bool IsInNucleus(const GHepParticle *p) const
Root of GENIE utility namespaces.
cet::coded_exception< error, detail::translate > exception
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
static AlgConfigPool * Instance()
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...