source: branches/AddingGoogleTestEnvironment/macros/fact/underflow.C@ 20063

Last change on this file since 20063 was 16892, checked in by tbretz, 11 years ago
File size: 1.4 KB
Line 
1int underflow(const char *filename="/raid10/raw/2013/06/21/20130621_062.fits", const char *outname="underflow-check.root")
2{
3 // The input file must be a drs-gain file
4 // The return value is
5 // 0) Success
6 // 1) Underflow detected
7 // 3) Event loop stopped
8 // 4) Display closed
9 // ======================================================
10
11 gLog.Separator("Underflow check");
12
13 // ------------------------------------------------------
14
15 MStatusDisplay *d = new MStatusDisplay;
16
17 MParList plist;
18
19 MTaskList tlist;
20 plist.AddToList(&tlist);
21
22 MEvtLoop loop;
23 loop.SetParList(&plist);
24 loop.SetDisplay(d);
25
26 // --------------------------------------------------------
27
28 MRawFitsRead read1(filename);
29
30 MGeomApply apply;
31
32 tlist.AddToList(&read1);
33 tlist.AddToList(&apply);
34
35 MHDrsCalibration hcalib;
36
37 MFillH fill(&hcalib);
38 fill.SetNameTab("Check");
39
40 tlist.AddToList(&fill);
41
42 if (!loop.Eventloop())
43 return 3;
44
45 if (!loop.GetDisplay())
46 return 4;
47
48 // --------------------------------------------------------
49
50 TString title = "-- Underflow check ";
51 title += " (";
52 title += filename;
53 title += ") --";
54 d->SetTitle(title, kFALSE);
55 d->SaveAs(outname);
56
57 // --------------------------------------------------------
58
59 return hcalib.GetNumUnderflows(1.3)>0 ? 1 : 0;
60}
Note: See TracBrowser for help on using the repository browser.