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 <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-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 30 of file ARSampledNucleus.h.

Constructor & Destructor Documentation

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

Definition at line 46 of file ARSampledNucleus.cxx.

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

Definition at line 108 of file ARSampledNucleus.cxx.

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

Member Function Documentation

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

Definition at line 38 of file ARSampledNucleus.h.

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

Definition at line 217 of file ARSampledNucleus.cxx.

218 {
219  double dens_rel;
221  dens_rel = (1.0 + nuc_diff*r*r/(nuc_rad*nuc_rad)) * exp(-r*r/(nuc_rad*nuc_rad));
222  }
223  else { //fermi liquid
224  dens_rel = 1.0 / (1.0 + exp((r - nuc_rad)/nuc_diff));
225  }
226 
227  //~ double dens_0 = utils::nuclear::Density(nuc_rad, fA);
228  double dens_0 = Density0(fA,nuc_rad,nuc_diff);
229 
230  return dens_0 * dens_rel;
231 }
double Density0(unsigned int number, double diffuseness, double radius) const
double genie::alvarezruso::ARSampledNucleus::CalcMatterDensity ( double  r) const

Definition at line 278 of file ARSampledNucleus.cxx.

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

Definition at line 283 of file ARSampledNucleus.cxx.

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

Definition at line 140 of file ARSampledNucleus.cxx.

141 {
142  return fDensities[i][j];
143 }
double genie::alvarezruso::ARSampledNucleus::Density0 ( unsigned int  number,
double  diffuseness,
double  radius 
) const
private

Definition at line 233 of file ARSampledNucleus.cxx.

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

Definition at line 262 of file ARSampledNucleus.cxx.

263 {
264  return (new TF1("density0function", Density0FunctionFermiLiquid, 0.0, fR_max, 2));
265 }
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 267 of file ARSampledNucleus.cxx.

268 {
269  double r = (*r_);
270  double diffuseness = parameters[0];
271  double radius = parameters[1];
272 
273  double dens = 1.0 / (1.0 + exp((r - radius)/diffuseness));
274 
275  return 4.0*TMath::Pi()*r*r*dens;
276 }
double genie::alvarezruso::ARSampledNucleus::DensityOfCentres ( const int  i,
const int  j 
) const

Definition at line 145 of file ARSampledNucleus.cxx.

146 {
147  return fDensitiesOfCentres[i][j];
148 }
void genie::alvarezruso::ARSampledNucleus::Fill ( )
private

Definition at line 125 of file ARSampledNucleus.cxx.

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

Definition at line 174 of file ARSampledNucleus.cxx.

175 {
176  double r;
177 
178  for(unsigned int i = 0; i != fNDensities; ++i)
179  {
180  if (fDensities && fDensities [i]) delete[] fDensities [i];
182  if (fRadii && fRadii [i]) delete[] fRadii [i];
183  }
184  if (fDensities ) delete[] fDensities;
186  if (fRadii ) delete[] fRadii ;
187 
188  fDensities = new double*[fNDensities];
189  fDensitiesOfCentres = new double*[fNDensities];
190  fRadii = new double*[fNDensities];
191 
192  for(unsigned int i = 0; i != fNDensities; ++i)
193  {
194  fDensities [i] = new double[fNDensities];
195  fDensitiesOfCentres[i] = new double[fNDensities];
196  fRadii [i] = new double[fNDensities];
197 
198  for(unsigned int j = 0; j != fNDensities; ++j)
199  {
200  r = TMath::Sqrt( fSample_points_1[i]*fSample_points_1[i] + fSample_points_2[j]*fSample_points_2[j] );
201  fRadii[i][j] = r;
202  fDensities [i][j]=this->CalcMatterDensity(r);
203  fDensitiesOfCentres[i][j]=this->CalcNumberDensity(r);
204  }
205  }
206 }
double CalcMatterDensity(double r) const
double CalcNumberDensity(double r) const
void genie::alvarezruso::ARSampledNucleus::FillSamplePoints ( )
private

Definition at line 155 of file ARSampledNucleus.cxx.

156 {
157  if (fSample_points_1) delete[] fSample_points_1;
158  if (fSample_points_2) delete[] fSample_points_2;
159  if (fSample_weights_1) delete[] fSample_weights_1;
160  if (fSample_weights_2) delete[] fSample_weights_2;
161 
162  fSample_points_1 = new double[fNDensities];
163  fSample_points_2 = new double[fNDensities];
164 
165  fSample_weights_1 = new double[fNDensities];
166  fSample_weights_2 = new double[fNDensities];
167  unsigned int decoy;
168 
171 
172 }
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

Definition at line 212 of file ARSampledNucleus.cxx.

213 {
214  return fNDensities;
215 }
unsigned int genie::alvarezruso::ARSampledNucleus::GetSampling ( void  ) const

Definition at line 208 of file ARSampledNucleus.cxx.

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

Definition at line 42 of file ARSampledNucleus.h.

42 { return (fA-fZ); }
double genie::alvarezruso::ARSampledNucleus::Radius ( const int  i,
const int  j 
) const

Definition at line 150 of file ARSampledNucleus.cxx.

151 {
152  return fRadii[i][j];
153 }
double genie::alvarezruso::ARSampledNucleus::RadiusMax ( ) const
inline

Definition at line 48 of file ARSampledNucleus.h.

49  {
50  return fR_max;
51  }
double genie::alvarezruso::ARSampledNucleus::SamplePoint1 ( const unsigned int  i) const
inline

Definition at line 52 of file ARSampledNucleus.h.

53  {
54  return fSample_points_1[i];
55  }
double genie::alvarezruso::ARSampledNucleus::SamplePoint2 ( const unsigned int  i) const
inline

Definition at line 56 of file ARSampledNucleus.h.

57  {
58  return fSample_points_2[i];
59  }
unsigned int genie::alvarezruso::ARSampledNucleus::Z ( void  ) const
inline

Definition at line 40 of file ARSampledNucleus.h.

40 { return fZ; }

Member Data Documentation

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

Definition at line 83 of file ARSampledNucleus.h.

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

Definition at line 90 of file ARSampledNucleus.h.

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

Definition at line 91 of file ARSampledNucleus.h.

double genie::alvarezruso::ARSampledNucleus::fDiffuseness
private

Definition at line 97 of file ARSampledNucleus.h.

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

Definition at line 100 of file ARSampledNucleus.h.

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

Definition at line 86 of file ARSampledNucleus.h.

double genie::alvarezruso::ARSampledNucleus::fNucRadius
private

Definition at line 98 of file ARSampledNucleus.h.

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

Definition at line 99 of file ARSampledNucleus.h.

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

Definition at line 88 of file ARSampledNucleus.h.

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

Definition at line 89 of file ARSampledNucleus.h.

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

Definition at line 101 of file ARSampledNucleus.h.

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

Definition at line 92 of file ARSampledNucleus.h.

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

Definition at line 93 of file ARSampledNucleus.h.

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

Definition at line 94 of file ARSampledNucleus.h.

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

Definition at line 95 of file ARSampledNucleus.h.

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

Definition at line 84 of file ARSampledNucleus.h.

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

Definition at line 103 of file ARSampledNucleus.h.

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

Definition at line 82 of file ARSampledNucleus.h.

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

Definition at line 109 of file ARSampledNucleus.h.


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