00001
00008 class MsgStream;
00009 #include "Event/MonteCarlo/Exposure.h"
00010 #include "astro/PointingInfo.h"
00011 #include "AnalysisNtuple/PointingInfo.h"
00012
00013 #include "astro/SkyDir.h"
00014 #include "astro/GPS.h"
00015 #include "astro/JulianDate.h"
00016 #include "astro/EarthCoordinate.h"
00017
00018 #include "ntupleWriterSvc/INTupleWriterSvc.h"
00019
00020 using namespace AnalysisNtuple;
00021
00022 void PointingInfo::execute( const astro::GPS& gps)
00023 {
00024 start = gps.time();
00025 CLHEP::Hep3Vector pos_km = gps.position();
00026 CLHEP::Hep3Vector location = 1.e3* pos_km;
00027
00028
00029 sc_position[0] = location.x();
00030 sc_position[1] = location.y();
00031 sc_position[2] = location.z();
00032
00033 ra_zenith = gps.zenithDir().ra();
00034 dec_zenith= gps.zenithDir().dec();
00035
00036 ra_scx = gps.xAxisDir().ra();
00037 dec_scx = gps.xAxisDir().dec();
00038
00039 ra_scz = gps.zAxisDir().ra();
00040 dec_scz = gps.zAxisDir().dec();
00041
00042 const astro::EarthCoordinate& earth(gps.earthpos());
00043
00044 lat_geo = earth.latitude();
00045 lon_geo = earth.longitude();
00046
00047 rad_geo = earth.altitude();
00048 L=earth.L();
00049 B=earth.B();
00050 lat_mag = earth.geolat();
00051 in_saa= earth.insideSAA()? 1:0;
00052 zenith_scz = 180/M_PI* gps.zenithDir().difference(gps.zAxisDir());
00053 }
00054
00055
00074
00075 void PointingInfo::setPtTuple(INTupleWriterSvc* tuple, const std::string& tname)
00076 {
00077 if( tuple==0 ) return;
00078 tuple->addItem(tname, "PtTime", &start);
00079 tuple->addItem(tname, "PtPos[3]", sc_position);
00080 tuple->addItem(tname, "PtLat", &lat_geo);
00081 tuple->addItem(tname, "PtLon", &lon_geo);
00082 tuple->addItem(tname, "PtMagLat", &lat_mag);
00083 tuple->addItem(tname, "PtAlt", &rad_geo);
00084 tuple->addItem(tname, "PtRaz", &ra_scz);
00085 tuple->addItem(tname, "PtDecz", &dec_scz);
00086 tuple->addItem(tname, "PtRax", &ra_scx);
00087 tuple->addItem(tname, "PtDecx", &dec_scx);
00088 tuple->addItem(tname, "PtSCzenith", &zenith_scz);
00089 tuple->addItem(tname, "PtMcIlwainB", &B);
00090 tuple->addItem(tname, "PtMcIlwainL", &L);
00091
00092 }