Changeset 7130 for trunk/MagicSoft/Mars/mtools
- Timestamp:
- 06/03/05 18:02:36 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc
r2744 r7130 109 109 Bool_t MTFillMatrix::CheckResult(MHMatrix *m, Int_t num) const 110 110 { 111 if (!m )111 if (!m || num==0) 112 112 return kTRUE; 113 113 … … 190 190 fLog->Separator(GetDescriptor()); 191 191 *fLog << "Fill " << fDestMatrix1->GetDescriptor() << " with " << fNumDestEvents1 << endl; 192 *fLog << "Fill " << fDestMatrix2->GetDescriptor() << " with " << fNumDestEvents2 << endl; 192 if (fDestMatrix2) 193 *fLog << "Fill " << fDestMatrix2->GetDescriptor() << " with " << fNumDestEvents2 << endl; 193 194 *fLog << "Distribution choosen "; 194 195 if (fReference && fReference->GetHist().GetEntries()>0) … … 210 211 // FIXME: Merge MFEventSelector and MFEventSelector2 211 212 MFilter *selector=0; 212 if (fReference) 213 { 214 // Case of a reference/nominal distribution 215 // The events must be read before selection 216 MFEventSelector2 *sel = new MFEventSelector2(*fReference); 217 sel->SetNumMax(fNumDestEvents1+fNumDestEvents2); 218 sel->SetInverted(); 219 220 selector = sel; 221 } 222 else 223 { 224 // Case of a random distribution 225 // The events can be selected before reading 226 MFEventSelector *sel = new MFEventSelector; 227 sel->SetNumSelectEvts(fNumDestEvents1+fNumDestEvents2); 228 fReader->SetSelector(sel); 229 230 selector = sel; 213 if (fNumDestEvents1>0 || fNumDestEvents2>0) 214 { 215 if (fReference) 216 { 217 // Case of a reference/nominal distribution 218 // The events must be read before selection 219 MFEventSelector2 *sel = new MFEventSelector2(*fReference); 220 sel->SetNumMax(fNumDestEvents1+fNumDestEvents2); 221 sel->SetInverted(); 222 223 selector = sel; 224 } 225 else 226 { 227 // Case of a random distribution 228 // The events can be selected before reading 229 MFEventSelector *sel = new MFEventSelector; 230 sel->SetNumSelectEvts(fNumDestEvents1+fNumDestEvents2); 231 fReader->SetSelector(sel); 232 233 selector = sel; 234 } 231 235 } 232 236 … … 256 260 MFillH fill1(fDestMatrix1); 257 261 MFillH fill2(fDestMatrix2); 258 fill1.SetFilter(&split); 259 fill2.SetFilter(&invsplit); 262 if (selector) 263 { 264 fill1.SetFilter(&split); 265 fill2.SetFilter(&invsplit); 266 } 260 267 261 268 // entries in MTaskList 262 269 tlist.AddToList(fReader); // Read events 263 if (fReference )270 if (fReference && selector) 264 271 tlist.AddToList(&cont); // select a sample of events 265 272 tlist.AddToList(&invsplit); // process invsplit (which implicitly processes split) 266 if (fDestMatrix1 && fNumDestEvents1>0)273 if (fDestMatrix1) 267 274 tlist.AddToList(&fill1); // fill matrix 1 268 if (fDestMatrix2 && fNumDestEvents2>0)275 if (fDestMatrix2) 269 276 tlist.AddToList(&fill2); // fill matrix 2 270 277 if (fWriteFile1) … … 289 296 const Bool_t rc = evtloop.Eventloop(); 290 297 291 // Print execution statistics of the tasklist 292 if (rc) 293 tlist.PrintStatistics(); 294 295 delete selector; 298 if (selector) 299 delete selector; 296 300 297 301 if (!rc)
Note:
See TracChangeset
for help on using the changeset viewer.