BaryonResUtils.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2019, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9  Igor Kakorin <kakorin@jinr.ru> (latest updates)
10  Joint Institute for Nuclear Research
11 
12  For the namespace documentation see the corresponding header file.
13 
14 */
15 //____________________________________________________________________________
16 
17 #include <cassert>
18 #include <cstdlib>
19 #include <map>
20 
21 #include <TMath.h>
22 
28 #include "Framework/Utils/BWFunc.h"
30 
31 using namespace genie;
32 using namespace genie::constants;
33 
34 //____________________________________________________________________________
36 {
37  switch(res) {
38  case kP33_1232 : return "P33(1232)" ; break;
39  case kS11_1535 : return "S11(1535)" ; break;
40  case kD13_1520 : return "D13(1520)" ; break;
41  case kS11_1650 : return "S11(1650)" ; break;
42  case kD13_1700 : return "D13(1700)" ; break;
43  case kD15_1675 : return "D15(1675)" ; break;
44  case kS31_1620 : return "S31(1620)" ; break;
45  case kD33_1700 : return "D33(1700)" ; break;
46  case kP11_1440 : return "P11(1440)" ; break;
47  case kP33_1600 : return "P33(1600)" ; break;
48  case kP13_1720 : return "P13(1720)" ; break;
49  case kF15_1680 : return "F15(1680)" ; break;
50  case kP31_1910 : return "P31(1910)" ; break;
51  case kP33_1920 : return "P33(1920)" ; break;
52  case kF35_1905 : return "F35(1905)" ; break;
53  case kF37_1950 : return "F37(1950)" ; break;
54  case kP11_1710 : return "P11(1710)" ; break;
55  case kF17_1970 : return "F17(1970)" ; break;
56  default: break;
57  }
58  return "unknown resonance!";
59 }
60 //____________________________________________________________________________
62 {
63  if ( strcmp( res,"P33(1232)" ) == 0 ) return kP33_1232;
64  else if( strcmp( res,"S11(1535)" ) == 0 ) return kS11_1535;
65  else if( strcmp( res,"D13(1520)" ) == 0 ) return kD13_1520;
66  else if( strcmp( res,"S11(1650)" ) == 0 ) return kS11_1650;
67  else if( strcmp( res,"D13(1700)" ) == 0 ) return kD13_1700;
68  else if( strcmp( res,"D15(1675)" ) == 0 ) return kD15_1675;
69  else if( strcmp( res,"S31(1620)" ) == 0 ) return kS31_1620;
70  else if( strcmp( res,"D33(1700)" ) == 0 ) return kD33_1700;
71  else if( strcmp( res,"P11(1440)" ) == 0 ) return kP11_1440;
72  else if( strcmp( res,"P33(1600)" ) == 0 ) return kP33_1600;
73  else if( strcmp( res,"P13(1720)" ) == 0 ) return kP13_1720;
74  else if( strcmp( res,"F15(1680)" ) == 0 ) return kF15_1680;
75  else if( strcmp( res,"P31(1910)" ) == 0 ) return kP31_1910;
76  else if( strcmp( res,"P33(1920)" ) == 0 ) return kP33_1920;
77  else if( strcmp( res,"F35(1905)" ) == 0 ) return kF35_1905;
78  else if( strcmp( res,"F37(1950)" ) == 0 ) return kF37_1950;
79  else if( strcmp( res,"P11(1710)" ) == 0 ) return kP11_1710;
80  else if( strcmp( res,"F17(1970)" ) == 0 ) return kF17_1970;
81  else return kNoResonance;
82 }
83 //____________________________________________________________________________
85 {
86 
87  switch(pdgc) {
88 
89  case (kPdgP33m1232_DeltaM ) : /* Delta- */
90  case (kPdgP33m1232_Delta0 ) : /* Delta0 */
91  case (kPdgP33m1232_DeltaP ) : /* Delta+ */
92  case (kPdgP33m1232_DeltaPP) : /* Delta++ */
93  return kP33_1232; break;
94 
95  case (kPdgS11m1535_N0) : /* N0 */
96  case (kPdgS11m1535_NP) : /* N+ */
97  return kS11_1535; break;
98 
99  case (kPdgD13m1520_N0) : /* N0 */
100  case (kPdgD13m1520_NP) : /* N+ */
101  return kD13_1520; break;
102 
103  case (kPdgS11m1650_N0) : /* N0 */
104  case (kPdgS11m1650_NP) : /* N+ */
105  return kS11_1650; break;
106 
107  case (kPdgD13m1700_N0) : /* N0 */
108  case (kPdgD13m1700_NP) : /* N+ */
109  return kD13_1700; break;
110 
111  case (kPdgD15m1675_N0) : /* N0 */
112  case (kPdgD15m1675_NP) : /* N+ */
113  return kD15_1675; break;
114 
115  case (kPdgS31m1620_DeltaM ) : /* Delta- */
116  case (kPdgS31m1620_Delta0 ) : /* Delta0 */
117  case (kPdgS31m1620_DeltaP ) : /* Delta+ */
118  case (kPdgS31m1620_DeltaPP) : /* Delta++ */
119  return kS31_1620; break;
120 
121  case (kPdgD33m1700_DeltaM ) : /* Delta- */
122  case (kPdgD33m1700_Delta0 ) : /* Delta0 */
123  case (kPdgD33m1700_DeltaP ) : /* Delta+ */
124  case (kPdgD33m1700_DeltaPP) : /* Delta++ */
125  return kD33_1700; break;
126 
127  case (kPdgP11m1440_N0) : /* N0 */
128  case (kPdgP11m1440_NP) : /* N+ */
129  return kP11_1440; break;
130 
131  case (kPdgP33m1600_DeltaM) : /* Delta- */
132  case (kPdgP33m1600_Delta0) : /* Delta0 */
133  case (kPdgP33m1600_DeltaP) : /* Delta+ */
134  case (kPdgP33m1600_DeltaPP) : /* Delta++ */
135  return kP33_1600; break;
136 
137  case (kPdgP13m1720_N0) : /* N0 */
138  case (kPdgP13m1720_NP) : /* N+ */
139  return kP13_1720; break;
140 
141  case (kPdgF15m1680_N0) : /* N0 */
142  case (kPdgF15m1680_NP) : /* N+ */
143  return kF15_1680; break;
144 
145  case (kPdgP31m1910_DeltaM ) : /* Delta- */
146  case (kPdgP31m1910_Delta0 ) : /* Delta0 */
147  case (kPdgP31m1910_DeltaP ) : /* Delta+ */
148  case (kPdgP31m1910_DeltaPP) : /* Delta++ */
149  return kP31_1910; break;
150 
151  case (kPdgP33m1920_DeltaM ) : /* Delta- */
152  case (kPdgP33m1920_Delta0 ) : /* Delta0 */
153  case (kPdgP33m1920_DeltaP ) : /* Delta+ */
154  case (kPdgP33m1920_DeltaPP) : /* Delta++ */
155  return kP33_1920; break;
156 
157  case (kPdgF35m1905_DeltaM ) : /* Delta- */
158  case (kPdgF35m1905_Delta0 ) : /* Delta0 */
159  case (kPdgF35m1905_DeltaP ) : /* Delta+ */
160  case (kPdgF35m1905_DeltaPP) : /* Delta++ */
161  return kF35_1905; break;
162 
163  case (kPdgF37m1950_DeltaM ) : /* Delta- */
164  case (kPdgF37m1950_Delta0 ) : /* Delta0 */
165  case (kPdgF37m1950_DeltaP ) : /* Delta+ */
166  case (kPdgF37m1950_DeltaPP) : /* Delta++ */
167  return kF37_1950; break;
168 
169  case (kPdgP11m1710_N0) : /* N0 */
170  case (kPdgP11m1710_NP) : /* N+ */
171  return kP11_1710; break;
172 
173  case (kPdgF17m1970_N0) : /* N0 */
174  case (kPdgF17m1970_NP) : /* N+ */
175  return kF17_1970; break;
176  }
177 
178  return kNoResonance;
179 }
180 //____________________________________________________________________________
182 {
183 
184  switch(res) {
185 
186  case kP33_1232:
187  if(Q == -1) return kPdgP33m1232_DeltaM; /* Delta- */
188  if(Q == 0) return kPdgP33m1232_Delta0; /* Delta0 */
189  if(Q == 1) return kPdgP33m1232_DeltaP; /* Delta+ */
190  if(Q == 2) return kPdgP33m1232_DeltaPP; /* Delta++ */
191  break;
192 
193  case kS11_1535:
194  if(Q == 0) return kPdgS11m1535_N0; /* N0 */
195  if(Q == 1) return kPdgS11m1535_NP; /* N+ */
196  break;
197 
198  case kD13_1520:
199  if(Q == 0) return kPdgD13m1520_N0; /* N0 */
200  if(Q == 1) return kPdgD13m1520_NP; /* N+ */
201  break;
202 
203  case kS11_1650:
204  if(Q == 0) return kPdgS11m1650_N0; /* N0 */
205  if(Q == 1) return kPdgS11m1650_NP; /* N+ */
206  break;
207 
208  case kD13_1700:
209  if(Q == 0) return kPdgD13m1700_N0; /* N0 */
210  if(Q == 1) return kPdgD13m1700_NP; /* N+ */
211  break;
212 
213  case kD15_1675:
214  if(Q == 0) return kPdgD15m1675_N0; /* N0 */
215  if(Q == 1) return kPdgD15m1675_NP; /* N+ */
216  break;
217 
218  case kS31_1620:
219  if(Q == -1) return kPdgS31m1620_DeltaM; /* Delta- */
220  if(Q == 0) return kPdgS31m1620_Delta0; /* Delta0 */
221  if(Q == 1) return kPdgS31m1620_DeltaP; /* Delta+ */
222  if(Q == 2) return kPdgS31m1620_DeltaPP; /* Delta++ */
223  break;
224 
225  case kD33_1700:
226  if(Q == -1) return kPdgD33m1700_DeltaM; /* Delta- */
227  if(Q == 0) return kPdgD33m1700_Delta0; /* Delta0 */
228  if(Q == 1) return kPdgD33m1700_DeltaP; /* Delta+ */
229  if(Q == 2) return kPdgD33m1700_DeltaPP; /* Delta++ */
230  break;
231 
232  case kP11_1440:
233  if(Q == 0) return kPdgP11m1440_N0; /* N0 */
234  if(Q == 1) return kPdgP11m1440_NP; /* N+ */
235  break;
236 
237  case kP33_1600:
238  if(Q == -1) return kPdgP33m1600_DeltaM; /* Delta- */
239  if(Q == 0) return kPdgP33m1600_Delta0; /* Delta0 */
240  if(Q == 1) return kPdgP33m1600_DeltaP; /* Delta+ */
241  if(Q == 2) return kPdgP33m1600_DeltaPP; /* Delta++ */
242  break;
243 
244  case kP13_1720:
245  if(Q == 0) return kPdgP13m1720_N0; /* N0 */
246  if(Q == 1) return kPdgP13m1720_NP; /* N+ */
247  break;
248 
249  case kF15_1680:
250  if(Q == 0) return kPdgF15m1680_N0; /* N0 */
251  if(Q == 1) return kPdgF15m1680_NP; /* N+ */
252  break;
253 
254  case kP31_1910:
255  if(Q == -1) return kPdgP31m1910_DeltaM; /* Delta- */
256  if(Q == 0) return kPdgP31m1910_Delta0; /* Delta0 */
257  if(Q == 1) return kPdgP31m1910_DeltaP; /* Delta+ */
258  if(Q == 2) return kPdgP31m1910_DeltaPP; /* Delta++ */
259  break;
260 
261  case kP33_1920:
262  if(Q == -1) return kPdgP33m1920_DeltaM; /* Delta- */
263  if(Q == 0) return kPdgP33m1920_Delta0; /* Delta0 */
264  if(Q == 1) return kPdgP33m1920_DeltaP; /* Delta+ */
265  if(Q == 2) return kPdgP33m1920_DeltaPP; /* Delta++ */
266  break;
267 
268  case kF35_1905:
269  if(Q == -1) return kPdgF35m1905_DeltaM; /* Delta- */
270  if(Q == 0) return kPdgF35m1905_Delta0; /* Delta0 */
271  if(Q == 1) return kPdgF35m1905_DeltaP; /* Delta+ */
272  if(Q == 2) return kPdgF35m1905_DeltaPP; /* Delta++ */
273  break;
274 
275  case kF37_1950:
276  if(Q == -1) return kPdgF37m1950_DeltaM; /* Delta- */
277  if(Q == 0) return kPdgF37m1950_Delta0; /* Delta0 */
278  if(Q == 1) return kPdgF37m1950_DeltaP; /* Delta+ */
279  if(Q == 2) return kPdgF37m1950_DeltaPP; /* Delta++ */
280  break;
281 
282  case kP11_1710:
283  if(Q == 0) return kPdgP11m1710_N0; /* N0 */
284  if(Q == 1) return kPdgP11m1710_NP; /* N+ */
285  break;
286 
287  case kF17_1970:
288  if(Q == 0) return kPdgF17m1970_N0; /* N0 */
289  if(Q == 1) return kPdgF17m1970_NP; /* N+ */
290  break;
291 
292  default:
293  return 0;
294  }
295 
296  return 0;
297 }
298 //____________________________________________________________________________
300 {
301 
302  switch(pdgc) {
303 
304  /* ------ P33(1232) ------*/
305  case (kPdgP33m1232_DeltaM ) : /* Delta- */
306  case (kPdgP33m1232_Delta0 ) : /* Delta0 */
307  case (kPdgP33m1232_DeltaP ) : /* Delta+ */
308  case (kPdgP33m1232_DeltaPP) : /* Delta++ */
309 
310  /* ------ S11(1535) ------*/
311  case (kPdgS11m1535_N0) : /* N0 */
312  case (kPdgS11m1535_NP) : /* N+ */
313 
314  /* ------ D13(1520) ------*/
315  case (kPdgD13m1520_N0) : /* N0 */
316  case (kPdgD13m1520_NP) : /* N+ */
317 
318  /* ------ S11(1650) ------*/
319  case (kPdgS11m1650_N0) : /* N0 */
320  case (kPdgS11m1650_NP) : /* N+ */
321 
322  /* ------ D13(1700) ------*/
323  case (kPdgD13m1700_N0) : /* N0 */
324  case (kPdgD13m1700_NP) : /* N+ */
325 
326  /* ------ D15(1675) ------*/
327  case (kPdgD15m1675_N0) : /* N0 */
328  case (kPdgD15m1675_NP) : /* N+ */
329 
330  /* ------ S31(1620) ------*/
331  case (kPdgS31m1620_DeltaM ) : /* Delta- */
332  case (kPdgS31m1620_Delta0 ) : /* Delta0 */
333  case (kPdgS31m1620_DeltaP ) : /* Delta+ */
334  case (kPdgS31m1620_DeltaPP) : /* Delta++ */
335 
336  /* ------ D33(1700) ------*/
337  case (kPdgD33m1700_DeltaM ) : /* Delta- */
338  case (kPdgD33m1700_Delta0 ) : /* Delta0 */
339  case (kPdgD33m1700_DeltaP ) : /* Delta+ */
340  case (kPdgD33m1700_DeltaPP) : /* Delta++ */
341 
342  /* ------ P11(1440) ------*/
343  case (kPdgP11m1440_N0) : /* N0 */
344  case (kPdgP11m1440_NP) : /* N+ */
345 
346  /* ------ P33(1600) ------*/
347  case (kPdgP33m1600_DeltaM ) : /* Delta- */
348  case (kPdgP33m1600_Delta0 ) : /* Delta0 */
349  case (kPdgP33m1600_DeltaP ) : /* Delta+ */
350  case (kPdgP33m1600_DeltaPP) : /* Delta++ */
351 
352  /* ------ P13(1720) ------*/
353  case (kPdgP13m1720_N0) : /* N0 */
354  case (kPdgP13m1720_NP) : /* N+ */
355 
356  /* ------ F15(1680) ------*/
357  case (kPdgF15m1680_N0) : /* N0 */
358  case (kPdgF15m1680_NP) : /* N+ */
359 
360  /* ------ P31(1910) ------*/
361  case (kPdgP31m1910_DeltaM ) : /* Delta- */
362  case (kPdgP31m1910_Delta0 ) : /* Delta0 */
363  case (kPdgP31m1910_DeltaP ) : /* Delta+ */
364  case (kPdgP31m1910_DeltaPP) : /* Delta++ */
365 
366  /* ------ P33(1920) ------*/
367  case (kPdgP33m1920_DeltaM ) : /* Delta- */
368  case (kPdgP33m1920_Delta0 ) : /* Delta0 */
369  case (kPdgP33m1920_DeltaP ) : /* Delta+ */
370  case (kPdgP33m1920_DeltaPP) : /* Delta++ */
371 
372  /* ------ F35(1905) ------*/
373  case (kPdgF35m1905_DeltaM ) : /* Delta- */
374  case (kPdgF35m1905_Delta0 ) : /* Delta0 */
375  case (kPdgF35m1905_DeltaP ) : /* Delta+ */
376  case (kPdgF35m1905_DeltaPP) : /* Delta++ */
377 
378  /* ------ F37(1950) ------*/
379  case (kPdgF37m1950_DeltaM ) : /* Delta- */
380  case (kPdgF37m1950_Delta0 ) : /* Delta0 */
381  case (kPdgF37m1950_DeltaP ) : /* Delta+ */
382  case (kPdgF37m1950_DeltaPP) : /* Delta++ */
383 
384  /* ------ P11(1710) ------*/
385  case (kPdgP11m1710_N0) : /* N0 */
386  case (kPdgP11m1710_NP) : /* N+ */
387 
388  /* ------ F17(1970) ------*/
389  case (kPdgF17m1970_N0) : /* N0 */
390  case (kPdgF17m1970_NP) : /* N+ */
391 
392  return true;
393  }
394 
395  return false;
396 }
397 //____________________________________________________________________________
399 {
400  switch(res) {
401 
402  case kP33_1232: return true; break;
403  case kS11_1535: return false; break;
404  case kD13_1520: return false; break;
405  case kS11_1650: return false; break;
406  case kD13_1700: return false; break;
407  case kD15_1675: return false; break;
408  case kS31_1620: return true; break;
409  case kD33_1700: return true; break;
410  case kP11_1440: return false; break;
411  case kP33_1600: return true; break;
412  case kP13_1720: return false; break;
413  case kF15_1680: return false; break;
414  case kP31_1910: return true; break;
415  case kP33_1920: return true; break;
416  case kF35_1905: return true; break;
417  case kF37_1950: return true; break;
418  case kP11_1710: return false; break;
419  case kF17_1970: return false; break;
420  default:
421  // should not be here - meaningless to return anything
422  gAbortingInErr = true;
423  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
424  exit(1);
425  }
426  return false;
427 }
428 //____________________________________________________________________________
429 // The values of resonance mass and width is taken from
430 // M. Tanabashi et al. (Particle Data Group) Phys. Rev. D 98, 030001
432 {
433  return (! utils::res::IsDelta(res) );
434 }
435 //____________________________________________________________________________
437 {
438  if (res == kNoResonance)
439  return -1;
440 
441  // Hardcoded data are removed, now they are taken from PDG table via TDatabasePDG and cached
442  static std::map<Resonance_t, double> cache ;
443 
444  auto it = cache.find( res ) ;
445  if ( it != cache.end() )
446  return it -> second ;
447 
448  PDGLibrary * pdglib = PDGLibrary::Instance();
449  int pdg = genie::utils::res::PdgCode(res, 0); // the mass doesn't depend on resonance charge
450  TParticlePDG * res_pdg = pdglib->Find( pdg );
451  if (res_pdg != 0)
452  {
453  double mass = res_pdg->Mass() * units::GeV;
454  return cache[res] = mass;
455  }
456 
457  // should not be here - meaningless to return anything
458  gAbortingInErr = true;
459  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
460  exit(1);
461 }
462 //____________________________________________________________________________
464 
465  if (res == kNoResonance)
466  return -1;
467 
468  // Hardcoded data are removed, now they are taken from PDG table via TDatabasePDG and cached
469  static std::map<Resonance_t, double> cache ;
470 
471  auto it = cache.find( res ) ;
472  if ( it != cache.end() )
473  return it -> second ;
474 
475  PDGLibrary * pdglib = PDGLibrary::Instance();
476  int pdg = genie::utils::res::PdgCode(res, 0); // the width doesn't depend on resonance charge
477  TParticlePDG * res_pdg = pdglib->Find( pdg );
478  if (res_pdg != 0) {
479  double width = res_pdg->Width() * units::GeV;
480  return cache[res] = width;
481  }
482 
483  // should not be here - meaningless to return anything
484  gAbortingInErr = true;
485  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
486  exit(1);
487 
488 }
489 //____________________________________________________________________________
491  double N0ResMaxNWidths, double N2ResMaxNWidths, double GnResMaxNWidths) {
492 
493  if (res == kNoResonance)
494  return -1;
495 
496  static std::map<Resonance_t, double> cache ;
497 
498  auto it = cache.find( res ) ;
499  if ( it != cache.end() )
500  return it -> second ;
501 
502  // Get baryon resonance parameters
503  int IR = utils::res::ResonanceIndex (res);
504  int LR = utils::res::OrbitalAngularMom (res);
505  double MR = utils::res::Mass (res);
506  double WR = utils::res::Width (res);
507 
508  // imported part of code from src/contrib/misc/bwnorm.C
509 
510  double NW = GnResMaxNWidths;
511  if(IR==2) NW = N2ResMaxNWidths;
512  if(IR==0) NW = N0ResMaxNWidths;
513 
514  double Wmin = 0.001;
515  double Wmax = MR + NW*WR;
516  int N = 1000* TMath::Nint( (Wmax-Wmin)/WR );
517  if(N%2==0) N++;
518 
519  double dW = (Wmax-Wmin)/(N-1);
520 
521  double norm = 0.5 * (genie::utils::bwfunc::BreitWignerL(Wmin,LR,MR,WR,1.0) + genie::utils::bwfunc::BreitWignerL(Wmax,LR,MR,WR,1.0));
522 
523  for(int i=1; i<N-1; i++) {
524  double W = Wmin + i*dW;
525  norm += ( genie::utils::bwfunc::BreitWignerL(W,LR,MR,WR,1.0) * (i%2+1) );
526  }
527  norm *= (2.*dW/3.);
528  return cache[res] = norm;
529 }
530 //____________________________________________________________________________
532 {
533  switch(res) {
534  case kP33_1232: return 1; break;
535  case kS11_1535: return 0; break;
536  case kD13_1520: return 2; break;
537  case kS11_1650: return 0; break;
538  case kD13_1700: return 2; break;
539  case kD15_1675: return 2; break;
540  case kS31_1620: return 0; break;
541  case kD33_1700: return 2; break;
542  case kP11_1440: return 1; break;
543  case kP33_1600: return 1; break;
544  case kP13_1720: return 1; break;
545  case kF15_1680: return 3; break;
546  case kP31_1910: return 1; break;
547  case kP33_1920: return 1; break;
548  case kF35_1905: return 3; break;
549  case kF37_1950: return 3; break;
550  case kP11_1710: return 1; break;
551  case kF17_1970: return 3; break;
552  default:
553  // should not be here - meaningless to return anything
554  gAbortingInErr = true;
555  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
556  exit(1);
557  }
558  return 0;
559 }
560 //____________________________________________________________________________
562 {
563  switch(res) {
564  case kP33_1232: return 0; break;
565  case kS11_1535: return 1; break;
566  case kD13_1520: return 1; break;
567  case kS11_1650: return 1; break;
568  case kD13_1700: return 1; break;
569  case kD15_1675: return 1; break;
570  case kS31_1620: return 1; break;
571  case kD33_1700: return 1; break;
572  case kP11_1440: return 2; break;
573  case kP33_1600: return 2; break;
574  case kP13_1720: return 2; break;
575  case kF15_1680: return 2; break;
576  case kP31_1910: return 2; break;
577  case kP33_1920: return 2; break;
578  case kF35_1905: return 2; break;
579  case kF37_1950: return 2; break;
580  case kP11_1710: return 2; break;
581  case kF17_1970: return 2; break;
582  default:
583  // should not be here - meaningless to return anything
584  gAbortingInErr = true;
585  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
586  exit(1);
587  }
588  return 0;
589 }
590 //____________________________________________________________________________
592 {
593  switch(res) {
594  case kP33_1232: return 3; break;
595  case kS11_1535: return 1; break;
596  case kD13_1520: return 1; break;
597  case kS11_1650: return 1; break;
598  case kD13_1700: return 1; break;
599  case kD15_1675: return 1; break;
600  case kS31_1620: return 3; break;
601  case kD33_1700: return 3; break;
602  case kP11_1440: return 1; break;
603  case kP33_1600: return 3; break;
604  case kP13_1720: return 1; break;
605  case kF15_1680: return 1; break;
606  case kP31_1910: return 3; break;
607  case kP33_1920: return 3; break;
608  case kF35_1905: return 3; break;
609  case kF37_1950: return 3; break;
610  case kP11_1710: return 1; break;
611  case kF17_1970: return 1; break;
612  default:
613  // should not be here - meaningless to return anything
614  gAbortingInErr = true;
615  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
616  exit(1);
617  }
618  return 0;
619 }
620 //____________________________________________________________________________
621 // The function returns 2*j, j-resonance angular momentum
623 {
624  switch(res) {
625  case kP33_1232: return 3; break;
626  case kS11_1535: return 1; break;
627  case kD13_1520: return 3; break;
628  case kS11_1650: return 1; break;
629  case kD13_1700: return 3; break;
630  case kD15_1675: return 5; break;
631  case kS31_1620: return 1; break;
632  case kD33_1700: return 3; break;
633  case kP11_1440: return 1; break;
634  case kP33_1600: return 3; break;
635  case kP13_1720: return 3; break;
636  case kF15_1680: return 5; break;
637  case kP31_1910: return 1; break;
638  case kP33_1920: return 3; break;
639  case kF35_1905: return 5; break;
640  case kF37_1950: return 7; break;
641  case kP11_1710: return 1; break;
642  case kF17_1970: return 7; break;
643  default:
644  // should not be here - meaningless to return anything
645  gAbortingInErr = true;
646  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
647  exit(1);
648  }
649  return 0;
650 }
651 //____________________________________________________________________________
653 // signs of angular momentum Clebsch-Gordon coefficient for RSPP model
654 {
655 
656  switch(res) {
657  case kP33_1232: return 1; break;
658  case kS11_1535: return 1; break;
659  case kD13_1520: return -1; break;
660  case kS11_1650: return 1; break;
661  case kD13_1700: return -1; break;
662  case kD15_1675: return 1; break;
663  case kS31_1620: return 1; break;
664  case kD33_1700: return -1; break;
665  case kP11_1440: return -1; break;
666  case kP33_1600: return 1; break;
667  case kP13_1720: return 1; break;
668  case kF15_1680: return -1; break;
669  case kP31_1910: return -1; break;
670  case kP33_1920: return 1; break;
671  case kF35_1905: return -1; break;
672  case kF37_1950: return 1; break;
673  case kP11_1710: return -1; break;
674  case kF17_1970: return 1; break;
675  default:
676  // should not be here - meaningless to return anything
677  gAbortingInErr = true;
678  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
679  exit(1);
680  }
681  return 0;
682 }
683 //____________________________________________________________________________
684 // Rein-Sehgal signs for RSPP model
686 {
687 
688  switch(res) {
689  case kP33_1232: return 1; break;
690  case kS11_1535: return 1; break;
691  case kD13_1520: return -1; break;
692  case kS11_1650: return 1; break;
693  case kD13_1700: return -1; break;
694  case kD15_1675: return -1; break;
695  case kS31_1620: return -1; break;
696  case kD33_1700: return 1; break;
697  case kP11_1440: return -1; break;
698  case kP33_1600: return 1; break;
699  case kP13_1720: return -1; break;
700  case kF15_1680: return 1; break;
701  case kP31_1910: return -1; break;
702  case kP33_1920: return -1; break;
703  case kF35_1905: return 1; break;
704  case kF37_1950: return 1; break;
705  case kP11_1710: return -1; break;
706  case kF17_1970: return -1; break;
707  default:
708  // should not be here - meaningless to return anything
709  gAbortingInErr = true;
710  LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
711  exit(1);
712  }
713  return 0;
714 }
715 /*
716 // Not used in the latest version
717 //____________________________________________________________________________
718 //phases between resonances and nonresonant helicity amplitudes for MK model
719 double genie::utils::res::AxialPhase(Resonance_t res)
720 {
721 
722 switch(res) {
723 case kP33_1232: return 2.97; break;
724 case kS11_1535: return 0.93; break;
725 case kD13_1520: return 0.00; break;
726 case kS11_1650: return 0.00; break;
727 case kD13_1700: return 0.00; break;
728 case kD15_1675: return 0.00; break;
729 case kS31_1620: return 0.00; break;
730 case kD33_1700: return 0.00; break;
731 case kP11_1440: return 0.64; break;
732 case kP33_1600: return 0.00; break;
733 case kP13_1720: return 0.00; break;
734 case kF15_1680: return 0.00; break;
735 case kP31_1910: return 0.00; break;
736 case kP33_1920: return 0.00; break;
737 case kF35_1905: return 0.00; break;
738 case kF37_1950: return 0.00; break;
739 case kP11_1710: return 0.00; break;
740 case kF17_1970: return 0.00; break;
741 default:
742 // should not be here - meaningless to return anything
743 gAbortingInErr = true;
744 LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
745 exit(1);
746 }
747 }
748 //____________________________________________________________________________
749 //phases between resonances and nonresonant helicity amplitudes for MK model
750 double genie::utils::res::VectorPhase(Resonance_t res)
751 {
752 
753 switch(res) {
754 case kP33_1232: return -2.860; break;
755 case kS11_1535: return 0.000; break;
756 case kD13_1520: return 2.498; break;
757 case kS11_1650: return kPi; break;
758 case kD13_1700: return 0.000; break;
759 case kD15_1675: return 0.000; break;
760 case kS31_1620: return 0.000; break;
761 case kD33_1700: return 0.000; break;
762 case kP11_1440: return 0.000; break;
763 case kP33_1600: return 0.000; break;
764 case kP13_1720: return 0.000; break;
765 case kF15_1680: return 0.000; break;
766 case kP31_1910: return 0.000; break;
767 case kP33_1920: return 0.000; break;
768 case kF35_1905: return 0.000; break;
769 case kF37_1950: return 0.000; break;
770 case kP11_1710: return 0.000; break;
771 case kF17_1970: return 0.000; break;
772 default:
773 // should not be here - meaningless to return anything
774 gAbortingInErr = true;
775 LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
776 exit(1);
777 }
778 }
779 //____________________________________________________________________________
780 //Vector form factors parameter for MK model
781 double genie::utils::res::CV40(Resonance_t res)
782 {
783 
784 switch(res) {
785 case kP33_1232: return 1.12; break;
786 case kS11_1535: return 1.00; break;
787 case kD13_1520: return 1.00; break;
788 case kS11_1650: return 1.00; break;
789 case kD13_1700: return 1.00; break;
790 case kD15_1675: return 1.00; break;
791 case kS31_1620: return 1.00; break;
792 case kD33_1700: return 1.00; break;
793 case kP11_1440: return 1.00; break;
794 case kP33_1600: return 1.00; break;
795 case kP13_1720: return 1.00; break;
796 case kF15_1680: return 1.00; break;
797 case kP31_1910: return 1.00; break;
798 case kP33_1920: return 1.00; break;
799 case kF35_1905: return 1.00; break;
800 case kF37_1950: return 1.00; break;
801 case kP11_1710: return 1.00; break;
802 case kF17_1970: return 1.00; break;
803 default:
804 // should not be here - meaningless to return anything
805 gAbortingInErr = true;
806 LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
807 exit(1);
808 }
809 }
810 //____________________________________________________________________________
811 //Axial form factors parameter for MK model
812 double genie::utils::res::CA50(Resonance_t res)
813 {
814 
815 switch(res) {
816 case kP33_1232: return 1.02; break;
817 case kS11_1535: return 1.53; break;
818 case kD13_1520: return 0.50; break;
819 case kS11_1650: return 1.00; break;
820 case kD13_1700: return 1.00; break;
821 case kD15_1675: return 0.60; break;
822 case kS31_1620: return 1.00; break;
823 case kD33_1700: return 1.00; break;
824 case kP11_1440: return 1.00; break;
825 case kP33_1600: return 1.00; break;
826 case kP13_1720: return 1.10; break;
827 case kF15_1680: return 1.30; break;
828 case kP31_1910: return 0.60; break;
829 case kP33_1920: return 0.60; break;
830 case kF35_1905: return 0.60; break;
831 case kF37_1950: return 1.40; break;
832 case kP11_1710: return 1.20; break;
833 case kF17_1970: return 1.00; break;
834 default:
835 // should not be here - meaningless to return anything
836 gAbortingInErr = true;
837 LOG("BaryonResUtils", pFATAL) << "Unknown resonance " << res;
838 exit(1);
839 }
840 }
841 //____________________________________________________________________________
842 */
bool IsDelta(Resonance_t res)
is it a Delta resonance?
const int kPdgP31m1910_DeltaP
Definition: PDGCodes.h:138
const int kPdgS31m1620_DeltaM
Definition: PDGCodes.h:118
const int kPdgP33m1232_DeltaPP
Definition: PDGCodes.h:107
Resonance_t FromString(const char *res)
string -> resonance id
Basic constants.
const int kPdgF35m1905_DeltaM
Definition: PDGCodes.h:144
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
const int kPdgD15m1675_N0
Definition: PDGCodes.h:116
const int kPdgF35m1905_Delta0
Definition: PDGCodes.h:145
const int kPdgF15m1680_NP
Definition: PDGCodes.h:135
const int kPdgD33m1700_Delta0
Definition: PDGCodes.h:123
const int kPdgD13m1700_NP
Definition: PDGCodes.h:115
#define pFATAL
Definition: Messenger.h:56
const int kPdgP33m1600_DeltaP
Definition: PDGCodes.h:130
double Mass(Resonance_t res)
resonance mass (GeV)
const int kPdgS11m1650_N0
Definition: PDGCodes.h:112
double Width(Resonance_t res)
resonance width (GeV)
const int kPdgF37m1950_DeltaM
Definition: PDGCodes.h:148
const int kPdgF37m1950_DeltaP
Definition: PDGCodes.h:150
int AngularMom(Resonance_t res)
double BreitWignerL(double W, int L, double mass, double width0, double norm)
Definition: BWFunc.cxx:99
const int kPdgP33m1600_Delta0
Definition: PDGCodes.h:129
const int kPdgS11m1535_N0
Definition: PDGCodes.h:108
double BWNorm(Resonance_t res, double N0ResMaxNWidths=6, double N2ResMaxNWidths=2, double GnResMaxNWidths=4)
breit-wigner normalization factor
enum genie::EResonance Resonance_t
bool IsN(Resonance_t res)
is it an N resonance?
const int kPdgP33m1232_DeltaP
Definition: PDGCodes.h:106
const int kPdgP33m1232_DeltaM
Definition: PDGCodes.h:104
const int kPdgP31m1910_DeltaM
Definition: PDGCodes.h:136
int Cjsgn_plus(Resonance_t res)
const int kPdgP33m1600_DeltaPP
Definition: PDGCodes.h:131
const int kPdgF37m1950_Delta0
Definition: PDGCodes.h:149
const int kPdgD33m1700_DeltaPP
Definition: PDGCodes.h:125
const int kPdgF35m1905_DeltaP
Definition: PDGCodes.h:146
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgD15m1675_NP
Definition: PDGCodes.h:117
static constexpr double GeV
Definition: Units.h:28
const int kPdgF35m1905_DeltaPP
Definition: PDGCodes.h:147
const int kPdgS31m1620_DeltaPP
Definition: PDGCodes.h:121
const int kPdgP31m1910_DeltaPP
Definition: PDGCodes.h:139
const int kPdgP33m1920_DeltaPP
Definition: PDGCodes.h:143
const int kPdgP31m1910_Delta0
Definition: PDGCodes.h:137
int OrbitalAngularMom(Resonance_t res)
orbital angular momentum
const int kPdgP33m1920_DeltaP
Definition: PDGCodes.h:142
const int kPdgD33m1700_DeltaM
Definition: PDGCodes.h:122
const int kPdgP33m1920_DeltaM
Definition: PDGCodes.h:140
const int kPdgF37m1950_DeltaPP
Definition: PDGCodes.h:151
const int kPdgD13m1520_NP
Definition: PDGCodes.h:111
const int kPdgF15m1680_N0
Definition: PDGCodes.h:134
const int kPdgP11m1710_N0
Definition: PDGCodes.h:152
const int kPdgS11m1650_NP
Definition: PDGCodes.h:113
Resonance_t FromPdgCode(int pdgc)
PDG code -> resonance id.
const int kPdgP33m1600_DeltaM
Definition: PDGCodes.h:128
auto norm(Vector const &v)
Return norm of the specified vector.
const int kPdgP33m1232_Delta0
Definition: PDGCodes.h:105
const int kPdgP13m1720_N0
Definition: PDGCodes.h:132
const int kPdgP11m1440_N0
Definition: PDGCodes.h:126
int Dsgn(Resonance_t res)
const int kPdgP33m1920_Delta0
Definition: PDGCodes.h:141
const int kPdgD13m1520_N0
Definition: PDGCodes.h:110
const int kPdgP11m1440_NP
Definition: PDGCodes.h:127
const int kPdgS31m1620_Delta0
Definition: PDGCodes.h:119
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:32
int strcmp(const String &s1, const String &s2)
Definition: relates.cpp:14
const char * AsString(Resonance_t res)
resonance id -> string
bool IsBaryonResonance(int pdgc)
is input a baryon resonance?
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
const int kPdgP11m1710_NP
Definition: PDGCodes.h:153
const int kPdgF17m1970_N0
Definition: PDGCodes.h:154
const int kPdgF17m1970_NP
Definition: PDGCodes.h:155
const int kPdgS11m1535_NP
Definition: PDGCodes.h:109
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
bool gAbortingInErr
Definition: Messenger.cxx:34
const int kPdgS31m1620_DeltaP
Definition: PDGCodes.h:120
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
const int kPdgP13m1720_NP
Definition: PDGCodes.h:133
int Isospin(Resonance_t res)
int ResonanceIndex(Resonance_t res)
resonance idx, quark model / SU(6)
const int kPdgD13m1700_N0
Definition: PDGCodes.h:114
const int kPdgD33m1700_DeltaP
Definition: PDGCodes.h:124