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

Last change on this file since 860 was 852, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.4 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
19! Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2001
22!
23!
24\* ======================================================================== */
25
26#include "MCollAreaTrigger.h"
27
28#include "MParList.h"
29
30#include "MLog.h"
31#include "MLogManip.h"
32
33#include "MMcEvt.hxx"
34#include "MMcTrig.hxx"
35
36#include "MHMcCollectionArea.h"
37
38ClassImp(MCollAreaTrigger)
39
40MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title)
41{
42 *fName = name ? name : "MCollAreaTrigger";
43 *fTitle = title ? title : "Task to calc the collection area ";
44}
45
46Bool_t MCollAreaTrigger::PreProcess (MParList *pList)
47{
48 // connect the raw data with this task
49
50 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
51 if (!fMcEvt)
52 {
53 *fLog << dbginf << "MMcEvt not found... exit." << endl;
54 return kFALSE;
55 }
56
57 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
58 if (!fMcTrig)
59 {
60 *fLog << dbginf << "MMcTrig not found... exit." << endl;
61 return kFALSE;
62 }
63
64 fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea");
65 if (!fCollArea)
66 return kFALSE;
67
68 return kTRUE;
69}
70
71Bool_t MCollAreaTrigger::Process ()
72{
73 const Float_t energy = log10(fMcEvt->GetEnergy());
74 const Float_t impact = fMcEvt->GetImpact()/100.;
75
76 fCollArea->FillAll(energy, impact);
77
78 if (fMcTrig->GetFirstLevel() <= 0)
79 return kTRUE;
80
81 fCollArea->FillSel(energy, impact);
82
83 return kTRUE;
84}
85
86Bool_t MCollAreaTrigger::PostProcess ()
87{
88 //
89 // do the calculation of the effectiv area
90 //
91 fCollArea->CalcEfficiency();
92
93 return kTRUE;
94}
Note: See TracBrowser for help on using the repository browser.