Changeset 9850 for trunk/Mars/mimage
- Timestamp:
- 08/12/10 09:34:13 (14 years ago)
- Location:
- trunk/Mars/mimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mimage/MHillasExt.cc
r9849 r9850 121 121 fSlopeLong = 0; 122 122 fSlopeTrans = 0; 123 124 fTimeSpread = -1; 125 fTimeSpreadWeighted = -1; 126 fSlopeSpread = -1; 127 fSlopeSpreadWeighted = -1; 123 128 } 124 129 … … 202 207 203 208 sumxw += x*nphot; 204 sumyw += x*nphot;209 sumyw += y*nphot; 205 210 sumtw += t*nphot; 206 211 … … 250 255 // Time spread 251 256 // 252 fTimeSpread = TMath::Sqrt(sumt2 /cnt - sumt*sumt/cnt/cnt);253 fTimeSpreadWeighted = TMath::Sqrt(sumt2w2 + (sumw2 - 2*sumtw2)*sumtw/sumw)/sumw;257 fTimeSpread = TMath::Sqrt(sumt2*cnt - sumt*sumt)/cnt; 258 fTimeSpreadWeighted = TMath::Sqrt(sumt2w2 + sumw2*sumtw*sumtw/sumw/sumw - 2*sumtw2*sumtw/sumw)/sumw; 254 259 255 260 // … … 280 285 const Double_t sumdt2w2 = sumt2w2 - 2*fSlopeLong*(c*sumtxw2 + s*sumtyw2) + fSlopeLong*fSlopeLong * (c*c*sumx2 + s*s*sumy2 + 2*c*s*sumxy) * sumw2; 281 286 282 fSlopeSpread = TMath::Sqrt(sumdt2/cnt - sumdt*sumdt/cnt/cnt); 283 fSlopeSpreadWeighted = TMath::Sqrt(sumdt2w2 + (sumw2 - 2*sumdtw2)*sumdtw/sumw)/sumw; 284 285 // 286 // FIXME: Missing Time spread along slope 287 // 287 fSlopeSpread = TMath::Sqrt(sumdt2*cnt - sumdt*sumdt)/cnt; 288 fSlopeSpreadWeighted = TMath::Sqrt(sumdt2w2 + sumw2*sumdtw*sumdtw/sumw/sumw - 2*sumdtw2*sumdtw/sumw)/sumw; 288 289 289 290 // … … 314 315 void MHillasExt::Set(const TArrayF &arr) 315 316 { 316 if (arr.GetSize() != 5)317 if (arr.GetSize() != 9) 317 318 return; 318 319 … … 322 323 fSlopeLong = arr.At(3); 323 324 fSlopeTrans = arr.At(4); 325 326 fTimeSpread = arr.At(5); 327 fTimeSpreadWeighted = arr.At(6); 328 fSlopeSpread = arr.At(7); 329 fSlopeSpreadWeighted = arr.At(8); 324 330 } 325 331 … … 341 347 if (showtrans) 342 348 *fLog << " - Slope Trans [mm] = " << fSlopeTrans << endl; 349 *fLog << " - Time Spread [ns] = " << fTimeSpread << endl; 350 *fLog << " - Slope Spread [ns] = " << fSlopeSpread << endl; 351 *fLog << " - Time Spread W [ns] = " << fTimeSpreadWeighted << endl; 352 *fLog << " - Slope Spread W [ns] = " << fSlopeSpreadWeighted << endl; 343 353 } 344 354 … … 357 367 *fLog << " - Slope Long [mm] = " << fSlopeLong*geom.GetConvMm2Deg() << endl; 358 368 *fLog << " - Slope Trans [mm] = " << fSlopeTrans*geom.GetConvMm2Deg() << endl; 369 *fLog << " - Slope Spread [ns] = " << fSlopeSpread << endl; 370 *fLog << " - Time Spread W [ns] = " << fTimeSpreadWeighted << endl; 371 *fLog << " - Slope Spread W [ns] = " << fSlopeSpreadWeighted << endl; 359 372 } 360 373 -
trunk/Mars/mimage/MHillasExt.h
r9845 r9850 35 35 void Reset(); 36 36 37 Float_t GetAsym() const { return fAsym; } 38 Float_t GetM3Long() const { return fM3Long; } 39 Float_t GetM3Trans() const { return fM3Trans; } 40 Float_t GetSlopeLong() const { return fSlopeLong; } 41 Float_t GetSlopeTrans() const { return fSlopeTrans; } 42 Float_t GetTimeSpread() const { return fTimeSpread; } 43 Float_t GetTimeSpreadWeighted() const { return fTimeSpreadWeighted; } 37 Float_t GetAsym() const { return fAsym; } 38 Float_t GetM3Long() const { return fM3Long; } 39 Float_t GetM3Trans() const { return fM3Trans; } 40 Float_t GetSlopeLong() const { return fSlopeLong; } 41 Float_t GetSlopeTrans() const { return fSlopeTrans; } 42 Float_t GetTimeSpread() const { return fTimeSpread; } 43 Float_t GetTimeSpreadWeighted() const { return fTimeSpreadWeighted; } 44 Float_t GetSlopeSpread() const { return fSlopeSpread; } 45 Float_t GetSlopeSpreadWeighted() const { return fSlopeSpreadWeighted; } 44 46 45 47 Int_t Calc(const MGeomCam &geom, const MSignalCam &pix,
Note:
See TracChangeset
for help on using the changeset viewer.