1 | void SetupWriter(MWriteRootFile *write, const char *name, Bool_t ismc) const
|
---|
2 | {
|
---|
3 | if (!write)
|
---|
4 | return;
|
---|
5 |
|
---|
6 | write->SetName(name);
|
---|
7 | write->AddContainer("MHillas", "Events");
|
---|
8 | write->AddContainer("MHillasSrc", "Events");
|
---|
9 | write->AddContainer("MHillasExt", "Events");
|
---|
10 | write->AddContainer("MPointingPos", "Events");
|
---|
11 | write->AddContainer("MHillasSrcAnti", "Events", kFALSE);
|
---|
12 | write->AddContainer("MImagePar", "Events", kFALSE);
|
---|
13 | write->AddContainer("MNewImagePar", "Events", kFALSE);
|
---|
14 | write->AddContainer("MNewImagePar2", "Events", kFALSE);
|
---|
15 | write->AddContainer("Hadronness", "Events", kFALSE);
|
---|
16 | write->AddContainer("MSrcPosCam", "Events", kFALSE);
|
---|
17 | write->AddContainer("MSrcPosAnti", "Events", kFALSE);
|
---|
18 | write->AddContainer("ThetaSquared", "Events", kFALSE);
|
---|
19 | write->AddContainer("OpticalAxis", "Events", kFALSE);
|
---|
20 | write->AddContainer("Disp", "Events", kFALSE);
|
---|
21 | write->AddContainer("Ghostbuster", "Events", kFALSE);
|
---|
22 | write->AddContainer("MEnergyEst", "Events", kFALSE);
|
---|
23 | write->AddContainer("MTime", "Events", kFALSE);
|
---|
24 | write->AddContainer("MMcEvt", "Events", kFALSE);
|
---|
25 | write->AddContainer("MEnergyEst", "Events", kFALSE);
|
---|
26 | write->AddContainer("DataType", "Events");
|
---|
27 | write->AddContainer("Weight", "Events");
|
---|
28 | write->AddContainer("FileId", "Events");
|
---|
29 | write->AddContainer("EvtNumber", "Events");
|
---|
30 |
|
---|
31 | write->AddContainer("MMcRunHeader", "RunHeaders", kFALSE);
|
---|
32 | write->AddContainer("MMcCorsikaRunHeader", "RunHeaders", kFALSE);
|
---|
33 | write->AddContainer("MCorsikaRunHeader", "RunHeaders", kFALSE);
|
---|
34 |
|
---|
35 | //if (ismc)
|
---|
36 | // write->AddCopySource("OriginalMC");
|
---|
37 | }
|
---|
38 |
|
---|
39 | int ganymed(const char *dataset, const char *outfile, Float_t ra, Float_t dec, Bool_t ismc=false)
|
---|
40 | {
|
---|
41 | MDirIter files;
|
---|
42 | if (files.ReadList(dataset)<=0)
|
---|
43 | return 2;
|
---|
44 | files.Sort();
|
---|
45 |
|
---|
46 | // =============================================================
|
---|
47 |
|
---|
48 | // Crab (05h34'32" 22d00'52")
|
---|
49 | MPointingPos source("MSourcePos");
|
---|
50 | //source.SetSkyPosition(5.5755, 22.0144); // ra[h], dec[deg]
|
---|
51 | //source.SetSkyPosition(12.356089, 30.176897); // ra[h], dec[deg]//1218
|
---|
52 | //source.SetSkyPosition(16.897867,39.760201);// mrk501
|
---|
53 | //source.SetSkyPosition(11.0742, 38.2089); // ra[h], dec[deg]//mrk421
|
---|
54 |
|
---|
55 | if (ismc)
|
---|
56 | source.SetLocalPosition(ra, dec); // RA is ZD, DEC, is AZ!!!!
|
---|
57 | else
|
---|
58 | source.SetSkyPosition(ra, dec); // ra[h], dec[deg]//mrk421
|
---|
59 |
|
---|
60 | UInt_t fNumOffSourcePos = 5;
|
---|
61 |
|
---|
62 | // =============================================================
|
---|
63 |
|
---|
64 | // FIXME: If fPathIn read cuts and energy estimator from file!
|
---|
65 | MContinue contq("MImagePar.fNumIslands>3.5"
|
---|
66 | "|| MNewImagePar.fNumUsedPixels<5.5"
|
---|
67 | "|| MNewImagePar.fLeakage1>0.1",
|
---|
68 | "CutQ");
|
---|
69 |
|
---|
70 | MContinue cont0("MHillas.fSize<0"
|
---|
71 | "|| MHillasExt.fSlopeSpreadWeighted>0.68"
|
---|
72 | "|| MHillasExt.fSlopeSpreadWeighted<0.18"
|
---|
73 | "|| log10(MHillas.GetArea*MGeomCam.fConvMm2Deg^2)>(log10(MHillas.fSize)-2)*1.1-1.55"
|
---|
74 | "|| MNewImagePar.fConcCore < 0.13"
|
---|
75 | "|| MNewImagePar.fConcCOG < 0.15"
|
---|
76 | , "Cut0");
|
---|
77 |
|
---|
78 | // Cuts before plots
|
---|
79 | MContinue cont2("0"
|
---|
80 | "|| MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg<-0.07"
|
---|
81 | "|| log10(MNewImagePar.fConc1)<-log10(MHillas.fSize)*0.57+0.13"
|
---|
82 | //"|| log10(MNewImagePar.fConc1)>-log10(MHillas.fSize)*0.57+0.5"
|
---|
83 | //"|| MHillasSrc.fDist*MGeomCam.fConvMm2Deg>log10(MHillas.fSize)*0.42+0.29"
|
---|
84 | "|| MHillas.GetArea*MGeomCam.fConvMm2Deg^2<0.01"
|
---|
85 | "|| MHillasSrc.fDist*MGeomCam.fConvMm2Deg>log10(MHillas.fSize)*0.5+0.095"
|
---|
86 | "|| MHillasSrc.fDist*MGeomCam.fConvMm2Deg<0.4"
|
---|
87 | "|| MHillasSrc.fDist*MGeomCam.fConvMm2Deg>1.2",
|
---|
88 | "Cut2");
|
---|
89 |
|
---|
90 | TArrayD param(12);
|
---|
91 | // Parametrization of Disp
|
---|
92 | param[0] = 1.15136; // constant
|
---|
93 | param[8] = 0.0681437; // slope
|
---|
94 | param[9] = 2.62932; // leak
|
---|
95 | param[10] = 1.51279; // size-offset
|
---|
96 | param[11] = 0.0507821; // size-slope
|
---|
97 | // Parametrization for sign of disp (m3long, slope)
|
---|
98 | param[5] = -0.07;
|
---|
99 | param[6] = 7.2;
|
---|
100 | param[7] = 0.5;
|
---|
101 | // ThetaSq-Cut
|
---|
102 | param[1] = 0.11; // 0.215
|
---|
103 | // Area-Cut
|
---|
104 | param[2] = 0.215468;
|
---|
105 | param[3] = 5.63973;
|
---|
106 | param[4] = 0.0836169;
|
---|
107 |
|
---|
108 | // --------------------------------------------------------------------------------
|
---|
109 |
|
---|
110 | // Setup fitter and histograms
|
---|
111 | MAlphaFitter fit;
|
---|
112 | fit.SetBackgroundFitMin(0.09);
|
---|
113 | fit.SetBackgroundFitMax(0.25);
|
---|
114 | fit.SetPolynomOrder(1);
|
---|
115 | fit.SetSignalFunction(MAlphaFitter::kThetaSq);
|
---|
116 | fit.SetScaleUser(1./fNumOffSourcePos); // includes fit.SetScaleMode(MAlphaFitter::kUserScale);
|
---|
117 |
|
---|
118 | // --------------------------------------------------------------------------------
|
---|
119 |
|
---|
120 | MBinning bins3( 67, -0.005, 0.665, "BinningTheta", "asin");
|
---|
121 | MBinning binsD( 25, 0, 2.5, "BinningDist");
|
---|
122 | MBinning binsC( 25, 0, 2.5, "BinningDistC");
|
---|
123 | MBinning binsR( 60, 0, 300, "BinningRate");
|
---|
124 |
|
---|
125 | // --------------------------------------------------------------------------------
|
---|
126 |
|
---|
127 | MParList plist;
|
---|
128 | plist.AddToList(&source);
|
---|
129 | plist.AddToList(&fit);
|
---|
130 |
|
---|
131 | // Initialize default binnings
|
---|
132 | plist.AddToList(&bins3);
|
---|
133 | plist.AddToList(&binsD);
|
---|
134 | plist.AddToList(&binsC);
|
---|
135 | plist.AddToList(&binsR);
|
---|
136 |
|
---|
137 | MParameterI par("DataType");
|
---|
138 | MParameterD weight("Weight");
|
---|
139 | plist.AddToList(&par);
|
---|
140 | plist.AddToList(&weight);
|
---|
141 |
|
---|
142 | // Setup Tasklist
|
---|
143 | MTaskList tlist;
|
---|
144 | plist.AddToList(&tlist);
|
---|
145 |
|
---|
146 | // La Palma Magic1
|
---|
147 | MObservatory obs;
|
---|
148 | plist.AddToList(&obs);
|
---|
149 |
|
---|
150 | // --------------------------------------------------------------------------------
|
---|
151 |
|
---|
152 | MParameterD scale;
|
---|
153 | scale.SetVal(1./fNumOffSourcePos);
|
---|
154 |
|
---|
155 | MHThetaSq *halphaoff = plist.FindCreateObj("MHThetaSq", "HistOff");
|
---|
156 | halphaoff->ForceUsingSize();
|
---|
157 |
|
---|
158 | MFillH falpha(halphaoff, "", "FillHist");
|
---|
159 | MFillH fenergy1("HistEOff [MHThetaSq]", "", "FillHistE");
|
---|
160 |
|
---|
161 | MFMagicCuts cuts;
|
---|
162 | cuts.SetHadronnessCut(MFMagicCuts::kNoCut);
|
---|
163 | cuts.SetVariables(param);
|
---|
164 |
|
---|
165 | // Cuts before thetasq
|
---|
166 | MContinue cont1(&cuts, "Cut1");
|
---|
167 |
|
---|
168 | // Energy estimation
|
---|
169 | MEnergyEstimate energyest;
|
---|
170 | energyest.SetRule("MHillas.fSize^0.815*pow(10, 0.0199*(MHillasSrc.fDist*1.17e-2 - (-6.95))^2*(MHillasSrc.fDist*1.17e-2>(-6.95)) + 0.5997 *(MHillasSrc.fDist*1.17e-2 - 0.7568)^2 * (MHillasSrc.fDist*1.17e-2>0.7568) )");
|
---|
171 | // energyest.SetRule("1737 * (MHillas.fSize / 300.)^0.810");
|
---|
172 |
|
---|
173 | // Cuts before writing
|
---|
174 | MContinue cont3("", "Cut3");
|
---|
175 | contq.SetAllowEmpty();
|
---|
176 | cont0.SetAllowEmpty();
|
---|
177 | cont1.SetAllowEmpty();
|
---|
178 | cont2.SetAllowEmpty();
|
---|
179 | cont3.SetAllowEmpty();
|
---|
180 |
|
---|
181 | cont1.SetInverted();
|
---|
182 |
|
---|
183 | // Filter for VsSize
|
---|
184 | MFDataPhrase ftheta("ThetaSquared.fVal < ThetaSquaredCut.fVal", "CutT");
|
---|
185 |
|
---|
186 | // ------------- Loop Off Data --------------------
|
---|
187 | MRead *readoffdata = NULL;
|
---|
188 | if (ismc)
|
---|
189 | {
|
---|
190 | MReadMarsFile *read = new MReadMarsFile("Events");
|
---|
191 | read->DisableAutoScheme();
|
---|
192 | readoffdata = read;
|
---|
193 | }
|
---|
194 | else
|
---|
195 | {
|
---|
196 | MReadReports *read = new MReadReports;
|
---|
197 | read->AddTree("Events", "MTime.", MReadReports::kMaster);
|
---|
198 | read->AddTree("Drive",MReadReports::kRequired);
|
---|
199 | read->AddTree("Rates",MReadReports::kRequired);
|
---|
200 | readoffdata = read;
|
---|
201 | }
|
---|
202 |
|
---|
203 | readoffdata->AddFiles(files);
|
---|
204 |
|
---|
205 | TString fname0 = Form("%s-summary.root", outfile);
|
---|
206 | TString fname1 = Form("%s-analysis.root", outfile);
|
---|
207 |
|
---|
208 | MWriteRootFile dummy0(fname0.Data(), "RECREATE");
|
---|
209 | MWriteRootFile dummy1(fname1.Data(), "RECREATE");
|
---|
210 |
|
---|
211 | MWriteRootFile *write0 = &dummy0;
|
---|
212 | MWriteRootFile *write1 = &dummy1;
|
---|
213 | SetupWriter(write0, "WriteAfterCut0", ismc);
|
---|
214 | SetupWriter(write1, "WriteAfterCut3", ismc);
|
---|
215 |
|
---|
216 | MWriteRootFile write2(fname1.Data(), "RECRATE");
|
---|
217 | write2.AddContainer("MReportRates", "Rates");
|
---|
218 | write2.AddContainer("MTimeRates", "Rates");
|
---|
219 |
|
---|
220 | MParameterCalc setevtnum("MRawEvtHeader.fDAQEvtNumber", "SetEvtNumber");
|
---|
221 | setevtnum.SetNameParameter("EvtNumber");
|
---|
222 |
|
---|
223 | MParameterCalc setrunnum("MRawRunHeader.GetFileID", "SetFileId");
|
---|
224 | setrunnum.SetNameParameter("FileId");
|
---|
225 |
|
---|
226 | MFillH fill1a("MHHillasOffPre [MHHillas]", "MHillas", "FillHillasPre");
|
---|
227 | MFillH fill2a("MHHillasOffPost [MHHillas]", "MHillas", "FillHillasPost");
|
---|
228 | MFillH fill3a("MHVsSizeOffPost [MHVsSize]", "MHillasSrc", "FillVsSizePost");
|
---|
229 | MFillH fill3c("MHVsSizeOffTheta [MHVsSize]", "MHillasSrc", "FillVsSizeTheta");
|
---|
230 | MFillH fill4a("MHHilExtOffPost [MHHillasExt]", "MHillasSrc", "FillHilExtPost");
|
---|
231 | MFillH fill5a("MHHilSrcOffPost [MHHillasSrc]", "MHillasSrc", "FillHilSrcPost");
|
---|
232 | MFillH fill6a("MHImgParOffPost [MHImagePar]", "MImagePar", "FillImgParPost");
|
---|
233 | MFillH fill7a("MHNewParOffPost [MHNewImagePar]", "MNewImagePar", "FillNewParPost");
|
---|
234 | //MFillH fill9a("MHEffOffTime [MHEffectiveOnTime]", "MTime", "FillEffOnTime");
|
---|
235 | fill1a.SetNameTab("PreCut");
|
---|
236 | fill2a.SetNameTab("PostCut");
|
---|
237 | fill3a.SetNameTab("VsSize");
|
---|
238 | fill3c.SetNameTab("CutT");
|
---|
239 | fill4a.SetNameTab("HilExt");
|
---|
240 | fill5a.SetNameTab("HilSrc");
|
---|
241 | fill6a.SetNameTab("ImgPar");
|
---|
242 | fill7a.SetNameTab("NewPar");
|
---|
243 | //fill9a.SetNameTab("EffOffT");
|
---|
244 |
|
---|
245 | fill3c.SetFilter(&ftheta);
|
---|
246 |
|
---|
247 | //MFDataMember fbin("Bin.fVal", '>', 0);
|
---|
248 | //fill9a.SetFilter(&fbin);
|
---|
249 |
|
---|
250 | MTaskList tlist2;
|
---|
251 | tlist2.SetNumPasses(fNumOffSourcePos);
|
---|
252 | fill2a.SetWeight(&scale);
|
---|
253 | fill3a.SetWeight(&scale);
|
---|
254 | fill3c.SetWeight(&scale);
|
---|
255 | fill4a.SetWeight(&scale);
|
---|
256 | fill5a.SetWeight(&scale);
|
---|
257 | fill6a.SetWeight(&scale);
|
---|
258 | fill7a.SetWeight(&scale);
|
---|
259 |
|
---|
260 | // How to get source position from off- and on-data?
|
---|
261 | MSrcPosCalc scalc;
|
---|
262 | scalc.SetMode(MSrcPosCalc::kWobble);
|
---|
263 | scalc.SetCallback(&tlist2);
|
---|
264 |
|
---|
265 | MSrcPosCorrect scor;
|
---|
266 |
|
---|
267 | MHillasCalc hcalc;
|
---|
268 | MHillasCalc hcalc2("MHillasCalcAnti");
|
---|
269 | hcalc.SetFlags(MHillasCalc::kCalcHillasSrc);
|
---|
270 | hcalc2.SetFlags(MHillasCalc::kCalcHillasSrc);
|
---|
271 | hcalc2.SetNameHillasSrc("MHillasSrcAnti");
|
---|
272 | hcalc2.SetNameSrcPosCam("MSrcPosAnti");
|
---|
273 |
|
---|
274 | MSrcPosRndm srcrndm;
|
---|
275 |
|
---|
276 | tlist2.AddToList(&scalc);
|
---|
277 | //tlist2.AddToList(&scor);
|
---|
278 | tlist2.AddToList(&srcrndm);
|
---|
279 | tlist2.AddToList(&hcalc);
|
---|
280 | tlist2.AddToList(&hcalc2);
|
---|
281 | tlist2.AddToList(&setrunnum);
|
---|
282 | tlist2.AddToList(&setevtnum);
|
---|
283 | tlist2.AddToList(&cuts);
|
---|
284 | tlist2.AddToList(&energyest);
|
---|
285 | tlist2.AddToList(write0);
|
---|
286 | tlist2.AddToList(&cont0); // Post/Pre shown cuts
|
---|
287 | tlist2.AddToList(&cont1); // Calculate ThetaSq
|
---|
288 | tlist2.AddToList(&fill2a);
|
---|
289 | tlist2.AddToList(&ftheta); // Calculate theta Cut
|
---|
290 | if (!ismc)
|
---|
291 | {
|
---|
292 | tlist2.AddToList(&falpha);
|
---|
293 | tlist2.AddToList(&fenergy1);
|
---|
294 | }
|
---|
295 | tlist2.AddToList(&fill3c); // With theta cut
|
---|
296 | tlist2.AddToList(&cont2);
|
---|
297 | tlist2.AddToList(&fill3a);
|
---|
298 | tlist2.AddToList(&fill4a);
|
---|
299 | tlist2.AddToList(&fill5a);
|
---|
300 | tlist2.AddToList(&fill6a);
|
---|
301 | tlist2.AddToList(&fill7a);
|
---|
302 | tlist2.AddToList(&cont3);
|
---|
303 | tlist2.AddToList(write1);
|
---|
304 |
|
---|
305 | MPointingPosCalc pcalc;
|
---|
306 | MPointingDevCalc devcalc;
|
---|
307 |
|
---|
308 | tlist.AddToList(readoffdata);
|
---|
309 | if (!ismc)
|
---|
310 | tlist.AddToList(&pcalc, "Drive");
|
---|
311 | tlist.AddToList(&contq, "Events");
|
---|
312 | tlist.AddToList(&fill1a, "Events");
|
---|
313 | tlist.AddToList(&tlist2, "Events");
|
---|
314 |
|
---|
315 | // by setting it here it is distributed to all consecutive tasks
|
---|
316 | tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
|
---|
317 |
|
---|
318 | par.SetVal(0);
|
---|
319 | weight.SetVal(-1./fNumOffSourcePos);
|
---|
320 |
|
---|
321 | MStatusDisplay *d = new MStatusDisplay;
|
---|
322 |
|
---|
323 | // Create and setup the eventloop
|
---|
324 | MEvtLoop evtloop("Off");
|
---|
325 | evtloop.SetParList(&plist);
|
---|
326 | evtloop.SetDisplay(d);
|
---|
327 |
|
---|
328 | // Execute first analysis
|
---|
329 | if (!evtloop.Eventloop())
|
---|
330 | return 2;
|
---|
331 |
|
---|
332 | if (!evtloop.GetDisplay())
|
---|
333 | return 2;
|
---|
334 |
|
---|
335 | // ------------- Loop On Data --------------------
|
---|
336 | MRead *readondata = NULL;
|
---|
337 | if (ismc)
|
---|
338 | {
|
---|
339 | MReadMarsFile *read = new MReadMarsFile("Events");
|
---|
340 | read->DisableAutoScheme();
|
---|
341 | readondata = read;
|
---|
342 | }
|
---|
343 | else
|
---|
344 | {
|
---|
345 | MReadReports *read = new MReadReports;
|
---|
346 | read->AddTree("Events", "MTime.", MReadReports::kMaster);
|
---|
347 | read->AddTree("Drive", MReadReports::kRequired);
|
---|
348 | read->AddTree("Rates", MReadReports::kRequired);
|
---|
349 | read->AddTree("Humidity", MReadReports::kRequired);
|
---|
350 | read->AddTree("Temperatures", MReadReports::kRequired);
|
---|
351 | readondata = read;
|
---|
352 | }
|
---|
353 | readondata->AddFiles(files);
|
---|
354 |
|
---|
355 | scalc.SetMode(MSrcPosCalc::kDefault);
|
---|
356 | scalc.SetNumRandomOffPositions(fNumOffSourcePos);
|
---|
357 |
|
---|
358 | MFillH fill1b("MHHillasOnPre [MHHillas]", "MHillas", "FillHillasPre");
|
---|
359 | MFillH fill2b("MHHillasOnPost [MHHillas]", "MHillas", "FillHillasPost");
|
---|
360 | MFillH fill3b("MHVsSizeOnPost [MHVsSize]", "MHillasSrc", "FillVsSizePost");
|
---|
361 | MFillH fill3d("MHVsSizeOnTheta [MHVsSize]", "MHillasSrc", "FillVsSizeTheta");
|
---|
362 | MFillH fill4b("MHHilExtOnPost [MHHillasExt]", "MHillasSrc", "FillHilExtPost");
|
---|
363 | MFillH fill5b("MHHilSrcOnPost [MHHillasSrc]", "MHillasSrc", "FillHilSrcPost");
|
---|
364 | MFillH fill6b("MHImgParOnPost [MHImagePar]", "MImagePar", "FillImgParPost");
|
---|
365 | MFillH fill7b("MHNewParOnPost [MHNewImagePar]", "MNewImagePar", "FillNewParPost");
|
---|
366 | //MFillH fill9b("MHEffOnTime [MHEffectiveOnTime]", "MTime", "FillEffOnTime");
|
---|
367 | fill1b.SetNameTab("PreCut");
|
---|
368 | fill2b.SetNameTab("PostCut");
|
---|
369 | fill3b.SetNameTab("VsSize");
|
---|
370 | fill3d.SetNameTab("CutT");
|
---|
371 | fill4b.SetNameTab("HilExt");
|
---|
372 | fill5b.SetNameTab("HilSrc");
|
---|
373 | fill6b.SetNameTab("ImgPar");
|
---|
374 | fill7b.SetNameTab("NewPar");
|
---|
375 | //fill9b.SetNameTab("EffOnT");
|
---|
376 | fill1b.SetDrawOption("same");
|
---|
377 | fill2b.SetDrawOption("same");
|
---|
378 | fill3b.SetDrawOption("same");
|
---|
379 | fill3d.SetDrawOption("same");
|
---|
380 | fill4b.SetDrawOption("same");
|
---|
381 | fill5b.SetDrawOption("same");
|
---|
382 | fill6b.SetDrawOption("same");
|
---|
383 | fill7b.SetDrawOption("same");
|
---|
384 | //fill9b.SetFilter(&fbin);
|
---|
385 |
|
---|
386 | fill3d.SetFilter(&ftheta);
|
---|
387 |
|
---|
388 | MHThetaSq *halphaon = plist.FindCreateObj("MHThetaSq", "Hist");
|
---|
389 | halphaon->ForceUsingSize();
|
---|
390 |
|
---|
391 | MFillH falpha2(halphaon, "", "FillHist");
|
---|
392 | MFillH fenergy2("HistE [MHThetaSq]", "", "FillHistE");
|
---|
393 |
|
---|
394 | tlist2.SetNumPasses();
|
---|
395 |
|
---|
396 | tlist.Replace(readondata);
|
---|
397 |
|
---|
398 | MHSrcPosCam hsrcpos(kTRUE);
|
---|
399 |
|
---|
400 | MFillH fillsrc(&hsrcpos, "MSrcPosCam", "FillSrcPosCam");
|
---|
401 | fillsrc.SetNameTab("SrcPos");
|
---|
402 |
|
---|
403 | tlist2.AddToListBefore(&fillsrc, &hcalc);
|
---|
404 |
|
---|
405 | MH3 hvs1("MPointingPos.fZd");
|
---|
406 | MH3 hvs2("MPointingPos.fZd");
|
---|
407 | MHVsTime hvstM("MTimeDrive.GetMjd");
|
---|
408 | MHVsTime hvst0("MPointingPos.fZd");
|
---|
409 | MHVsTime hvst1("MReportRates.fTriggerRate");
|
---|
410 | MH3 hvst2("MPointingPos.fZd", "MReportRates.fTriggerRate");
|
---|
411 | MHVsTime hvst("MReportTemperatures.GetTempMean");
|
---|
412 | MHVsTime hvsh("MReportHumidity.GetMean");
|
---|
413 | hvs1.SetName("ObsTime;Theta");
|
---|
414 | hvs2.SetName("OnTime;Theta");
|
---|
415 | hvstM.SetName("MJD");
|
---|
416 | hvst0.SetName("ZdTime");
|
---|
417 | hvst1.SetName("Rate");
|
---|
418 | hvst2.SetName("RateZd;Theta;Rate");
|
---|
419 | hvst.SetName("CamTemp");
|
---|
420 | hvsh.SetName("CamHum");
|
---|
421 | hvs1.SetTitle("Observation time vs. Zenith Angle;\\Theta [\\circ];T_{on} [s]");
|
---|
422 | hvs2.SetTitle("On-Time vs. Zenith Angle;\\Theta [\\circ];T_{on} [s]");
|
---|
423 | hvstM.SetTitle("MJD vs time;Time;MJD");
|
---|
424 | hvst0.SetTitle("Zenith distance vs time;Time;Zd [\\circ]");
|
---|
425 | hvst1.SetTitle("Camera trigger rate vs time;Time;Rate [Hz]");
|
---|
426 | hvst2.SetTitle("Camera trigger rate vs Zd; Zd [\\circ];Rate [Hz]");
|
---|
427 | hvst.SetTitle("Average sensor compartment temperature;Time;T [\\circ C]");
|
---|
428 | hvsh.SetTitle("Average camera humidity;Time;Hum [%]");
|
---|
429 |
|
---|
430 | MFillH fillvs1(&hvs1, "", "FillObsTime");
|
---|
431 | MFillH fillvs2(&hvs2, "", "FillOnTime");
|
---|
432 | MFillH fillvstM(&hvstM, "MTime", "FillMjdVsTime");
|
---|
433 | MFillH fillvst0(&hvst0, "MTimeDrive", "FillZdVsTime");
|
---|
434 | MFillH fillvst1(&hvst1, "MTimeRates", "FillRate");
|
---|
435 | MFillH fillvst2(&hvst2, "", "FillRateVsZd");
|
---|
436 | MFillH fillvst(&hvst, "MTimeTemperatures", "FillCamTemp");
|
---|
437 | MFillH fillvsh(&hvsh, "MTimeHumidity", "FillCamHum");
|
---|
438 | fillvs1.SetNameTab("ObsTime");
|
---|
439 | fillvs2.SetNameTab("OnTime");
|
---|
440 | fillvst1.SetNameTab("Rate");
|
---|
441 | fillvst2.SetNameTab("RateZd");
|
---|
442 | fillvst.SetNameTab("CamTemp");
|
---|
443 | fillvsh.SetNameTab("CamHum");
|
---|
444 |
|
---|
445 | hvs1.SetWeight("MReportRates.fElapsedTime");
|
---|
446 | hvs2.SetWeight("MReportRates.fElapsedOnTime");
|
---|
447 |
|
---|
448 | hvst1.SetMinimum(0);
|
---|
449 | hvst2.SetDrawOption("colz");
|
---|
450 |
|
---|
451 | MH3 hrate("MRawRunHeader.GetFileID"/*, "MRawEvtHeader.GetTriggerID"*/);
|
---|
452 | hrate.SetWeight("1./TMath::Max(MRawRunHeader.GetRunLength,1)");
|
---|
453 | hrate.SetName("RateVsRun");
|
---|
454 | hrate.SetTitle("Event rate after quality cuts;File Id;Event Rate [Hz];");
|
---|
455 | hrate.InitLabels(MH3::kLabelsX);
|
---|
456 | hrate.GetHist().SetMinimum(0);
|
---|
457 |
|
---|
458 | MFillH fillr(&hrate, "", "FillRateVsRun");
|
---|
459 | tlist.AddToListAfter(&fillr, &contq, "Events");
|
---|
460 |
|
---|
461 | tlist.Replace(&fill1b);
|
---|
462 |
|
---|
463 | tlist2.Replace(&fill2b);
|
---|
464 | tlist2.Replace(&fill3b);
|
---|
465 | tlist2.Replace(&fill3d);
|
---|
466 | tlist2.Replace(&fill4b);
|
---|
467 | tlist2.Replace(&fill5b);
|
---|
468 | tlist2.Replace(&fill6b);
|
---|
469 | tlist2.Replace(&fill7b);
|
---|
470 | tlist2.Replace(&falpha2);
|
---|
471 | tlist2.Replace(&fenergy2);
|
---|
472 | if (!ismc)
|
---|
473 | {
|
---|
474 | tlist.AddToList(&fillvs1, "Rates");
|
---|
475 | tlist.AddToList(&fillvs2, "Rates");
|
---|
476 | tlist.AddToList(&fillvst1, "Rates");
|
---|
477 | tlist.AddToList(&fillvst2, "Rates");
|
---|
478 | tlist.AddToList(&write2, "Rates");
|
---|
479 | tlist.AddToList(&fillvst, "Temperatures");
|
---|
480 | tlist.AddToList(&fillvsh, "Humidity");
|
---|
481 | tlist.AddToList(&fillvst0, "Drive");
|
---|
482 | tlist.AddToList(&fillvstM, "Drive");
|
---|
483 | }
|
---|
484 |
|
---|
485 | // by setting it here it is distributed to all consecutive tasks
|
---|
486 | tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
|
---|
487 |
|
---|
488 | par.SetVal(1);
|
---|
489 | weight.SetVal(1);
|
---|
490 |
|
---|
491 | // Execute first analysis
|
---|
492 | if (!evtloop.Eventloop())
|
---|
493 | return 2;
|
---|
494 |
|
---|
495 | if (!evtloop.GetDisplay())
|
---|
496 | return 2;
|
---|
497 |
|
---|
498 | delete readondata;
|
---|
499 | delete readoffdata;
|
---|
500 |
|
---|
501 | TObjArray cont;
|
---|
502 | //cont.Add(const_cast<TEnv*>(GetEnv()));
|
---|
503 | //cont.Add(const_cast<MSequence*>(&fSequence));
|
---|
504 |
|
---|
505 | //TNamed cmdline("CommandLine", fCommandLine.Data());
|
---|
506 | //cont.Add(&cmdline);
|
---|
507 |
|
---|
508 | if (d)
|
---|
509 | {
|
---|
510 | TString title = "-- Analysis #";
|
---|
511 | title += dataset;
|
---|
512 | title += " --";
|
---|
513 | d->SetTitle(title, kFALSE);
|
---|
514 |
|
---|
515 | cont.Add(d);
|
---|
516 | TString path;
|
---|
517 | path += fname1;
|
---|
518 |
|
---|
519 | d->Write();
|
---|
520 | }
|
---|
521 |
|
---|
522 | // if (!WriteContainer(cont, fname1, "RECREATE"))
|
---|
523 | // return;
|
---|
524 |
|
---|
525 | return 0;
|
---|
526 | }
|
---|