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

Created this new module that controls the addition of the recoil nucleon in the event record and extracts its kinematics. More...

#include <SRCNuclearRecoil.h>

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

Public Member Functions

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

Protected Member Functions

void LoadConfig (void)
int SRCRecoilPDG (const GHepParticle &nucleon, const Target &tgt) const
Protected Member Functions inherited from genie::SecondNucleonEmissionI
virtual bool EmitSecondNucleon (GHepRecord *evrec, const int eject_nucleon_pdg) const
 SecondNucleonEmissionI (string name)
 SecondNucleonEmissionI (string name, string config)
void LoadConfig (void)
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.

Private Attributes

double fPPPairPercentage
double fPNPairPercentage

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 Attributes inherited from genie::SecondNucleonEmissionI
const NuclearModelIfNuclModel
 nuclear model
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

Created this new module that controls the addition of the recoil nucleon in the event record and extracts its kinematics.

Author
Afroditi Papadopoulou <apapadop \at mit.edu> Massachusetts Institute of Technology - October 04, 2019
Created:\n October 04, 2019
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 31 of file SRCNuclearRecoil.h.

Constructor & Destructor Documentation

◆ SRCNuclearRecoil() [1/2]

SRCNuclearRecoil::SRCNuclearRecoil ( )

Definition at line 51 of file SRCNuclearRecoil.cxx.

51 :
52SecondNucleonEmissionI("genie::SRCNuclearRecoil")
53{
54
55}

References genie::SecondNucleonEmissionI::SecondNucleonEmissionI().

◆ SRCNuclearRecoil() [2/2]

SRCNuclearRecoil::SRCNuclearRecoil ( string config)

Definition at line 57 of file SRCNuclearRecoil.cxx.

57 :
58 SecondNucleonEmissionI("genie::SRCNuclearRecoil", config )
59{
60
61}

References genie::SecondNucleonEmissionI::SecondNucleonEmissionI().

◆ ~SRCNuclearRecoil()

SRCNuclearRecoil::~SRCNuclearRecoil ( )

Definition at line 65 of file SRCNuclearRecoil.cxx.

66{
67
68}

Member Function Documentation

◆ Configure() [1/2]

void SRCNuclearRecoil::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 121 of file SRCNuclearRecoil.cxx.

122{
123 Algorithm::Configure(config);
124 this->LoadConfig();
125}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

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

◆ Configure() [2/2]

void SRCNuclearRecoil::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 127 of file SRCNuclearRecoil.cxx.

128{
129 Algorithm::Configure(config);
130 this->LoadConfig();
131}

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

◆ LoadConfig()

void SRCNuclearRecoil::LoadConfig ( void )
protected

Definition at line 133 of file SRCNuclearRecoil.cxx.

134{
135
137
138 this->GetParamDef("PNPairPercentage", fPNPairPercentage, 0.95);
139
141
142 LOG("SRCNuclearRecoil", pFATAL)
143 << "PNPairPercentage either less than 0 or greater than 1: Exiting" ;
144
145 exit(78);
146 }
147
149
150}
#define pFATAL
Definition Messenger.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
bool GetParamDef(const RgKey &name, T &p, const T &def) const

References fPNPairPercentage, fPPPairPercentage, genie::Algorithm::GetParamDef(), genie::SecondNucleonEmissionI::LoadConfig(), LOG, and pFATAL.

Referenced by Configure(), and Configure().

◆ ProcessEventRecord()

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

Implements genie::EventRecordVisitorI.

Definition at line 72 of file SRCNuclearRecoil.cxx.

73{
74
75 const Interaction * interaction = evrec -> Summary();
76 const InitialState & init_state = interaction -> InitState();
77 const Target & tgt = init_state.Tgt();
78
79 // do nothing for non-nuclear targets
80 if(! tgt.IsNucleus()) return;
81
82 // access the hit nucleon and target nucleus at the GHEP record
83 GHepParticle * nucleon = evrec->HitNucleon();
84 GHepParticle * nucleus = evrec->TargetNucleus();
85 assert(nucleon);
86 assert(nucleus);
87
88 // Set this to either a proton or neutron to eject a secondary particle
89 int eject_nucleon_pdg = this->SRCRecoilPDG( *nucleon, tgt );
90
91 // Ejection of secondary particle
92 if (eject_nucleon_pdg != 0) { EmitSecondNucleon(evrec,eject_nucleon_pdg); }
93
94}
const Target & Tgt(void) const
int SRCRecoilPDG(const GHepParticle &nucleon, const Target &tgt) const
virtual bool EmitSecondNucleon(GHepRecord *evrec, const int eject_nucleon_pdg) const
bool IsNucleus(void) const
Definition Target.cxx:272

References genie::SecondNucleonEmissionI::EmitSecondNucleon(), genie::GHepRecord::HitNucleon(), genie::Target::IsNucleus(), SRCRecoilPDG(), genie::GHepRecord::TargetNucleus(), and genie::InitialState::Tgt().

◆ SRCRecoilPDG()

int SRCNuclearRecoil::SRCRecoilPDG ( const GHepParticle & nucleon,
const Target & tgt ) const
protected

Definition at line 98 of file SRCNuclearRecoil.cxx.

98 {
99
100 int eject_nucleon_pdg = 0;
101
102 // const int nucleus_pdgc = tgt->Pdg();
103 const int nucleon_pdgc = nucleon.Pdg();
104
105 double pN2 = TMath::Power(nucleon.P4()->Rho(),2.); // (momentum of struck nucleon)^2
106
107 double kF = fNuclModel -> LocalFermiMomentum( tgt,
108 nucleon_pdgc,
109 nucleon.X4()->Vect().Mag() );
110
111 if (TMath::Sqrt(pN2) > kF) {
112 double Pp = (nucleon_pdgc == kPdgProton) ? fPPPairPercentage : fPNPairPercentage;
113 RandomGen * rnd = RandomGen::Instance();
114 double prob = rnd->RndGen().Rndm();
115 eject_nucleon_pdg = (prob > Pp) ? kPdgNeutron : kPdgProton;
116 }
117
118 return eject_nucleon_pdg;
119}
int Pdg(void) const
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition RandomGen.h:80
const NuclearModelI * fNuclModel
nuclear model
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgNeutron
Definition PDGCodes.h:83

References genie::SecondNucleonEmissionI::fNuclModel, fPNPairPercentage, fPPPairPercentage, genie::RandomGen::Instance(), genie::kPdgNeutron, genie::kPdgProton, genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), genie::RandomGen::RndGen(), and genie::GHepParticle::X4().

Referenced by ProcessEventRecord().

Member Data Documentation

◆ fPNPairPercentage

double genie::SRCNuclearRecoil::fPNPairPercentage
private

Definition at line 56 of file SRCNuclearRecoil.h.

Referenced by LoadConfig(), and SRCRecoilPDG().

◆ fPPPairPercentage

double genie::SRCNuclearRecoil::fPPPairPercentage
private

Definition at line 55 of file SRCNuclearRecoil.h.

Referenced by LoadConfig(), and SRCRecoilPDG().


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