37 LOG(
"PhotonRESGenerator",
pWARN) <<
"W decayer failed!";
40 exception.
SetReason(
"Could not simulate the W decay system");
49#ifdef __GENIE_PYTHIA8_ENABLED__
55#ifdef __GENIE_PYTHIA8_ENABLED__
66 TVector3 unit_nu = nu->
P4()->Vect().Unit();
68 int probepdg = init_state.
ProbePdg();
74 long double s =
born->GetS(Mtarget,Enuin);
79 long double costhCM = n1;
80 long double sinthCM = sqrtl(1-costhCM*costhCM);
82 long double xmin =
fQ2PDFmin/2./Enuin/Mtarget;
83 long double x = expl( logl(xmin) + (logl(1.0)-logl(xmin))*n2 );
84 long double s_r = s*x;
87 long double EnuinCM = sqrtl(s_r)/2.;
88 long double beta = (powl(Enuin,2)-powl(EnuinCM,2))/(powl(Enuin,2)+powl(EnuinCM,2));
96 long double ElpoutCM = (s_r+mlout*mlout)/sqrtl(s_r)/2.;
97 long double EnuoutCM = (s_r-mlout*mlout)/sqrtl(s_r)/2.;
104 TLorentzVector p4lp_o( (
double)p4_lpout.
Px(), (
double)p4_lpout.
Py(), (
double)p4_lpout.
Pz(), (
double)p4_lpout.
E() );
105 TLorentzVector p4nu_o( (
double)p4_nuout.
Px(), (
double)p4_nuout.
Py(), (
double)p4_nuout.
Pz(), (
double)p4_nuout.
E() );
109 double phi = 2*
kPi * rnd->
RndLep().Rndm();
114 p4lp_o.RotateUz(unit_nu);
115 p4nu_o.RotateUz(unit_nu);
131 event->Summary()->KinePtr()->SetFSLeptonP4(p4lp_o);
141 Pythia8::Event fEvent;
143 fPythiaP->settings.mode(
"Random:seed", rnd->
RndLep().Integer(100000000));
144 fPythiaP->settings.parm(
"Beams:eCM",sqrtl(s_r));
149 fEvent = fPythiaP->event;
152 fPythiaN->settings.mode(
"Random:seed", rnd->
RndLep().Integer(100000000));
153 fPythiaN->settings.parm(
"Beams:eCM",sqrtl(s_r));
158 fEvent = fPythiaN->event;
161 int np = fEvent.size();
164 for (
int i = 5; i < np; i++) {
166 int pdgc = fEvent[i].id();
169 int ks = fEvent[i].status();
171 LongLorentzVector p4longo(fEvent[i].px(), fEvent[i].py(), fEvent[i].pz(), fEvent[i].
e());
174 TLorentzVector p4o( (
double)p4longo.
Px(), (
double)p4longo.
Py(), (
double)p4longo.
Pz(), (
double)p4longo.
E() );
175 p4o.RotateUz(unit_nu);
178 if ( ks>0 && p4o.E()<massPDG ) {
179 LOG(
"PhotonRESGenerator",
pWARN) <<
"Putting at rest one stable particle generated by PYTHIA because E < m";
180 LOG(
"PhotonRESGenerator",
pWARN) <<
"PDG = " << pdgc <<
" // State = " << ks;
181 LOG(
"PhotonRESGenerator",
pWARN) <<
"E = " << p4o.E() <<
" // |p| = " << TMath::Sqrt(p4o.P());
182 LOG(
"PhotonRESGenerator",
pWARN) <<
"p = [ " << p4o.Px() <<
" , " << p4o.Py() <<
" , " << p4o.Pz() <<
" ]";
183 LOG(
"PhotonRESGenerator",
pWARN) <<
"m = " << p4o.M() <<
" // mpdg = " << massPDG;
184 p4o.SetXYZT(0,0,0,massPDG);
191 int firstmother = -1;
196 if ( fEvent[i].mother1() == 3 ) {
198 firstchild = fEvent[i].daughter1() - 3;
199 lastchild = fEvent[i].daughter2() - 3;
202 firstmother = fEvent[i].mother1() - 3;
203 firstchild = fEvent[i].daughter1() - 3;
204 lastchild = fEvent[i].daughter2() - 3;
207 double vx = nu->
X4()->X() + fEvent[i].xProd()*1e12;
208 double vy = nu->
X4()->Y() + fEvent[i].yProd()*1e12;
209 double vz = nu->
X4()->Z() + fEvent[i].zProd()*1e12;
211 TLorentzVector pos( vx, vy, vz, vt );
213 event->AddParticle(pdgc, ist, firstmother, lastmother, firstchild, lastchild, p4o, pos );
240#ifdef __GENIE_PYTHIA8_ENABLED__
255 fPythiaP->settings.parm(
"Diffraction:primKTwidth",
fGaussianPt2);
261 fPythiaP->settings.parm(
"StringZ:aLund",
fLunda);
262 fPythiaP->settings.parm(
"StringZ:bLund",
fLundb);
263 fPythiaP->settings.parm(
"StringZ:aExtraDiquark",
fLundaDiq);
266 fPythiaN->settings.parm(
"Diffraction:primKTwidth",
fGaussianPt2);
272 fPythiaN->settings.parm(
"StringZ:aLund",
fLunda);
273 fPythiaN->settings.parm(
"StringZ:bLund",
fLundb);
274 fPythiaN->settings.parm(
"StringZ:aExtraDiquark",
fLundaDiq);
294 RgKeyList::const_iterator kiter = klist.begin();
295 for( ; kiter != klist.end(); ++kiter) {
299 int pdg_code = atoi(kv[1].c_str());
301 LOG(
"PhotonRESGenerator",
pDEBUG) <<
"Configured to inhibit decays for " << pdg_code;
302 auto pdentryP = fPythiaP->particleData.particleDataEntryPtr(pdg_code);
303 for (
int ichan=0; ichan<=pdentryP->sizeChannels()-1; ++ichan) {
304 int onMode = pdentryP->channel(ichan).onMode();
305 bool is_particle = (pdg_code>0);
310 onMode = (is_particle ? 3 : 2);
313 onMode = (is_particle ? 0 : 2);
316 onMode = (is_particle ? 3 : 0);
319 pdentryP->channel(ichan).onMode(onMode);
322 auto pdentryN = fPythiaN->particleData.particleDataEntryPtr(pdg_code);
323 for (
int ichan=0; ichan<=pdentryN->sizeChannels()-1; ++ichan) {
324 int onMode = pdentryN->channel(ichan).onMode();
325 bool is_particle = (pdg_code>0);
330 onMode = (is_particle ? 3 : 2);
333 onMode = (is_particle ? 0 : 2);
336 onMode = (is_particle ? 3 : 0);
339 pdentryN->channel(ichan).onMode(onMode);
353#ifdef __GENIE_PYTHIA8_ENABLED__
358 fPythiaP =
new Pythia8::Pythia();
359 fPythiaP->readString(
"Print:quiet = on");
360 fPythiaP->readString(
"Random:setSeed = on");
361 fPythiaP->readString(
"WeakSingleBoson:ffbar2ffbar(s:W) = on");
362 fPythiaP->readString(
"PDF:lepton = off");
363 fPythiaP->readString(
"24:onMode = off");
364 fPythiaP->readString(
"24:onIfAny = 1 2 3 4 5");
365 fPythiaP->readString(
"Beams:idA = 12");
366 fPythiaP->readString(
"Beams:idB = -11");
368 fPythiaN =
new Pythia8::Pythia();
369 fPythiaN->readString(
"Print:quiet = on");
370 fPythiaN->readString(
"Random:setSeed = on");
371 fPythiaN->readString(
"WeakSingleBoson:ffbar2ffbar(s:W) = on");
372 fPythiaN->readString(
"PDF:lepton = off");
373 fPythiaN->readString(
"24:onMode = off");
374 fPythiaN->readString(
"24:onIfAny = 1 2 3 4 5");
375 fPythiaN->readString(
"Beams:idA = -12");
376 fPythiaN->readString(
"Beams:idB = 11");
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
virtual const Registry & GetConfig(void) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Born level nu-electron cross section.
STDHEP-like event record entry that can fit a particle or a nucleus.
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
GENIE's GHEP MC event record.
Initial State information.
const Target & Tgt(void) const
double ProbeE(RefFrame_t rf) const
Summary information for an interaction.
const Kinematics & Kine(void) const
int FSPrimLeptonPdg(void) const
final state primary lepton pdg
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
const InitialState & InitState(void) const
double GetKV(KineVar_t kv) const
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
bool Wdecay(GHepRecord *event) const
double fLundaDiq
adjustment of Lund a for di-quark
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
double fSSBarSuppression
ssbar suppression
void ProcessEventRecord(GHepRecord *event) const
double fGaussianPt2
gaussian pt2 distribution width
void Configure(const Registry &config)
double fLundb
Lund b parameter.
void Initialize(void) const
double fLightVMesonSuppression
light vector meson suppression
double fSVMesonSuppression
strange vector meson suppression
double fDiQuarkSuppression
di-quark suppression parameter
double fRemainingECutoff
remaining E cutoff stopping fragmentation
double fLunda
Lund a parameter.
A singleton holding random number generator classes. All random number generation in GENIE should tak...
static RandomGen * Instance()
Access instance.
TRandom3 & RndLep(void) const
rnd number generator used by final state primary lepton generators
A registry. Provides the container for algorithm configuration parameters.
RgKeyList FindKeys(RgKey key_part) const
create list with all keys containing 'key_part'
RgBool GetBool(RgKey key) const
double HitNucMass(void) const
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
void SwitchOnFastForward(void)
void SetReason(string reason)
void BoostZ(long double bz)
bool IsNeutrino(int pdgc)
bool IsPositron(int pdgc)
bool IsElectron(int pdgc)
bool IsAntiMuon(int pdgc)
static constexpr double millimeter
static constexpr double second
Simple functions for loading and reading nucleus dependent keys from config files.
vector< string > Split(string input, string delim)
@ kIStFinalStateNuclearRemnant
@ kIStDISPreFragmHadronicState
vector< RgKey > RgKeyList
enum genie::EGHepStatus GHepStatus_t