4 #include <utl/MathConstants.h>
5 #include <utl/AugerUnits.h>
6 #include <utl/Branch.h>
12 using namespace ParametricMuonProfileNS;
21 std::vector<size_t> extent;
24 tensor.resize(extent);
25 tensorLocal.resize(extent);
27 std::vector<double>
data;
32 for (
size_t i=0,ii=0; i < tensor.num_elements(); ++i)
35 ip.Delinearize(i, kjvmlu);
37 if ( (kjvmlu[1]==0 && kjvmlu[2]==1) || (kjvmlu[4]==0 && kjvmlu[5]==1) )
39 tensor.data()[i] = data[ii];
46 fTheta(0.), fPhi(0.), fEnergy(10.*
EeV), fBPsi(0.)
57 std::vector<double>
data;
59 b = topBranch.
GetChild(
"nMuTankModel");
63 b = topBranch.
GetChild(
"cosThetaModel");
67 b = topBranch.
GetChild(
"logEnergyModel");
81 const double z = 2*theta/(0.5*
kPi)-1.0;
84 for (
unsigned int i=n-1;i!=0;--i)
96 const double lgE = log10(energy/
EeV);
97 const double lgD = log10(
D(theta));
103 double theta,
double phi,
double energy)
135 if (result < 0) result = 0.0;
136 if (result > 1) result = 1.0;
137 result = acos(result);
156 for (
size_t k=0; k <
fLocalData[type].shape()[0]; ++k)
157 for (
size_t j=0; j <
fLocalData[type].shape()[1]; ++j)
158 for (
size_t v=0; v < 2; ++v)
161 if (j==0 && v==1)
continue;
164 result +=
fLocalData[type][k][j][v]*
pow(sqr,
int(k))*cos(j*zeta);
166 result +=
fLocalData[type][k][j][v]*
pow(sqr,
int(k))*sin(j*zeta);
175 const double dmax =
D(90*
degree);
176 const double dmin =
D(0);
177 const double zA = 2*(
D(
fTheta)-dmin)/(dmax-dmin)-1;
180 for (
int iType=0;iType<3;++iType)
181 for (
size_t k=0; k<
fModelData[iType].shape()[0]; ++k)
182 for (
size_t j=0; j<
fModelData[iType].shape()[1]; ++j)
183 for (
size_t v=0; v<2; ++v)
187 for (
size_t l=0; l<
fModelData[iType].shape()[4]; ++l)
188 for (
size_t u=0; u<2; ++u)
191 if ( (j==0 && v==1) || (l==0 && u==1) )
continue;
192 const double z = iType == 0? zA : zB;
void ReadModelData(const utl::Branch &modelBranch, ModelDataType &tensor, LocalDataType &tensorLocal) const
double rPerpendicular(const double xpos, const double ypos, const double theta, const double phi)
radial distance in shower front plane coordinate system
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
double pow(const double x, const unsigned int i)
LocalDataType fLocalData[3]
ParametricMuonProfile(utl::Branch)
double TotalMuonNumber(double theta, double energy) const
Class representing a document branch.
double EvaluateProfile(ProfileType type, double x, double y, double theta, double phi, double energy)
ModelDataType fModelData[3]
double GetThetaMax()
Maximum zenith angle, at which the tank response function is defined.
void GetData(bool &b) const
Overloads of the GetData member template function.
boost::multi_array< double, 6 > ModelDataType
double PsiPerpendicular(const double xpos, const double ypos, const double theta, const double phi)
polar angle in shower front plane coordinate system
boost::multi_array< double, 3 > LocalDataType
double GetThetaMin()
Minimum zenith angle, at which the tank response function is defined.
void CachedSetProfile(double theta, double phi, double energy)
double EvaluateLocalProfile(ProfileType type, double sqr, double zeta) const
double D(double theta) const
double fBiasCorrection[3]