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

Last change on this file since 761 was 749, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
19! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2001
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MHillas Calc //
29// //
30/////////////////////////////////////////////////////////////////////////////
31
32#include "MHillasCalc.h"
33
34#include "MParList.h"
35
36#include "MHillas.h"
37#include "MCerPhotEvt.h"
38
39#include "MLog.h"
40#include "MLogManip.h"
41
42ClassImp(MHillasCalc)
43
44MHillasCalc::MHillasCalc(const char *name, const char *title)
45{
46 *fName = name ? name : "MHillasCalc";
47 *fTitle = title ? title : "Task to calculate Hillas parameters";
48}
49
50Bool_t MHillasCalc::PreProcess( MParList *pList )
51{
52 fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
53 if (!fCerPhotEvt)
54 {
55 *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
56 return kFALSE;
57 }
58
59 fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
60 if (!fGeomCam)
61 {
62 *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
63 return kFALSE;
64 }
65
66 fHillas = (MHillas*)pList->FindCreateObj("MHillas");
67 if (!fHillas)
68 return kFALSE;
69
70 return kTRUE;
71}
72
73Bool_t MHillasCalc::Process()
74{
75 //
76 // If you want do complex descisions inside the calculations
77 // we must move the calculation code inside this function
78 //
79 // If the calculation wasn't sucessfull skip this event
80 //
81 return fHillas->Calc(*fGeomCam, *fCerPhotEvt) ? kTRUE : kCONTINUE;
82}
83
Note: See TracBrowser for help on using the repository browser.