source: trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc@ 2818

Last change on this file since 2818 was 2206, checked in by tbretz, 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 <mailto:wittek@mppmu.mpg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26// //
27// MCT1PointingCorrCalc //
28// //
29// This is a task to do the CT1 pointing correction //
30// //
31/////////////////////////////////////////////////////////////////////////////
32
33#include "MCT1PointingCorrCalc.h"
34
35#include "MParList.h"
36
37#include "MSrcPosCam.h"
38#include "MGeomCam.h"
39#include "MParameters.h"
40
41#include "MLog.h"
42#include "MLogManip.h"
43
44ClassImp(MCT1PointingCorrCalc);
45
46using namespace std;
47
48// --------------------------------------------------------------------------
49//
50// Default constructor.
51//
52MCT1PointingCorrCalc::MCT1PointingCorrCalc(const char *srcname,
53 const char *name, const char *title)
54 : fSrcName(srcname)
55{
56 fName = name ? name : "MCT1PointingCorrCalc";
57 fTitle = title ? title : "Task to do the CT1 pointing correction";
58}
59
60// --------------------------------------------------------------------------
61//
62Int_t MCT1PointingCorrCalc::PreProcess(MParList *pList)
63{
64 MGeomCam *geom = (MGeomCam*)pList->FindObject("MGeomCam");
65 if (!geom)
66 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
67 else
68 {
69 fMm2Deg = geom->GetConvMm2Deg();
70 }
71
72 fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
73 if (!fHourAngle)
74 {
75 *fLog << err << "HourAngle [MParameterD] not found... aborting." << endl;
76 return kFALSE;
77 }
78
79
80 fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
81 if (!fSrcPos)
82 {
83 *fLog << err << fSrcName << " [MSrcPosCam] not found... aborting." << endl;
84 return kFALSE;
85 }
86
87
88 return kTRUE;
89}
90
91// --------------------------------------------------------------------------
92//
93// Do the pointing correction
94//
95// the parametrization is for Mkn421 2001 data (Daniel Kranich)
96//
97Int_t MCT1PointingCorrCalc::Process()
98{
99 // fhourangle is the hour angle [degrees]
100 // (cx, cy) is the source position in the camera [mm]
101 //
102 Float_t fhourangle = fHourAngle->GetVal();
103
104 //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = "
105 // << fhourangle << endl;
106
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 << "MCT1PointingCorrCal::Process; fhourangle, cx, cy, fMm2Deg = "
118 // << fhourangle << ", " << cx << ", " << cy << ", "
119 // << fMm2Deg << endl;
120
121 fSrcPos->SetReadyToSave();
122
123 return kTRUE;
124}
125
126
127
Note: See TracBrowser for help on using the repository browser.