1 | #ifndef MARS_MSkyPlot
|
---|
2 | #define MARS_MSkyPlot
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #include <vector>
|
---|
9 |
|
---|
10 | #ifndef ROOT_TH2
|
---|
11 | #include <TH2.h>
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #ifndef ROOT_TH1
|
---|
15 | #include <TH1.h>
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | class TH2D;
|
---|
19 | class TH1D;
|
---|
20 |
|
---|
21 | class MParList;
|
---|
22 | class MTime;
|
---|
23 | class MPointingPos;
|
---|
24 | class MSrcPosCam;
|
---|
25 | class MReportDrive;
|
---|
26 | class MObservatory;
|
---|
27 | class MHillas;
|
---|
28 | class MHillasExt;
|
---|
29 | class MHillasSrc;
|
---|
30 | class MNewImagePar;
|
---|
31 | class MGeomCam;
|
---|
32 |
|
---|
33 | class MSkyPlot : public MTask
|
---|
34 | {
|
---|
35 | private:
|
---|
36 | MGeomCam *fGeomCam; //! container to take the event time from
|
---|
37 | MTime *fTime; //! container to take the event time from
|
---|
38 | MPointingPos *fPointPos; //! container to take pointing position from
|
---|
39 | MReportDrive *fRepDrive;
|
---|
40 | MSrcPosCam *fSrcPosCam; //! container with x and y of the source
|
---|
41 | MSrcPosCam *fPntPosCam; //! container with x and y of the position MReportDrive.GetRa, MReportDrive.GetDec
|
---|
42 | MObservatory *fObservatory; //! container to take observatory location from
|
---|
43 | MHillas *fHillas;
|
---|
44 | MHillasExt *fHillasExt;
|
---|
45 | MHillasSrc *fHillasSrc;
|
---|
46 | MNewImagePar *fNewImagePar;
|
---|
47 |
|
---|
48 | Float_t fMm2Deg; // conversion factor for display in degrees
|
---|
49 | Double_t fGridBinning; // degrees
|
---|
50 | Double_t fGridFineBin; // degrees
|
---|
51 |
|
---|
52 | // Float_t fAlphaCut; // Alpha cut
|
---|
53 | // Float_t fBgMean; // Background mean
|
---|
54 |
|
---|
55 | // Float_t fMinDist; // Min dist
|
---|
56 | // Float_t fMaxDist; // Max dist
|
---|
57 |
|
---|
58 | // Float_t fMinLD; // Minimum distance in percent of dist
|
---|
59 | // Float_t fMaxLD; // Maximum distance in percent of dist
|
---|
60 |
|
---|
61 | std::vector <TH1D> fHistAlpha; // vector of histograms for alpha
|
---|
62 | Int_t fNumalphahist; // number of histograms for alpha
|
---|
63 | Int_t fNumBinsAlpha;
|
---|
64 | Float_t fHistAlphaBinWidth;
|
---|
65 | Float_t fAlphaLeftEdge;
|
---|
66 | Float_t fAlphaRightEdge;
|
---|
67 | Float_t fAlphaONMax; // [deg] , upper cut for alpha ON region in the alpha plot
|
---|
68 | // [deg], ON region in the alpha plot, maybe 5 deg is better
|
---|
69 | // NOTE: up to now only values of 5, 10, 15, 20 degrees are possible
|
---|
70 | Float_t fAlphaBgLow; // lower limit for bg region in the ON alpha plot
|
---|
71 | Float_t fAlphaBgUp; // upper limit for bg region in the ON alpha plot
|
---|
72 |
|
---|
73 | TH2D fHistSignif; // sky plot of significance vs. x and y
|
---|
74 | TH2D fHistNexcess; // sky plot of number of excess events vs. x and y
|
---|
75 | TH2D fHistOn; // sky plot of events below fAlphaONMax vs. x and y
|
---|
76 | TH1D fHistSignifGaus; // distribution of significance
|
---|
77 | Bool_t fSetCenter; // used to set the center of these histograms once
|
---|
78 | Double_t fRa0;
|
---|
79 | Double_t fDec0;
|
---|
80 | Bool_t kSaveAlphaPlots;
|
---|
81 | Bool_t kSaveSkyPlots;
|
---|
82 |
|
---|
83 | Float_t fMinXGrid; // [deg] , left edge of the skyplot
|
---|
84 | Float_t fMaxXGrid; // [deg] , right edge of the skyplot
|
---|
85 | Float_t fMinYGrid; // [deg] , upper edge of the skyplot
|
---|
86 | Float_t fMaxYGrid; // [deg] , lower edge of the skyplot
|
---|
87 | Float_t fBinStepGrid; // [deg] , grid size
|
---|
88 | Int_t fNumStepsX; // number of bins in x
|
---|
89 | Int_t fNumStepsY; // number of bins in y
|
---|
90 |
|
---|
91 |
|
---|
92 | // some filter cuts:
|
---|
93 | Float_t fSizeMin; // min size in photons
|
---|
94 | Float_t fSizeMax; // max size in photons
|
---|
95 | Float_t fLeakMax; // leakmax in per cent
|
---|
96 | Float_t fMaxDist; // dist max cut (ever possible)
|
---|
97 | Float_t fMinDist; // dist min cut (ever possible)
|
---|
98 |
|
---|
99 | // coefficients for the cuts:
|
---|
100 | Double_t fLengthUp[8], fLengthLo[8], fWidthUp[8], fWidthLo[8], fDistUp[8], fDistLo[8];
|
---|
101 |
|
---|
102 | Double_t fRa;
|
---|
103 | Double_t fDec;
|
---|
104 |
|
---|
105 | TString fAlphaHName; // name for histogram with alpha plots
|
---|
106 | TString fSkyHName; // name for histogram with sky plots
|
---|
107 |
|
---|
108 | Int_t DistancetoPrimitive(Int_t px, Int_t py);
|
---|
109 |
|
---|
110 | TObject *GetCatalog();
|
---|
111 |
|
---|
112 | Int_t PreProcess(MParList *pList);
|
---|
113 | Int_t Process();
|
---|
114 | Int_t PostProcess();
|
---|
115 |
|
---|
116 |
|
---|
117 | public:
|
---|
118 | MSkyPlot(const char *name=NULL, const char *title=NULL);
|
---|
119 |
|
---|
120 | // TH1 *GetHistByName(const TString name) { return &fHist; }
|
---|
121 | TH2D *GetHistSignif() { return &fHistSignif; }
|
---|
122 | TH2D *GetHistNexcess() { return &fHistNexcess; }
|
---|
123 | TH2D *GetHistOn() { return &fHistOn; }
|
---|
124 | TH1D *GetHistSignifGaus() { return &fHistSignifGaus; }
|
---|
125 |
|
---|
126 | void SetMinDist(Float_t dist) { fMinDist = dist; } // Absolute minimum distance
|
---|
127 | void SetMaxDist(Float_t dist) { fMaxDist = dist; } // Absolute maximum distance
|
---|
128 | void SetSizeMin(Float_t size) { fSizeMin = size; } // Absolute minimum Size
|
---|
129 | void SetSizeMax(Float_t size) { fSizeMax = size; } // Absolute maximum Size
|
---|
130 | // void SetMinLD(Float_t ratio) { fMinLD = ratio; } // Minimum ratio between length/dist
|
---|
131 | // void SetMaxLD(Float_t ratio) { fMaxLD = ratio; } // Maximum ratio between length/dist
|
---|
132 | void ReadCuts(const TString parSCinit);
|
---|
133 | void SetSkyPlot(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t step);
|
---|
134 | Double_t CalcLimit(Double_t *a, Double_t ls, Double_t ls2, Double_t dd2);
|
---|
135 | //void SaveSkyPlots(const TString skyplotfilename="skyplots.root");
|
---|
136 |
|
---|
137 | void SetOutputAlphaName(TString outname1) { fAlphaHName = outname1; }
|
---|
138 | void SaveSkyPlots(TString stri);
|
---|
139 |
|
---|
140 |
|
---|
141 | //void SaveAlphaPlots(const TString alphaplotfilename="alphaplots.root");
|
---|
142 | void SetOutputSkyName(TString outname2) { fSkyHName = outname2; }
|
---|
143 | void SaveAlphaPlots(const TString stri2);
|
---|
144 |
|
---|
145 | void SetAlphaCut(Float_t alpha);
|
---|
146 | void SetAlphaBGLimits(Float_t alphalow, Float_t alphalup);
|
---|
147 |
|
---|
148 | //std::vector <TH1D>::iterator GetAlphaPlots() { std::vector <TH1D>::iterator iter; return iter = fHistAlpha.begin() ; }
|
---|
149 | std::vector <TH1D> GetAlphaPlots() { return fHistAlpha ; }
|
---|
150 |
|
---|
151 | void Draw(Option_t *option="");
|
---|
152 |
|
---|
153 | ClassDef(MSkyPlot, 0) //2D-histogram in alpha, x and y
|
---|
154 | };
|
---|
155 |
|
---|
156 | #endif
|
---|