source: trunk/Mars/fact/analysis/mc/callisto.C@ 17370

Last change on this file since 17370 was 17309, checked in by ftemme, 11 years ago
Changed the name of the mc_callisto macro and commented the inclusion of MLogManip.h out. The inclusion causes an error while compiling
File size: 21.2 KB
Line 
1using namespace std;
2
3#include <sstream>
4#include <iostream>
5
6#include "TH1F.h"
7#include "TFile.h"
8#include "TStyle.h"
9#include "TGraph.h"
10#include "TLine.h"
11
12#include "MDrsCalibration.h"
13//#include "MLogManip.h"
14#include "MExtralgoSpline.h"
15#include "MSequence.h"
16#include "MStatusArray.h"
17#include "MHCamera.h"
18#include "MJob.h"
19#include "MWriteRootFile.h"
20#include "MHCamera.h"
21#include "MBadPixelsCam.h"
22#include "MBadPixelsPix.h"
23#include "MDirIter.h"
24#include "MTaskList.h"
25#include "MFDataPhrase.h"
26#include "MArrayF.h"
27#include "MBadPixelsTreat.h"
28#include "MCalibrateDrsTimes.h"
29#include "MHSectorVsTime.h"
30#include "MHCamEvent.h"
31#include "MExtractTimeAndChargeSpline.h"
32#include "MFillH.h"
33#include "MDrsCalibApply.h"
34#include "MGeomApply.h"
35#include "MContinue.h"
36#include "MRawFitsRead.h"
37#include "MEvtLoop.h"
38#include "MParList.h"
39#include "MStatusDisplay.h"
40#include "MDrsCalibrationTime.h"
41#include "MH3.h"
42#include "MGeomCamFACT.h"
43#include "MCalibrateFact.h"
44#include "MParameters.h"
45#include "MWriteAsciiFile.h"
46
47/* Maybe you wanna use this macro like this:
48 *
49 * 0.) ---- call root ----
50 * root -b
51 *
52 * 1.) ---- compile the stuff ----
53 * .L fact/analysis/callisto_buildable_no_sequence_file.C++
54 * <read a lot of warnings>
55 *
56 * 2.) ---- you can call it then ----
57 * Therefore you need to specify all the paths ... see below.
58 *
59 * When you wanna call the stuff directly from the bash make sure to
60 * escape the bracets and quotes correctly.
61 *
62 * your can do:
63 * root -b -q callisto_buildable_no_sequence_file.C++'("path1","path2",...)'
64 * or:
65 * root -b -q callisto_buildable_no_sequence_file.C++(\"path1\",\"$HOME\",...)
66 * using bash enviroment variables like $HOME is not possible in the upper variant.
67 */
68
69//using namespace std;
70
71int callisto(
72 const char *drs_calib_300_path="/fhgfs/groups/app/fact/mc_test/testingdrsfile/test300samples.drs.fits",
73 const char *pedestal_file_path="/fhgfs/groups/app/fact/mc_test/ceresfitstest/mcFilesForTests/mcNsbPedestal/00000001.001_P_MonteCarlo000_Events.fits",
74 const char *data_file_path="/fhgfs/groups/app/fact/mc_test/ceresfitstest/mcFilesForTests/mcProton/00000003.387_D_MonteCarlo010_Events.fits",
75
76 const char *root_file_output_path = "/fhgfs/groups/app/callisto_star_test/callisto_for_mc_test_output/callisto.root",
77 const char *status_display_output_path = "/fhgfs/groups/app/callisto_star_test/callisto_for_mc_test_output/callisto_status_display.root",
78 const char *status_display_title = "callisto_status_display")
79{
80
81 // ======================================================
82
83 // true: Display correctly mapped pixels in the camera displays
84 // but the value-vs-index plot is in software/spiral indices
85 // false: Display pixels in hardware/linear indices,
86 // but the order is the camera display is distorted
87 bool usemap = true;
88
89 // map file to use (get that from La Palma!)
90 const char *map = usemap ? "/fhgfs/groups/app/fact/resources/monte_carlo_FACTmap.txt" : NULL;
91
92 Bool_t maximum = kTRUE;
93
94 const char *lp_template = maximum ?
95 "/cm/shared/apps/fact/Mars_svn_LP/template-lp-extractor-maximum.root" :
96 "/cm/shared/apps/fact/Mars_svn_LP/template-lp-extractor-leading-edge.root";
97
98 const char *pulse_template = "/cm/shared/apps/fact/Mars_svn_LP/template-pulse.root";
99
100 // ------------------------------------------------------
101
102 // Calib: 51 / 90 / 197 (20% TH)
103 // Data: 52 / 64 / 104 (20% TH)
104
105 // Extraction range in slices. It will always(!) contain the full range
106 // of integration
107 const int first_slice = 20; // 10ns
108 const int last_slice = 250; // 125ns
109
110 // Note that rise and fall time mean different things whether you use IntegralFixed or IntegraRel:
111 //
112 // IntegralFixed:
113 // * fRiseTime: Number of slices left from arrival time
114 // * fFallTime: Number of slices right from arrival time
115 // IntegralRel:
116 // * fRiseTime: Number of slices left from maximum time
117 // * fFallTime: Number of slices right from maximum time
118 //
119 const int rise_time_cal = maximum ? 40 : 10; // was 13; 5ns
120 const int fall_time_cal = maximum ? 120 : 160; // was 23; 80ns
121
122 const int rise_time_dat = maximum ? 10 : 2; // was 13; was 10; 1ns
123 const int fall_time_dat = maximum ? 40 : 48; // was 23; was 40; 24ns
124
125 // Extraction type: Extract integral and half leading edge
126
127 const MExtralgoSpline::ExtractionType_t type = maximum ? (MExtralgoSpline::kIntegralRel) : (MExtralgoSpline::kIntegralFixed);
128 //const int type = MExtralgoSpline::kIntegralFixed;
129
130
131 const double heighttm = 0.5; // IntegralAbs { 1.5pe * 9.6mV/pe } / IntegralRel { 0.5 }
132
133 Long_t max = 0; // All
134 Long_t max3 = max; // Pedestal Rndm
135 Long_t max4 = max; // Pedestal Ext
136
137 // ======================================================
138
139 if (map && gSystem->AccessPathName(map, kFileExists))
140 {
141 gLog << err << "ERROR - Cannot access mapping file '" << map << "'" << endl;
142 return 1;
143 }
144
145 TString datfile = TString(data_file_path);
146 TString drsfile = TString(drs_calib_300_path);
147 TString pedfile = TString(pedestal_file_path);
148
149 gLog.Separator("Callisto");
150 gLog << all;
151 gLog << "Data File : " << datfile << "\n";
152 gLog << "DRS calib 300: " << drsfile << '\n';
153
154 MDrsCalibration drscalib300;
155 if (!drscalib300.ReadFits(drsfile.Data())) {
156 gLog << err << "ERROR - Cannot access drscallib300 file '" << drsfile << "'" << endl;
157 return 5;
158 }
159 gLog << all;
160 gLog << "Pedestal file: " << pedfile << '\n';
161
162 gLog << "root_file_output_path: " << root_file_output_path << endl;
163 gLog << "status_display_output_path: " << status_display_output_path << endl;
164 gLog << "status_display_title: " << status_display_title << endl;
165
166 // ------------------------------------------------------
167 MStatusArray arrt, arrp;
168
169 TFile ft(lp_template);
170 if (arrt.Read()<=0)
171 {
172 gLog << err << "ERROR - Reading LP template from " << lp_template << endl;
173 return 100;
174 }
175
176 MHCamera *lpref = (MHCamera*)arrt.FindObjectInCanvas("ExtCalSig;avg", "MHCamera", "Cam");
177 if (!lpref)
178 {
179 gLog << err << "ERROR - LP Template not found in " << lp_template << endl;
180 return 101;
181 }
182 lpref->SetDirectory(0);
183
184 MHCamera *gain = (MHCamera*)arrt.FindObjectInCanvas("gain", "MHCamera", "Gain");
185 if (!gain)
186 {
187 gLog << err << "ERROR - Gain not found in " << lp_template << endl;
188 return 101;
189 }
190 gain->SetDirectory(0);
191
192 TFile fp(pulse_template);
193 if (arrp.Read()<=0)
194 {
195 gLog << err << "ERROR - Reading Pulse template from " << pulse_template << endl;
196 return 102;
197 }
198
199 TH1F *hpulse = (TH1F*)arrp.FindObjectInCanvas("hPixelEdgeMean0_0", "TH1F", "cgpPixelPulses0");
200 if (!hpulse)
201 {
202 gLog << err << "ERROR - Pulse Template not found in " << pulse_template << endl;
203 return 103;
204 }
205 hpulse->SetDirectory(0);
206 // ======================================================
207
208 MStatusDisplay *d = new MStatusDisplay;
209
210 MBadPixelsCam badpixels;
211 badpixels.InitSize(1440);
212 /*
213 badpixels[ 424].SetUnsuitable(MBadPixelsPix::kUnsuitable);
214 badpixels[ 583].SetUnsuitable(MBadPixelsPix::kUnsuitable);
215 badpixels[ 830].SetUnsuitable(MBadPixelsPix::kUnsuitable);
216 badpixels[ 923].SetUnsuitable(MBadPixelsPix::kUnsuitable);
217 badpixels[1208].SetUnsuitable(MBadPixelsPix::kUnsuitable);
218 badpixels[1399].SetUnsuitable(MBadPixelsPix::kUnsuitable);
219 */
220 // Twin pixel
221 // 113
222 // 115
223 // 354
224 // 423
225 // 1195
226 // 1393
227
228 MDrsCalibrationTime timecam;
229
230 // Plot the trigger pattern rates vs. run-number
231 MH3 hrate("MRawRunHeader.GetFileID", "MRawEvtHeader.GetTriggerID&0xff00");
232 hrate.SetWeight("1./TMath::Max(MRawRunHeader.GetRunLength,1)");
233 hrate.SetName("Rate");
234 hrate.SetTitle("Event rate [Hz];File Id;Trigger Type;");
235 hrate.InitLabels(MH3::kLabelsXY);
236 hrate.DefineLabelY( 0, "Data"); // What if TriggerID==0 already???
237 hrate.DefineLabelY(0x100, "Cal");
238 hrate.DefineLabelY(0x400, "Ped");
239 // hrate.DefaultLabelY("ERROR");
240 gStyle->SetOptFit(kTRUE);
241
242
243 // ========================= Result ==================================
244
245 //~ Double_t avgS = evt1f.GetHist()->GetMean();
246 //~ Double_t medS = evt1f.GetHist()->GetMedian();
247 //~ Double_t rmsS = evt1f.GetHist()->GetRMS();
248 //~ Double_t maxS = evt1f.GetHist()->GetMaximum();
249
250 MArrayF der1(hpulse->GetNbinsX());
251 MArrayF der2(hpulse->GetNbinsX());
252
253 MExtralgoSpline spline(hpulse->GetArray()+1, hpulse->GetNbinsX(),
254 der1.GetArray(), der2.GetArray());
255 spline.SetRiseFallTime(rise_time_dat, fall_time_dat);
256 spline.SetExtractionType(type);
257 spline.SetHeightTm(heighttm);
258
259 spline.Extract(hpulse->GetMaximumBin()-1);
260
261 // The pulser signal is most probably around 400mV/9.5mV
262 // IntegraFixed 2/48 corresponds to roughly 215mV*50slices
263 Double_t scale = 1./spline.GetSignal();
264
265 MArrayD calib(1440);
266 for (int i=0; i<1440; i++)
267 calib[i] =1.;
268
269 gROOT->SetSelectedPad(0);
270 d->AddTab("PulseTemp");
271 gPad->SetGrid();
272 hpulse->SetNameTitle("Pulse", "Single p.e. pulse template");
273 hpulse->SetDirectory(0);
274 hpulse->SetLineColor(kBlack);
275 hpulse->DrawCopy();
276
277 TAxis *ax = hpulse->GetXaxis();
278
279 Double_t w = hpulse->GetBinWidth(1);
280 Double_t T = w*(spline.GetTime()+0.5) +ax->GetXmin();
281 //~ Double_t H = w*(hpulse->GetMaximumBin()+0.5)+ax->GetXmin();
282
283 TLine line;
284 line.SetLineColor(kRed);
285 line.DrawLine(T-rise_time_dat*w, spline.GetHeight(),
286 T+fall_time_dat*w, spline.GetHeight());
287 line.DrawLine(T, spline.GetHeight()/4, T, 3*spline.GetHeight()/4);
288 line.DrawLine(T-rise_time_dat*w, 0,
289 T-rise_time_dat*w, spline.GetHeight());
290 line.DrawLine(T+fall_time_dat*w, 0,
291 T+fall_time_dat*w, spline.GetHeight());
292
293 TGraph gg;
294 for (int ix=1; ix<=hpulse->GetNbinsX(); ix++)
295 for (int i=0; i<10; i++)
296 {
297 Double_t x = hpulse->GetBinLowEdge(ix)+i*hpulse->GetBinWidth(ix)/10.;
298 gg.SetPoint(gg.GetN(), x+w/2, spline.EvalAt(ix-1+i/10.));
299 }
300
301 gg.SetLineColor(kBlue);
302 gg.SetMarkerColor(kBlue);
303 gg.SetMarkerStyle(kFullDotMedium);
304 gg.DrawClone("L");
305
306 gROOT->SetSelectedPad(0);
307 d->AddTab("CalConst");
308 MGeomCamFACT fact;
309 MHCamera hcalco(fact);
310 hcalco.SetName("CalConst");
311 hcalco.SetTitle(Form("Relative calibration constant [%.0f/pe]", 1./scale));
312 hcalco.SetCamContent(calib);
313 hcalco.SetAllUsed();
314 //hcalco.Scale(scale);
315 hcalco.DrawCopy();
316
317 // ======================================================
318
319 gLog << endl;
320 gLog.Separator("Extracting random pedestal");
321
322 MTaskList tlist3;
323
324 MParList plist3;
325 plist3.AddToList(&tlist3);
326 plist3.AddToList(&drscalib300);
327 plist3.AddToList(&badpixels);
328 plist3.AddToList(&timecam);
329
330 MEvtLoop loop3("DetermineRndmPed");
331 loop3.SetDisplay(d);
332 loop3.SetParList(&plist3);
333
334 // ------------------ Setup the tasks ---------------
335
336 MRawFitsRead read3;
337 read3.LoadMap(map);
338 read3.AddFile(pedfile);
339
340 MFillH fill3a(&hrate);
341
342 MContinue cont3("(MRawEvtHeader.GetTriggerID&0xff00)!=0x400", "SelectPed");
343
344 MGeomApply apply3;
345
346 MDrsCalibApply drsapply3;
347
348 //---
349
350 MExtractTimeAndChargeSpline extractor3;
351 extractor3.SetRange(first_slice, last_slice);
352 extractor3.SetRiseTimeHiGain(rise_time_dat);
353 extractor3.SetFallTimeHiGain(fall_time_dat);
354 extractor3.SetHeightTm(heighttm);
355 extractor3.SetChargeType(type);
356 extractor3.SetSaturationLimit(600000);
357 extractor3.SetNoiseCalculation(kTRUE);
358
359// MHCamEvent evt2a(0, "PedRdm", "Extracted Pedestal Signal;;S");
360
361// MFillH fill2a(&evt2a, "MExtractedSignalCam", "FillPedRndm");
362
363 // Use this for data, but not for calibration events
364// evt2a.SetErrorSpread(kFALSE);
365
366 /*
367 MCalibrateData conv3;
368 conv3.SetCalibrationMode(MCalibrateData::kNone);
369 conv3.SetPedestalFlag(MCalibrateData::kNo);
370 conv3.SetCalibConvMinLimit(0);
371 conv3.SetCalibConvMaxLimit(10000);
372 conv3.SetScaleFactor(scale);
373 */
374
375 MCalibrateFact conv3;
376 conv3.SetScale(scale);
377 conv3.SetCalibConst(calib);
378
379 MBadPixelsTreat treat3;
380 treat3.SetProcessPedestalRun(kFALSE);
381 treat3.SetProcessPedestalEvt(kFALSE);
382 treat3.SetProcessTimes(kFALSE);
383
384 MHCamEvent evt3b(0, "PedRdm","Interpolated random pedestal;;Signal [~phe]");
385 //evt2b.SetErrorSpread(kFALSE);
386
387 MFillH fill3b(&evt3b, "MSignalCam", "FillPedRdm");
388 fill3b.SetDrawOption("gaus");
389
390 // ------------------ Setup eventloop and run analysis ---------------
391
392 tlist3.AddToList(&read3);
393 tlist3.AddToList(&apply3);
394 tlist3.AddToList(&drsapply3);
395 tlist3.AddToList(&cont3);
396 tlist3.AddToList(&extractor3);
397// tlist3.AddToList(&fill3a);
398 tlist3.AddToList(&conv3);
399 tlist3.AddToList(&treat3);
400 tlist3.AddToList(&fill3b);
401
402 if (!loop3.Eventloop(max3))
403 return 14;
404
405 if (!loop3.GetDisplay())
406 return 15;
407
408 // ======================================================
409
410 gLog << endl;
411 gLog.Separator("Extracting pedestal");
412
413 MTaskList tlist4;
414
415 MParList plist4;
416 plist4.AddToList(&tlist4);
417 plist4.AddToList(&drscalib300);
418 plist4.AddToList(&badpixels);
419 plist4.AddToList(&timecam);
420
421 MEvtLoop loop4("DetermineExtractedPed");
422 loop4.SetDisplay(d);
423 loop4.SetParList(&plist4);
424
425 // ------------------ Setup the tasks ---------------
426
427 MRawFitsRead read4;
428 read4.LoadMap(map);
429 read4.AddFile(pedfile);
430
431 MContinue cont4("(MRawEvtHeader.GetTriggerID&0xff00)!=0x400", "SelectPed");
432
433 MGeomApply apply4;
434
435 MDrsCalibApply drsapply4;
436
437 MExtractTimeAndChargeSpline extractor4;
438 extractor4.SetRange(first_slice, last_slice);
439 extractor4.SetRiseTimeHiGain(rise_time_dat);
440 extractor4.SetFallTimeHiGain(fall_time_dat);
441 extractor4.SetHeightTm(heighttm);
442 extractor4.SetChargeType(type);
443 extractor4.SetSaturationLimit(600000);
444 extractor4.SetNoiseCalculation(kFALSE);
445
446 // MHCamEvent evt3a(0, "PedExt", "Extracted Pedestal Signal;;S");
447
448 // MFillH fill3a(&evt3a, "MExtractedSignalCam", "FillPedExt");
449
450 // Use this for data, but not for calibration events
451// evt3a.SetErrorSpread(kFALSE);
452/*
453 MCalibrateData conv4;
454 conv4.SetCalibrationMode(MCalibrateData::kNone);
455 conv4.SetPedestalFlag(MCalibrateData::kNo);
456 conv4.SetCalibConvMinLimit(0);
457 conv4.SetCalibConvMaxLimit(10000);
458 conv4.SetScaleFactor(scale);
459*/
460 MCalibrateFact conv4;
461 conv4.SetScale(scale);
462 conv4.SetCalibConst(calib);
463
464 MBadPixelsTreat treat4;
465 treat4.SetProcessPedestalRun(kFALSE);
466 treat4.SetProcessPedestalEvt(kFALSE);
467
468 MHCamEvent evt4b(0, "PedExt","Interpolated extracted pedestal;;Signal [~phe]");
469 //evt4b.SetErrorSpread(kFALSE);
470
471 MFillH fill4b(&evt4b, "MSignalCam", "FillPedExt");
472 fill4b.SetDrawOption("gaus");
473
474 // ------------------ Setup eventloop and run analysis ---------------
475
476 tlist4.AddToList(&read4);
477 tlist4.AddToList(&apply4);
478 tlist4.AddToList(&drsapply4);
479 tlist4.AddToList(&cont4);
480 tlist4.AddToList(&extractor4);
481// tlist4.AddToList(&fill4a);
482 tlist4.AddToList(&conv4);
483 tlist4.AddToList(&treat4);
484 tlist4.AddToList(&fill4b);
485
486 if (!loop4.Eventloop(max4))
487 return 15;
488
489 if (!loop4.GetDisplay())
490 return 16;
491
492 // ===================================================================
493
494 gLog << endl;
495 gLog.Separator("Extracting and calibration data");
496
497 MTaskList tlist5;
498
499 MParList plist5;
500 plist5.AddToList(&tlist5);
501 plist5.AddToList(&drscalib300);
502 plist5.AddToList(&badpixels);
503 plist5.AddToList(&timecam);
504
505 MEvtLoop loop5("CalibratingData");
506 loop5.SetDisplay(d);
507 loop5.SetParList(&plist5);
508
509 // ------------------ Setup the tasks ---------------
510
511 MRawFitsRead read5;
512 read5.LoadMap(map);
513 read5.AddFile(datfile);
514
515 MFillH fill5a(&hrate);
516
517 MGeomApply apply5;
518
519 MDrsCalibApply drsapply5;
520
521 MFDataPhrase filterdat("(MRawEvtHeader.GetTriggerID&0xff00)==0", "SelectDat");
522 MFDataPhrase filtercal("(MRawEvtHeader.GetTriggerID&0xff00)==0x100", "SelectCal");
523 MFDataPhrase filterped("(MRawEvtHeader.GetTriggerID&0xff00)==0x400", "SelectPed");
524 MFDataPhrase filterncl("(MRawEvtHeader.GetTriggerID&0xff00)!=0x100", "SelectNonCal");
525
526 //MContinue cont4("MRawEvtHeader.GetTriggerID!=4", "SelectData");
527
528 // ---
529
530 MExtractTimeAndChargeSpline extractor5dat;
531 extractor5dat.SetRange(first_slice, last_slice);
532 extractor5dat.SetRiseTimeHiGain(rise_time_dat);
533 extractor5dat.SetFallTimeHiGain(fall_time_dat);
534 extractor5dat.SetHeightTm(heighttm);
535 extractor5dat.SetChargeType(type);
536 extractor5dat.SetSaturationLimit(600000);
537 extractor5dat.SetNoiseCalculation(kFALSE);
538
539 MExtractTimeAndChargeSpline extractor5cal;
540 extractor5cal.SetRange(first_slice, last_slice);
541 extractor5cal.SetRiseTimeHiGain(rise_time_cal);
542 extractor5cal.SetFallTimeHiGain(fall_time_cal);
543 extractor5cal.SetHeightTm(heighttm);
544 extractor5cal.SetChargeType(type);
545 extractor5cal.SetSaturationLimit(600000);
546 extractor5cal.SetNoiseCalculation(kFALSE);
547
548 MExtractTimeAndChargeSpline extractor5tm("ExtractTM");
549 extractor5tm.SetRange(last_slice, 294);
550 extractor5tm.SetRiseTimeHiGain(1);
551 extractor5tm.SetFallTimeHiGain(1);
552 extractor5tm.SetHeightTm(0.5);
553 extractor5tm.SetChargeType(MExtralgoSpline::kAmplitudeRel);
554 extractor5tm.SetSaturationLimit(600000);
555 extractor5tm.SetNoiseCalculation(kFALSE);
556 extractor5tm.SetNameSignalCam("TimeMarkerAmplitude");
557 extractor5tm.SetNameTimeCam("TimeMarkerTime");
558
559 extractor5dat.SetFilter(&filterncl);
560 extractor5cal.SetFilter(&filtercal);
561 //extractor4tm.SetFilter(&filtercal);
562
563 // ---
564/*
565 MCalibrateData conv5;
566 conv5.SetCalibrationMode(MCalibrateData::kNone);
567 conv5.SetPedestalFlag(MCalibrateData::kNo);
568 conv5.SetCalibConvMinLimit(0);
569 conv5.SetCalibConvMaxLimit(10000);
570 conv5.SetScaleFactor(scale);
571*/
572 MCalibrateFact conv5;
573 conv5.SetScale(scale);
574 conv5.SetCalibConst(calib);
575
576 MCalibrateDrsTimes calctm5;
577 calctm5.SetNameUncalibrated("UncalibratedTimes");
578
579 MCalibrateDrsTimes calctm5tm("CalibrateTimeMarker");
580 calctm5tm.SetNameArrivalTime("TimeMarkerTime");
581 calctm5tm.SetNameUncalibrated("UncalTimeMarker");
582 calctm5tm.SetNameCalibrated("TimeMarker");
583 calctm5tm.SetTimeMarker();
584 //calctm4tm.SetFilter(&filtercal);
585
586 MBadPixelsTreat treat5;
587 treat5.SetProcessPedestalRun(kFALSE);
588 treat5.SetProcessPedestalEvt(kFALSE);
589
590 MHCamEvent evt5b(0, "ExtSig", "Extracted signal;;S [mV·sl]");
591 MHCamEvent evt5c(0, "CalSig", "Calibrated and interpolated signal;;S [~phe]");
592 MHCamEvent evt5d(4, "ExtSigTm", "Extracted time;;T [sl]");
593 MHCamEvent evt5e(6, "CalSigTm", "Calibrated and interpolated time;;T [ns]");
594
595 MFillH fill5b(&evt5b, "MExtractedSignalCam", "FillExtSig");
596 MFillH fill5c(&evt5c, "MSignalCam", "FillCalSig");
597 MFillH fill5d(&evt5d, "MArrivalTimeCam", "FillExtTm");
598 MFillH fill5e(&evt5e, "MSignalCam", "FillCalTm");
599
600 fill5c.SetDrawOption("gaus");
601 fill5d.SetDrawOption("gaus");
602 fill5e.SetDrawOption("gaus");
603
604 /*
605 fill4b.SetFilter(&filterdat);
606 fill4c.SetFilter(&filterdat);
607 fill4d.SetFilter(&filterdat);
608 fill4e.SetFilter(&filterdat);
609 */
610
611 //MFSoftwareTrigger swtrig;
612 //MContinue contsw(&swtrig, "FilterSwTrigger", "Software trigger");
613 //contsw.SetInverted();
614
615 // The second rule is for the case reading raw-files!
616
617 MWriteRootFile write5(root_file_output_path, "RECREATE", "Calibrated Data", 2);
618 write5.AddContainer("MRawRunHeader", "RunHeaders");
619 write5.AddContainer("MGeomCam", "RunHeaders");
620 write5.AddContainer("MSignalCam", "Events");
621 write5.AddContainer("MTime", "Events");
622 write5.AddContainer("MRawEvtHeader", "Events");
623 //write.AddContainer("MTriggerPattern", "Events");
624
625
626 // ------------------ Setup histograms and fill tasks ----------------
627
628 MContinue test;
629 test.SetFilter(&filterncl);
630
631 MTaskList tlist5tm;
632 tlist5tm.AddToList(&extractor5tm);
633 tlist5tm.AddToList(&calctm5tm);
634 tlist5tm.SetFilter(&filtercal);
635
636 MTaskList tlist5dat;
637 tlist5dat.AddToList(&fill5b);
638 tlist5dat.AddToList(&fill5c);
639 tlist5dat.AddToList(&fill5d);
640 tlist5dat.AddToList(&fill5e);
641 tlist5dat.SetFilter(&filterdat);
642
643 tlist5.AddToList(&read5);
644 tlist5.AddToList(&apply5);
645 tlist5.AddToList(&drsapply5);
646 tlist5.AddToList(&filterncl);
647 //tlist5.AddToList(&test);
648 tlist5.AddToList(&filterdat);
649 tlist5.AddToList(&filtercal);
650 tlist5.AddToList(&filterped);
651 tlist5.AddToList(&fill5a);
652 tlist5.AddToList(&extractor5dat);
653 tlist5.AddToList(&extractor5cal);
654 tlist5.AddToList(&calctm5);
655 tlist5.AddToList(&tlist5tm);
656 tlist5.AddToList(&conv5);
657 tlist5.AddToList(&treat5);
658 tlist5.AddToList(&tlist5dat);
659 tlist5.AddToList(&write5);
660
661 if (!loop5.Eventloop(max4))
662 return 18;
663
664 if (!loop5.GetDisplay())
665 return 19;
666
667 d->SetTitle(status_display_title, kFALSE);
668 d->SaveAs(status_display_output_path);
669
670 return 0;
671}
Note: See TracBrowser for help on using the repository browser.