12 #include <TClonesArray.h>
28 #ifdef __GENIE_PYTHIA6_ENABLED__
29 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,6)
30 #include <TMCParticle.h>
32 #include <TMCParticle6.h>
34 #endif // __GENIE_PYTHIA6_ENABLED__
36 using namespace genie;
37 using namespace genie::constants;
40 extern "C" void py2ent_(
int *,
int *,
int *,
double *);
66 #ifdef __GENIE_PYTHIA6_ENABLED__
70 <<
"Calling GENIE/PYTHIA6 hadronization modules without enabling PYTHIA6";
82 #ifdef __GENIE_PYTHIA6_ENABLED__
84 LOG(
"Pythia6Had",
pNOTICE) <<
"Running PYTHIA6 hadronizer";
88 double W = kinematics.
W();
101 TClonesArray * pythia_particles =
102 (TClonesArray *)
fPythia->ImportParticles(
"All");
107 int np = pythia_particles->GetEntries();
109 TClonesArray * particle_list =
new TClonesArray(
"genie::GHepParticle", np);
110 particle_list->SetOwner(
true);
113 TLorentzVector p4Had = kinematics.
HadSystP4();
116 TVector3 unitvq = p4Had.Vect().Unit();
119 TVector3 beta(0,0,p4Had.P()/p4Had.Energy());
126 int mom =
event->FinalStateHadronicSystemPosition();
131 const TLorentzVector & vtx = *(neutrino->
X4());
136 TIter particle_iter(pythia_particles);
137 while( (p = (TMCParticle *) particle_iter.Next()) ) {
139 int particle_pdg_code = p->GetKF();
140 int pythia_particle_status = p->GetKS();
143 if(pythia_particle_status == 1) {
148 <<
"Hadronization failed! Bare quarks appear in final state!";
158 TLorentzVector p4o(p->GetPx(), p->GetPy(), p->GetPz(), p->GetEnergy());
160 TVector3 p3 = p4o.Vect();
162 TLorentzVector p4(p3,p4o.Energy());
170 bool is_gamma = (particle_pdg_code ==
kPdgGamma);
173 bool not_hadr = is_gamma || is_nu || is_lchg;
177 int mother1 = mom + p->GetParent();
179 int daughter1 = (p->GetFirstChild() <= 0 ) ? -1 : mom + p->GetFirstChild();
180 int daughter2 = (p->GetLastChild() <= 0 ) ? -1 : mom + p->GetLastChild();
201 <<
"Adding final state particle pdgc = " << particle.
Pdg()
202 <<
" with status = " << particle.
Status();
205 event->AddParticle(particle);
211 #endif // __GENIE_PYTHIA6_ENABLED__
216 #ifdef __GENIE_PYTHIA6_ENABLED__
227 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
229 <<
"Original PYTHIA6 decay flags:"
241 #endif // __GENIE_PYTHIA6_ENABLED__
246 #ifdef __GENIE_PYTHIA6_ENABLED__
267 #endif // __GENIE_PYTHIA6_ENABLED__
272 #ifdef __GENIE_PYTHIA6_ENABLED__
293 #endif // __GENIE_PYTHIA6_ENABLED__
312 #ifdef __GENIE_PYTHIA6_ENABLED__
331 #ifdef __GENIE_PYTHIA6_ENABLED__
332 fPythia = TPythia6::Instance();
double fSSBarSuppression
ssbar suppression
virtual void LoadConfig(void)
const int kPdgP33m1232_DeltaPP
void CopyOriginalDecayFlags(void) const
double W(bool selected=false) const
void ProcessEventRecord(GHepRecord *event) const
bool Hadronize(GHepRecord *event) const
static RandomGen * Instance()
Access instance.
#define __GENIE_PYTHIA6_ENABLED__
bool IsNucleus(void) const
Generated/set kinematical variables for an event.
virtual void ProcessEventRecord(GHepRecord *event) const
double fGaussianPt2
gaussian pt2 distribution width
void RestoreOriginalDecayFlags(void) const
bool IsChargedLepton(int pdgc)
const TLorentzVector & HadSystP4(void) const
double fDiQuarkSuppression
di-quark suppression parameter
TPythia6 * fPythia
PYTHIA6 wrapper class.
GHepStatus_t Status(void) const
virtual const Registry & GetConfig(void) const
const int kPdgP33m1232_DeltaP
double fSVMesonSuppression
strange vector meson suppression
const int kPdgP33m1232_DeltaM
double W(const Interaction *const i)
virtual void Initialize(void)
Summary information for an interaction.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double fLightVMesonSuppression
light vector meson suppression
double fLundaDiq
adjustment of Lund a for di-quark
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
void py2ent_(int *, int *, int *, double *)
double fLunda
Lund a parameter.
Base class for the Pythia (6 and 8) hadronization modules in GENIE. In particular, the base class provides common checks and basic assignments of quark/diquark codes for a no frills interface to Pythia hadronization routines.
void Configure(const Registry &config)
const int kPdgP33m1232_Delta0
bool IsNeutralLepton(int pdgc)
const TLorentzVector * X4(void) const
A registry. Provides the container for algorithm configuration parameters.
const InitialState & InitState(void) const
double fLundb
Lund b parameter.
virtual ~Pythia6Hadro2019()
const Target & Tgt(void) const
void SetDesiredDecayFlags(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.
double fRemainingECutoff
remaining E cutoff stopping fragmentation
enum genie::EGHepStatus GHepStatus_t