14 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,6)
15 #include <TMCParticle.h>
17 #include <TMCParticle6.h>
19 #include <TClonesArray.h>
37 using namespace genie;
38 using namespace genie::constants;
39 using namespace genie::utils::math;
81 TVector3 unit_nu = nu->
P4()->Vect().Unit();
83 int probepdg = init_state.
ProbePdg();
89 long double s =
born->
GetS(Mtarget,Enuin);
94 long double costhCM = n1;
95 long double sinthCM = sqrtl(1-costhCM*costhCM);
97 long double xmin =
fQ2PDFmin/2./Enuin/Mtarget;
98 long double x = expl( logl(xmin) + (logl(1.0)-logl(xmin))*n2 );
99 long double s_r = s*x;
102 long double EnuinCM = sqrtl(s_r)/2.;
103 long double beta = (powl(Enuin,2)-powl(EnuinCM,2))/(powl(Enuin,2)+powl(EnuinCM,2));
111 long double ElpoutCM = (s_r+mlout*mlout)/sqrtl(s_r)/2.;
112 long double EnuoutCM = (s_r-mlout*mlout)/sqrtl(s_r)/2.;
114 LongLorentzVector p4_nuout( 0., -EnuoutCM*sinthCM, -EnuoutCM*costhCM, EnuoutCM );
119 TLorentzVector p4lp_o( (
double)p4_lpout.
Px(), (double)p4_lpout.
Py(), (double)p4_lpout.
Pz(), (double)p4_lpout.
E() );
120 TLorentzVector p4nu_o( (
double)p4_nuout.
Px(), (double)p4_nuout.
Py(), (double)p4_nuout.
Pz(), (double)p4_nuout.
E() );
124 double phi = 2*
kPi * rnd->RndLep().Rndm();
129 p4lp_o.RotateUz(unit_nu);
130 p4nu_o.RotateUz(unit_nu);
152 strcpy(p6frame,
"CMS" );
154 char p6nu[10], p6tgt[10];
158 int def61 =
fPythia->GetMSTP(61);
159 int def71 =
fPythia->GetMSTP(71);
160 int def206 =
fPythia->GetMDME(206,1);
161 int def207 =
fPythia->GetMDME(207,1);
162 int def208 =
fPythia->GetMDME(208,1);
169 fPythia->Pyinit(p6frame, p6nu, p6tgt, sqrtl(s_r));
174 fPythia->SetMDME(206,1,def206);
175 fPythia->SetMDME(207,1,def207);
176 fPythia->SetMDME(208,1,def208);
180 TClonesArray * pythia_particles = (TClonesArray *)
fPythia->ImportParticles(
"All");
181 int np = pythia_particles->GetEntries();
184 TMCParticle * particle = 0;
185 TIter piter(pythia_particles);
186 while( (particle = (TMCParticle *) piter.Next()) ) {
188 int pdgc = particle->GetKF();
189 int ks = particle->GetKS();
191 if ( ks==21 ) {
continue; }
193 LongLorentzVector p4longo(particle->GetPx(), particle->GetPy(), particle->GetPz(), particle->GetEnergy());
196 TLorentzVector p4o( (
double)p4longo.Px(), (double)p4longo.Py(), (double)p4longo.Pz(), (double)p4longo.E() );
197 p4o.RotateUz(unit_nu);
200 if ( (ks==1 || ks==4) && p4o.E() < part->Mass() ) {
201 LOG(
"PhotonRESGenerator",
pWARN) <<
"Putting at rest one stable particle generated by PYTHIA because E < m";
202 LOG(
"PhotonRESGenerator",
pWARN) <<
"PDG = " << pdgc <<
" // State = " << ks;
203 LOG(
"PhotonRESGenerator",
pWARN) <<
"E = " << p4o.E() <<
" // |p| = " << TMath::Sqrt(p4o.P());
204 LOG(
"PhotonRESGenerator",
pWARN) <<
"p = [ " << p4o.Px() <<
" , " << p4o.Py() <<
" , " << p4o.Pz() <<
" ]";
205 LOG(
"PhotonRESGenerator",
pWARN) <<
"m = " << p4o.M() <<
" // mpdg = " << part->Mass();
206 p4o.SetXYZT(0,0,0,part->Mass());
213 int firstmother = -1;
218 if ( particle->GetParent() < 10 ) {
219 if ( TMath::Abs(pdgc)<7 ) {
221 firstchild = particle->GetFirstChild() - 6;
222 lastchild = particle->GetLastChild() - 6;
224 else if ( TMath::Abs(pdgc)==24 ) {
226 firstchild = particle->GetFirstChild() - 6;
227 lastchild = particle->GetLastChild() - 6;
229 else if ( pdgc==22 ) {
234 firstmother = particle->GetParent() - 6;
235 firstchild = (particle->GetFirstChild()==0) ? particle->GetFirstChild() - 1 : particle->GetFirstChild() - 6;
236 lastchild = (particle->GetLastChild()==0) ? particle->GetLastChild() - 1 : particle->GetLastChild() - 6;
239 double lightspeed = 299792458e3;
240 double vx = nu->
X4()->X() + particle->GetVx()*1e12;
241 double vy = nu->
X4()->Y() + particle->GetVy()*1e12;
242 double vz = nu->
X4()->Z() + particle->GetVz()*1e12;
243 double vt = nu->
X4()->T() + particle->GetTime()/lightspeed;
244 TLorentzVector pos( vx, vy, vz, vt );
246 evrec->
AddParticle(pdgc, ist, firstmother, lastmother, firstchild, lastchild, p4o, pos );
251 pythia_particles->Clear(
"C");
273 double wmin;
GetParam(
"Xsec-Wmin", wmin ) ;
274 int warnings;
GetParam(
"Warnings", warnings ) ;
275 int errors;
GetParam(
"Errors", errors ) ;
276 int qrk_mass;
GetParam(
"QuarkMass", qrk_mass ) ;
278 fPythia->SetMSTU(26, warnings);
280 fPythia->SetMSTJ(93, qrk_mass);
bool IsNeutrino(int pdgc)
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
const TLorentzVector * P4(void) const
Kinematics * KinePtr(void) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
void Initialize(void) const
double HitNucMass(void) const
static constexpr double s
A singleton holding random number generator classes. All random number generation in GENIE should tak...
int FSPrimLeptonPdg(void) const
final state primary lepton pdg
virtual GHepParticle * Probe(void) const
Summary information for an interaction.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void SetFSLeptonP4(const TLorentzVector &p4)
TPythia6 * fPythia
PYTHIA6 wrapper class.
bool IsAntiNeutrino(int pdgc)
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
bool IsAntiMuon(int pdgc)
void Configure(const Registry &config)
double GetKV(KineVar_t kv) const
bool IsPositron(int pdgc)
double GetS(double mlin, double Enuin)
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
Born level nu-electron cross section.
static PDGLibrary * Instance(void)
void BoostZ(long double bz)
const TLorentzVector * X4(void) const
A registry. Provides the container for algorithm configuration parameters.
virtual GHepParticle * HitNucleon(void) const
virtual void AddParticle(const GHepParticle &p)
const InitialState & InitState(void) const
TParticlePDG * Find(int pdgc, bool must_exist=true)
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
double ProbeE(RefFrame_t rf) 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.
bool IsElectron(int pdgc)
enum genie::EGHepStatus GHepStatus_t
void ProcessEventRecord(GHepRecord *evrec) const
Initial State information.