-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoundUpFancyMaps.hh
298 lines (267 loc) · 12.5 KB
/
RoundUpFancyMaps.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
#include <TNamed.h>
#include <TGraph.h>
#include <TString.h>
#include <TNtuple.h>
#include <TNtupleD.h>
#include <TH2F.h>
#include <vector>
#include <iostream>
#include <sash/MonitorBase.hh>
#include <display/CanvasHolder.hh>
#include <display/SkyHistogram2D.hh>
namespace SurveySuite {
class MapMaker : public Sash::MonitorBase,
public Display::CanvasHolder
{
public:
typedef TH1F* pTH1F;
typedef Display::SkyHistogram2D * pSkyHisto;
MapMaker();//Sash::HESSArray & hess
//#if defined(__CINT__) || defined(CINTOBJECT)
// = hessdummy
//#endif
// ,const char *name = "");
virtual ~MapMaker();
GETMEMBER(EventsMap,pSkyHisto);
GETMEMBER(AcceptanceMap,pSkyHisto);
GETMEMBER(ExclusionMap,pSkyHisto);
GETMEMBER(ExpectedCountsMap,pSkyHisto);
GETMEMBER(ExtendedExpectedCountsMap,pSkyHisto);
GETMEMBER(ExcessMap,pSkyHisto);
GETMEMBER(UncorrelatedExcessMap,pSkyHisto);
GETMEMBER(SignificanceMap,pSkyHisto);
GETMEMBER(AlphaMap,pSkyHisto);
GETMEMBER(OffMap,pSkyHisto);
GETMEMBER(OffAxisMap,pSkyHisto);
GETMEMBER(ZenithAngleMap,pSkyHisto);
GETMEMBER(MuonEfficiencyMap,pSkyHisto);
GETMEMBER(MinSafeThresholdMap,pSkyHisto);
GETMEMBER(AveragedSafeThresholdMap,pSkyHisto);
GETMEMBER(AveragedLiveTimeMap,pSkyHisto);
GETMEMBER(EventsAndAcceptanceFromFile,bool);
GETMEMBER(EventsAndAcceptanceFromRadial,bool);
GETMEMBER(EventsAndAcceptanceFromRadialFile,bool);
GETMEMBER(ExclusionFromFits, bool);
GETMEMBER(ExclusionFromRegionFile, bool);
GETMEMBER(UseConfigTarget, bool);
GETMEMBER(UseConfigMapParams, bool);
GETMEMBER(UserLambda,double);
GETMEMBER(UserBeta,double);
GETMEMBER(BinSize,double);
GETMEMBER(ExtX,double);
GETMEMBER(ExtY,double);
GETMEMBER(PsiCut,double);
GETMEMBER(OSRadius,double);
GETMEMBER(AdaptFFT,bool);
GETMEMBER(AdaptCut_Alpha,bool);
GETMEMBER(ConstantArea,bool);
GETMEMBER(ConstantThickness,bool);
GETMEMBER(ConstantInnerRadius,bool);
GETMEMBER(SmoothRings,bool);
GETMEMBER(RingMinimalRadius,double);
GETMEMBER(InnerRingMax,double);
GETMEMBER(OuterRingMax,double);
GETMEMBER(RingStep,double);
GETMEMBER(RingParam_AreaOverPi,double);
GETMEMBER(RingParam_ExcFracMax,double);
GETMEMBER(RingParam_Thickness,double);
GETMEMBER(RingParam_AlphaMax,double);
GETMEMBER(StandardRingRadius,double);
GETMEMBER(StandardRingThickness,double);
GETMEMBER(AverageOff,bool);
GETMEMBER(CorrectZenith,bool);
GETMEMBER(EMin,double);
GETMEMBER(EMax,double);
GETMEMBER(FitAcceptance,bool);
GETMEMBER(SelectAllRunsContributingToTheMap,bool);
GETMEMBER(ApplySafeThreshold,bool);
GETMEMBER(SafeThresholdFromAcceptance,bool);
GETMEMBER(SafeThresholdFromPsiCut,bool);
GETMEMBER(SafeThresholdFromPsiValue,double);
GETMEMBER(SafeThresholdRatioParam,double);
GETMEMBER(ProduceFluxProducts,bool);
GETMEMBER(SpectralIndex,double);
GETMEMBER(PointLikeFluxMaps,bool);
GETMEMBER(ProduceSurfaceBrightnessMap,bool);
GETMEMBER(ExposureMapsFromFits,bool);
GETMEMBER(SaveResults,bool);
GETMEMBER(Verbose,bool);
GETMEMBER(ConfigureOutputsFlag, bool);
GETMEMBER(ConfigureFluxProductsFlag, bool);
GETMEMBER(ConfigureRingMethodFlag, bool);
GETMEMBER(ConfigureMapsFlag, bool);
GETMEMBER(ConfigureAcceptanceFlag, bool);
GETMEMBER(ConfigureExclusionsFlag, bool);
GETMEMBER(StartConfigureFlag, bool);
void Clear();
void StartConfigure();
bool ConfigureExclusions(bool ExclusionFromFits,
bool ExclusionFromRegionFile);
bool ConfigureAcceptance(bool EventsAndAcceptanceFromFile,
bool EventsAndAcceptanceFromRadial,
bool EventsAndAcceptanceFromRadialFile,
double PsiCut,
bool FitAcceptance,
bool CorrectZenith,
bool SelectAllRunsContributingToTheMap,
bool ApplySafeThreshold,
bool SafeThresholdFromAcceptance,
bool SafeThresholdFromPsiCut,
double SafeThresholdFromPsiValue,
double SafeThresholdRatioParam);
bool ConfigureMaps(bool UseConfigTarget,
bool UseConfigMapParams,
double UserLambda,
double UserBeta,
double BinSize,
double ExtX,
double ExtY,
double OSRadius,
double EMin,
double EMax);
bool ConfigureRingMethod(bool AdaptFFT,
bool AdaptCut_Alpha,
bool ConstantArea,
bool ConstantThickness,
bool ConstantInnerRadius,
bool SmoothRings,
double RingMinimalRadius,
double InnerRingMax,
double OuterRingMax,
double RingStep,
double RingParam_AreaOverPi,
double RingParam_ExcFracMax,
double RingParam_Thickness,
double RingParam_AlphaMax,
double StandardRingRadius,
double StandardRingThickness,
bool AverageOff);
bool ConfigureFluxProducts(bool ProduceFluxProducts,
double SpectralIndex,
bool PointLikeFluxMaps,
bool ProduceSurfaceBrightnessMap,
bool ExposureMapsFromFits,
const char *AnalysisConfig);
bool ConfigureOutputs(bool SaveResults, bool Verbose);
bool ConfigureRuns(const char *Resfile, int RunNumberMin, int RunNumberMax, bool UseRunListToMatch, bool UseRunsToForbid, const char *RunListToMatch, const char *RunsToForbid, std::string table_path);
bool IsRunInFile(int RunNumber, std::vector<int> File, bool ReverseAnswer);
void RemoveBadTablesRuns(const char *Resfile, std::string table_path);
void ComputeSafeThresholdPerRun(const char *RadialConfig, const char *Resfile, std::string table_path);
bool EndConfigure(const char *RadialConfig, const char *Resfile, int RunNumberMin, int RunNumberMax, bool UseRunListToMatch, bool UseRunsToForbid, const char *RunListToMatch, const char *RunsToForbid, std::string table_path);
void PrintConfigSummary();
void RetrieveRunStat(const char *Resfile);
void DisplayEventsMap(const char *Resfile); // *MENU={Hierarchy="Clear All"}*
void DrawRadialLookup(const char *Config, double ZenithAngle);
void DisplayEventsAndAcceptanceMaps();
void CreateEventsMap_FromFITS(const char *EventsMapFile);
void CreateAcceptanceMap_FromFITS(const char *AccMapFile);
void CreateExclusionMap_FromFITS(const char *ExclusionMapFile);
void CreateEventsMap_FromResultFile(const char *Resfile);
void CreateAcceptanceMap_FromResultFile(const char *Resfile);
void CreateEventsAndAcceptanceMaps_FromRadialLookups(const char *RadialConfig, const char *Resfile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
void CreateExposureMaps_FromFITS(const char *ExposureMapFile);
void CreateExposureMaps_FromFile(const char *ExposureMapFile);
void CreateExtendedExposureMaps_FromFITS(const char *ExposureMapFile);
void CreateExtendedExposureMaps_FromFile(const char *ExposureMapFile);
void CreateExcessMaps_FromFITS(const char *ExcessMapFile);
void CreateAlphaMaps_FromFITS(const char *AlphaMapFile);
void CreateOffMaps_FromFITS(const char *OffMapFile);
void CreateExclusionMask(const char *Resfile, const char *Regionsfile);
void CreateEventsAndAcceptanceMaps(const char *RadialConfig, const char *Resfile, const char *Regionsfile, const char *Evtfile, const char *Accfile, std::string table_path, const char *OutfilePrefix);
void CreateRunList(const char *Resfile, const char *Regionsfile, const char *OutfilePrefix, double SourceRadius, int sourceNumber);
void CreateRunFileInfos(const char *Resfile, const char *Regionsfile, const char *OutfilePrefix);
void CreateEventsInfosFile(const char *RadialConfig, const char *Resfile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
void CreateExposureMaps(const char *RadialConfig, const char *Resfile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
void CreatePSFMaps(const char *RadialConfig, const char *Resfile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
void CreateRingBgMaps(const char *AnalysisConfig, const char *Resfile, const char *Evtfile, const char *Accfile, const char *ExposureMapFile, const char *ExtendedExposureMapFile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
//void CreateFluxMaps_FromFITS(const char *AnalysisConfig, const char *ExcessMapFile, const char *AlphaMapFile, const char *OffMapFile, const char *ExposureMapFile, const char *OutfilePrefix);
void CreateFluxMaps_FromResultFile(const char *AnalysisConfig, const char *ResultFile, const char *ExposureMapFile, const char *ExtendedExposureMapFile, const char *OutfilePrefix);
void CreateEventsAndAcceptanceMaps_FromRadialLookups_PerRun(const char *RadialConfig, const char *Resfile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
void CreateBgMaps_PerRun(const char *AnalysisConfig, const char *Resfile, const char *Evtfile, const char *Accfile, const char *ExposureMapFile, const char *ExtendedExposureMapFile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
void CreateONOFFTestMaps(const char *AnalysisConfig, const char *Resfile, const char *Evtfile, const char *Accfile, const char *ExposureMapFile, const char *ExtendedExposureMapFile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix);
bool CreateEventsAndAcceptanceMaps_FromRadialLookups_OneEntry(const char *RadialConfig, const char *Resfile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix, int EntryNumber);
bool CreateRingBgMaps_OneEntry(const char *AnalysisConfig, const char *Resfile, const char *Evtfile, const char *Accfile, const char *ExposureMapFile, const char *ExtendedExposureMapFile, const char *Regionsfile, std::string table_path, const char *OutfilePrefix, int EntryNumber);
public:
//SkyMaps
Display::SkyHistogram2D *fEventsMap;
Display::SkyHistogram2D *fAcceptanceMap;
Display::SkyHistogram2D *fExclusionMap;
Display::SkyHistogram2D *fExpectedCountsMap;
Display::SkyHistogram2D *fExtendedExpectedCountsMap;
Display::SkyHistogram2D *fExcessMap;
Display::SkyHistogram2D *fUncorrelatedExcessMap;
Display::SkyHistogram2D *fSignificanceMap;
Display::SkyHistogram2D *fAlphaMap;
Display::SkyHistogram2D *fOffMap;
Display::SkyHistogram2D *fOffAxisMap;
Display::SkyHistogram2D *fZenithAngleMap;
Display::SkyHistogram2D *fMuonEfficiencyMap;
Display::SkyHistogram2D *fMinSafeThresholdMap;
Display::SkyHistogram2D *fAveragedSafeThresholdMap;
Display::SkyHistogram2D *fAveragedLiveTimeMap;
//values
bool fEventsAndAcceptanceFromFile;
bool fEventsAndAcceptanceFromRadial;
bool fEventsAndAcceptanceFromRadialFile;
bool fExclusionFromFits;
bool fExclusionFromRegionFile;
bool fUseConfigTarget;
bool fUseConfigMapParams;
double fUserLambda;
double fUserBeta;
double fBinSize;
double fExtX;
double fExtY;
double fPsiCut;
double fOSRadius;
bool fAdaptFFT;
bool fAdaptCut_Alpha;
bool fConstantArea;
bool fConstantThickness;
bool fConstantInnerRadius;
bool fSmoothRings;
double fRingMinimalRadius;
double fInnerRingMax;
double fOuterRingMax;
double fRingStep;
double fRingParam_AreaOverPi;
double fRingParam_ExcFracMax;
double fRingParam_Thickness;
double fRingParam_AlphaMax;
double fStandardRingRadius;
double fStandardRingThickness;
bool fAverageOff;
bool fCorrectZenith;
double fEMin;
double fEMax;
bool fFitAcceptance;
bool fSelectAllRunsContributingToTheMap;
bool fApplySafeThreshold;
bool fSafeThresholdFromAcceptance;
bool fSafeThresholdFromPsiCut;
double fSafeThresholdFromPsiValue;
double fSafeThresholdRatioParam;
bool fProduceFluxProducts;
double fSpectralIndex;
bool fPointLikeFluxMaps;
bool fProduceSurfaceBrightnessMap;
bool fExposureMapsFromFits;
bool fSaveResults;
bool fVerbose;
//Configuration flags
bool fConfigureOutputsFlag;
bool fConfigureFluxProductsFlag;
bool fConfigureRingMethodFlag;
bool fConfigureMapsFlag;
bool fConfigureAcceptanceFlag;
bool fConfigureExclusionsFlag;
bool fStartConfigureFlag;
//Vectors, maps
std::vector<int> fEntriesVector;
std::map<int,double> fPerRunSafeThreshold;
std::map<double,double> fScaleFactor;
std::map<double,std::pair<double,double> > fRadialIntegrationEbin;
protected:
ClassDef(SurveySuite::MapMaker,1);
};
}