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

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

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

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

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)

October 08, 2004

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

Definition at line 46 of file PauliBlocker.cxx.

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

Definition at line 52 of file PauliBlocker.cxx.

52  :
53 EventRecordVisitorI("genie::PauliBlocker", config)
54 {
55 
56 }
static Config * config
Definition: config.cpp:1054
PauliBlocker::~PauliBlocker ( )

Definition at line 58 of file PauliBlocker.cxx.

59 {
60 
61 }

Member Function Documentation

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
void LoadModelType(void)
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 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadModelType(void)
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();
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 }
static constexpr double hbarc
Definition: Units.h:34
double Density(double r, int A, double ring=0.)
int A(void) const
Definition: Target.h:70
int Pdg(void) const
Definition: Target.h:71
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
int Z(void) const
Definition: Target.h:68
static const double kLightSpeed
Definition: Constants.h:31
int N(void) const
Definition: Target.h:69
const FermiMomentumTable * fKFTable
Definition: PauliBlocker.h:59
#define A
Definition: memgrp.cpp:38
static constexpr double fermi
Definition: Units.h:55
double FindClosestKF(int target_pdgc, int nucleon_pdgc) const
static const double kPlankConstant
Definition: Constants.h:32
static const double kPi2
Definition: Constants.h:38
void PauliBlocker::LoadModelType ( void  )
private

Definition at line 142 of file PauliBlocker.cxx.

142  {
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 
163  fKFTable = kftp->GetTable(fKFTableName);
164  assert(fKFTable);
165  }
166 }
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:40
static FermiMomentumTablePool * Instance(void)
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
Definition: NuclearModelI.h:46
virtual NuclearModel_t ModelType(const Target &) const =0
Singleton class to load & serve tables of Fermi momentum constants.
const FermiMomentumTable * GetTable(string name)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:75
Registry * GlobalParameterList(void) const
static AlgFactory * Instance()
Definition: AlgFactory.cxx:64
string RgKey
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
const FermiMomentumTable * fKFTable
Definition: PauliBlocker.h:59
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
The GENIE Algorithm Factory.
Definition: AlgFactory.h:39
string config
RgAlg GetAlg(RgKey key) const
Definition: Registry.cxx:488
static AlgConfigPool * Instance()
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);
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 }
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
int FirstDaughter(void) const
Definition: GHepParticle.h:68
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:69
int Pdg(void) const
Definition: GHepParticle.h:63
Summary information for an interaction.
Definition: Interaction.h:56
double GetFermiMomentum(const Target &tgt, int pdg_Nf, double radius=0.0) const
Get the Fermi momentum needed to check Pauli blocking.
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
p
Definition: test.py:223
bool IsDarkMatterElastic(void) const
Definition: ProcessInfo.cxx:74
#define pINFO
Definition: Messenger.h:62
Detector simulation of raw signals on wires.
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
#define pNOTICE
Definition: Messenger.h:61
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
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

const FermiMomentumTable* genie::PauliBlocker::fKFTable
private

Definition at line 59 of file PauliBlocker.h.

string genie::PauliBlocker::fKFTableName
private

Definition at line 60 of file PauliBlocker.h.

bool genie::PauliBlocker::fLFG
private

Definition at line 58 of file PauliBlocker.h.


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