20 #include <TLorentzVector.h> 37 using namespace genie;
74 TLorentzVector * p4v = evrec->
Probe()->
GetP4();
78 double Q2 = interaction->
Kine().
Q2(
true);
79 double y = interaction->
Kine().
y(
true);
82 double ml2 = TMath::Power(ml,2);
85 <<
"Ev = " << Ev <<
", Q2 = " << Q2 <<
", y = " <<
y;
90 double plp = El - 0.5*(Q2+ml2)/Ev;
91 double plt =
TMath::Sqrt(TMath::Max(0.,El*El-plp*plp-ml2));
94 <<
"fsl: E = " << El <<
", |p//| = " << plp <<
", [pT] = " << plt;
98 double phi = 2*
kPi * rnd->
RndLep().Rndm();
99 double pltx = plt * TMath::Cos(phi);
100 double plty = plt * TMath::Sin(phi);
103 TVector3 unit_nudir = p4v->Vect().Unit();
107 TVector3 p3l(pltx,plty,plp);
108 p3l.RotateUz(unit_nudir);
111 TLorentzVector p4l(p3l,El);
142 const TLorentzVector & pnuc4 = init_state.
Tgt().
HitNucP4();
143 TVector3
beta = pnuc4.BoostVector();
149 GHepRecord * evrec,
int pdgc,
const TLorentzVector &
p4)
const 159 const TLorentzVector & vtx = *(mom->
X4());
161 TLorentzVector x4l(vtx);
162 TLorentzVector p4l(p4);
173 <<
"Correcting f/s lepton energy for Coulomb effects";
176 double Z = nucltgt->
Z();
177 double A = nucltgt->
A();
180 double Rc = (1.1*TMath::Power(A,1./3.) + 0.86*TMath::Power(A,-1./3.))/0.197;
183 double Vo = 3*
kAem*Z/(2*Rc);
186 double Elo = p4l.Energy();
187 double e = TMath::Min(Vo, Elo-m);
188 double El = TMath::Max(0., Elo-e);
191 <<
"Lepton energy subtraction: E = " << Elo <<
" --> " << El;
193 double pmag_old = p4l.P();
195 double scale = pmag_new / pmag_old;
197 <<
"|pnew| = " << pmag_new <<
", |pold| = " << pmag_old
198 <<
", scale = " <<
scale;
200 double pxl = scale * p4l.Px();
201 double pyl = scale * p4l.Py();
202 double pzl = scale * p4l.Pz();
204 p4l.SetPxPyPzE(pxl,pyl,pzl,El);
206 TLorentzVector p4c = p4 - p4l;
207 TLorentzVector x4dummy(0,0,0,0);;
231 <<
"Final state lepton not set yet! \n" << *ev;
236 TVector3 plab(fsl->
Px(), fsl->
Py(), fsl->
Pz());
240 int pdgc = fsl->
Pdg();
247 <<
"Setting polarization angles for particle: " << fsl->
Name();
bool IsNeutrino(int pdgc)
THE MAIN GENIE PROJECT NAMESPACE
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...
double PolzPolarAngle(void) const
bool IsInverseMuDecay(void) const
string P4AsString(const TLorentzVector *p)
virtual ~PrimaryLeptonGenerator()
bool IsIMDAnnihilation(void) const
void SetPolarization(double theta, double phi)
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double Pz(void) const
Get Pz.
double Px(void) const
Get Px.
virtual GHepParticle * Probe(void) const
double y(bool selected=false) const
string Name(void) const
Name that corresponds to the PDG code.
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
TLorentzVector * GetP4(void) const
virtual GHepParticle * FinalStatePrimaryLepton(void) const
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
virtual GHepParticle * TargetNucleus(void) const
virtual TVector3 NucRestFrame2Lab(GHepRecord *ev) const
bool PolzIsSet(void) const
void Configure(const Registry &config)
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
bool fApplyCoulombCorrection
virtual void SetPolarization(GHepRecord *ev) const
Var Sqrt(const Var &v)
Use to take sqrt of a var.
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
double PolzAzimuthAngle(void) const
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) 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)
Initial State information.
double Py(void) const
Get Py.