| 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 | ! Markus Meyer 09/2004 <mailto:meyer@astro.uni-wuerzburg.de>
|
|---|
| 20 | !
|
|---|
| 21 | ! Copyright: MAGIC Software Development, 2000-2004
|
|---|
| 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. The actual calculation is done in the class of
|
|---|
| 34 | // MMuonSearchPar. Please see the manual.
|
|---|
| 35 | //
|
|---|
| 36 | // In order to use further information of muons such as the width of arcs,
|
|---|
| 37 | // the arc length along it, the muons size. Use the infomation stored in
|
|---|
| 38 | // MMuonCalibPar. The information will be available by using the task of
|
|---|
| 39 | // MMuonCalibParCalc.
|
|---|
| 40 | //
|
|---|
| 41 | //
|
|---|
| 42 | // Input Containers:
|
|---|
| 43 | // [MGeomCam]
|
|---|
| 44 | // [MHillas]
|
|---|
| 45 | // [MCerPhotEvt]
|
|---|
| 46 | //
|
|---|
| 47 | // Output Containers:
|
|---|
| 48 | // [MMuonSearchPar]
|
|---|
| 49 | //
|
|---|
| 50 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 51 | #include "MMuonSearchParCalc.h"
|
|---|
| 52 |
|
|---|
| 53 | #include <fstream>
|
|---|
| 54 |
|
|---|
| 55 | #include "MParList.h"
|
|---|
| 56 | #include "MGeomCam.h"
|
|---|
| 57 | #include "MCerPhotEvt.h"
|
|---|
| 58 | #include "MMuonSearchPar.h"
|
|---|
| 59 | #include "MLog.h"
|
|---|
| 60 | #include "MLogManip.h"
|
|---|
| 61 |
|
|---|
| 62 | using namespace std;
|
|---|
| 63 |
|
|---|
| 64 | ClassImp(MMuonSearchParCalc);
|
|---|
| 65 |
|
|---|
| 66 | static const TString gsDefName = "MMuonSearchParCalc";
|
|---|
| 67 | static const TString gsDefTitle = "Calculate muon parameters";
|
|---|
| 68 |
|
|---|
| 69 | // -------------------------------------------------------------------------
|
|---|
| 70 | //
|
|---|
| 71 | // Default constructor.
|
|---|
| 72 | //
|
|---|
| 73 | MMuonSearchParCalc::MMuonSearchParCalc
|
|---|
| 74 | (const char *mupar, const char *name, const char *title)
|
|---|
| 75 | : fHillas(NULL), fMuonPar(NULL), fCerPhotName("MCerPhotEvt")
|
|---|
| 76 | {
|
|---|
| 77 | fName = name ? name : gsDefName.Data();
|
|---|
| 78 | fTitle = title ? title : gsDefTitle.Data();
|
|---|
| 79 |
|
|---|
| 80 | fMuparName = mupar;
|
|---|
| 81 | fHillasInput = "MHillas";
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | // -------------------------------------------------------------------------
|
|---|
| 85 | //
|
|---|
| 86 | Int_t MMuonSearchParCalc::PreProcess(MParList *pList)
|
|---|
| 87 | {
|
|---|
| 88 | fHillas = (MHillas*)pList->FindObject(fHillasInput, "MHillas");
|
|---|
| 89 | if (!fHillas)
|
|---|
| 90 | {
|
|---|
| 91 | *fLog << err << dbginf << "MHillas not found... aborting." << endl;
|
|---|
| 92 | return kFALSE;
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 | fCerPhotEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber(fCerPhotName), "MCerPhotEvt");
|
|---|
| 96 | if (!fCerPhotEvt)
|
|---|
| 97 | {
|
|---|
| 98 | *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
|
|---|
| 99 | return kFALSE;
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 | fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
|
|---|
| 103 | if (!fGeomCam)
|
|---|
| 104 | {
|
|---|
| 105 | *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
|
|---|
| 106 | return kFALSE;
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 | fMuonPar = (MMuonSearchPar*)pList->FindCreateObj("MMuonSearchPar", fMuparName);
|
|---|
| 110 | if (!fMuonPar)
|
|---|
| 111 | return kFALSE;
|
|---|
| 112 |
|
|---|
| 113 | return kTRUE;
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|
| 116 | // -------------------------------------------------------------------------
|
|---|
| 117 | //
|
|---|
| 118 | Int_t MMuonSearchParCalc::Process()
|
|---|
| 119 | {
|
|---|
| 120 |
|
|---|
| 121 | fMuonPar->Calc(*fGeomCam, *fCerPhotEvt, *fHillas);
|
|---|
| 122 |
|
|---|
| 123 | return kTRUE;
|
|---|
| 124 | }
|
|---|
| 125 |
|
|---|