source: trunk/Mars/mmuon/MMuonSearchParCalc.cc@ 14913

Last change on this file since 14913 was 14896, checked in by tbretz, 12 years ago
Added MCalibrateFact and MCalibrateDrsTimes
File size: 3.3 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): Keiichi Mase 09/2004 <mailto:mase@mppmu.mpg.de>
19! Author(s): Markus Meyer 09/2004 <mailto:meyer@astro.uni-wuerzburg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2005
22!
23!
24\* ======================================================================== */
25
26//////////////////////////////////////////////////////////////////////////////
27//
28// MMuonSearchParCalc
29//
30// Task to calculate the muon parameters
31//
32// This class search for muons and store the information into the container
33// of MMuonSearchPar. Please see the manual for more information.
34//
35//
36// Input Containers:
37// MGeomCam
38// MHillas
39// MSignalCam
40//
41// Output Containers:
42// MMuonSearchPar
43//
44//////////////////////////////////////////////////////////////////////////////
45#include "MMuonSearchParCalc.h"
46
47#include "MParList.h"
48
49#include "MLog.h"
50#include "MLogManip.h"
51
52#include "MGeomCam.h"
53#include "MSignalCam.h"
54#include "MMuonSearchPar.h"
55
56using namespace std;
57
58ClassImp(MMuonSearchParCalc);
59
60static const TString gsDefName = "MMuonSearchParCalc";
61static const TString gsDefTitle = "Calculate muon parameters";
62
63// -------------------------------------------------------------------------
64//
65// Default constructor.
66//
67MMuonSearchParCalc::MMuonSearchParCalc(const char *name, const char *title)
68 : fHillas(NULL), fMuonPar(NULL)
69{
70 fName = name ? name : gsDefName.Data();
71 fTitle = title ? title : gsDefTitle.Data();
72}
73
74// -------------------------------------------------------------------------
75//
76Int_t MMuonSearchParCalc::PreProcess(MParList *pList)
77{
78 fHillas = 0;
79 if (!fUseFactAlgorithm)
80 {
81 fHillas = (MHillas*)pList->FindObject("MHillas");
82 if (!fHillas)
83 {
84 *fLog << err << "MHillas not found... aborting." << endl;
85 return kFALSE;
86 }
87 }
88
89 fSignalCam = (MSignalCam*)pList->FindObject("MSignalCam");
90 if (!fSignalCam)
91 {
92 *fLog << err << "MSignalCam not found... aborting." << endl;
93 return kFALSE;
94 }
95
96 fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
97 if (!fGeomCam)
98 {
99 *fLog << err << "MGeomCam not found... aborting." << endl;
100 return kFALSE;
101 }
102
103 fMuonPar = (MMuonSearchPar*)pList->FindCreateObj("MMuonSearchPar");
104 if (!fMuonPar)
105 return kFALSE;
106
107 return kTRUE;
108}
109
110// -------------------------------------------------------------------------
111//
112Int_t MMuonSearchParCalc::Process()
113{
114 if (fUseFactAlgorithm)
115 fMuonPar->CalcFact(*fGeomCam, *fSignalCam);
116 else
117 fMuonPar->Calc(*fGeomCam, *fSignalCam, *fHillas);
118
119 return kTRUE;
120}
Note: See TracBrowser for help on using the repository browser.