Ignore:
Timestamp:
08/28/07 13:03:04 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r8636 r8719  
    178178            *fLog << inf;
    179179            *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;
    181181            *fLog << "of  Monte Carlo set to the appropriate wobble position." << endl;
    182182            return kTRUE;
     
    331331
    332332    return kTRUE;
    333 }
    334 
    335 // --------------------------------------------------------------------------
    336 //
    337 // Loc0LocToCam
    338 //
    339 // Input :   (theta0, phi0)   direction for the position (0,0) in the camera 
    340 //           ( theta,  phi)   some other direction
    341 //
    342 // Output :  (X, Y)      position in the camera corresponding to (theta, phi)
    343 //
    344 TVector2 MSrcPosCalc::CalcXYinCamera(const MVector3 &pos0, const MVector3 &pos) const
    345 {
    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);
    376333}
    377334
     
    428385
    429386    // 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);
    431388
    432389    if (fDeviation)
Note: See TracChangeset for help on using the changeset viewer.