Changeset 1956 for trunk/MagicSoft/Mars/mhist/MHStarMap.cc
- Timestamp:
- 04/12/03 21:48:57 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r1951 r1956 156 156 const float sind = sqrt(1.0-cosd*cosd); 157 157 158 constfloat t = h.GetMeanY() - m*h.GetMeanX();158 float t = h.GetMeanY() - m*h.GetMeanX(); 159 159 160 160 if (!fUseMmScale) … … 162 162 163 163 // get step size ds along the main axis of the ellipse 164 const TAxis &axe = *fStarMap->GetXaxis();165 const int N = axe.GetNbins();166 const float xm in = axe.GetXmin();167 const float xmax = axe.GetXmax(); 164 const TAxis &axex = *fStarMap->GetXaxis(); 165 const float xmin = axex.GetXmin(); 166 const float xmax = axex.GetXmax(); 167 168 168 // FIXME: Fixed number? 169 const float ds 169 const float ds = (xmax-xmin) / 200.0; 170 170 171 171 if (m>-1 && m<1) 172 172 { 173 173 const float dx = ds * cosd; 174 const float x = xmin + dx/2.0; 175 const int N1 = (int) ((xmax-xmin)/dx+1.0); 176 177 for (int i=0; i<N1; i++) 178 { 179 const float y = m*x+t; 180 fStarMap->Fill(x, y); 181 x += dx; 182 } 174 175 for (float x=xmin+dx/2; x<(xmax-xmin)+dx; x+=dx) 176 fStarMap->Fill(x, m*x+t); 183 177 } 184 178 else 185 179 { 186 const TAxis &axe = *fStarMap->GetYaxis(); 187 const int M = axe.GetNbins(); 188 const float ymin = axe.GetXmin(); 189 const float ymax = axe.GetXmax(); 180 const TAxis &axey = *fStarMap->GetYaxis(); 181 const float ymin = axey.GetXmin(); 182 const float ymax = axey.GetXmax(); 190 183 191 184 const float dy = ds * sind; 192 const float y = ymin + dy/2.0; 193 const int M1 = (int) ((ymax-ymin)/dy+1.0); 194 195 for (int i=0; i<M1; i++) 196 { 197 const float x = (y-t)/m; 198 fStarMap->Fill(x, y); 199 y += dy; 200 } 185 186 for (float y=ymin+dy/2; y<(ymax-ymin)+dy; y+=dy) 187 fStarMap->Fill((y-t)/m, y); 201 188 } 202 189
Note:
See TracChangeset
for help on using the changeset viewer.