112{
113
114 string basedir = "";
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;
118
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";
124 assert(0);
125 }
126
127 const int nx = 1000.;
128
131
132#ifdef __GENIE_APFEL_ENABLED__
133 for (int k=0; k<2; k++) {
134
136
137
138 LOG(
"gmkphotonsf",
pINFO) <<
"Initialising APFEL..." ;
139 string pdfset;
142
143 const LHAPDF::PDFSet set(pdfset);
144 pdf_cache = LHAPDF::mkPDF(pdfset,0);
145
146 double xPDFmin,QPDFmin,QPDFmax,mc,mb,mt;
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;
157 LOG(
"gmkphotonsf",
pINFO) <<
"mb = " << mb;
158 LOG(
"gmkphotonsf",
pINFO) <<
"mt = " << mt;
159
160 APFEL::CleanUp();
161
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();
179
180 LOG(
"gmkphotonsf",
pWARN) <<
"Init EvolveAPFEL";
181 APFEL::EvolveAPFEL(QPDFmin,
kMw);
182 LOG(
"gmkphotonsf",
pWARN) <<
"End EvolveAPFEL";
183
184
185
186 double x[nx];
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) );
188
189 for(int j=0; j<6; j++) {
190
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++ ) {
194 double tmp = 0;
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;
203 }
204
205 sf_stream.close();
206 }
207
208 }
209#endif
210
211}
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
bool IsAntiNuTau(int pdgc)
bool IsAntiNuMu(int pdgc)