Ignore:
Timestamp:
03/01/04 11:36:44 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r3365 r3366  
    1717!
    1818!   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    19 !             Wolfgang Wittek 02/2004 <mailto:wittek@mppmu.mpg.de>
     19!   Author(s): Wolfgang Wittek 02/2004 <mailto:wittek@mppmu.mpg.de>
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2004
     
    178178Bool_t MHStarMap::ReInit(MParList *pList)
    179179{
    180     MObservatory *obs = (MObservatory*)pList->FindObject(AddSerialNumber("MObservatory"));
    181     if (!obs)
     180    fObservatory = (MObservatory*)pList->FindObject(AddSerialNumber("MObservatory"));
     181    if (!fObservatory)
    182182    {
    183183        *fLog << err << "MObservatory not found...  aborting" << endl;
     
    188188    fCosLat = TMath::Cos(obs->GetPhi());
    189189
    190     *fLog << "fSinLat, fCosLat = " << fSinLat << ",  "
    191           << fCosLat << endl;
    192 
    193190    return kTRUE;
    194191}
     
    196193// --------------------------------------------------------------------------
    197194//
    198 // RotationAngle
    199 //
    200 // calculates the angle for the rotation of the sky image in the camera;
    201 // this angle is a function of the local coordinates (theta, phi) in rad.
    202 //
    203 // calculate rotation angle alpha of sky image in camera
    204 // (see TDAS 00-11, eqs. (18) and (20))
    205 //
    206 void MHStarMap::GetRotationAngle(const Double_t &theta, const Double_t &phi,
    207                                  Double_t &cosal, Double_t &sinal)
    208 {
    209 
    210     const Double_t sint = TMath::Sin(theta);
    211     const Double_t cost = TMath::Cos(theta);
    212 
    213     const Double_t sinp = TMath::Sin(phi);
    214     const Double_t cosp = TMath::Cos(phi);
    215 
    216     const Double_t v1 = sint*sinp;
    217     const Double_t v2 = fCosLat*cost - fSinLat*sint*cosp;
    218 
    219     const Double_t denom =  1./ TMath::Sqrt(v1*v1 + v2*v2);
    220 
    221     cosal =  (fSinLat * sint - fCosLat * cost * cosp) * denom;
    222     sinal =   fCosLat * sinp                          * denom;
     195// Calls MObservatory::RotationAngle
     196//
     197void MHStarMap::GetRotationAngle(Double_t &sin, Double_t &cos)
     198{
     199    fObservatory->RotationAngle(fMcEvt->GetTelescopeTheta(),
     200                                fMcEvt->GetTelescopePhi(), sin, cos);
    223201}
    224202
     
    270248    Double_t cosal;
    271249    Double_t sinal;
    272     GetRotationAngle(theta, phi, cosal, sinal);
     250    GetRotationAngle(sinal, cosal);
    273251
    274252    if (m>-1 && m<1)
  • trunk/MagicSoft/Mars/mhist/MHStarMap.h

    r3365 r3366  
    1010class MSrcPosCam;
    1111class MMcEvt;
     12class MObservatory;
    1213
    1314class MHStarMap : public MH
    1415{
    1516private:
    16     MSrcPosCam *fSrcPos; //!
    17     MMcEvt     *fMcEvt;  //!
     17    MSrcPosCam   *fSrcPos; //!
     18    MMcEvt       *fMcEvt;  //!
     19    MObservatory *fObservatory; //!
    1820
    1921    TH2F *fStarMap;      //->
     
    2325    Bool_t fUseMmScale;
    2426
    25     Float_t fCosLat; //!
    26     Float_t fSinLat; //!
    27 
    2827    void PrepareDrawing() const;
    2928
    3029    void Paint(Option_t *opt="");
    3130
     31    void GetRotationAngle(Double_t &sinangle, Double_t &cosangle);
    3232
    3333    Bool_t SetupFill(const MParList *pList);
     
    4646    TH2F *GetHist() { return fStarMap; }
    4747
    48     void GetRotationAngle(const Double_t &thetatel, const Double_t &phitel,
    49                           Double_t &cosangle, Double_t &sinangle);
    50 
    5148    void Draw(Option_t *opt=NULL);
    5249    TObject *DrawClone(Option_t *opt=NULL) const;
Note: See TracChangeset for help on using the changeset viewer.