GENIEGenerator
Loading...
Searching...
No Matches
NuETargetRemnantGenerator.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 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
19
20using namespace genie;
21
22//___________________________________________________________________________
24EventRecordVisitorI("genie::NuETargetRemnantGenerator")
25{
26
27}
28//___________________________________________________________________________
30EventRecordVisitorI("genie::NuETargetRemnantGenerator", config)
31{
32
33}
34//___________________________________________________________________________
39//___________________________________________________________________________
41{
42 this -> AddElectronNeutrino (evrec);
43 this -> AddTargetNucleusRemnant (evrec);
44}
45//___________________________________________________________________________
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}
86//___________________________________________________________________________
88 GHepRecord * evrec) const
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}
119//___________________________________________________________________________
#define pINFO
Definition Messenger.h:62
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
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.
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual GHepParticle * Probe(void) const
virtual int HitElectronPosition(void) const
virtual GHepParticle * HitElectron(void) const
virtual Interaction * Summary(void) const
virtual void AddParticle(const GHepParticle &p)
virtual int TargetNucleusPosition(void) const
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Initial State information.
const Target & Tgt(void) const
int ProbePdg(void) const
Summary information for an interaction.
Definition Interaction.h:56
const ProcessInfo & ProcInfo(void) const
Definition Interaction.h:70
const InitialState & InitState(void) const
Definition Interaction.h:69
void AddElectronNeutrino(GHepRecord *evrec) const
void AddTargetNucleusRemnant(GHepRecord *evrec) const
void ProcessEventRecord(GHepRecord *evrec) const
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition ProcessInfo.h:46
bool IsNuElectronElastic(void) const
bool IsInverseMuDecay(void) const
bool IsIMDAnnihilation(void) const
int Z(void) const
Definition Target.h:68
int A(void) const
Definition Target.h:70
bool IsNucleus(void) const
Definition Target.cxx:272
int IonPdgCode(int A, int Z)
Definition PDGUtils.cxx:71
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
@ kIStStableFinalState
Definition GHepStatus.h:30
const int kPdgNuE
Definition PDGCodes.h:28
const int kPdgAntiNuMu
Definition PDGCodes.h:31