GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PrimaryLeptonUtils.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, 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 
19 using namespace genie;
20 using 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 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:110
#define pERROR
Definition: Messenger.h:59
double PolzPolarAngle(void) const
Definition: GHepParticle.h:119
void SetPolarization(double theta, double phi)
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
int Pdg(void) const
Definition: GHepParticle.h:63
string Name(void) const
Name that corresponds to the PDG code.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:333
bool IsTau(int pdgc)
Definition: PDGUtils.cxx:208
#define pINFO
Definition: Messenger.h:62
bool IsMuon(int pdgc)
Definition: PDGUtils.cxx:198
bool PolzIsSet(void) const
double PolzAzimuthAngle(void) const
Definition: GHepParticle.h:120
void SetPrimaryLeptonPolarization(GHepRecord *ev)
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
bool IsElectron(int pdgc)
Definition: PDGUtils.cxx:188
double Py(void) const
Get Py.
Definition: GHepParticle.h:89