Changeset 14913 for trunk/Mars/mmuon
- Timestamp:
- 02/13/13 10:48:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mmuon/MMuonSearchPar.cc
r14896 r14913 295 295 296 296 //SetReadyToSave(); 297 } 298 299 Bool_t MMuonSearchPar::CalcFact(const MGeomCam &geom, const MSignalCam &evt) 300 { 301 // ===================== Reset cleaning ====================== 302 303 for (UInt_t idx=0; idx<evt.GetNumPixels(); idx++) 304 { 305 MSignalPix &pix = evt[idx]; 306 if (pix.IsPixelUnmapped()) 307 continue; 308 309 pix.SetPixelUnused(); 310 pix.SetPixelCore(kFALSE); 311 } 312 313 // ============ Do muon cleaning / calculate COG ============= 314 315 // The window must be large enough that the earliest and latest 316 // events do not get a biased timerms 317 double time_min = -19.5; 318 double time_max = -4.5; 319 double signal_min = 2.30; 320 double delta_t = 1.75; 321 322 Double_t sumx = 0.; 323 Double_t sumy = 0.; 324 Double_t sumw = 0.; 325 for (UInt_t i=0; i<evt.GetNumPixels(); i++) 326 { 327 MSignalPix &pix = evt[i]; 328 329 if (pix.GetNumPhotons()<signal_min) 330 continue; 331 if (pix.GetArrivalTime()>=time_max || pix.GetArrivalTime()<time_min) 332 continue; 333 if (pix.IsPixelUnmapped()) 334 continue; 335 336 const MGeom &gpix = geom[i]; 337 338 const double x = gpix.GetX(); 339 const double y = gpix.GetY(); 340 341 int counter = 0; 342 for (int j=0; j<gpix.GetNumNeighbors(); j++) 343 { 344 const int idx = gpix.GetNeighbor(j); 345 346 const MSignalPix &spix = evt[idx]; 347 348 if (spix.GetNumPhotons()<signal_min) 349 continue; 350 if (spix.GetArrivalTime()>=time_max || spix.GetArrivalTime()<time_min) 351 continue; 352 if (spix.IsPixelUnmapped()) 353 continue; 354 355 if (TMath::Abs(pix.GetArrivalTime()-spix.GetArrivalTime())>delta_t) 356 continue; 357 358 counter++; 359 } 360 361 if (counter==0) 362 continue; 363 364 sumx += pix.GetNumPhotons()*x; 365 sumy += pix.GetNumPhotons()*y; 366 sumw += pix.GetNumPhotons(); 367 368 pix.SetPixelUsed(); 369 pix.SetPixelCore(); 370 } 371 372 if (sumw==0) 373 return kFALSE; 374 375 sumx /= sumw; 376 sumy /= sumw; 377 378 // ============== Fit circle to resulting data =============== 379 380 Double_t sigma, rad; 381 CalcMinimumDeviation(geom, evt, sumx, sumy, sigma, rad); 382 383 fCenterX = sumx; 384 fCenterY = sumy; 385 fRadius = rad; 386 fDeviation = sigma; 387 388 return kTRUE; 389 } 297 } 390 298 391 299 void MMuonSearchPar::Print(Option_t *) const
Note:
See TracChangeset
for help on using the changeset viewer.