115 if ( gSystem->Getenv(
"PHOTON_SF_DATA_PATH")==NULL ) basedir =
string(gSystem->Getenv(
"GENIE")) +
"/data/evgen/photon-sf";
116 else basedir = string(gSystem->Getenv(
"PHOTON_SF_DATA_PATH"));
117 LOG(
"gmkphotonsf",
pERROR) <<
"Base directory: " << basedir;
119 if ( gSystem->AccessPathName( basedir.c_str(), kWritePermission ) ) {
120 LOG(
"gmkphotonsf",
pFATAL) <<
"Base directory doesnt exist or you dont have write permission.";
121 LOG(
"gmkphotonsf",
pFATAL) <<
"Remember!!!";
122 LOG(
"gmkphotonsf",
pFATAL) <<
"Path to base directory is defined with the enviroment variable PHOTON_SF_DATA_PATH.";
123 LOG(
"gmkphotonsf",
pFATAL) <<
"If not defined, default location is $GENIE/data/evgen/photon-sf";
127 const int nx = 1000.;
132 #ifdef __GENIE_APFEL_ENABLED__
133 for (
int k=0; k<2; k++) {
138 LOG(
"gmkphotonsf",
pINFO) <<
"Initialising APFEL..." ;
143 const LHAPDF::PDFSet set(pdfset);
144 pdf_cache = LHAPDF::mkPDF(pdfset,0);
147 stringstream( set.get_entry(
"MCharm") ) >> mc;
148 stringstream( set.get_entry(
"MBottom") ) >> mb;
149 stringstream( set.get_entry(
"MTop") ) >> mt;
150 stringstream( set.get_entry(
"QMin") ) >> QPDFmin;
151 stringstream( set.get_entry(
"QMax") ) >> QPDFmax;
152 stringstream( set.get_entry(
"XMin") ) >> xPDFmin;
154 LOG(
"gmkphotonsf",
pINFO) <<
"QPDFmin = " << QPDFmin;
155 LOG(
"gmkphotonsf",
pINFO) <<
"QPDFmax = " << QPDFmax;
156 LOG(
"gmkphotonsf",
pINFO) <<
"mc = " << mc;
158 LOG(
"gmkphotonsf",
pINFO) <<
"mt = " << mt;
162 APFEL::SetPDFSet(pdfset);
163 APFEL::SetReplica(0);
164 APFEL::SetPerturbativeOrder(2);
165 APFEL::SetQLimits(QPDFmin,QPDFmax);
166 APFEL::SetMaxFlavourPDFs(6);
167 APFEL::SetMaxFlavourAlpha(6);
168 APFEL::SetNumberOfGrids(3);
169 APFEL::SetGridParameters(1,100,5,1
e-9);
170 APFEL::SetGridParameters(2,40,3,1
e-1);
171 APFEL::SetGridParameters(3,60,3,8
e-1);
172 APFEL::SetGFermi(
kGF);
173 APFEL::SetPoleMasses(mc,mb,mt);
174 APFEL::SetTheory(
"QUniD");
175 APFEL::EnableLeptonEvolution(
true);
176 APFEL::SetFastEvolution(
true);
177 APFEL::SetPDFSet(
"leptexternal");
178 APFEL::InitializeAPFEL();
180 LOG(
"gmkphotonsf",
pWARN) <<
"Init EvolveAPFEL";
181 APFEL::EvolveAPFEL(QPDFmin,
kMw);
182 LOG(
"gmkphotonsf",
pWARN) <<
"End EvolveAPFEL";
187 for (
int i=0; i<nx; i++ ) x[i] = TMath::Power( 10, TMath::Log10(xPDFmin) + i*(TMath::Log10(1.)-TMath::Log10(xPDFmin))/(1000.-1) );
189 for(
int j=0; j<6; j++) {
191 string SFname = basedir +
"/PhotonSF_hitnuc"+to_string(
fNucPdg)+
"_hitlep"+to_string(pdgs[j])+
".dat";
192 std::ofstream sf_stream(SFname);
193 for (
int i=0; i<nx; i++ ) {
195 if (
pdg::IsNuE (pdgs[j]) ) tmp = APFEL::xLepton( 1,x[i]);
196 else if (
pdg::IsAntiNuE (pdgs[j]) ) tmp = APFEL::xLepton(-1,x[i]);
197 else if (
pdg::IsNuMu (pdgs[j]) ) tmp = APFEL::xLepton( 2,x[i]);
199 else if (
pdg::IsNuTau (pdgs[j]) ) tmp = APFEL::xLepton( 3,x[i]);
201 LOG(
"gmkphotonsf",
pWARN) <<
"SF " << pdgs[j] <<
" [x=" << x[i] <<
"] = " << tmp;
202 sf_stream << x[i] <<
" " << tmp << endl;
211 }
bool IsAntiNuTau(int pdgc)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double mb
bool IsAntiNuMu(int pdgc)