source: trunk/MagicSoft/Mars/macros/getThreshold.C@ 852

Last change on this file since 852 was 851, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 2.2 KB
Line 
1void getThreshold( char* filename = "/hdb1/users/jlopez/temp_loop.root")
2{
3 // This macro fill the container MMcEnerThre using the task
4 // MMcEnerThreCalc and shows the results.
5
6 MParList parlist;
7 MTaskList tasklist;
8
9 // Setup the parameter list
10 // - You need create the container MMcEnerThre.
11 // + You need to put the number of trigger conditions when
12 // you declarete the MMcEnerThre
13 // + If you don't put any dimension to MMcEnerThre it works
14 // taking only the trigger information from MMcTrig
15 // - You can control the number of bins in the energy distribution
16 // histogram used to compute the energy threshold using
17 // the SetBins() function.
18
19 Int_t numtrigcond = 5;
20 MHMcEnergies *hists = new MHMcEnergies(numtrigcond);
21
22 parlist.AddToList(&tasklist);
23 hists->AddEntriesToList(&parlist);
24
25 // Setup the task list
26 // - You need the read and the MMcEnerThreCalc tasks
27 // + You need to put the number of trigger conditions when
28 // you declarete the MMcEnerThreCalc
29 // + If you don't put any dimension to MMcEnerThreCalc it works
30 // like one dimension MMcEnerThreCalc
31
32 MReadTree read("Events", filename);
33
34 MMcThresholdCalc tcalc(numtrigcond);
35
36 tasklist.AddToList(&read);
37 tasklist.AddToList(&tcalc);
38
39 MEvtLoop evtloop;
40 evtloop.SetParList(&parlist);
41
42 // Begin the loop
43
44 evtloop.Eventloop();
45
46 // Now you can display the results
47
48 TCanvas *c;
49
50 c=new TCanvas("c0","Energy distribution for triggered events", 50, 50, 850, 550);
51 hists[0].Print();
52 hists[0].Draw();
53 c->Update();
54
55 c= new TCanvas("c1","Energy distribution for triggered events", 50, 50, 850, 550);
56 hists[1].Print();
57 hists[1].Draw();
58 c->Update();
59
60 c= new TCanvas("c2","Energy distribution for triggered events", 50, 50, 850, 550);
61 hists[2].Print();
62 hists[2].Draw();
63 c->Update();
64
65 c= new TCanvas("c3","Energy distribution for triggered events", 50, 50, 850, 550);
66 hists[3].Print();
67 hists[3].Draw();
68 c->Update();
69
70 c= new TCanvas("c4","Energy distribution for triggered events", 50, 50, 850, 550);
71 hists[4].Print();
72 hists[4].Draw();
73 c->Update();
74}
Note: See TracBrowser for help on using the repository browser.