10 #include <det/Detector.h>
12 #include <tls/MuonProfile.h>
13 #include <tls/MuonProfileUtilities.h>
15 #include <utl/AugerUnits.h>
16 #include <utl/MathConstants.h>
17 #include <utl/Reader.h>
18 #include <utl/Branch.h>
19 #include <utl/Vector.h>
20 #include <utl/Point.h>
21 #include <utl/CoordinateSystemPtr.h>
22 #include <utl/ReferenceEllipsoid.h>
23 #include <utl/AugerCoordinateSystem.h>
24 #include <utl/UTMPoint.h>
25 #include <utl/Transformation.h>
35 #include <boost/shared_ptr.hpp>
36 #include <boost/program_options.hpp>
41 namespace po = boost::program_options;
54 int main(
int argc,
char* argv[]) {
57 const double xMax = 3000*
m;
58 const double yMax = 3000*
m;
59 const int xBins = 200;
60 const int yBins = 200;
63 TFile f(
"MuonProfile.root",
"RECREATE");
68 Branch b = topBranch.GetFirstChild();
69 vector<MuonProfile> muonProfiles;
70 vector<string> muonProfileNames;
73 muonProfileNames.push_back(b.
GetName());
87 for(
unsigned int i = 0; i !=
gTheta.size(); ++i)
88 for(
unsigned int j = 0; j !=
gPhi.size(); ++j)
92 const double energy = 10.*
EeV;
94 const Vector axis(1,theta,phi,localCs, Vector::kSpherical);
96 CoordinateSystem::RotationY(theta,CoordinateSystem::RotationZ(phi, localCs));
100 for (
unsigned int iType=0;iType<muonProfiles.size();++iType)
102 const string& name = muonProfileNames[iType];
106 label << name <<
"NMu" <<
"_" << theta/
deg <<
"_" << phi/
deg;
107 boost::shared_ptr<TH2D> histoNMu(
new TH2D(label.str().c_str(),name.c_str(),
108 xBins,-xMax,xMax, yBins, -yMax, yMax));
111 label << name <<
"ThMu" <<
"_" << theta/
deg <<
"_" << phi/
deg;
112 boost::shared_ptr<TH2D> histoThMu(
new TH2D(label.str().c_str(),name.c_str(),
113 xBins,-xMax,xMax, yBins, -yMax, yMax));
116 label << name <<
"EnMu" <<
"_" << theta/
deg <<
"_" << phi/
deg;
117 boost::shared_ptr<TH2D> histoEnMu(
new TH2D(label.str().c_str(),name.c_str(),
118 xBins,-xMax,xMax, yBins, -yMax, yMax));
120 cout <<
"Processing " << name <<
" " << theta/
deg <<
" " << phi/
deg << endl;
122 for(
int i = 1; i <= xBins+1; ++i)
for(
int j = 1; j <= yBins+1; ++j)
124 const double x = histoNMu->GetXaxis()->GetBinCenter(i);
125 const double y = histoNMu->GetYaxis()->GetBinCenter(j);
126 Point p(x, y, 0, geomagneticCs);
128 const double xp = p_ground.
GetX(localCs);
129 const double yp = p_ground.
GetY(localCs);
131 histoNMu->Fill(x, y, mp.
NMuon(xp, yp, theta, phi, energy));
132 histoThMu->Fill(x, y, mp.
ThetaMuon(xp, yp, theta, phi, energy));
133 histoEnMu->Fill(x, y, mp.
EnergyMuon(xp, yp, theta, phi, energy));
152 msg <<
"Usage: " << argv[0] <<
" -c <xml_config_file> -z <zenith> [-z <zenith>...] -a <azimuth> [-a <azimuth>...]\n"
153 <<
"Example: '" << argv[0] <<
" -c MuonProfile.xml -z 60 -z 70 -a 0 -a 90' will histogram the maps for the following directions: (60 deg,0), (60 deg,90 deg), (70 deg,0) and (79 deg,90 deg).\n"
154 <<
"Everything is saved in the file MuonProfile.root.\n"
155 <<
"\nAll options are";
156 po::options_description desc(msg.str());
159 "write this message")
162 "path to configuration file. Required.")
164 po::value< vector<double> >(&
gTheta),
165 "Zenith angle (in degrees). Required.")
167 po::value< vector<double> >(&
gPhi),
168 "Azimuth angle (in degrees). Required.")
171 po::variables_map vm;
173 po::store(po::parse_command_line(argc, argv, desc), vm);
176 catch (po::error& er) {
177 cerr <<
"Command line error : " << er.what() <<
'\n'
182 if (vm.count(
"help") || !vm.count(
"zenith") || !vm.count(
"azimuth")) {
183 cerr << desc << endl;
194 UTMPoint malargueOrigin(6060000*
m, 440000*
m, 1400*
m, 19,
'H', wgs84);
195 return AugerBaseCoordinateSystem::Create(malargueOrigin, ecef);
Branch GetTopBranch() const
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Class to handle average muon profiles.
Class to hold and convert a point in geodetic coordinates.
double ThetaMuon(double xpos, double ypos, double theta, double phi, double energy)
Branch GetNextSibling() const
Get next sibling of this branch.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Utility for parsing XML files.
Class representing a document branch.
Reference ellipsoids for UTM transformations.
int main(int argc, char *argv[])
double GetX(const CoordinateSystemPtr &coordinateSystem) const
double EnergyMuon(double xpos, double ypos, double theta, double phi, double energy)
constexpr double kPiOnTwo
double NMuon(double xpos, double ypos, double theta, double phi, double energy)
const CoordinateSystemPtr GetECEF() const
Get the ECEF.
std::string GetName() const
function to get the Branch name
static const double kInclination
kInclination of geomagnetic field in Malargüe, 2007
static const double kDeclination
kDeclination of geomagnetic field in Malargüe, 2007
double GetY(const CoordinateSystemPtr &coordinateSystem) const
string gXMLConfigurationFileName
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
CoordinateSystemPtr GetLocalCS()
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
void processOptions(int argc, char *argv[])