25 using std::ostringstream;
31 using namespace genie;
32 using namespace genie::utils;
52 LOG(
"GiBUURESFormFactor",
pINFO) <<
"GiBUURESFormFactor late initialization";
86 cout <<
"GiBUURESFormFactor singleton dtor: Deleting all f/f splines" << endl;
90 for(
int r=0; r<kNRes; r++) {
91 for(
int i=0; i<kNCurr; i++) {
92 for(
int j=0; j<kNHitNuc; j++) {
93 for(
int k=0; k<kNFFRes; k++) {
94 if (fFFRes[r][i][j][k]) {
95 delete fFFRes[r][i][j][k];
96 fFFRes[r][i][j][k] = 0;
108 for(
int r=0; r<kNRes; r++) {
109 for(
int i=0; i<kNCurr; i++) {
110 for(
int j=0; j<kNHitNuc; j++) {
111 for(
int k=0; k<kNFFRes; k++) {
112 fFFRes[r][i][j][k] = 0;
118 string data_dir = string(gSystem->Getenv(
"GENIE")) +
119 string(
"/data/evgen/gibuu");
121 LOG(
"GiBUURESFormFactor",
pNOTICE) <<
"Loading GiBUU data from: " << data_dir;
126 for(
int r=0; r<kNRes; r++) {
127 for(
int i=0; i<kNCurr; i++) {
128 for(
int j=0; j<kNHitNuc; j++) {
134 ostringstream datafile;
135 datafile << data_dir <<
"/form_factors/";
138 case ( 0): datafile <<
"P33_1232";
break;
139 case ( 1): datafile <<
"S11_1535";
break;
140 case ( 2): datafile <<
"D13_1520";
break;
141 case ( 3): datafile <<
"S11_1650";
break;
142 case ( 5): datafile <<
"D15_1675";
break;
143 case ( 6): datafile <<
"S31_1620";
break;
144 case ( 7): datafile <<
"D33_1700";
break;
145 case ( 8): datafile <<
"P11_1440";
break;
146 case (10): datafile <<
"P13_1720";
break;
147 case (11): datafile <<
"F15_1680";
break;
148 case (12): datafile <<
"P31_1910";
break;
149 case (14): datafile <<
"F35_1905";
break;
150 case (15): datafile <<
"F37_1950";
break;
151 default : skip =
true;
155 case (0): datafile <<
"_CC";
break;
156 case (1): datafile <<
"_NC";
break;
157 case (2): datafile <<
"_EM";
break;
158 default : skip =
true;
161 case (0): datafile <<
"_neutron";
break;
162 case (1): datafile <<
"_proton";
break;
163 default : skip =
true;
165 datafile <<
"_FFres.dat";
170 assert( ! gSystem->AccessPathName(datafile.str().c_str()) );
180 data_ffres.ReadFile(datafile.str().c_str(),
181 "Q2/D:f1/D:f2/D:f3/D:f4/D:f5/D:f6/D:f7/D:f8/D");
184 <<
"Number of data rows: " << data_ffres.GetEntries();
190 fFFRes[r][i][j][0] =
new Spline(&data_ffres,
"Q2:f1");
191 fFFRes[r][i][j][1] =
new Spline(&data_ffres,
"Q2:f2");
192 fFFRes[r][i][j][2] =
new Spline(&data_ffres,
"Q2:f5");
193 fFFRes[r][i][j][3] =
new Spline(&data_ffres,
"Q2:f6");
200 fFFRes[r][i][j][4] =
new Spline(&data_ffres,
"Q2:f1");
201 fFFRes[r][i][j][5] =
new Spline(&data_ffres,
"Q2:f2");
202 fFFRes[r][i][j][6] =
new Spline(&data_ffres,
"Q2:f3");
203 fFFRes[r][i][j][7] =
new Spline(&data_ffres,
"Q2:f4");
204 fFFRes[r][i][j][8] =
new Spline(&data_ffres,
"Q2:f5");
205 fFFRes[r][i][j][9] =
new Spline(&data_ffres,
"Q2:f6");
206 fFFRes[r][i][j][10] =
new Spline(&data_ffres,
"Q2:f7");
207 fFFRes[r][i][j][11] =
new Spline(&data_ffres,
"Q2:f8");
215 for(
int r=0; r<kNRes; r++) {
216 for(
int i=0; i<kNCurr; i++) {
217 for(
int j=0; j<kNHitNuc; j++) {
218 for(
int k=0; k<kNFFRes; k++) {
219 if(fFFRes[r][i][j][k]) fFFRes[r][i][j][k]->YCanBeNegative(
true);
226 <<
"Done loading all resonance form factor files...";
233 return this->FFRes(Q2,res,hit_nucleon_pdg,it,4);
240 return this->FFRes(Q2,res,hit_nucleon_pdg,it,5);
247 return this->FFRes(Q2,res,hit_nucleon_pdg,it,6);
254 return this->FFRes(Q2,res,hit_nucleon_pdg,it,7);
261 return this->FFRes(Q2,res,hit_nucleon_pdg,it,8);
268 return this->FFRes(Q2,res,hit_nucleon_pdg,it,9);
275 return this->FFRes(Q2,res,hit_nucleon_pdg,it,10);
282 return this->FFRes(Q2,res,hit_nucleon_pdg,it,11);
289 return this->FFRes(Q2,res,hit_nucleon_pdg,it,0);
296 return this->FFRes(Q2,res,hit_nucleon_pdg,it,1);
303 return this->FFRes(Q2,res,hit_nucleon_pdg,it,2);
310 return this->FFRes(Q2,res,hit_nucleon_pdg,it,3);
317 if(Q2 < fMinQ2 || Q2 > fMaxQ2)
return 0.;
319 int r = -1, i = -1, j = -1;
321 if(ffresid<0 || ffresid >= kNFFRes)
return 0.;
324 if(r<0 || r >= kNRes)
return 0.;
328 else if (it ==
kIntEM) { i = 2; }
331 else if (hit_nucleon_pdg ==
kPdgProton ) { j = 1; }
333 const Spline * spl = fFFRes[r][i][j][ffresid];
bool IsDelta(Resonance_t res)
is it a Delta resonance?
double Q2(const Interaction *const i)
A numeric analysis tool class for interpolating 1-D functions.
double Evaluate(double x) const
enum genie::EResonance Resonance_t
bool IsN(Resonance_t res)
is it an N resonance?
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
enum genie::EInteractionType InteractionType_t