| 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 TH1I;
|
|---|
| 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 | vector <TH1I> 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 | Bool_t fSetCenter; // used to set the center of these histograms once
|
|---|
| 77 | Double_t fRa0;
|
|---|
| 78 | Double_t fDec0;
|
|---|
| 79 | Bool_t kSaveAlphaPlots;
|
|---|
| 80 | Bool_t kSaveSkyPlots;
|
|---|
| 81 |
|
|---|
| 82 | Float_t fMinXGrid; // [deg] , left edge of the skyplot
|
|---|
| 83 | Float_t fMaxXGrid; // [deg] , right edge of the skyplot
|
|---|
| 84 | Float_t fMinYGrid; // [deg] , upper edge of the skyplot
|
|---|
| 85 | Float_t fMaxYGrid; // [deg] , lower edge of the skyplot
|
|---|
| 86 | Float_t fBinStepGrid; // [deg] , grid size
|
|---|
| 87 | Float_t fNumStepsX; // number of bins in x
|
|---|
| 88 | Float_t fNumStepsY; // number of bins in y
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | // some filter cuts:
|
|---|
| 92 | Float_t fSizeMin; // min size in photons
|
|---|
| 93 | Float_t fSizeMax; // max size in photons
|
|---|
| 94 | Float_t fLeakMax; // leakmax in per cent
|
|---|
| 95 | Float_t fMaxDist; // dist max cut (ever possible)
|
|---|
| 96 | Float_t fMinDist; // dist min cut (ever possible)
|
|---|
| 97 |
|
|---|
| 98 | // coefficients for the cuts:
|
|---|
| 99 | Double_t fLengthUp[8], fLengthLo[8], fWidthUp[8], fWidthLo[8], fDistUp[8], fDistLo[8];
|
|---|
| 100 |
|
|---|
| 101 | Double_t fRa;
|
|---|
| 102 | Double_t fDec;
|
|---|
| 103 |
|
|---|
| 104 | Int_t DistancetoPrimitive(Int_t px, Int_t py);
|
|---|
| 105 |
|
|---|
| 106 | TObject *GetCatalog();
|
|---|
| 107 |
|
|---|
| 108 | Int_t PreProcess(MParList *pList);
|
|---|
| 109 | Int_t Process();
|
|---|
| 110 | Int_t PostProcess();
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 | public:
|
|---|
| 114 | MSkyPlot(const char *name=NULL, const char *title=NULL);
|
|---|
| 115 |
|
|---|
| 116 | // TH1 *GetHistByName(const TString name) { return &fHist; }
|
|---|
| 117 |
|
|---|
| 118 | void SetMinDist(Float_t dist) { fMinDist = dist; } // Absolute minimum distance
|
|---|
| 119 | void SetMaxDist(Float_t dist) { fMaxDist = dist; } // Absolute maximum distance
|
|---|
| 120 | // void SetMinLD(Float_t ratio) { fMinLD = ratio; } // Minimum ratio between length/dist
|
|---|
| 121 | // void SetMaxLD(Float_t ratio) { fMaxLD = ratio; } // Maximum ratio between length/dist
|
|---|
| 122 | void ReadCuts(const TString parSCinit);
|
|---|
| 123 | void SetSkyPlot(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t step);
|
|---|
| 124 | Double_t CalcLimit(Double_t *a, Double_t ls, Double_t ls2, Double_t dd2);
|
|---|
| 125 | void SaveSkyPlots(const TString skyplotfilename="skyplots.root");
|
|---|
| 126 | void SaveAlphaPlots(const TString alphaplotfilename="alphaplots.root");
|
|---|
| 127 |
|
|---|
| 128 | void SetAlphaCut(Float_t alpha);
|
|---|
| 129 |
|
|---|
| 130 | void Draw(Option_t *option="");
|
|---|
| 131 |
|
|---|
| 132 | ClassDef(MSkyPlot, 0) //2D-histogram in alpha, x and y
|
|---|
| 133 | };
|
|---|
| 134 |
|
|---|
| 135 | #endif
|
|---|