Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
genie::alvarezruso::ARSampledNucleus Class Reference

Nucleus class for Alvarez-Ruso Coherent Pion Production xsec. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Physics/Coherent/XSection/ARSampledNucleus.h"

Public Member Functions

 ARSampledNucleus (unsigned int ZNumber, unsigned int ANumber, unsigned int sampling=20)
 
 ~ARSampledNucleus ()
 
unsigned int A () const
 
unsigned int Z () const
 
unsigned int N () const
 
double Density (const int i, const int j) const
 
double DensityOfCentres (const int i, const int j) const
 
double Radius (const int i, const int j) const
 
double RadiusMax () const
 
double SamplePoint1 (const unsigned int i) const
 
double SamplePoint2 (const unsigned int i) const
 
unsigned int GetSampling (void) const
 
unsigned int GetNDensities (void) const
 
double CalcMatterDensity (double r) const
 
double CalcNumberDensity (double r) const
 

Private Member Functions

void Fill ()
 
void FillSamplePoints ()
 
void FillDensities ()
 
double CalcDensity (double radius, double nuc_rad, double nuc_diff) const
 
double Density0 (unsigned int number, double diffuseness, double radius) const
 
TF1 * Density0Function () const
 

Static Private Member Functions

static Double_t Density0FunctionFermiLiquid (Double_t *r, Double_t *parameters)
 

Private Attributes

const unsigned int fZ
 
const unsigned int fA
 
unsigned int fSampling
 
unsigned int fNDensities
 
double fR_max
 
double ** fRadii
 
double ** fDensities
 
double ** fDensitiesOfCentres
 
double * fSample_points_1
 
double * fSample_points_2
 
double * fSample_weights_1
 
double * fSample_weights_2
 
double fDiffuseness
 
double fNucRadius
 
double fNucRadiusSq
 
double fDiffusenessCentres
 
double fRadiusCentres
 
double fUseHarmonicOscillator
 

Static Private Attributes

static double mean_radius_squared = 0.69
 

Detailed Description

Nucleus class for Alvarez-Ruso Coherent Pion Production xsec.

Author
Steve Dennis University of Warwick, Rutherford Appleton Laboratory

05/12/2013

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 31 of file ARSampledNucleus.h.

Constructor & Destructor Documentation

genie::alvarezruso::ARSampledNucleus::ARSampledNucleus ( unsigned int  ZNumber,
unsigned int  ANumber,
unsigned int  sampling = 20 
)

Definition at line 48 of file ARSampledNucleus.cxx.

References fA, fDensities, fDensitiesOfCentres, fDiffuseness, fDiffusenessCentres, Fill(), fNDensities, fNucRadius, fNucRadiusSq, fRadii, fRadiusCentres, fSample_points_1, fSample_points_2, fSample_weights_1, fSample_weights_2, fSampling, fUseHarmonicOscillator, genie::constants::kPi2, mean_radius_squared, cet::pow(), std::sqrt(), ana::Sqrt(), and submit_syst::x.

48  :
49  fZ(ZNumber),
50  fA(ANumber),
51  fSampling(fSampling_)
52 {
54 
55  fDensities = NULL;
56  fDensitiesOfCentres = NULL;
57  fRadii = NULL;
58  fSample_points_1 = NULL;
59  fSample_points_2 = NULL;
60  fSample_weights_1 = NULL;
61  fSample_weights_2 = NULL;
62 
63  if(fA>20) { // fermi gas
64  if (fA == 27) { fNucRadius = 3.07; fDiffuseness = 0.52; } // aluminum
65  else if (fA == 28) { fNucRadius = 3.07; fDiffuseness = 0.54; } // silicon
66  else if (fA == 40) { fNucRadius = 3.53; fDiffuseness = 0.54; } // argon
67  else if (fA == 56) { fNucRadius = 4.10; fDiffuseness = 0.56; } // iron
68  else if (fA == 208) { fNucRadius = 6.62; fDiffuseness = 0.55; } // lead
69  else {
70  fNucRadius = pow(fA,0.35); fDiffuseness = 0.54;
71  } //others
72  fUseHarmonicOscillator = false;
73  }
74  else {
75  if (fA == 7) { fNucRadius = 1.77 ; fDiffuseness = 0.327;} // lithium
76  else if (fA == 12) { fNucRadius = 1.692 ; fDiffuseness = 1.083;} // carbon
77  else if (fA == 14) { fNucRadius = 1.76 ; fDiffuseness = 1.23; } // nitrogen
78  else if (fA == 16) { fNucRadius = 1.83 ; fDiffuseness = 1.54; } // oxygen
79  else if (fA <= 4 ) { fNucRadius = 1.344 ; fDiffuseness = 0.00; } // helium
80  else {
81  fNucRadius=1.75; fDiffuseness=-0.4+.12*fA;
82  } //others- fDiffuseness=0.08 if A=4
83 
85  }
86 
88 
89  // Calculate number densities (density of 'centres'):
90  double diff2 = fDiffuseness*fDiffuseness;
93  double x = (fDiffuseness * fNucRadiusSq) / ((1 + (1.5*fDiffuseness)) * (fRadiusCentres*fRadiusCentres));
94  fDiffusenessCentres = 2.*x / (2. - 3.*x ) ;
95  }
96  else { //fermi liquid
97  double numerator = 5.0 * mean_radius_squared * fNucRadius;
98  double denominator = (15.0 * (fNucRadiusSq)) + (7.0 * kPi2 * fDiffuseness*fDiffuseness);
99  fRadiusCentres = fNucRadius + (numerator / denominator);
100 
101  numerator = (fNucRadiusSq*fNucRadius) + (kPi2 * diff2 * fRadiusCentres) - (fRadiusCentres*fRadiusCentres*fRadiusCentres);
102  denominator = kPi2 * fRadiusCentres;
103 
104  fDiffusenessCentres = sqrt( numerator / denominator );
105  }
106 
107  this->Fill();
108 }
T sqrt(T number)
Definition: d0nt_math.hpp:156
constexpr T pow(T x)
Definition: pow.h:75
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
static const double kPi2
Definition: Constants.h:39
genie::alvarezruso::ARSampledNucleus::~ARSampledNucleus ( )

Definition at line 110 of file ARSampledNucleus.cxx.

References fDensities, fDensitiesOfCentres, fNDensities, fRadii, fSample_points_1, fSample_points_2, fSample_weights_1, fSample_weights_2, and MECModelEnuComparisons::i.

111 {
112  for(unsigned int i = 0; i != fNDensities; ++i)
113  {
114  if (fDensities && fDensities [i]) delete[] fDensities[i];
116  if (fRadii && fRadii [i]) delete[] fRadii [i];
117  }
118 
119  if (fDensities ) delete[] fDensities;
121  if (fRadii ) delete[] fRadii ;
122  if (fSample_points_1 ) delete[] fSample_points_1;
123  if (fSample_points_2 ) delete[] fSample_points_2;
124  if (fSample_weights_1 ) delete[] fSample_weights_1;
125  if (fSample_weights_2 ) delete[] fSample_weights_2;
126 }

Member Function Documentation

unsigned int genie::alvarezruso::ARSampledNucleus::A ( void  ) const
inline

Definition at line 39 of file ARSampledNucleus.h.

References fA.

Referenced by genie::alvarezruso::AREikonalSolution::Element(), and Fill().

39 { return fA; }
double genie::alvarezruso::ARSampledNucleus::CalcDensity ( double  radius,
double  nuc_rad,
double  nuc_diff 
) const
private

Definition at line 219 of file ARSampledNucleus.cxx.

References Density0(), stan::math::exp(), fA, and fUseHarmonicOscillator.

Referenced by CalcMatterDensity(), and CalcNumberDensity().

220 {
221  double dens_rel;
223  dens_rel = (1.0 + nuc_diff*r*r/(nuc_rad*nuc_rad)) * exp(-r*r/(nuc_rad*nuc_rad));
224  }
225  else { //fermi liquid
226  dens_rel = 1.0 / (1.0 + exp((r - nuc_rad)/nuc_diff));
227  }
228 
229  //~ double dens_0 = utils::nuclear::Density(nuc_rad, fA);
230  double dens_0 = Density0(fA,nuc_rad,nuc_diff);
231 
232  return dens_0 * dens_rel;
233 }
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
double Density0(unsigned int number, double diffuseness, double radius) const
TRandom3 r(0)
double genie::alvarezruso::ARSampledNucleus::CalcMatterDensity ( double  r) const

Definition at line 280 of file ARSampledNucleus.cxx.

References CalcDensity(), fDiffuseness, and fNucRadius.

Referenced by FillDensities(), and SamplePoint2().

281 {
282  return this->CalcDensity(r,fNucRadius,fDiffuseness);
283 }
double CalcDensity(double radius, double nuc_rad, double nuc_diff) const
TRandom3 r(0)
double genie::alvarezruso::ARSampledNucleus::CalcNumberDensity ( double  r) const

Definition at line 285 of file ARSampledNucleus.cxx.

References CalcDensity(), fDiffusenessCentres, and fRadiusCentres.

Referenced by genie::alvarezruso::AREikonalSolution::Element(), FillDensities(), and SamplePoint2().

286 {
288 }
double CalcDensity(double radius, double nuc_rad, double nuc_diff) const
TRandom3 r(0)
double genie::alvarezruso::ARSampledNucleus::Density ( const int  i,
const int  j 
) const

Definition at line 142 of file ARSampledNucleus.cxx.

References fDensities, MECModelEnuComparisons::i, and calib::j.

Referenced by N().

143 {
144  return fDensities[i][j];
145 }
const double j
Definition: BetheBloch.cxx:29
double genie::alvarezruso::ARSampledNucleus::Density0 ( unsigned int  number,
double  diffuseness,
double  radius 
) const
private

Definition at line 235 of file ARSampledNucleus.cxx.

References Density0Function(), MakeMiniprodValidationCuts::f, fR_max, fUseHarmonicOscillator, radius, fillBadChanDBTables::result, ana::Sqrt(), and submit_hadd::u.

Referenced by CalcDensity().

240 {
241  double result = 0.0;
243  {
244  double u = fR_max/radius;
245  double dterm = (3*diffuseness+2);
246  double term1 = TMath::Sqrt(TMath::Pi())*dterm*TMath::Power(radius,3)*TMath::Exp(u*u)*TMath::Erf(u);
247  double term2 = 2*fR_max*(dterm*radius*radius+2*diffuseness*radius*radius);
248  result = (0.5)*TMath::Pi()*TMath::Exp(-u*u)*(term1 - term2);
249  }
250  else
251  {
252  //Probably faster to do this via the integral for the moment as ROOT doesn't have a builtin
253  //PolyLog function
254  TF1* f = this->Density0Function();
255  f->SetParameter(0, diffuseness);
256  f->SetParameter(1, radius);
257  result = f->Integral(0.0,fR_max);
258  delete f;
259  }
260 
261  return ( number / result );
262 }
Double_t radius
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
TF1 * genie::alvarezruso::ARSampledNucleus::Density0Function ( ) const
private

Definition at line 264 of file ARSampledNucleus.cxx.

References Density0FunctionFermiLiquid(), and fR_max.

Referenced by Density0().

265 {
266  return (new TF1("density0function", Density0FunctionFermiLiquid, 0.0, fR_max, 2));
267 }
static Double_t Density0FunctionFermiLiquid(Double_t *r, Double_t *parameters)
Double_t genie::alvarezruso::ARSampledNucleus::Density0FunctionFermiLiquid ( Double_t *  r,
Double_t *  parameters 
)
staticprivate

Definition at line 269 of file ARSampledNucleus.cxx.

References stan::math::exp(), r(), and radius.

Referenced by Density0Function().

270 {
271  double r = (*r_);
272  double diffuseness = parameters[0];
273  double radius = parameters[1];
274 
275  double dens = 1.0 / (1.0 + exp((r - radius)/diffuseness));
276 
277  return 4.0*TMath::Pi()*r*r*dens;
278 }
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
Double_t radius
TRandom3 r(0)
double genie::alvarezruso::ARSampledNucleus::DensityOfCentres ( const int  i,
const int  j 
) const
void genie::alvarezruso::ARSampledNucleus::Fill ( )
private

Definition at line 127 of file ARSampledNucleus.cxx.

References A(), fA, FillDensities(), FillSamplePoints(), fR_max, fZ, LOG, and pDEBUG.

Referenced by ARSampledNucleus(), and SamplePoint2().

128 {
129 
130  fR_max = 3.0 * TMath::Power(this->A(), (1.0/3.0));
131 
132 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
133  LOG("AR_PiWFunction_Table", pDEBUG)<< "N:: fR_max = " << fR_max
134  << "N:: z = " << fZ
135  << "N:: a = " << fA
136 #endif
137 
138  this->FillSamplePoints();
139  this->FillDensities();
140 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pDEBUG
Definition: Messenger.h:64
void genie::alvarezruso::ARSampledNucleus::FillDensities ( )
private

Definition at line 176 of file ARSampledNucleus.cxx.

References CalcMatterDensity(), CalcNumberDensity(), fDensities, fDensitiesOfCentres, fNDensities, fRadii, fSample_points_1, fSample_points_2, MECModelEnuComparisons::i, calib::j, r(), and ana::Sqrt().

Referenced by Fill(), and SamplePoint2().

177 {
178  double r;
179 
180  for(unsigned int i = 0; i != fNDensities; ++i)
181  {
182  if (fDensities && fDensities [i]) delete[] fDensities [i];
184  if (fRadii && fRadii [i]) delete[] fRadii [i];
185  }
186  if (fDensities ) delete[] fDensities;
188  if (fRadii ) delete[] fRadii ;
189 
190  fDensities = new double*[fNDensities];
191  fDensitiesOfCentres = new double*[fNDensities];
192  fRadii = new double*[fNDensities];
193 
194  for(unsigned int i = 0; i != fNDensities; ++i)
195  {
196  fDensities [i] = new double[fNDensities];
197  fDensitiesOfCentres[i] = new double[fNDensities];
198  fRadii [i] = new double[fNDensities];
199 
200  for(unsigned int j = 0; j != fNDensities; ++j)
201  {
203  fRadii[i][j] = r;
204  fDensities [i][j]=this->CalcMatterDensity(r);
206  }
207  }
208 }
double CalcMatterDensity(double r) const
const double j
Definition: BetheBloch.cxx:29
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
TRandom3 r(0)
double CalcNumberDensity(double r) const
void genie::alvarezruso::ARSampledNucleus::FillSamplePoints ( )
private

Definition at line 157 of file ARSampledNucleus.cxx.

References fNDensities, fR_max, fSample_points_1, fSample_points_2, fSample_weights_1, fSample_weights_2, fSampling, and genie::alvarezruso::integrationtools::SGNR().

Referenced by Fill(), and SamplePoint2().

158 {
159  if (fSample_points_1) delete[] fSample_points_1;
160  if (fSample_points_2) delete[] fSample_points_2;
161  if (fSample_weights_1) delete[] fSample_weights_1;
162  if (fSample_weights_2) delete[] fSample_weights_2;
163 
164  fSample_points_1 = new double[fNDensities];
165  fSample_points_2 = new double[fNDensities];
166 
167  fSample_weights_1 = new double[fNDensities];
168  fSample_weights_2 = new double[fNDensities];
169  unsigned int decoy;
170 
173 
174 }
void SGNR(const double a, const double b, const unsigned int n, const unsigned int nsamp, double *x, unsigned int &np, double *w)
unsigned int genie::alvarezruso::ARSampledNucleus::GetNDensities ( void  ) const
unsigned int genie::alvarezruso::ARSampledNucleus::GetSampling ( void  ) const

Definition at line 210 of file ARSampledNucleus.cxx.

References fSampling.

Referenced by SamplePoint2().

211 {
212  return fSampling;
213 }
unsigned int genie::alvarezruso::ARSampledNucleus::N ( void  ) const
inline

Definition at line 43 of file ARSampledNucleus.h.

References Density(), DensityOfCentres(), fA, fZ, MECModelEnuComparisons::i, calib::j, and Radius().

43 { return (fA-fZ); }
double genie::alvarezruso::ARSampledNucleus::Radius ( const int  i,
const int  j 
) const
double genie::alvarezruso::ARSampledNucleus::RadiusMax ( ) const
inline
double genie::alvarezruso::ARSampledNucleus::SamplePoint1 ( const unsigned int  i) const
inline
double genie::alvarezruso::ARSampledNucleus::SamplePoint2 ( const unsigned int  i) const
inline
unsigned int genie::alvarezruso::ARSampledNucleus::Z ( void  ) const
inline

Definition at line 41 of file ARSampledNucleus.h.

References fZ.

Referenced by genie::alvarezruso::AREikonalSolution::Element().

41 { return fZ; }

Member Data Documentation

const unsigned int genie::alvarezruso::ARSampledNucleus::fA
private

Definition at line 84 of file ARSampledNucleus.h.

Referenced by A(), ARSampledNucleus(), CalcDensity(), Fill(), and N().

double** genie::alvarezruso::ARSampledNucleus::fDensities
private

Definition at line 91 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), Density(), FillDensities(), and ~ARSampledNucleus().

double** genie::alvarezruso::ARSampledNucleus::fDensitiesOfCentres
private
double genie::alvarezruso::ARSampledNucleus::fDiffuseness
private

Definition at line 98 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), and CalcMatterDensity().

double genie::alvarezruso::ARSampledNucleus::fDiffusenessCentres
private

Definition at line 101 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), and CalcNumberDensity().

unsigned int genie::alvarezruso::ARSampledNucleus::fNDensities
private
double genie::alvarezruso::ARSampledNucleus::fNucRadius
private

Definition at line 99 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), and CalcMatterDensity().

double genie::alvarezruso::ARSampledNucleus::fNucRadiusSq
private

Definition at line 100 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus().

double genie::alvarezruso::ARSampledNucleus::fR_max
private

Definition at line 89 of file ARSampledNucleus.h.

Referenced by Density0(), Density0Function(), Fill(), FillSamplePoints(), and RadiusMax().

double** genie::alvarezruso::ARSampledNucleus::fRadii
private

Definition at line 90 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), FillDensities(), Radius(), and ~ARSampledNucleus().

double genie::alvarezruso::ARSampledNucleus::fRadiusCentres
private

Definition at line 102 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), and CalcNumberDensity().

double* genie::alvarezruso::ARSampledNucleus::fSample_points_1
private
double* genie::alvarezruso::ARSampledNucleus::fSample_points_2
private
double* genie::alvarezruso::ARSampledNucleus::fSample_weights_1
private

Definition at line 95 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), FillSamplePoints(), and ~ARSampledNucleus().

double* genie::alvarezruso::ARSampledNucleus::fSample_weights_2
private

Definition at line 96 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), FillSamplePoints(), and ~ARSampledNucleus().

unsigned int genie::alvarezruso::ARSampledNucleus::fSampling
private

Definition at line 85 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), FillSamplePoints(), and GetSampling().

double genie::alvarezruso::ARSampledNucleus::fUseHarmonicOscillator
private

Definition at line 104 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus(), CalcDensity(), and Density0().

const unsigned int genie::alvarezruso::ARSampledNucleus::fZ
private

Definition at line 83 of file ARSampledNucleus.h.

Referenced by Fill(), N(), and Z().

double genie::alvarezruso::ARSampledNucleus::mean_radius_squared = 0.69
staticprivate

Definition at line 110 of file ARSampledNucleus.h.

Referenced by ARSampledNucleus().


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