11 #ifndef ANITAGEOMTOOL_H 12 #define ANITAGEOMTOOL_H 19 #include "AnitaConventions.h" 23 #include "AnitaConventions.h" 26 #include "TObjArray.h" 27 #include "TObjString.h" 35 #define R_EARTH 6.378137E6 36 #define GEOID_MAX 6.378137E6 // parameters of geoid model 37 #define GEOID_MIN 6.356752E6 38 #define C_LIGHT 299792458 //meters 39 #define FLATTENING_FACTOR (1./298.257223563) 67 Int_t &surf, Int_t &chan, Int_t &ant);
79 static Int_t getSurfFromAnt(Int_t ant);
82 Int_t &surf,Int_t &chan);
92 Int_t &surf, Int_t &l1Chan);
94 Int_t &surf, Int_t &l1Chan);
100 static void getNeighbors(Int_t rx,
int& rxleft,
int& rxright);
106 static Double_t
getPhiDiff(Double_t firstPhi, Double_t secondPhi);
117 void getAntXYZ(Int_t ant, Double_t &x, Double_t &y, Double_t &z,
129 void getAntFaceXYZ(Int_t ant, Double_t &x, Double_t &y, Double_t &z);
140 Double_t xAntFromDeckHorn[NUM_SEAVEYS];
141 Double_t yAntFromDeckHorn[NUM_SEAVEYS];
142 Double_t zAntFromDeckHorn[NUM_SEAVEYS];
143 Double_t rAntFromDeckHorn[NUM_SEAVEYS];
144 Double_t azCentreFromDeckHorn[NUM_SEAVEYS];
145 Double_t apertureAzFromDeckHorn[NUM_SEAVEYS];
146 Double_t apertureElFromDeckHorn[NUM_SEAVEYS];
149 Double_t xPhaseCentreFromDeckHorn[NUM_SEAVEYS][NUM_POLS];
150 Double_t yPhaseCentreFromDeckHorn[NUM_SEAVEYS][NUM_POLS];
151 Double_t zPhaseCentreFromDeckHorn[NUM_SEAVEYS][NUM_POLS];
152 Double_t rPhaseCentreFromDeckHorn[NUM_SEAVEYS][NUM_POLS];
153 Double_t azPhaseCentreFromDeckHorn[NUM_SEAVEYS][NUM_POLS];
156 Double_t xAntFromDeckBicone[NUM_BICONES];
157 Double_t yAntFromDeckBicone[NUM_BICONES];
158 Double_t zAntFromDeckBicone[NUM_BICONES];
160 Double_t xAntFromDeckDiscone[NUM_DISCONES];
161 Double_t yAntFromDeckDiscone[NUM_DISCONES];
162 Double_t zAntFromDeckDiscone[NUM_DISCONES];
164 Double_t xAnitaBoxFromDeckCorner[4];
165 Double_t yAnitaBoxFromDeckCorner[4];
166 Double_t zAnitaBoxFromDeckCorner[4];
167 Double_t xBatteryBoxFromDeckCorner[4];
168 Double_t yBatteryBoxFromDeckCorner[4];
169 Double_t zBatteryBoxFromDeckCorner[4];
170 Double_t xSipBoxFromDeckCorner[4];
171 Double_t ySipBoxFromDeckCorner[4];
172 Double_t zSipBoxFromDeckCorner[4];
174 Double_t gpsPlaneFromDeck[3];
175 Double_t gpsHeadingFromDeck[3];
176 Double_t aftForeOffsetAngleDeck;
178 Double_t xAntFromVerticalHorn[NUM_SEAVEYS];
179 Double_t yAntFromVerticalHorn[NUM_SEAVEYS];
180 Double_t zAntFromVerticalHorn[NUM_SEAVEYS];
181 Double_t rAntFromVerticalHorn[NUM_SEAVEYS];
182 Double_t azCentreFromVerticalHorn[NUM_SEAVEYS];
183 Double_t apertureAzFromVerticalHorn[NUM_SEAVEYS];
184 Double_t apertureElFromVerticalHorn[NUM_SEAVEYS];
186 Double_t xPhaseCentreFromVerticalHorn[NUM_SEAVEYS][NUM_POLS];
187 Double_t yPhaseCentreFromVerticalHorn[NUM_SEAVEYS][NUM_POLS];
188 Double_t zPhaseCentreFromVerticalHorn[NUM_SEAVEYS][NUM_POLS];
189 Double_t rPhaseCentreFromVerticalHorn[NUM_SEAVEYS][NUM_POLS];
190 Double_t azPhaseCentreFromVerticalHorn[NUM_SEAVEYS][NUM_POLS];
193 Double_t xAntFromVerticalBicone[NUM_BICONES];
194 Double_t yAntFromVerticalBicone[NUM_BICONES];
195 Double_t zAntFromVerticalBicone[NUM_BICONES];
197 Double_t xAntFromVerticalDiscone[NUM_DISCONES];
198 Double_t yAntFromVerticalDiscone[NUM_DISCONES];
199 Double_t zAntFromVerticalDiscone[NUM_DISCONES];
201 Double_t xAnitaBoxFromVerticalCorner[4];
202 Double_t yAnitaBoxFromVerticalCorner[4];
203 Double_t zAnitaBoxFromVerticalCorner[4];
204 Double_t xBatteryBoxFromVerticalCorner[4];
205 Double_t yBatteryBoxFromVerticalCorner[4];
206 Double_t zBatteryBoxFromVerticalCorner[4];
207 Double_t xSipBoxFromVerticalCorner[4];
208 Double_t ySipBoxFromVerticalCorner[4];
209 Double_t zSipBoxFromVerticalCorner[4];
211 Double_t gpsPlaneFromVertical[3];
212 Double_t gpsHeadingFromVertical[3];
213 Double_t aftForeOffsetAngleVertical;
216 Double_t deltaRPhaseCentre[NUM_SEAVEYS][NUM_POLS];
217 Double_t deltaZPhaseCentre[NUM_SEAVEYS][NUM_POLS];
218 Double_t deltaPhiPhaseCentre[NUM_SEAVEYS][NUM_POLS];
219 Double_t ringPhaseCentreOffset[3];
222 TVector3 fHeadingRotationAxis;
223 TVector3 fPitchRotationAxis;
224 TVector3 fRollRotationAxis;
228 Double_t xAntFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
229 Double_t yAntFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
230 Double_t zAntFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
231 Double_t rAntFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
232 Double_t azCentreFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
233 Double_t apertureAzFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
234 Double_t apertureElFromVerticalHornPhotogrammetry[NUM_SEAVEYS];
236 Double_t xPhaseCentreFromVerticalHornPhotogrammetry[NUM_SEAVEYS][NUM_POLS];
237 Double_t yPhaseCentreFromVerticalHornPhotogrammetry[NUM_SEAVEYS][NUM_POLS];
238 Double_t zPhaseCentreFromVerticalHornPhotogrammetry[NUM_SEAVEYS][NUM_POLS];
239 Double_t rPhaseCentreFromVerticalHornPhotogrammetry[NUM_SEAVEYS][NUM_POLS];
240 Double_t azPhaseCentreFromVerticalHornPhotogrammetry[NUM_SEAVEYS][NUM_POLS];
241 Double_t aftForeOffsetAngleVerticalPhotogrammetry;
243 void updateAnt(Double_t deltaR,Double_t deltaRL,Double_t deltaUD);
245 void addPhaseCenters();
247 void usePhotogrammetryNumbers(Int_t flag) {
248 fUsePhotogrammetryNumbers=flag;
253 Double_t c=TMath::Cos(theta);
254 return GEOID_MIN*GEOID_MAX/TMath::Sqrt(GEOID_MIN*GEOID_MIN-
255 (GEOID_MIN*GEOID_MIN-GEOID_MAX*GEOID_MAX)*c*c);
258 void getCartesianCoords(Double_t lat, Double_t lon, Double_t alt, Double_t p[3]);
259 void getLatLonAltFromCartesian(Double_t p[3], Double_t &lat, Double_t &lon, Double_t &alt);
260 Double_t getDistanceToCentreOfEarth(Double_t lat);
263 return (90.-((theta*TMath::RadToDeg())));
268 Double_t phi_deg = phi*TMath::RadToDeg();
271 return (90.-phi_deg);
275 return (90.- lat)*TMath::DegToRad();
280 Double_t phi_deg = 90. - lon;
281 if(phi_deg<0) phi_deg+=360;
282 return phi_deg*TMath::DegToRad();
289 pt=sqrt(p[0]*p[0]+p[1]*p[1]);
293 if (p[1]/pt>1 || p[1]/pt<-1) {
294 std::cerr <<
"Error in getPhi. \n";
299 if (p[1]<0. && p[0]>0) phi += 2*TMath::Pi();
300 else if (phi>0 && p[0]<0.) phi = TMath::Pi() - phi;
301 else if (phi<0 && p[0]<0.) phi = -(TMath::Pi()+phi)+2*TMath::Pi();
305 inline Double_t
getPhi(TVector3 &thePos) {
306 Double_t p[3]={thePos.X(),thePos.Y(),thePos.Z()};
313 Double_t tantheta1=0;
317 pt=sqrt(p[0]*p[0]+p[1]*p[1]);
319 theta=atan(tantheta1);
322 theta += TMath::Pi();
328 Double_t p[3]={thePos.X(),thePos.Y(),thePos.Z()};
333 inline void getLonLat(Double_t p[3],Double_t& lon,Double_t& lat) {
338 inline void getLonLat(TVector3 &thePos,Double_t& lon,Double_t& lat) {
346 void readAnita2Photogrammetry();
347 void readPhotogrammetry(
int version);
348 void readSimonsNumbers();
349 void readPhaseCenterNumbers(
int version);
350 Int_t fUsePhotogrammetryNumbers;
359 #endif //ANITAGEOMTOOL_H
enum AnitaRing::EAnitaRing AnitaRing_t
Ring enumeration.
enum AnitaTrigPol::EAnitaTrigPol AnitaTrigPol_t
Polarisation enumeration.
UsefulAnitaEvent – The Calibrated Useful Anita Event object.
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.