source: trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc@ 1302

Last change on this file since 1302 was 1211, checked in by tbretz, 23 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.6 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@uni-sw.gwdg.de>
19! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2002
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MHillasCalc //
29// //
30// This is a task to calculate the Hillas parameters from each event //
31// //
32// Input Containers: //
33// MCerPhotEvt, MGeomCam //
34// //
35// Output Containers: //
36// MHillas //
37// //
38/////////////////////////////////////////////////////////////////////////////
39
40#include "MHillasCalc.h"
41
42#include "MParList.h"
43
44#include "MHillas.h"
45#include "MCerPhotEvt.h"
46
47#include "MLog.h"
48#include "MLogManip.h"
49
50ClassImp(MHillasCalc);
51
52// --------------------------------------------------------------------------
53//
54// Default constructor.
55//
56MHillasCalc::MHillasCalc(const char *hil, const char *name, const char *title)
57{
58 fName = name ? name : "MHillasCalc";
59 fTitle = title ? title : "Task to calculate Hillas parameters";
60
61 fHilName = hil;
62}
63
64// --------------------------------------------------------------------------
65//
66// Check for a MCerPhotEvt object from which the Hillas are calculated.
67// Try to find the Geometry conatiner. And try to find the output
68// (Hillas) container or create one.
69//
70Bool_t MHillasCalc::PreProcess(MParList *pList)
71{
72 fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
73 if (!fCerPhotEvt)
74 {
75 *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
76 return kFALSE;
77 }
78
79 fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
80 if (!fGeomCam)
81 {
82 *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
83 return kFALSE;
84 }
85
86 fHillas = (MHillas*)pList->FindCreateObj(fHilName);
87 if (!fHillas)
88 return kFALSE;
89
90 return kTRUE;
91}
92
93// --------------------------------------------------------------------------
94//
95// If you want do complex descisions inside the calculations
96// we must move the calculation code inside this function
97//
98// If the calculation wasn't sucessfull skip this event
99//
100Bool_t MHillasCalc::Process()
101{
102 return fHillas->Calc(*fGeomCam, *fCerPhotEvt) ? kTRUE : kCONTINUE;
103}
104
Note: See TracBrowser for help on using the repository browser.