Public Member Functions | Protected Member Functions | Private Attributes | List of all members
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:
genie::SecondNucleonEmissionI genie::EventRecordVisitorI genie::Algorithm

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

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

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

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

Author
Afroditi Papadopoulou <apapadop mit.edu> Massachusetts Institute of Technology - October 04, 2019

October 04, 2019

Copyright (c) 2003-2019, 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::SRCNuclearRecoil ( )

Definition at line 51 of file SRCNuclearRecoil.cxx.

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

Definition at line 57 of file SRCNuclearRecoil.cxx.

57  :
58  SecondNucleonEmissionI("genie::SRCNuclearRecoil", config )
59 {
60 
61 }
static Config * config
Definition: config.cpp:1054
SRCNuclearRecoil::~SRCNuclearRecoil ( )

Definition at line 65 of file SRCNuclearRecoil.cxx.

66 {
67 
68 }

Member Function Documentation

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
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 {
130  this->LoadConfig();
131 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void SRCNuclearRecoil::LoadConfig ( void  )
protected

Definition at line 133 of file SRCNuclearRecoil.cxx.

134 {
135 
137 
138  this->GetParamDef("PNPairPercentage", fPNPairPercentage, 0.95);
139 
140  if (fPNPairPercentage < 0. || fPNPairPercentage > 1.) {
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
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 }
virtual bool EmitSecondNucleon(GHepRecord *evrec, const int eject_nucleon_pdg) const
bool IsNucleus(void) const
Definition: Target.cxx:272
Summary information for an interaction.
Definition: Interaction.h:56
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int SRCRecoilPDG(const GHepParticle &nucleon, const Target &tgt) const
const Target & Tgt(void) const
Definition: InitialState.h:66
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
Initial State information.
Definition: InitialState.h:48
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 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
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
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
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

Member Data Documentation

double genie::SRCNuclearRecoil::fPNPairPercentage
private

Definition at line 56 of file SRCNuclearRecoil.h.

double genie::SRCNuclearRecoil::fPPPairPercentage
private

Definition at line 55 of file SRCNuclearRecoil.h.


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