GENIEGenerator
Loading...
Searching...
No Matches
PrimaryLeptonUtils.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Steven Gardiner <gardiner \at fnal.gov>
7 Fermi National Accelerator Laboratory
8*/
9//____________________________________________________________________________
10
11#include "TVector3.h"
12
18
19using namespace genie;
20using namespace genie::utils;
21
22//___________________________________________________________________________
24{
25// Moved out of the PrimaryLeptonGenerator class to make the same treatment
26// accessible for generators that use a more unified approach (e.g.,
27// QELEventGenerator and MECGenerator). -- S. Gardiner
28
29// Set the final state lepton polarization. A mass-less lepton would be fully
30// polarized. This would be exact for neutrinos and a very good approximation
31// for electrons for the energies this generator is going to be used. This is
32// not the case for muons and, mainly, for taus. I need to refine this later.
33// How? See Kuzmin, Lyubushkin and Naumov, hep-ph/0312107
34
35 // get the final state primary lepton
37 if ( !fsl ) {
38 LOG("LeptonicVertex", pERROR)
39 << "Final state lepton not set yet! \n" << *ev;
40 return;
41 }
42
43 // Get (px,py,pz) @ LAB
44 TVector3 plab( fsl->Px(), fsl->Py(), fsl->Pz() );
45
46 // In the limit m/E->0: leptons are left-handed and their anti-particles
47 // are right-handed
48 int pdgc = fsl->Pdg();
49 if ( pdg::IsNeutrino(pdgc) || pdg::IsElectron(pdgc) ||
50 pdg::IsMuon(pdgc) || pdg::IsTau(pdgc) )
51 {
52 plab *= -1; // left-handed
53 }
54
55 LOG("LeptonicVertex", pINFO)
56 << "Setting polarization angles for particle: " << fsl->Name();
57
58 fsl->SetPolarization( plab );
59
60 if ( fsl->PolzIsSet() ) {
61 LOG("LeptonicVertex", pINFO)
62 << "Polarization (rad): Polar = " << fsl->PolzPolarAngle()
63 << ", Azimuthal = " << fsl->PolzAzimuthAngle();
64 }
65}
#define pINFO
Definition Messenger.h:62
#define pERROR
Definition Messenger.h:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
STDHEP-like event record entry that can fit a particle or a nucleus.
string Name(void) const
Name that corresponds to the PDG code.
int Pdg(void) const
double PolzAzimuthAngle(void) const
double PolzPolarAngle(void) const
double Px(void) const
Get Px.
double Pz(void) const
Get Pz.
double Py(void) const
Get Py.
void SetPolarization(double theta, double phi)
bool PolzIsSet(void) const
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual GHepParticle * FinalStatePrimaryLepton(void) const
bool IsTau(int pdgc)
Definition PDGUtils.cxx:208
bool IsNeutrino(int pdgc)
Definition PDGUtils.cxx:110
bool IsElectron(int pdgc)
Definition PDGUtils.cxx:188
bool IsMuon(int pdgc)
Definition PDGUtils.cxx:198
Root of GENIE utility namespaces.
void SetPrimaryLeptonPolarization(GHepRecord *ev)
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25