12 #include <TLorentzVector.h>
30 using namespace genie;
31 using namespace genie::constants;
67 TLorentzVector * p4v = evrec->
Probe()->
GetP4();
71 double Q2 = interaction->
Kine().
Q2(
true);
72 double y = interaction->
Kine().
y(
true);
75 double ml2 = TMath::Power(ml,2);
78 <<
"Ev = " << Ev <<
", Q2 = " << Q2 <<
", y = " << y;
83 double plp = El - 0.5*(Q2+ml2)/Ev;
84 double plt = TMath::Sqrt(TMath::Max(0.,El*El-plp*plp-ml2));
87 <<
"fsl: E = " << El <<
", |p//| = " << plp <<
", [pT] = " << plt;
91 double phi = 2*
kPi * rnd->
RndLep().Rndm();
92 double pltx = plt * TMath::Cos(phi);
93 double plty = plt * TMath::Sin(phi);
96 TVector3 unit_nudir = p4v->Vect().Unit();
100 TVector3 p3l(pltx,plty,plp);
101 p3l.RotateUz(unit_nudir);
104 TLorentzVector p4l(p3l,El);
135 const TLorentzVector & pnuc4 = init_state.
Tgt().
HitNucP4();
136 TVector3 beta = pnuc4.BoostVector();
142 GHepRecord * evrec,
int pdgc,
const TLorentzVector & p4)
const
152 const TLorentzVector & vtx = *(mom->
X4());
154 TLorentzVector x4l(vtx);
155 TLorentzVector p4l(p4);
166 <<
"Correcting f/s lepton energy for Coulomb effects";
169 double Z = nucltgt->
Z();
170 double A = nucltgt->
A();
173 double Rc = (1.1*TMath::Power(A,1./3.) + 0.86*TMath::Power(A,-1./3.))/0.197;
176 double Vo = 3*
kAem*Z/(2*Rc);
179 double Elo = p4l.Energy();
180 double e = TMath::Min(Vo, Elo-m);
181 double El = TMath::Max(0., Elo-e);
184 <<
"Lepton energy subtraction: E = " << Elo <<
" --> " << El;
186 double pmag_old = p4l.P();
188 double scale = pmag_new / pmag_old;
190 <<
"|pnew| = " << pmag_new <<
", |pold| = " << pmag_old
191 <<
", scale = " << scale;
193 double pxl = scale * p4l.Px();
194 double pyl = scale * p4l.Py();
195 double pzl = scale * p4l.Pz();
197 p4l.SetPxPyPzE(pxl,pyl,pzl,El);
199 TLorentzVector p4c = p4 - p4l;
200 TLorentzVector x4dummy(0,0,0,0);;
TRandom3 & RndLep(void) const
rnd number generator used by final state primary lepton generators
double Q2(const Interaction *const i)
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
Kinematics * KinePtr(void) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
bool IsInverseMuDecay(void) const
string P4AsString(const TLorentzVector *p)
virtual ~PrimaryLeptonGenerator()
bool IsIMDAnnihilation(void) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
virtual GHepParticle * Probe(void) const
double y(bool selected=false) const
Summary information for an interaction.
const TLorentzVector & HitNucP4(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void SetFSLeptonP4(const TLorentzVector &p4)
bool IsNuElectronElastic(void) const
virtual void ProcessEventRecord(GHepRecord *evrec) const
static constexpr double A
TLorentzVector * GetP4(void) const
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
virtual GHepParticle * TargetNucleus(void) const
virtual TVector3 NucRestFrame2Lab(GHepRecord *ev) const
void Configure(const Registry &config)
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
bool fApplyCoulombCorrection
virtual void SetPolarization(GHepRecord *ev) const
const TLorentzVector * X4(void) const
A registry. Provides the container for algorithm configuration parameters.
virtual void AddParticle(const GHepParticle &p)
const InitialState & InitState(void) const
const ProcessInfo & ProcInfo(void) const
double NonNegative(double x)
double Q2(bool selected=false) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const Target & Tgt(void) const
virtual int ProbePosition(void) const
void SetPrimaryLeptonPolarization(GHepRecord *ev)
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
GENIE's GHEP MC event record.
static constexpr double m
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.
Initial State information.