Changeset 5690 for trunk/MagicSoft/Mars/mfbase
- Timestamp:
- 12/27/04 13:13:32 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mfbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfbase/MFEventSelector2.cc
r5667 r5690 116 116 #include "MH3.h" // MH3 117 117 #include "MRead.h" // MRead 118 //#include "MProgressBar.h" //119 118 #include "MEvtLoop.h" // MEvtLoop 120 119 #include "MTaskList.h" // MTaskList … … 158 157 // events outside these ranges won't be accepted). 159 158 // 159 // Set default name of filter to be applied when determining the original 160 // distribution for all data on the input file to "FilterSelector2" 161 // 160 162 MFEventSelector2::MFEventSelector2(MH3 &hist, const char *name, const char *title) 161 : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL), 162 fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')), 163 fDataZ(hist.GetRule('z')), fNumMax(-1), fHistIsProbability(kFALSE), 164 fUseOrigDist(kTRUE) 163 : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL), 164 fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')), 165 fDataZ(hist.GetRule('z')), fNumMax(-1), fCanvas(0), 166 fFilterName("FilterSelector2"), fHistIsProbability(kFALSE), 167 fUseOrigDist(kTRUE) 165 168 { 166 169 fName = name ? (TString)name : gsDefName; 167 170 fTitle = title ? (TString)title : gsDefTitle; 168 169 // name of filter to be applied when determining the original distribution170 // for all data on the input file171 fFilterName = "FilterSelector2";172 171 } 173 172 … … 216 215 } 217 216 218 *fLog << inf << underline << endl; 219 *fLog << "MFEventSelector2::ReadDistribution:" << endl; 220 *fLog << "**********************" << endl; 221 *fLog << " - Start of eventloop to generate the original distribution..." 222 << endl; 217 *fLog << inf; 218 fLog->Separator("MFEventSelector2::ReadDistribution"); 219 *fLog << " - Start of eventloop to generate the original distribution..." << endl; 223 220 224 221 if (filter != NULL) 225 { 226 *fLog << " filter used : " << filter->GetName() 227 << endl; 228 } 222 *fLog << " - filter used: " << filter->GetDescriptor() << endl; 229 223 230 224 231 225 MEvtLoop run("ReadDistribution"); 232 //MProgressBar bar;233 //run.SetProgressBar(&bar);234 226 235 227 MParList plist; … … 264 256 if (!run.Eventloop()) 265 257 { 266 *fLog << err << dbginf 267 << "Evtloop in MFEventSelector2::ReadDistribution failed." 268 << endl; 269 return kFALSE; 270 } 271 272 tlist.PrintStatistics(0, kTRUE); 258 *fLog << err << dbginf << "Evtloop failed... abort." << endl; 259 return kFALSE; 260 } 261 262 tlist.PrintStatistics(); 273 263 274 264 *fLog << inf; 275 265 *fLog << "MFEventSelector2::ReadDistribution:" << endl; 276 *fLog << " - Original distribution has " 277 << fHistOrig->GetHist().GetEntries() << " entries." << endl; 278 *fLog << " - End of eventloop to generate the original distribution." 279 << endl; 280 *fLog << "**********************" << endl; 266 *fLog << " - Original distribution has " << fHistOrig->GetHist().GetEntries() << " entries." << endl; 267 *fLog << " - End of eventloop to generate the original distribution." << endl; 268 fLog->Separator(); 281 269 282 270 return read.Rewind(); … … 447 435 if (!read) 448 436 { 449 *fLog << err << "MRead not found ... abort." << endl;437 *fLog << err << "MRead not found in tasklist... abort." << endl; 450 438 return kFALSE; 451 439 } 452 440 453 441 MFilter *filter = (MFilter*)tasklist->FindObject(fFilterName); 454 if (!filter) 455 { 456 *fLog << inf 457 << "No filter will be used when making the original distribution" 458 << endl; 459 filter = NULL; 460 } 461 442 if (!filter || !filter->InheritsFrom(MFilter::Class())) 443 { 444 *fLog << inf << "No filter will be used when making the original distribution" << endl; 445 filter = NULL; 446 } 462 447 463 448 if (!ReadDistribution(*read, filter)) 464 449 return kFALSE; 465 466 450 467 451 // Prepare histograms and arrays for selection 468 452 PrepareHistograms(); 469 453 470 *fLog << "MFEventSelector2::PreProcess; call PreProcess() for read and filter object again" 471 << endl; 472 Int_t rcr = read->CallPreProcess(parlist); 473 Int_t rcf = filter->CallPreProcess(parlist); 474 475 *fLog << "rcr, rcf = " << rcr << ", " << rcf << endl; 476 477 return rcf*rcr; 454 *fLog << all << "PreProcess..." << flush; 455 const Int_t rcf = filter->CallPreProcess(parlist); 456 if (rcf!=kTRUE) 457 return rcf; 458 459 const Int_t rcr = read->CallPreProcess(parlist); 460 return rcr; 478 461 } 479 462 -
trunk/MagicSoft/Mars/mfbase/MFEventSelector2.h
r5667 r5690 41 41 TCanvas *fCanvas; //! canvas for online display 42 42 43 TString fFilterName; // name of the MFilter object to be used 44 // when determining the original distribution 43 TString fFilterName; // name of the MFilter object to be used when determining the original distribution 45 44 46 45 Bool_t fResult; 47 46 Bool_t fHistIsProbability; 48 Bool_t fUseOrigDist; // flag indicating that in the selection the 49 // original distribution is not changed 47 Bool_t fUseOrigDist; // flag indicating that in the selection the original distribution is not changed 50 48 51 49 Int_t fCounter[3];
Note:
See TracChangeset
for help on using the changeset viewer.