Changeset 1283 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 04/22/02 11:28:38 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MFilterList.cc
r1218 r1283 59 59 TString str(type); 60 60 61 if ( str.CompareTo("OR", TString::kIgnoreCase) ||str.CompareTo("|"))61 if (!str.CompareTo("OR", TString::kIgnoreCase) || !str.CompareTo("|")) 62 62 fFilterType = kEOr; 63 if ( str.CompareTo("XOR", TString::kIgnoreCase) ||str.CompareTo("^"))63 if (!str.CompareTo("XOR", TString::kIgnoreCase) || !str.CompareTo("^")) 64 64 fFilterType = kEXor; 65 if ( str.CompareTo("LAND", TString::kIgnoreCase) ||str.CompareTo("&&"))65 if (!str.CompareTo("LAND", TString::kIgnoreCase) || !str.CompareTo("&&")) 66 66 fFilterType = kELAnd; 67 if ( str.CompareTo("LOR", TString::kIgnoreCase) ||str.CompareTo("||"))67 if (!str.CompareTo("LOR", TString::kIgnoreCase) || !str.CompareTo("||")) 68 68 fFilterType = kELOr; 69 69 } … … 180 180 while ((filter=(MFilter*)Next())) 181 181 if (!filter->PreProcess(pList)) 182 { 183 *fLog << err << "Error - Preprocessing Filter "; 184 *fLog << filter->GetName() << " in " << fName << endl; 182 185 return kFALSE; 186 } 183 187 184 188 return kTRUE; … … 235 239 const Bool_t verbose = str.Contains("V", TString::kIgnoreCase); 236 240 241 //*fLog << all << "(" << GetName() << "=" << (int)fFilterType << ")"; 242 237 243 *fLog << all << "("; 238 244 … … 250 256 } 251 257 252 do 258 filter->Print(); 259 260 while ((filter=(MFilter*)Next())) 253 261 { 254 262 switch (fFilterType) 255 263 { 256 264 case kEAnd: 257 *fLog << (verbose?" and ":" &");265 *fLog << (verbose?" and ":" & "); 258 266 break; 259 267 260 268 case kEOr: 261 *fLog << (verbose?" or ":" |");269 *fLog << (verbose?" or ":" | "); 262 270 break; 263 271 264 272 case kEXor: 265 *fLog << (verbose?" xor ":" ^");273 *fLog << (verbose?" xor ":" ^ "); 266 274 break; 267 275 268 276 case kELAnd: 269 *fLog << (verbose?" land ":" &&");277 *fLog << (verbose?" land ":" && "); 270 278 break; 271 279 272 280 case kELOr: 273 *fLog << (verbose?" lor ":" ||");281 *fLog << (verbose?" lor ":" || "); 274 282 break; 275 283 } 276 284 277 285 filter->Print(); 278 } while ((filter=(MFilter*)Next()));286 } 279 287 280 288 *fLog << ")" << flush; 281 289 } 290 -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1279 r1283 319 319 return rc; 320 320 } 321 322 TMethodCall *MParContainer::GetterMethod(const char *name) const 323 { 324 TClass *cls = IsA()->GetBaseDataMember(name); 325 if (!cls) 326 { 327 *fLog << err << "No (base) class containing '" << name << "'." << endl; 328 return NULL; 329 } 330 331 TDataMember *member = cls->GetDataMember(name); 332 if (!member) 333 { 334 *fLog << err << "Datamember '" << name << "' not in " << GetDescriptor() << endl; 335 return NULL; 336 } 337 338 TMethodCall *call = member->GetterMethod(); 339 if (!call) 340 { 341 *fLog << err << "Sorry, no getter method found for " << name << endl; 342 return NULL; 343 } 344 345 return call; 346 } -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1235 r1283 24 24 25 25 class TDataMember; 26 class TMethodCall; 26 27 27 28 class MParContainer : public TObject … … 66 67 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; } 67 68 69 TMethodCall *GetterMethod(const char *name) const; 70 68 71 Bool_t WriteDataMember(ostream &out, const char *member, Double_t scale=1) const; 69 72 Bool_t WriteDataMember(ostream &out, const TDataMember *member, Double_t scale=1) const; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r1211 r1283 380 380 // 381 381 TClass *cls = gROOT->GetClass(cname); 382 383 382 if (!cls) 384 383 { … … 394 393 // 395 394 pcont = (MParContainer*)cls->New(); 395 if (!pcont) 396 { 397 *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "' (Maybe no def. constructor)" << endl; 398 return NULL; 399 } 396 400 397 401 // … … 424 428 void MParList::Print(Option_t *t) const 425 429 { 426 *fLog << all << GetDescriptor() << endl;430 *fLog << all << " " << GetDescriptor() << endl; 427 431 *fLog << setfill('-') << setw(strlen(GetDescriptor())+2) << "" << endl; 428 432 MParContainer *obj = NULL; … … 572 576 // 573 577 TClass *cls = gROOT->GetClass(cname); 574 575 578 if (!cls) 576 579 { … … 602 605 // 603 606 MParContainer *pcont = (MParContainer*)cls->New(); 607 if (pcont) 608 { 609 gLog << err << dbginf << "Cannot create new instance of class '" << cname << "' (Maybe no def. constructor)" << endl; 610 return list; 611 } 604 612 605 613 // -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r1211 r1283 458 458 // check if object is existing in the list 459 459 // 460 *pcont=pList->FindCreateObj( oname);460 *pcont=pList->FindCreateObj(branch->GetClassName(), oname); 461 461 462 462 if (!*pcont) … … 466 466 // we cannot proceed reading this branch 467 467 // 468 *fLog << warn << dbginf << "Warning: Class '" << oname << "' not existing in dictionary. Branch skipped." << endl; 468 *fLog << warn << dbginf << "Warning: Class '" << branch->GetClassName(); 469 *fLog << "' for " << oname << " not existing in dictionary. Branch skipped." << endl; 469 470 DisableSubBranches(branch); 470 471 continue; … … 484 485 // 485 486 fChain->SetBranchAddress(bname, pcont); 486 *fLog << inf << "Master branch address " << bname << " setup for reading." << endl; 487 488 *fLog << inf << "Master branch address " << bname << " ["; 489 *fLog << branch->GetClassName() << "] setup for reading." << endl; 487 490 488 491 //*fLog << "Branch " << bname << " autodel: " << (int)branch->IsAutoDelete() << endl; … … 568 571 // 569 572 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06) 570 //#include "../mraw/MRawEvtData.h"571 573 #include "MRawEvtData.h" 572 574 #endif -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1280 r1283 58 58 59 59 #include <TClass.h> 60 #include <TBaseClass.h> 60 61 #include <TOrdCollection.h> 61 62 … … 259 260 // -------------------------------------------------------------------------- 260 261 // 262 // Check whether this task (or one of it's base classes) overloads 263 // MTask::Process. Only if this function is overloaded this task is 264 // added to the fTaskProcess-List. This makes the execution of the 265 // tasklist a little bit (only a little bit) faster, bacause tasks 266 // doing no Processing are not Processed. 267 // 268 Bool_t MTaskList::CheckClassForProcess(TClass *cls) 269 { 270 // 271 // Check whether the class itself overloads the Process function 272 // 273 if (cls->GetName()=="MTask") 274 return kFALSE; 275 276 if (cls->GetMethodAny("Process")) 277 return kTRUE; 278 279 // 280 // If the class itself doesn't overload it check all it's base classes 281 // 282 TBaseClass *base=NULL; 283 TIter NextBase(cls->GetListOfBases()); 284 while ((base=(TBaseClass*)NextBase())) 285 { 286 if (CheckClassForProcess(base->GetClassPointer())) 287 return kTRUE; 288 } 289 290 return kFALSE; 291 } 292 293 // -------------------------------------------------------------------------- 294 // 261 295 // do pre processing (before eventloop) of all tasks in the task-list 262 296 // 263 #include <TMethod.h>264 #include <TBaseClass.h>265 297 Bool_t MTaskList::PreProcess(MParList *pList) 266 298 { … … 283 315 while ((task=(MTask*)Next())) 284 316 { 285 *fLog << all << task->GetName() << "... " << flush; 286 287 // 288 // Check whether this task (or one of it's base classes) overloads 289 // MTask::Process. Only if this function is overloaded this task is 290 // added to the fTaskProcess-List. This makes the execution of the 291 // tasklist a little bit (only a little bit) faster, bacause tasks 292 // doing no Processing are not Processed. 293 // 294 TBaseClass *cls=NULL; 295 TIter NextBase(task->IsA()->GetListOfBases()); 296 while ((cls=(TBaseClass*)NextBase())) 297 { 298 if (cls->GetName()=="MTask") 299 break; 300 301 if (!cls->GetClassPointer()->GetMethodAny("Process")) 302 continue; 303 317 if (CheckClassForProcess(task->IsA())) 304 318 fTasksProcess.Add(task); 305 break;306 }307 319 308 320 // -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1269 r1283 30 30 enum { kIsOwner = BIT(14) }; 31 31 32 void Remove(MTask *task); 32 void Remove(MTask *task); 33 Bool_t CheckClassForProcess(TClass *cls); 33 34 34 35 public:
Note:
See TracChangeset
for help on using the changeset viewer.