50 #include "Conventions/GBuild.h" 74 using std::ostringstream;
76 using namespace genie;
107 <<
"************ Running hN2014 MODE INTRANUKE ************";
111 "Experimental code (INTRANUKE/hN model) - Run at your own risk");
115 LOG(
"HNIntranuke2014",
pINFO) <<
"Done with this event";
124 LOG(
"HNIntranuke2014",
pERROR) <<
"** Null input!";
134 if(!(is_pion || is_baryon || is_gamma))
136 LOG(
"HNIntranuke2014",
pERROR) <<
"** Cannot handle particle: " << p->
Name();
149 LOG(
"HNIntranuke2014",
pERROR) <<
"** Couldn't select a fate";
152 LOG(
"HNIntranuke2014",
pERROR) <<
"** Particle: " <<
"\n" << (*p);
171 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 173 <<
"Invoking InelasticHN() for a : " << p->
Name()
194 <<
"retry call to SimulateHadronicFinalState ";
211 <<
"Selecting hN fate for " << p->
Name() <<
" with KE = " << ke <<
" MeV";
214 unsigned int iter = 0;
232 if(pdgc==
kPdgPi0) frac_abs*= 0.665;
241 double tf = frac_cex +
246 double r = tf * rnd->
RndFsi().Rndm();
247 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 248 LOG(
"HNIntranuke2014",
pDEBUG) <<
"r = " << r <<
" (max = " << tf <<
")";
253 if(r < (cf += frac_cex ))
return kIHNFtCEx;
256 if(r < (cf += frac_abs ))
return kIHNFtAbs;
259 <<
"No selection after going through all fates! " 260 <<
"Total fraction = " << tf <<
" (r = " << r <<
")";
280 double tf = frac_elas + frac_inel + frac_cmp;
282 double r = tf * rnd->
RndFsi().Rndm();
284 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 285 LOG(
"HNIntranuke2014",
pDEBUG) <<
"r = " << r <<
" (max = " << tf <<
")";
291 if(r < (cf += frac_cmp ))
return kIHNFtCmp;
294 <<
"No selection after going through all fates! " 295 <<
"Total fraction = " << tf <<
" (r = " << r <<
")";
319 if (np < 1 && nn < 1)
321 LOG(
"HNIntranuke2014",
pERROR) <<
"** Nothing left in nucleus!!! **";
328 if (fate ==
kIHNFtAbs) {
return ((nn>=1) && (np>=1)) ? 1. : 0.; }
342 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 344 <<
"AbsorbHN() is invoked for a : " << p->
Name()
369 int pcode, t1code, t2code, scode, s2code;
370 double M1, M2_1, M2_2, M3, M4;
371 double E1L, P1L, E2L, P2L, E3L, P3L, E4L, P4L;
376 double Theta1, Theta2, theta5;
378 double E1CM, E3CM, E4CM, P3CM;
379 double P3zL, P3tL, P4zL, P4tL;
381 TVector3 tP2_1L, tP2_2L, tP1L, tP2L, tPtot, P1zCM, P2zCM;
383 TVector3 bDir, tTrans, tbeta, tVect;
420 <<
"AbsorbHN() cannot handle probe: " << pdgc;
425 M1 = pLib->
Find(pcode) ->Mass();
426 M2_1 = pLib->
Find(t1code)->Mass();
427 M2_2 = pLib->
Find(t2code)->Mass();
428 M3 = pLib->
Find(scode) ->Mass();
429 M4 = pLib->
Find(s2code)->Mass();
434 target.SetHitNucPdg(t1code);
437 E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1);
439 target.SetHitNucPdg(t2code);
442 E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2);
446 tP2_1L.SetXYZ(0.0, 0.0, 0.0);
449 tP2_2L.SetXYZ(0.0, 0.0, 0.0);
464 S3CM = TMath::Sqrt(1.0 - C3CM*C3CM);
468 if(E1L<0.001) E1L=0.001;
469 P1L = TMath::Sqrt(E1L*E1L - M1*M1);
470 tP1L = p->
P4()->Vect();
471 tP2L = tP2_1L + tP2_2L;
477 Theta1 = tP1L.Angle(bDir);
478 Theta2 = tP2L.Angle(bDir);
481 P1zL = P1L*TMath::Cos(Theta1);
482 P2zL = P2L*TMath::Cos(Theta2);
484 if(TMath::Abs((tVect - bDir).Mag())<.01) tVect.SetXYZ(0,1,0);
485 theta5 = tVect.Angle(bDir);
486 tTrans = (tVect - TMath::Cos(theta5)*bDir).Unit();
489 tbeta = tPtot * (1.0 / (E1L + E2L));
491 gm = 1.0 / TMath::Sqrt(1.0 - beta*beta);
494 E1CM = gm*E1L - gm*beta*P1zL;
495 P1zCM = gm*P1zL*bDir - gm*tbeta*E1L;
496 E2CM = gm*E2L - gm*beta*P2zL;
497 P2zCM = gm*P2zL*bDir - gm*tbeta*E2L;
499 E3CM = (Et*Et + (M3*M3) - (M4*M4)) / (2.0*Et);
501 P3CM = TMath::Sqrt(E3CM*E3CM - M3*M3);
504 P3zL = gm*beta*E3CM + gm*P3CM*C3CM;
506 P4zL = gm*beta*E4CM + gm*P3CM*(-C3CM);
509 P3L = TMath::Sqrt(P3zL*P3zL + P3tL*P3tL);
510 P4L = TMath::Sqrt(P4zL*P4zL + P4tL*P4tL);
514 if(!(TMath::Finite(P3L))||P3L<.001)
517 <<
"Particle 3 " << M3 <<
" momentum small or non-finite: " << P3L
518 <<
"\n" <<
"--> Assigning .001 as new momentum";
522 E3L = TMath::Sqrt(P3L*P3L + M3*M3);
525 if(!(TMath::Finite(P4L))||P4L<.001)
528 <<
"Particle 4 " << M4 <<
" momentum small or non-finite: " << P4L
529 <<
"\n" <<
"--> Assigning .001 as new momentum";
533 E4L = TMath::Sqrt(P4L*P4L + M4*M4);
539 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 540 LOG(
"HNIntranuke2014",
pINFO) <<
"AbsorbHN failed: Pauli blocking";
553 fRemnP4 -= TLorentzVector(tP2_1L,E2_1L);
554 fRemnP4 -= TLorentzVector(tP2_2L,E2_2L);
559 tP3L = P3zL*bDir + P3tL*tTrans;
560 tP4L = P4zL*bDir + P4tL*tTrans;
562 tP3L.Rotate(PHI3,bDir);
563 tP4L.Rotate(PHI3,bDir);
565 E3L = TMath::Sqrt(P3L*P3L + M3*M3);
566 E4L = TMath::Sqrt(P4L*P4L + M4*M4);
574 TLorentzVector t4P4L(tP4L,E4L);
580 TLorentzVector t4P3L(tP3L,E3L);
585 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 587 <<
"|p3| = " << (P3L) <<
", E3 = " << (E3L);
589 <<
"|p4| = " << (P4L) <<
", E4 = " << (E4L);
603 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 605 <<
"ElasHN() is invoked for a : " << p->
Name()
620 int pcode = p->
Pdg();
621 int tcode, scode, s2code;
659 double Mt = t->
Mass();
668 target.SetHitNucPdg(tcode);
671 double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt);
682 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 684 <<
"|p3| = " << P3L <<
", E3 = " << E3L;
686 <<
"|p4| = " << P4L <<
", E4 = " << E4L;
702 LOG(
"HNIntranuke2014",
pINFO) <<
"Elastic in hN failed calling TwoBodyCollision";
704 exception.
SetReason(
"hN scattering kinematics through TwoBodyCollision failed");
721 if (
utils::intranuke2014::PionProduction(ev,p,s1,s2,s3,
fRemnA,
fRemnZ,
fRemnP4,
fDoFermi,
fFermiFac,
fFermiMomentum,
fNuclmodel))
740 LOG(
"HNIntranuke2014",
pNOTICE) <<
"Error: could not create pion production final state";
742 exception.
SetReason(
"PionProduction in hN failed");
757 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 759 <<
"GammaInelasticHN() is invoked for a : " << p->
Name()
775 int pcode = p->
Pdg();
781 <<
"Particle code: " << pcode <<
", target: " << tcode;
799 <<
"Error: could not determine particle final states";
807 <<
" final state: " << scode <<
" and " << s2code;
809 <<
" scattering angle: " << C3CM;
813 double Mt = t->
Mass();
821 target.SetHitNucPdg(tcode);
824 double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt);
835 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 837 <<
"|p3| = " << P3L <<
", E3 = " << E3L;
839 <<
"|p4| = " << P4L <<
", E4 = " << E4L;
866 double rpreeq = rnd->
RndFsi().Rndm();
883 <<
"*** Nothing left to interact with, escaping.";
934 LOG(
"HNIntranuke2014",
pWARN) <<
"R0 = " <<
fR0 <<
" fermi";
946 LOG(
"HNIntranuke2014",
pWARN) <<
"DoFermi? = " << ((
fDoFermi)?(
true):(
false));
static string AsString(INukeMode_t mode)
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
bool HandleCompoundNucleusHN(GHepRecord *ev, GHepParticle *p) const
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
void SimulateHadronicFinalState(GHepRecord *ev, GHepParticle *p) const
#include "Numerical/GSFunc.h"
AlgFactory * fAlgf
algorithm factory instance
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...
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.
double E(void) const
Get energy.
static RandomGen * Instance()
Access instance.
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
double fEPreEq
threshold for pre-equilibrium reaction
double fR0
effective nuclear size param
int fRemnZ
remnant nucleus Z
bool IsInNucleus(const GHepParticle *p) const
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
INukeHadroData2014 * fHadroData2014
a collection of h+N,h+A data & calculations
void SetMomentum(const TLorentzVector &p4)
double Mass(void) const
Mass that corresponds to the PDG code.
RgDbl GetDouble(RgKey key) const
double fFermiMomentum
whether or not particle collision is pauli blocked
A singleton holding random number generator classes. All random number generation in GENIE should tak...
virtual void ProcessEventRecord(GHepRecord *event_rec) const
int LastMother(void) const
int FirstMother(void) const
string Name(void) const
Name that corresponds to the PDG code.
int fRemnA
remnant nucleus A
void InelasticHN(GHepRecord *ev, GHepParticle *p) const
double fDelRPion
factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement ...
double fFreeStep
produced particle free stem, in fm
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double FateWeight(int pdgc, INukeFateHN_t fate) const
void PreEquilibrium(GHepRecord *ev, GHepParticle *p, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, bool DoFermi, double FermiFac, const NuclearModelI *Nuclmodel, double NucRmvE, EINukeMode mode=kIMdHN)
void SetReason(string reason)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
double Frac(int hpdgc, INukeFateHN_t fate, double ke, int targA=0, int targZ=0) const
const Algorithm * GetAlgorithm(const AlgId &algid)
virtual GHepParticle * TargetNucleus(void) const
void ProcessEventRecord(GHepRecord *event_rec) 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)
Misc GENIE control constants.
enum genie::EINukeFateHN_t INukeFateHN_t
Registry * GlobalParameterList(void) const
double fFermiFac
testing parameter to modify fermi momentum
double fNucCEXFac
charge exchange xsec correction factor (hN Mode)
double fNucRmvE
binding energy to subtract from cascade nucleons
bool fDoCompoundNucleus
whether or not to do compound nucleus considerations
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
static PDGLibrary * Instance(void)
void GammaInelasticHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
static AlgFactory * Instance()
void SetLastMother(int m)
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.
void AbsorbHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
bool IsNeutronOrProton(int pdgc)
TParticlePDG * Find(int pdgc)
RgBool GetBool(RgKey key) const
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)
int HandleCompoundNucleus(GHepRecord *ev, GHepParticle *p, int mom) const
double fDelRNucleon
factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement ...
static const unsigned int kRjMaxIterations
void ElasHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
TLorentzVector * P4(void) 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.
RgBool GetBoolDef(RgKey key, RgBool def_opt, bool set_def=true)
double fNucAbsFac
absorption xsec correction factor (hN Mode)
double fHadStep
step size for intranuclear hadron transport
INukeFateHN_t HadronFateHN(const GHepParticle *p) const
TLorentzVector fRemnP4
P4 of remnant system.
Root of GENIE utility namespaces.
cet::coded_exception< error, detail::translate > exception
static AlgConfigPool * Instance()
static INukeHadroData2014 * Instance(void)
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
bool fDoFermi
whether or not to do fermi mom.