Changeset 7867 for trunk/MagicSoft/Mars/mhist/MHCamera.cc
- Timestamp:
- 08/08/06 17:51:35 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r7829 r7867 84 84 85 85 #include "MArrayD.h" 86 #include "MMath.h" // MMath::GaussProb 86 87 87 88 #define kItemsLegend 48 // see SetPalette(1,0) … … 312 313 for (Int_t idx=0; idx<fNcells-2; idx++) 313 314 arr[idx] ? SetUsed(idx) : ResetUsed(idx); 315 } 316 317 // ------------------------------------------------------------------------ 318 // 319 // Return the median value on the y-axis (profile option is correctly taken 320 // into account) 321 // 322 Stat_t MHCamera::GetMedian() const 323 { 324 // Just for speed reasons 325 if (!TestBit(kProfile)) 326 return TMath::Median(GetSize()-2, GetArray()+1); 327 328 // Copy profiled data into new array (FIXME: Should we take errors into account?) 329 TArrayD arr(fNcells-2); 330 for (int i=1; i<fNcells-1; i++) 331 arr[i-1] = GetBinContent(i); 332 333 // return Median of the profile data 334 return TMath::Median(arr.GetSize(), arr.GetArray()); 335 } 336 337 // ------------------------------------------------------------------------ 338 // 339 // Return the median value (divided by MMath::GausProb(1.0)) of the 340 // distribution of abs(y[i]-Median). This is my Median equivalent of the RMS 341 // 342 Stat_t MHCamera::GetMedianDev() const 343 { 344 // Just for speed reasons 345 if (!TestBit(kProfile)) 346 return MMath::MedianDev(GetSize()-2, GetArray()+1); 347 348 // Copy profiled data into new array (FIXME: Should we take errors into account?) 349 TArrayD arr(fNcells-2); 350 for (int i=1; i<fNcells-1; i++) 351 arr[i-1] = GetBinContent(i); 352 353 // return MedianDev of the profile data 354 return MMath::MedianDev(arr.GetSize(), arr.GetArray())/MMath::GaussProb(1.0); 314 355 } 315 356
Note:
See TracChangeset
for help on using the changeset viewer.