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

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