1 #include "Framework/Conventions/GBuild.h" 2 #ifdef __GENIE_INCL_ENABLED__ 4 #ifndef INCLConvertParticle_hh 5 #define INCLConvertParticle_hh 1 8 #include "G4INCLParticleSpecies.hh" 9 #include "G4INCLParticleTable.hh" 17 using namespace genie;
21 int INCLpartycleSpecietoPDGCODE(G4INCL::ParticleSpecies theSpecies) {
22 if (theSpecies.theType != Composite) {
23 if (ParticleTable::getName(theSpecies.theType) ==
"pi0")
return 111;
24 else if (ParticleTable::getName(theSpecies.theType) ==
"pi+")
return 211;
25 else if (ParticleTable::getName(theSpecies.theType) ==
"pi-")
return -211;
27 if (theSpecies.theA == 1 && theSpecies.theZ == 1)
return 2212;
28 else if (theSpecies.theA == 1 && theSpecies.theZ == 0)
return 2112;
32 int INCLtopdgcode(
int A,
int Z) {
33 if (A == 1 && Z == 1)
return 2212;
34 else if (A == 1 && Z == 0)
return 2112;
35 else if (A == 0 && Z == 0)
return 111;
36 else if (A == 0 && Z == 1)
return 211;
37 else if (A == 0 && Z ==-1)
return -211;
43 G4INCL::ParticleType toINCLparticletype(
int pdgc) {
45 if (pdgc == 2212)
return G4INCL::Proton;
46 else if (pdgc == 2112)
return G4INCL::Neutron;
47 else if (pdgc == 211)
return G4INCL::PiPlus;
48 else if (pdgc == -211)
return G4INCL::PiMinus;
49 else if (pdgc == 111)
return G4INCL::PiZero;
50 else if (pdgc == 1000010020)
return G4INCL::Composite;
51 else if (pdgc == 1000010030)
return G4INCL::Composite;
52 else if (pdgc == 1000020030)
return G4INCL::Composite;
53 else if (pdgc == 1000020040)
return G4INCL::Composite;
54 else return G4INCL::UnknownParticle;
61 double E_pnP(0), EKinP = result.EKin[nP];
62 TVector3 p3M(result.px[nP]/1000,result.py[nP]/1000,result.pz[nP]/1000);
63 TLorentzVector x4null(0.,0.,0.,0.);
64 double m_pnP = 0.5*((result.px[nP])*(result.px[nP]) +
65 (result.py[nP])*(result.py[nP]) +
66 (result.pz[nP])*(result.pz[nP]) -
67 EKinP*EKinP) / (EKinP);
68 if (m_pnP < 10 && result.A[nP] == 0 && result.Z[nP] == 0) {
70 E_pnP = TMath::Sqrt((result.px[nP])*(result.px[nP]) +
71 (result.py[nP])*(result.py[nP]) +
72 (result.pz[nP])*(result.pz[nP]) );
74 pdg_codeP = INCLtopdgcode(result.A[nP],result.Z[nP]);
76 E_pnP = EKinP + Mass_prodPar*1000;
78 TLorentzVector p4tgtf(p3M,E_pnP/1000);
79 return new GHepParticle(pdg_codeP,ist,mom1,mom2,-1,-1,p4tgtf,x4null);
86 #endif // __GENIE_INCL_ENABLED__ THE MAIN GENIE PROJECT NAMESPACE
static PDGLibrary * Instance(void)
int IonPdgCode(int A, int Z)
TParticlePDG * Find(int pdgc, bool must_exist=true)
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.
enum genie::EGHepStatus GHepStatus_t