701 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 703 <<
"Inelastic() is invoked for a : " << p->
Name()
707 bool allow_dup =
true;
718 ev,p,&s1,&s2,&s3,
fRemnA,
fRemnZ,
fRemnP4,
fDoFermi,
fFermiFac,
fFermiMomentum,
fNuclmodel);
721 LOG (
"HAIntranuke2014",
pINFO) <<
" successful pion production fate";
736 LOG(
"HAIntranuke2014",
pNOTICE) <<
"Error: could not create pion production final state";
738 exception.
SetReason(
"PionProduction kinematics failed - retry kinematics");
756 LOG(
"HAIntranuke2014",
pNOTICE) <<
"stop propagation - could not create absorption final state: too few particles";
763 LOG(
"HAIntranuke2014",
pNOTICE) <<
"stop propagation - could not create absorption final state: Pi- or K- cannot be absorbed by only neutrons";
770 LOG(
"HAIntranuke2014",
pINFO) <<
"stop propagation - could not create absorption final state: Pi+ or K+ cannot be absorbed by only protons";
784 int t1code,t2code,scode,s2code;
790 double Prob_pipd_pp=2.*ppcnt*(1.-ppcnt);
791 double Prob_pipnn_pn=.083*(1.-ppcnt)*(1.-ppcnt);
792 if (rnd->
RndFsi().Rndm()*(Prob_pipd_pp+Prob_pipnn_pn)<Prob_pipd_pp){
800 double Prob_pimd_nn=2.*ppcnt*(1.-ppcnt);
801 double Prob_pimpp_pn=.083*ppcnt*ppcnt;
802 if (rnd->
RndFsi().Rndm()*(Prob_pimd_nn+Prob_pimpp_pn)<Prob_pimd_nn){
810 double Prob_pi0d_pn=0.88*ppcnt*(1.-ppcnt);
811 double Prob_pi0pp_pp=.14*ppcnt*ppcnt;
812 double Prob_pi0nn_nn=.14*(1.-ppcnt)*(1.-ppcnt);
813 if (rnd->
RndFsi().Rndm()*(Prob_pi0d_pn+Prob_pi0pp_pp+Prob_pi0nn_nn)<Prob_pi0d_pn){
816 else if (rnd->
RndFsi().Rndm()*(Prob_pi0d_pn+Prob_pi0pp_pp+Prob_pi0nn_nn)<(Prob_pi0d_pn+Prob_pi0pp_pp)){
823 LOG(
"HAIntranuke2014",
pINFO) <<
"choose 2 body absorption, probe, fs = " << pdgc <<
" "<< scode <<
" "<<s2code;
826 double M2_1 = pLib->
Find(t1code)->Mass();
827 double M2_2 = pLib->
Find(t2code)->Mass();
829 double M3 = pLib->
Find(scode) ->Mass();
830 double M4 = pLib->
Find(s2code)->Mass();
834 TVector3 tP2_1L, tP2_2L;
839 target.SetHitNucPdg(t1code);
842 E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1);
844 target.SetHitNucPdg(t2code);
847 E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2);
853 tP2_1L.SetXYZ(0.0, 0.0, 0.0);
856 tP2_2L.SetXYZ(0.0, 0.0, 0.0);
859 TLorentzVector dNucl_P4=TLorentzVector(tP2_1L+tP2_2L,E2_1L+E2_2L);
861 double E2L = E2_1L + E2_2L;
868 LOG(
"HAIntranuke2014",
pWARN) <<
"Inelastic() failed: IntBounce returned bad angle - try again";
870 exception.
SetReason(
"unphysical angle for hN scattering");
875 TLorentzVector t4P1L,t4P2L,t4P3L,t4P4L;
877 t4P2L=TLorentzVector(TVector3(tP2_1L+tP2_2L),E2L);
916 LOG(
"HAIntranuke2014",
pNOTICE) <<
"Inelastic in hA failed calling TwoBodyKineamtics";
918 exception.
SetReason(
"Pion absorption kinematics through TwoBodyKinematics failed");
942 nd0 = -135.227 * TMath::Exp(-7.124*
fRemnZ /
double(
fRemnA)) + 4.914;
944 Sig_nd = 2.034 +
fRemnA * 0.007846;
946 double c1 = 0.041 + ke * 0.0001525;
947 double c2 = -0.003444 - ke * 0.00002324;
950 double c3 = 0.064 - ke * 0.000015;
951 gam_ns = c1 * TMath::Exp(c2*
fRemnA) + c3;
952 if(gam_ns<0.002) gam_ns = 0.002;
954 LOG(
"HAIntranuke2014",
pINFO) <<
"nucleon absorption";
955 LOG(
"HAIntranuke2014",
pINFO) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
957 LOG(
"HAIntranuke2014",
pINFO) <<
"--> gam_ns = " << gam_ns;
961 ns0 = .0001*(1.+ke/250.) * (
fRemnA-10)*(
fRemnA-10) + 3.5;
962 nd0 = (1.+ke/250.) - ((
fRemnA/200.)*(1. + 2.*ke/250.));
963 Sig_ns = (10. + 4. * ke/250.)*TMath::Power(
fRemnA/250.,0.9);
964 Sig_nd = 4*(1 - TMath::Exp(-0.03*ke));
965 LOG(
"HAIntranuke2014",
pINFO) <<
"pion absorption";
966 LOG(
"HAIntranuke2014",
pINFO) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
967 LOG(
"HAIntranuke2014",
pINFO) <<
"--> mean sum distr = " << ns0 <<
", Stand dev = " << Sig_ns;
971 ns0 = (rnd->
RndFsi().Rndm()>0.5?3:2);
975 LOG(
"HAIntranuke2014",
pINFO) <<
"kaon absorption - set ns, nd later";
981 LOG(
"HAIntranuke2014",
pWARN) <<
"Inelastic() cannot handle absorption reaction for " << p->
Name();
991 double u1 = 0, u2 = 0;
997 LOG(
"HAIntranuke2014",
pNOTICE) <<
"Error: could not choose absorption final state";
998 LOG(
"HAIntranuke2014",
pNOTICE) <<
"--> mean diff distr = " << nd0 <<
", stand dev = " << Sig_nd;
999 LOG(
"HAIntranuke2014",
pNOTICE) <<
"--> mean sum distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1000 LOG(
"HAIntranuke2014",
pNOTICE) <<
"--> gam_ns = " << gam_ns;
1003 exception.
SetReason(
"Absorption choice of # of p,n failed");
1012 u1 = rnd->
RndFsi().Rndm();
1013 u2 = rnd->
RndFsi().Rndm();
1014 if (u1==0) u1 = rnd->
RndFsi().Rndm();
1015 if (u2==0) u2 = rnd->
RndFsi().Rndm();
1018 double x2 = TMath::Sqrt(-2*TMath::Log(u1))*TMath::Sin(2*
kPi*u2);
1024 ns = -TMath::Log(rnd->
RndFsi().Rndm())/gam_ns;
1028 ns = (rnd->
RndFsi().Rndm()<0.5?2:3);
1039 double max = ns0 + Sig_ns * 10;
1042 bool not_found =
true;
1050 LOG(
"HAIntranuke2014",
pNOTICE) <<
"Error: stuck in random variable loop for ns";
1051 LOG(
"HAIntranuke2014",
pNOTICE) <<
"--> mean of sum parent distr = " << ns0 <<
", Stand dev = " << Sig_ns;
1055 exception.
SetReason(
"Random number generator for choice of #p,n final state failed - unusual - redo kinematics");
1060 u1 = rnd->
RndFsi().Rndm();
1061 u2 = rnd->
RndFsi().Rndm();
1062 if (u1==0) u1 = rnd->
RndFsi().Rndm();
1063 if (u2==0) u2 = rnd->
RndFsi().Rndm();
1064 x1 = TMath::Sqrt(-2*TMath::Log(u1))*TMath::Cos(2*
kPi*u2);
1066 ns = ns0 + Sig_ns * x1;
1067 if ( ns>max || ns<0 ) {iter2++;
continue;}
1068 else if ( rnd->
RndFsi().Rndm() > (ns/
max) ) {iter2++;
continue;}
1076 double nd = nd0 + Sig_nd * x2;
1081 np =
int((ns+nd)/2.+.5);
1082 nn =
int((ns-nd)/2.+.5);
1084 LOG(
"HAIntranuke2014",
pINFO) <<
"ns = "<<ns<<
", nd = "<<nd<<
", np = "<<np<<
", nn = "<<nn;
1090 if (np < 0 || nn < 0 ) {iter++;
continue;}
1091 else if (np + nn < 2. ) {iter++;
continue;}
1094 - ((pdgc==
kPdgPiM || pdgc==
kPdgKM)?1:0)) {iter++;
continue;}
1099 LOG(
"HAIntranuke2014",
pINFO) <<
"success, iter = " << iter <<
" np, nn = " << np <<
" " << nn;
1102 double frac = 85./double(np+nn);
1110 if (rnd->
RndFsi().Rndm()<np/(double)(np+nn)) np--;
1114 LOG(
"HAIntranuke2014",
pNOTICE) <<
"Final state chosen; # protons : " 1115 << np <<
", # neutrons : " << nn;
1143 PDGCodeList* listar[5] = {&list0, &list1, &list2, &list3, &list4};
1148 double probM = pLib->
Find(pdgc) ->Mass();
1149 TVector3 pP3 = p->
P4()->Vect() * (1./5.);
1150 double probKE = p->
P4()->E() -probM;
1151 double clusKE = probKE * (1./5.);
1152 TLorentzVector clusP4(pP3,clusKE);
1154 TLorentzVector X4(*p->
X4());
1169 for (
int i=0;
i<(np+nn);
i++)
1179 for (
int i=0;
i<5;
i++)
1181 LOG(
"HAIntranuke2014",
pINFO) <<
"List" <<
i <<
" size: " << listar[
i]->size();
1182 if (listar[
i]->size() <2)
1185 exception.
SetReason(
"too few particles for Phase Space decay - try again");
1225 if(success1 && success2 && success3 && success4 && success5)
1227 LOG(
"HAIntranuke2014",
pINFO)<<
"Successful many-body absorption - n>=18";
1232 LOG(
"HAIntranuke2014",
pWARN) <<
"PhaseSpace decay fails for HadrCluster- recovery likely incorrect - rethrow event";
1258 for (
int i=0;
i<np;
i++)
1264 for (
int i=0;
i<nn;
i++)
1300 <<
"Remnant nucleus (A,Z) = (" <<
fRemnA <<
", " <<
fRemnZ <<
")";
1301 LOG(
"HAIntranuke2014",
pINFO) <<
" list size: " << np+nn;
1305 exception.
SetReason(
"too few particles for Phase Space decay - try again");
1313 LOG (
"HAIntranuke2014",
pINFO) <<
"Successful many-body absorption, n<=18";
1322 if ( pdgc==
kPdgPiM ) fRemnZ++;
1325 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
static RandomGen * Instance()
Access instance.
enum genie::EGHepStatus GHepStatus_t
int fRemnZ
remnant nucleus Z
INukeHadroData2014 * fHadroData2014
a collection of h+N,h+A data & calculations
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 TwoBodyKinematics(double M3, double M4, TLorentzVector tP1L, TLorentzVector tP2L, TLorentzVector &tP3L, TLorentzVector &tP4L, double C3CM, TLorentzVector &RemnP4, double bindE=0)
int LastMother(void) const
int FirstMother(void) const
string Name(void) const
Name that corresponds to the PDG code.
int fRemnA
remnant nucleus A
const int kPdgCompNuclCluster
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...
void SetReason(string reason)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
virtual GHepParticle * TargetNucleus(void) 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)
enum genie::EINukeFateHN_t INukeFateHN_t
double fFermiFac
testing parameter to modify fermi momentum
double fNucRmvE
binding energy to subtract from cascade nucleons
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
static PDGLibrary * Instance(void)
bool PhaseSpaceDecay(GHepRecord *ev, GHepParticle *p, const PDGCodeList &pdgv, TLorentzVector &RemnP4, double NucRmvE, EINukeMode mode=kIMdHA)
general phase space decay method
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)
virtual bool GenerateNucleon(const Target &) const =0
virtual void AddParticle(const GHepParticle &p)
TLorentzVector * P4(void) const
STDHEP-like event record entry that can fit a particle or a nucleus.
TLorentzVector fRemnP4
P4 of remnant system.
cet::coded_exception< error, detail::translate > exception
void push_back(int pdg_code)
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
bool fDoFermi
whether or not to do fermi mom.