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

Last change on this file since 2570 was 2566, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.7 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//////////////////////////////////////////////////////////////////////////////
30#include "MReportDrive.h"
31
32#include "MLogManip.h"
33
34#include "MAstro.h"
35
36ClassImp(MReportDrive);
37
38using namespace std;
39
40MReportDrive::MReportDrive() : MReport("DRIVE-REPORT")
41{
42 fName = "MReportDrive";
43}
44
45Bool_t MReportDrive::InterpreteBody(TString &str)
46{
47 MAstro::String2Angle(str, fRa);
48 MAstro::String2Angle(str, fDec);
49 MAstro::String2Angle(str, fHa);
50
51 Int_t len;
52 Int_t n=sscanf(str.Data(), "%lf %n", &fMjd, &len);
53 if (n!=1)
54 return kFALSE;
55
56 str.Remove(0, len);
57
58 MAstro::String2Angle(str, fNominalZd);
59 MAstro::String2Angle(str, fNominalAz);
60 MAstro::String2Angle(str, fCurrentZd);
61 MAstro::String2Angle(str, fCurrentAz);
62
63 n=sscanf(str.Data(), "%lf %lf %n", &fErrorZd, &fErrorAz, &len);
64 if (n!=2)
65 return kFALSE;
66
67 str.Remove(0, len);
68
69 str = str.Strip(TString::kBoth);
70
71 return str.IsNull();
72}
73
74Double_t MReportDrive::GetAbsError() const
75{
76 const Double_t pzd = fNominalZd*TMath::DegToRad();
77 const Double_t azd = fErrorZd *TMath::DegToRad();
78 const Double_t aaz = fErrorAz *TMath::DegToRad();
79
80 const double el = TMath::Pi()/2-pzd;
81
82 const double dphi2 = aaz/2.;
83 const double cos2 = cos(dphi2)*cos(dphi2);
84 const double sin2 = sin(dphi2)*sin(dphi2);
85 const double d = cos(azd)*cos2 - cos(2*el)*sin2;
86
87 //
88 // Original:
89 // cos(Zd1)*cos(Zd2)+sin(Zd1)*sin(Zd2)*cos(dAz)
90 //
91 // Correct:
92 // const double d = cos(azd)*cos2 - cos(el1+el2)*sin2;
93 //
94 // Estimated:
95 // const double d = cos(azd)*cos2 - cos(2*el)*sin2;
96 //
97
98 return acos(d)*TMath::RadToDeg();
99}
Note: See TracBrowser for help on using the repository browser.