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 6/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2005
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | //////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MSrcPosCorrect
|
---|
28 | //
|
---|
29 | // For more details see Process()
|
---|
30 | //
|
---|
31 | //////////////////////////////////////////////////////////////////////////////
|
---|
32 | #include "MSrcPosCorrect.h"
|
---|
33 |
|
---|
34 | #include <TVector2.h>
|
---|
35 |
|
---|
36 | #include "MParList.h"
|
---|
37 |
|
---|
38 | #include "MLog.h"
|
---|
39 | #include "MLogManip.h"
|
---|
40 |
|
---|
41 | #include "MSrcPosCam.h"
|
---|
42 | #include "MRawRunHeader.h"
|
---|
43 |
|
---|
44 | ClassImp(MSrcPosCorrect);
|
---|
45 |
|
---|
46 | using namespace std;
|
---|
47 |
|
---|
48 | // --------------------------------------------------------------------------
|
---|
49 | //
|
---|
50 | MSrcPosCorrect::MSrcPosCorrect(const char *name, const char *title)
|
---|
51 | : fSrcPosCam(NULL), fSrcPosAnti(NULL)
|
---|
52 | {
|
---|
53 | fName = name ? name : "MSrcPosCorrect";
|
---|
54 | fTitle = title ? title : "Calculates the source position in the camera";
|
---|
55 | }
|
---|
56 |
|
---|
57 | // --------------------------------------------------------------------------
|
---|
58 | //
|
---|
59 | // Search and if necessary create MSrcPosCam in the parameter list. Search
|
---|
60 | // MSourcePos. If not found, do nothing else, and skip the task. If MSrcPosCam
|
---|
61 | // did not exist before and has been created here, it will contain as source
|
---|
62 | // position the camera center (0,0).
|
---|
63 | // In the case that MSourcePos is found, go ahead in searching the rest of
|
---|
64 | // necessary containers. The source position will be calculated for each
|
---|
65 | // event in Process.
|
---|
66 | //
|
---|
67 | Int_t MSrcPosCorrect::PreProcess(MParList *pList)
|
---|
68 | {
|
---|
69 | fSrcPosCam = (MSrcPosCam*)pList->FindObject("MSrcPosCam");
|
---|
70 | if (!fSrcPosCam)
|
---|
71 | {
|
---|
72 | *fLog << err << "MSrcPosCam not found... aborting." << endl;
|
---|
73 | return kFALSE;
|
---|
74 | }
|
---|
75 |
|
---|
76 | fSrcPosAnti = (MSrcPosCam*)pList->FindObject("MSrcPosAnti", "MSrcPosCam");
|
---|
77 |
|
---|
78 | return kTRUE;
|
---|
79 | }
|
---|
80 |
|
---|
81 | // --------------------------------------------------------------------------
|
---|
82 | //
|
---|
83 | // Checking for file type. If the file type is Monte Carlo the
|
---|
84 | // source position is arbitrarily determined from the MC headers.
|
---|
85 | //
|
---|
86 | Bool_t MSrcPosCorrect::ReInit(MParList *plist)
|
---|
87 | {
|
---|
88 | MRawRunHeader *run = (MRawRunHeader*)plist->FindObject("MRawRunHeader");
|
---|
89 | if (!run)
|
---|
90 | {
|
---|
91 | *fLog << err << "MRawRunHeader not found... aborting." << endl;
|
---|
92 | return kFALSE;
|
---|
93 | }
|
---|
94 |
|
---|
95 | fRunType = run->GetRunType();
|
---|
96 | fRunNumber = run->GetRunNumber();
|
---|
97 |
|
---|
98 | return kTRUE;
|
---|
99 | }
|
---|
100 |
|
---|
101 | // --------------------------------------------------------------------------
|
---|
102 | //
|
---|
103 | // Performs source position correction in the camera.
|
---|
104 | // Due to missfocussing a shift of
|
---|
105 | // dx=0.048deg and dy=0.032deg
|
---|
106 | // or
|
---|
107 | // dx=14.24mm and dy=9.495mm
|
---|
108 | // is added between run 53832 (excl) and 56161 (excl)
|
---|
109 | // See also: Runbook
|
---|
110 | //
|
---|
111 | // 2005-05-23 03:33:51:
|
---|
112 | // We start again to make tests on AMC with Roque lamp and PinDiode Tests.
|
---|
113 | // At park position, we do a Laser initial isation and a Laser adjustment.
|
---|
114 | // We discovered that the procedure we used yester day for Roque Lamp
|
---|
115 | // light source was producing a very non-uniform light
|
---|
116 | // We did some studies to produce an uniformly illuminated li ght from the
|
---|
117 | // Roque Lamp Then we moved the telescope to the Roque Lamp position a nd
|
---|
118 | // did a Laser adjust for the Roque position. We put the telescope to
|
---|
119 | // the same shaftencoder values as were used in August to adjust the
|
---|
120 | // mirrors
|
---|
121 | // ( 29691 for SE-Az and SE-Zd1 1301 and SE-Zd2 9912 ( someti mes
|
---|
122 | // oscillating to 9913 ) ) When we looked at the image of the spot on the
|
---|
123 | // camer a, we saw a clear offset from the centre. Then we calculated this
|
---|
124 | // offset and put the correct numbers in the AMC code. Then we redid the
|
---|
125 | // laser adjustment and fou nd the spot to be nicely centred. Our
|
---|
126 | // calculations showed that the offset was 0 .048 deg in X direction and
|
---|
127 | // 0.032 deg in Y direction.
|
---|
128 | // Good night
|
---|
129 | //
|
---|
130 | Int_t MSrcPosCorrect::Process()
|
---|
131 | {
|
---|
132 | if (fRunType==MRawRunHeader::kRTMonteCarlo)
|
---|
133 | return kTRUE;
|
---|
134 |
|
---|
135 | if (fRunNumber<56161 && fRunNumber>53832)
|
---|
136 | {
|
---|
137 | static const TVector2 dxy(-14.24, -9.495);
|
---|
138 | fSrcPosCam->Add(dxy);
|
---|
139 | if (fSrcPosAnti)
|
---|
140 | fSrcPosAnti->Add(dxy);
|
---|
141 | }
|
---|
142 |
|
---|
143 | return kTRUE;
|
---|
144 | }
|
---|