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

A table of Fermi momentum constants. More...

#include <FermiMomentumTable.h>

Collaboration diagram for genie::FermiMomentumTable:
Collaboration graph
[legend]

Public Member Functions

 FermiMomentumTable ()
 
 FermiMomentumTable (const FermiMomentumTable &fmt)
 
virtual ~FermiMomentumTable ()
 
double FindClosestKF (int target_pdgc, int nucleon_pdgc) const
 
void AddTableEntry (int target_pdgc, KF_t kf)
 

Private Attributes

map< int, KF_tfKFSets
 

Detailed Description

A table of Fermi momentum constants.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
August 18, 2005
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 33 of file FermiMomentumTable.h.

Constructor & Destructor Documentation

FermiMomentumTable::FermiMomentumTable ( )

Definition at line 26 of file FermiMomentumTable.cxx.

27 {
28 }
FermiMomentumTable::FermiMomentumTable ( const FermiMomentumTable fmt)

Definition at line 30 of file FermiMomentumTable.cxx.

31 {
32 
33 }
FermiMomentumTable::~FermiMomentumTable ( )
virtual

Definition at line 35 of file FermiMomentumTable.cxx.

36 {
37 
38 }

Member Function Documentation

void FermiMomentumTable::AddTableEntry ( int  target_pdgc,
KF_t  kf 
)

Definition at line 40 of file FermiMomentumTable.cxx.

References fKFSets.

Referenced by genie::FermiMomentumTablePool::ParseXMLTables().

41 {
42  fKFSets.insert(map<int, KF_t>::value_type(tgt_pdgc, kf));
43 }
double FermiMomentumTable::FindClosestKF ( int  target_pdgc,
int  nucleon_pdgc 
) const

Definition at line 45 of file FermiMomentumTable.cxx.

References fKFSets, genie::pdg::IonPdgCode(), genie::pdg::IonPdgCodeToA(), genie::pdg::IonPdgCodeToZ(), genie::pdg::IsProton(), LOG, genie::EKF_t::n, genie::EKF_t::p, pDEBUG, pINFO, and pWARN.

Referenced by genie::NievesQELCCPXSec::CNCTCLimUcalc(), genie::PauliBlocker::GetFermiMomentum(), main(), genie::utils::nuclear::NuclQELXSecSuppression(), genie::SmithMonizUtils::SetInteraction(), genie::SuSAv2MECPXSec::XSec(), genie::ReinSehgalRESPXSec::XSec(), genie::BSKLNBaseRESPXSec2014::XSec(), genie::MKSPPPXSec2020::XSec(), and genie::SuSAv2QELPXSec::XSecScaling().

46 {
47  LOG("FermiP", pINFO)
48  << "Finding Fermi momenta table entry for (tgt = "
49  << tgt_pdgc << ", nucl = " << nucleon_pdgc << ")";
50 
51  if(fKFSets.size()==0) {
52  LOG("FermiP", pWARN)
53  << "The Fermi momenta table is empty! Returning kf(tgt = "
54  << tgt_pdgc << ", nucl = " << nucleon_pdgc << ") = 0";
55  return 0;
56  }
57 
58  double kf=0;
59  bool isp = pdg::IsProton(nucleon_pdgc);
60 
61  if(fKFSets.count(tgt_pdgc) == 1) {
62  LOG("FermiP", pDEBUG) << "Got exact match in Fermi momenta table";
63  map<int, KF_t>::const_iterator table_iter = fKFSets.find(tgt_pdgc);
64  if(isp) kf = table_iter->second.p;
65  else kf = table_iter->second.n;
66  LOG("FermiP", pINFO) << "kF = " << kf;
67  return kf;
68  }
69  LOG("FermiP", pINFO) << "Couldn't find exact match in Fermi momenta table";
70 
71  int Z = pdg::IonPdgCodeToZ(tgt_pdgc);
72  int Ac=9999, Zc=9999, dZmin=9999;
73  map<int, KF_t>::const_iterator kfiter;
74  for(kfiter=fKFSets.begin(); kfiter!=fKFSets.end(); ++kfiter) {
75  int pdgc = kfiter->first;
76  int Zt = pdg::IonPdgCodeToZ(pdgc);
77  int dZ = TMath::Abs(Zt-Z);
78  if(dZ<dZmin) {
79  dZmin = dZ;
80  Zc = Zt;
81  Ac = pdg::IonPdgCodeToA(pdgc);
82  KF_t kft = kfiter->second;
83  if(isp) kf=kft.p;
84  else kf=kft.n;
85  }
86  }
87  LOG("FermiP", pINFO)
88  << "The closest nucleus in table is pdgc = " << pdg::IonPdgCode(Ac,Zc);
89  LOG("FermiP", pINFO) << "kF = " << kf;
90  return kf;
91 }
int IonPdgCodeToA(int pdgc)
Definition: PDGUtils.cxx:63
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 pINFO
Definition: Messenger.h:62
#define pWARN
Definition: Messenger.h:60
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:71
int IonPdgCodeToZ(int pdgc)
Definition: PDGUtils.cxx:55
#define pDEBUG
Definition: Messenger.h:63

Member Data Documentation

map<int, KF_t> genie::FermiMomentumTable::fKFSets
private

Definition at line 44 of file FermiMomentumTable.h.

Referenced by AddTableEntry(), and FindClosestKF().


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