| 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 | Bool_t kSaveNexPlot;
|
|---|
| 83 |
|
|---|
| 84 | Float_t fMinXGrid; // [deg] , left edge of the skyplot
|
|---|
| 85 | Float_t fMaxXGrid; // [deg] , right edge of the skyplot
|
|---|
| 86 | Float_t fMinYGrid; // [deg] , upper edge of the skyplot
|
|---|
| 87 | Float_t fMaxYGrid; // [deg] , lower edge of the skyplot
|
|---|
| 88 | Float_t fBinStepGrid; // [deg] , grid size
|
|---|
| 89 | Int_t fNumStepsX; // number of bins in x
|
|---|
| 90 | Int_t fNumStepsY; // number of bins in y
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 | // some filter cuts:
|
|---|
| 94 | Float_t fSizeMin; // min size in photons
|
|---|
| 95 | Float_t fSizeMax; // max size in photons
|
|---|
| 96 | Float_t fLeakMax; // leakmax in per cent
|
|---|
| 97 | Float_t fMaxDist; // dist max cut (ever possible)
|
|---|
| 98 | Float_t fMinDist; // dist min cut (ever possible)
|
|---|
| 99 |
|
|---|
| 100 | // coefficients for the cuts:
|
|---|
| 101 | Double_t fLengthUp[8], fLengthLo[8], fWidthUp[8], fWidthLo[8], fDistUp[8], fDistLo[8];
|
|---|
| 102 |
|
|---|
| 103 | Double_t fRa;
|
|---|
| 104 | Double_t fDec;
|
|---|
| 105 |
|
|---|
| 106 | TString fAlphaHName; // name for histogram with alpha plots
|
|---|
| 107 | TString fSkyHName; // name for histogram with sky plots
|
|---|
| 108 | TString fNexHName; // name for canvas with Nex plot
|
|---|
| 109 |
|
|---|
| 110 | Int_t DistancetoPrimitive(Int_t px, Int_t py);
|
|---|
| 111 |
|
|---|
| 112 | TObject *GetCatalog();
|
|---|
| 113 |
|
|---|
| 114 | Int_t PreProcess(MParList *pList);
|
|---|
| 115 | Int_t Process();
|
|---|
| 116 | Int_t PostProcess();
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 | public:
|
|---|
| 120 | MSkyPlot(const char *name=NULL, const char *title=NULL);
|
|---|
| 121 |
|
|---|
| 122 | // TH1 *GetHistByName(const TString name) { return &fHist; }
|
|---|
| 123 | TH2D *GetHistSignif() { return &fHistSignif; }
|
|---|
| 124 | TH2D *GetHistNexcess() { return &fHistNexcess; }
|
|---|
| 125 | TH2D *GetHistOn() { return &fHistOn; }
|
|---|
| 126 | TH1D *GetHistSignifGaus() { return &fHistSignifGaus; }
|
|---|
| 127 |
|
|---|
| 128 | void SetMinDist(Float_t dist) { fMinDist = dist; } // Absolute minimum distance
|
|---|
| 129 | void SetMaxDist(Float_t dist) { fMaxDist = dist; } // Absolute maximum distance
|
|---|
| 130 | void SetSizeMin(Float_t size) { fSizeMin = size; } // Absolute minimum Size
|
|---|
| 131 | void SetSizeMax(Float_t size) { fSizeMax = size; } // Absolute maximum Size
|
|---|
| 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 |
|
|---|
| 136 | void SetOutputSkyName(TString outname2) { fSkyHName = outname2; }
|
|---|
| 137 | void SaveSkyPlots(TString stri);
|
|---|
| 138 | void SetNotSaveSkyPlots() { kSaveSkyPlots = kFALSE; }
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | void SetOutputAlphaName(TString outname1) { fAlphaHName = outname1; }
|
|---|
| 142 | void SaveAlphaPlots(const TString stri2);
|
|---|
| 143 | void SetNotSaveAlphaPlots() { kSaveAlphaPlots = kFALSE; }
|
|---|
| 144 |
|
|---|
| 145 | void SetOutputNexName(TString outname3) { fNexHName = outname3; }
|
|---|
| 146 | void SaveNexPlot(const TString stri3);
|
|---|
| 147 | void SetNotSaveNexPlot() { kSaveNexPlot = kFALSE; }
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | void SetAlphaCut(Float_t alpha);
|
|---|
| 151 | void SetAlphaBGLimits(Float_t alphalow, Float_t alphalup);
|
|---|
| 152 |
|
|---|
| 153 | //std::vector <TH1D>::iterator GetAlphaPlots() { std::vector <TH1D>::iterator iter; return iter = fHistAlpha.begin() ; }
|
|---|
| 154 | std::vector <TH1D> GetAlphaPlots() { return fHistAlpha ; }
|
|---|
| 155 |
|
|---|
| 156 | void Draw(Option_t *option="");
|
|---|
| 157 |
|
|---|
| 158 | ClassDef(MSkyPlot, 0) //2D-histogram in alpha, x and y
|
|---|
| 159 | };
|
|---|
| 160 |
|
|---|
| 161 | #endif
|
|---|