Changeset 666 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 03/02/01 12:48:15 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParList.cc
r652 r666 18 18 19 19 #include <TNamed.h> 20 #include <TClass.h> 20 21 21 22 #include "MLog.h" … … 111 112 } 112 113 114 MParContainer *MParList::FindCreateObj(const char *name) 115 { 116 // 117 // Find an object in the list. 118 // 'name' is the name of the object you are searching for. 119 // If the object doesn't exist we try to create one from the 120 // dictionary. If this isn't possible NULL is returned 121 // 122 MParContainer *pcont = (MParContainer*)FindObject(name); 123 124 if (pcont) 125 return pcont; 126 127 // 128 // if object is not existing in the list try to create one 129 // 130 *fLog << "MParList::CreateObject - Warning: '" << name << "' not found... creating." << endl; 131 132 // 133 // try to get class from root environment 134 // 135 TClass *cls = gROOT->GetClass(name); 136 137 if (!cls) 138 { 139 // 140 // if class is not existing in the root environment 141 // 142 *fLog << "MParList::CreateObject - Warning: Class '" << name << "' not existing in dictionary." << endl; 143 return NULL; 144 } 145 146 // 147 // create the container and add it to the list 148 // 149 pcont = (MParContainer*)cls->New(); 150 AddToList(pcont); 151 152 // 153 // Find an object in the list. 154 // 'name' is the name of the object you are searching for. 155 // 156 return pcont; 157 } 113 158 114 159 void MParList::Print(Option_t *t) -
trunk/MagicSoft/Mars/mbase/MParList.h
r652 r666 40 40 void SetLogStream(MLog *log); 41 41 42 TObject *FindObject(const char *name) const; 42 TObject *FindObject(const char *name) const; 43 MParContainer *FindCreateObj(const char *name); 43 44 44 45 void Print(Option_t *t = NULL); -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r659 r666 101 101 // check if object is existing in the list 102 102 // 103 MParContainer *pcont = (MParContainer*)pList->FindObject(name);103 MParContainer *pcont = pList->FindCreateObj(name); 104 104 105 105 if (!pcont) 106 106 { 107 107 // 108 // if object is not existing in the list try to create one 108 // if class is not existing in the (root) environment 109 // we cannot proceed reading this branch 109 110 // 110 *fLog << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl; 111 112 // 113 // try to get class from root environment 114 // 115 TClass *cls = gROOT->GetClass(name); 116 117 if (!cls) 118 { 119 // 120 // if class is not existing in the root environment 121 // we cannot proceed reading this branch 122 // 123 *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl; 124 continue; 125 } 126 127 // 128 // create the container and add it to the list 129 // 130 pcont = (MParContainer*)cls->New(); 131 *fLog << pcont << endl; 132 pList->AddToList(pcont); 111 *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl; 112 continue; 133 113 } 134 114
Note:
See TracChangeset
for help on using the changeset viewer.