OscProb
EarthModelBinned.h
Go to the documentation of this file.
1
30
43
54
63
72
73#ifndef EARTHMODELBINNED_H
74#define EARTHMODELBINNED_H
75
76#include "EarthModelBase.h"
77
78namespace OscProb {
79
96 TrajConstants(double cosT = 0, double phi = 0, double DetLat = 0,
97 double DetLon = 0, double rDet = 6368);
98
99 void UpdateNuAngles(
100 double cosTheta,
101 double phi);
103 void UpdateDetPos(double rDet, double DetLat,
104 double DetLon);
106 void Recalculate();
109
110 // Variables defining trajectory
111 double cosT;
112 double cosA;
113 double sinA;
114 double sinDetLat;
115 double cosDetLon;
116 double sinDetLon;
117 double DetRadius;
118
119 // Derived Variables Calculated by UpdateNuAngles()
120 double sinSqT;
121 double sinT;
122 double sinTsinA;
123 double sinTcosA;
124
125 // Derived Variables Calculated by UpdateDetPos()
126 double cosDetLat;
129
130 // Derived Variables Calculated by Recalculate()
134 double rDetCosT;
135 double rDetSinT;
136 double alpha;
137 double beta;
138 double gamma;
139 double gammaSq;
140 double
142 double maxSinSqLat;
143 double
147 };
148
149 struct EarthBin {
169 EarthBin(double r_out = 0, double r_in = 0, double lat = 0,
170 double lon = 0, double den = 0, double z = 0.5, int n = 0);
171
189 void SetBin(double r_out = 0, double r_in = 0, double lat = 0,
190 double lon = 0, double den = 0, double z = 0.5, int n = 0);
191
192 double radius_out;
193 double radius_in;
194 double latitude;
195 double longitude;
196 double density;
197 double zoa;
198 int index;
199 };
200
202 public:
203 EarthModelBinned(std::string filename = "");
204 virtual ~EarthModelBinned();
205
206 void SetDetPos(double rad, double lat = 0,
207 double lon = 0);
209
210 int FillPath(double cosT, double phi = 0);
212
213 virtual void LoadModel(
214 std::string filename);
215
216 virtual std::vector<EarthBin> GetEarthBins();
218
219 virtual void SetRegionZoA(
220 int index,
221 double zoa);
222 virtual double GetRegionZoA(
223 int index);
224 virtual void ScaleRegionDensity(
225 int index, double scalingfactor);
227
228 protected:
229 struct LatBinInfo {
230 int bin;
238 int sign;
242 double dLat;
249 };
250
251 struct LonBinInfo {
252 int bin;
260 double dLon;
264 double min;
265 double max;
266 int error = 0;
268 std::string
270 };
271
272 virtual void ClearModel();
273
274 virtual void AddBin(
275 double radius_out, double radius_in, double latitude,
276 double longitude, double density, double zoa,
277 double layer);
278
279 virtual void AddPath(
280 double length, EarthBin bin);
281
282 virtual double DetDistForNextLatBin(
283 int cur_index,
285 L);
287
288 virtual double DetDistForNextLonBin(
289 double prev_lon,
290 LonBinInfo& L);
293
294 virtual void RecordLatLonBinCrossings(
295 double detDist_nextDbin, double& DetDist, int& index,
296 LatBinInfo& latI,
298 lonI);
300
301 virtual int LonBinIndex(
302 double longitude);
303
305
306 std::vector<EarthBin> fEarthBins;
314
316
317 // For Latitude Calculation Error Message
321
322 // Required for saving in ROOT files
324 };
325
326} // namespace OscProb
327
328#endif
Base class for implementing an earth model.
Implements an earth model with depth/latitude/longitude bins.
virtual double GetRegionZoA(int index)
Get Z/A of all bins with specified region index.
virtual double DetDistForNextLonBin(double prev_lon, LonBinInfo &L)
std::vector< EarthBin > fEarthBins
The bins in the earth model.
virtual void ClearModel()
Clear the earth model information.
double fInvLonBinWidth
1/binwidth for each longitude bin
virtual void AddPath(double length, EarthBin bin)
Add a path segment to the sequence.
virtual ~EarthModelBinned()
Destructor.
int fnDepthBins
Total number of depth bins.
int FillPath(double cosT, double phi=0)
virtual std::vector< EarthBin > GetEarthBins()
virtual void LoadModel(std::string filename)
Load an earth model from a file.
EarthModelBinned(std::string filename="")
Constructor.
virtual void RecordLatLonBinCrossings(double detDist_nextDbin, double &DetDist, int &index, LatBinInfo &latI, LonBinInfo &lonI)
double fHalfLonBinWidth
Half-width of each longitude bin.
void SetDetPos(double rad, double lat=0, double lon=0)
virtual void SetRegionZoA(int index, double zoa)
Set Z/A of all bins with specified region index.
int fnLatBins
Total number of latitude bins.
virtual void AddBin(double radius_out, double radius_in, double latitude, double longitude, double density, double zoa, double layer)
Add a bin to the model (angles in degrees)
double fHalfLatBinWidth
Half-width of each latitude bin.
double fInvLatBinWidth
1/binwidth for each latitude bin
virtual int LonBinIndex(double longitude)
Find lon bin index containing longitude.
TrajConstants fC
Useful constants for the trajectory.
int fmaxRegIndex
Largest region index in model.
ClassDef(EarthModelBinned, 1)
virtual void ScaleRegionDensity(int index, double scalingfactor)
virtual double DetDistForNextLatBin(int cur_index, LatBinInfo &L)
int fnLonBins
Total number of longitude bins.
Some useful general definitions.
Definition: Absorption.h:6
double radius_in
The inner radius of the bin in km.
void SetBin(double r_out=0, double r_in=0, double lat=0, double lon=0, double den=0, double z=0.5, int n=0)
Set the properties of the bin.
double latitude
The latitude of the bin center in radians.
double longitude
The longitude of the bin center in radians.
double zoa
The effective Z/A value of the matter in the bin.
double radius_out
The outer radius of the bin in km.
int index
Region index.
EarthBin(double r_out=0, double r_in=0, double lat=0, double lon=0, double den=0, double z=0.5, int n=0)
Constructor.
double density
The density of the matter in the bin in g/cm^3.
A struct holding information about upcoming latitude bin crossings along the neutrino's trajectory.
int nextBin
Index of next latitude bin.
int bin
Index of current latitude bin.
A struct holding information about upcoming longitude bin crossings along the neutrino's trajectory.
int nextBin
Index of next longitude bin.
int bin
Index of current longitude bin.
std::string err_message
Part of error message specific to piece of path.
A struct holding useful combinations of trajectory variables.
double cosTcosDetLat
cosT*cos(DetLat)
double sinTsinA
sin(T)*sin(phi)
double cosDetLon
cos(DetLon)
double beta
sin(T)*sin(DetLat)-cos(phi)*cosT*cos(DetLat)
double gammaSq
[sin(T)*cos(phi)*cos(DetLat)+cosT*sin(DetLat)]^2
double sinDetLat
sin(DetLat)
double rDetSinT
rDet*sin(T)
double sinTcosA
sin(T)*cos(phi)
double alpha
sin(T)*cos(phi)*sin(DetLat)-cosT*cos(DetLat)
double rDetCosT
rDet*cosT
double rDetGammaSinDetLat
rDet*sin(DetLat)*[sin(T)*cos(phi)*cos(DetLat)+cosT*sin(DetLat)]
double sinSqT
sin^2(T) = 1 - (cosT)^2
double sinDetLon
sin(DetLon)
double sinTsinAsinDetLon
sin(T)*sin(phi)*sin(DetLon)
void UpdateDetPos(double rDet, double DetLat, double DetLon)
double gamma
sin(T)*cos(phi)*cos(DetLat)+cosT*sin(DetLat)
double maxSinSqLat
1 - [sin(phi)*cos(DetLat)]^2
void UpdateNuAngles(double cosTheta, double phi)
TrajConstants(double cosT=0, double phi=0, double DetLat=0, double DetLon=0, double rDet=6368)
Constructor.
double rDetSinDetLat
rDet*sin(DetLat)
double rDetCosDetLat
rDet*cos(DetLat)
double cosDetLat
cos(DetLat)
double sinT
sin(T) = sqrt(sinSqT)
double sinTsinAcosDetLon
sin(T)*sin(phi)*cos(DetLon)