source: trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc@ 1443

Last change on this file since 1443 was 1211, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.8 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 1/2002 <mailto:tbretz@uni-sw.gwdg.de>
19! Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2002
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MEnergyEstimate //
29// //
30// Task to estimate the energy //
31// //
32// //
33/////////////////////////////////////////////////////////////////////////////
34#include "MEnergyEstimate.h"
35
36#include "MParList.h"
37
38#include "MMcEvt.hxx"
39#include "MHillas.h"
40#include "MEnergyEst.h"
41
42#include "MLog.h"
43#include "MLogManip.h"
44
45ClassImp(MEnergyEstimate);
46
47// --------------------------------------------------------------------------
48//
49// Default constructor.
50//
51MEnergyEstimate::MEnergyEstimate(const char *name, const char *title)
52{
53 fName = name ? name : "MEnergyEstimate";
54 fTitle = title ? title : "Task to estimate the energy";
55
56 AddToBranchList("MMcEvt.fEnergy");
57}
58
59Bool_t MEnergyEstimate::PreProcess(MParList *plist)
60{
61 fHillas = (MHillas*)plist->FindObject("MHillas");
62 if (!fHillas)
63 {
64 *fLog << err << dbginf << "MHillas not found... aborting." << endl;
65 return kFALSE;
66 }
67
68 fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt");
69 if (!fMcEvt)
70 {
71 *fLog << err << dbginf << "MMcEvt not found... aborting." << endl;
72 return kFALSE;
73 }
74
75 fEnergy = (MEnergyEst*)plist->FindCreateObj("MEnergyEst");
76 if (!fEnergy)
77 return kFALSE;
78
79 return kTRUE;
80}
81
82Bool_t MEnergyEstimate::Process()
83{
84 //fEnergy->SetEnergy(fHillas->GetSize());
85 fEnergy->SetEnergy(fMcEvt->GetEnergy());
86 return kTRUE;
87}
Note: See TracBrowser for help on using the repository browser.