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

#include <INukeDeltaPropg.h>

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

Public Member Functions

 INukeDeltaPropg ()
 INukeDeltaPropg (string config)
 ~INukeDeltaPropg ()
void ProcessEventRecord (GHepRecord *event_rec) const
void Configure (const Registry &config)
void Configure (string config)
Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
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.

Private Member Functions

void LoadConfig (void)

Private Attributes

double fR0
 effective nuclear size param
double fNR
 param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear boundary"
double fHadStep
 step size for intranuclear hadron transport

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

Detailed Description

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n Oct 01, 2009
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 27 of file INukeDeltaPropg.h.

Constructor & Destructor Documentation

◆ INukeDeltaPropg() [1/2]

INukeDeltaPropg::INukeDeltaPropg ( )

Definition at line 36 of file INukeDeltaPropg.cxx.

36 :
37EventRecordVisitorI("genie::INukeDeltaPropg")
38{
39
40}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ INukeDeltaPropg() [2/2]

INukeDeltaPropg::INukeDeltaPropg ( string config)

Definition at line 42 of file INukeDeltaPropg.cxx.

42 :
43EventRecordVisitorI("genie::INukeDeltaPropg", config)
44{
45
46}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ ~INukeDeltaPropg()

INukeDeltaPropg::~INukeDeltaPropg ( )

Definition at line 48 of file INukeDeltaPropg.cxx.

49{
50
51}

Member Function Documentation

◆ Configure() [1/2]

void INukeDeltaPropg::Configure ( const Registry & config)
virtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 158 of file INukeDeltaPropg.cxx.

159{
160 Algorithm::Configure(config);
161 this->LoadConfig();
162}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

References genie::Algorithm::Configure(), and LoadConfig().

◆ Configure() [2/2]

void INukeDeltaPropg::Configure ( string config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 164 of file INukeDeltaPropg.cxx.

165{
166 Algorithm::Configure(config);
167 this->LoadConfig();
168}

References genie::Algorithm::Configure(), and LoadConfig().

◆ LoadConfig()

void INukeDeltaPropg::LoadConfig ( void )
private

Definition at line 170 of file INukeDeltaPropg.cxx.

171{
172
173 GetParam( "NUCL-R0", fR0 ) ; //fm
174 GetParam( "NUCL-NR", fNR ) ;
175 GetParam( "INUKE-HadStep", fHadStep ) ; //fm
176
177}
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fR0
effective nuclear size param
double fHadStep
step size for intranuclear hadron transport
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...

References fHadStep, fNR, fR0, and genie::Algorithm::GetParam().

Referenced by Configure(), and Configure().

◆ ProcessEventRecord()

void INukeDeltaPropg::ProcessEventRecord ( GHepRecord * event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 53 of file INukeDeltaPropg.cxx.

54{
55 // Check that we have an interaction with a nuclear target. If not skip...
56 GHepParticle * nucltgt = event->TargetNucleus();
57 if (!nucltgt) {
58 LOG("INukeDelta", pINFO)
59 << "No nuclear target. Skipping....";
60 return;
61 }
62
63 // mass number, nuclear radius, step size
64 int A = nucltgt->A();
65 double step_sz = fHadStep;
66 double nucl_radius = utils::nuclear::Radius(A,fR0);
67 nucl_radius *= fNR; // track the particle further out
68
69 RandomGen * rnd = RandomGen::Instance();
70
71 // Loop over GHEP rescatter handled particles
72 TObjArrayIter piter(event);
73 GHepParticle * p = 0;
74 int icurr = -1;
75
76 while( (p = (GHepParticle *) piter.Next()) )
77 {
78 icurr++;
79
80 // handle?
81 int pdgc = p->Pdg();
82 bool delta = (pdgc == kPdgP33m1232_DeltaPP);
83 if (!delta) return;
84 GHepStatus_t ist = p->Status();
85 bool in_nucleus = (ist == kIStHadronInTheNucleus);
86 if (!in_nucleus) return;
87
88 LOG("INukeDelta", pNOTICE)
89 << " >> Stepping a " << p->Name()
90 << " with kinetic E = " << p->KinE() << " GeV";
91
92 // Rescatter a clone, not the original particle
93 GHepParticle * sp = new GHepParticle(*p);
94
95 // Set clone's mom to be the hadron that was cloned
96 sp->SetFirstMother(icurr);
97
98 // Start stepping particle out of the nucleus
99 bool has_interacted = false;
100 bool has_decayed = false;
101 while (1) {
102
103 const TLorentzVector & p4 = *(sp->P4());
104 const TLorentzVector & x4 = *(sp->X4());
105
106 bool is_in = (x4.Vect().Mag() < nucl_radius + step_sz);
107 if (!is_in) break;
108
109 // step
110 utils::intranuke::StepParticle(sp, step_sz, nucl_radius);
111
112 // check whether it decayed at this step
113 double Ldec = 0.; // calculate
114 double ddec = -1. * Ldec * TMath::Log(rnd->RndFsi().Rndm());
115 has_decayed = (ddec < step_sz);
116 if(has_decayed) break;
117
118 // check whether it interacted at this step
119 double Lint = utils::intranuke::MeanFreePath_Delta(pdgc,x4,p4,A);
120 double dint = -1. * Lint * TMath::Log(rnd->RndFsi().Rndm());
121 has_interacted = (dint < step_sz);
122 if(has_interacted) break;
123
124 }//stepping
125
126 if(has_decayed) {
127 // the particle decays
128
129 }
130 else
131 if(has_interacted) {
132 // the particle interacts - simulate the hadronic interaction
133 LOG("INukeDelta", pINFO)
134 << "Particle has interacted at location: "
135 << sp->X4()->Vect().Mag() << " / nucl radius = " << nucl_radius;
136
137 //
138 // *** Temporary / Used in test mode only ***
139 // For now, just change the Delta++ to a proton to prevent the
140 // Delta++ decay later on.
141 // Causes energy and charge non-conservation
142 //
145 event->AddParticle(*sp);
146 }
147 else {
148 // the particle escapes the nucleus
149 LOG("Intranuke", pNOTICE)
150 << "*** Hadron escaped the nucleus! Done with it.";
152 event->AddParticle(*sp);
153 }//decay? interacts? escapes?
154
155 }//particle loop
156}
#define pNOTICE
Definition Messenger.h:61
#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
string Name(void) const
Name that corresponds to the PDG code.
int Pdg(void) const
void SetFirstMother(int m)
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
int A(void) const
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
GHepStatus_t Status(void) const
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition RandomGen.h:59
void StepParticle(GHepParticle *p, double step, double nuclear_radius=-1.)
Step particle.
double MeanFreePath_Delta(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A)
Mean free path (Delta++ test)
double Radius(int A, double Ro=constants::kNucRo)
@ kIStHadronInTheNucleus
Definition GHepStatus.h:37
@ kIStStableFinalState
Definition GHepStatus.h:30
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgP33m1232_DeltaPP
Definition PDGCodes.h:107
enum genie::EGHepStatus GHepStatus_t

References genie::GHepParticle::A(), fHadStep, fNR, fR0, genie::RandomGen::Instance(), genie::GHepParticle::KinE(), genie::kIStHadronInTheNucleus, genie::kIStStableFinalState, genie::kPdgP33m1232_DeltaPP, genie::kPdgProton, LOG, genie::utils::intranuke::MeanFreePath_Delta(), genie::GHepParticle::Name(), genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), pINFO, pNOTICE, genie::utils::nuclear::Radius(), genie::RandomGen::RndFsi(), genie::GHepParticle::SetFirstMother(), genie::GHepParticle::SetPdgCode(), genie::GHepParticle::SetStatus(), genie::GHepParticle::Status(), genie::utils::intranuke::StepParticle(), and genie::GHepParticle::X4().

Member Data Documentation

◆ fHadStep

double genie::INukeDeltaPropg::fHadStep
private

step size for intranuclear hadron transport

Definition at line 47 of file INukeDeltaPropg.h.

Referenced by LoadConfig(), and ProcessEventRecord().

◆ fNR

double genie::INukeDeltaPropg::fNR
private

param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear boundary"

Definition at line 46 of file INukeDeltaPropg.h.

Referenced by LoadConfig(), and ProcessEventRecord().

◆ fR0

double genie::INukeDeltaPropg::fR0
private

effective nuclear size param

Definition at line 45 of file INukeDeltaPropg.h.

Referenced by LoadConfig(), and ProcessEventRecord().


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