37 LOG(
"GLRESGenerator",
pWARN) <<
"W decayer failed!";
40 exception.
SetReason(
"Could not simulate the W decay system");
49#ifdef __GENIE_PYTHIA8_ENABLED__
55#ifdef __GENIE_PYTHIA8_ENABLED__
67 TVector3 unit_nu = nu->
P4()->Vect().Unit();
73 long double s =
born->GetS(mlin,Enuin);
78 long double costhCM = n1;
79 long double sinthCM = sqrtl(1-costhCM*costhCM);
81 long double t =
born->GetT(mlin,mlout,s,n1);
83 long double omx = powl(n2, 1.0/zeta );
84 long double s_r = s*( 1.-omx );
87 long double EnuinCM = (s_r-mlin*mlin)/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);
140 fPythia->settings.mode(
"Random:seed", rnd->
RndLep().Integer(100000000));
141 fPythia->settings.parm(
"Beams:eCM",sqrtl(s_r));
148 Pythia8::Event &fEvent = fPythia->event;
149 int np = fEvent.size();
152 for (
int i = 5; i < np; i++) {
154 int pdgc = fEvent[i].id();
157 int ks = fEvent[i].status();
159 LongLorentzVector p4longo(fEvent[i].px(), fEvent[i].py(), fEvent[i].pz(), fEvent[i].
e());
162 TLorentzVector p4o( (
double)p4longo.
Px(), (
double)p4longo.
Py(), (
double)p4longo.
Pz(), (
double)p4longo.
E() );
163 p4o.RotateUz(unit_nu);
166 if ( ks>0 && p4o.E()<massPDG ) {
167 LOG(
"GLRESGenerator",
pWARN) <<
"Putting at rest one stable particle generated by PYTHIA because E < m";
168 LOG(
"GLRESGenerator",
pWARN) <<
"PDG = " << pdgc <<
" // State = " << ks;
169 LOG(
"GLRESGenerator",
pWARN) <<
"E = " << p4o.E() <<
" // |p| = " << TMath::Sqrt(p4o.P());
170 LOG(
"GLRESGenerator",
pWARN) <<
"p = [ " << p4o.Px() <<
" , " << p4o.Py() <<
" , " << p4o.Pz() <<
" ]";
171 LOG(
"GLRESGenerator",
pWARN) <<
"m = " << p4o.M() <<
" // mpdg = " << massPDG;
172 p4o.SetXYZT(0,0,0,massPDG);
179 int firstmother = -1;
184 if ( fEvent[i].mother1() == 3 ) {
186 firstchild = fEvent[i].daughter1() - 1;
187 lastchild = fEvent[i].daughter2() - 1;
190 firstmother = fEvent[i].mother1() - 1;
191 firstchild = fEvent[i].daughter1() - 1;
192 lastchild = fEvent[i].daughter2() - 1;
195 double vx = nu->
X4()->X() + fEvent[i].xProd()*1e12;
196 double vy = nu->
X4()->Y() + fEvent[i].yProd()*1e12;
197 double vz = nu->
X4()->Z() + fEvent[i].zProd()*1e12;
199 TLorentzVector pos( vx, vy, vz, vt );
201 event->AddParticle(pdgc, ist, firstmother, lastmother, firstchild, lastchild, p4o, pos );
228#ifdef __GENIE_PYTHIA8_ENABLED__
241 fPythia->settings.parm(
"Diffraction:primKTwidth",
fGaussianPt2);
247 fPythia->settings.parm(
"StringZ:aLund",
fLunda);
248 fPythia->settings.parm(
"StringZ:bLund",
fLundb);
249 fPythia->settings.parm(
"StringZ:aExtraDiquark",
fLundaDiq);
269 RgKeyList::const_iterator kiter = klist.begin();
270 for( ; kiter != klist.end(); ++kiter) {
274 int pdg_code = atoi(kv[1].c_str());
276 LOG(
"GLRESGenerator",
pDEBUG) <<
"Configured to inhibit decays for " << pdg_code;
277 auto pdentry = fPythia->particleData.particleDataEntryPtr(pdg_code);
278 for (
int ichan=0; ichan<=pdentry->sizeChannels()-1; ++ichan) {
279 int onMode = pdentry->channel(ichan).onMode();
280 bool is_particle = (pdg_code>0);
285 onMode = (is_particle ? 3 : 2);
288 onMode = (is_particle ? 0 : 2);
291 onMode = (is_particle ? 3 : 0);
294 pdentry->channel(ichan).onMode(onMode);
307#ifdef __GENIE_PYTHIA8_ENABLED__
308 fPythia =
new Pythia8::Pythia();
310 fPythia->readString(
"Print:quiet = on");
311 fPythia->readString(
"Random:setSeed = on");
316 fPythia->readString(
"WeakSingleBoson:ffbar2ffbar(s:W) = on");
317 fPythia->readString(
"PDF:lepton = off");
318 fPythia->readString(
"24:onMode = off");
319 fPythia->readString(
"24:onIfAny = 1 2 3 4 5");
320 fPythia->readString(
"Beams:idA = -12");
321 fPythia->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.
double fDiQuarkSuppression
di-quark suppression parameter
double fLundaDiq
adjustment of Lund a for di-quark
double fLightVMesonSuppression
light vector meson suppression
double fRemainingECutoff
remaining E cutoff stopping fragmentation
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
void Configure(const Registry &config)
double fLundb
Lund b parameter.
double fLunda
Lund a parameter.
double fSVMesonSuppression
strange vector meson suppression
void Initialize(void) const
void ProcessEventRecord(GHepRecord *event) const
double fGaussianPt2
gaussian pt2 distribution width
double fSSBarSuppression
ssbar suppression
bool Wdecay(GHepRecord *event) const
Initial State information.
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)
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
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)
static const double kElectronMass
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