Changeset 8719 for trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
- Timestamp:
- 08/28/07 13:03:04 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
r8636 r8719 178 178 *fLog << inf; 179 179 *fLog << "MSourcePos [MPointPos] not found... The source position" << endl; 180 *fLog << "set in MSrcPosCam will be set to (0/0) or in the case" << endl;180 *fLog << "set in MSrcPosCam will be set to (0/0) or in the case" << endl; 181 181 *fLog << "of Monte Carlo set to the appropriate wobble position." << endl; 182 182 return kTRUE; … … 331 331 332 332 return kTRUE; 333 }334 335 // --------------------------------------------------------------------------336 //337 // Loc0LocToCam338 //339 // Input : (theta0, phi0) direction for the position (0,0) in the camera340 // ( theta, phi) some other direction341 //342 // Output : (X, Y) position in the camera corresponding to (theta, phi)343 //344 TVector2 MSrcPosCalc::CalcXYinCamera(const MVector3 &pos0, const MVector3 &pos) const345 {346 const Double_t theta0 = pos0.Theta();347 const Double_t phi0 = pos0.Phi();348 349 const Double_t theta = pos.Theta();350 const Double_t phi = pos.Phi();351 352 //--------------------------------------------353 354 /* --- OLD ---355 const Double_t YC0 = TMath::Cos(theta0)*TMath::Tan(theta)*TMath::Cos(phi-phi0) - TMath::Sin(theta0);356 const Double_t YC1 = TMath::Cos(theta0) + TMath::Sin(theta0)*TMath::Tan(theta);357 const Double_t YC = YC0 / YC1;358 359 const Double_t XC0 = TMath::Cos(theta0) - YC*TMath::Sin(theta0);360 const Double_t XC = -TMath::Sin(phi-phi0) * TMath::Tan(theta) * XC0;361 */362 363 /* --- NEW --- Same as MSrcPosCorrect::CalcXYinCamera */364 const Double_t XC0 = TMath::Sin(theta)*TMath::Sin(phi-phi0);365 const Double_t XC1 = TMath::Cos(theta0)*TMath::Cos(theta);366 const Double_t XC2 = TMath::Sin(theta0)*TMath::Sin(theta)*TMath::Cos(phi-phi0);367 368 const Double_t YC0 = TMath::Sin(theta0)*TMath::Cos(theta);369 const Double_t YC1 = TMath::Cos(theta0)*TMath::Sin(theta)*TMath::Cos(phi-phi0);370 371 const Double_t XC = - XC0 / (XC1 + XC2);372 const Double_t YC = (-YC0+YC1) / (XC1 + XC2);373 374 //--------------------------------------------375 return TVector2(XC, YC);376 333 } 377 334 … … 428 385 429 386 // Calculate source position in camera, and convert to mm: 430 TVector2 v = CalcXYinCamera(pos0, pos)*fGeom->GetCameraDist()*1000;387 TVector2 v = MAstro::GetDistOnPlain(pos0, pos, -fGeom->GetCameraDist()*1000); 431 388 432 389 if (fDeviation)
Note:
See TracChangeset
for help on using the changeset viewer.