Changeset 7670 for trunk/MagicSoft/Mars/mjtrain
- Timestamp:
- 04/30/06 19:16:08 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc
r7669 r7670 90 90 TH2D res2(g); 91 91 92 h.SetTitle("Hadronness-Distribution vs. Size"); 92 93 res1.SetTitle("Significance Li/Ma"); 93 94 res2.SetTitle("Significance Li/Ma * log_{10}(excess)"); … … 351 352 } 352 353 353 Bool_t MJTrainSeparation::AutoTrain( )354 Bool_t MJTrainSeparation::AutoTrain(MDataSet &set, UInt_t &seton, UInt_t &setoff) 354 355 { 355 356 Double_t num, min, max; 356 if (!GetEventsProduced( fDataSetTrain, num, min, max))357 if (!GetEventsProduced(set, num, min, max)) 357 358 return kFALSE; 358 359 … … 386 387 // With an average data rate after star of 387 388 Double_t data=0; 388 const Double_t r = GetDataRate( fDataSetTrain, data); //[Hz]389 const Double_t r = GetDataRate(set, data); //[Hz] 389 390 390 391 *fLog << "Events measured per second effective on time: " << r << "Hz" << endl; 392 *fLog << "Total effective on time: " << data/r << endl; 391 393 392 394 // this yields a number of n events to be read for training … … 399 401 return kFALSE; 400 402 401 Double_t nummc = GetNumMC( fDataSetTrain);403 Double_t nummc = GetNumMC(set); 402 404 403 405 *fLog << "Events available in MC sample: " << nummc << endl; … … 419 421 } 420 422 421 if ( fNumTrainOn>0 && fNumTrainOn<on)422 { 423 fNumTrainOff = TMath::Nint(off*fNumTrainOn/on);424 *fLog << "Less MC events requested... scaling by " << fNumTrainOn/on << endl;423 if (seton>0 && seton<on) 424 { 425 setoff = TMath::Nint(off*seton/on); 426 *fLog << "Less MC events requested... scaling by " << seton/on << endl; 425 427 } 426 428 else 427 429 { 428 fNumTrainOn = TMath::Nint(on); 429 fNumTrainOff = TMath::Nint(off); 430 } 431 432 *fLog << "Target number of MC events: " << fNumTrainOn << endl; 433 *fLog << "Target number of data events: " << fNumTrainOff << endl; 434 435 fNumTestOn = fNumTrainOn; 436 fNumTestOff = fNumTrainOff; 430 seton = TMath::Nint(on); 431 setoff = TMath::Nint(off); 432 } 433 434 *fLog << "Target number of MC events: " << seton << endl; 435 *fLog << "Target number of data events: " << setoff << endl; 437 436 438 437 /* … … 470 469 471 470 if (fAutoTrain) 472 if (!AutoTrain()) 471 { 472 fLog->Separator("Auto-Training -- Train-Data"); 473 if (!AutoTrain(fDataSetTrain, fNumTrainOn, fNumTrainOff)) 473 474 return kFALSE; 475 fLog->Separator("Auto-Training -- Test-Data"); 476 if (!AutoTrain(fDataSetTest, fNumTestOn, fNumTestOff)) 477 return kFALSE; 478 } 474 479 475 480 // --------------------- Setup files --------------------
Note:
See TracChangeset
for help on using the changeset viewer.