GENIEGenerator
Loading...
Searching...
No Matches
PauliBlocker.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6
7 Costas Andreopoulos <c.andreopoulos \at cern.ch>
8 University of Liverpool
9
10 Joe Johnston (Univ of Pittsburgh) added code (Mar 18, 2016) to use
11 either local or relativistic Fermi Gas for Pauli blocking.
12
13 Changes required to implement the GENIE Boosted Dark Matter module
14 were installed by Josh Berger (Univ. of Wisconsin)
15*/
16//____________________________________________________________________________
17
18#include <TLorentzVector.h>
19#include <TVector3.h>
20
27
41
42using namespace genie;
43using namespace genie::constants;
44
45//___________________________________________________________________________
47EventRecordVisitorI("genie::PauliBlocker")
48{
49
50}
51//___________________________________________________________________________
53EventRecordVisitorI("genie::PauliBlocker", config)
54{
55
56}
57//___________________________________________________________________________
62//___________________________________________________________________________
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}
129//___________________________________________________________________________
131{
132 Algorithm::Configure(config);
133 this->LoadModelType();
134}
135//___________________________________________________________________________
136void PauliBlocker::Configure(string param_set)
137{
138 Algorithm::Configure(param_set);
139 this->LoadModelType();
140}
141//___________________________________________________________________________
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);
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
164 assert(fKFTable);
165 }
166}
167//___________________________________________________________________________
168double PauliBlocker::GetFermiMomentum(const Target& tgt, int pdg_Nf,
169 double radius) const
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}
#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
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
string RgKey
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
static AlgConfigPool * Instance()
Registry * GlobalParameterList(void) const
The GENIE Algorithm Factory.
Definition AlgFactory.h:39
const Algorithm * GetAlgorithm(const AlgId &algid)
static AlgFactory * Instance()
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
Singleton class to load & serve tables of Fermi momentum constants.
const FermiMomentumTable * GetTable(string name)
static FermiMomentumTablePool * Instance(void)
STDHEP-like event record entry that can fit a particle or a nucleus.
int Pdg(void) const
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
int FirstDaughter(void) const
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual GHepParticle * TargetNucleus(void) const
virtual Interaction * Summary(void) const
virtual TBits * EventFlags(void) const
Definition GHepRecord.h:117
virtual GHepParticle * Particle(int position) const
virtual GHepParticle * HitNucleon(void) const
const Target & Tgt(void) const
Summary information for an interaction.
Definition Interaction.h:56
const ProcessInfo & ProcInfo(void) const
Definition Interaction.h:70
const InitialState & InitState(void) const
Definition Interaction.h:69
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
virtual NuclearModel_t ModelType(const Target &) const =0
double GetFermiMomentum(const Target &tgt, int pdg_Nf, double radius=0.0) const
Get the Fermi momentum needed to check Pauli blocking.
const FermiMomentumTable * fKFTable
void ProcessEventRecord(GHepRecord *event_rec) const
void Configure(const Registry &config)
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition ProcessInfo.h:46
bool IsDarkMatterElastic(void) const
bool IsQuasiElastic(void) const
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
RgAlg GetAlg(RgKey key) const
Definition Registry.cxx:488
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition Target.h:40
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
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
Basic constants.
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.)
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
@ kNucmLocalFermiGas
@ kPauliBlock
Definition GHepFlags.h:28