16 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,6) 17 #include <TMCParticle.h> 19 #include <TMCParticle6.h> 21 #include <TClonesArray.h> 27 #include "Framework/Conventions/GBuild.h" 39 using namespace genie;
43 extern "C" void py2ent_(
int *,
int *,
int *,
double *);
75 LOG(
"PythiaHad",
pNOTICE) <<
"Running PYTHIA hadronizer";
78 LOG(
"PythiaHad",
pERROR) <<
"Returning a null particle list!";
91 double W = kinematics.
W();
99 <<
"Hit nucleon pdgc = " << hit_nucleon <<
", W = " <<
W;
101 <<
"Selected hit quark pdgc = " << hit_quark
102 << ((from_sea) ?
"[sea]" :
"[valence]");
114 bool isem = proc_info.
IsEM ();
130 if (isnc || isem || isdm) {
132 final_quark = hit_quark;
136 else if (isv && iss ) final_quark =
kPdgUQuark;
138 else if (isvb && isu ) final_quark =
kPdgDQuark;
143 <<
"Not allowed mode. Refused to make a final quark assignment!";
199 <<
"Can not really handle a hit s or sbar quark / Faking it";
213 double Rqq = rnd->
RndHadro().Rndm();
224 <<
"Fragmentation / Init System: " 225 <<
"q = " << final_quark <<
", qq = " << diquark;
240 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 241 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for pi0 = " << pi0_decflag;
242 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for K0 = " << K0_decflag;
243 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for \bar{K0} = " << K0b_decflag;
244 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for Lambda = " << L0_decflag;
245 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for \bar{Lambda0} = " << L0b_decflag;
246 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for D- = " << Dm_decflag;
247 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for D0 = " << D0_decflag;
248 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for D+ = " << Dp_decflag;
249 LOG(
"PythiaHad",
pDEBUG) <<
"Original decay flag for D++ = " << Dpp_decflag;
263 py2ent_(&ip, &final_quark, &diquark, &W);
278 TClonesArray * pythia_particles =
279 (TClonesArray *)
fPythia->ImportParticles(
"All");
284 int np = pythia_particles->GetEntries();
286 TClonesArray * particle_list =
new TClonesArray(
"TMCParticle", np);
287 particle_list->SetOwner(
true);
290 TMCParticle * particle = 0;
291 TIter particle_iter(pythia_particles);
293 while( (particle = (TMCParticle *) particle_iter.Next()) ) {
295 <<
"Adding final state particle pdgc = " << particle->GetKF()
296 <<
" with status = " << particle->GetKS();
298 if(particle->GetKS() == 1) {
302 <<
"Hadronization failed! Bare quark/di-quarks appear in final state!";
303 particle_list->Delete();
304 delete particle_list;
310 particle->SetParent (particle->GetParent() - 1);
311 particle->SetFirstChild (particle->GetFirstChild() - 1);
312 particle->SetLastChild (particle->GetLastChild() - 1);
315 new ( (*particle_list)[i++] ) TMCParticle(*particle);
319 return particle_list;
331 TClonesArray * particle_list = this->
Hadronize(interaction);
333 if(!particle_list)
return 0;
337 pdgcv->reserve(particle_list->GetEntries());
339 TMCParticle * particle = 0;
340 TIter particle_iter(particle_list);
342 while ((particle = (TMCParticle *) particle_iter.Next()))
344 if (particle->GetKS()==1) pdgcv->
push_back(particle->GetKF());
346 particle_list->Delete();
347 delete particle_list;
359 <<
"Returning a null multipicity probability distribution!";
362 double maxmult = this->
MaxMult(interaction);
366 TMCParticle * particle = 0;
368 for(
int iev=0; iev<nev; iev++) {
370 TClonesArray * particle_list = this->
Hadronize(interaction);
373 if(!particle_list) { iev--;
continue; }
376 TIter particle_iter(particle_list);
377 while ((particle = (TMCParticle *) particle_iter.Next()))
379 if (particle->GetKS()==1) n++;
381 particle_list->Delete();
382 delete particle_list;
383 mult_prob->Fill( (
double)n, weight);
386 double integral = mult_prob->Integral(
"width");
389 mult_prob->Scale(1.0/integral);
391 SLOG(
"PythiaHad",
pWARN) <<
"probability distribution integral = 0";
397 bool apply_neugen_Rijk = option.find(
"+LowMultSuppr") != string::npos;
398 bool renormalize = option.find(
"+Renormalize") != string::npos;
401 if(apply_neugen_Rijk) {
402 SLOG(
"KNOHad",
pINFO) <<
"Applying NeuGEN scaling factors";
405 double W = kinematics.
W();
407 this->
ApplyRijk(interaction, renormalize, mult_prob);
410 <<
"W = " << W <<
" < Wcut = " <<
fWcut 411 <<
" - Will not apply scaling factors";
505 LOG(
"PythiaHad",
pWARN) <<
"Can't hadronize charm events";
510 if(W < this->
Wmin()) {
511 LOG(
"PythiaHad",
pWARN) <<
"Low invariant mass, W = " << W <<
" GeV!!";
520 LOG(
"PythiaHad",
pWARN) <<
"Hit quark was not set!";
540 bool isem = proc_info.
IsEM ();
541 if( !(iscc||isnc||isem||isdmi) ) {
543 <<
"Can only handle electro-weak interactions";
546 if( !(isp||isn) || !(isv||isvb||isl||islb||isdm) ) {
548 <<
"Invalid initial state: probe = " 549 << probe <<
", hit_nucleon = " << hit_nucleon;
561 bool allowed = (iscc && isv && (isd||isub||iss)) ||
562 (iscc && isvb && (isu||isdb||issb)) ||
563 (isnc && (isv||isvb) && (isu||isd||isub||isdb||iss||issb)) ||
564 (isdmi && isdm && (isu||isd||isub||isdb||iss||issb)) ||
565 (isem && (isl||islb) && (isu||isd||isub||isdb||iss||issb));
568 <<
"Impossible interaction type / probe / hit quark combination!";
const int kPdgP33m1232_DeltaPP
double fRvnCCm3
neugen's Rijk: vn, CC, multiplicity = 3
PDGCodeList * SelectParticles(const Interaction *) const
const int kPdgUUDiquarkS1
double W(bool selected=false) const
double fRvbpCCm3
neugen's Rijk: vbp, CC, multiplicity = 3
double fSSBarSuppression
ssbar suppression
bool HitSeaQrk(void) const
bool IsWeakCC(void) const
bool IsNeutrino(int pdgc)
THE MAIN GENIE PROJECT NAMESPACE
double MaxMult(const Interaction *i) const
static RandomGen * Instance()
Access instance.
int HitNucPdg(void) const
double fLundaDiq
adjustment of Lund a for di-quark
double fRvnNCm2
neugen's Rijk: vn, NC, multiplicity = 2
double fRvbpCCm2
neugen's Rijk: vbp, CC, multiplicity = 2
double fDiQuarkSuppression
di-quark suppression parameter
double Weight(void) const
int HitQrkPdg(void) const
double fRvpCCm2
neugen's Rijk: vp, CC, multiplicity = 2
Generated/set kinematical variables for an event.
const DecayModelI * fDecayer
bool IsDarkMatter(int pdgc)
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
double fLundb
Lund b parameter.
void py2ent_(int *, int *, int *, double *)
bool IsAntiSQuark(int pdgc)
double fRvbnNCm3
neugen's Rijk: vbn, NC, multiplicity = 3
A singleton holding random number generator classes. All random number generation in GENIE should tak...
bool IsAntiDQuark(int pdgc)
virtual const Registry & GetConfig(void) const
const int kPdgP33m1232_DeltaP
double fRvpNCm2
neugen's Rijk: vp, NC, multiplicity = 2
const int kPdgP33m1232_DeltaM
bool IsCharmEvent(void) const
double W(const Interaction *const i)
TH1D * CreateMultProbHist(double maxmult) const
double fLightVMesonSuppression
Light vector meon suppression.
bool IsPosChargedLepton(int pdgc)
Summary information for an interaction.
double fGaussianPt2
gaussian pt2 distribution width
Pure abstract base class. Defines the DecayModelI interface to be implemented by any algorithmic clas...
void Configure(const Registry &config)
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double fRvpNCm3
neugen's Rijk: vp, NC, multiplicity = 3
const int kPdgUDDiquarkS1
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
bool IsAntiNeutrino(int pdgc)
const Kinematics & Kine(void) const
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
virtual void Configure(const Registry &config)
double fRvbnNCm2
neugen's Rijk: vbn, NC, multiplicity = 2
double fLunda
Lund a parameter.
const int kPdgUDDiquarkS0
double fRvpCCm3
neugen's Rijk: vp, CC, multiplicity = 3
double fRvbpNCm2
neugen's Rijk: vbp, NC, multiplicity = 2
const int kPdgP33m1232_Delta0
double fRvnNCm3
neugen's Rijk: vn, NC, multiplicity = 3
virtual ~PythiaHadronization()
double fSVMesonSuppression
Strange vector meson suppression.
void ApplyRijk(const Interaction *i, bool norm, TH1D *mp) const
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
double Wmin(void) const
Various utility methods common to hadronization models.
double fRemainingECutoff
remaining E cutoff for stopping fragmentation
bool HitQrkIsSet(void) const
An abstract class. It avoids implementing the HadronizationModelI interface, leaving it for the concr...
bool IsDarkMatter(void) const
TPythia6 * fPythia
PYTHIA6 wrapper class.
A registry. Provides the container for algorithm configuration parameters.
const XclsTag & ExclTag(void) const
TH1D * MultiplicityProb(const Interaction *, Option_t *opt="") const
void Print(const TClonesArray *const part_list)
double fWcut
configuration data common to all hadronizers
const InitialState & InitState(void) const
const ProcessInfo & ProcInfo(void) const
double fRvbnCCm3
neugen's Rijk: vbn, CC, multiplicity = 3
bool AssertValidity(const Interaction *i) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
TClonesArray * Hadronize(const Interaction *) const
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
void Initialize(void) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
bool IsNegChargedLepton(int pdgc)
void push_back(int pdg_code)
double fRvbpNCm3
neugen's Rijk: vbp, NC, multiplicity = 3
bool IsAntiUQuark(int pdgc)
double fRvnCCm2
neugen's Rijk: vn, CC, multiplicity = 2
Initial State information.
double fRvbnCCm2
neugen's Rijk: vbn, CC, multiplicity = 2
const int kPdgDDDiquarkS1
const Algorithm * SubAlg(const RgKey ®istry_key) const