GENIEGenerator
Loading...
Searching...
No Matches
genie::HadronicSystemGenerator Class Reference

Abstract class. Is used to pass some commonly recurring methods to all concrete implementations of the EventRecordVisitorI interface generating the hadronic system for a specific processes (QEL,DIS, RES,...) More...

#include <HadronicSystemGenerator.h>

Inheritance diagram for genie::HadronicSystemGenerator:
[legend]
Collaboration diagram for genie::HadronicSystemGenerator:
[legend]

Public Member Functions

void AddTargetNucleusRemnant (GHepRecord *event_rec) const
void AddFinalHadronicSyst (GHepRecord *event_rec) const
void PreHadronTransportDecays (GHepRecord *event_rec) const
TLorentzVector Hadronic4pLAB (GHepRecord *event_rec) const
TLorentzVector MomentumTransferLAB (GHepRecord *event_rec) const
TVector3 HCM2LAB (GHepRecord *event_rec) const
int HadronShowerCharge (GHepRecord *event_rec) const
int ResonanceCharge (GHepRecord *event_rec) const
Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
virtual void ProcessEventRecord (GHepRecord *event_rec) const =0
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.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
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.

Protected Member Functions

 HadronicSystemGenerator ()
 HadronicSystemGenerator (string name)
 HadronicSystemGenerator (string name, string config)
 ~HadronicSystemGenerator ()
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.
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.
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.
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
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.

Protected Attributes

const EventRecordVisitorIfPreINukeDecayer
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

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)

Detailed Description

Abstract class. Is used to pass some commonly recurring methods to all concrete implementations of the EventRecordVisitorI interface generating the hadronic system for a specific processes (QEL,DIS, RES,...)

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

Definition at line 31 of file HadronicSystemGenerator.h.

Constructor & Destructor Documentation

◆ HadronicSystemGenerator() [1/3]

HadronicSystemGenerator::HadronicSystemGenerator ( )
protected

Definition at line 26 of file HadronicSystemGenerator.cxx.

References genie::EventRecordVisitorI::EventRecordVisitorI().

Referenced by genie::COHHadronicSystemGenerator::COHHadronicSystemGenerator(), genie::COHHadronicSystemGenerator::COHHadronicSystemGenerator(), genie::DFRHadronicSystemGenerator::DFRHadronicSystemGenerator(), genie::DFRHadronicSystemGenerator::DFRHadronicSystemGenerator(), genie::DISHadronicSystemGenerator::DISHadronicSystemGenerator(), genie::DISHadronicSystemGenerator::DISHadronicSystemGenerator(), genie::HEDISGenerator::HEDISGenerator(), genie::HEDISGenerator::HEDISGenerator(), genie::IBDHadronicSystemGenerator::IBDHadronicSystemGenerator(), genie::IBDHadronicSystemGenerator::IBDHadronicSystemGenerator(), genie::QELHadronicSystemGenerator::QELHadronicSystemGenerator(), genie::QELHadronicSystemGenerator::QELHadronicSystemGenerator(), genie::RESHadronicSystemGenerator::RESHadronicSystemGenerator(), genie::RESHadronicSystemGenerator::RESHadronicSystemGenerator(), genie::RSPPHadronicSystemGenerator::RSPPHadronicSystemGenerator(), genie::RSPPHadronicSystemGenerator::RSPPHadronicSystemGenerator(), genie::RSPPResonanceSelector::RSPPResonanceSelector(), genie::RSPPResonanceSelector::RSPPResonanceSelector(), genie::SKHadronicSystemGenerator::SKHadronicSystemGenerator(), and genie::SKHadronicSystemGenerator::SKHadronicSystemGenerator().

◆ HadronicSystemGenerator() [2/3]

HadronicSystemGenerator::HadronicSystemGenerator ( string name)
protected

Definition at line 32 of file HadronicSystemGenerator.cxx.

32 :
34{
35
36}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ HadronicSystemGenerator() [3/3]

HadronicSystemGenerator::HadronicSystemGenerator ( string name,
string config )
protected

Definition at line 38 of file HadronicSystemGenerator.cxx.

38 :
39EventRecordVisitorI(name, config)
40{
41
42}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ ~HadronicSystemGenerator()

HadronicSystemGenerator::~HadronicSystemGenerator ( )
protected

Definition at line 44 of file HadronicSystemGenerator.cxx.

45{
46
47}

Member Function Documentation

◆ AddFinalHadronicSyst()

void HadronicSystemGenerator::AddFinalHadronicSyst ( GHepRecord * event_rec) const

Definition at line 49 of file HadronicSystemGenerator.cxx.

50{
51// Adds a GHEP entry for the sum of the f/s hadronic system.
52// Intended for DIS hadronic system generators.
53
54 TLorentzVector p4 = this->Hadronic4pLAB(evrec);
55 LOG("HadronicVtx", pNOTICE) << "\n HadrSyst [LAB]: " << P4AsString(&p4);
56
57 TLorentzVector v4(0,0,0,0);
58 int mom = evrec->HitNucleonPosition();
59
60 evrec->AddParticle(
61 kPdgHadronicSyst, kIStDISPreFragmHadronicState, mom,-1,-1,-1, p4, v4);
62
63 // update the interaction summary
64 evrec->Summary()->KinePtr()->SetHadSystP4(p4);
65}
#define pNOTICE
Definition Messenger.h:61
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
string P4AsString(const TLorentzVector *p)
@ kIStDISPreFragmHadronicState
Definition GHepStatus.h:35
const int kPdgHadronicSyst
Definition PDGCodes.h:210

References genie::GHepRecord::AddParticle(), Hadronic4pLAB(), genie::GHepRecord::HitNucleonPosition(), genie::Interaction::KinePtr(), genie::kIStDISPreFragmHadronicState, genie::kPdgHadronicSyst, LOG, genie::utils::print::P4AsString(), pNOTICE, genie::Kinematics::SetHadSystP4(), and genie::GHepRecord::Summary().

Referenced by genie::DISHadronicSystemGenerator::ProcessEventRecord().

◆ AddTargetNucleusRemnant()

void HadronicSystemGenerator::AddTargetNucleusRemnant ( GHepRecord * event_rec) const

Definition at line 67 of file HadronicSystemGenerator.cxx.

69{
70// add the remnant nuclear target at the GHEP record
71
72 LOG("HadronicVtx", pDEBUG) << "Adding final state nucleus";
73
74 //-- skip for non nuclear targets
75 GHepParticle * nucleus = evrec->TargetNucleus();
76 if (!nucleus) {
77 LOG("HadronicVtx", pDEBUG)
78 << "Initial state not a nucleus - no remnant nucleus to add";
79 return;
80 }
81
82 //-- compute A,Z for final state nucleus & get its PDG code and its mass
83 GHepParticle * nucleon = evrec->HitNucleon();
84 assert(nucleon);
85 int npdgc = nucleon->Pdg();
86 bool is_p = pdg::IsProton(npdgc);
87 int A = nucleus->A();
88 int Z = nucleus->Z();
89 if (is_p) Z--;
90 A--;
91 TParticlePDG * particle = 0;
92 int ipdgc = pdg::IonPdgCode(A, Z);
93 particle = PDGLibrary::Instance()->Find(ipdgc);
94 if(!particle) {
95 LOG("HadronicVtx", pFATAL)
96 << "No particle with [A = " << A << ", Z = " << Z
97 << ", pdgc = " << ipdgc << "] in PDGLibrary!";
98 assert(particle);
99 }
100 double Mf = particle->Mass(); // remnant nucleus rest mass
101 double Mf2 = TMath::Power(Mf,2);
102
103 //-- Has opposite momentum from the struck nucleon
104 double px = -1.* nucleon->Px();
105 double py = -1.* nucleon->Py();
106 double pz = -1.* nucleon->Pz();
107 double E = TMath::Sqrt(Mf2 + nucleon->P4()->Vect().Mag2());
108
109 //-- Add the nucleus to the event record
110 LOG("HadronicVtx", pINFO)
111 << "Adding nucleus [A = " << A << ", Z = " << Z
112 << ", pdgc = " << ipdgc << "]";
113
114 int mom = evrec->TargetNucleusPosition();
115 evrec->AddParticle(
116 ipdgc,kIStStableFinalState, mom,-1,-1,-1, px,py,pz,E, 0,0,0,0);
117}
#define pINFO
Definition Messenger.h:62
#define pFATAL
Definition Messenger.h:56
#define pDEBUG
Definition Messenger.h:63
int Pdg(void) const
const TLorentzVector * P4(void) const
double Px(void) const
Get Px.
int Z(void) const
double Pz(void) const
Get Pz.
double Py(void) const
Get Py.
int A(void) const
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
int IonPdgCode(int A, int Z)
Definition PDGUtils.cxx:71
bool IsProton(int pdgc)
Definition PDGUtils.cxx:336
@ kIStStableFinalState
Definition GHepStatus.h:30

References genie::GHepParticle::A(), genie::GHepRecord::AddParticle(), genie::PDGLibrary::Find(), genie::GHepRecord::HitNucleon(), genie::PDGLibrary::Instance(), genie::pdg::IonPdgCode(), genie::pdg::IsProton(), genie::kIStStableFinalState, LOG, genie::GHepParticle::P4(), pDEBUG, genie::GHepParticle::Pdg(), pFATAL, pINFO, genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), and genie::GHepParticle::Z().

Referenced by genie::HEDISGenerator::ProcessEventRecord().

◆ Hadronic4pLAB()

TLorentzVector HadronicSystemGenerator::Hadronic4pLAB ( GHepRecord * event_rec) const

Definition at line 127 of file HadronicSystemGenerator.cxx.

129{
130// Returns the final state hadronic system 4-p in LAB
131
132 GHepParticle * nu = evrec->Probe(); // incoming v
133 GHepParticle * N = evrec->HitNucleon(); // struck nucleon
134 GHepParticle * l = evrec->FinalStatePrimaryLepton(); // f/s primary lepton
135
136 assert(nu);
137 assert(N);
138 assert(l);
139
140 LOG("HadronicVtx", pINFO)
141 << "\n v [LAB]: " << P4AsString( nu->P4() )
142 << "\n N [LAB]: " << P4AsString( N->P4() )
143 << "\n l [LAB]: " << P4AsString( l->P4() );
144
145 //-- Compute the Final State Hadronic System 4p (PX = Pv + PN - Pl)
146
147 const TLorentzVector & p4nu = *(nu->P4());
148 const TLorentzVector & p4N = *(N ->P4());
149 const TLorentzVector & p4l = *(l ->P4());
150
151 TLorentzVector pX4 = p4nu + p4N - p4l;
152
153 LOG("HadronicVtx", pINFO) << "\n HadrSyst [LAB]: " << P4AsString(&pX4);
154
155 return pX4;
156}

References genie::GHepRecord::FinalStatePrimaryLepton(), genie::GHepRecord::HitNucleon(), LOG, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), pINFO, and genie::GHepRecord::Probe().

Referenced by AddFinalHadronicSyst(), genie::IBDHadronicSystemGenerator::AddRecoilBaryon(), genie::QELHadronicSystemGenerator::AddRecoilBaryon(), genie::RESHadronicSystemGenerator::AddResonance(), genie::RSPPResonanceSelector::AddResonance(), HCM2LAB(), and genie::DISHadronicSystemGenerator::ProcessEventRecord().

◆ HadronShowerCharge()

int HadronicSystemGenerator::HadronShowerCharge ( GHepRecord * event_rec) const

Definition at line 193 of file HadronicSystemGenerator.cxx.

194{
195// Returns the hadron shower charge in units of +e
196// eg in v n -> l- X the hadron shower charge is +1
197
198 int hadronShowerCharge = 0;
199
200 Interaction * interaction = evrec->Summary();
201 const InitialState & init_state = interaction->InitState();
202
203 int hit_nucleon = init_state.Tgt().HitNucPdg();
204
205 assert( pdg::IsProton(hit_nucleon) || pdg::IsNeutron(hit_nucleon) );
206
207 double qfsl = interaction->FSPrimLepton()->Charge() / 3.;
208 double qp = interaction->InitState().Probe()->Charge() / 3.;
209 double qnuc = PDGLibrary::Instance()->Find(hit_nucleon)->Charge() / 3.;
210
211 // probe + nucleon - primary final state lepton
212 hadronShowerCharge = (int) (qp + qnuc - qfsl);
213
214 return hadronShowerCharge;
215}
const Target & Tgt(void) const
TParticlePDG * Probe(void) const
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
const InitialState & InitState(void) const
Definition Interaction.h:69
int HitNucPdg(void) const
Definition Target.cxx:304
bool IsNeutron(int pdgc)
Definition PDGUtils.cxx:341

References genie::PDGLibrary::Find(), genie::Interaction::FSPrimLepton(), genie::Target::HitNucPdg(), genie::Interaction::InitState(), genie::PDGLibrary::Instance(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::InitialState::Probe(), genie::GHepRecord::Summary(), and genie::InitialState::Tgt().

Referenced by ResonanceCharge().

◆ HCM2LAB()

TVector3 HadronicSystemGenerator::HCM2LAB ( GHepRecord * event_rec) const

Definition at line 177 of file HadronicSystemGenerator.cxx.

178{
179// Velocity for the Hadronic CM -> LAB active Lorentz transform
180
181 TLorentzVector pH = this->Hadronic4pLAB(evrec);
182
183 //-- Compute the velocity of the LAB frame in the Final State Hadronic
184 // CM Frame (PxH/EH, PyH/EH, PzH/EH)
185
186 TVector3 beta = pH.BoostVector();
187
188 LOG("HadronicVtx", pINFO) << "beta (HCM->LAB): " << Vec3AsString(&beta);
189
190 return beta;
191}
string Vec3AsString(const TVector3 *vec)

References Hadronic4pLAB(), LOG, pINFO, and genie::utils::print::Vec3AsString().

◆ MomentumTransferLAB()

TLorentzVector HadronicSystemGenerator::MomentumTransferLAB ( GHepRecord * event_rec) const

Definition at line 158 of file HadronicSystemGenerator.cxx.

160{
161 GHepParticle * nu = evrec->Probe(); // incoming v
162 GHepParticle * l = evrec->FinalStatePrimaryLepton(); // f/s primary lepton
163
164 assert(nu);
165 assert(l);
166
167 const TLorentzVector & p4nu = *(nu->P4());
168 const TLorentzVector & p4l = *(l ->P4());
169
170 TLorentzVector pq4 = p4nu - p4l; // q
171
172 LOG("HadronicVtx", pNOTICE)
173 << "\n Momentum Transfer [LAB]: " << P4AsString(&pq4);
174 return pq4;
175}

References genie::GHepRecord::FinalStatePrimaryLepton(), LOG, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), pNOTICE, and genie::GHepRecord::Probe().

◆ PreHadronTransportDecays()

void HadronicSystemGenerator::PreHadronTransportDecays ( GHepRecord * event_rec) const

Definition at line 119 of file HadronicSystemGenerator.cxx.

121{
122 if(fPreINukeDecayer) {
123 fPreINukeDecayer->ProcessEventRecord(evrec);
124 }
125}
const EventRecordVisitorI * fPreINukeDecayer

References fPreINukeDecayer.

Referenced by genie::DISHadronicSystemGenerator::SimulateFormationZone().

◆ ResonanceCharge()

int HadronicSystemGenerator::ResonanceCharge ( GHepRecord * event_rec) const

Member Data Documentation

◆ fPreINukeDecayer

const EventRecordVisitorI* genie::HadronicSystemGenerator::fPreINukeDecayer
protected

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