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

Structure function using photon PDFs of nucleons. More...

#include <PhotonStrucFunc.h>

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

Classes

struct  Cleaner
 
class  PhotonStrucFuncTable
 

Public Member Functions

double EvalSF (int hitnuc, int hitlep, double x)
 

Static Public Member Functions

static PhotonStrucFuncInstance (void)
 

Private Member Functions

 PhotonStrucFunc ()
 
 PhotonStrucFunc (const PhotonStrucFunc &)
 
 ~PhotonStrucFunc ()
 

Private Attributes

map< int, PhotonStrucFuncTablefSFTables
 

Static Private Attributes

static PhotonStrucFuncfgInstance = 0
 

Friends

struct Cleaner
 

Detailed Description

Structure function using photon PDFs of nucleons.

Author
Alfonso Garcia <aagarciasoto km3net.de> IFIC & Harvard University
Created:
Dec 8, 2021
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 36 of file PhotonStrucFunc.h.

Constructor & Destructor Documentation

PhotonStrucFunc::PhotonStrucFunc ( )
private

Definition at line 22 of file PhotonStrucFunc.cxx.

References fgInstance, fSFTables, genie::kPdgAntiNuE, genie::kPdgAntiNuMu, genie::kPdgAntiNuTau, genie::kPdgNeutron, genie::kPdgNuE, genie::kPdgNuMu, genie::kPdgNuTau, genie::kPdgProton, LOG, pFATAL, and pWARN.

Referenced by Instance().

23 {
24 
25  string basedir = "";
26  if ( gSystem->Getenv("PHOTON_SF_DATA_PATH")==NULL ) basedir = string(gSystem->Getenv("GENIE")) + "/data/evgen/photon-sf";
27  else basedir = string(gSystem->Getenv("PHOTON_SF_DATA_PATH"));
28  LOG("PhotonStrucFunc", pWARN) << "Base diretory: " << basedir;
29 
30  int nucs[2] = { kPdgProton, kPdgNeutron };
32 
33  for (int k=0; k<2; k++) {
34  for(int j=0; j<6; j++) {
35  string SFname = basedir + "/PhotonSF_hitnuc"+std::to_string(nucs[k])+"_hitlep"+std::to_string(pdgs[j])+".dat";
36  if ( gSystem->AccessPathName( SFname.c_str(), kReadPermission ) ) {
37  LOG("PhotonStrucFunc", pFATAL) << "File doesnt exist or you dont have read permission.";
38  LOG("PhotonStrucFunc", pFATAL) << "Remember!!!";
39  LOG("PhotonStrucFunc", pFATAL) << "Path to base directory is defined with the enviroment variable PHOTON_SF_DATA_PATH.";
40  LOG("PhotonStrucFunc", pFATAL) << "If not defined, default location is $GENIE/data/evgen/photon-sf";
41  LOG("PhotonStrucFunc", pFATAL) << "Photon SF tables must be computed with gmkglressf.";
42  assert(0);
43  }
44  fSFTables[nucs[k]].Table[pdgs[j]] = new genie::Spline();
45  fSFTables[nucs[k]].Table[pdgs[j]]->LoadFromAsciiFile(SFname);
46  }
47  }
48 
49  fgInstance = 0;
50 
51 }
map< int, PhotonStrucFuncTable > fSFTables
const int kPdgNuE
Definition: PDGCodes.h:28
const int kPdgAntiNuE
Definition: PDGCodes.h:29
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:58
#define pFATAL
Definition: Messenger.h:56
const int kPdgNuMu
Definition: PDGCodes.h:30
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgAntiNuTau
Definition: PDGCodes.h:33
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
#define pWARN
Definition: Messenger.h:60
const int kPdgNuTau
Definition: PDGCodes.h:32
static PhotonStrucFunc * fgInstance
const int kPdgProton
Definition: PDGCodes.h:81
const int kPdgNeutron
Definition: PDGCodes.h:83
genie::PhotonStrucFunc::PhotonStrucFunc ( const PhotonStrucFunc )
private
PhotonStrucFunc::~PhotonStrucFunc ( )
private

Definition at line 53 of file PhotonStrucFunc.cxx.

54 {
55 
56 }

Member Function Documentation

double genie::PhotonStrucFunc::EvalSF ( int  hitnuc,
int  hitlep,
double  x 
)
inline

Definition at line 56 of file PhotonStrucFunc.h.

References fSFTables.

Referenced by genie::PhotonRESPXSec::XSec().

56 { return fSFTables[hitnuc].Table[hitlep]->Evaluate(x); }
map< int, PhotonStrucFuncTable > fSFTables
PhotonStrucFunc * PhotonStrucFunc::Instance ( void  )
static

Definition at line 58 of file PhotonStrucFunc.cxx.

References genie::PhotonStrucFunc::Cleaner::DummyMethodAndSilentCompiler(), fgInstance, LOG, PhotonStrucFunc(), and pINFO.

Referenced by genie::PhotonRESPXSec::XSec().

59 {
60  if(fgInstance == 0) {
61  LOG("PhotonStrucFunc", pINFO) << "Late initialization";
62  static PhotonStrucFunc::Cleaner cleaner;
65  }
66  return fgInstance;
67 }
#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
static PhotonStrucFunc * fgInstance

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 82 of file PhotonStrucFunc.h.

Member Data Documentation

PhotonStrucFunc * PhotonStrucFunc::fgInstance = 0
staticprivate
map<int, PhotonStrucFuncTable> genie::PhotonStrucFunc::fSFTables
private

Definition at line 69 of file PhotonStrucFunc.h.

Referenced by EvalSF(), and PhotonStrucFunc().


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