GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
genie::NuEPrimaryLeptonGenerator Class Reference

Generates the final state primary lepton in neutrino-electron events. Is a concrete implementation of the EventRecordVisitorI interface. More...

#include <NuEPrimaryLeptonGenerator.h>

Inheritance diagram for genie::NuEPrimaryLeptonGenerator:
Inheritance graph
[legend]
Collaboration diagram for genie::NuEPrimaryLeptonGenerator:
Collaboration graph
[legend]

Public Member Functions

 NuEPrimaryLeptonGenerator ()
 
 NuEPrimaryLeptonGenerator (string config)
 
 ~NuEPrimaryLeptonGenerator ()
 
void ProcessEventRecord (GHepRecord *event_rec) const
 
- Public Member Functions inherited from genie::PrimaryLeptonGenerator
virtual void SetPolarization (GHepRecord *ev) const
 
virtual TVector3 NucRestFrame2Lab (GHepRecord *ev) const
 
virtual void AddToEventRecord (GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
 
void Configure (const Registry &config)
 
void Configure (string config)
 
- Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void FindConfig (void)
 
virtual const RegistryGetConfig (void) const
 
RegistryGetOwnedConfig (void)
 
virtual const AlgIdId (void) const
 Get algorithm ID. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
virtual void SetId (string name, string config)
 
const AlgorithmSubAlg (const RgKey &registry_key) const
 
void AdoptConfig (void)
 
void AdoptSubstructure (void)
 
virtual void Print (ostream &stream) const
 Print algorithm info. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
 
static string BuildParamVectSizeKey (const std::string &comm_name)
 
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
 
static string BuildParamMatRowSizeKey (const std::string &comm_name)
 
static string BuildParamMatColSizeKey (const std::string &comm_name)
 
- Protected Member Functions inherited from genie::PrimaryLeptonGenerator
 PrimaryLeptonGenerator ()
 
 PrimaryLeptonGenerator (string name)
 
 PrimaryLeptonGenerator (string name, string config)
 
virtual ~PrimaryLeptonGenerator ()
 
void LoadConfig (void)
 
- Protected Member Functions inherited from genie::EventRecordVisitorI
 EventRecordVisitorI ()
 
 EventRecordVisitorI (string name)
 
 EventRecordVisitorI (string name, string config)
 
- Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 
 Algorithm (string name)
 
 Algorithm (string name, string config)
 
void Initialize (void)
 
void DeleteConfig (void)
 
void DeleteSubstructure (void)
 
RegistryExtractLocalConfig (const Registry &in) const
 
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key. More...
 
template<class T >
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
 
template<class T >
bool GetParamDef (const RgKey &name, T &p, const T &def) const
 
template<class T >
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters. More...
 
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
template<class T >
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters. More...
 
template<class T >
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
 
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- Protected Attributes inherited from genie::PrimaryLeptonGenerator
bool fApplyCoulombCorrection
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< bool > fOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

Generates the final state primary lepton in neutrino-electron events. Is a concrete implementation of the EventRecordVisitorI interface.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
July 13, 2005
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 26 of file NuEPrimaryLeptonGenerator.h.

Constructor & Destructor Documentation

NuEPrimaryLeptonGenerator::NuEPrimaryLeptonGenerator ( )

Definition at line 28 of file NuEPrimaryLeptonGenerator.cxx.

28  :
29 PrimaryLeptonGenerator("genie::NuEPrimaryLeptonGenerator")
30 {
31 
32 }
NuEPrimaryLeptonGenerator::NuEPrimaryLeptonGenerator ( string  config)

Definition at line 34 of file NuEPrimaryLeptonGenerator.cxx.

34  :
35 PrimaryLeptonGenerator("genie::NuEPrimaryLeptonGenerator", config)
36 {
37 
38 }
NuEPrimaryLeptonGenerator::~NuEPrimaryLeptonGenerator ( )

Definition at line 40 of file NuEPrimaryLeptonGenerator.cxx.

41 {
42 
43 }

Member Function Documentation

void NuEPrimaryLeptonGenerator::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Reimplemented from genie::PrimaryLeptonGenerator.

Definition at line 45 of file NuEPrimaryLeptonGenerator.cxx.

References genie::PrimaryLeptonGenerator::AddToEventRecord(), genie::Interaction::FSPrimLepton(), genie::Interaction::FSPrimLeptonPdg(), genie::Interaction::InitState(), genie::RandomGen::Instance(), genie::constants::kElectronMass, genie::Interaction::Kine(), genie::constants::kPi, genie::kRfLab, LOG, genie::GHepParticle::P4(), pINFO, pNOTICE, genie::GHepRecord::Probe(), genie::InitialState::ProbeE(), pWARN, genie::utils::kinematics::Q2(), genie::RandomGen::RndLep(), genie::PrimaryLeptonGenerator::SetPolarization(), genie::GHepRecord::Summary(), and genie::Kinematics::y().

46 {
47 // This method generates the final state primary lepton for NuE events
48 
49  Interaction * interaction = evrec->Summary();
50  const InitialState & init_state = interaction->InitState();
51 
52  // Get selected kinematics
53  double y = interaction->Kine().y(true);
54  assert(y>0 && y<1);
55 
56  // Final state primary lepton PDG code
57  int pdgc = interaction->FSPrimLeptonPdg();
58  assert(pdgc!=0);
59 
60  // Compute the neutrino and muon energy
61  double Ev = init_state.ProbeE(kRfLab);
62  double El = (1-y)*Ev;
63 
64  LOG("LeptonicVertex", pINFO)
65  << "Ev = " << Ev << ", y = " << y << ", -> El = " << El;
66 
67  // Compute the momentum transfer and scattering angle
68  double El2 = TMath::Power(El,2);
69  double me = kElectronMass;
70  double ml = interaction->FSPrimLepton()->Mass();
71  double ml2 = TMath::Power(ml,2);
72  double pl = TMath::Sqrt(El2-ml2);
73 
74  assert(El2>=ml2);
75 
76  double Q2 = 2*(Ev-El)*me + me*me;
77  double costh = (El-0.5*(Q2+ml2)/Ev)/pl;
78  double sinth = TMath::Sqrt( TMath::Max(0., 1-TMath::Power(costh,2.)) );
79 
80  LOG("LeptonicVertex", pNOTICE)
81  << "Q2 = " << Q2 << ", cos(theta) = " << costh;
82 
83  //warn about overflow in costheta and ignore it if it is small or abort
84  if( TMath::Abs(costh)>1 ) {
85  LOG("LeptonicVertex", pWARN)
86  << "El = " << El << ", Ev = " << Ev << ", cos(theta) = " << costh;
87  //if(TMath::Abs(costh)-1<0.3) costh = 1.0; //why?
88  }
89  assert(TMath::Abs(costh)<=1);
90 
91  // Compute the p components along and perpendicular the v direction
92  double plp = pl * costh; // p(//)
93  double plt = pl * sinth; // p(-|)
94 
95  LOG("LeptonicVertex", pNOTICE)
96  << "fsl: E = " << El << ", |p//| = " << plp << "[pT] = " << plt;
97 
98  // Randomize transverse components
100  double phi = 2*kPi * rnd->RndLep().Rndm();
101  double pltx = plt * TMath::Cos(phi);
102  double plty = plt * TMath::Sin(phi);
103 
104  // Take a unit vector along the neutrino direction
105  TVector3 unit_nudir = evrec->Probe()->P4()->Vect().Unit();
106 
107  // Rotate lepton momentum vector from the reference frame (x'y'z') where
108  // {z':(neutrino direction), z'x':(theta plane)} to the LAB
109  TVector3 p3l(pltx,plty,plp);
110  p3l.RotateUz(unit_nudir);
111 
112  // Lepton 4-momentum in the LAB
113  TLorentzVector p4l(p3l,El);
114 
115  // Create a GHepParticle and add it to the event record
116  this->AddToEventRecord(evrec, pdgc, p4l);
117 
118  // Set final state lepton polarization
119  this->SetPolarization(evrec);
120 }
TRandom3 & RndLep(void) const
rnd number generator used by final state primary lepton generators
Definition: RandomGen.h:62
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
static const double kElectronMass
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
int FSPrimLeptonPdg(void) const
final state primary lepton pdg
double y(bool selected=false) const
Definition: Kinematics.cxx:112
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
virtual void SetPolarization(GHepRecord *ev) const
const InitialState & InitState(void) const
Definition: Interaction.h:69
#define pNOTICE
Definition: Messenger.h:61
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
double ProbeE(RefFrame_t rf) const
Initial State information.
Definition: InitialState.h:48

The documentation for this class was generated from the following files: