743 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 745 <<
"Inelastic() is invoked for a : " << p->
Name()
749 bool allow_dup =
true;
760 ev,p,&s1,&s2,&s3,
fRemnA,
fRemnZ,
fRemnP4,
fDoFermi,
fFermiFac,
fFermiMomentum,
fNuclmodel);
763 LOG (
"HAIntranuke2015",
pINFO) <<
" successful pion production fate";
778 LOG(
"HAIntranuke2015",
pNOTICE) <<
"Error: could not create pion production final state";
780 exception.
SetReason(
"PionProduction kinematics failed - retry kinematics");
798 LOG(
"HAIntranuke2015",
pNOTICE) <<
"stop propagation - could not create absorption final state: too few particles";
805 LOG(
"HAIntranuke2015",
pNOTICE) <<
"stop propagation - could not create absorption final state: Pi- or K- cannot be absorbed by only neutrons";
812 LOG(
"HAIntranuke2015",
pINFO) <<
"stop propagation - could not create absorption final state: Pi+ or K+ cannot be absorbed by only protons";
826 int t1code,t2code,scode,s2code;
832 double Prob_pipd_pp=2.*ppcnt*(1.-ppcnt);
833 double Prob_pipnn_pn=.083*(1.-ppcnt)*(1.-ppcnt);
834 if (rnd->
RndFsi().Rndm()*(Prob_pipd_pp+Prob_pipnn_pn)<Prob_pipd_pp){
842 double Prob_pimd_nn=2.*ppcnt*(1.-ppcnt);
843 double Prob_pimpp_pn=.083*ppcnt*ppcnt;
844 if (rnd->
RndFsi().Rndm()*(Prob_pimd_nn+Prob_pimpp_pn)<Prob_pimd_nn){
852 double Prob_pi0d_pn=0.88*ppcnt*(1.-ppcnt);
853 double Prob_pi0pp_pp=.14*ppcnt*ppcnt;
854 double Prob_pi0nn_nn=.14*(1.-ppcnt)*(1.-ppcnt);
855 if (rnd->
RndFsi().Rndm()*(Prob_pi0d_pn+Prob_pi0pp_pp+Prob_pi0nn_nn)<Prob_pi0d_pn){
858 else if (rnd->
RndFsi().Rndm()*(Prob_pi0d_pn+Prob_pi0pp_pp+Prob_pi0nn_nn)<(Prob_pi0d_pn+Prob_pi0pp_pp)){
865 LOG(
"HAIntranuke2015",
pINFO) <<
"choose 2 body absorption, probe, fs = " << pdgc <<
" "<< scode <<
" "<<s2code;
868 double M2_1 = pLib->
Find(t1code)->Mass();
869 double M2_2 = pLib->
Find(t2code)->Mass();
871 double M3 = pLib->
Find(scode) ->Mass();
872 double M4 = pLib->
Find(s2code)->Mass();
876 TVector3 tP2_1L, tP2_2L;
881 target.SetHitNucPdg(t1code);
884 E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1);
886 target.SetHitNucPdg(t2code);
889 E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2);
895 tP2_1L.SetXYZ(0.0, 0.0, 0.0);
898 tP2_2L.SetXYZ(0.0, 0.0, 0.0);
901 TLorentzVector dNucl_P4=TLorentzVector(tP2_1L+tP2_2L,E2_1L+E2_2L);
903 double E2L = E2_1L + E2_2L;
910 LOG(
"HAIntranuke2015",
pWARN) <<
"Inelastic() failed: IntBounce returned bad angle - try again";
912 exception.
SetReason(
"unphysical angle for hN scattering");
917 TLorentzVector t4P1L,t4P2L,t4P3L,t4P4L;
919 t4P2L=TLorentzVector(TVector3(tP2_1L+tP2_2L),E2L);
958 LOG(
"HAIntranuke2015",
pNOTICE) <<
"Inelastic in hA failed calling TwoBodyKineamtics";
960 exception.
SetReason(
"Pion absorption kinematics through TwoBodyKinematics failed");
984 nd0 = -135.227 * TMath::Exp(-7.124*
fRemnZ /
double(
fRemnA)) + 4.914;
986 Sig_nd = 2.034 +
fRemnA * 0.007846;
988 double c1 = 0.041 + ke * 0.0001525;
989 double c2 = -0.003444 - ke * 0.00002324;
992 double c3 = 0.064 - ke * 0.000015;
993 gam_ns = c1 * TMath::Exp(c2*
fRemnA) + c3;
994 if(gam_ns<0.002) gam_ns = 0.002;
996 LOG(
"HAIntranuke2015",
pINFO) <<
"nucleon absorption";
997 LOG(
"HAIntranuke2015",
pINFO) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
999 LOG(
"HAIntranuke2015",
pINFO) <<
"--> gam_ns = " << gam_ns;
1003 ns0 = .0001*(1.+ke/250.) * (
fRemnA-10)*(
fRemnA-10) + 3.5;
1004 nd0 = (1.+ke/250.) - ((
fRemnA/200.)*(1. + 2.*ke/250.));
1005 Sig_ns = (10. + 4. * ke/250.)*TMath::Power(
fRemnA/250.,0.9);
1006 Sig_nd = 4*(1 - TMath::Exp(-0.03*ke));
1007 LOG(
"HAIntranuke2015",
pINFO) <<
"pion absorption";
1008 LOG(
"HAIntranuke2015",
pINFO) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
1009 LOG(
"HAIntranuke2015",
pINFO) <<
"--> mean sum distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1013 ns0 = (rnd->
RndFsi().Rndm()>0.5?3:2);
1017 LOG(
"HAIntranuke2015",
pINFO) <<
"kaon absorption - set ns, nd later";
1023 LOG(
"HAIntranuke2015",
pWARN) <<
"Inelastic() cannot handle absorption reaction for " << p->
Name();
1033 double u1 = 0, u2 = 0;
1039 LOG(
"HAIntranuke2015",
pNOTICE) <<
"Error: could not choose absorption final state";
1040 LOG(
"HAIntranuke2015",
pNOTICE) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
1041 LOG(
"HAIntranuke2015",
pNOTICE) <<
"--> mean sum distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1042 LOG(
"HAIntranuke2015",
pNOTICE) <<
"--> gam_ns = " << gam_ns;
1045 exception.
SetReason(
"Absorption choice of # of p,n failed");
1054 u1 = rnd->
RndFsi().Rndm();
1055 u2 = rnd->
RndFsi().Rndm();
1056 if (u1==0) u1 = rnd->
RndFsi().Rndm();
1057 if (u2==0) u2 = rnd->
RndFsi().Rndm();
1060 double x2 = TMath::Sqrt(-2*TMath::Log(u1))*TMath::Sin(2*
kPi*u2);
1066 ns = -TMath::Log(rnd->
RndFsi().Rndm())/gam_ns;
1070 ns = (rnd->
RndFsi().Rndm()<0.5?2:3);
1081 double max = ns0 + Sig_ns * 10;
1084 bool not_found =
true;
1092 LOG(
"HAIntranuke2015",
pNOTICE) <<
"Error: stuck in random variable loop for ns";
1093 LOG(
"HAIntranuke2015",
pNOTICE) <<
"--> mean of sum parent distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1097 exception.
SetReason(
"Random number generator for choice of #p,n final state failed - unusual - redo kinematics");
1102 u1 = rnd->
RndFsi().Rndm();
1103 u2 = rnd->
RndFsi().Rndm();
1104 if (u1==0) u1 = rnd->
RndFsi().Rndm();
1105 if (u2==0) u2 = rnd->
RndFsi().Rndm();
1106 x1 = TMath::Sqrt(-2*TMath::Log(u1))*TMath::Cos(2*
kPi*u2);
1108 ns = ns0 + Sig_ns * x1;
1109 if ( ns>max || ns<0 ) {iter2++;
continue;}
1110 else if ( rnd->
RndFsi().Rndm() > (ns/
max) ) {iter2++;
continue;}
1118 double nd = nd0 + Sig_nd * x2;
1123 np =
int((ns+nd)/2.+.5);
1124 nn =
int((ns-nd)/2.+.5);
1126 LOG(
"HAIntranuke2015",
pINFO) <<
"ns = "<<ns<<
", nd = "<<nd<<
", np = "<<np<<
", nn = "<<nn;
1132 if (np < 0 || nn < 0 ) {iter++;
continue;}
1133 else if (np + nn < 2. ) {iter++;
continue;}
1136 - ((pdgc==
kPdgPiM || pdgc==
kPdgKM)?1:0)) {iter++;
continue;}
1141 LOG(
"HAIntranuke2015",
pINFO) <<
"success, iter = " << iter <<
" np, nn = " << np <<
" " << nn;
1144 double frac = 85./double(np+nn);
1152 if (rnd->
RndFsi().Rndm()<np/(double)(np+nn)) np--;
1156 LOG(
"HAIntranuke2015",
pNOTICE) <<
"Final state chosen; # protons : " 1157 << np <<
", # neutrons : " << nn;
1185 PDGCodeList* listar[5] = {&list0, &list1, &list2, &list3, &list4};
1190 double probM = pLib->
Find(pdgc) ->Mass();
1191 TVector3 pP3 = p->
P4()->Vect() * (1./5.);
1192 double probKE = p->
P4()->E() -probM;
1193 double clusKE = probKE * (1./5.);
1194 TLorentzVector clusP4(pP3,clusKE);
1196 TLorentzVector X4(*p->
X4());
1211 for (
int i=0;
i<(np+nn);
i++)
1221 for (
int i=0;
i<5;
i++)
1223 LOG(
"HAIntranuke2015",
pINFO) <<
"List" <<
i <<
" size: " << listar[
i]->size();
1224 if (listar[
i]->size() <2)
1227 exception.
SetReason(
"too few particles for Phase Space decay - try again");
1267 if(success1 && success2 && success3 && success4 && success5)
1269 LOG(
"HAIntranuke2015",
pINFO)<<
"Successful many-body absorption - n>=18";
1271 TParticlePDG * remn = 0;
1272 double MassRem = 0.;
1278 <<
"NO Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1279 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1283 MassRem = remn->Mass();
1285 <<
"Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1286 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1290 double MRemn = TMath::Sqrt(ERemn*ERemn - PRemn*PRemn);
1291 LOG(
"HAIntranuke2015",
pINFO) <<
"PRemn = " << PRemn <<
" ;ERemn= " << ERemn;
1292 LOG(
"HAIntranuke2015",
pINFO) <<
"MRemn= " << MRemn <<
" ;true Mass= " << MassRem <<
" ; excitation energy= " << (MRemn-MassRem)*1000. <<
" MeV";
1298 LOG(
"HAIntranuke2015",
pWARN) <<
"PhaseSpace decay fails for HadrCluster- recovery likely incorrect - rethrow event";
1304 if ( pdgc==
kPdgPiM ) fRemnZ++;
1324 for (
int i=0;
i<np;
i++)
1330 for (
int i=0;
i<nn;
i++)
1366 <<
"Remnant nucleus (A,Z) = (" <<
fRemnA <<
", " << fRemnZ <<
")";
1367 LOG(
"HAIntranuke2015",
pINFO) <<
" list size: " << np+nn;
1371 exception.
SetReason(
"too few particles for Phase Space decay - try again");
1379 LOG (
"HAIntranuke2015",
pINFO) <<
"Successful many-body absorption, n<=18";
1380 LOG(
"HAIntranuke2015",
pDEBUG) <<
"Nucleus : (A,Z) = ("<<
fRemnA<<
','<<fRemnZ<<
')';
1381 TParticlePDG * remn = 0;
1382 double MassRem = 0.;
1388 <<
"NO Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1389 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1393 MassRem = remn->Mass();
1395 <<
"Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1396 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1400 double MRemn = TMath::Sqrt(ERemn*ERemn - PRemn*PRemn);
1401 LOG(
"HAIntranuke2015",
pINFO) <<
"PRemn = " << PRemn <<
" ;ERemn= " << ERemn;
1402 LOG(
"HAIntranuke2015",
pINFO) <<
"MRemn= " << MRemn <<
" ;true Mass= " << MassRem <<
" ; excitation energy= " << (MRemn-MassRem)*1000. <<
" MeV";
1411 if ( pdgc==
kPdgPiM ) fRemnZ++;
1414 exception.
SetReason(
"Phase space generation of absorption final state failed");
An exception thrown by SimulateHadronState for kinematics problems. TwoBodyCollision/Kinematics used ...
void SetFirstMother(int m)
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
static RandomGen * Instance()
Access instance.
double fNucRmvE
binding energy to subtract from cascade nucleons
enum genie::EGHepStatus GHepStatus_t
bool TwoBodyKinematics(double M3, double M4, TLorentzVector tP1L, TLorentzVector tP2L, TLorentzVector &tP3L, TLorentzVector &tP4L, double C3CM, TLorentzVector &RemnP4, double bindE=0)
void SetMomentum(const TLorentzVector &p4)
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...
bool PhaseSpaceDecay(GHepRecord *ev, GHepParticle *p, const PDGCodeList &pdgv, TLorentzVector &RemnP4, double NucRmvE, EINukeMode mode=kIMdHA)
general phase space decay method
int LastMother(void) const
int FirstMother(void) const
string Name(void) const
Name that corresponds to the PDG code.
INukeHadroData2015 * fHadroData2015
a collection of h+N,h+A data & calculations
const int kPdgCompNuclCluster
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
void SetReason(string reason)
bool fDoFermi
whether or not to do fermi mom.
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
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)
double fFermiFac
testing parameter to modify fermi momentum
virtual GHepParticle * TargetNucleus(void) const
enum genie::EINukeFateHN_t INukeFateHN_t
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
static PDGLibrary * Instance(void)
void SetLastMother(int m)
Singleton class to load & serve a TDatabasePDG.
TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
virtual TVector3 Momentum3(void) const
static string AsString(INukeFateHN_t fate)
bool IsNeutronOrProton(int pdgc)
TParticlePDG * Find(int pdgc)
int IonPdgCode(int A, int Z)
int fRemnZ
remnant nucleus Z
TLorentzVector fRemnP4
P4 of remnant system.
virtual bool GenerateNucleon(const Target &) const =0
virtual void AddParticle(const GHepParticle &p)
TLorentzVector * P4(void) const
int fRemnA
remnant nucleus A
STDHEP-like event record entry that can fit a particle or a nucleus.
cet::coded_exception< error, detail::translate > exception
void push_back(int pdg_code)