Changeset 7611 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 03/15/06 16:39:37 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCameraData.cc
r7082 r7611 18 18 ! Author(s): Thomas Bretz, 10/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! Author(s): Hendrik Bartko, 08/2004 <mailto:hbartko@mppmu.mpg.de> 20 ! 21 ! Copyright: MAGIC Software Development, 2000-2004 20 ! Author(s): Stefan Ruegamer, 03/2006 <mailto:snruegam@astro.uni-wuerzburg.de> 21 ! 22 ! Copyright: MAGIC Software Development, 2000-2006 22 23 ! 23 24 ! … … 380 381 } 381 382 383 void MCameraData::CalcCleaningArrivalTime(const MSignalCam &evt, const MGeomCam &geom) 384 { 385 const Int_t n = geom.GetNumPixels(); 386 387 // Reset arrays 388 fData.Set(n); 389 fData.Reset(); 390 391 fValidity.Set(n); 392 fValidity.Reset(); 393 394 // check validity of noise 395 const Int_t entries = evt.GetNumPixels(); 396 TArrayD u(6), w(6); 397 TArrayI ii(6); 398 399 for (int i=0; i<entries; i++) 400 { 401 if (evt[i].IsPixelUnmapped()) 402 continue; 403 404 const Double_t t0 = evt[i].GetArrivalTime(); 405 const Double_t s0 = evt[i].GetNumPhotons(); 406 const Double_t r0 = geom.GetPixRatio(i); 407 const Double_t x0 = geom[i].GetX(); 408 const Double_t y0 = geom[i].GetY(); 409 410 const Double_t e0 = s0<0.01 ? 100 : 1./s0; 411 412 const Int_t n2 = geom[i].GetNumNeighbors(); 413 414 Int_t cnt2=0; 415 for (int j=0; j<n2; j++) 416 { 417 Int_t idx = geom[i].GetNeighbor(j); 418 419 if (evt[idx].IsPixelUnmapped()) 420 continue; 421 422 const Double_t tj = evt[idx].GetArrivalTime()-t0; 423 const Double_t sj = evt[idx].GetNumPhotons(); 424 const Double_t rj = geom.GetPixRatio(idx)+r0; 425 const Double_t xj = geom[idx].GetX()-x0; 426 const Double_t yj = geom[idx].GetY()-y0; 427 428 const Double_t d2 = xj*xj+yj*yj; 429 430 const Double_t ej = sj<0.01 ? 100 : 1./sj; 431 432 u[cnt2] = tj*tj/rj; 433 w[cnt2] = 1./(e0+ej)/d2; // TYPE I+II 434 cnt2++; 435 } 436 437 TMath::Sort(cnt2, u.GetArray(), ii.GetArray(), kFALSE); 438 439 Double_t sumt = 0; 440 Double_t sumw = 0; 441 for (int j=0; j<TMath::Min(cnt2, 3); j++) 442 { 443 sumt += u[ii[j]]*w[ii[j]]; 444 sumw += w[ii[j]]; 445 } 446 447 const Double_t wuz = TMath::Sqrt(sumt/sumw); 448 449 if (TMath::IsNaN(wuz)) 450 *fLog << warn << "WARNING - MCameraData " << sumt << " " << sumw << endl; 451 452 Double_t val = s0<0 || TMath::IsNaN(wuz) || wuz<1e-200 ? 0 : s0*r0/wuz; 453 454 if ((s0>0 && wuz<1e-200) || val>100) 455 val=100; 456 457 fData[i] = TMath::Log10(val+1)*5; 458 459 if (TMath::IsNaN(fData[i])) 460 // 0 1e-6 0 NaN 461 *fLog << warn << "WARNING - MCameraData " << sumt << " " << sumw << " " << wuz << " " << val << endl; 462 463 fValidity[i] = 1; 464 } 465 } 466 382 467 // -------------------------------------------------------------------------- 383 468 // -
trunk/MagicSoft/Mars/manalysis/MCameraData.h
r7082 r7611 42 42 const MGeomCam &geom); 43 43 void CalcCleaningAbsolute(const MSignalCam &evt, const MGeomCam &geom); 44 void CalcCleaningArrivalTime(const MSignalCam &evt, const MGeomCam &geom); 44 45 45 46 const TArrayD &GetData() const { return fData; }
Note:
See TracChangeset
for help on using the changeset viewer.