Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::INukeDeltaPropg Class Reference

#include <INukeDeltaPropg.h>

Inheritance diagram for genie::INukeDeltaPropg:
genie::EventRecordVisitorI genie::Algorithm

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

Private Member Functions

void LoadConfig (void)
 

Private Attributes

double fR0
 effective nuclear size param More...
 
double fNR
 param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear boundary" More...
 
double fHadStep
 step size for intranuclear hadron transport 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)
 
- 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
 
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 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< boolfOwnerships
 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...
 

Detailed Description

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

Oct 01, 2009

Copyright (c) 2003-2020, 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::INukeDeltaPropg ( )

Definition at line 36 of file INukeDeltaPropg.cxx.

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

Definition at line 42 of file INukeDeltaPropg.cxx.

42  :
43 EventRecordVisitorI("genie::INukeDeltaPropg", config)
44 {
45 
46 }
static Config * config
Definition: config.cpp:1054
INukeDeltaPropg::~INukeDeltaPropg ( )

Definition at line 48 of file INukeDeltaPropg.cxx.

49 {
50 
51 }

Member Function Documentation

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
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 {
167  this->LoadConfig();
168 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
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 }
double fR0
effective nuclear size param
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double fHadStep
step size for intranuclear hadron transport
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 
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  //
143  sp->SetPdgCode(kPdgProton);
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 }
const int kPdgP33m1232_DeltaPP
Definition: PDGCodes.h:107
void SetFirstMother(int m)
Definition: GHepParticle.h:132
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:59
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
double MeanFreePath_Delta(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A)
Mean free path (Delta++ test)
Definition: INukeUtils.cxx:170
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
GHepStatus_t Status(void) const
Definition: GHepParticle.h:64
int Pdg(void) const
Definition: GHepParticle.h:63
double Radius(int A, double Ro=constants::kNucRo)
string Name(void) const
Name that corresponds to the PDG code.
double fR0
effective nuclear size param
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
p
Definition: test.py:223
#define pINFO
Definition: Messenger.h:62
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
void StepParticle(GHepParticle *p, double step, double nuclear_radius=-1.)
Step particle.
Definition: INukeUtils.cxx:341
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:126
#define A
Definition: memgrp.cpp:38
const int kPdgProton
Definition: PDGCodes.h:81
int A(void) const
#define pNOTICE
Definition: Messenger.h:61
double fHadStep
step size for intranuclear hadron transport
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
Event finding and building.
enum genie::EGHepStatus GHepStatus_t
void SetPdgCode(int c)

Member Data Documentation

double genie::INukeDeltaPropg::fHadStep
private

step size for intranuclear hadron transport

Definition at line 47 of file INukeDeltaPropg.h.

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.

double genie::INukeDeltaPropg::fR0
private

effective nuclear size param

Definition at line 45 of file INukeDeltaPropg.h.


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