9 #include <tls/EMComponent.h>
10 #include <tls/MuonProfileUtilities.h>
12 #include <utl/AugerUnits.h>
13 #include <utl/MathConstants.h>
14 #include <utl/Reader.h>
15 #include <utl/CoordinateSystemPtr.h>
16 #include <utl/ReferenceEllipsoid.h>
17 #include <utl/AugerCoordinateSystem.h>
18 #include <utl/UTMPoint.h>
19 #include <utl/Transformation.h>
20 #include <utl/Vector.h>
21 #include <utl/Point.h>
29 #include <boost/shared_ptr.hpp>
30 #include <boost/program_options.hpp>
33 #include <TObjectTable.h>
37 namespace po = boost::program_options;
52 int main(
int argc,
char* argv[]) {
60 TFile* f = TFile::Open(
"EMComponent.root",
"RECREATE");
75 for(
unsigned int irmu = 0; irmu !=
gLgRMu.size(); ++irmu)
76 for(
unsigned int ith = 0; ith !=
gTheta.size(); ++ith)
82 const Vector axis(1,theta,phi,localCs, Vector::kSpherical);
84 CoordinateSystem::RotationY(theta,CoordinateSystem::RotationZ(phi, localCs));
86 CoordinateSystem::RotationZ(gMagneticField.
GetPhi(showerCs) -
kPiOnTwo, showerCs);
88 ostringstream label, title;
89 char buf[256]; sprintf(buf,
"%s_%i_%i",branch.GetName().c_str(),
90 int(round(log10(rmu))),
91 int(round(theta/degree)) );
93 title << branch.GetName() <<
";x / km;y / km;S_{em} / S_{#mu}";
94 TH2D* histo =
new TH2D(label.str().c_str(),title.str().c_str(),xBins,-xMax,xMax, yBins, -yMax, yMax);
95 histo->SetDirectory(0);
97 for(
int ix = 1; ix < xBins+1; ++ix)
98 for(
int iy = 1; iy < yBins+1; ++iy)
100 const double x = histo->GetXaxis()->GetBinCenter(ix);
101 const double y = histo->GetYaxis()->GetBinCenter(iy);
103 Point p(x, y, 0,showerCs);
106 const double xp = p_ground.
GetX(localCs);
107 const double yp = p_ground.
GetY(localCs);
110 const double semsmu = emComponent.
SignalRatio(xp*
km, yp*km, rmu, theta, phi);
111 histo->SetBinContent(ix,iy,semsmu);
114 histo->SetTitle(
"Em correction on the shower plane");
118 branch = branch.GetNextSibling();
129 msg <<
"Usage: " << argv[0] <<
" -c <xml_config_file> -z <zenith> [-z <zenith> ...] -m <lgRMu> [-m <lgRMu> ... ]\n"
130 <<
"Example: '" << argv[0] <<
" -z 60 -z 70 -m 0' will histogram the em components for the zenith angles 60 deg and 70 deg and an energy estimator lgRMu = 0.\n"
131 <<
"Everything is saved in the file EMComponent.root.\n"
132 <<
"\nAll options are";
133 po::options_description desc(msg.str());
136 "write this message")
139 "path to configuration file. Required.")
141 po::value< vector<int> >(&
gTheta),
142 "Zenith angle (in degrees). Required.")
144 po::value< vector<int> >(&
gLgRMu),
145 "lg(energy estimator). Required.")
148 po::variables_map vm;
150 po::store(po::parse_command_line(argc, argv, desc), vm);
153 catch (po::error& er) {
154 cerr <<
"Command line error : " << er.what() <<
'\n'
159 if ( vm.count(
"help") || !vm.count(
"zenith") || !vm.count(
"lgrmu") ) {
160 cerr << desc << endl;
171 UTMPoint malargueOrigin(6060000*
m, 440000*
m, 1400*
m, 19,
'H', wgs84);
172 return AugerBaseCoordinateSystem::Create(malargueOrigin, ecef);
Branch GetTopBranch() const
Facade for any instance of EMComponent.
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Class to hold and convert a point in geodetic coordinates.
double pow(const double x, const unsigned int i)
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
constexpr double kPiOnTwo
const CoordinateSystemPtr GetECEF() const
Get the ECEF.
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
double SignalRatio(double x, double y, double rmu, double theta, double phi)
Ratio between electromagnetic and muon signal.
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
CoordinateSystemPtr GetLocalCS()
Branch GetFirstChild() const
Get first child of this Branch.
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
void processOptions(int argc, char *argv[])