8 #include <boost/algorithm/string.hpp>
9 #include <boost/tokenizer.hpp>
13 #include <fwk/CentralConfig.h>
14 #include <utl/AugerCoordinateSystem.h>
15 #include <fwk/LocalCoordinateSystem.h>
16 #include <fwk/CoordinateSystemRegistry.h>
18 #include <rdet/RDetector.h>
20 #include <evt/Event.h>
21 #include <sevt/SEvent.h>
22 #include <revt/REvent.h>
23 #include <revt/Header.h>
24 #include <sevt/Header.h>
25 #include <evt/ShowerRecData.h>
26 #include <evt/ShowerSRecData.h>
27 #include <evt/Header.h>
29 #include <utl/Point.h>
30 #include <utl/UTMPoint.h>
31 #include <utl/ReferenceEllipsoid.h>
32 #include <utl/AugerUnits.h>
33 #include <utl/Reader.h>
34 #include <utl/TimeStamp.h>
49 using std::stringstream;
50 using std::ostringstream;
56 typedef boost::tokenizer<boost::char_separator<char> >
mytok;
65 UTMPoint rodrigoOrigin(6113924.83*
m, 448375.63*
m, 1560.0*
m, 19,
'H', wgs84);
66 return AugerBaseCoordinateSystem::Create(rodrigoOrigin, ecef);
94 double geoInclination = -35.56728*
kPiOnTwo/90.0;
95 double geoDeclination = 2.71397*
kPiOnTwo/90.0;
105 RdEVASimPreparator::~RdEVASimPreparator() {
120 string sCoreZPosition;
125 info <<
" \n-------RdEVASimPreparator::Init \n";
136 stringstream eventidreader;
137 string EVAsim,EVAscript;
138 vector<string> v_detectorfiles;
150 INFO(
"RdEVASimPreparator::Finish()");
158 Detector& Det = Detector::GetInstance();
168 cout <<
"Setting the core position relative to AERA station 13! Overriding the old value for the Z-core position!" << endl;
176 cout <<
"Setting the core position relative to MAXIMA station 4! Overriding the old value for the Z-core position!" << endl;
205 double XCoreReference = ShowerCore.
GetX(referenceCS)/
meter;
206 double YCoreReference = ShowerCore.
GetY(referenceCS)/
meter;
207 double ZCoreReference = ShowerCore.
GetZ(referenceCS)/
meter;
216 long int event_id(0);
225 WARNING(
"No event id seems to be stored anywhere. We are making up some number for you.");
228 filename << (
fUseMGMR ?
"MGMR-" :
"EVA-") << event_id;
229 string nameWithoutSuffix(filename.str());
233 EVAFile << std::scientific;
234 EVAFile <<
"set name " << event_id <<
"\n";
235 EVAFile <<
"set thin " <<
"4" <<
"\n";
236 EVAFile <<
"set initial " << (
fPrim ==
eProton ?
"proton" : (fPrim ==
eIron ?
"iron" :
"unknown")) <<
"\n";
238 EVAFile <<
"set shzen " << AxisZenith <<
"\n";
239 EVAFile <<
"set shazi " << AxisAzimuth <<
"\n";
240 EVAFile <<
"set hground " << HeightUTM <<
"\n";
243 EVAFile <<
"set ximpact " << 0.0 <<
"\n";
244 EVAFile <<
"set yimpact " << 0.0 <<
"\n";
248 EVAFile <<
"set zimpact " << 0.0 <<
"\n";
249 EVAFile <<
"set bgeomag " << MagneticStrength <<
"\n";
250 EVAFile <<
"set geozen " << MagneticZenith <<
"\n";
251 EVAFile <<
"set geoazi " << MagneticAzimuth <<
"\n";
252 EVAFile <<
"extra gpssec " << gps_seconds <<
"\n";
253 EVAFile <<
"extra gpsnsec " << gps_nanoseconds <<
"\n";
254 EVAFile <<
"extra refcoordx " << XCoreReference <<
"\n";
255 EVAFile <<
"extra refcoordy " << YCoreReference <<
"\n";
256 EVAFile <<
"extra refcoordz " << ZCoreReference <<
"\n";
259 vector<string> v_filelist;
262 if (!rdIt->IsInGrid()) {
263 cout <<
"Antenna not in grid!" << endl;
266 utl::Point StationPosition = rdIt->GetPosition();
269 cout <<
"Antenna too far away from core!" << endl;
273 EVAFile <<
"set continue yes\n";
274 EVAFile <<
"set antenna " << rdIt->GetName() <<
"\n";
275 EVAFile <<
"set antennax " << VecAntenna.
GetX(coreCS)/
meter <<
"\n";
276 EVAFile <<
"set antennay " << VecAntenna.
GetY(coreCS)/
meter <<
"\n";
277 EVAFile <<
"set antennaz " << VecAntenna.
GetZ(coreCS)/
meter <<
"\n";
278 EVAFile <<
"set refindex " << 1.0 << endl;
280 EVAFile <<
"set continue no\n";
284 return filename.str();
289 string RdEVASimPreparator::CreateBashScriptEVASim() {
290 return string(
"no filename yet...");
Branch GetTopBranch() const
boost::transform_iterator< InternalStationFunctor, InternalStationIterator, const Station & > StationIterator
StationIterator returns a pointer to a station.
CoordinateSystemPtr GetRodrigoCS()
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
evt::Header & GetHeader()
Interface class to access Shower Reconstructed parameters.
double GetR(const CoordinateSystemPtr &coordinateSystem) const
radius r in spherical coordinates coordinates (distance to origin)
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
Class to hold and convert a point in geodetic coordinates.
StationIterator StationsEnd() const
End of the collection of pointers to commissioned stations.
double fMaxAntennaDistanceFromCore
ShowerRecData & GetRecShower()
StationIterator StationsBegin() const
Beginning of the collection of pointers to commissioned stations.
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
revt::REvent & GetREvent()
vector< t2list > out
output of the algorithm: a list of clusters
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
utl::Vector fMagneticField
ShowerSRecData & GetSRecShower()
Detector description interface for RDetector-related data.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
Reference ellipsoids for UTM transformations.
double GetHeight() const
Get the height.
double GetX(const CoordinateSystemPtr &coordinateSystem) const
Header & GetHeader()
access to REvent Header
Top of the hierarchy of the detector description interface.
CoordinateSystemPtr GetRodrigoCS()
constexpr double kPiOnTwo
const utl::Vector & GetAxis() const
const CoordinateSystemPtr GetECEF() const
Get the ECEF.
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
double GetY(const CoordinateSystemPtr &coordinateSystem) const
ResultFlag
Flag returned by module methods to the RunController.
boost::tokenizer< boost::char_separator< char > > mytok
std::string EVAFileWriter(evt::ShowerRecData &show, const evt::Header &head, evt::Event &theevent)
unsigned long GetGPSSecond() const
GPS second.
double GetGPSNanoSecond() const
GPS nanosecond.
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
Get the reference coordinate system used for analysis (usually PampaAmarilla for Auger) ...
const utl::Point & GetCorePosition() const
void SetCorePosition(const utl::Point &core)
sevt::Header & GetHeader()
const rdet::RDetector & GetRDetector() const
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
utl::Point GetPosition() const
Tank position in Site Cartesian Coordinates.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
ECoreZPosition fCoreZPosition
const Station & GetStation(const int stationId) const
Get station by Station Id.
sevt::SEvent & GetSEvent()
std::string CreateBashScriptEVASim()
constexpr double electronvolt