Changeset 3366 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 03/01/04 11:36:44 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r3365 r3366 17 17 ! 18 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 19 ! Author(s): Wolfgang Wittek 02/2004 <mailto:wittek@mppmu.mpg.de> 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 178 178 Bool_t MHStarMap::ReInit(MParList *pList) 179 179 { 180 MObservatory *obs= (MObservatory*)pList->FindObject(AddSerialNumber("MObservatory"));181 if (! obs)180 fObservatory = (MObservatory*)pList->FindObject(AddSerialNumber("MObservatory")); 181 if (!fObservatory) 182 182 { 183 183 *fLog << err << "MObservatory not found... aborting" << endl; … … 188 188 fCosLat = TMath::Cos(obs->GetPhi()); 189 189 190 *fLog << "fSinLat, fCosLat = " << fSinLat << ", "191 << fCosLat << endl;192 193 190 return kTRUE; 194 191 } … … 196 193 // -------------------------------------------------------------------------- 197 194 // 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 // 197 void MHStarMap::GetRotationAngle(Double_t &sin, Double_t &cos) 198 { 199 fObservatory->RotationAngle(fMcEvt->GetTelescopeTheta(), 200 fMcEvt->GetTelescopePhi(), sin, cos); 223 201 } 224 202 … … 270 248 Double_t cosal; 271 249 Double_t sinal; 272 GetRotationAngle( theta, phi, cosal, sinal);250 GetRotationAngle(sinal, cosal); 273 251 274 252 if (m>-1 && m<1) -
trunk/MagicSoft/Mars/mhist/MHStarMap.h
r3365 r3366 10 10 class MSrcPosCam; 11 11 class MMcEvt; 12 class MObservatory; 12 13 13 14 class MHStarMap : public MH 14 15 { 15 16 private: 16 MSrcPosCam *fSrcPos; //! 17 MMcEvt *fMcEvt; //! 17 MSrcPosCam *fSrcPos; //! 18 MMcEvt *fMcEvt; //! 19 MObservatory *fObservatory; //! 18 20 19 21 TH2F *fStarMap; //-> … … 23 25 Bool_t fUseMmScale; 24 26 25 Float_t fCosLat; //!26 Float_t fSinLat; //!27 28 27 void PrepareDrawing() const; 29 28 30 29 void Paint(Option_t *opt=""); 31 30 31 void GetRotationAngle(Double_t &sinangle, Double_t &cosangle); 32 32 33 33 Bool_t SetupFill(const MParList *pList); … … 46 46 TH2F *GetHist() { return fStarMap; } 47 47 48 void GetRotationAngle(const Double_t &thetatel, const Double_t &phitel,49 Double_t &cosangle, Double_t &sinangle);50 51 48 void Draw(Option_t *opt=NULL); 52 49 TObject *DrawClone(Option_t *opt=NULL) const;
Note:
See TracChangeset
for help on using the changeset viewer.