source: trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h@ 9562

Last change on this file since 9562 was 9070, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1#ifndef MARS_MSrcPosCalc
2#define MARS_MSrcPosCalc
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8#ifndef ROOT_TVector2
9#include <TVector2.h>
10#endif
11
12class MObservatory;
13class MPointingPos;
14class MPointingDev;
15class MSrcPosCam;
16class MGeomCam;
17class MTime;
18class MVector3;
19class MTaskList;
20class MMcEvt;
21class MMcRunHeader;
22
23class MSrcPosCalc : public MTask
24{
25public:
26 enum Mode_t {
27 kDefault = 0, // Set source position to on-position
28 kOffData = 1, // The source position is fixed to (0/0)
29 kWobble = 2, // The source position is set to the wobble aka. anti-source position depending on the cycle number
30 kFixed = 3 // Set source position to predefined fFixedPos
31 };
32private:
33 enum {
34 kIsOwner = BIT(14)
35 };
36
37 const MObservatory *fObservatory; //! Observatory location
38 const MPointingPos *fPointPos; //! Present pointing position of the telescope in Zd/Az
39 const MPointingDev *fDeviation; //! Deviation calculated from starguider data
40 const MMcEvt *fMcEvt; //! Possible input of shower position from MC
41 const MMcRunHeader *fMcHeader; //! Monte Carlo run header needed for correct wobble position
42 const MGeomCam *fGeom; //! Camera geomety
43 const MTime *fTime; //! Time of the current event
44 const MTaskList *fCallback; //! Callback function to get the number of the cycle
45 MPointingPos *fSourcePos; //! Source Postion in sky coordinates
46 MSrcPosCam *fSrcPosCam; //! Output: Source position in the camera
47 MSrcPosCam *fSrcPosAnti; //! Output: Anti Source position in the camera
48
49 UShort_t fRunType; //! Run Type to decide where to get pointing position from
50
51 TVector2 fFixedPos; //! [deg] Fixed source position
52
53 Int_t fMode; // Mode how the source position is calculated
54
55 Int_t fNumRandomOffPositions; // Number of possible random off-sourcr position
56
57 // MSrcPosCalc
58 void SetSrcPos(TVector2 v=TVector2()) const;
59 TVector2 Rotate(TVector2 v, Int_t pass, Int_t num) const;
60 TString GetRaDec(const MPointingPos &pos) const;
61 Bool_t GetCoordinate(TString str, Double_t &ret) const;
62 void FreeSourcePos();
63 void CalcResult(const MVector3 &pos0, const MVector3 &pos);
64 void InitFixedPos() const;
65
66 // MParContainer
67 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
68
69 // MTask
70 Bool_t ReInit(MParList *pList);
71 Int_t PreProcess(MParList *pList);
72 Int_t Process();
73
74public:
75 MSrcPosCalc(const char *name=NULL, const char *title=NULL);
76 ~MSrcPosCalc() { FreeSourcePos(); }
77
78 // MSrcPosCalc
79 void SetSourcePos(MPointingPos *pos) { FreeSourcePos(); fSourcePos = pos; }
80 void SetSourcePos(Double_t ra, Double_t dec);
81 void SetOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); } // Make MSrcPosCalc owner of fSourcePos
82 void SetMode(Mode_t m=kDefault) { fMode = m; }
83 void SetCallback(MTaskList *list) { fCallback=list; }
84 void SetNumRandomOffPositions(Int_t num=0) { fNumRandomOffPositions=num; }
85
86 ClassDef(MSrcPosCalc, 0) // Calculates the source position in the camera
87};
88
89#endif
Note: See TracBrowser for help on using the repository browser.