OscProb
OscProb::PremModel Class Reference

Implements an earth model with spherical shells. More...

#include <PremModel.h>

Inheritance diagram for OscProb::PremModel:
OscProb::EarthModelBase

Public Member Functions

 PremModel (std::string filename="")
 Constructor. More...
 
virtual ~PremModel ()
 Destructor. More...
 
void SetDetPos (double rad, double lat=0, double lon=0)
 
int FillPath (double cosT, double phi=0)
 Fill the path sequence in a vector. More...
 
virtual void LoadModel (std::string filename)
 Load an earth model from a file. More...
 
virtual std::vector< PremLayerGetPremLayers ()
 
virtual void SetLayerZoA (int layer, double zoa)
 Set Z/A of all layers of a given type. More...
 
virtual double GetLayerZoA (int layer)
 Get Z/A of all layers of a given type. More...
 
virtual void SetTopLayerSize (double thick)
 Set the outermost layer thickness in km. More...
 
virtual std::vector< NuPathGetNuPath ()
 
virtual std::vector< NuPathGetMergedPaths (double prec=0.25)
 Get merged path sequence in a vector. More...
 
virtual double GetTotalL (double cosT)
 Get the total baseline for a given cosTheta. More...
 
virtual double GetCosT (double L)
 Get the cosTheta for a given total baseline. More...
 
virtual void SetRemoveSmallPaths (bool rp=true)
 Set tag to remove small paths. More...
 

Protected Member Functions

virtual void ClearModel ()
 Clear the earth model information. More...
 
virtual void AddLayer (double radius, double density, double zoa, double layer)
 Add a layer to the model. More...
 
virtual void AddPath (double length, PremLayer pl)
 Add a path segment to the sequence. More...
 
virtual void AddDetLayer ()
 Add the detector layer. More...
 
virtual void CleanIdentical ()
 Clear identical consecutive layers. More...
 
 ClassDef (PremModel, 1)
 
virtual void SetDetectorCoordinates (double rad, double lat, double lon)
 
virtual void AddPathSegment (double length, double density, double zoa, int index)
 Add a path segment to the sequence. More...
 
 ClassDef (EarthModelBase, 1)
 

Protected Attributes

std::vector< PremLayerfPremLayers
 The layers in the earth model. More...
 
int fDetLayer
 The layer index of the detector. More...
 
std::string fFilename
 The input filename. More...
 
std::vector< NuPathfNuPath
 The current neutrino path sequence. More...
 
double fRadiusMax
 Maximum radius in Earth model (in km) More...
 
double fDetRadius
 The radius where the detector sits (in km) More...
 
double fDetLat
 The latitude (in rad) where the detector sits. More...
 
double fDetLon
 The longitude (in rad) where the detector sits. More...
 
bool fRemoveSmallPaths
 Tag whether to merge small paths. More...
 

Static Protected Attributes

static const double DET_TOL = 0.2
 The detector position tolerance near boundaries. More...
 

Detailed Description

This class implements a spherically symmetric model of the earth using PremLayer's to store spherical shells with different properties.

The class is then able to produce path sequences through the different earth layers as a function of the cosine of the zenith angle with respect to the detector.

The detector can be positioned at any radius within the model and the path sequences will take into account the fact that some layers are above the detector.

By default this implements the model stored in PremTables/prem_default.txt with the detector at the bottom of the ocean layer (radius = 6368 km).

This class inherits from EarthModelBase and can be saved in ROOT files.

Author
jcoelho@apc.in2p3.fr

Definition at line 33 of file PremModel.h.

Constructor & Destructor Documentation

◆ PremModel()

PremModel::PremModel ( std::string  filename = "")

Constructor.

By default this implements the model stored in PremTables/prem_default.txt with the detector at the bottom of the ocean layer (radius = 6368 km).

Parameters
filename- The txt file containing a table of earth layers

Definition at line 35 of file PremModel.cxx.

35 : fDetLayer(0)
36{
38 SetDetPos(6368);
39 LoadModel(filename);
40}
virtual void SetRemoveSmallPaths(bool rp=true)
Set tag to remove small paths.
int fDetLayer
The layer index of the detector.
Definition: PremModel.h:73
virtual void LoadModel(std::string filename)
Load an earth model from a file.
Definition: PremModel.cxx:181
void SetDetPos(double rad, double lat=0, double lon=0)
Definition: PremModel.cxx:131

References LoadModel(), SetDetPos(), and OscProb::EarthModelBase::SetRemoveSmallPaths().

◆ ~PremModel()

PremModel::~PremModel ( )
virtual

Nothing to clean.

Definition at line 46 of file PremModel.cxx.

46{}

Member Function Documentation

◆ AddDetLayer()

void PremModel::AddDetLayer ( )
protectedvirtual

Add a detector layer at the detector position if needed. If not, set the detector layer to an existing boundary.

Definition at line 73 of file PremModel.cxx.

74{
76
77 fDetLayer = fPremLayers.size() - 1;
78
79 if (fPremLayers.size() && fDetRadius > fPremLayers.back().radius) {
80 cerr << "WARNING: Detector must be inside Earth model." << endl
81 << "WARNING: Adjusting detector radius from " << fDetRadius
82 << " km to " << fPremLayers.back().radius << " km." << endl;
83
84 fDetRadius = fPremLayers.back().radius;
85
86 return;
87 }
88
89 for (int i = 0; i < fPremLayers.size(); i++) {
90 double radius = fPremLayers[i].radius;
91
92 // See if we passed the detector and decide whether
93 // to create a special layer for it
94 if (radius > fDetRadius - DET_TOL) {
95 fDetLayer = i;
96
97 // If detector is not near boundary, add a special layer
98 if (radius > fDetRadius + DET_TOL) {
99 PremLayer det_layer = fPremLayers[i];
100 det_layer.radius = fDetRadius;
101 fPremLayers.insert(fPremLayers.begin() + fDetLayer, det_layer);
102 }
103 else if (radius != fDetRadius) {
104 // update detector radius
105 cerr << "WARNING: Adjusting detector radius from " << fDetRadius
106 << " km to " << radius << " km." << endl;
107 fDetRadius = radius;
108 }
109
110 break;
111 }
112 }
113}
double fDetRadius
The radius where the detector sits (in km)
virtual void CleanIdentical()
Clear identical consecutive layers.
Definition: PremModel.cxx:54
static const double DET_TOL
The detector position tolerance near boundaries.
Definition: PremModel.h:78
std::vector< PremLayer > fPremLayers
The layers in the earth model.
Definition: PremModel.h:71
A struct representing a spherical shell of matter for earth models.
Definition: NuPath.h:84
double radius
The outer radius of the layer in km.
Definition: NuPath.h:128

References CleanIdentical(), DET_TOL, fDetLayer, OscProb::EarthModelBase::fDetRadius, fPremLayers, and OscProb::PremLayer::radius.

Referenced by LoadModel(), and SetDetPos().

◆ AddLayer()

void PremModel::AddLayer ( double  radius,
double  density,
double  zoa,
double  layer 
)
protectedvirtual

Add a layer to the earth model.

Parameters
radius- The outer radius of the layer in km
density- The density of the layer in g/cm^3
zoa- The effective Z/A value of the layer
layer- An index to identify the matter type (e.g. earth inner core)

Definition at line 167 of file PremModel.cxx.

169{
170 fPremLayers.push_back(PremLayer(radius, density, zoa, layer));
171}

References fPremLayers.

Referenced by LoadModel().

◆ AddPath()

void PremModel::AddPath ( double  length,
PremLayer  pl 
)
protectedvirtual

Add a path segment to the sequence.

For a given PremLayer, adds a path of a given length in that material

Parameters
length- The length of the path segment in km
pl- The layer we are crossing

Definition at line 325 of file PremModel.cxx.

326{
327 AddPathSegment(length, pl.density, pl.zoa, pl.layer);
328}
virtual void AddPathSegment(double length, double density, double zoa, int index)
Add a path segment to the sequence.
double zoa
The effective Z/A value of the layer.
Definition: NuPath.h:130
double density
The density of the layer in g/cm^3.
Definition: NuPath.h:129
int layer
An index to identify the matter type.
Definition: NuPath.h:131

References OscProb::EarthModelBase::AddPathSegment(), OscProb::PremLayer::density, OscProb::PremLayer::layer, and OscProb::PremLayer::zoa.

Referenced by FillPath().

◆ AddPathSegment()

void EarthModelBase::AddPathSegment ( double  length,
double  density,
double  zoa,
int  index 
)
protectedvirtualinherited

Add a path segment to the sequence.

For a given EarthBin, adds a path of a given length in that material

Parameters
length- The length of the path segment in km
density- The density along the path segment
zoa- Z/A along the path segment
index- Index for the matter along the path segment

Definition at line 65 of file EarthModelBase.cxx.

67{
68 fNuPath.push_back(NuPath(length, density, zoa, index));
69}
std::vector< NuPath > fNuPath
The current neutrino path sequence.
A struct representing a neutrino path segment.
Definition: NuPath.h:34

References OscProb::EarthModelBase::fNuPath.

Referenced by OscProb::EarthModelBinned::AddPath(), and AddPath().

◆ ClassDef() [1/2]

OscProb::EarthModelBase::ClassDef ( EarthModelBase  ,
 
)
protectedinherited

◆ ClassDef() [2/2]

OscProb::PremModel::ClassDef ( PremModel  ,
 
)
protected

◆ CleanIdentical()

void PremModel::CleanIdentical ( )
protectedvirtual

Clean identical consecutive layers. This is used in particular to remove previously added detector layers.

Definition at line 54 of file PremModel.cxx.

55{
56 int i = 0;
57
58 while (i < int(fPremLayers.size()) - 1) {
59 if (fPremLayers[i] == fPremLayers[i + 1]) {
60 fPremLayers.erase(fPremLayers.begin() + i);
61 continue;
62 }
63
64 i++;
65 }
66}

References fPremLayers.

Referenced by AddDetLayer().

◆ ClearModel()

void PremModel::ClearModel ( )
protectedvirtual

Clear the earth model information.

Definition at line 151 of file PremModel.cxx.

152{
153 fDetLayer = 0;
154 fPremLayers.clear();
155}

References fDetLayer, and fPremLayers.

Referenced by LoadModel().

◆ FillPath()

int PremModel::FillPath ( double  cosT,
double  phi = 0 
)
virtual

Fill the path sequence in a vector.

This will start at the upper-most layer and find straight paths to the boundary of the next layer down. When reaching the inner-most layer in the given direction, the paths move back to outer layers until hitting the detector.

The path sequence is stored as an attribute and can be retrieved with the function GetNuPath.

Parameters
cosT- The cosine of the zenith angle of the neutrino direction
phi- The azimuthal angle of the neutrino direction (default = 0; not used)
Returns
The number of path segments in the sequence

Implements OscProb::EarthModelBase.

Definition at line 347 of file PremModel.cxx.

348{
349 // Clear current path sequence
350 fNuPath.clear();
351
352 // Do nothing if cosine is unphysical
353 if (fabs(cosT) > 1) return 0;
354
355 // Define the minimum path radius
356 double minR = fDetRadius * sqrt(1 - cosT * cosT);
357 double minRsq = minR * minR;
358
359 // Set the top layer index
360 int toplayer = fPremLayers.size() - 1;
361
362 // Find the inner-most crossed layer
363 int minlayer = 0;
364 while (fPremLayers[minlayer].radius < minR) minlayer++;
365
366 // Compute the number of path segments needed
367 int nsteps = toplayer - fDetLayer;
368 if (cosT < 0) nsteps += 2 * (fDetLayer - minlayer) + 1;
369
370 // Start at the top layer and go down
371 int layer = toplayer;
372 int dl = -1;
373
374 // Loop over all path segments
375 for (int i = 0; i < nsteps; i++) {
376 // Get square of the path length between this layer's
377 // outer radius and inner-most radius
378 double L1 = pow(fPremLayers[layer].radius, 2) - minRsq;
379
380 // If L1 is negative, outer radius is not crossed.
381 // This only happens if detector is at the top layer and the
382 // neutrino is coming from above.
383 if (L1 < 0) return true;
384
385 // Get square of the path length between this layer's
386 // inner radius and inner-most radius
387 double L2 = -minRsq;
388 if (layer > 0) L2 += pow(fPremLayers[layer - 1].radius, 2);
389
390 // If L2 is negative, inner radius is not crossed,
391 // so set this as the minimum layer.
392 bool ismin = (L2 <= 0 && cosT < 0);
393
394 // Store the path segment length
395 double dL;
396
397 // If it's the minimum layer, connect two outer radius
398 // crossing points. If not, compute difference between
399 // inner and outer radius crossings.
400 if (ismin)
401 dL = 2 * sqrt(L1);
402 else if (L2 >= 0)
403 dL = sqrt(L1) - sqrt(L2);
404 else
405 dL = sqrt(L1); // This should never actually happen,
406 // but protect in case L2 is slightly
407 // negative when it should be zero.
408 // e.g. arriving at the detector from above.
409
410 // Add this path segment to the sequence
411 AddPath(dL, fPremLayers[layer]);
412
413 // If we reached the inner-most layer,
414 // start moving up again.
415 if (ismin) dl = 1;
416
417 // Move to next layer
418 layer += dl;
419 }
420
421 // Return the number of path segments
422 return fNuPath.size();
423}
virtual void AddPath(double length, PremLayer pl)
Add a path segment to the sequence.
Definition: PremModel.cxx:325

References AddPath(), fDetLayer, OscProb::EarthModelBase::fDetRadius, OscProb::EarthModelBase::fNuPath, and fPremLayers.

◆ GetCosT()

double EarthModelBase::GetCosT ( double  L)
virtualinherited

Get the cosTheta for a given total baseline.

Given a baseline, find the direction of the neutrino. This could be useful for experiments with fixed baselines for example.

The baseline must be within the range of possible values in this earth model. Will return vertical neutrinos otherwise.

Parameters
L- The total baseline of the neutrino

Definition at line 99 of file EarthModelBase.cxx.

100{
101 if (L < fRadiusMax - fDetRadius) return 1;
102 if (L > fRadiusMax + fDetRadius) return -1;
103
104 return (fRadiusMax * fRadiusMax - fDetRadius * fDetRadius - L * L) /
105 (2 * fDetRadius * L);
106}
double fRadiusMax
Maximum radius in Earth model (in km)

References OscProb::EarthModelBase::fDetRadius, and OscProb::EarthModelBase::fRadiusMax.

◆ GetLayerZoA()

double PremModel::GetLayerZoA ( int  layer)
virtual

Get the effective Z/A value for all layers of a given type, e.g. all outer-core layers.

Parameters
layer- The index of the layer type
Returns
Z/A corresponding to layer

Definition at line 256 of file PremModel.cxx.

257{
258 int nlayers = fPremLayers.size();
259
260 // This check assumes the layer types are in increasing order
261 if (layer > fPremLayers.back().layer) {
262 cerr << "ERROR: Not that many layer types. Returning 0" << endl;
263 return 0;
264 }
265
266 for (int i = 0; i < nlayers; i++) {
267 if (fPremLayers[i].layer != layer)
268 continue;
269
270 else
271 return fPremLayers[i].zoa;
272 }
273
274 // End of vector reached without finding input type
275 cerr << "ERROR: layer type not found. Returning 0" << endl;
276 return 0;
277}

References fPremLayers.

◆ GetMergedPaths()

vector< NuPath > EarthModelBase::GetMergedPaths ( double  prec = 0.25)
virtualinherited

Merge similar paths to reduce number of steps

This method will merge consecutive paths and take their averages until it finds a large enough gap to start a new merged path.

The merged paths will be returned, and the original detailed path will not be changed and will stay stored as an attribute.

Parameters
prec- The precision to merge paths in g/cm^3
Returns
The vector of merged path segments

Definition at line 121 of file EarthModelBase.cxx.

122{
123 // The output vector
124 vector<NuPath> mergedPath;
125
126 // Start with the first path
127 NuPath path = fNuPath[0];
128
129 // Track the total length
130 double totL = 0;
131
132 // Loop over all paths starting from second
133 for (int i = 1; i < fNuPath.size(); i++) {
134 // If this path electron density is beyond the tolerance
135 if (fabs(path.density * path.zoa - fNuPath[i].density * fNuPath[i].zoa) >
136 prec * path.zoa) {
137 // Add merged path to vector
138 mergedPath.push_back(path);
139
140 // Set this path as new merged path
141 path = fNuPath[i];
142 }
143 else { // If path is within tolerance
144
145 // Merge the path with current merged path
146 path = AvgPath(path, fNuPath[i]);
147 }
148
149 // Increment total length
150 totL += fNuPath[i].length;
151
152 } // End of loop over paths
153
154 // Add the final merged path to vector
155 mergedPath.push_back(path);
156
157 // If tag is true, remove small paths
158 if (fRemoveSmallPaths) {
159 // Start at first path
160 int k = 0;
161
162 // While not at the end of vector
163 while (k + 1 < mergedPath.size()) {
164 // If length is less than 1% of total
165 if (mergedPath[k].length < 0.01 * totL) {
166 // Merge path with following path
167 mergedPath = MergePaths(mergedPath, k, k + 1);
168 }
169 // If path is long enough skip it
170 else
171 k++;
172
173 } // End of while loop
174
175 } // End of if statement
176
177 // return the merged vector
178 return mergedPath;
179}
bool fRemoveSmallPaths
Tag whether to merge small paths.
std::vector< NuPath > MergePaths(std::vector< NuPath > &inputPath, int j, int k)
Merge paths j and k in vector.
Definition: NuPath.cxx:89
NuPath AvgPath(NuPath &p1, NuPath &p2)
Get the average of two paths.
Definition: NuPath.cxx:27
double density
The density of the path segment in g/cm^3.
Definition: NuPath.h:79
double zoa
The effective Z/A value of the path segment.
Definition: NuPath.h:80

References OscProb::AvgPath(), OscProb::NuPath::density, OscProb::EarthModelBase::fNuPath, OscProb::EarthModelBase::fRemoveSmallPaths, OscProb::MergePaths(), and OscProb::NuPath::zoa.

◆ GetNuPath()

vector< NuPath > EarthModelBase::GetNuPath ( )
virtualinherited

Get the current neutrino path sequence

Get the current neutrino path sequence

The path needs to be filled for a given cosTheta before calling this function.

Definition at line 52 of file EarthModelBase.cxx.

52{ return fNuPath; }

References OscProb::EarthModelBase::fNuPath.

◆ GetPremLayers()

vector< PremLayer > PremModel::GetPremLayers ( )
virtual

Get the set of earth layers

Get the set of earth layers

This returns the set of PremLayer's for this earth model and detector position.

Definition at line 145 of file PremModel.cxx.

145{ return fPremLayers; }

References fPremLayers.

◆ GetTotalL()

double EarthModelBase::GetTotalL ( double  cosT)
virtualinherited

Get the total baseline for a given cosTheta.

Parameters
cosT- The cosine of the neutrino direction

Definition at line 77 of file EarthModelBase.cxx.

78{
79 if (fabs(cosT) > 1) return 0;
80
81 double sinsqrT = 1 - cosT * cosT;
82
83 return -fDetRadius * cosT +
84 sqrt(fRadiusMax * fRadiusMax - fDetRadius * fDetRadius * sinsqrT);
85}

References OscProb::EarthModelBase::fDetRadius, and OscProb::EarthModelBase::fRadiusMax.

◆ LoadModel()

void PremModel::LoadModel ( std::string  filename)
virtual

Load an earth model from a file.

By default it loads the model stored in PremTables/prem_default.txt

Parameters
filename- The txt file containing a table of earth layers

Definition at line 181 of file PremModel.cxx.

182{
183 // Clear the current model
184 ClearModel();
185
186 // Use default if no file provided
187 if (filename == "") { filename = PREM_DEFAULT; }
188
189 // Open the file
190 ifstream fin;
191 fin.open(filename.c_str());
192
193 if (!fin) {
194 cerr << "ERROR: File " << filename << " not found!" << endl;
195 return;
196 }
197
198 // Variables for storing table rows
199 float radius, density, zoa, layer;
200
201 // Keep track of previous radius
202 double rprev = 0;
203
204 // Loop over table rows
205 while (fin >> radius >> density >> zoa >> layer) {
206 // Radii must be ordered in model file
207 if (radius <= rprev) {
208 cerr
209 << "ERROR: Radii are not sorted in increasing order in the model file"
210 << endl;
211 ClearModel();
212 return;
213 }
214
215 // Add this layer to the model
216 AddLayer(radius, density, zoa, layer);
217 }
218
219 AddDetLayer();
220
221 // Set the maximum radius in the model
222 fRadiusMax = fPremLayers.back().radius;
223}
virtual void AddLayer(double radius, double density, double zoa, double layer)
Add a layer to the model.
Definition: PremModel.cxx:167
virtual void AddDetLayer()
Add the detector layer.
Definition: PremModel.cxx:73
virtual void ClearModel()
Clear the earth model information.
Definition: PremModel.cxx:151

References AddDetLayer(), AddLayer(), ClearModel(), fPremLayers, and OscProb::EarthModelBase::fRadiusMax.

Referenced by PremModel().

◆ SetDetectorCoordinates()

void EarthModelBase::SetDetectorCoordinates ( double  rad,
double  lat,
double  lon 
)
protectedvirtualinherited

Set the coordinates of the detector (rad = radius in km, lat/lon in deg)

Set the coordinates of the detector: radius in km, latitude in degrees, longitude in degrees

Parameters
rad- The distance from the detector to the Earth's center in km
lat- The latitude of the detector in deg N (between -90 and 90)
lon- The longitude of the detector in deg E (between 0 and 360)

Definition at line 25 of file EarthModelBase.cxx.

26{
27 // Force radius to be non-negative
28 if (rad < 0) {
29 cerr << "WARNING: Negative radius detected. Setting to absolute value."
30 << endl;
31 rad = -rad;
32 }
33 fDetRadius = rad;
34
35 // Force latitude to be between -90 and 90 deg
36 lat -= floor((lat + 90.0) / 360.0) * 360.0;
37 if (lat > 90) { lat = 180.0 - lat; }
38 fDetLat = lat / 180.0 * M_PI; // convert to radians
39
40 // Force longitude to be between 0 and 360 deg
41 lon -= floor(lon / 360.0) * 360.0;
42 fDetLon = lon / 180.0 * M_PI; // convert to radians
43}
double fDetLat
The latitude (in rad) where the detector sits.
double fDetLon
The longitude (in rad) where the detector sits.

References OscProb::EarthModelBase::fDetLat, OscProb::EarthModelBase::fDetLon, and OscProb::EarthModelBase::fDetRadius.

Referenced by OscProb::EarthModelBinned::SetDetPos(), and SetDetPos().

◆ SetDetPos()

void PremModel::SetDetPos ( double  rad,
double  lat = 0,
double  lon = 0 
)
virtual

Set the detector position (rad = radius in km, lat/lon in deg)

Set the coordinates of the detector: radius in km, latitude in degrees, longitude in degrees The latitude and longitude are not actually used in PremModel functions.

If the position is within 200m of a layer boundary, the detector is considered to be on the boundary. If not, an extra boundary is inserted in the detector position to distinguish what parts of the earth are above and below the detector.

Parameters
rad- The distance from the detector to the Earth's center in km
lat- The latitude of the detector in deg N (between -90 and 90)
lon- The longitude of the detector in deg E (between 0 and 360)

Implements OscProb::EarthModelBase.

Definition at line 131 of file PremModel.cxx.

132{
133 SetDetectorCoordinates(rad, lat, lon);
134
135 if (fPremLayers.size()) AddDetLayer();
136}
virtual void SetDetectorCoordinates(double rad, double lat, double lon)

References AddDetLayer(), fPremLayers, and OscProb::EarthModelBase::SetDetectorCoordinates().

Referenced by PremModel().

◆ SetLayerZoA()

void PremModel::SetLayerZoA ( int  layer,
double  zoa 
)
virtual

Set the effective Z/A value for all layers of a given type.

Use this to change the Z/A of indexed layer, e.g. all outer-core layers

Parameters
layer- The index of the layer type
zoa- The effective Z/A value to use

Definition at line 235 of file PremModel.cxx.

236{
237 int nlayers = fPremLayers.size();
238
239 // Loop over all layers and change the ones
240 // with the given index
241 for (int i = 0; i < nlayers; i++) {
242 if (fPremLayers[i].layer != layer) continue;
243
244 fPremLayers[i].zoa = zoa;
245 }
246}

References fPremLayers.

◆ SetRemoveSmallPaths()

void EarthModelBase::SetRemoveSmallPaths ( bool  rp = true)
virtualinherited

Set the boolean to tag whether to remove small paths when merging Small is defined as <1% of the total baseline

Parameters
rp- Boolean value to set

Definition at line 188 of file EarthModelBase.cxx.

188{ fRemoveSmallPaths = rp; }

References OscProb::EarthModelBase::fRemoveSmallPaths.

Referenced by OscProb::EarthModelBinned::EarthModelBinned(), and PremModel().

◆ SetTopLayerSize()

void PremModel::SetTopLayerSize ( double  thick)
virtual

Set the radius of the outermost layer of the model.

This usually corresponds to the atmosphere and is useful for computing oscillations with variable neutrino production height.

Parameters
thick- The thickness of the outer layer in km

Definition at line 288 of file PremModel.cxx.

289{
290 if (thick <= 0) {
291 cerr << "WARNING: Layer thickness should be positive. Do nothing." << endl;
292 return;
293 }
294
295 int nlayers = fPremLayers.size();
296
297 if (nlayers < 1) {
298 cerr << "WARNING: PremModel has no layers. Do nothing." << endl;
299 return;
300 }
301
302 double bottomRadius;
303 if (nlayers > 1)
304 bottomRadius = fPremLayers[nlayers - 2].radius;
305 else
306 bottomRadius = 0;
307
308 double topRadius = bottomRadius + thick;
309
310 fPremLayers[nlayers - 1].radius = topRadius;
311
312 // Update max radius
313 fRadiusMax = fPremLayers.back().radius;
314}

References fPremLayers, and OscProb::EarthModelBase::fRadiusMax.

Member Data Documentation

◆ DET_TOL

const double PremModel::DET_TOL = 0.2
staticprotected

Define the tolerance of the detector around a boundary when considering whether to add a new layer for the detector position.

Definition at line 78 of file PremModel.h.

Referenced by AddDetLayer().

◆ fDetLat

double OscProb::EarthModelBase::fDetLat
protectedinherited

◆ fDetLayer

int OscProb::PremModel::fDetLayer
protected

Definition at line 73 of file PremModel.h.

Referenced by AddDetLayer(), ClearModel(), and FillPath().

◆ fDetLon

double OscProb::EarthModelBase::fDetLon
protectedinherited

◆ fDetRadius

◆ fFilename

std::string OscProb::PremModel::fFilename
protected

Definition at line 75 of file PremModel.h.

◆ fNuPath

◆ fPremLayers

std::vector<PremLayer> OscProb::PremModel::fPremLayers
protected

◆ fRadiusMax

◆ fRemoveSmallPaths

bool OscProb::EarthModelBase::fRemoveSmallPaths
protectedinherited

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