GENIEGenerator
Loading...
Searching...
No Matches
genie::PhotonStrucFunc Class Reference

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

#include <PhotonStrucFunc.h>

Collaboration diagram for genie::PhotonStrucFunc:
[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 \at km3net.de> IFIC & Harvard University
Created:\n Dec 8, 2021
License:\n Copyright (c) 2003-2025, 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() [1/2]

PhotonStrucFunc::PhotonStrucFunc ( )
private

Definition at line 22 of file PhotonStrucFunc.cxx.

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}
#define pFATAL
Definition Messenger.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60
static PhotonStrucFunc * fgInstance
map< int, PhotonStrucFuncTable > fSFTables
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgNeutron
Definition PDGCodes.h:83
const int kPdgAntiNuE
Definition PDGCodes.h:29
const int kPdgAntiNuTau
Definition PDGCodes.h:33
const int kPdgNuE
Definition PDGCodes.h:28
const int kPdgNuTau
Definition PDGCodes.h:32
const int kPdgAntiNuMu
Definition PDGCodes.h:31
const int kPdgNuMu
Definition PDGCodes.h:30

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(), and PhotonStrucFunc().

◆ PhotonStrucFunc() [2/2]

genie::PhotonStrucFunc::PhotonStrucFunc ( const PhotonStrucFunc & )
private

References PhotonStrucFunc().

◆ ~PhotonStrucFunc()

PhotonStrucFunc::~PhotonStrucFunc ( )
private

Definition at line 53 of file PhotonStrucFunc.cxx.

54{
55
56}

Member Function Documentation

◆ EvalSF()

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

Definition at line 56 of file PhotonStrucFunc.h.

56{ return fSFTables[hitnuc].Table[hitlep]->Evaluate(x); }

References fSFTables.

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

◆ Instance()

PhotonStrucFunc * PhotonStrucFunc::Instance ( void )
static

Definition at line 58 of file PhotonStrucFunc.cxx.

59{
60 if(fgInstance == 0) {
61 LOG("PhotonStrucFunc", pINFO) << "Late initialization";
62 static PhotonStrucFunc::Cleaner cleaner;
65 }
66 return fgInstance;
67}
#define pINFO
Definition Messenger.h:62

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

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

◆ Cleaner

friend struct Cleaner
friend

Definition at line 82 of file PhotonStrucFunc.h.

Member Data Documentation

◆ fgInstance

PhotonStrucFunc * PhotonStrucFunc::fgInstance = 0
staticprivate

◆ fSFTables

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: