source: trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc@ 1869

Last change on this file since 1869 was 1868, checked in by wittek, 22 years ago
*** empty log message ***
File size: 3.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): Wolfgang Wittek 03/2003 <wittek@mppmu.mpg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2002
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26// //
27// MPointingCorr //
28// //
29// This is a task to do the pointing correction //
30// //
31/////////////////////////////////////////////////////////////////////////////
32
33#include "MPointingCorr.h"
34
35#include "MParList.h"
36
37#include "MMcEvt.hxx"
38#include "MSrcPosCam.h"
39#include "MGeomCam.h"
40
41#include "MLog.h"
42#include "MLogManip.h"
43
44ClassImp(MPointingCorr);
45
46// --------------------------------------------------------------------------
47//
48// Default constructor.
49//
50MPointingCorr::MPointingCorr(const char *name, const char *title,
51 const char *srcname)
52{
53 fName = name ? name : "MPointingCorr";
54 fTitle = title ? title : "Task to do the pointing correction";
55
56 fSrcName = srcname;
57}
58
59// --------------------------------------------------------------------------
60//
61//
62//
63//
64//
65Bool_t MPointingCorr::PreProcess(MParList *pList)
66{
67 MGeomCam *geom = (MGeomCam*)pList->FindObject("MGeomCam");
68 if (!geom)
69 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
70 else
71 {
72 fMm2Deg = geom->GetConvMm2Deg();
73 }
74
75
76 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
77 if (!fMcEvt)
78 {
79 *fLog << dbginf << "MMcEvt not found... aborting." << endl;
80 return kFALSE;
81 }
82
83
84 fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
85 if (!fSrcPos)
86 {
87 *fLog << err << dbginf << fSrcName << " [MSrcPosCam] not found... aborting." << endl;
88 return kFALSE;
89 }
90
91
92 return kTRUE;
93}
94
95// --------------------------------------------------------------------------
96//
97// Do the pointing correction
98//
99// the parametrization is for Mkn421 2001 data (Daniel Kranich)
100//
101Bool_t MPointingCorr::Process()
102{
103 // fhourangle is the hour angle [degrees]
104 // (cx, cy) is the source position in the camera [mm]
105 //
106 Float_t fhourangle = fMcEvt->GetOtherCphFraction();
107 Float_t cx = -0.05132 - 0.001064 * fhourangle
108 - 3.530e-6 * fhourangle * fhourangle;
109 cx /= fMm2Deg;
110
111 Float_t cy = -0.04883 - 0.0003175* fhourangle
112 - 2.165e-5 * fhourangle * fhourangle;
113 cy /= fMm2Deg;
114
115 fSrcPos->SetXY(cx, cy);
116
117 //*fLog << "MPointingCorr::Process; fhourangle, cx, cy, fMm2Deg = "
118 // << fhourangle << ", " << cx << ", " << cy << ", "
119 // << fMm2Deg << endl;
120
121 return kTRUE;
122}
123// --------------------------------------------------------------------------
124//
125//
126//
127Bool_t MPointingCorr::PostProcess()
128{
129 return kTRUE;
130}
131//============================================================================
132
133
134
135
136
137
Note: See TracBrowser for help on using the repository browser.