Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
genie::GiBUUData::FormFactors Class Reference

#include <GiBUUData.h>

Public Member Functions

 FormFactors ()
 
 ~FormFactors ()
 
double C3V (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C4V (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C5V (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C6V (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C3A (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C4A (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C5A (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double C6A (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double F1V (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double F2V (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double FA (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double FP (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it) const
 
double Q2min (void) const
 
double Q2max (void) const
 

Private Member Functions

double FFRes (double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
 func to retrieve interpolated form factor values More...
 
void LoadTables (void)
 load all form factor data tables More...
 

Private Attributes

SplinefFFRes [kNRes][kNCurr][kNHitNuc][kNFFRes]
 actual form factor data = f(Q2) More...
 

Static Private Attributes

static double fMinQ2 = 0.0
 min Q2 for which resonance f/f data are given More...
 
static double fMaxQ2 = 4.0
 max Q2 for which resonance f/f data are given More...
 
static const int kNRes = 18
 
static const int kNCurr = 3
 
static const int kNHitNuc = 2
 
static const int kNFFRes = 12
 

Friends

class GiBUUData
 

Detailed Description

Definition at line 45 of file GiBUUData.h.

Constructor & Destructor Documentation

GiBUUData::FormFactors::FormFactors ( void  )

Definition at line 89 of file GiBUUData.cxx.

90 {
91 
92 }
GiBUUData::FormFactors::~FormFactors ( void  )

Definition at line 94 of file GiBUUData.cxx.

95 {
96  if(!gAbortingInErr) {
97  cout << "GiBUUData singleton dtor: Deleting all f/f splines" << endl;
98  }
99 
100  // resonance form factor splines
101  for(int r=0; r<kNRes; r++) {
102  for(int i=0; i<kNCurr; i++) {
103  for(int j=0; j<kNHitNuc; j++) {
104  for(int k=0; k<kNFFRes; k++) {
105  if (fFFRes[r][i][j][k]) {
106  delete fFFRes[r][i][j][k];
107  fFFRes[r][i][j][k] = 0;
108  }
109  }//k
110  }//j
111  }//i
112  }//r
113 }
static const int kNCurr
Definition: GiBUUData.h:100
static const int kNFFRes
Definition: GiBUUData.h:102
static const int kNRes
Definition: GiBUUData.h:99
static const int kNHitNuc
Definition: GiBUUData.h:101
Spline * fFFRes[kNRes][kNCurr][kNHitNuc][kNFFRes]
actual form factor data = f(Q2)
Definition: GiBUUData.h:105
bool gAbortingInErr
Definition: Messenger.cxx:56

Member Function Documentation

double GiBUUData::FormFactors::C3A ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 268 of file GiBUUData.cxx.

270 {
271  if(!res::IsN(res)) return 0.;
272  return this->FFRes(Q2,res,hit_nucleon_pdg,it,8);
273 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C3V ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 240 of file GiBUUData.cxx.

242 {
243  if(!res::IsN(res)) return 0.;
244  return this->FFRes(Q2,res,hit_nucleon_pdg,it,4);
245 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C4A ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 275 of file GiBUUData.cxx.

277 {
278  if(!res::IsN(res)) return 0.;
279  return this->FFRes(Q2,res,hit_nucleon_pdg,it,9);
280 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C4V ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 247 of file GiBUUData.cxx.

249 {
250  if(!res::IsN(res)) return 0.;
251  return this->FFRes(Q2,res,hit_nucleon_pdg,it,5);
252 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C5A ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 282 of file GiBUUData.cxx.

284 {
285  if(!res::IsN(res)) return 0.;
286  return this->FFRes(Q2,res,hit_nucleon_pdg,it,10);
287 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C5V ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 254 of file GiBUUData.cxx.

256 {
257  if(!res::IsN(res)) return 0.;
258  return this->FFRes(Q2,res,hit_nucleon_pdg,it,6);
259 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C6A ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 289 of file GiBUUData.cxx.

291 {
292  if(!res::IsN(res)) return 0.;
293  return this->FFRes(Q2,res,hit_nucleon_pdg,it,11);
294 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::C6V ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 261 of file GiBUUData.cxx.

263 {
264  if(!res::IsN(res)) return 0.;
265  return this->FFRes(Q2,res,hit_nucleon_pdg,it,7);
266 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
bool IsN(Resonance_t res)
is it an N resonance?
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::F1V ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 296 of file GiBUUData.cxx.

298 {
299  if(!res::IsDelta(res)) return 0.;
300  return this->FFRes(Q2,res,hit_nucleon_pdg,it,0);
301 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::F2V ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 303 of file GiBUUData.cxx.

305 {
306  if(!res::IsDelta(res)) return 0.;
307  return this->FFRes(Q2,res,hit_nucleon_pdg,it,1);
308 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::FA ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 310 of file GiBUUData.cxx.

312 {
313  if(!res::IsDelta(res)) return 0.;
314  return this->FFRes(Q2,res,hit_nucleon_pdg,it,2);
315 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
double GiBUUData::FormFactors::FFRes ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it,
int  ffid 
) const
private

func to retrieve interpolated form factor values

Definition at line 324 of file GiBUUData.cxx.

327 {
328  if(Q2 < fMinQ2 || Q2 > fMaxQ2) return 0.;
329 
330  int r = -1, i = -1, j = -1;
331 
332  if(ffresid<0 || ffresid >= kNFFRes) return 0.;
333 
334  r = (int)res;
335  if(r<0 || r >= kNRes) return 0.;
336 
337  if (it == kIntWeakCC) { i = 0; }
338  else if (it == kIntWeakNC) { i = 1; }
339  else if (it == kIntEM) { i = 2; }
340 
341  if (hit_nucleon_pdg == kPdgNeutron) { j = 0; }
342  else if (hit_nucleon_pdg == kPdgProton ) { j = 1; }
343 
344  const Spline * spl = fFFRes[r][i][j][ffresid];
345 
346  if(!spl) return 0;
347  else {
348  return spl->Evaluate(Q2);
349  }
350 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:47
double Evaluate(double x) const
Definition: Spline.cxx:380
static const int kNFFRes
Definition: GiBUUData.h:102
static const int kNRes
Definition: GiBUUData.h:99
static double fMaxQ2
max Q2 for which resonance f/f data are given
Definition: GiBUUData.h:74
Spline * fFFRes[kNRes][kNCurr][kNHitNuc][kNFFRes]
actual form factor data = f(Q2)
Definition: GiBUUData.h:105
const int kPdgProton
Definition: PDGCodes.h:62
const int kPdgNeutron
Definition: PDGCodes.h:64
double GiBUUData::FormFactors::FP ( double  Q2,
Resonance_t  res,
int  nucleon_pdg,
InteractionType_t  it 
) const

Definition at line 317 of file GiBUUData.cxx.

319 {
320  if(!res::IsDelta(res)) return 0.;
321  return this->FFRes(Q2,res,hit_nucleon_pdg,it,3);
322 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
double FFRes(double Q2, Resonance_t res, int nucleon_pdg, InteractionType_t it, int ffid) const
func to retrieve interpolated form factor values
Definition: GiBUUData.cxx:324
void GiBUUData::FormFactors::LoadTables ( void  )
private

load all form factor data tables

Definition at line 115 of file GiBUUData.cxx.

116 {
117 // Loads hadronic x-section data
118 
119  for(int r=0; r<kNRes; r++) {
120  for(int i=0; i<kNCurr; i++) {
121  for(int j=0; j<kNHitNuc; j++) {
122  for(int k=0; k<kNFFRes; k++) {
123  fFFRes[r][i][j][k] = 0;
124  }//k
125  }//j
126  }//i
127  }//r
128 
129  string data_dir = string(gSystem->Getenv("GENIE")) +
130  string("/data/evgen/gibuu");
131 
132  LOG("GiBUUData", pNOTICE) << "Loading GiBUU data from: " << data_dir;
133 
134  //
135  // load resonance form factor data
136  //
137  for(int r=0; r<kNRes; r++) {
138  for(int i=0; i<kNCurr; i++) {
139  for(int j=0; j<kNHitNuc; j++) {
140 
141  bool skip = false;
142 
143  Resonance_t resonance = (Resonance_t)r;
144 
145  ostringstream datafile;
146  datafile << data_dir << "/form_factors/";
147 
148  switch(r){
149  case ( 0): datafile << "P33_1232"; break;
150  case ( 1): datafile << "S11_1535"; break;
151  case ( 2): datafile << "D13_1520"; break;
152  case ( 3): datafile << "S11_1650"; break;
153  case ( 5): datafile << "D15_1675"; break;
154  case ( 6): datafile << "S31_1620"; break;
155  case ( 7): datafile << "D33_1700"; break;
156  case ( 8): datafile << "P11_1440"; break;
157  case (10): datafile << "P13_1720"; break;
158  case (11): datafile << "F15_1680"; break;
159  case (12): datafile << "P31_1910"; break;
160  case (14): datafile << "F35_1905"; break;
161  case (15): datafile << "F37_1950"; break;
162  default : skip = true;
163 
164  }
165  switch(i){
166  case (0): datafile << "_CC"; break;
167  case (1): datafile << "_NC"; break;
168  case (2): datafile << "_EM"; break;
169  default : skip = true;
170  }
171  switch(j){
172  case (0): datafile << "_neutron"; break;
173  case (1): datafile << "_proton"; break;
174  default : skip = true;
175  }
176  datafile << "_FFres.dat";
177 
178  if(skip) continue;
179 
180  //-- Make sure that all data file exists
181  assert( ! gSystem->AccessPathName(datafile.str().c_str()) );
182 
183  //-- Read the data and fill a tree
184 
185  // The GiBUU files have the data organized in 9 columns:
186  // 0 1 2 3 4 5 6 7 8
187  // I=3/2 res: Qs C_3^V C_4^V C_5^V C_6^V C_3^A C_4^A C_5^A C_6^A
188  // I=1/2 res: Qs F_1^V F_2^V ----- ----- F_A F_P ----- ----
189 
190  TTree data_ffres;
191  data_ffres.ReadFile(datafile.str().c_str(),
192  "Q2/D:f1/D:f2/D:f3/D:f4/D:f5/D:f6/D:f7/D:f8/D");
193 
194  LOG("GiBUUData", pDEBUG)
195  << "Number of data rows: " << data_ffres.GetEntries();
196 
197  //
198  // I=3/2 resonances
199  //
200  if(res::IsDelta(resonance)) {
201  fFFRes[r][i][j][0] = new Spline(&data_ffres, "Q2:f1"); // F1V = f(Q2)
202  fFFRes[r][i][j][1] = new Spline(&data_ffres, "Q2:f2"); // F2V = f(Q2)
203  fFFRes[r][i][j][2] = new Spline(&data_ffres, "Q2:f5"); // FA = f(Q2)
204  fFFRes[r][i][j][3] = new Spline(&data_ffres, "Q2:f6"); // FP = f(Q2)
205  } // Delta res
206  else
207  //
208  // I=1/2 resonances
209  //
210  if(res::IsN(resonance)) {
211  fFFRes[r][i][j][4] = new Spline(&data_ffres, "Q2:f1"); // C3V = f(Q2)
212  fFFRes[r][i][j][5] = new Spline(&data_ffres, "Q2:f2"); // C4V = f(Q2)
213  fFFRes[r][i][j][6] = new Spline(&data_ffres, "Q2:f3"); // C5V = f(Q2)
214  fFFRes[r][i][j][7] = new Spline(&data_ffres, "Q2:f4"); // C6V = f(Q2)
215  fFFRes[r][i][j][8] = new Spline(&data_ffres, "Q2:f5"); // C3A = f(Q2)
216  fFFRes[r][i][j][9] = new Spline(&data_ffres, "Q2:f6"); // C4A = f(Q2)
217  fFFRes[r][i][j][10] = new Spline(&data_ffres, "Q2:f7"); // C5A = f(Q2)
218  fFFRes[r][i][j][11] = new Spline(&data_ffres, "Q2:f8"); // C6A = f(Q2)
219  } //N res
220 
221  }//j
222  }//i
223  }//r
224 
225 
226  for(int r=0; r<kNRes; r++) {
227  for(int i=0; i<kNCurr; i++) {
228  for(int j=0; j<kNHitNuc; j++) {
229  for(int k=0; k<kNFFRes; k++) {
230  if(fFFRes[r][i][j][k]) fFFRes[r][i][j][k]->YCanBeNegative(true);
231  }//k
232  }//j
233  }//i
234  }//r
235 
236  LOG("GiBUUData", pINFO)
237  << "Done loading all resonance form factor files...";
238 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
static const int kNCurr
Definition: GiBUUData.h:100
std::string string
Definition: nybbler.cc:12
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:47
enum genie::EResonance Resonance_t
bool IsN(Resonance_t res)
is it an N resonance?
static const int kNFFRes
Definition: GiBUUData.h:102
static const int kNRes
Definition: GiBUUData.h:99
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
static const int kNHitNuc
Definition: GiBUUData.h:101
#define pINFO
Definition: Messenger.h:53
Spline * fFFRes[kNRes][kNCurr][kNHitNuc][kNFFRes]
actual form factor data = f(Q2)
Definition: GiBUUData.h:105
void YCanBeNegative(bool tf)
Definition: Spline.h:86
#define pNOTICE
Definition: Messenger.h:52
#define pDEBUG
Definition: Messenger.h:54
double genie::GiBUUData::FormFactors::Q2max ( void  ) const
inline

Definition at line 69 of file GiBUUData.h.

69 { return fMaxQ2; }
static double fMaxQ2
max Q2 for which resonance f/f data are given
Definition: GiBUUData.h:74
double genie::GiBUUData::FormFactors::Q2min ( void  ) const
inline

Definition at line 68 of file GiBUUData.h.

68 { return fMinQ2; }
static double fMinQ2
min Q2 for which resonance f/f data are given
Definition: GiBUUData.h:73

Friends And Related Function Documentation

friend class GiBUUData
friend

Definition at line 113 of file GiBUUData.h.

Member Data Documentation

Spline* genie::GiBUUData::FormFactors::fFFRes[kNRes][kNCurr][kNHitNuc][kNFFRes]
private

actual form factor data = f(Q2)

Definition at line 105 of file GiBUUData.h.

double GiBUUData::FormFactors::fMaxQ2 = 4.0
staticprivate

max Q2 for which resonance f/f data are given

Definition at line 74 of file GiBUUData.h.

double GiBUUData::FormFactors::fMinQ2 = 0.0
staticprivate

min Q2 for which resonance f/f data are given

Definition at line 73 of file GiBUUData.h.

const int genie::GiBUUData::FormFactors::kNCurr = 3
staticprivate

Definition at line 100 of file GiBUUData.h.

const int genie::GiBUUData::FormFactors::kNFFRes = 12
staticprivate

Definition at line 102 of file GiBUUData.h.

const int genie::GiBUUData::FormFactors::kNHitNuc = 2
staticprivate

Definition at line 101 of file GiBUUData.h.

const int genie::GiBUUData::FormFactors::kNRes = 18
staticprivate

Definition at line 99 of file GiBUUData.h.


The documentation for this class was generated from the following files: