125{
128
129 string detectorFile;
130 string option;
132
133 try {
134
135 JParser<> zap(
"Example program to print geographical data for given detector.");
136
138 zap[
'O'] =
make_field(option) = calculated_t, fixed_t;
140
141 zap(argc, argv);
142 }
143 catch(const exception &error) {
144 FATAL(error.what() << endl);
145 }
146
147
149
150 try {
152 }
155 }
156
157
158 string name;
159 double meridian;
161
162 if (option == calculated_t) {
163
165 location = getGeographicalLocation(
detector.getUTMGrid(),
detector.getUTMPosition());
166
167 } else if (option == fixed_t) {
168
170
171 meridian = ORCA_MERIDIAN_CONVERGENCE_ANGLE_DEG;
172 location = ORCA;
173
175
176 meridian = ARCA_MERIDIAN_CONVERGENCE_ANGLE_DEG;
177 location = ARCA;
178
179 } else {
180
181 FATAL(
"No location" << endl);
182 }
183
184 } else {
185
186 FATAL(
"Invalid option " << option << endl);
187 }
188
189 if (
debug >= debug_t) {
190
191 cout <<
"grid: " <<
detector.getUTMGrid() << endl;
192 cout <<
"UTM: " <<
detector.getUTMPosition() << endl;
193 cout <<
"zone: " <<
detector.getUTMZone() <<
' ' << getUTMZone(location.
getLongitude()) << endl;
194
195 cout <<
"Meridian convergence angle [deg]: " <<
FIXED(9,5) << meridian <<
" (" << option <<
")" << endl;
197 }
198
203 cout <<
"Meridian convergence angle [deg]: " <<
FIXED(9,5) << meridian << endl;
204 cout <<
"Meridian convergence angle [rad]: " <<
FIXED(9,5) <<
getRadians(meridian) << endl;
205}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
double getMeridianConvergenceAngle(const JGeographicalLocation &location)
Get Meridian convergence angle.
double getDegrees(const double angle)
Convert angle to degrees.
double getRadians(const double angle)
Convert angle to radians.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
bool isORCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with that of ORCA.
bool isARCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with tat of ARCA.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
double getLongitude() const
Get longitude.
double getLatitude() const
Get latitude.