OscProb
|
Implements an earth model with depth/latitude/longitude bins. More...
#include <EarthModelBinned.h>
Classes | |
struct | LatBinInfo |
A struct holding information about upcoming latitude bin crossings along the neutrino's trajectory. More... | |
struct | LonBinInfo |
A struct holding information about upcoming longitude bin crossings along the neutrino's trajectory. More... | |
Public Member Functions | |
EarthModelBinned (std::string filename="") | |
Constructor. More... | |
virtual | ~EarthModelBinned () |
Destructor. More... | |
void | SetDetPos (double rad, double lat=0, double lon=0) |
int | FillPath (double cosT, double phi=0) |
virtual void | LoadModel (std::string filename) |
Load an earth model from a file. More... | |
virtual std::vector< EarthBin > | GetEarthBins () |
virtual void | SetRegionZoA (int index, double zoa) |
Set Z/A of all bins with specified region index. More... | |
virtual double | GetRegionZoA (int index) |
Get Z/A of all bins with specified region index. More... | |
virtual void | ScaleRegionDensity (int index, double scalingfactor) |
virtual std::vector< NuPath > | GetNuPath () |
virtual std::vector< NuPath > | GetMergedPaths (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 | 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) More... | |
virtual void | AddPath (double length, EarthBin bin) |
Add a path segment to the sequence. More... | |
virtual double | DetDistForNextLatBin (int cur_index, LatBinInfo &L) |
virtual double | DetDistForNextLonBin (double prev_lon, LonBinInfo &L) |
virtual void | RecordLatLonBinCrossings (double detDist_nextDbin, double &DetDist, int &index, LatBinInfo &latI, LonBinInfo &lonI) |
virtual int | LonBinIndex (double longitude) |
Find lon bin index containing longitude. More... | |
ClassDef (EarthModelBinned, 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 | |
TrajConstants | fC |
Useful constants for the trajectory. More... | |
std::vector< EarthBin > | fEarthBins |
The bins in the earth model. More... | |
int | fnDepthBins |
Total number of depth bins. More... | |
int | fnLonBins |
Total number of longitude bins. More... | |
int | fnLatBins |
Total number of latitude bins. More... | |
double | fInvLonBinWidth |
1/binwidth for each longitude bin More... | |
double | fInvLatBinWidth |
1/binwidth for each latitude bin More... | |
double | fHalfLonBinWidth |
Half-width of each longitude bin. More... | |
double | fHalfLatBinWidth |
Half-width of each latitude bin. More... | |
int | fmaxRegIndex |
Largest region index in model. More... | |
std::string | fErrorMessage_LonInfo |
int | fLonError |
std::vector< NuPath > | fNuPath |
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... | |
This class implements a 3D (asymmetric) model of the earth using EarthBin's to store bins with different properties.
The class is then able to produce path sequences through the Earth as a function of the azimuthal angle and cosine of the zenith angle with respect to the detector.
The detector can be positioned at any point within the Earth, and the path sequences will take into account the fact that some layers are above the detector.
Using indices to specify various regions (which must have a constant Z/A value), the Z/A value for a region can be changed, and the density throughout the region can be scaled by a constant factor.
By default this implements the model stored in EarthTables/earth_binned_default.txt with the detector at the bottom of the ocean layer (radius = 6368 km) where the prime meridian intersects the equator.
This class inherits from EarthModelBase and can be saved in ROOT files.
Definition at line 214 of file EarthModelBinned.h.
EarthModelBinned::EarthModelBinned | ( | std::string | filename = "" | ) |
Constructor.
By default this implements the model stored in EarthTables/earth_binned_default.txt with the detector 6368 km from the center of the Earth, having a latitude of 0 deg N and a longitude of 0 deg E.
filename | - The txt file containing a table of earth layers |
Definition at line 94 of file EarthModelBinned.cxx.
References fLonError, LoadModel(), SetDetPos(), and OscProb::EarthModelBase::SetRemoveSmallPaths().
|
virtual |
|
protectedvirtual |
Add a bin to the earth model.
radius_out | - The outer depth of the bin in km |
radius_in | - The inner depth of the bin in km |
latitude | - The latitude of the bin center in degrees |
longitude | - The longitude of the bin center in degrees |
density | - The density of the matter in the bin in g/cm^3 |
zoa | - The effective Z/A value of the matter in the bin |
index | - Region index |
Definition at line 160 of file EarthModelBinned.cxx.
References fEarthBins.
Referenced by LoadModel().
|
protectedvirtual |
Add a path segment to the sequence.
For a given EarthBin, adds a path of a given length in that material
length | - The length of the path segment in km |
bin | - The bin we are crossing |
Definition at line 406 of file EarthModelBinned.cxx.
References OscProb::EarthModelBase::AddPathSegment(), OscProb::EarthBin::density, OscProb::EarthBin::index, and OscProb::EarthBin::zoa.
Referenced by FillPath(), and RecordLatLonBinCrossings().
|
protectedvirtualinherited |
Add a path segment to the sequence.
For a given EarthBin, adds a path of a given length in that material
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.
References OscProb::EarthModelBase::fNuPath.
Referenced by AddPath(), and OscProb::PremModel::AddPath().
|
protectedinherited |
|
protected |
|
protectedvirtual |
Clear the earth model information.
Definition at line 120 of file EarthModelBinned.cxx.
References fEarthBins, fnDepthBins, fnLatBins, and fnLonBins.
Referenced by LoadModel().
|
protectedvirtual |
Calculate the detector distance at the edge of the current lat bin along the neutrino's trajectory
Calculate the distance to the detector along a neutrino trajectory, specified by cosT and the azimuthal angle, at the edge of the current latitude bin in the direction specified by dir. Returns a negative value if the next latitude bin will not be reached before the neutrino reaches the detector. Flips L.sign and changes L.maxreached to true if the extreme latitude is within the cur_index Earth bin.
In an attempt to make this calculation more robust, this function turns the latitude bin iteration around when sin^2(lat) gets within 10^(-14) of its extreme limit.
cur_index | - Index of current Earth bin |
L | - Information for the lat bin crossings |
Definition at line 429 of file EarthModelBinned.cxx.
References OscProb::EarthModelBinned::LatBinInfo::dLat, fC, fEarthBins, OscProb::TrajConstants::gamma, OscProb::TrajConstants::gammaSq, OscProb::EarthModelBinned::LatBinInfo::maxreached, OscProb::TrajConstants::maxSinSqLat, OscProb::TrajConstants::rDetCosT, OscProb::TrajConstants::rDetGammaSinDetLat, OscProb::TrajConstants::rDetSinDetLat, OscProb::TrajConstants::rDetSinT, OscProb::EarthModelBinned::LatBinInfo::sign, and OscProb::TrajConstants::xlatextreme.
Referenced by FillPath(), and RecordLatLonBinCrossings().
|
protectedvirtual |
Calculate the detector distance at the edge of the current lon bin along the neutrino's trajectory and increment L.bin
Calculate the distance to the detector at the edge of the current longitude bin along a neutrino trajectory specified by cosT and the azimuthal angle, setting the index for the next longitude bin in the process. The maximum/minimum longitude are expressed around the 0-2pi boundary. So, if the track spans that boundary, the actual allowed range for lon is [min_lon,2pi)U[0,max_lon].
prev_lon | - Value at center of initial longitude bin |
L | - Information about longitude bin crossings |
Definition at line 499 of file EarthModelBinned.cxx.
References OscProb::TrajConstants::alpha, OscProb::EarthModelBinned::LonBinInfo::bin, OscProb::TrajConstants::cosDetLon, OscProb::EarthModelBinned::LonBinInfo::dLon, OscProb::EarthModelBinned::LonBinInfo::err_message, OscProb::EarthModelBinned::LonBinInfo::error, fC, fnLonBins, OscProb::EarthModelBinned::LonBinInfo::max, OscProb::EarthModelBinned::LonBinInfo::min, OscProb::EarthModelBinned::LonBinInfo::nextBin, OscProb::TrajConstants::rDetCosDetLat, OscProb::TrajConstants::sinDetLon, OscProb::TrajConstants::sinTsinAcosDetLon, and OscProb::TrajConstants::sinTsinAsinDetLon.
Referenced by FillPath(), and RecordLatLonBinCrossings().
|
virtual |
Fill the path sequence in a vector (phi in degrees)
Fill the path sequence in a vector.
This will start at the upper-most layer (where the neutrino's path started) and find path lengths to the next bin crossed. When reaching the inner-most depth in the given direction, the paths move back to outer layers until hitting the detector. The neutrino direction is specified as the zenith angle and azimuthal angle of the vector pointing from the detector to where the neutrino entered the Earth.
The path sequence is stored as an attribute and can be retrieved with the function GetNuPath.
Note: This function assumes uniform bin sizes for the latitude bins and the longitude bins.
cosT | - The cosine of the zenith angle of the neutrino direction |
phi | - The azimuthal angle (in degrees from North) of the neutrino direction |
Implements OscProb::EarthModelBase.
Definition at line 652 of file EarthModelBinned.cxx.
References AddPath(), OscProb::TrajConstants::alpha, OscProb::TrajConstants::beta, OscProb::EarthModelBinned::LatBinInfo::bin, OscProb::EarthModelBinned::LonBinInfo::bin, OscProb::TrajConstants::cosA, OscProb::TrajConstants::cosDetLat, OscProb::TrajConstants::cosDetLon, OscProb::EarthModelBinned::LatBinInfo::detDist_nextBin, OscProb::EarthModelBinned::LonBinInfo::detDist_nextBin, DetDistForNextLatBin(), DetDistForNextLonBin(), OscProb::EarthModelBinned::LatBinInfo::dLat, OscProb::EarthModelBinned::LonBinInfo::dLon, OscProb::EarthModelBinned::LonBinInfo::err_message, OscProb::EarthModelBinned::LonBinInfo::error, fC, OscProb::EarthModelBase::fDetLat, OscProb::EarthModelBase::fDetLon, OscProb::EarthModelBase::fDetRadius, fEarthBins, fHalfLatBinWidth, fHalfLonBinWidth, fInvLatBinWidth, fnDepthBins, fnLatBins, OscProb::EarthModelBase::fNuPath, OscProb::EarthModelBase::fRadiusMax, OscProb::TrajConstants::gamma, LonBinIndex(), OscProb::EarthModelBinned::LonBinInfo::max, OscProb::EarthModelBinned::LatBinInfo::maxreached, OscProb::EarthModelBinned::LonBinInfo::min, OscProb::EarthModelBinned::LatBinInfo::nextBin, OscProb::EarthModelBinned::LonBinInfo::nextBin, OscProb::TrajConstants::rDetCosDetLat, OscProb::TrajConstants::rDetCosT, OscProb::TrajConstants::rDetSinT, OscProb::TrajConstants::Recalculate(), RecordLatLonBinCrossings(), OscProb::EarthModelBinned::LatBinInfo::sign, OscProb::TrajConstants::sinA, OscProb::TrajConstants::sinDetLon, OscProb::TrajConstants::sinT, OscProb::TrajConstants::sinTsinAcosDetLon, OscProb::TrajConstants::sinTsinAsinDetLon, OscProb::TrajConstants::UpdateNuAngles(), and OscProb::TrajConstants::xlatextreme.
|
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.
L | - The total baseline of the neutrino |
Definition at line 99 of file EarthModelBase.cxx.
References OscProb::EarthModelBase::fDetRadius, and OscProb::EarthModelBase::fRadiusMax.
|
virtual |
Get the set of earth layers
Get the set of Earth bins
This returns the set of bins for this Earth model.
Definition at line 114 of file EarthModelBinned.cxx.
References fEarthBins.
|
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.
prec | - The precision to merge paths in g/cm^3 |
Definition at line 121 of file EarthModelBase.cxx.
References OscProb::AvgPath(), OscProb::NuPath::density, OscProb::EarthModelBase::fNuPath, OscProb::EarthModelBase::fRemoveSmallPaths, OscProb::MergePaths(), and OscProb::NuPath::zoa.
|
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.
References OscProb::EarthModelBase::fNuPath.
|
virtual |
Get the effective Z/A value for all bins in region specified by index, e.g. all outer-core layers. (Assumes that all bins of given index have same Z/A value)
index | - The region index |
Definition at line 345 of file EarthModelBinned.cxx.
References fEarthBins, and fmaxRegIndex.
|
virtualinherited |
Get the total baseline for a given cosTheta.
cosT | - The cosine of the neutrino direction |
Definition at line 77 of file EarthModelBase.cxx.
References OscProb::EarthModelBase::fDetRadius, and OscProb::EarthModelBase::fRadiusMax.
|
virtual |
Load an earth model from a file.
By default it loads the model stored in EarthTables/earth_binned_default.txt
The row format for the model table needs to be: longitude (deg) latitude (deg) outer depth (km) density (g/cm^3?) Z/A region_index The data in the table must be in order of decreasing depth, followed by increasing longitude, and then increasing latitude. Latitude bin widths and longitude bin widths must each be constant. In each bin of one coordinate, the bins centers for the other coordinates must be the same. This assumes that the center of the Earth is at a depth of 6371km.
filename | - The txt file containing a table of earth layers |
Definition at line 187 of file EarthModelBinned.cxx.
References AddBin(), ClearModel(), fEarthBins, fHalfLatBinWidth, fHalfLonBinWidth, fInvLatBinWidth, fInvLonBinWidth, fmaxRegIndex, fnDepthBins, fnLatBins, fnLonBins, and OscProb::EarthModelBase::fRadiusMax.
Referenced by EarthModelBinned().
|
protectedvirtual |
Find and return longitude bin index that contains longitude.
longitude | - longitude for which bin is found |
Definition at line 616 of file EarthModelBinned.cxx.
References fEarthBins, fHalfLonBinWidth, and fInvLonBinWidth.
Referenced by FillPath().
|
protectedvirtual |
Record path segments for each latitude/longitude bin crossed before reaching detDist_nextDbin
Record all the path segments as the neutrino crosses into new latitude and longitude bins until it reaches the next depth bin.
detDist_nextDbin | - Distance from the detector at which neutrino passes into next depth bin |
DetDist | - Current distance from the detector |
index | - Index of current Earth bin |
latI | - Information about lat bin crossings |
lonI | - Information about lon bin crossings |
Definition at line 559 of file EarthModelBinned.cxx.
References AddPath(), OscProb::EarthModelBinned::LatBinInfo::bin, OscProb::EarthModelBinned::LonBinInfo::bin, OscProb::EarthModelBinned::LatBinInfo::detDist_nextBin, OscProb::EarthModelBinned::LonBinInfo::detDist_nextBin, DetDistForNextLatBin(), DetDistForNextLonBin(), OscProb::EarthModelBinned::LatBinInfo::dLat, OscProb::EarthModelBinned::LonBinInfo::dLon, fEarthBins, fnLatBins, OscProb::EarthModelBinned::LatBinInfo::nextBin, OscProb::EarthModelBinned::LonBinInfo::nextBin, and OscProb::EarthModelBinned::LatBinInfo::sign.
Referenced by FillPath().
|
virtual |
Set Z/A of all bins with specified region index
Scale density by scaling factor for all bins in region specified by given index.
index | - The region index |
factor | - The scaling factor for changing the density |
Definition at line 376 of file EarthModelBinned.cxx.
References fEarthBins, and fmaxRegIndex.
|
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
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.
References OscProb::EarthModelBase::fDetLat, OscProb::EarthModelBase::fDetLon, and OscProb::EarthModelBase::fDetRadius.
Referenced by SetDetPos(), and OscProb::PremModel::SetDetPos().
|
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 Also, updates the detector-coordinate-dependent parts of the trajectory constants.
Note: If lat = -90 (or 90), lon (or -lon) defines where the azimuthal angle for the neutrino's trajectory is 0.
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 142 of file EarthModelBinned.cxx.
References fC, OscProb::EarthModelBase::fDetLat, OscProb::EarthModelBase::fDetLon, OscProb::EarthModelBase::fDetRadius, OscProb::EarthModelBase::SetDetectorCoordinates(), and OscProb::TrajConstants::UpdateDetPos().
Referenced by EarthModelBinned().
|
virtual |
Set the effective Z/A value for all bins with given region index.
Use this to change the Z/A of indexed bin, e.g. all outer-core layers
index | - The region index |
zoa | - The effective Z/A value to use |
Definition at line 316 of file EarthModelBinned.cxx.
References fEarthBins, and fmaxRegIndex.
|
virtualinherited |
Set the boolean to tag whether to remove small paths when merging Small is defined as <1% of the total baseline
rp | - Boolean value to set |
Definition at line 188 of file EarthModelBase.cxx.
References OscProb::EarthModelBase::fRemoveSmallPaths.
Referenced by EarthModelBinned(), and OscProb::PremModel::PremModel().
|
protected |
Definition at line 317 of file EarthModelBinned.h.
Referenced by DetDistForNextLatBin(), DetDistForNextLonBin(), FillPath(), and SetDetPos().
|
protectedinherited |
Definition at line 78 of file EarthModelBase.h.
Referenced by FillPath(), OscProb::EarthModelBase::SetDetectorCoordinates(), and SetDetPos().
|
protectedinherited |
Definition at line 79 of file EarthModelBase.h.
Referenced by FillPath(), OscProb::EarthModelBase::SetDetectorCoordinates(), and SetDetPos().
|
protectedinherited |
Definition at line 77 of file EarthModelBase.h.
Referenced by OscProb::PremModel::AddDetLayer(), FillPath(), OscProb::PremModel::FillPath(), OscProb::EarthModelBase::GetCosT(), OscProb::EarthModelBase::GetTotalL(), OscProb::EarthModelBase::SetDetectorCoordinates(), and SetDetPos().
|
protected |
Definition at line 319 of file EarthModelBinned.h.
Referenced by AddBin(), ClearModel(), DetDistForNextLatBin(), FillPath(), GetEarthBins(), GetRegionZoA(), LoadModel(), LonBinIndex(), RecordLatLonBinCrossings(), ScaleRegionDensity(), and SetRegionZoA().
|
protected |
Part of error message containing the longitude information
Definition at line 331 of file EarthModelBinned.h.
|
protected |
Definition at line 326 of file EarthModelBinned.h.
Referenced by FillPath(), and LoadModel().
|
protected |
Definition at line 325 of file EarthModelBinned.h.
Referenced by FillPath(), LoadModel(), and LonBinIndex().
|
protected |
Definition at line 324 of file EarthModelBinned.h.
Referenced by FillPath(), and LoadModel().
|
protected |
Definition at line 323 of file EarthModelBinned.h.
Referenced by LoadModel(), and LonBinIndex().
|
protected |
Definition at line 333 of file EarthModelBinned.h.
Referenced by EarthModelBinned().
|
protected |
Definition at line 328 of file EarthModelBinned.h.
Referenced by GetRegionZoA(), LoadModel(), ScaleRegionDensity(), and SetRegionZoA().
|
protected |
Definition at line 320 of file EarthModelBinned.h.
Referenced by ClearModel(), FillPath(), and LoadModel().
|
protected |
Definition at line 322 of file EarthModelBinned.h.
Referenced by ClearModel(), FillPath(), LoadModel(), and RecordLatLonBinCrossings().
|
protected |
Definition at line 321 of file EarthModelBinned.h.
Referenced by ClearModel(), DetDistForNextLonBin(), and LoadModel().
|
protectedinherited |
Definition at line 74 of file EarthModelBase.h.
Referenced by OscProb::EarthModelBase::AddPathSegment(), FillPath(), OscProb::PremModel::FillPath(), OscProb::EarthModelBase::GetMergedPaths(), and OscProb::EarthModelBase::GetNuPath().
|
protectedinherited |
Definition at line 76 of file EarthModelBase.h.
Referenced by FillPath(), OscProb::EarthModelBase::GetCosT(), OscProb::EarthModelBase::GetTotalL(), LoadModel(), OscProb::PremModel::LoadModel(), and OscProb::PremModel::SetTopLayerSize().
|
protectedinherited |
Definition at line 81 of file EarthModelBase.h.
Referenced by OscProb::EarthModelBase::GetMergedPaths(), and OscProb::EarthModelBase::SetRemoveSmallPaths().