Line | |
---|
1 | #include "MCollAreaTrigger.h"
|
---|
2 |
|
---|
3 | #include "MLog.h"
|
---|
4 | #include "MLogManip.h"
|
---|
5 | #include "MParList.h"
|
---|
6 |
|
---|
7 | #include "MCollArea.h"
|
---|
8 | #include "MMcEvt.hxx"
|
---|
9 | #include "MMcTrig.hxx"
|
---|
10 |
|
---|
11 | ClassImp(MCollAreaTrigger)
|
---|
12 |
|
---|
13 | MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title)
|
---|
14 | {
|
---|
15 | *fName = name ? name : "MCollAreaTrigger";
|
---|
16 | *fTitle = title ? title : "Task to calc the collection area ";
|
---|
17 | }
|
---|
18 |
|
---|
19 |
|
---|
20 | Bool_t MCollAreaTrigger::PreProcess (MParList *pList)
|
---|
21 | {
|
---|
22 | // connect the raw data with this task
|
---|
23 |
|
---|
24 | fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt") ;
|
---|
25 | if (!fMcEvt) {
|
---|
26 | *fLog << dbginf << "MMcEvt not found... exit." << endl;
|
---|
27 | return kFALSE;
|
---|
28 | }
|
---|
29 |
|
---|
30 | fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig") ;
|
---|
31 | if (!fMcTrig) {
|
---|
32 | *fLog << dbginf << "MMcTrig not found... exit." << endl;
|
---|
33 | return kFALSE;
|
---|
34 | }
|
---|
35 |
|
---|
36 | fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ;
|
---|
37 | if (!fCollArea)
|
---|
38 | return kFALSE;
|
---|
39 |
|
---|
40 | return kTRUE ;
|
---|
41 |
|
---|
42 | }
|
---|
43 |
|
---|
44 |
|
---|
45 | Bool_t MCollAreaTrigger::Process ()
|
---|
46 | {
|
---|
47 | const Float_t energy = log10(fMcEvt->GetEnergy());
|
---|
48 | const Float_t impact = fMcEvt->GetImpact()/100.;
|
---|
49 |
|
---|
50 | fCollArea->FillAll(energy, impact);
|
---|
51 |
|
---|
52 |
|
---|
53 | if (fMcTrig->GetFirstLevel() <= 0)
|
---|
54 | return kTRUE;
|
---|
55 |
|
---|
56 | fCollArea->FillSel(energy, impact);
|
---|
57 |
|
---|
58 | return kTRUE ;
|
---|
59 | }
|
---|
60 |
|
---|
61 | Bool_t MCollAreaTrigger::PostProcess ()
|
---|
62 | {
|
---|
63 | //
|
---|
64 | // do the calculation of the effectiv area
|
---|
65 | //
|
---|
66 |
|
---|
67 | fCollArea->CalcEfficiency() ;
|
---|
68 |
|
---|
69 | return kTRUE ;
|
---|
70 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.