source: trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.cc@ 2906

Last change on this file since 2906 was 1745, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.2 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): Robert Wagner 10/2002 <mailto:magicsoft@rwagner.de>
19!
20! Copyright: MAGIC Software Development, 2002
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26// //
27// MObservatoryLocation //
28// //
29// //
30/////////////////////////////////////////////////////////////////////////////
31#include "MObservatoryLocation.h"
32
33#include <TMath.h>
34
35#include "MLog.h"
36#include "MLogManip.h"
37
38ClassImp(MObservatoryLocation);
39
40void MObservatoryLocation::Init(const char *name, const char *title)
41{
42 fName = name ? name : "MObservatoryLocation";
43 fTitle = title ? title : "Storage container for coordinates of an observatory";
44}
45
46MObservatoryLocation::MObservatoryLocation(const char *name, const char *title)
47{
48 Init();
49
50 fLatitude = 28.7594 / kRad2Deg; // rad; 28 45 34
51 fLongitude = 17.8761 / kRad2Deg; // rad; 17 52 34;
52 // slalib uses + for WEST !!!
53 fElevation = 2300; // m
54 fObsName = "Observatorio del Roque de los Muchachos";
55}
56
57MObservatoryLocation::MObservatoryLocation(LocationName_t name, const char *name=NULL, const char *title=NULL)
58{
59 Init();
60
61 switch (name)
62 {
63 case kMagic1:
64 case kMagic2:
65 case kRobertGarten:
66 fLatitude = 28.7594 / kRad2Deg; // rad; 28 45 34
67 fLongitude = 17.8761 / kRad2Deg; // rad; 17 52 34;
68 // slalib uses + for WEST !!!
69 fElevation = 2300; // m
70 fObsName = "Observatorio del Roque de los Muchachos";
71 break;
72 }
73}
74
75//Double_t GetHorizon(Double_t phi);
76//TF1 SetHorizonLine() { return fHorizon; }
77//TF1 GetHorizonLine() { return fHorizon; }
78
79MObservatoryLocation::~MObservatoryLocation()
80{
81 // do nothing special.
82}
83
84void MObservatoryLocation::Print(Option_t *) const
85{
86 *fLog << all;
87 *fLog << fObsName << endl;
88 *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude*kRad2Deg) : -(fLatitude*kRad2Deg)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
89 *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude*kRad2Deg) : -(fLongitude*kRad2Deg)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
90 *fLog << "Elevation " << fElevation << "m" << endl;
91}
92
Note: See TracBrowser for help on using the repository browser.