Changeset 3580
- Timestamp:
- 03/22/04 17:13:19 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3579 r3580 134 134 * mimage/MNewImagePar.[h,cc]: 135 135 - added some comments 136 137 * mhist/MHStarMap.[h,cc]: 138 - fixed to use the correct MPointingPos instead of the 139 deprecated MMcEvt. Use MPointingPosCalc to copy the 140 pointing position from MMcEvt to MPointingPos 136 141 137 142 -
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r3370 r3580 48 48 #include <TColor.h> // SetRGB 49 49 #include <TCanvas.h> // TCanvas 50 #include <TVector2.h> 50 51 51 52 #include "MLog.h" … … 58 59 #include "MHillas.h" 59 60 #include "MBinning.h" 60 #include "MMcEvt.hxx"61 61 #include "MSrcPosCam.h" 62 62 #include "MObservatory.h" 63 #include "MPointingPos.h" 63 64 64 65 ClassImp(MHStarMap); … … 131 132 } 132 133 133 f McEvt = (MMcEvt*)plist->FindObject("MMcEvt");134 if (!f McEvt)134 fPointPos = (MPointingPos*)plist->FindObject("MPointingPos"); 135 if (!fPointPos) 135 136 { 136 *fLog << err << "M McEvtnot found... aborting." << endl;137 *fLog << err << "MPointingPos not found... aborting." << endl; 137 138 return kFALSE; 138 139 } … … 190 191 // -------------------------------------------------------------------------- 191 192 // 192 // Calls MObservatory::RotationAngle193 //194 void MHStarMap::GetRotationAngle(Double_t &sin, Double_t &cos)195 {196 fObservatory->RotationAngle(fMcEvt->GetTelescopeTheta(),197 fMcEvt->GetTelescopePhi(), sin, cos);198 }199 200 // --------------------------------------------------------------------------201 //202 193 // Fill the four histograms with data from a MHillas-Container. 203 194 // Be careful: Only call this with an object of type MHillas … … 216 207 Float_t t = h.GetMeanY() - m*h.GetMeanX(); 217 208 218 Float_t xSource = fSrcPos->GetX(); 219 Float_t ySource = fSrcPos->GetY(); 209 TVector2 src(fSrcPos->GetXY()); 220 210 221 211 if (!fUseMmScale) 222 212 { 223 t *= fMm2Deg; 224 xSource *= fMm2Deg; 225 ySource *= fMm2Deg; 213 t *= fMm2Deg; 214 src *= fMm2Deg; 226 215 } 227 216 … … 239 228 // - and perform a rotation to compensate the rotation of the 240 229 // sky image in the camera 241 Double_t cosal; 242 Double_t sinal; 243 GetRotationAngle(sinal, cosal); 230 const Double_t rho = fPointPos->RotationAngle(*fObservatory); 244 231 245 232 if (m>-1 && m<1) … … 248 235 249 236 for (float x=xmin+dx/2; x<(xmax-xmin)+dx; x+=dx) 250 { 251 const Float_t xorig = x - xSource; 252 const Float_t yorig = m*x+t - ySource; 253 254 const Float_t xfill = cosal*xorig + sinal*yorig; 255 const Float_t yfill = -sinal*xorig + cosal*yorig; 256 fStarMap->Fill(xfill, yfill, w); 237 { 238 TVector2 v(x, m*x+t); 239 v -= src; 240 v.Rotate(-rho); 241 242 fStarMap->Fill(v.X(), v.Y(), w); 257 243 } 258 244 } … … 266 252 267 253 for (float y=ymin+dy/2; y<(ymax-ymin)+dy; y+=dy) 268 { 269 const Float_t xorig = (y-t)/m - xSource; 270 const Float_t yorig = y - ySource; 271 272 const Float_t xfill = cosal*xorig + sinal*yorig; 273 const Float_t yfill = -sinal*xorig + cosal*yorig; 274 fStarMap->Fill(xfill, yfill, w); 254 { 255 TVector2 v((y-t)/m, y); 256 v -= src; 257 v.Rotate(-rho); 258 259 fStarMap->Fill(v.X(), v.Y(), w); 275 260 } 276 261 } -
trunk/MagicSoft/Mars/mhist/MHStarMap.h
r3384 r3580 9 9 class MHillas; 10 10 class MSrcPosCam; 11 class MMcEvt;12 11 class MObservatory; 12 class MPointingPos; 13 13 14 14 class MHStarMap : public MH 15 15 { 16 16 private: 17 MSrcPosCam *fSrcPos; //!18 M McEvt *fMcEvt;//!17 MSrcPosCam *fSrcPos; //! 18 MPointingPos *fPointPos; //! 19 19 MObservatory *fObservatory; //! 20 20
Note:
See TracChangeset
for help on using the changeset viewer.