Changeset 3704 for trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
- Timestamp:
- 04/10/04 16:02:20 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
r3666 r3704 33 33 // PRELIMINARY!! 34 34 // 35 // The caluclation of the position of the reflection in the camera is 36 // done by: 37 // - Rotation of the star-field such that the camera is looking into 38 // the pointing direction 39 // - Calculation of the reflected star-light vector by calling 40 // MGeomMirror::GetReflection (which returns the point at which 41 // the vector hits the camera plain) 42 // - Depending on the draw-option you get each reflected point, the 43 // reflection on a virtual ideal mirror or the reflection on each 44 // individual mirror 45 // 46 // GUI: You can use the the cursor keys to change the pointing position 47 // and plus/minus to change the time by a quarter of an hour. 48 // 35 49 ///////////////////////////////////////////////////////////////////////////// 36 50 #include "MAstroCamera.h" … … 58 72 59 73 // -------------------------------------------------------------------------- 74 // 75 // Create a virtual MGeomMirror which is in the center of the coordinate 76 // system and has a normal vector in z-direction. 77 // 60 78 MAstroCamera::MAstroCamera() : fGeom(0), fMirrors(0) 61 79 { … … 65 83 66 84 // -------------------------------------------------------------------------- 85 // 86 // Delete fGeom, fMirrors and the virtual 0-Mirror fMirror0 87 // 67 88 MAstroCamera::~MAstroCamera() 68 89 { … … 76 97 77 98 // -------------------------------------------------------------------------- 99 // 100 // Set a list of mirrors. The Mirrors must be of type MGeomMirror and 101 // stored in a TClonesArray 102 // 78 103 void MAstroCamera::SetMirrors(TClonesArray &arr) 79 104 { 80 105 if (arr.GetClass()!=MGeomMirror::Class()) 106 { 107 cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl; 81 108 return; 109 } 82 110 83 111 const Int_t n = arr.GetSize(); … … 94 122 95 123 // -------------------------------------------------------------------------- 124 // 125 // Set the camera geometry. The MGeomCam object is cloned. 126 // 96 127 void MAstroCamera::SetGeom(const MGeomCam &cam) 97 128 { … … 103 134 104 135 // -------------------------------------------------------------------------- 136 // 137 // Convert To Pad coordinates (see MAstroCatalog) 138 // 105 139 Int_t MAstroCamera::ConvertToPad(const TVector3 &w, TVector2 &v) const 106 140 { … … 124 158 125 159 // -------------------------------------------------------------------------- 160 // 161 // Find an object with a given name in the list of primitives of this pad. 162 // 126 163 TObject *FindObjectInPad(const char *name, TVirtualPad *pad) 127 164 { … … 152 189 // 153 190 // '*' Draw the mean of the reflections on all mirrors 154 // '.' Draw a dot for the reflection on each mirror 191 // '.' Draw a dot for the reflection on each individual mirror 192 // 'h' To create a TH2D of the star-light which is displayed 193 // 'c' Use the underlaying MHCamera as histogram 194 // '0' Draw the reflection on a virtual perfect mirror 195 // 196 // If the Pad contains an object MHCamera of type MHCamera it is used. 197 // Otherwise a new object is created. 155 198 // 156 199 void MAstroCamera::AddPrimitives(TString o) … … 165 208 o = "*."; 166 209 210 const Bool_t hasnull = o.Contains("0", TString::kIgnoreCase); 167 211 const Bool_t hashist = o.Contains("h", TString::kIgnoreCase); 168 212 const Bool_t hasmean = o.Contains("*", TString::kIgnoreCase); … … 257 301 // transform meters into millimeters (camera display works with mm) 258 302 mean *= 1./num; 259 260 303 DrawStar(mean(0), mean(1), *radec, !hasmean, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1))); 304 305 if (hasnull) 306 { 307 TVector3 star(*radec); 308 star *= rot; 309 const TVector3 spot = fMirror0->GetReflection(star, fGeom->GetCameraDist())*1000; 310 DrawStar(spot(0), spot(1), *radec, !hasmean, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1))); 311 } 261 312 } 262 313 }
Note:
See TracChangeset
for help on using the changeset viewer.