GENIEGenerator
Loading...
Searching...
No Matches
IBDHadronicSystemGenerator.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 Author: Corey Reed <cjreed \at nikhef.nl> - October 29, 2009
8 using code from the QELKinematicGenerator written by
9 Costas Andreopoulos <c.andreopoulos \at cern.ch>
10 University of Liverpool - October 03, 2004
11
12 For the class documentation see the corresponding header file.
13
14*/
15//____________________________________________________________________________
16
25
26using namespace genie;
27
28//___________________________________________________________________________
30HadronicSystemGenerator("genie::IBDHadronicSystemGenerator")
31{
32
33}
34//___________________________________________________________________________
36HadronicSystemGenerator("genie::IBDHadronicSystemGenerator", config)
37{
38
39}
40//___________________________________________________________________________
45//___________________________________________________________________________
47{
48// This method generates the final state hadronic system
49
50 // Add the recoil baryon
51 // (p or n)
52 // Its 4-momentum is computed by requiring the energy + momentum to be
53 // conserved.
54 this->AddRecoilBaryon(evrec);
55}
56//___________________________________________________________________________
58{
59 //-- Determine the pdg & status code of the recoil baryon
60 Interaction * interaction = evrec->Summary();
61 const int pdgc = interaction->RecoilNucleonPdg();
62 assert(pdgc!=0);
63
64 //-- Determine the status code
65 const Target & tgt = interaction->InitState().Tgt();
66 const GHepStatus_t ist = (tgt.IsNucleus()) ?
68
69 //-- Get the vtx position
70 const GHepParticle * neutrino = evrec->Probe();
71 const TLorentzVector & vtx = *(neutrino->X4());
72
73 //-- Get nucleon 4-momentum (in the LAB frame) & position
74 const TLorentzVector p4 = this->Hadronic4pLAB(evrec);
75
76 //-- Get mother position
77 const int mom = evrec->HitNucleonPosition();
78
79 //-- Add the final state recoil baryon at the EventRecord
80 LOG("IBD", pINFO)
81 << "Adding recoil baryon [pdgc = " << pdgc << "]";
82
83 GHepParticle p(pdgc, ist, mom,-1,-1,-1, p4, vtx);
84 const double w = evrec->Particle(mom)->RemovalEnergy();
86 evrec->AddParticle(p);
87}
88//___________________________________________________________________________
#define pINFO
Definition Messenger.h:62
#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.
void SetRemovalEnergy(double Erm)
double RemovalEnergy(void) const
Get removal energy.
const TLorentzVector * X4(void) const
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual GHepParticle * Probe(void) const
virtual Interaction * Summary(void) const
virtual void AddParticle(const GHepParticle &p)
virtual GHepParticle * Particle(int position) const
virtual int HitNucleonPosition(void) const
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
void ProcessEventRecord(GHepRecord *event_rec) const
void AddRecoilBaryon(GHepRecord *event_rec) const
const Target & Tgt(void) const
Summary information for an interaction.
Definition Interaction.h:56
int RecoilNucleonPdg(void) const
recoil nucleon pdg
const InitialState & InitState(void) const
Definition Interaction.h:69
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition Target.h:40
bool IsNucleus(void) const
Definition Target.cxx:272
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
@ kIStHadronInTheNucleus
Definition GHepStatus.h:37
@ kIStStableFinalState
Definition GHepStatus.h:30
enum genie::EGHepStatus GHepStatus_t