source: trunk/MagicSoft/Mars/mmontecarlo/MMcCT1CollectionAreaCalc.cc@ 1956

Last change on this file since 1956 was 1823, checked in by moralejo, 22 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.7 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): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
19! Author(s): Harald Kornmayer 1/2001
20!
21! Copyright: MAGIC Software Development, 2000-2002
22!
23!
24\* ======================================================================== */
25
26//////////////////////////////////////////////////////////////////////////////
27//
28// MHMcCT1CollectionAreaCalc
29//
30//
31//////////////////////////////////////////////////////////////////////////////
32
33#include "MMcCT1CollectionAreaCalc.h"
34
35#include "MParList.h"
36
37#include "MLog.h"
38#include "MLogManip.h"
39
40#include "MMcEvt.hxx"
41
42#include "MHMcCT1CollectionArea.h"
43
44ClassImp(MMcCT1CollectionAreaCalc);
45
46MMcCT1CollectionAreaCalc::MMcCT1CollectionAreaCalc(const char *input,
47 const char *name, const char *title)
48{
49 fName = name ? name : "MMcCT1CollectionAreaCalc";
50 fTitle = title ? title : "Task to calculate the collection area";
51
52 AddToBranchList("MMcEvt.fEnergy");
53 AddToBranchList("MMcEvt.fTelescopeTheta");
54}
55
56Bool_t MMcCT1CollectionAreaCalc::PreProcess (MParList *pList)
57{
58 // connect the raw data with this task
59
60 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
61 if (!fMcEvt)
62 {
63 *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
64 return kFALSE;
65 }
66
67 fCollArea = (MHMcCT1CollectionArea*)pList->FindCreateObj("MHMcCT1CollectionArea");
68 if (!fCollArea)
69 return kFALSE;
70
71 fTotalNumSimulatedShowers = 0;
72 fAllEvtsTriggered = kTRUE;
73
74 return kTRUE;
75}
76
77Bool_t MMcCT1CollectionAreaCalc::Process()
78{
79 const Double_t energy = fMcEvt->GetEnergy();
80
81 Double_t TelescopeTheta = 180.*fMcEvt->GetTelescopeTheta()/TMath::Pi();
82
83 fCollArea->FillSel(energy, TelescopeTheta);
84
85 return kTRUE;
86}
87
88Bool_t MMcCT1CollectionAreaCalc::PostProcess()
89{
90 //
91 // do the calculation of the effective area
92 //
93 *fLog << inf << "Calculation Collection Area..." << endl;
94
95 fCollArea->CalcEfficiency();
96
97 return kTRUE;
98}
99
Note: See TracBrowser for help on using the repository browser.