GENIEGenerator
Loading...
Searching...
No Matches
PhotonStrucFunc.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 Alfonso Garcia <aagarciasoto \at km3net.de>
7 IFIC & Harvard University
8*/
9//____________________________________________________________________________
10
14
15#include "TSystem.h"
16
17using namespace genie;
18
19//_________________________________________________________________________
21//_________________________________________________________________________
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}
52//_________________________________________________________________________
57//_________________________________________________________________________
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
#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
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils.
Structure function using photon PDFs of nucleons.
static PhotonStrucFunc * fgInstance
static PhotonStrucFunc * Instance(void)
map< int, PhotonStrucFuncTable > fSFTables
A numeric analysis tool class for interpolating 1-D functions.
Definition Spline.h:58
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
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