GENIEGenerator
Loading...
Searching...
No Matches
DMETargetRemnantGenerator.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
7 Costas Andreopoulos <c.andreopoulos \at cern.ch>
8 University of Liverpool
9
10 For the class documentation see the corresponding header file.
11
12 Important revisions after version 2.0.0 :
13 @ Feb 09, 2009 - CA
14 Moved into the DME package from its previous location (EVGModules package)
15 @ Feb 12, 2013 - CA (code from Rosen Matev)
16 Handle the IMD annihilation channel.
17
18*/
19//____________________________________________________________________________
20
29
30using namespace genie;
31
32//___________________________________________________________________________
34EventRecordVisitorI("genie::DMETargetRemnantGenerator")
35{
36
37}
38//___________________________________________________________________________
40EventRecordVisitorI("genie::DMETargetRemnantGenerator", config)
41{
42
43}
44//___________________________________________________________________________
49//___________________________________________________________________________
51{
52 this -> AddElectronNeutrino (evrec);
53 this -> AddTargetNucleusRemnant (evrec);
54}
55//___________________________________________________________________________
57{
58 //-- Get all initial & final state particles 4-momenta (in the LAB frame)
59
60 //incoming v:
61 GHepParticle * nu = evrec->Probe();
62
63 //struck particle
64 GHepParticle * el = evrec->HitElectron();
65
66 //final state primary lepton:
68
69 assert(nu);
70 assert(el);
71 assert(l);
72
73 //-- Force energy conservation
74 // Pv(Ev,pxv,pyv,pzv) + Pe(En,pxn,pyn,pzn) = Pfsl(El,pxl,pyl,pzl) + Px
75
76 const TLorentzVector & p4v = *(nu->P4());
77 const TLorentzVector & p4e = *(el->P4());
78 const TLorentzVector & p4l = *(l->P4());
79 const TLorentzVector & p4 = p4v + p4e - p4l;
80
81 //-- Vtx position
82 const TLorentzVector & vtx = *(nu->X4());
83
84 LOG("DMETargetRemnant", pINFO) << "Adding final state lepton from e- vtx";
85
86 const ProcessInfo & proc_info = evrec->Summary()->ProcInfo();
87 int mom = evrec->HitElectronPosition();
88 int pdgc = 0;
89 if (proc_info.IsDarkMatterElectronElastic()) pdgc = kPdgElectron;
90 assert(pdgc!=0);
91 evrec->AddParticle(
92 pdgc,kIStStableFinalState, mom,-1,-1,-1, p4, vtx);
93}
94//___________________________________________________________________________
96 GHepRecord * evrec) const
97{
98// add the remnant nuclear target at the GHEP record
99
100 LOG("DMETargetRemnant", pDEBUG) << "Adding final state nucleus";
101
102 //-- get A,Z for initial state nucleus
103 Interaction * interaction = evrec->Summary();
104 const InitialState & init_state = interaction->InitState();
105
106 bool is_nucleus = init_state.Tgt().IsNucleus();
107 if (!is_nucleus) {
108 LOG("DMETargetRemnant", pDEBUG)
109 << "Initial state not a nucleus - no remnant nucleus to add";
110 return;
111 }
112 int A = init_state.Tgt().A();
113 int Z = init_state.Tgt().Z();
114
115 int ipdgc = pdg::IonPdgCode(A, Z);
116 double mass = PDGLibrary::Instance()->Find(ipdgc)->Mass();
117
118 //-- Add the nucleus to the event record
119 LOG("DMETargetRemnant", pINFO)
120 << "Adding nucleus [A = " << A << ", Z = " << Z
121 << ", pdgc = " << ipdgc << "]";
122
123 int mom = evrec->TargetNucleusPosition();
124 evrec->AddParticle(
125 ipdgc,kIStStableFinalState, mom,-1,-1,-1, 0,0,0,mass, 0,0,0,0);
126}
127//___________________________________________________________________________
#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.
void ProcessEventRecord(GHepRecord *evrec) const
void AddTargetNucleusRemnant(GHepRecord *evrec) const
void AddElectronNeutrino(GHepRecord *evrec) const
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
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
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 IsDarkMatterElectronElastic(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 kPdgElectron
Definition PDGCodes.h:35