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

Examines whether the generated event should be Pauli blocked. Is a concerete implementation of the EventRecordVisitorI interface. More...

#include <PauliBlocker.h>

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

Public Member Functions

 PauliBlocker ()
 PauliBlocker (string config)
 ~PauliBlocker ()
void ProcessEventRecord (GHepRecord *event_rec) const
void Configure (const Registry &config)
void Configure (string param_set)
double GetFermiMomentum (const Target &tgt, int pdg_Nf, double radius=0.0) const
 Get the Fermi momentum needed to check Pauli blocking.
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 LoadModelType (void)

Private Attributes

bool fLFG
const FermiMomentumTablefKFTable
string fKFTableName

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

Examines whether the generated event should be Pauli blocked. Is a concerete implementation of the EventRecordVisitorI interface.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool

Changes required to implement the GENIE Boosted Dark Matter module were installed by Josh Berger (Univ. of Wisconsin)

Other code improvements, additions, fixes were installed by Joe Johnston (Univ of Pittsburgh)

Created:\n October 08, 2004
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 36 of file PauliBlocker.h.

Constructor & Destructor Documentation

◆ PauliBlocker() [1/2]

PauliBlocker::PauliBlocker ( )

Definition at line 46 of file PauliBlocker.cxx.

46 :
47EventRecordVisitorI("genie::PauliBlocker")
48{
49
50}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ PauliBlocker() [2/2]

PauliBlocker::PauliBlocker ( string config)

Definition at line 52 of file PauliBlocker.cxx.

52 :
53EventRecordVisitorI("genie::PauliBlocker", config)
54{
55
56}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ ~PauliBlocker()

PauliBlocker::~PauliBlocker ( )

Definition at line 58 of file PauliBlocker.cxx.

59{
60
61}

Member Function Documentation

◆ Configure() [1/2]

void PauliBlocker::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 130 of file PauliBlocker.cxx.

131{
132 Algorithm::Configure(config);
133 this->LoadModelType();
134}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

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

◆ Configure() [2/2]

void PauliBlocker::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 136 of file PauliBlocker.cxx.

137{
138 Algorithm::Configure(param_set);
139 this->LoadModelType();
140}

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

◆ GetFermiMomentum()

double PauliBlocker::GetFermiMomentum ( const Target & tgt,
int pdg_Nf,
double radius = 0.0 ) const

Get the Fermi momentum needed to check Pauli blocking.

Definition at line 168 of file PauliBlocker.cxx.

170{
171 // Pauli blocking should only be applied for nucleons
172 assert( pdg::IsProton(pdg_Nf) || pdg::IsNeutron(pdg_Nf) );
173 double kF = 0.;
174 if ( fLFG ) {
175 int A = tgt.A();
176 bool is_p = pdg::IsProton( pdg_Nf );
177 int numNuc = (is_p) ? tgt.Z() : tgt.N();
178 double hbarc = kLightSpeed * kPlankConstant / units::fermi;
179 kF = TMath::Power(3 * kPi2 * numNuc *
180 genie::utils::nuclear::Density(radius, A), 1.0/3.0) * hbarc;
181 }
182 else {
183 kF = fKFTable->FindClosestKF(tgt.Pdg(), pdg_Nf);
184 }
185
186 return kF;
187}
const FermiMomentumTable * fKFTable
int N(void) const
Definition Target.h:69
int Z(void) const
Definition Target.h:68
int A(void) const
Definition Target.h:70
int Pdg(void) const
Definition Target.h:71
bool IsProton(int pdgc)
Definition PDGUtils.cxx:336
bool IsNeutron(int pdgc)
Definition PDGUtils.cxx:341
static constexpr double fermi
Definition Units.h:55
double Density(double r, int A, double ring=0.)

References genie::Target::A(), genie::utils::nuclear::Density(), genie::units::fermi, fKFTable, fLFG, genie::pdg::IsNeutron(), genie::pdg::IsProton(), genie::constants::kLightSpeed, genie::constants::kPi2, genie::constants::kPlankConstant, genie::Target::N(), genie::Target::Pdg(), and genie::Target::Z().

Referenced by ProcessEventRecord().

◆ LoadModelType()

void PauliBlocker::LoadModelType ( void )
private

Definition at line 142 of file PauliBlocker.cxx.

142 {
143 AlgConfigPool * confp = AlgConfigPool::Instance();
144 const Registry * gc = confp->GlobalParameterList();
145
146 // Create a nuclear model object to check the model type
147 RgKey nuclkey = "NuclearModel";
148 RgAlg nuclalg = gc->GetAlg(nuclkey);
149 AlgFactory * algf = AlgFactory::Instance();
150 const NuclearModelI* nuclModel =
151 dynamic_cast<const NuclearModelI*>(
152 algf->GetAlgorithm(nuclalg.name,nuclalg.config));
153 // Check if the model is a local Fermi gas
154 fLFG = (nuclModel && nuclModel->ModelType(Target()) == kNucmLocalFermiGas);
155
156 if ( !fLFG ) {
157 // get the Fermi momentum table for relativistic Fermi gas
158 GetParam( "FermiMomentumTable", fKFTableName ) ;
159
160 fKFTable = 0;
161
162 FermiMomentumTablePool * kftp = FermiMomentumTablePool::Instance();
164 assert(fKFTable);
165 }
166}
string RgKey
static AlgConfigPool * Instance()
Registry * GlobalParameterList(void) const
const Algorithm * GetAlgorithm(const AlgId &algid)
static AlgFactory * Instance()
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
const FermiMomentumTable * GetTable(string name)
static FermiMomentumTablePool * Instance(void)
virtual NuclearModel_t ModelType(const Target &) const =0
RgAlg GetAlg(RgKey key) const
Definition Registry.cxx:488
@ kNucmLocalFermiGas

References RgAlg::config, fKFTable, fKFTableName, fLFG, genie::Registry::GetAlg(), genie::AlgFactory::GetAlgorithm(), genie::Algorithm::GetParam(), genie::FermiMomentumTablePool::GetTable(), genie::AlgConfigPool::GlobalParameterList(), genie::AlgConfigPool::Instance(), genie::AlgFactory::Instance(), genie::FermiMomentumTablePool::Instance(), genie::kNucmLocalFermiGas, genie::NuclearModelI::ModelType(), and RgAlg::name.

Referenced by Configure(), and Configure().

◆ ProcessEventRecord()

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

Implements genie::EventRecordVisitorI.

Definition at line 63 of file PauliBlocker.cxx.

64{
65 // Return if the neutrino was not scatterred off a nuclear target
66 GHepParticle * nucltgt = evrec->TargetNucleus();
67 if (!nucltgt) {
68 LOG("PauliBlock", pINFO)
69 << "No nuclear target found - The Pauli Blocker exits";
70 return;
71 }
72
73 // Handle only QEL for now...
74 // (can also be dark matter elastic)
75 Interaction * interaction = evrec->Summary();
76 const ProcessInfo & proc = interaction->ProcInfo();
77 if(!proc.IsQuasiElastic() && !proc.IsDarkMatterElastic()) {
78 LOG("PauliBlock", pINFO) << "Not a QEL event - The Pauli Blocker exits";
79 return;
80 }
81
82 // Get the particle representing the initial hit nucleon
83 GHepParticle * hit = evrec->HitNucleon();
84 assert(hit);
85
86 // Get the particle representing the recoiling final nucleon
87 GHepParticle * recoil = evrec->Particle(hit->FirstDaughter());
88 assert(recoil);
89 int nuc_pdgc = recoil->Pdg();
90
91 const Target& tgt = interaction->InitState().Tgt();
92 double radius = hit->X4()->Vect().Mag();
93 double kf = this->GetFermiMomentum(tgt, nuc_pdgc, radius);
94
95 LOG("PauliBlock", pINFO) << "KF = " << kf;
96
97 // get the recoil momentum
98 double p = recoil->P4()->P(); // |p| for the recoil nucleon
99 LOG("PauliBlock", pINFO) << "Recoil nucleon |P| = " << p;
100
101 // check for pauli blocking
102 bool is_blocked = (p < kf);
103
104 // if it is blocked, set & thow an exception
105 if ( is_blocked ) {
106 LOG("PauliBlock", pNOTICE)
107 << " *** The generated event is Pauli-blocked ("
108 << "|p_{nucleon}| = " << p << " GeV < Fermi momentum = " << kf << " GeV) ***";
109
110 evrec->EventFlags()->SetBitNumber(kPauliBlock, true);
111 genie::exceptions::EVGThreadException exception;
112 exception.SetReason("Pauli-blocked event");
113
114 // Include dark matter elastic
115 if(proc.IsQuasiElastic() || proc.IsDarkMatterElastic()) {
116 // nuclear suppression taken into account at the QEL cross
117 // section - should attempt to regenerate the event as QEL
118 exception.SwitchOnStepBack();
119 exception.SetReturnStep(0);
120 } else {
121 // end this event generation thread and start again at the
122 // interaction selection step
123 // - this is irrelevant for the time being as we only handle QEL-
124 exception.SwitchOnFastForward();
125 }
126 throw exception;
127 }
128}
#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
int Pdg(void) const
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
int FirstDaughter(void) const
const Target & Tgt(void) const
const ProcessInfo & ProcInfo(void) const
Definition Interaction.h:70
const InitialState & InitState(void) const
Definition Interaction.h:69
double GetFermiMomentum(const Target &tgt, int pdg_Nf, double radius=0.0) const
Get the Fermi momentum needed to check Pauli blocking.
bool IsDarkMatterElastic(void) const
bool IsQuasiElastic(void) const
@ kPauliBlock
Definition GHepFlags.h:28

References genie::GHepRecord::EventFlags(), genie::GHepParticle::FirstDaughter(), GetFermiMomentum(), genie::GHepRecord::HitNucleon(), genie::Interaction::InitState(), genie::ProcessInfo::IsDarkMatterElastic(), genie::ProcessInfo::IsQuasiElastic(), genie::kPauliBlock, LOG, genie::GHepParticle::P4(), genie::GHepRecord::Particle(), genie::GHepParticle::Pdg(), pINFO, pNOTICE, genie::Interaction::ProcInfo(), genie::exceptions::EVGThreadException::SetReason(), genie::exceptions::EVGThreadException::SetReturnStep(), genie::GHepRecord::Summary(), genie::exceptions::EVGThreadException::SwitchOnFastForward(), genie::exceptions::EVGThreadException::SwitchOnStepBack(), genie::GHepRecord::TargetNucleus(), genie::InitialState::Tgt(), and genie::GHepParticle::X4().

Member Data Documentation

◆ fKFTable

const FermiMomentumTable* genie::PauliBlocker::fKFTable
private

Definition at line 59 of file PauliBlocker.h.

Referenced by GetFermiMomentum(), and LoadModelType().

◆ fKFTableName

string genie::PauliBlocker::fKFTableName
private

Definition at line 60 of file PauliBlocker.h.

Referenced by LoadModelType().

◆ fLFG

bool genie::PauliBlocker::fLFG
private

Definition at line 58 of file PauliBlocker.h.

Referenced by GetFermiMomentum(), and LoadModelType().


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