1 | void getThreshold( char* filename = "data/oscar_protons.root")
|
---|
2 | {
|
---|
3 | //
|
---|
4 | // This macro fill the container MMcEnerThre using the task
|
---|
5 | // MMcEnerThreCalc and shows the results.
|
---|
6 | //
|
---|
7 | MParList parlist;
|
---|
8 |
|
---|
9 | MTaskList tasklist;
|
---|
10 | parlist.AddToList(&tasklist);
|
---|
11 |
|
---|
12 | //
|
---|
13 | // Setup the parameter list
|
---|
14 | // - You need create the container MMcEnerThre.
|
---|
15 | // + You need to put the number of trigger conditions when
|
---|
16 | // you declarete the MHMcEnergies
|
---|
17 | // + If you don't put any dimension to MHMcEnergies it works
|
---|
18 | // taking only the trigger information from MMcTrig
|
---|
19 | //
|
---|
20 | const UInt_t numtriggerconditions = 1;
|
---|
21 |
|
---|
22 | MHMcEnergies *hists = new MHMcEnergies(numtriggerconditions);
|
---|
23 | hists->AddEntriesToList(&parlist);
|
---|
24 |
|
---|
25 | //
|
---|
26 | // Setup the task list
|
---|
27 | // - You need the read and the MMcThresholdCalc tasks
|
---|
28 | // - You have to fill the histograms for the Energy threshold
|
---|
29 | // + You need to put the number of trigger conditions when
|
---|
30 | // you declarete the MMcThresholdCalc
|
---|
31 | // + If you don't put any dimension to MMcThresholdCalc it works
|
---|
32 | // like one dimension MMcThresholdCalc
|
---|
33 | //
|
---|
34 | MReadTree read("Events", filename);
|
---|
35 | MMcThresholdCalc calc(numtriggerconditions);
|
---|
36 |
|
---|
37 | tasklist.AddToList(&read);
|
---|
38 | tasklist.AddToList(&calc);
|
---|
39 |
|
---|
40 | MEvtLoop evtloop;
|
---|
41 | evtloop.SetParList(&parlist);
|
---|
42 |
|
---|
43 | //
|
---|
44 | // Begin the loop
|
---|
45 | //
|
---|
46 | evtloop.Eventloop();
|
---|
47 |
|
---|
48 | //
|
---|
49 | // Now you can display the results
|
---|
50 | //
|
---|
51 | for (UInt_t i=0; i<numtriggerconditions; i++)
|
---|
52 | ((*hists)[i]).Draw();
|
---|
53 | }
|
---|