767 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 769 <<
"Inelastic() is invoked for a : " << p->
Name()
773 bool allow_dup =
true;
784 ev,p,&s1,&s2,&s3,
fRemnA,
fRemnZ,
fRemnP4,
fDoFermi,
fFermiFac,
fFermiMomentum,
fNuclmodel);
787 LOG (
"HAIntranuke2018",
pINFO) <<
" successful pion production fate";
802 LOG(
"HAIntranuke2018",
pNOTICE) <<
"Error: could not create pion production final state";
804 exception.
SetReason(
"PionProduction kinematics failed - retry kinematics");
822 LOG(
"HAIntranuke2018",
pNOTICE) <<
"stop propagation - could not create absorption final state: too few particles";
829 LOG(
"HAIntranuke2018",
pNOTICE) <<
"stop propagation - could not create absorption final state: Pi- or K- cannot be absorbed by only neutrons";
836 LOG(
"HAIntranuke2018",
pINFO) <<
"stop propagation - could not create absorption final state: Pi+ or K+ cannot be absorbed by only protons";
850 int t1code,t2code,scode,s2code;
856 double Prob_pipd_pp=2.*ppcnt*(1.-ppcnt);
857 double Prob_pipnn_pn=.083*(1.-ppcnt)*(1.-ppcnt);
858 if (rnd->
RndFsi().Rndm()*(Prob_pipd_pp+Prob_pipnn_pn)<Prob_pipd_pp){
866 double Prob_pimd_nn=2.*ppcnt*(1.-ppcnt);
867 double Prob_pimpp_pn=.083*ppcnt*ppcnt;
868 if (rnd->
RndFsi().Rndm()*(Prob_pimd_nn+Prob_pimpp_pn)<Prob_pimd_nn){
876 double Prob_pi0d_pn=0.88*ppcnt*(1.-ppcnt);
877 double Prob_pi0pp_pp=.14*ppcnt*ppcnt;
878 double Prob_pi0nn_nn=.14*(1.-ppcnt)*(1.-ppcnt);
879 if (rnd->
RndFsi().Rndm()*(Prob_pi0d_pn+Prob_pi0pp_pp+Prob_pi0nn_nn)<Prob_pi0d_pn){
882 else if (rnd->
RndFsi().Rndm()*(Prob_pi0d_pn+Prob_pi0pp_pp+Prob_pi0nn_nn)<(Prob_pi0d_pn+Prob_pi0pp_pp)){
889 LOG(
"HAIntranuke2018",
pINFO) <<
"choose 2 body absorption, probe, fs = " << pdgc <<
" "<< scode <<
" "<<s2code;
892 double M2_1 = pLib->
Find(t1code)->Mass();
893 double M2_2 = pLib->
Find(t2code)->Mass();
895 double M3 = pLib->
Find(scode) ->Mass();
896 double M4 = pLib->
Find(s2code)->Mass();
900 TVector3 tP2_1L, tP2_2L;
905 target.SetHitNucPdg(t1code);
909 E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1);
911 target.SetHitNucPdg(t2code);
914 E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2);
920 tP2_1L.SetXYZ(0.0, 0.0, 0.0);
923 tP2_2L.SetXYZ(0.0, 0.0, 0.0);
926 TLorentzVector dNucl_P4=TLorentzVector(tP2_1L+tP2_2L,E2_1L+E2_2L);
928 double E2L = E2_1L + E2_2L;
935 LOG(
"HAIntranuke2018",
pWARN) <<
"Inelastic() failed: IntBounce returned bad angle - try again";
937 exception.
SetReason(
"unphysical angle for hN scattering");
942 TLorentzVector t4P1L,t4P2L,t4P3L,t4P4L;
944 t4P2L=TLorentzVector(TVector3(tP2_1L+tP2_2L),E2L);
959 TParticlePDG * remn = 0;
966 <<
"NO Particle with [A = " <<
fRemnA <<
", Z = " <<
fRemnZ 967 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
971 MassRem = remn->Mass();
973 <<
"Particle with [A = " <<
fRemnA <<
", Z = " <<
fRemnZ 974 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
978 double MRemn = TMath::Sqrt(ERemn*ERemn - PRemn*PRemn);
979 LOG(
"HAIntranuke2018",
pINFO) <<
"PRemn = " << PRemn <<
" ;ERemn= " << ERemn;
980 LOG(
"HAIntranuke2018",
pINFO) <<
"expt MRemn= " << MRemn <<
" ;true Mass= " << MassRem <<
" ; excitation energy (>0 good)= " << (MRemn-MassRem)*1000. <<
" MeV";
992 t1->SetPdgCode(scode);
993 t1->SetMomentum(t4P3L);
1010 LOG(
"HAIntranuke2018",
pNOTICE) <<
"Inelastic in hA failed calling TwoBodyKineamtics";
1012 exception.
SetReason(
"Pion absorption kinematics through TwoBodyKinematics failed");
1036 nd0 = -135.227 * TMath::Exp(-7.124*
fRemnZ /
double(
fRemnA)) + 4.914;
1038 Sig_nd = 2.034 +
fRemnA * 0.007846;
1040 double c1 = 0.041 + ke * 0.0001525;
1041 double c2 = -0.003444 - ke * 0.00002324;
1044 double c3 = 0.064 - ke * 0.000015;
1045 gam_ns = c1 * TMath::Exp(c2*
fRemnA) + c3;
1046 if(gam_ns<0.002) gam_ns = 0.002;
1048 LOG(
"HAIntranuke2018",
pINFO) <<
"nucleon absorption";
1049 LOG(
"HAIntranuke2018",
pINFO) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
1051 LOG(
"HAIntranuke2018",
pINFO) <<
"--> gam_ns = " << gam_ns;
1055 ns0 = .0001*(1.+ke/250.) * (
fRemnA-10)*(
fRemnA-10) + 3.5;
1056 nd0 = (1.+ke/250.) - ((
fRemnA/200.)*(1. + 2.*ke/250.));
1057 Sig_ns = (10. + 4. * ke/250.)*TMath::Power(
fRemnA/250.,0.9);
1058 Sig_nd = 4*(1 - TMath::Exp(-0.03*ke));
1059 LOG(
"HAIntranuke2018",
pINFO) <<
"pion absorption";
1060 LOG(
"HAIntranuke2018",
pINFO) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
1061 LOG(
"HAIntranuke2018",
pINFO) <<
"--> mean sum distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1065 ns0 = (rnd->
RndFsi().Rndm()>0.5?3:2);
1069 LOG(
"HAIntranuke2018",
pINFO) <<
"kaon absorption - set ns, nd later";
1075 LOG(
"HAIntranuke2018",
pWARN) <<
"Inelastic() cannot handle absorption reaction for " << p->
Name();
1085 double u1 = 0, u2 = 0;
1091 LOG(
"HAIntranuke2018",
pNOTICE) <<
"Error: could not choose absorption final state";
1092 LOG(
"HAIntranuke2018",
pNOTICE) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
1093 LOG(
"HAIntranuke2018",
pNOTICE) <<
"--> mean sum distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1094 LOG(
"HAIntranuke2018",
pNOTICE) <<
"--> gam_ns = " << gam_ns;
1097 exception.
SetReason(
"Absorption choice of # of p,n failed");
1106 u1 = rnd->
RndFsi().Rndm();
1107 u2 = rnd->
RndFsi().Rndm();
1108 if (u1==0) u1 = rnd->
RndFsi().Rndm();
1109 if (u2==0) u2 = rnd->
RndFsi().Rndm();
1112 double x2 = TMath::Sqrt(-2*TMath::Log(u1))*TMath::Sin(2*
kPi*u2);
1118 ns = -TMath::Log(rnd->
RndFsi().Rndm())/gam_ns;
1122 ns = (rnd->
RndFsi().Rndm()<0.5?2:3);
1133 double max = ns0 + Sig_ns * 10;
1136 bool not_found =
true;
1144 LOG(
"HAIntranuke2018",
pNOTICE) <<
"Error: stuck in random variable loop for ns";
1145 LOG(
"HAIntranuke2018",
pNOTICE) <<
"--> mean of sum parent distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1149 exception.
SetReason(
"Random number generator for choice of #p,n final state failed - unusual - redo kinematics");
1154 u1 = rnd->
RndFsi().Rndm();
1155 u2 = rnd->
RndFsi().Rndm();
1156 if (u1==0) u1 = rnd->
RndFsi().Rndm();
1157 if (u2==0) u2 = rnd->
RndFsi().Rndm();
1158 x1 = TMath::Sqrt(-2*TMath::Log(u1))*TMath::Cos(2*
kPi*u2);
1160 ns = ns0 + Sig_ns *
x1;
1161 if ( ns>max || ns<0 ) {iter2++;
continue;}
1162 else if ( rnd->
RndFsi().Rndm() > (ns/
max) ) {iter2++;
continue;}
1170 double nd = nd0 + Sig_nd *
x2;
1175 np =
int((ns+nd)/2.+.5);
1176 nn =
int((ns-nd)/2.+.5);
1178 LOG(
"HAIntranuke2018",
pINFO) <<
"ns = "<<ns<<
", nd = "<<nd<<
", np = "<<np<<
", nn = "<<nn;
1184 if (np < 0 || nn < 0 ) {iter++;
continue;}
1185 else if (np + nn < 2. ) {iter++;
continue;}
1188 - ((pdgc==
kPdgPiM || pdgc==
kPdgKM)?1:0)) {iter++;
continue;}
1193 LOG(
"HAIntranuke2018",
pINFO) <<
"success, iter = " << iter <<
" np, nn = " << np <<
" " << nn;
1196 double frac = 85./double(np+nn);
1204 if (rnd->
RndFsi().Rndm()<np/(double)(np+nn)) np--;
1208 LOG(
"HAIntranuke2018",
pNOTICE) <<
"Final state chosen; # protons : " 1209 << np <<
", # neutrons : " << nn;
1237 PDGCodeList* listar[5] = {&list0, &list1, &list2, &list3, &list4};
1242 double probM = pLib->
Find(pdgc) ->Mass();
1244 TVector3 pP3 = p->
P4()->Vect() * (1./5.);
1245 double probKE = p->
P4()->E() -probM;
1246 double clusKE = probKE * (1./5.);
1247 TLorentzVector clusP4(pP3,clusKE);
1248 LOG(
"HAIntranuke2018",
pINFO) <<
"probM = " << probM <<
" ;clusKE= " << clusKE;
1249 TLorentzVector X4(*p->
X4());
1264 for (
int i=0;i<(np+nn);i++)
1274 for (
int i=0;i<5;i++)
1276 LOG(
"HAIntranuke2018",
pINFO) <<
"List" << i <<
" size: " << listar[i]->
size();
1277 if (listar[i]->
size() <2)
1280 exception.
SetReason(
"too few particles for Phase Space decay - try again");
1320 if(success1 && success2 && success3 && success4 && success5)
1322 LOG(
"HAIntranuke2018",
pINFO)<<
"Successful many-body absorption - n>=18";
1324 TParticlePDG * remn = 0;
1325 double MassRem = 0.;
1331 <<
"NO Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1332 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1336 MassRem = remn->Mass();
1338 <<
"Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1339 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1343 double MRemn = TMath::Sqrt(ERemn*ERemn - PRemn*PRemn);
1344 LOG(
"HAIntranuke2018",
pINFO) <<
"PRemn = " << PRemn <<
" ;ERemn= " << ERemn;
1345 LOG(
"HAIntranuke2018",
pINFO) <<
"MRemn= " << MRemn <<
" ;true Mass= " << MassRem <<
" ; excitation energy (>0 good)= " << (MRemn-MassRem)*1000. <<
" MeV";
1351 LOG(
"HAIntranuke2018",
pWARN) <<
"PhaseSpace decay fails for HadrCluster- recovery likely incorrect - rethrow event";
1357 if ( pdgc==
kPdgPiM ) fRemnZ++;
1390 double probM = pLib->
Find(pdgc) ->Mass();
1391 double probBE = (np+nn)*.005;
1392 TVector3 pP3 = p->
P4()->Vect();
1393 double probKE = p->
P4()->E() - (probM - probBE);
1394 double clusKE = probKE;
1395 TLorentzVector clusP4(pP3,clusKE);
1396 LOG(
"HAIntranuke2018",
pINFO) <<
"probM = " << probM <<
" ;clusKE= " << clusKE;
1397 TLorentzVector X4(*p->
X4());
1406 for (
int i=0;i<np;i++)
1412 for (
int i=0;i<nn;i++)
1448 <<
"Remnant nucleus (A,Z) = (" <<
fRemnA <<
", " << fRemnZ <<
")";
1449 LOG(
"HAIntranuke2018",
pINFO) <<
" list size: " << np+nn;
1453 exception.
SetReason(
"too few particles for Phase Space decay - try again");
1462 LOG (
"HAIntranuke2018",
pINFO) <<
"Successful many-body absorption, n<=18";
1463 LOG(
"HAIntranuke2018",
pDEBUG) <<
"Nucleus : (A,Z) = ("<<
fRemnA<<
','<<fRemnZ<<
')';
1464 TParticlePDG * remn = 0;
1465 double MassRem = 0.;
1471 <<
"NO Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1472 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1476 MassRem = remn->Mass();
1478 <<
"Particle with [A = " <<
fRemnA <<
", Z = " << fRemnZ
1479 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
1483 double MRemn = TMath::Sqrt(ERemn*ERemn - PRemn*PRemn);
1484 LOG(
"HAIntranuke2018",
pINFO) <<
"PRemn = " << PRemn <<
" ;ERemn= " << ERemn;
1485 LOG(
"HAIntranuke2018",
pINFO) <<
"expt MRemn= " << MRemn <<
" ;true Mass= " << MassRem <<
" ; excitation energy (>0 good)= " << (MRemn-MassRem)*1000. <<
" MeV";
1494 if ( pdgc==
kPdgPiM ) fRemnZ++;
1497 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 fFermiMomentum
whether or not particle collision is pauli blocked
static RandomGen * Instance()
Access instance.
const TLorentzVector * P4(void) const
bool PhaseSpaceDecay(GHepRecord *ev, GHepParticle *p, const PDGCodeList &pdgv, TLorentzVector &RemnP4, double NucRmvE, EINukeMode mode=kIMdHA)
general phase space decay method
double fFermiFac
testing parameter to modify fermi momentum
int fRemnA
remnant nucleus A
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 SetMomentum(const TLorentzVector &p4)
static constexpr double MeV
A singleton holding random number generator classes. All random number generation in GENIE should tak...
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
const TVector3 & Momentum3(void) const
int LastMother(void) const
int FirstMother(void) const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
string Name(void) const
Name that corresponds to the PDG code.
const int kPdgCompNuclCluster
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
enum genie::EINukeFateHN_t INukeFateHN_t
void SetReason(string reason)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
bool TwoBodyKinematics(double M3, double M4, TLorentzVector tP1L, TLorentzVector tP2L, TLorentzVector &tP3L, TLorentzVector &tP4L, double C3CM, TLorentzVector &RemnP4, double bindE=0)
virtual GHepParticle * TargetNucleus(void) const
bool fDoFermi
whether or not to do fermi mom.
static int max(int a, int b)
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.
const TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
static string AsString(INukeFateHN_t fate)
INukeHadroData2018 * fHadroData2018
a collection of h+N,h+A data & calculations
bool IsNeutronOrProton(int pdgc)
int IonPdgCode(int A, int Z)
virtual bool GenerateNucleon(const Target &) const =0
virtual void AddParticle(const GHepParticle &p)
TParticlePDG * Find(int pdgc, bool must_exist=true)
double fNucRmvE
binding energy to subtract from cascade nucleons
STDHEP-like event record entry that can fit a particle or a nucleus.
cet::coded_exception< error, detail::translate > exception
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
void push_back(int pdg_code)
enum genie::EGHepStatus GHepStatus_t
int fRemnZ
remnant nucleus Z
TLorentzVector fRemnP4
P4 of remnant system.