Changeset 14176 for fact/tools/marsmacros
- Timestamp:
- 06/13/12 17:10:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/marsmacros/singlepe.C
r14170 r14176 199 199 MBinning binsx, binsy; 200 200 binsx.SetEdges(fSingles->GetNumPixels(), -0.5, fSingles->GetNumPixels()-0.5); 201 binsy.SetEdges( 300, -7.5*w,(60-7.5)*w);201 binsy.SetEdges(2*150, -2*7.5*w, 2*(60-7.5)*w); 202 202 203 203 MH::SetBinning(fSignal, binsx, binsy); … … 283 283 MSingles *fSingles; 284 284 285 TH1F *fluct1 = new TH1F("", "", 100, -50, 50);285 TH1F *fluct1 = new TH1F("", "", 200, -200, 200); 286 286 TH1F *fluct2 = new TH1F("", "", 100, -50, 50); 287 287 … … 322 322 const UInt_t end_skip = 10; 323 323 const UInt_t integration_size = 10*3; 324 const UInt_t max_search_window = 30; 324 325 325 326 vector<float> val(roi-navg);//result of first sliding average … … 341 342 342 343 //peak finding via threshold 343 for (UInt_t i=start_skip; i<roi-navg-end_skip- 10; i++)344 for (UInt_t i=start_skip; i<roi-navg-end_skip-30; i++) 344 345 { 345 346 //search for threshold crossings … … 352 353 353 354 //search for maximum after threshold crossing 354 UInt_t k_max = 0;355 for (UInt_t k=i ; k<i+15 && k < roi-navg-end_skip-10; k++)355 UInt_t k_max = i+5; 356 for (UInt_t k=i+5; k<i+max_search_window; k++) 356 357 { 357 if (val[k +1] > val[k])358 if (val[k] > val[k_max]) 358 359 k_max = k; 359 360 } 360 361 362 if (k_max == i+5 || k_max == i + max_search_window-1) continue; 363 361 364 //search for half maximum before maximum 362 365 UInt_t k_half_max = 0; 363 for (UInt_t k=k_max; k>k_max-2 0; k--)366 for (UInt_t k=k_max; k>k_max-25; k--) 364 367 { 365 368 if (val[k-1] < val[k_max]/2 && … … 367 370 { 368 371 k_half_max = k; 372 break; 369 373 } 370 374 } 371 375 if (k_half_max > roi-navg-end_skip-max_search_window - integration_size) 376 continue; 377 if (k_half_max == 0) 378 continue; 379 if (k_max - k_half_max > 14) 380 continue; 381 382 fluct2->Fill(k_max - k_half_max); 372 383 373 384 // Evaluate arrival time more precisely!!! … … 378 389 single.fTime = k_half_max; 379 390 391 380 392 // Crossing of the threshold is at 5 381 393 for (UInt_t j=k_half_max; j<k_half_max+integration_size; j++) 382 394 single.fSignal += ptr[j]; 383 384 395 result.push_back(single); 385 396
Note:
See TracChangeset
for help on using the changeset viewer.