GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
genie::Intranuke2018 Class Referenceabstract

#include <Intranuke2018.h>

Inheritance diagram for genie::Intranuke2018:
Inheritance graph
[legend]
Collaboration diagram for genie::Intranuke2018:
Collaboration graph
[legend]

Public Member Functions

 Intranuke2018 ()
 
 Intranuke2018 (string name)
 
 Intranuke2018 (string name, string config)
 
 ~Intranuke2018 ()
 
virtual void ProcessEventRecord (GHepRecord *event_rec) const
 
virtual void Configure (const Registry &config)
 
virtual void Configure (string param_set)
 
virtual string GetINukeMode () const
 
virtual string GetGenINukeMode () const
 
void SetRemnA (int A)
 
void SetRemnZ (int Z)
 
double GetRemnA () const
 
double GetRemnZ () const
 
double GetR0 () const
 
double GetNR () const
 
double GetDelRPion () const
 
double GetDelRNucleon () const
 
double GetNucRmvE () const
 
double GetHadStep () const
 
bool GetUseOset () const
 
bool GetAltOset () const
 
bool GetXsecNNCorr () const
 
- 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...
 

Protected Member Functions

virtual void LoadConfig (void)=0
 
void TransportHadrons (GHepRecord *ev) const
 
void GenerateVertex (GHepRecord *ev) const
 
bool NeedsRescattering (const GHepParticle *p) const
 
bool CanRescatter (const GHepParticle *p) const
 
bool IsInNucleus (const GHepParticle *p) const
 
void SetTrackingRadius (const GHepParticle *p) const
 
double GenerateStep (GHepRecord *ev, GHepParticle *p) const
 
virtual void SimulateHadronicFinalState (GHepRecord *ev, GHepParticle *p) const =0
 
virtual int HandleCompoundNucleus (GHepRecord *ev, GHepParticle *p, int mom) const =0
 
- 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

double fTrackingRadius
 tracking radius for the nucleus in the current event More...
 
TGenPhaseSpace fGenPhaseSpace
 a phase space generator More...
 
INukeHadroData2018fHadroData2018
 a collection of h+N,h+A data & calculations More...
 
AlgFactoryfAlgf
 algorithm factory instance More...
 
const NuclearModelIfNuclmodel
 nuclear model used to generate fermi momentum More...
 
int fRemnA
 remnant nucleus A More...
 
int fRemnZ
 remnant nucleus Z More...
 
TLorentzVector fRemnP4
 P4 of remnant system. More...
 
GEvGenMode_t fGMode
 event generation mode (lepton+A, hadron+A, ...) More...
 
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 fNucRmvE
 binding energy to subtract from cascade nucleons More...
 
double fDelRPion
 factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement More...
 
double fDelRNucleon
 factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement More...
 
double fHadStep
 step size for intranuclear hadron transport More...
 
double fNucAbsFac
 absorption xsec correction factor (hN Mode) More...
 
double fNucCEXFac
 charge exchange xsec correction factor (hN Mode) More...
 
double fEPreEq
 threshold for pre-equilibrium reaction More...
 
double fFermiFac
 testing parameter to modify fermi momentum More...
 
double fFermiMomentum
 whether or not particle collision is pauli blocked More...
 
bool fDoFermi
 whether or not to do fermi mom. More...
 
bool fDoMassDiff
 whether or not to do mass diff. mode More...
 
bool fDoCompoundNucleus
 whether or not to do compound nucleus considerations More...
 
bool fUseOset
 Oset model for low energy pion in hN. More...
 
bool fAltOset
 NuWro's table-based implementation (not recommended) More...
 
bool fXsecNNCorr
 use nuclear medium correction for NN cross section More...
 
double fChPionMFPScale
 tweaking factors for tuning More...
 
double fNeutralPionMFPScale
 
double fPionFracCExScale
 
double fPionFracInelScale
 
double fChPionFracAbsScale
 
double fNeutralPionFracAbsScale
 
double fPionFracPiProdScale
 
double fNucleonMFPScale
 
double fNucleonFracCExScale
 
double fNucleonFracInelScale
 
double fNucleonFracAbsScale
 
double fNucleonFracPiProdScale
 
- 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...
 

Friends

class IntranukeTester
 

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

Definition at line 54 of file Intranuke2018.h.

Constructor & Destructor Documentation

Intranuke2018::Intranuke2018 ( )

Definition at line 96 of file Intranuke2018.cxx.

96  :
98 {
99 
100 }
Intranuke2018::Intranuke2018 ( string  name)

Definition at line 102 of file Intranuke2018.cxx.

102  :
104 {
105 
106 }
const char * name
Intranuke2018::Intranuke2018 ( string  name,
string  config 
)

Definition at line 108 of file Intranuke2018.cxx.

108  :
109 EventRecordVisitorI(name, config)
110 {
111 
112 }
const char * name
Intranuke2018::~Intranuke2018 ( )

Definition at line 114 of file Intranuke2018.cxx.

115 {
116 
117 }

Member Function Documentation

bool Intranuke2018::CanRescatter ( const GHepParticle p) const
protected

Definition at line 236 of file Intranuke2018.cxx.

References genie::kPdgKP, genie::kPdgNeutron, genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, genie::kPdgProton, and genie::GHepParticle::Pdg().

Referenced by TransportHadrons().

237 {
238 // checks whether a particle that needs to be rescattered, can in fact be
239 // rescattered by this cascade MC
240 
241  assert(p);
242  return ( p->Pdg() == kPdgPiP ||
243  p->Pdg() == kPdgPiM ||
244  p->Pdg() == kPdgPi0 ||
245  p->Pdg() == kPdgProton ||
246  p->Pdg() == kPdgNeutron ||
247  // p->Pdg() == kPdgGamma ||
248  p->Pdg() == kPdgKP //||
249  // p->Pdg() == kPdgKM
250  );
251 }
int Pdg(void) const
Definition: GHepParticle.h:63
const int kPdgKP
Definition: PDGCodes.h:172
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
const int kPdgPiM
Definition: PDGCodes.h:159
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
void Intranuke2018::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 432 of file Intranuke2018.cxx.

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

433 {
434  Algorithm::Configure(config);
435  this->LoadConfig();
436 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
virtual void LoadConfig(void)=0
void Intranuke2018::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 438 of file Intranuke2018.cxx.

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

439 {
440  Algorithm::Configure(param_set);
441  this->LoadConfig();
442 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
virtual void LoadConfig(void)=0
double Intranuke2018::GenerateStep ( GHepRecord ev,
GHepParticle p 
) const
protected

Definition at line 393 of file Intranuke2018.cxx.

References genie::RandomGen::Instance(), genie::kPdgNeutron, genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, genie::kPdgProton, LOG, genie::utils::intranuke2018::MeanFreePath(), pDEBUG, and genie::RandomGen::RndFsi().

Referenced by TransportHadrons().

394 {
395 // Generate a step (in fermis) for particle p in the input event.
396 // Computes the mean free path L and generate an 'interaction' distance d
397 // from an exp(-d/L) distribution
398 
399  int pdgc = p->Pdg();
400 
401  double scale = 1.;
402  if (pdgc==kPdgPiP || pdgc==kPdgPiM) {
403  scale = fChPionMFPScale;
404  }
405  if (pdgc==kPdgPi0) {
406  scale = fNeutralPionMFPScale;
407  }
408  else if (pdgc==kPdgProton || pdgc==kPdgNeutron) {
409  scale = fNucleonMFPScale;
410  }
411 
412  RandomGen * rnd = RandomGen::Instance();
413 
414  string fINukeMode = this->GetINukeMode();
415  string fINukeModeGen = this->GetGenINukeMode();
416 
417  double L = utils::intranuke2018::MeanFreePath(p->Pdg(), *p->X4(), *p->P4(), fRemnA,
419 
420  LOG("Intranuke2018", pDEBUG) << "mode= " << fINukeModeGen;
421  L *= scale;
422 
423  double d = -1.*L * TMath::Log(rnd->RndFsi().Rndm());
424 
425  /* LOG("Intranuke2018", pDEBUG)
426  << "mode= " << fINukeMode << "; Mean free path = " << L << " fm / "
427  << "Generated path length = " << d << " fm";
428  */
429  return d;
430 }
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 fDelRPion
factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement ...
virtual string GetINukeMode() const
Definition: Intranuke2018.h:72
int fRemnA
remnant nucleus A
double fChPionMFPScale
tweaking factors for tuning
bool fXsecNNCorr
use nuclear medium correction for NN cross section
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
int Pdg(void) const
Definition: GHepParticle.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
double MeanFreePath(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A, double Z, double nRpi=0.5, double nRnuc=1.0, const bool useOset=false, const bool altOset=false, const bool xsecNNCorr=false, string INukeMode="XX2018")
Mean free path (pions, nucleons)
virtual string GetGenINukeMode() const
Definition: Intranuke2018.h:73
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
bool fAltOset
NuWro&#39;s table-based implementation (not recommended)
double fDelRNucleon
factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement ...
const int kPdgPiM
Definition: PDGCodes.h:159
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
bool fUseOset
Oset model for low energy pion in hN.
int fRemnZ
remnant nucleus Z
#define pDEBUG
Definition: Messenger.h:63
void Intranuke2018::GenerateVertex ( GHepRecord ev) const
protected

Definition at line 156 of file Intranuke2018.cxx.

References epsilon, fTrackingRadius, genie::RandomGen::Instance(), genie::pdg::IsIon(), genie::pdg::IsPseudoParticle(), LOG, genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), pNOTICE, genie::GHepRecord::Probe(), genie::RandomGen::RndFsi(), genie::GHepParticle::SetPosition(), genie::GHepRecord::TargetNucleus(), and genie::utils::print::Vec3AsString().

Referenced by ProcessEventRecord().

157 {
158 // Sets a vertex in the nucleus periphery
159 // Called onlt in hadron/photon-nucleus interactions.
160 
161  GHepParticle * nucltgt = evrec->TargetNucleus();
162  assert(nucltgt);
163 
164  RandomGen * rnd = RandomGen::Instance();
165  TVector3 vtx(999999.,999999.,999999.);
166 
167  // *** For h+A events (test mode):
168  // Assume a hadron beam with uniform intensity across an area,
169  // so we need to choose events uniformly within that area.
170  double x=999999., y=999999., epsilon = 0.001;
171  double R2 = TMath::Power(fTrackingRadius,2.);
172  double rp2 = TMath::Power(x,2.) + TMath::Power(y,2.);
173  while(rp2 > R2-epsilon) {
174  x = (fTrackingRadius-epsilon) * rnd->RndFsi().Rndm();
175  y = -fTrackingRadius + 2*fTrackingRadius * rnd->RndFsi().Rndm();
176  y -= ((y>0) ? epsilon : -epsilon);
177  rp2 = TMath::Power(x,2.) + TMath::Power(y,2.);
178  }
179  vtx.SetXYZ(x,y, -1.*TMath::Sqrt(TMath::Max(0.,R2-rp2)) + epsilon);
180 
181  // get the actual unit vector along the incoming hadron direction
182  TVector3 direction = evrec->Probe()->P4()->Vect().Unit();
183 
184  // rotate the vtx position
185  vtx.RotateUz(direction);
186 
187  LOG("Intranuke2018", pNOTICE)
188  << "Generated vtx @ R = " << vtx.Mag() << " fm / "
189  << print::Vec3AsString(&vtx);
190 
191  TObjArrayIter piter(evrec);
192  GHepParticle * p = 0;
193  while( (p = (GHepParticle *) piter.Next()) )
194  {
195  if(pdg::IsPseudoParticle(p->Pdg())) continue;
196  if(pdg::IsIon (p->Pdg())) continue;
197 
198  p->SetPosition(vtx.x(), vtx.y(), vtx.z(), 0.);
199  }
200 }
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
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
const double epsilon
int Pdg(void) const
Definition: GHepParticle.h:63
void SetPosition(const TLorentzVector &v4)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:42
bool IsPseudoParticle(int pdgc)
Definition: PDGUtils.cxx:27
#define pNOTICE
Definition: Messenger.h:61
double fTrackingRadius
tracking radius for the nucleus in the current event
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:80
bool genie::Intranuke2018::GetAltOset ( ) const
inline

Definition at line 92 of file Intranuke2018.h.

References fAltOset.

Referenced by genie::utils::intranuke2018::ProbSurvival().

92 { return fAltOset; }
bool fAltOset
NuWro&#39;s table-based implementation (not recommended)
double genie::Intranuke2018::GetDelRNucleon ( ) const
inline

Definition at line 86 of file Intranuke2018.h.

References fDelRNucleon.

Referenced by genie::utils::intranuke2018::ProbSurvival().

86 { return fDelRNucleon; }
double fDelRNucleon
factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement ...
double genie::Intranuke2018::GetDelRPion ( ) const
inline

Definition at line 85 of file Intranuke2018.h.

References fDelRPion.

Referenced by genie::utils::intranuke2018::ProbSurvival().

85 { return fDelRPion; }
double fDelRPion
factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement ...
virtual string genie::Intranuke2018::GetGenINukeMode ( ) const
inlinevirtual

Reimplemented in genie::HAIntranuke2018, and genie::HNIntranuke2018.

Definition at line 73 of file Intranuke2018.h.

73 {return "XX";};
double genie::Intranuke2018::GetHadStep ( ) const
inline

Definition at line 89 of file Intranuke2018.h.

References fHadStep.

Referenced by genie::utils::intranuke2018::ProbSurvival().

89 { return fHadStep; }
double fHadStep
step size for intranuclear hadron transport
virtual string genie::Intranuke2018::GetINukeMode ( ) const
inlinevirtual

Reimplemented in genie::HAIntranuke2018, and genie::HNIntranuke2018.

Definition at line 72 of file Intranuke2018.h.

Referenced by genie::utils::intranuke2018::ProbSurvival().

72 {return "XX2018";};
double genie::Intranuke2018::GetNR ( ) const
inline

Definition at line 83 of file Intranuke2018.h.

References fNR.

Referenced by genie::utils::intranuke2018::ProbSurvival().

83 { return fNR; }
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the &quot;nuclear bounda...
double genie::Intranuke2018::GetNucRmvE ( ) const
inline

Definition at line 88 of file Intranuke2018.h.

References fNucRmvE.

88 { return fNucRmvE; }
double fNucRmvE
binding energy to subtract from cascade nucleons
double genie::Intranuke2018::GetR0 ( ) const
inline

Definition at line 82 of file Intranuke2018.h.

References fR0.

Referenced by genie::utils::intranuke2018::ProbSurvival().

82 { return fR0; }
double fR0
effective nuclear size param
double genie::Intranuke2018::GetRemnA ( ) const
inline

Definition at line 79 of file Intranuke2018.h.

References fRemnA.

Referenced by genie::utils::intranuke2018::ProbSurvival().

79 { return fRemnA; }
int fRemnA
remnant nucleus A
double genie::Intranuke2018::GetRemnZ ( ) const
inline

Definition at line 80 of file Intranuke2018.h.

References fRemnZ.

Referenced by genie::utils::intranuke2018::ProbSurvival().

80 { return fRemnZ; }
int fRemnZ
remnant nucleus Z
bool genie::Intranuke2018::GetUseOset ( ) const
inline

Definition at line 91 of file Intranuke2018.h.

References fUseOset.

Referenced by genie::utils::intranuke2018::ProbSurvival().

91 { return fUseOset; }
bool fUseOset
Oset model for low energy pion in hN.
bool genie::Intranuke2018::GetXsecNNCorr ( ) const
inline

Definition at line 93 of file Intranuke2018.h.

References fXsecNNCorr.

Referenced by genie::utils::intranuke2018::ProbSurvival().

93 { return fXsecNNCorr; }
bool fXsecNNCorr
use nuclear medium correction for NN cross section
virtual int genie::Intranuke2018::HandleCompoundNucleus ( GHepRecord ev,
GHepParticle p,
int  mom 
) const
protectedpure virtual
bool Intranuke2018::IsInNucleus ( const GHepParticle p) const
protected

Definition at line 253 of file Intranuke2018.cxx.

References fHadStep, fTrackingRadius, and genie::GHepParticle::X4().

Referenced by genie::HNIntranuke2018::HandleCompoundNucleus(), and TransportHadrons().

254 {
255 // check whether the input particle is still within the nucleus
256 //
257  return (p->X4()->Vect().Mag() < fTrackingRadius + fHadStep);
258 }
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
double fHadStep
step size for intranuclear hadron transport
double fTrackingRadius
tracking radius for the nucleus in the current event
virtual void genie::Intranuke2018::LoadConfig ( void  )
protectedpure virtual

Implemented in genie::HAIntranuke2018, and genie::HNIntranuke2018.

Referenced by Configure().

bool Intranuke2018::NeedsRescattering ( const GHepParticle p) const
protected

Definition at line 217 of file Intranuke2018.cxx.

References fGMode, genie::pdg::IsIon(), genie::kGMdHadronNucleus, genie::kGMdPhotonNucleus, genie::kIStHadronInTheNucleus, genie::kIStInitialState, genie::GHepParticle::Pdg(), and genie::GHepParticle::Status().

Referenced by TransportHadrons().

218 {
219 // checks whether the particle should be rescattered
220 
221  assert(p);
222 
223  if(fGMode == kGMdHadronNucleus ||
225  // hadron/photon-nucleus scattering propagate the incoming particle
226  return (
228  && !pdg::IsIon(p->Pdg()));
229  }
230  else {
231  // attempt to rescatter anything marked as 'hadron in the nucleus'
232  return (p->Status() == kIStHadronInTheNucleus);
233  }
234 }
GHepStatus_t Status(void) const
Definition: GHepParticle.h:64
GEvGenMode_t fGMode
event generation mode (lepton+A, hadron+A, ...)
int Pdg(void) const
Definition: GHepParticle.h:63
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:42
void Intranuke2018::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Reimplemented in genie::HAIntranuke2018, and genie::HNIntranuke2018.

Definition at line 119 of file Intranuke2018.cxx.

References genie::GHepRecord::EventGenerationMode(), fGMode, GenerateVertex(), genie::kGMdHadronNucleus, genie::kGMdPhotonNucleus, LOG, pINFO, SetTrackingRadius(), genie::GHepRecord::TargetNucleus(), and TransportHadrons().

Referenced by genie::HAIntranuke2018::ProcessEventRecord(), and genie::HNIntranuke2018::ProcessEventRecord().

120 {
121  // Do not continue if there is no nuclear target
122  GHepParticle * nucltgt = evrec->TargetNucleus();
123  if (!nucltgt) {
124  LOG("HNIntranuke2018", pINFO) << "No nuclear target found - INTRANUKE exits";
125  return;
126  }
127 
128  // Decide tracking radius for the current nucleus (few * R0 * A^1/3)
129  this->SetTrackingRadius(nucltgt);
130 
131  // Understand what the event generation mode is (hadron/photon-nucleus,
132  // lepton-nucleus, nucleon decay) from the input event.
133  // The determined mode has an effect on INTRANUKE behaviour (how to lookup
134  // the residual nucleus, whether to set an intranuclear vtx etc) but it
135  // does not affect the INTRANUKE physics.
136  fGMode = evrec->EventGenerationMode();
137 
138  // For lepton-nucleus scattering and for nucleon decay intranuclear vtx
139  // position (in the target nucleus coord system) is set elsewhere.
140  // This method only takes effect in hadron/photon-nucleus interactions.
141  // In this special mode, an interaction vertex is set at the periphery
142  // of the target nucleus.
143  if(fGMode == kGMdHadronNucleus ||
145  {
146  this->GenerateVertex(evrec);
147  }
148 
149  // Now transport all hadrons outside the tracking radius.
150  // Stepping part is common for both HA and HN.
151  // Once it has been estabished that an interaction takes place then
152  // HA and HN specific code takes over in order to simulate the final state.
153  this->TransportHadrons(evrec);
154 }
GEvGenMode_t fGMode
event generation mode (lepton+A, hadron+A, ...)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void SetTrackingRadius(const GHepParticle *p) const
#define pINFO
Definition: Messenger.h:62
void GenerateVertex(GHepRecord *ev) const
void TransportHadrons(GHepRecord *ev) const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
void genie::Intranuke2018::SetRemnA ( int  A)
inline

Definition at line 76 of file Intranuke2018.h.

References genie::units::A, and fRemnA.

76 { fRemnA = A; }
int fRemnA
remnant nucleus A
static constexpr double A
Definition: Units.h:74
void genie::Intranuke2018::SetRemnZ ( int  Z)
inline

Definition at line 77 of file Intranuke2018.h.

References fRemnZ.

77 { fRemnZ = Z; }
int fRemnZ
remnant nucleus Z
void Intranuke2018::SetTrackingRadius ( const GHepParticle p) const
protected

Definition at line 202 of file Intranuke2018.cxx.

References genie::units::A, genie::GHepParticle::A(), fNR, fR0, fTrackingRadius, genie::pdg::IsIon(), LOG, genie::GHepParticle::Pdg(), and pNOTICE.

Referenced by ProcessEventRecord().

203 {
204  assert(p && pdg::IsIon(p->Pdg()));
205  double A = p->A();
206  fTrackingRadius = fR0 * TMath::Power(A, 1./3.);
207 
208  // multiply that by some input factor so that hadrons are tracked
209  // beyond the nuclear 'boundary' since the nuclear density distribution
210  // is not zero there
211  fTrackingRadius *= fNR;
212 
213  LOG("Intranuke2018", pNOTICE)
214  << "Setting tracking radius to R = " << fTrackingRadius;
215 }
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the &quot;nuclear bounda...
int Pdg(void) const
Definition: GHepParticle.h:63
#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
double fR0
effective nuclear size param
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:42
int A(void) const
#define pNOTICE
Definition: Messenger.h:61
double fTrackingRadius
tracking radius for the nucleus in the current event
virtual void genie::Intranuke2018::SimulateHadronicFinalState ( GHepRecord ev,
GHepParticle p 
) const
protectedpure virtual
void Intranuke2018::TransportHadrons ( GHepRecord ev) const
protected

Definition at line 260 of file Intranuke2018.cxx.

References genie::GHepParticle::A(), genie::GHepRecord::AddParticle(), CanRescatter(), fGMode, fHadStep, genie::GHepParticle::FirstMother(), fRemnA, fRemnP4, fRemnZ, fTrackingRadius, GenerateStep(), IsInNucleus(), genie::kGMdDarkMatterNucleus, genie::kGMdHadronNucleus, genie::kGMdLeptonNucleus, genie::kGMdNucleonDecay, genie::kGMdPhotonNucleus, genie::GHepParticle::KinE(), genie::kIStFinalStateNuclearRemnant, genie::kIStIntermediateState, genie::kIStStableFinalState, genie::kPdgHadronicBlob, LOG, genie::GHepParticle::Name(), NeedsRescattering(), genie::GHepParticle::P4(), genie::GHepRecord::Particle(), pERROR, pNOTICE, genie::GHepRecord::RemnantNucleusPosition(), genie::GHepParticle::SetFirstMother(), genie::GHepParticle::SetStatus(), SimulateHadronicFinalState(), genie::utils::intranuke2018::StepParticle(), genie::GHepRecord::TargetNucleusPosition(), genie::GHepParticle::X4(), and genie::GHepParticle::Z().

Referenced by ProcessEventRecord().

261 {
262 // transport all hadrons outside the nucleus
263 
264  int inucl = -1;
265  fRemnA = -1;
266  fRemnZ = -1;
267 
268  // Get 'nuclear environment' at the beginning of hadron transport
269  // and keep track of the remnant nucleus A,Z
270 
271  if(fGMode == kGMdHadronNucleus ||
273  {
274  inucl = evrec->TargetNucleusPosition();
275  }
276  else if(fGMode == kGMdLeptonNucleus ||
279  inucl = evrec->RemnantNucleusPosition();
280  }
281 
282  LOG("Intranuke2018", pNOTICE)
283  << "Propagating hadrons within nucleus found in position = " << inucl;
284  GHepParticle * nucl = evrec->Particle(inucl);
285  if(!nucl) {
286  LOG("Intranuke2018", pERROR)
287  << "No nucleus found in position = " << inucl;
288  LOG("Intranuke2018", pERROR)
289  << *evrec;
290  return;
291  }
292 
293  fRemnA = nucl->A();
294  fRemnZ = nucl->Z();
295 
296  LOG("Intranuke2018", pNOTICE)
297  << "Nucleus (A,Z) = (" << fRemnA << ", " << fRemnZ << ")";
298 
299  const TLorentzVector & p4nucl = *(nucl->P4());
300  fRemnP4 = p4nucl;
301 
302  // Loop over GHEP and run intranuclear rescattering on handled particles
303  TObjArrayIter piter(evrec);
304  GHepParticle * p = 0;
305  int icurr = -1;
306 
307  while( (p = (GHepParticle *) piter.Next()) )
308  {
309  icurr++;
310 
311  // Check whether the particle needs rescattering, otherwise skip it
312  if( ! this->NeedsRescattering(p) ) continue;
313 
314  LOG("Intranuke2018", pNOTICE)
315  << " >> Stepping a " << p->Name()
316  << " with kinetic E = " << p->KinE() << " GeV";
317 
318  // Rescatter a clone, not the original particle
319  GHepParticle * sp = new GHepParticle(*p);
320 
321  // Set clone's mom to be the hadron that was cloned
322  sp->SetFirstMother(icurr);
323 
324  // Check whether the particle can be rescattered
325  if(!this->CanRescatter(sp)) {
326 
327  // if I can't rescatter it, I will just take it out of the nucleus
328  LOG("Intranuke2018", pNOTICE)
329  << "... Current version can't rescatter a " << sp->Name();
330  sp->SetFirstMother(icurr);
332  evrec->AddParticle(*sp);
333  delete sp;
334  continue; // <-- skip to next GHEP entry
335  }
336 
337  // Start stepping particle out of the nucleus
338  bool has_interacted = false;
339  while ( this-> IsInNucleus(sp) )
340  {
341  // advance the hadron by a step
343 
344  // check whether it interacts
345  double d = this->GenerateStep(evrec,sp);
346  has_interacted = (d<fHadStep);
347  if(has_interacted) break;
348  }//stepping
349 
350  if(has_interacted && fRemnA>0) {
351  // the particle interacts - simulate the hadronic interaction
352  LOG("Intranuke2018", pNOTICE)
353  << "Particle has interacted at location: "
354  << sp->X4()->Vect().Mag() << " / nucl rad= " << fTrackingRadius;
355  this->SimulateHadronicFinalState(evrec,sp);
356  } else if(has_interacted && fRemnA<=0) {
357  // nothing left to interact with!
358  LOG("Intranuke2018", pNOTICE)
359  << "*** Nothing left to interact with, escaping.";
361  evrec->AddParticle(*sp);
362  evrec->Particle(sp->FirstMother())->SetRescatterCode(1);
363  } else {
364  // the exits the nucleus without interacting - Done with it!
365  LOG("Intranuke2018", pNOTICE)
366  << "*** Hadron escaped the nucleus! Done with it.";
368  evrec->AddParticle(*sp);
369  evrec->Particle(sp->FirstMother())->SetRescatterCode(1);
370  }
371  delete sp;
372 
373  // Current snapshot
374  //LOG("Intranuke2018", pINFO) << "Current event record snapshot: " << *evrec;
375 
376  }// GHEP entries
377 
378  // Add remnant nucleus - that 'hadronic blob' has all the remaining hadronic
379  // 4p not put explicitly into the simulated particles
380  TLorentzVector v4(0.,0.,0.,0.);
381  GHepParticle remnant_nucleus(
383  evrec->AddParticle(remnant_nucleus);
384  // Mark the initial remnant nucleus as an intermediate state
385  // Don't do that in the hadron/photon-nucleus scatterig mode since the initial
386  // remnant nucleus and the target nucleus coincide.
387  if(fGMode != kGMdHadronNucleus &&
389  evrec->Particle(inucl)->SetStatus(kIStIntermediateState);
390  }
391 }
int Z(void) const
void SetFirstMother(int m)
Definition: GHepParticle.h:132
#define pERROR
Definition: Messenger.h:59
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
const int kPdgHadronicBlob
Definition: PDGCodes.h:211
void StepParticle(GHepParticle *p, double step, double nuclear_radius=-1.)
Step particle.
int fRemnA
remnant nucleus A
bool IsInNucleus(const GHepParticle *p) const
bool CanRescatter(const GHepParticle *p) const
GEvGenMode_t fGMode
event generation mode (lepton+A, hadron+A, ...)
int FirstMother(void) const
Definition: GHepParticle.h:66
string Name(void) const
Name that corresponds to the PDG code.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool NeedsRescattering(const GHepParticle *p) const
double GenerateStep(GHepRecord *ev, GHepParticle *p) const
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
virtual void SimulateHadronicFinalState(GHepRecord *ev, GHepParticle *p) const =0
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:126
double fHadStep
step size for intranuclear hadron transport
int A(void) const
#define pNOTICE
Definition: Messenger.h:61
double fTrackingRadius
tracking radius for the nucleus in the current event
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
int fRemnZ
remnant nucleus Z
TLorentzVector fRemnP4
P4 of remnant system.

Friends And Related Function Documentation

friend class IntranukeTester
friend

Definition at line 56 of file Intranuke2018.h.

Member Data Documentation

AlgFactory* genie::Intranuke2018::fAlgf
protected

algorithm factory instance

Definition at line 117 of file Intranuke2018.h.

bool genie::Intranuke2018::fAltOset
protected

NuWro's table-based implementation (not recommended)

Definition at line 140 of file Intranuke2018.h.

Referenced by GetAltOset(), genie::HAIntranuke2018::LoadConfig(), and genie::HNIntranuke2018::LoadConfig().

double genie::Intranuke2018::fChPionFracAbsScale
protected
double genie::Intranuke2018::fChPionMFPScale
protected

tweaking factors for tuning

Definition at line 143 of file Intranuke2018.h.

Referenced by genie::HAIntranuke2018::LoadConfig(), and genie::HNIntranuke2018::LoadConfig().

double genie::Intranuke2018::fDelRNucleon
protected

factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement

Definition at line 129 of file Intranuke2018.h.

Referenced by GetDelRNucleon(), genie::HAIntranuke2018::LoadConfig(), and genie::HNIntranuke2018::LoadConfig().

double genie::Intranuke2018::fDelRPion
protected

factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement

Definition at line 128 of file Intranuke2018.h.

Referenced by GetDelRPion(), genie::HAIntranuke2018::LoadConfig(), and genie::HNIntranuke2018::LoadConfig().

bool genie::Intranuke2018::fDoCompoundNucleus
protected
bool genie::Intranuke2018::fDoFermi
protected
bool genie::Intranuke2018::fDoMassDiff
protected

whether or not to do mass diff. mode

Definition at line 137 of file Intranuke2018.h.

double genie::Intranuke2018::fEPreEq
protected

threshold for pre-equilibrium reaction

Definition at line 133 of file Intranuke2018.h.

Referenced by genie::HNIntranuke2018::HandleCompoundNucleus(), genie::HNIntranuke2018::LoadConfig(), and genie::HAIntranuke2018::LoadConfig().

double genie::Intranuke2018::fFermiFac
protected
double genie::Intranuke2018::fFermiMomentum
protected
TGenPhaseSpace genie::Intranuke2018::fGenPhaseSpace
mutableprotected

a phase space generator

Definition at line 115 of file Intranuke2018.h.

GEvGenMode_t genie::Intranuke2018::fGMode
mutableprotected

event generation mode (lepton+A, hadron+A, ...)

Definition at line 122 of file Intranuke2018.h.

Referenced by NeedsRescattering(), ProcessEventRecord(), and TransportHadrons().

INukeHadroData2018* genie::Intranuke2018::fHadroData2018
protected
double genie::Intranuke2018::fHadStep
protected

step size for intranuclear hadron transport

Definition at line 130 of file Intranuke2018.h.

Referenced by GetHadStep(), IsInNucleus(), genie::HNIntranuke2018::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), and TransportHadrons().

double genie::Intranuke2018::fNeutralPionFracAbsScale
protected
double genie::Intranuke2018::fNeutralPionMFPScale
protected
double genie::Intranuke2018::fNR
protected

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

Definition at line 126 of file Intranuke2018.h.

Referenced by GetNR(), genie::HNIntranuke2018::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), and SetTrackingRadius().

double genie::Intranuke2018::fNucAbsFac
protected
double genie::Intranuke2018::fNucCEXFac
protected
double genie::Intranuke2018::fNucleonFracAbsScale
protected
double genie::Intranuke2018::fNucleonFracCExScale
protected
double genie::Intranuke2018::fNucleonFracInelScale
protected
double genie::Intranuke2018::fNucleonFracPiProdScale
protected
double genie::Intranuke2018::fNucleonMFPScale
protected
const NuclearModelI* genie::Intranuke2018::fNuclmodel
protected
double genie::Intranuke2018::fNucRmvE
protected
double genie::Intranuke2018::fPionFracCExScale
protected
double genie::Intranuke2018::fPionFracInelScale
protected
double genie::Intranuke2018::fPionFracPiProdScale
protected
double genie::Intranuke2018::fR0
protected

effective nuclear size param

Definition at line 125 of file Intranuke2018.h.

Referenced by GetR0(), genie::HNIntranuke2018::LoadConfig(), genie::HAIntranuke2018::LoadConfig(), and SetTrackingRadius().

int genie::Intranuke2018::fRemnA
mutableprotected
TLorentzVector genie::Intranuke2018::fRemnP4
mutableprotected
int genie::Intranuke2018::fRemnZ
mutableprotected
double genie::Intranuke2018::fTrackingRadius
mutableprotected

tracking radius for the nucleus in the current event

Definition at line 114 of file Intranuke2018.h.

Referenced by GenerateVertex(), IsInNucleus(), SetTrackingRadius(), and TransportHadrons().

bool genie::Intranuke2018::fUseOset
protected
bool genie::Intranuke2018::fXsecNNCorr
protected

use nuclear medium correction for NN cross section

Definition at line 141 of file Intranuke2018.h.

Referenced by GetXsecNNCorr(), genie::HAIntranuke2018::LoadConfig(), and genie::HNIntranuke2018::LoadConfig().


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