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

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

#include <NuETargetRemnantGenerator.h>

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

Public Member Functions

 NuETargetRemnantGenerator ()
 
 NuETargetRemnantGenerator (string config)
 
 ~NuETargetRemnantGenerator ()
 
void ProcessEventRecord (GHepRecord *evrec) const
 
- Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void Configure (const Registry &config)
 
virtual void Configure (string config)
 
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...
 

Private Member Functions

void AddElectronNeutrino (GHepRecord *evrec) const
 
void AddTargetNucleusRemnant (GHepRecord *evrec) const
 

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::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::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 all the non-primary lepton final state particles in neutrino-electron events. Is a concrete implementation of the EventRecordVisitorI interface.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
July 17, 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 27 of file NuETargetRemnantGenerator.h.

Constructor & Destructor Documentation

NuETargetRemnantGenerator::NuETargetRemnantGenerator ( )

Definition at line 23 of file NuETargetRemnantGenerator.cxx.

23  :
24 EventRecordVisitorI("genie::NuETargetRemnantGenerator")
25 {
26 
27 }
NuETargetRemnantGenerator::NuETargetRemnantGenerator ( string  config)

Definition at line 29 of file NuETargetRemnantGenerator.cxx.

29  :
30 EventRecordVisitorI("genie::NuETargetRemnantGenerator", config)
31 {
32 
33 }
NuETargetRemnantGenerator::~NuETargetRemnantGenerator ( )

Definition at line 35 of file NuETargetRemnantGenerator.cxx.

36 {
37 
38 }

Member Function Documentation

void NuETargetRemnantGenerator::AddElectronNeutrino ( GHepRecord evrec) const
private

Definition at line 46 of file NuETargetRemnantGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::GHepRecord::HitElectron(), genie::GHepRecord::HitElectronPosition(), genie::Interaction::InitState(), genie::ProcessInfo::IsIMDAnnihilation(), genie::ProcessInfo::IsInverseMuDecay(), genie::ProcessInfo::IsNuElectronElastic(), genie::kIStStableFinalState, genie::kPdgAntiNuMu, genie::kPdgNuE, LOG, genie::GHepParticle::P4(), pINFO, genie::GHepRecord::Probe(), genie::InitialState::ProbePdg(), genie::Interaction::ProcInfo(), genie::GHepRecord::Summary(), and genie::GHepParticle::X4().

Referenced by ProcessEventRecord().

47 {
48  //-- Get all initial & final state particles 4-momenta (in the LAB frame)
49 
50  //incoming v:
51  GHepParticle * nu = evrec->Probe();
52 
53  //struck particle
54  GHepParticle * el = evrec->HitElectron();
55 
56  //final state primary lepton:
58 
59  assert(nu);
60  assert(el);
61  assert(l);
62 
63  //-- Force energy conservation
64  // Pv(Ev,pxv,pyv,pzv) + Pe(En,pxn,pyn,pzn) = Pfsl(El,pxl,pyl,pzl) + Px
65 
66  const TLorentzVector & p4v = *(nu->P4());
67  const TLorentzVector & p4e = *(el->P4());
68  const TLorentzVector & p4l = *(l->P4());
69  const TLorentzVector & p4 = p4v + p4e - p4l;
70 
71  //-- Vtx position
72  const TLorentzVector & vtx = *(nu->X4());
73 
74  LOG("NuETargetRemnant", pINFO) << "Adding final state lepton from e- vtx";
75 
76  const ProcessInfo & proc_info = evrec->Summary()->ProcInfo();
77  int mom = evrec->HitElectronPosition();
78  int pdgc = 0;
79  if (proc_info.IsNuElectronElastic()) pdgc = evrec->Summary()->InitState().ProbePdg();
80  else if (proc_info.IsInverseMuDecay()) pdgc = kPdgNuE;
81  else if (proc_info.IsIMDAnnihilation()) pdgc = kPdgAntiNuMu;
82  assert(pdgc!=0);
83  evrec->AddParticle(
84  pdgc,kIStStableFinalState, mom,-1,-1,-1, p4, vtx);
85 }
const int kPdgNuE
Definition: PDGCodes.h:28
virtual GHepParticle * HitElectron(void) const
Definition: GHepRecord.cxx:323
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
bool IsInverseMuDecay(void) const
bool IsIMDAnnihilation(void) const
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:284
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool IsNuElectronElastic(void) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:333
int ProbePdg(void) const
Definition: InitialState.h:64
#define pINFO
Definition: Messenger.h:62
virtual int HitElectronPosition(void) const
Definition: GHepRecord.cxx:441
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:499
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
void NuETargetRemnantGenerator::AddTargetNucleusRemnant ( GHepRecord evrec) const
private

Definition at line 87 of file NuETargetRemnantGenerator.cxx.

References genie::Target::A(), genie::units::A, genie::GHepRecord::AddParticle(), genie::PDGLibrary::Find(), genie::Interaction::InitState(), genie::PDGLibrary::Instance(), genie::pdg::IonPdgCode(), genie::Target::IsNucleus(), genie::kIStStableFinalState, LOG, pDEBUG, pINFO, genie::GHepRecord::Summary(), genie::GHepRecord::TargetNucleusPosition(), genie::InitialState::Tgt(), and genie::Target::Z().

Referenced by ProcessEventRecord().

89 {
90 // add the remnant nuclear target at the GHEP record
91 
92  LOG("NuETargetRemnant", pDEBUG) << "Adding final state nucleus";
93 
94  //-- get A,Z for initial state nucleus
95  Interaction * interaction = evrec->Summary();
96  const InitialState & init_state = interaction->InitState();
97 
98  bool is_nucleus = init_state.Tgt().IsNucleus();
99  if (!is_nucleus) {
100  LOG("NuETargetRemnant", pDEBUG)
101  << "Initial state not a nucleus - no remnant nucleus to add";
102  return;
103  }
104  int A = init_state.Tgt().A();
105  int Z = init_state.Tgt().Z();
106 
107  int ipdgc = pdg::IonPdgCode(A, Z);
108  double mass = PDGLibrary::Instance()->Find(ipdgc)->Mass();
109 
110  //-- Add the nucleus to the event record
111  LOG("NuETargetRemnant", pINFO)
112  << "Adding nucleus [A = " << A << ", Z = " << Z
113  << ", pdgc = " << ipdgc << "]";
114 
115  int mom = evrec->TargetNucleusPosition();
116  evrec->AddParticle(
117  ipdgc,kIStStableFinalState, mom,-1,-1,-1, 0,0,0,mass, 0,0,0,0);
118 }
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
int A(void) const
Definition: Target.h:70
bool IsNucleus(void) const
Definition: Target.cxx:272
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
static constexpr double A
Definition: Units.h:74
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:68
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:71
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:499
const InitialState & InitState(void) const
Definition: Interaction.h:69
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
const Target & Tgt(void) const
Definition: InitialState.h:66
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:370
Initial State information.
Definition: InitialState.h:48
#define pDEBUG
Definition: Messenger.h:63
void NuETargetRemnantGenerator::ProcessEventRecord ( GHepRecord evrec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 40 of file NuETargetRemnantGenerator.cxx.

References AddElectronNeutrino(), and AddTargetNucleusRemnant().

41 {
42  this -> AddElectronNeutrino (evrec);
43  this -> AddTargetNucleusRemnant (evrec);
44 }
void AddTargetNucleusRemnant(GHepRecord *evrec) const
void AddElectronNeutrino(GHepRecord *evrec) const

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