GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for genie::HadronicSystemGenerator:
Collaboration graph
[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. 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...
 

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. 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

const EventRecordVisitorIfPreINukeDecayer
 
- 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...
 

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 cern.ch> University of Liverpool
Created:
July 16, 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 31 of file HadronicSystemGenerator.h.

Constructor & Destructor Documentation

HadronicSystemGenerator::HadronicSystemGenerator ( )
protected

Definition at line 26 of file HadronicSystemGenerator.cxx.

26  :
28 {
29 
30 }
HadronicSystemGenerator::HadronicSystemGenerator ( string  name)
protected

Definition at line 32 of file HadronicSystemGenerator.cxx.

32  :
34 {
35 
36 }
const char * name
HadronicSystemGenerator::HadronicSystemGenerator ( string  name,
string  config 
)
protected

Definition at line 38 of file HadronicSystemGenerator.cxx.

38  :
40 {
41 
42 }
const char * name
HadronicSystemGenerator::~HadronicSystemGenerator ( )
protected

Definition at line 44 of file HadronicSystemGenerator.cxx.

45 {
46 
47 }

Member Function Documentation

void HadronicSystemGenerator::AddFinalHadronicSyst ( GHepRecord event_rec) const

Definition at line 49 of file HadronicSystemGenerator.cxx.

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().

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 }
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pNOTICE
Definition: Messenger.h:61
const int kPdgHadronicSyst
Definition: PDGCodes.h:210
void HadronicSystemGenerator::AddTargetNucleusRemnant ( GHepRecord event_rec) const

Definition at line 67 of file HadronicSystemGenerator.cxx.

References genie::units::A, 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().

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 }
int Z(void) const
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
#define pFATAL
Definition: Messenger.h:56
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
int Pdg(void) const
Definition: GHepParticle.h:63
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
#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
#define pINFO
Definition: Messenger.h:62
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:68
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:71
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
int A(void) const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
#define pDEBUG
Definition: Messenger.h:63
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
TLorentzVector HadronicSystemGenerator::Hadronic4pLAB ( GHepRecord event_rec) const

Definition at line 127 of file HadronicSystemGenerator.cxx.

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

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

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 }
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
int HadronicSystemGenerator::HadronShowerCharge ( GHepRecord event_rec) const

Definition at line 193 of file HadronicSystemGenerator.cxx.

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().

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 }
int HitNucPdg(void) const
Definition: Target.cxx:304
TParticlePDG * Probe(void) const
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:341
Summary information for an interaction.
Definition: Interaction.h:56
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:68
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
Initial State information.
Definition: InitialState.h:48
TVector3 HadronicSystemGenerator::HCM2LAB ( GHepRecord event_rec) const

Definition at line 177 of file HadronicSystemGenerator.cxx.

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

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 }
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:80
TLorentzVector HadronicSystemGenerator::MomentumTransferLAB ( GHepRecord event_rec) const

Definition at line 158 of file HadronicSystemGenerator.cxx.

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

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 }
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pNOTICE
Definition: Messenger.h:61
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
void HadronicSystemGenerator::PreHadronTransportDecays ( GHepRecord event_rec) const

Definition at line 119 of file HadronicSystemGenerator.cxx.

References fPreINukeDecayer, and genie::EventRecordVisitorI::ProcessEventRecord().

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

121 {
122  if(fPreINukeDecayer) {
124  }
125 }
const EventRecordVisitorI * fPreINukeDecayer
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
int HadronicSystemGenerator::ResonanceCharge ( GHepRecord event_rec) const

Member Data Documentation

const EventRecordVisitorI* genie::HadronicSystemGenerator::fPreINukeDecayer
protected

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