source: trunk/MagicSoft/Mars/macros/triglvl2.C@ 1740

Last change on this file since 1740 was 1740, checked in by moralejo, 22 years ago
*** empty log message ***
File size: 1.9 KB
Line 
1
2Bool_t HandleInput()
3{
4 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
5 while (1)
6 {
7 //
8 // While reading the input process gui events asynchronously
9 //
10 timer.TurnOn();
11 TString input = Getline("Type 'q' to exit, <return> to go on: ");
12 timer.TurnOff();
13
14 if (input=="q\n")
15 return kFALSE;
16
17 if (input=="\n")
18 return kTRUE;
19 };
20
21 return kFALSE;
22}
23
24void secondlt(char *filename = "../../Mars-0.8/gamma_new.root")
25{
26 //
27 // first we have to create our empty lists
28 //
29 MParList parlist;
30 MTaskList tasklist;
31
32 MTrigLvl2 cell;
33
34 parlist.AddToList(&cell);
35 parlist.AddToList(&tasklist);
36
37 //
38 // Setup out tasks:
39 // - First we have to read the events
40 // - Then we can fill the efficiency histograms
41 //
42 MReadMarsFile reader("Events", filename);
43 reader.EnableBranch("fEnergy");
44 reader.EnableBranch("fImpact"); reader.EnableBranch("fTimeFirst[4]");
45 reader.EnableBranch("fPixelsFirst[73][4]");
46
47
48
49 MTrigLvl2FillTask fill("MTrigLvl2FillTask","MTrigLvl2FillTask");
50
51 tasklist.AddToList(&reader);
52 tasklist.AddToList(&fill);
53
54
55 //
56 // set up the loop for the processing
57 //
58 MEvtLoop magic;
59 magic.SetParList(&parlist);
60
61 //
62 // Start to loop over all events
63 //
64 MProgressBar bar;
65 magic.SetProgressBar(&bar);
66
67
68 // if (!magic.Eventloop())
69 // return;
70
71
72 if (!magic.PreProcess())
73 return;
74
75
76
77 while (tasklist.Process())
78 {
79 cout << "Event #" << reader.GetEventNum() ":" << endl;
80
81 cell.DrawLv1();
82
83 //if (!HandleInput())
84 // break;
85 }
86
87
88
89 magic.PostProcess();
90
91 tasklist.PrintStatistics();
92
93 //
94 // Now the histogram we wanted to get out of the data is
95 // filled and can be displayd
96 //
97 // parlist.FindObject("MHMcCollectionArea")->DrawClone();
98}
Note: See TracBrowser for help on using the repository browser.