GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::EffectiveSF Class Reference

An effective spectral function to match psi' superscaling. Implements the NuclearModelI interface. More...

#include <EffectiveSF.h>

Inheritance diagram for genie::EffectiveSF:
Inheritance graph
[legend]
Collaboration diagram for genie::EffectiveSF:
Collaboration graph
[legend]

Public Member Functions

 EffectiveSF ()
 
 EffectiveSF (string config)
 
virtual ~EffectiveSF ()
 
bool GenerateNucleon (const Target &t) const
 
double Prob (double mom, double w, const Target &t) const
 
NuclearModel_t ModelType (const Target &) const
 
void Configure (const Registry &config)
 
void Configure (string param_set)
 
- Public Member Functions inherited from genie::NuclearModelI
virtual ~NuclearModelI ()
 
virtual bool GenerateNucleon (const Target &tgt, double hitNucleonRadius) const
 
virtual double Prob (double p, double w, const Target &tgt, double hitNucleonRadius) const
 
virtual double FermiMomentum (const Target &, int nucleon_pdg) const
 
virtual double LocalFermiMomentum (const Target &, int nucleon_pdg, double radius) const
 
double RemovalEnergy (void) const
 
double Momentum (void) const
 
const TVector3 & Momentum3 (void) const
 
FermiMoverInteractionType_t GetFermiMoverInteractionType (void) const
 
void SetMomentum3 (const TVector3 &mom) const
 
void SetRemovalEnergy (double E) const
 
- 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

TH1D * ProbDistro (const Target &t) const
 
TH1D * MakeEffectiveSF (const Target &target) const
 
TH1D * MakeEffectiveSF (double bs, double bp, double alpha, double beta, double c1, double c2, double c3, const Target &target) const
 
double ReturnBindingEnergy (const Target &target) const
 
double GetTransEnh1p1hMod (const Target &target) const
 
double Returnf1p1h (const Target &target) const
 
void LoadConfig (void)
 

Private Attributes

map< string, TH1D * > fProbDistroMap
 
double fPMax
 
double fPCutOff
 
bool fEjectSecondNucleon2p2h
 
bool fUseElFFTransEnh
 
map< int, double > fNucRmvE
 
map< int, double > f1p1hMap
 
map< int, std::vector< double > > fProbDistParams
 
map< int, double > fTransEnh1p1hMods
 
map< pair< int, int >, double > fRangeNucRmvE
 
map< pair< int, int >, double > fRange1p1hMap
 
map< pair< int, int >
, std::vector< double > > 
fRangeProbDistParams
 
map< pair< int, int >, double > fRangeTransEnh1p1hMods
 

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::NuclearModelI
 NuclearModelI ()
 
 NuclearModelI (std::string name)
 
 NuclearModelI (std::string name, std::string config)
 
const string & FermiMomentumTableName () const
 
const genie::FermiMomentumTableFermiMomentumTable () const
 
- 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
 
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. More...
 
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 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::NuclearModelI
double fCurrRemovalEnergy
 
TVector3 fCurrMomentum
 
FermiMoverInteractionType_t fFermiMoverInteractionType
 
- 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< bool > fOwnerships
 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

An effective spectral function to match psi' superscaling. Implements the NuclearModelI interface.

References:
http://arxiv.org/abs/1405.0583
Author
Brian Coopersmith, University of Rochester
Created:
April 02, 2014
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 34 of file EffectiveSF.h.

Constructor & Destructor Documentation

EffectiveSF::EffectiveSF ( )

Definition at line 38 of file EffectiveSF.cxx.

38  :
39 NuclearModelI("genie::EffectiveSF")
40 {
41 
42 }
EffectiveSF::EffectiveSF ( string  config)

Definition at line 44 of file EffectiveSF.cxx.

44  :
45 NuclearModelI("genie::EffectiveSF", config)
46 {
47 
48 }
EffectiveSF::~EffectiveSF ( )
virtual

Definition at line 52 of file EffectiveSF.cxx.

References fProbDistroMap.

53 {
54  map<string, TH1D*>::iterator iter = fProbDistroMap.begin();
55  for( ; iter != fProbDistroMap.begin(); ++iter) {
56  TH1D * hst = iter->second;
57  if(hst) {
58  delete hst;
59  hst=0;
60  }
61  }
62  fProbDistroMap.clear();
63 }
map< string, TH1D * > fProbDistroMap
Definition: EffectiveSF.h:72

Member Function Documentation

void EffectiveSF::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 271 of file EffectiveSF.cxx.

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

272 {
273  Algorithm::Configure(config);
274  this->LoadConfig();
275 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadConfig(void)
void EffectiveSF::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 277 of file EffectiveSF.cxx.

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

278 {
279  Algorithm::Configure(param_set);
280  this->LoadConfig();
281 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadConfig(void)
bool EffectiveSF::GenerateNucleon ( const Target t) const
virtual

Implements genie::NuclearModelI.

Definition at line 67 of file EffectiveSF.cxx.

References genie::Target::A(), genie::NuclearModelI::fCurrMomentum, genie::NuclearModelI::fCurrRemovalEnergy, fEjectSecondNucleon2p2h, genie::NuclearModelI::fFermiMoverInteractionType, GetTransEnh1p1hMod(), genie::Target::HitNucIsSet(), genie::RandomGen::Instance(), genie::kFermiMoveEffectiveSF1p1h, genie::kFermiMoveEffectiveSF2p2h_eject, genie::kFermiMoveEffectiveSF2p2h_noeject, genie::constants::kPi, LOG, pDEBUG, pNOTICE, ProbDistro(), ReturnBindingEnergy(), Returnf1p1h(), and genie::RandomGen::RndGen().

68 {
69  assert(target.HitNucIsSet());
71  fCurrMomentum.SetXYZ(0,0,0);
72 
73  //-- set fermi momentum vector
74  //
75 
76  if ( target.A() > 1 ) {
77  TH1D * prob = this->ProbDistro(target);
78  if(!prob) {
79  LOG("EffectiveSF", pNOTICE)
80  << "Null nucleon momentum probability distribution";
81  exit(1);
82  }
83 
84  double p = prob->GetRandom();
85 
86 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
87  LOG("EffectiveSF", pDEBUG) << "|p,nucleon| = " << p;
88 #endif
89 
91 
92  double costheta = -1. + 2. * rnd->RndGen().Rndm();
93  double sintheta = TMath::Sqrt(1.-costheta*costheta);
94  double fi = 2 * kPi * rnd->RndGen().Rndm();
95  double cosfi = TMath::Cos(fi);
96  double sinfi = TMath::Sin(fi);
97 
98  double px = p*sintheta*cosfi;
99  double py = p*sintheta*sinfi;
100  double pz = p*costheta;
101 
102  fCurrMomentum.SetXYZ(px, py, pz);
103 
104  }
105 
106  //-- set removal energy
107  //
108 
109  fCurrRemovalEnergy = this->ReturnBindingEnergy(target);
110  double f1p1h = this->Returnf1p1h(target);
111  // Since TE increases the QE peak via a 2p2h process, we decrease f1p1h
112  // in order to increase the 2p2h interaction to account for this enhancement.
113  f1p1h /= this->GetTransEnh1p1hMod(target);
114  if ( RandomGen::Instance() -> RndGen().Rndm() < f1p1h) {
116  } else if (fEjectSecondNucleon2p2h) {
118  } else {
120  }
121 
122  return true;
123 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
FermiMoverInteractionType_t fFermiMoverInteractionType
double GetTransEnh1p1hMod(const Target &target) const
double ReturnBindingEnergy(const Target &target) const
double Returnf1p1h(const Target &target) const
TH1D * ProbDistro(const Target &t) const
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition: RandomGen.h:80
bool fEjectSecondNucleon2p2h
Definition: EffectiveSF.h:75
#define pNOTICE
Definition: Messenger.h:61
#define pDEBUG
Definition: Messenger.h:63
double EffectiveSF::GetTransEnh1p1hMod ( const Target target) const
private

Definition at line 167 of file EffectiveSF.cxx.

References fRangeTransEnh1p1hMods, fTransEnh1p1hMods, and genie::utils::config::GetValueFromNuclearMaps().

Referenced by GenerateNucleon().

167  {
168  double transEnhMod;
170  fRangeTransEnh1p1hMods, &transEnhMod) &&
171  transEnhMod > 0) {
172  return transEnhMod;
173  }
174  // If none specified, assume no enhancement to quasielastic peak
175  return 1.0;
176 }
map< int, double > fTransEnh1p1hMods
Definition: EffectiveSF.h:82
bool GetValueFromNuclearMaps(const Target &target, const map< int, double > &nuc_to_val, const map< pair< int, int >, double > &nucA_range_to_val, double *val)
map< pair< int, int >, double > fRangeTransEnh1p1hMods
Definition: EffectiveSF.h:89
void EffectiveSF::LoadConfig ( void  )
privatevirtual

Reimplemented from genie::NuclearModelI.

Definition at line 285 of file EffectiveSF.cxx.

References genie::units::A, f1p1hMap, fEjectSecondNucleon2p2h, fNucRmvE, fPCutOff, fPMax, fProbDistParams, fRange1p1hMap, fRangeNucRmvE, fRangeProbDistParams, fRangeTransEnh1p1hMods, fTransEnh1p1hMods, fUseElFFTransEnh, genie::utils::config::GetDoubleKeyPDG(), genie::utils::config::GetDoubleKeyRangeNucA(), genie::Algorithm::GetOwnedConfig(), genie::Algorithm::GetParam(), genie::Algorithm::GetParamDef(), genie::pdg::IonPdgCode(), genie::utils::config::LoadAllIsotopesForKey(), genie::utils::config::LoadAllNucARangesForKey(), genie::NuclearModelI::LoadConfig(), LOG, and pINFO.

Referenced by Configure().

286 {
287 
289 
290  this->GetParamDef("EjectSecondNucleon2p2h", fEjectSecondNucleon2p2h, false);
291 
292  this->GetParamDef("MomentumMax", fPMax, 1.0);
293  this->GetParamDef("MomentumCutOff", fPCutOff, 0.65);
294  assert(fPMax > 0 && fPCutOff > 0 && fPCutOff <= fPMax);
295 
296  // Find out if Transverse enhancement is enabled to figure out whether to load
297  // the 2p2h enhancement parameters.
298  this->GetParam("UseElFFTransverseEnhancement", fUseElFFTransEnh );
299  if (!fUseElFFTransEnh) {
300  LOG("EffectiveSF", pINFO)
301  << "Transverse enhancement not used; "
302  << "Do not increase the 2p2h cross section.";
303  }
304  else {
305  LoadAllIsotopesForKey("TransEnhf1p1hMod", "EffectiveSF",
307  LoadAllNucARangesForKey("TransEnhf1p1hMod", "EffectiveSF",
309  }
310 
311  LoadAllIsotopesForKey("BindingEnergy", "EffectiveSF", GetOwnedConfig(), &fNucRmvE);
312  LoadAllNucARangesForKey("BindingEnergy", "EffectiveSF",
314  LoadAllIsotopesForKey("f1p1h", "EffectiveSF", GetOwnedConfig(), &f1p1hMap);
315  LoadAllNucARangesForKey("f1p1h", "EffectiveSF", GetOwnedConfig(), &fRange1p1hMap);
316 
317  for (int Z = 1; Z < 140; Z++) {
318  for (int A = Z; A < 3*Z; A++) {
319  const int pdgc = pdg::IonPdgCode(A, Z);
320  double bs, bp, alpha, beta, c1, c2, c3;
321  if (GetDoubleKeyPDG("bs", pdgc, GetOwnedConfig(), &bs) &&
322  GetDoubleKeyPDG("bp", pdgc, GetOwnedConfig(), &bp) &&
323  GetDoubleKeyPDG("alpha", pdgc, GetOwnedConfig(), &alpha) &&
324  GetDoubleKeyPDG("beta", pdgc, GetOwnedConfig(), &beta) &&
325  GetDoubleKeyPDG("c1", pdgc, GetOwnedConfig(), &c1) &&
326  GetDoubleKeyPDG("c2", pdgc, GetOwnedConfig(), &c2) &&
327  GetDoubleKeyPDG("c3", pdgc, GetOwnedConfig(), &c3)) {
328  vector<double> pars = vector<double>();
329  pars.push_back(bs);
330  pars.push_back(bp);
331  pars.push_back(alpha);
332  pars.push_back(beta);
333  pars.push_back(c1);
334  pars.push_back(c2);
335  pars.push_back(c3);
336  LOG("EffectiveSF", pINFO)
337  << "Nucleus: " << pdgc << " -> using bs = " << bs << "; bp = "<< bp
338  << "; alpha = " << alpha << "; beta = "<<beta<<"; c1 = "<<c1
339  <<"; c2 = "<<c2<< "; c3 = " << c3;
340  fProbDistParams[pdgc] = pars;
341  }
342  }
343  }
344  for(int lowA = 1; lowA < 3 * 140; lowA++) {
345  for(int highA = lowA; highA < 3 * 140; highA++) {
346  double bs, bp, alpha, beta, c1, c2, c3;
347  if (GetDoubleKeyRangeNucA("bs", lowA, highA, GetOwnedConfig(), &bs) &&
348  GetDoubleKeyRangeNucA("bp", lowA, highA, GetOwnedConfig(), &bp) &&
349  GetDoubleKeyRangeNucA("alpha",lowA, highA, GetOwnedConfig(), &alpha) &&
350  GetDoubleKeyRangeNucA("beta", lowA, highA, GetOwnedConfig(), &beta) &&
351  GetDoubleKeyRangeNucA("c1", lowA, highA, GetOwnedConfig(), &c1) &&
352  GetDoubleKeyRangeNucA("c2", lowA, highA, GetOwnedConfig(), &c2) &&
353  GetDoubleKeyRangeNucA("c3", lowA, highA, GetOwnedConfig(), &c3)) {
354  vector<double> pars = vector<double>();
355  pars.push_back(bs);
356  pars.push_back(bp);
357  pars.push_back(alpha);
358  pars.push_back(beta);
359  pars.push_back(c1);
360  pars.push_back(c2);
361  pars.push_back(c3);
362  LOG("EffectiveSF", pINFO) << "For "<< lowA - 1 <<" < A < " << highA + 1
363  <<" -> using bs = " << bs << "; bp = "<< bp
364  << "; alpha = " << alpha << "; beta = "<<beta<<"; c1 = "<<c1
365  <<"; c2 = "<<c2<< "; c3 = " << c3;
366  fRangeProbDistParams[pair<int, int>(lowA, highA)] = pars;
367  }
368  }
369  }
370 }
Registry * GetOwnedConfig(void)
Definition: Algorithm.cxx:279
map< int, std::vector< double > > fProbDistParams
Definition: EffectiveSF.h:81
map< pair< int, int >, std::vector< double > > fRangeProbDistParams
Definition: EffectiveSF.h:88
map< int, double > fTransEnh1p1hMods
Definition: EffectiveSF.h:82
void LoadAllIsotopesForKey(const char *key_name, const char *log_tool_name, Registry *config, map< int, double > *nuc_to_val)
map< int, double > f1p1hMap
Definition: EffectiveSF.h:80
map< pair< int, int >, double > fRangeNucRmvE
Definition: EffectiveSF.h:86
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
map< pair< int, int >, double > fRange1p1hMap
Definition: EffectiveSF.h:87
static constexpr double A
Definition: Units.h:74
#define pINFO
Definition: Messenger.h:62
virtual void LoadConfig()
bool GetDoubleKeyRangeNucA(const char *valName, const int lowA, const int highA, Registry *config, double *val)
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:71
bool GetDoubleKeyPDG(const char *valName, const int pdgc, Registry *config, double *val)
bool fEjectSecondNucleon2p2h
Definition: EffectiveSF.h:75
map< int, double > fNucRmvE
Definition: EffectiveSF.h:79
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
void LoadAllNucARangesForKey(const char *key_name, const char *log_tool_name, Registry *config, map< pair< int, int >, double > *nuc_rangeA_to_val)
map< pair< int, int >, double > fRangeTransEnh1p1hMods
Definition: EffectiveSF.h:89
TH1D * EffectiveSF::MakeEffectiveSF ( const Target target) const
private

Definition at line 181 of file EffectiveSF.cxx.

References genie::Target::A(), fProbDistParams, fRangeProbDistParams, genie::pdg::IonPdgCode(), and genie::Target::Z().

Referenced by ProbDistro().

182 {
183  // First check for individually specified nuclei
184  int pdgc = pdg::IonPdgCode(target.A(), target.Z());
185  map<int,vector<double> >::const_iterator it = fProbDistParams.find(pdgc);
186  if(it != fProbDistParams.end()) {
187  vector<double> v = it->second;
188  return this->MakeEffectiveSF(v[0], v[1], v[2], v[3],
189  v[4], v[5], v[6], target);
190  }
191 
192  // Then check in the ranges of A
193  map<pair<int, int>, vector<double> >::const_iterator range_it = fRangeProbDistParams.begin();
194  for(; range_it != fRangeProbDistParams.end(); ++range_it) {
195  if (target.A() >= range_it->first.first && target.A() <= range_it->first.second) {
196  vector<double> v = range_it->second;
197  return this->MakeEffectiveSF(v[0], v[1], v[2], v[3],
198  v[4], v[5], v[6], target);
199  }
200  }
201 
202  return NULL;
203 }
int A(void) const
Definition: Target.h:70
map< int, std::vector< double > > fProbDistParams
Definition: EffectiveSF.h:81
TH1D * MakeEffectiveSF(const Target &target) const
map< pair< int, int >, std::vector< double > > fRangeProbDistParams
Definition: EffectiveSF.h:88
int Z(void) const
Definition: Target.h:68
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:71
TH1D * EffectiveSF::MakeEffectiveSF ( double  bs,
double  bp,
double  alpha,
double  beta,
double  c1,
double  c2,
double  c3,
const Target target 
) const
private

Definition at line 208 of file EffectiveSF.cxx.

References genie::units::as, genie::Target::AsString(), fPCutOff, fPMax, fProbDistroMap, LOG, and pDEBUG.

211 {
212  //-- create the probability distribution
213  int npbins = (int) (1000 * fPMax);
214 
215  TH1D * prob = new TH1D("", "", npbins, 0, fPMax);
216  prob->SetDirectory(0);
217 
218  double dp = fPMax / (npbins-1);
219  for(int i = 0; i < npbins; i++) {
220  double p = i * dp;
221  double y = p / 0.197;
222  double as = c1 * exp(-pow(bs*y,2));
223  double ap = c2 * pow(bp * y, 2) * exp(-pow(bp * y, 2));
224  double at = c3 * pow(y, beta) * exp(-alpha * (y - 2));
225  double rr = (3.14159265 / 4) * (as + ap + at) * pow(y, 2) / 0.197;
226  double dP_dp = rr / 1.01691371;
227  if(p>fPCutOff)
228  dP_dp = 0;
229  assert(dP_dp >= 0);
230  // calculate probability density : dProbability/dp
231 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
232  LOG("EffectiveSF", pDEBUG) << "p = " << p << ", dP/dp = " << dP_dp;
233 #endif
234  prob->Fill(p, dP_dp);
235  }
236 
237  //-- normalize the probability distribution
238  prob->Scale( 1.0 / prob->Integral("width") );
239 
240  //-- store
241  fProbDistroMap.insert(
242  map<string, TH1D*>::value_type(target.AsString(),prob));
243  return prob;
244 }
string AsString(void) const
Definition: Target.cxx:383
map< string, TH1D * > fProbDistroMap
Definition: EffectiveSF.h:72
static constexpr double as
Definition: Units.h:101
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pDEBUG
Definition: Messenger.h:63
NuclearModel_t genie::EffectiveSF::ModelType ( const Target ) const
inlinevirtual

Implements genie::NuclearModelI.

Definition at line 47 of file EffectiveSF.h.

References genie::kNucmEffSpectralFunc.

double EffectiveSF::Prob ( double  mom,
double  w,
const Target t 
) const
virtual

Implements genie::NuclearModelI.

Definition at line 129 of file EffectiveSF.cxx.

References ProbDistro().

130 {
131  if(w < 0) {
132  TH1D * prob_distr = this->ProbDistro(target);
133  int bin = prob_distr->FindBin(mom);
134  double y = prob_distr->GetBinContent(bin);
135  double dx = prob_distr->GetBinWidth(bin);
136  double prob = y * dx;
137  return prob;
138  }
139  return 1;
140 }
TH1D * ProbDistro(const Target &t) const
TH1D * EffectiveSF::ProbDistro ( const Target t) const
private

Definition at line 145 of file EffectiveSF.cxx.

References genie::Target::AsString(), fPCutOff, fPMax, fProbDistroMap, genie::Target::HitNucPdg(), genie::pdg::IsNeutron(), genie::pdg::IsProton(), LOG, MakeEffectiveSF(), and pNOTICE.

Referenced by GenerateNucleon(), and Prob().

146 {
147  //-- return stored /if already computed/
148  map<string, TH1D*>::iterator it = fProbDistroMap.find(target.AsString());
149  if(it != fProbDistroMap.end()) return it->second;
150 
151  LOG("EffectiveSF", pNOTICE)
152  << "Computing P = f(p_nucleon) for: " << target.AsString();
153  LOG("EffectiveSF", pNOTICE)
154  << "P(cut-off) = " << fPCutOff << ", P(max) = " << fPMax;
155 
156  //-- get information for the nuclear target
157  int nucleon_pdgc = target.HitNucPdg();
158  assert( pdg::IsProton(nucleon_pdgc) || pdg::IsNeutron(nucleon_pdgc) );
159  return this->MakeEffectiveSF(target);
160 
161 }
map< string, TH1D * > fProbDistroMap
Definition: EffectiveSF.h:72
TH1D * MakeEffectiveSF(const Target &target) const
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:341
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:336
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pNOTICE
Definition: Messenger.h:61
double EffectiveSF::ReturnBindingEnergy ( const Target target) const
private

Definition at line 248 of file EffectiveSF.cxx.

References fNucRmvE, fRangeNucRmvE, and genie::utils::config::GetValueFromNuclearMaps().

Referenced by GenerateNucleon().

249 {
250  double binding_en;
251  if (GetValueFromNuclearMaps(target, fNucRmvE, fRangeNucRmvE, &binding_en) &&
252  binding_en > 0) {
253  return binding_en;
254  }
255  return 0;
256 }
map< pair< int, int >, double > fRangeNucRmvE
Definition: EffectiveSF.h:86
bool GetValueFromNuclearMaps(const Target &target, const map< int, double > &nuc_to_val, const map< pair< int, int >, double > &nucA_range_to_val, double *val)
map< int, double > fNucRmvE
Definition: EffectiveSF.h:79
double EffectiveSF::Returnf1p1h ( const Target target) const
private

Definition at line 261 of file EffectiveSF.cxx.

References f1p1hMap, fRange1p1hMap, and genie::utils::config::GetValueFromNuclearMaps().

Referenced by GenerateNucleon().

262 {
263  double f1p1h;
264  if (GetValueFromNuclearMaps(target, f1p1hMap, fRange1p1hMap, &f1p1h) &&
265  f1p1h >= 0 && f1p1h <= 1) {
266  return f1p1h;
267  }
268  return 1;
269 }
map< int, double > f1p1hMap
Definition: EffectiveSF.h:80
map< pair< int, int >, double > fRange1p1hMap
Definition: EffectiveSF.h:87
bool GetValueFromNuclearMaps(const Target &target, const map< int, double > &nuc_to_val, const map< pair< int, int >, double > &nucA_range_to_val, double *val)

Member Data Documentation

map<int, double> genie::EffectiveSF::f1p1hMap
private

Definition at line 80 of file EffectiveSF.h.

Referenced by LoadConfig(), and Returnf1p1h().

bool genie::EffectiveSF::fEjectSecondNucleon2p2h
private

Definition at line 75 of file EffectiveSF.h.

Referenced by GenerateNucleon(), and LoadConfig().

map<int, double> genie::EffectiveSF::fNucRmvE
private

Definition at line 79 of file EffectiveSF.h.

Referenced by LoadConfig(), and ReturnBindingEnergy().

double genie::EffectiveSF::fPCutOff
private

Definition at line 74 of file EffectiveSF.h.

Referenced by LoadConfig(), MakeEffectiveSF(), and ProbDistro().

double genie::EffectiveSF::fPMax
private

Definition at line 73 of file EffectiveSF.h.

Referenced by LoadConfig(), MakeEffectiveSF(), and ProbDistro().

map<int, std::vector<double> > genie::EffectiveSF::fProbDistParams
private

Definition at line 81 of file EffectiveSF.h.

Referenced by LoadConfig(), and MakeEffectiveSF().

map<string, TH1D *> genie::EffectiveSF::fProbDistroMap
mutableprivate

Definition at line 72 of file EffectiveSF.h.

Referenced by MakeEffectiveSF(), ProbDistro(), and ~EffectiveSF().

map<pair<int, int>, double> genie::EffectiveSF::fRange1p1hMap
private

Definition at line 87 of file EffectiveSF.h.

Referenced by LoadConfig(), and Returnf1p1h().

map<pair<int, int>, double> genie::EffectiveSF::fRangeNucRmvE
private

Definition at line 86 of file EffectiveSF.h.

Referenced by LoadConfig(), and ReturnBindingEnergy().

map<pair<int, int>, std::vector<double> > genie::EffectiveSF::fRangeProbDistParams
private

Definition at line 88 of file EffectiveSF.h.

Referenced by LoadConfig(), and MakeEffectiveSF().

map<pair<int, int>, double> genie::EffectiveSF::fRangeTransEnh1p1hMods
private

Definition at line 89 of file EffectiveSF.h.

Referenced by GetTransEnh1p1hMod(), and LoadConfig().

map<int, double> genie::EffectiveSF::fTransEnh1p1hMods
private

Definition at line 82 of file EffectiveSF.h.

Referenced by GetTransEnh1p1hMod(), and LoadConfig().

bool genie::EffectiveSF::fUseElFFTransEnh
private

Definition at line 76 of file EffectiveSF.h.

Referenced by LoadConfig().


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