Changeset 7687 for trunk/MagicSoft/Mars/mtools
- Timestamp:
- 05/03/06 14:13:48 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mtools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc
r7642 r7687 183 183 //------------------------------------------------------------------------ 184 184 // 185 // Function serving AddPreCuts, AddPreTasks and AddPostTasks 186 // 187 void MTFillMatrix::Add(const TList &src, const TClass *cls, TList &dest) 188 { 189 TIter Next(&src); 190 TObject *obj=0; 191 while ((obj=Next())) 192 if (obj->InheritsFrom(cls)) 193 dest.Add(obj); 194 } 195 196 //------------------------------------------------------------------------ 197 // 185 198 // Add a cut which is used to fill the matrix, eg "MMcEvt.fOartId<1.5" 186 199 // (The rule is applied, nit inverted: The matrix is filled with … … 211 224 void MTFillMatrix::AddPreCuts(const TList &list) 212 225 { 213 TIter Next(&list); 214 TObject *obj=0; 215 while ((obj=Next())) 216 if (obj->InheritsFrom(MFilter::Class())) 217 fPreCuts.Add(obj); 226 Add(list, MFilter::Class(), fPreCuts); 227 } 228 229 //------------------------------------------------------------------------ 230 // 231 // Add a task which is executed before the precuts. If kCanDelete is set 232 // MJOptimize takes the ownership. 233 // 234 void MTFillMatrix::AddPreTask(MTask *t) 235 { 236 fPreTasks.Add(t); 237 } 238 239 //------------------------------------------------------------------------ 240 // 241 // Add all entries deriving from MTask from list to PreTasks. 242 // The ownership is not affected. 243 // 244 void MTFillMatrix::AddPreTasks(const TList &list) 245 { 246 Add(list, MTask::Class(), fPreTasks); 247 } 248 249 //------------------------------------------------------------------------ 250 // 251 // Add a task which is executed after the precuts. If kCanDelete is set 252 // MJOptimize takes the ownership. 253 // 254 void MTFillMatrix::AddPostTask(MTask *t) 255 { 256 fPostTasks.Add(t); 257 } 258 259 //------------------------------------------------------------------------ 260 // 261 // Add all entries deriving from MTask from list to PostTasks. 262 // The ownership is not affected. 263 // 264 void MTFillMatrix::AddPostTasks(const TList &list) 265 { 266 Add(list, MTask::Class(), fPostTasks); 218 267 } 219 268 … … 315 364 MFillH fill1(fDestMatrix1); 316 365 MFillH fill2(fDestMatrix2); 317 if (selector) 318 { 319 fill1.SetFilter(&split); 320 fill2.SetFilter(&invsplit); 321 } 366 fill1.SetFilter(&split); 367 fill2.SetFilter(&invsplit); 322 368 323 369 // entries in MTaskList 324 370 tlist.AddToList(fReader); // Read events 371 tlist.AddToList(fPreTasks); // PreTasks 325 372 if (fPreCuts.GetEntries()>0) 326 373 tlist.AddToList(&cont0); // PreCuts … … 328 375 tlist.AddToList(&cont); // select a sample of events 329 376 tlist.AddToList(&invsplit); // process invsplit (which implicitly processes split) 377 tlist.AddToList(fPostTasks); // PostTasks 330 378 if (fDestMatrix1) 331 379 tlist.AddToList(&fill1); // fill matrix 1 -
trunk/MagicSoft/Mars/mtools/MTFillMatrix.h
r7413 r7687 31 31 32 32 TList fPreCuts; 33 TList fPreTasks; 34 TList fPostTasks; 35 36 void Add(const TList &src, const TClass *cls, TList &dest); 33 37 34 38 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); … … 80 84 void AddPreCuts(const TList &list); 81 85 86 void AddPreTask(MTask *t); 87 void AddPreTasks(const TList &list); 88 89 void AddPostTask(MTask *t); 90 void AddPostTasks(const TList &list); 91 82 92 Bool_t Process(const MParList &plist=MParList()); 83 93 Bool_t WriteMatrix1(const TString &fname) const { return WriteMatrix(fDestMatrix1, fname, 1); }
Note:
See TracChangeset
for help on using the changeset viewer.