source: trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc@ 1399

Last change on this file since 1399 was 1211, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.9 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): Rudolf Bock 10/2001 <mailto:Rudolf.Bock@cern.ch>
20!
21! Copyright: MAGIC Software Development, 2000-2002
22!
23!
24\* ======================================================================== */
25
26//////////////////////////////////////////////////////////////////////////////
27//
28// MHillasSrcCalc
29//
30// Task to calculate the source dependant part of the hillas parameters
31//
32//////////////////////////////////////////////////////////////////////////////
33#include "MHillasSrcCalc.h"
34
35#include "MParList.h"
36
37#include "MHillasSrc.h"
38
39#include "MLog.h"
40#include "MLogManip.h"
41
42ClassImp(MHillasSrcCalc);
43
44// -------------------------------------------------------------------------
45//
46// Default constructor. The first argument is the name of a container
47// containing the source position in the camera plain (MScrPosCam).
48// The default is "MSrcPosCam". hil is the name of a container
49// of type MHillasSrc (or derived) in which the parameters are stored
50// The default is "MHillasSrc"
51//
52MHillasSrcCalc::MHillasSrcCalc(const char *src, const char *hil,
53 const char *name, const char *title)
54{
55 fName = name ? name : "MHillasSrcCalc";
56 fTitle = title ? title : "add parameters dependent on source position (MHillasSrc)";
57
58 fSrcName = src;
59 fHillasName = hil;
60}
61
62// -------------------------------------------------------------------------
63//
64Bool_t MHillasSrcCalc::PreProcess(MParList *pList)
65{
66 fHillas = (MHillas*)pList->FindObject("MHillas");
67 if (!fHillas)
68 {
69 *fLog << err << dbginf << "MHillas not found... aborting." << endl;
70 return kFALSE;
71 }
72
73 fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
74 if (!fSrcPos)
75 {
76 *fLog << err << dbginf << fSrcName << " [MSrcPosCam] not found... aborting." << endl;
77 return kFALSE;
78 }
79
80 fHillasSrc = (MHillasSrc*)pList->FindCreateObj("MHillasSrc", fHillasName);
81 if (!fHillasSrc)
82 return kFALSE;
83
84 fHillasSrc->SetSrcPos(fSrcPos);
85
86 return kTRUE;
87}
88
89// -------------------------------------------------------------------------
90//
91Bool_t MHillasSrcCalc::Process()
92{
93 fHillasSrc->Calc(fHillas);
94
95 return kTRUE;
96}
97
Note: See TracBrowser for help on using the repository browser.