source: trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc@ 703

Last change on this file since 703 was 686, checked in by harald, 24 years ago
Added the first implementation of macro to calculate the trigger collection area. the macro is called getCollArea.C
File size: 1.4 KB
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
11ClassImp(MCollAreaTrigger)
12
13MCollAreaTrigger::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
20Bool_t MCollAreaTrigger::PreProcess (MParList *pList)
21{
22 // connect the raw data with this task
23
24 fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt") ;
25 if (!fMcEvt) {
26 *fLog << dbginf << " Error: MMcEvt not found... exit." << endl;
27 return kFALSE;
28 }
29
30 fMcTrig = (MMcTrig*)pList->FindCreateObj("MMcTrig") ;
31 if (!fMcTrig) {
32 *fLog << dbginf << " Error: MMcTrig not found... exit." << endl;
33 return kFALSE;
34 }
35
36 fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ;
37 if (!fCollArea) {
38 *fLog << dbginf << " Error: MCollArea not found... exit." << endl;
39 return kFALSE;
40 }
41
42 return kTRUE ;
43
44}
45
46
47Bool_t MCollAreaTrigger::Process ()
48{
49
50 fCollArea->FillAll( log10( fMcEvt->GetEnergy()) ,
51 fMcEvt->GetImpact()/100. ) ;
52
53 if ( fMcTrig->GetFirstLevel() > 0 )
54 fCollArea->FillSel( log10( fMcEvt->GetEnergy()) ,
55 fMcEvt->GetImpact()/100. ) ;
56
57 return kTRUE ;
58}
59
60Bool_t MCollAreaTrigger::PostProcess ()
61{
62 //
63 // do the calculation of the effectiv area
64 //
65
66 fCollArea->CalculateEffi() ;
67
68 return kTRUE ;
69}
Note: See TracBrowser for help on using the repository browser.