]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/AliAstrolab.h
Modifying logging output of components.
[u/mrichter/AliRoot.git] / RALICE / AliAstrolab.h
1 #ifndef ALIASTROLAB_H
2 #define ALIASTROLAB_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 #include <math.h>
10
11 #include "TNamed.h"
12 #include "TString.h"
13 #include "TRotMatrix.h"
14 #include "TObjArray.h"
15 #include "TArrayI.h"
16
17 #include "AliTimestamp.h"
18 #include "AliPosition.h"
19 #include "AliSignal.h"
20  
21 class AliAstrolab : public TNamed,public AliTimestamp
22 {
23  public:
24   AliAstrolab(const char* name="",const char* title="");       // Constructor
25   virtual ~AliAstrolab();                                      // Destructor
26   AliAstrolab(const AliAstrolab& t);                           // Copy constructor
27   virtual TObject* Clone(const char* name="") const;           // Make a deep copy and provide its pointer
28   void Data(Int_t mode=1,TString u="deg");                     // Lab info in angular units u
29   void SetLabPosition(Ali3Vector& r);                          // Set lab position in terrestrial frame
30   void SetLabPosition(Double_t l,Double_t b,TString u="deg");  // Set lab terrestrial position
31   AliPosition GetLabPosition() const;                          // Provide the lab terrestrial position 
32   void GetLabPosition(Double_t& l,Double_t& b,TString u="deg") const;// Provide the lab terrestrial position
33   using AliTimestamp::GetLT;
34   Double_t GetLT();  // Provide Local Time (LT) in fractional hours
35   using AliTimestamp::GetLMST;
36   Double_t GetLMST(); // Provide Local Mean Sidereal Time (LMST) in fractional hours
37   using AliTimestamp::GetLAST;
38   Double_t GetLAST(); // Provide Local Apparent Sidereal Time (LAST) in fractional hours
39   using AliTimestamp::SetLT;
40   void SetLT(Int_t y,Int_t m,Int_t d,Int_t hh,Int_t mm,Int_t ss,Int_t ns=0,Int_t ps=0); // Set specified LT
41   void SetLT(Int_t y,Int_t d,Int_t s,Int_t ns=0,Int_t ps=0); // Set LT based on elapsed days, secs etc...
42   Double_t ConvertAngle(Double_t a,TString in,TString out) const;       // Angular format conversions
43   void PrintAngle(Double_t a,TString in,TString out,Int_t ndig=1) const;// Print angle in various formats
44   void SetSignal(Ali3Vector* r,TString frame,TString mode,AliTimestamp* ts,Int_t jref=0,TString name=""); // Store a generic signal
45   void SetSignal(Double_t a,Double_t d,TString s,Double_t e,TString mode,Int_t jref=0,TString name="");   // Store RA, decl. and time
46   void SetSignal(Double_t a,Double_t d,TString mode,AliTimestamp* ts,Int_t jref=0,TString name="");       // Store RA, decl. and time
47   AliSignal* GetSignal(Ali3Vector& r,TString frame,TString mode,AliTimestamp* ts,Int_t jref=0);// Provide stored signal data
48   AliSignal* GetSignal(Ali3Vector& r,TString frame,TString mode,AliTimestamp* ts,TString name);// Provide stored signal data
49   AliSignal* GetSignal(Double_t& a,Double_t& d,TString mode,AliTimestamp* ts,Int_t jref=0);    // Provide corrected RA and decl.
50   AliSignal* GetSignal(Double_t& a,Double_t& d,TString mode,AliTimestamp* ts,TString name);    // Provide corrected RA and decl.
51   AliSignal* GetSignal(Double_t& a,Double_t& d,TString s,Double_t e,TString mode,Int_t jref=0);// Provide corrected RA and decl.
52   AliSignal* GetSignal(Double_t& a,Double_t& d,TString s,Double_t e,TString mode,TString name);// Provide corrected RA and decl.
53   AliSignal* GetSignal(Int_t jref=0);                // Provide pointer to a stored signal object
54   AliSignal* GetSignal(TString name);                // Provide pointer to a stored signal object
55   void RemoveRefSignal(Int_t j,Int_t compress);      // Remove a stored reference signal object
56   void RemoveRefSignal(TString name,Int_t compress); // Remove a stored reference signal object
57   void PrintSignal(TString frame,TString mode,AliTimestamp* ts,Int_t ndig,Int_t jref=0); // Print stored signal data
58   void PrintSignal(TString frame,TString mode,AliTimestamp* ts,Int_t ndig,TString name); // Print stored signal data
59   void ListSignals(TString frame,TString mode,Int_t ndig=1); // List all stored signals
60   Int_t GetSignalIndex(TString name); // Provide storage index of the signal with the specified name
61   Double_t GetHourAngle(TString mode,AliTimestamp* ts,Int_t jref=0);// Provide the Local Hour Angle in degrees
62   void SetLocalFrame(Double_t t1,Double_t p1,Double_t t2,Double_t p2,Double_t t3,Double_t p3); // Define local coordinate frame
63   using AliTimestamp::GetDifference;
64   Double_t GetDifference(Int_t jref,TString au,Double_t& dt,TString tu,Int_t mode=1,Int_t* ia=0,Int_t* it=0); // Provide space and time difference
65   Double_t GetDifference(TString name,TString au,Double_t& dt,TString tu,Int_t mode=1);// Provide space and time difference
66   TArrayI* MatchRefSignal(Double_t da,TString au,Double_t dt,TString tu,Int_t mode=1); // Provide space and time matching reference signals
67  
68  protected:
69   AliPosition fLabPos;   // Position of the lab in the terrestrial longitude-latitude frame
70   Double_t fToffset;     // Lab time offset in fractional hours w.r.t. UT
71   AliSignal* fXsig;      // Signal entry for object or event studies
72   TObjArray* fRefs;      // Array holding the reference signals
73   TRotMatrix fB;         //! The frame bias matrix for conversion of ICRS to J2000 coordinates
74   Int_t fBias;           //! Initialisation flag for fB values (0=uninitialised  1=initialised)
75   TRotMatrix fP;         //! Matrix for precession correction  
76   TRotMatrix fN;         //! Matrix for nutation correction  
77   TRotMatrix fG;         //! Matrix for conversion of equatorial to galactic coordinates
78   Int_t fGal;            //! Type indicator for fG values (0=uninitialised  1=B1950  2=J2000)
79   TRotMatrix fE;         //! Matrix for conversion of equatorial to ecliptic coordinates
80   TRotMatrix fH;         //! Matrix for conversion of equatorial to horizontal coordinates
81   TRotMatrix fL;         //! Matrix for conversion of horizontal to local-frame coordinates
82   TArrayI* fIndices;     //! Storage indices of the matching reference signals
83   void SetBmatrix();                 // Set the frame bias matrix
84   void SetPmatrix(AliTimestamp* ts); // Set precession matrix for Julian date jd w.r.t. J2000.
85   void SetNmatrix(AliTimestamp* ts); // Set nutation matrix for Julian date jd w.r.t. J2000.
86   void SetGmatrix(TString mode);     // Set the equatorial to galactic conversion matrix
87   void SetEmatrix(AliTimestamp* ts); // Set the equatorial to ecliptic conversion matrix
88   void SetHmatrix(AliTimestamp* ts); // Set the equatorial to horizontal conversion matrix
89   void Precess(Ali3Vector& r,AliTimestamp* ts1,AliTimestamp* ts2); // Correct RA and decl. for earth's precession
90   void Nutate(Ali3Vector& r,AliTimestamp* ts); // Correct RA and decl. for earth's nutation
91  
92  ClassDef(AliAstrolab,1) // Virtual lab to relate measurements with astrophysical phenomena
93 };
94 #endif