Changeset 701
- Timestamp:
- 03/22/01 16:28:06 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MHillas.cc
r698 r701 55 55 56 56 fEllipse = new TEllipse(cos(fTheta)*fDist, sin(fTheta)*fDist, 57 f Width, fLength,58 0, 360, f Alpha);57 fLength, fWidth, 58 0, 360, fTheta*kRad2Deg+fAlpha-180); 59 59 60 60 fEllipse->SetLineWidth(2); … … 137 137 float s = sin(theta); // [1] 138 138 139 const float direction = c*xmean + s*ymean; 140 141 if (direction<0) 142 { 143 c = -c; 144 s = -s; 145 } 146 139 // 140 // resolve four-fold ambiguity of solution 141 // 147 142 float axis1 = 2.0*c*s*sigmaxy + c*c*sigmaxx + s*s*sigmayy; // [mm^2] 148 143 float axis2 = -2.0*c*s*sigmaxy + s*s*sigmaxx + c*c*sigmayy; // [mm^2] … … 158 153 159 154 // 160 // check the rotation of the axis 155 // check the rotation of the axis (maybe turn by 90ø) 161 156 // 162 const int rotation = axis1<axis2;157 const int rotation = axis1<axis2; 163 158 164 fLength = rotation ? sqrt(axis2) : sqrt(axis1); 165 fWidth = rotation ? sqrt(axis1) : sqrt(axis2); 159 fLength = rotation ? sqrt(axis2) : sqrt(axis1); // [mm] 160 fWidth = rotation ? sqrt(axis1) : sqrt(axis2); // [mm] 166 161 167 fAlpha = 180/kPI*atan((-xmean*s+ymean*c)/direction); // [deg] 162 fAlpha = rotation ? 163 fabs(atan((-xmean*c - ymean*s)/(c*ymean - s*xmean))) : 164 fabs(atan(( ymean*c - xmean*s)/(c*xmean + s*ymean))) ; 168 165 169 fDist = sqrt(xmean*xmean + ymean*ymean); // [mm]166 // [deg] 170 167 171 fTheta = atan(ymean/xmean); // [rad] 172 if (xmean<0) fTheta += kPI; // [deg] 168 fAlpha *= kRad2Deg; // [deg] 169 170 fDist = sqrt(xmean*xmean + ymean*ymean); // [mm] 171 172 fTheta = atan(ymean/xmean); // [rad] 173 if (xmean<0) fTheta += kPI; // [rad] 173 174 }
Note:
See TracChangeset
for help on using the changeset viewer.