Changeset 2357 for trunk/MagicSoft/Mars/mfilter
- Timestamp:
- 09/24/03 13:29:00 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mfilter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc
r2206 r2357 188 188 } 189 189 190 *fLog << "-------------------------" << endl; 191 *fLog << "MFEventSelector2::ReadDistribution; read input file to generate the original distribution" << endl; 192 190 193 MEvtLoop run(GetName()); 191 194 MParList plist; … … 215 218 } 216 219 220 tlist.PrintStatistics(0, kTRUE); 221 222 *fLog << "MFEventSelector2::ReadDistribution; Original distribution has " 223 << fHistOrig->GetHist().GetEntries() << " entries" << endl; 224 *fLog << "-------------------------" << endl; 225 217 226 return read.Rewind(); 218 227 } … … 259 268 if (fNumMax>0) 260 269 { 261 cout << "SCALE: " << fNumMax/hn.Integral() << endl; 262 cout << "SCALE: " << fNumMax << endl; 263 cout << "SCALE: " << hn.Integral() << endl; 270 *fLog << "MFEventSelector2::PrepareHistograms; SCALE : fNumMax = " 271 << fNumMax << ", hn.Integral() = " << hn.Integral() 272 << ", fNumMax/hn.Integral() = " << fNumMax/hn.Integral() 273 << endl; 274 264 275 hn.Scale(fNumMax/hn.Integral()); 265 276 } … … 329 340 Int_t MFEventSelector2::PreProcess(MParList *parlist) 330 341 { 342 memset(fErrors, 0, sizeof(fErrors)); 343 331 344 MTaskList *tasklist = (MTaskList*)parlist->FindObject("MTaskList"); 332 345 if (!tasklist) … … 383 396 const Double_t valz=fDataZ.GetValue(); 384 397 398 385 399 // get corresponding bin number 386 400 const Int_t bin = fHistNom->FindFixBin(valx, valy, valz)-1; … … 389 403 if (bin<0) 390 404 return kTRUE; 405 391 406 392 407 if (gRandom->Rndm()*fIs[bin]<=fNom[bin]) … … 404 419 fIs[bin]-=1; 405 420 421 //---------------------- 422 Int_t rc; 423 if (fResult) 424 { 425 rc = 0; 426 fErrors[rc]++; 427 return kTRUE; 428 } 429 rc = 1; 430 fErrors[rc]++; 431 //---------------------- 432 406 433 return kTRUE; 407 434 } … … 413 440 Int_t MFEventSelector2::PostProcess() 414 441 { 442 //--------------------------------- 443 if (GetNumExecutions() != 0) 444 { 445 *fLog << inf << endl; 446 *fLog << GetDescriptor() << " execution statistics:" << endl; 447 *fLog << dec << setfill(' '); 448 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 449 << (int)(fErrors[1]*100/GetNumExecutions()) 450 << "%) Events not selected" << endl; 451 452 *fLog << " " << fErrors[0] << " (" 453 << (int)(fErrors[0]*100/GetNumExecutions()) 454 << "%) Events selected!" << endl; 455 *fLog << endl; 456 } 457 //--------------------------------- 458 415 459 if (!fCanvas || !fDisplay) 416 460 return kTRUE; -
trunk/MagicSoft/Mars/mfilter/MFEventSelector2.h
r2206 r2357 42 42 43 43 Bool_t fResult; 44 Int_t fErrors[2]; 44 45 45 46 TH1 &InitHistogram(MH3* &hist);
Note:
See TracChangeset
for help on using the changeset viewer.