source: trunk/Mars/mpointing/MSrcPosCalc.h@ 12947

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