source: trunk/MagicSoft/Mars/mreport/MReportDrive.cc@ 2593

Last change on this file since 2593 was 2593, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.0 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MReportDrive
28//
29// This is the class interpreting and storing the DRIVE-REPORT information.
30//
31// This is NOT the place to get the pointing position from. The class
32// definition might change. But it is the place to calculate the
33// correct pointing position from.
34//
35//////////////////////////////////////////////////////////////////////////////
36#include "MReportDrive.h"
37
38#include "MLogManip.h"
39
40#include "MAstro.h"
41
42ClassImp(MReportDrive);
43
44using namespace std;
45
46MReportDrive::MReportDrive() : MReport("DRIVE-REPORT")
47{
48 fName = "MReportDrive";
49 fTitle = "Class for DRIVE-REPORT information";
50}
51
52Bool_t MReportDrive::InterpreteBody(TString &str)
53{
54 MAstro::String2Angle(str, fRa);
55 MAstro::String2Angle(str, fDec);
56 MAstro::String2Angle(str, fHa);
57
58 Int_t len;
59 Int_t n=sscanf(str.Data(), "%lf %n", &fMjd, &len);
60 if (n!=1)
61 return kFALSE;
62
63 str.Remove(0, len);
64
65 MAstro::String2Angle(str, fNominalZd);
66 MAstro::String2Angle(str, fNominalAz);
67 MAstro::String2Angle(str, fCurrentZd);
68 MAstro::String2Angle(str, fCurrentAz);
69
70 n=sscanf(str.Data(), "%lf %lf %n", &fErrorZd, &fErrorAz, &len);
71 if (n!=2)
72 return kFALSE;
73
74 str.Remove(0, len);
75
76 str = str.Strip(TString::kBoth);
77
78 return str.IsNull();
79}
80
81Double_t MReportDrive::GetAbsError() const
82{
83 const Double_t pzd = fNominalZd*TMath::DegToRad();
84 const Double_t azd = fErrorZd *TMath::DegToRad();
85 const Double_t aaz = fErrorAz *TMath::DegToRad();
86
87 const double el = TMath::Pi()/2-pzd;
88
89 const double dphi2 = aaz/2.;
90 const double cos2 = cos(dphi2)*cos(dphi2);
91 const double sin2 = sin(dphi2)*sin(dphi2);
92 const double d = cos(azd)*cos2 - cos(2*el)*sin2;
93
94 //
95 // Original:
96 // cos(Zd1)*cos(Zd2)+sin(Zd1)*sin(Zd2)*cos(dAz)
97 //
98 // Correct:
99 // const double d = cos(azd)*cos2 - cos(el1+el2)*sin2;
100 //
101 // Estimated:
102 // const double d = cos(azd)*cos2 - cos(2*el)*sin2;
103 //
104
105 return acos(d)*TMath::RadToDeg();
106}
Note: See TracBrowser for help on using the repository browser.