Changeset 1108 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 12/11/01 15:22:10 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MGList.cc
r1105 r1108 167 167 // - The picture is freed as often as it was retrieved from gClient 168 168 // 169 void MGList::AddPicture(const TGPicture *pic )169 void MGList::AddPicture(const TGPicture *pic, const char *name) 170 170 { 171 171 // … … 174 174 if (!pic) 175 175 { 176 cout << "Warning: Requested picture not found... ignored." << endl; 176 cout << "Warning: Requested picture '" << name << "' not found... ignored." << endl; 177 cout << " Please copy " << name << " to $HOME or $HOME/icons or add" << endl; 178 cout << " Unix.*.Gui.IconPath: ~/Path/To/The/Picture" << endl; 179 cout << " to [$HOME/].rootrc." << endl; 177 180 return; 178 181 } … … 199 202 { 200 203 const TGPicture *pic = gClient->GetPicture(name); 201 AddPicture(pic );204 AddPicture(pic, name); 202 205 return pic; 203 206 } … … 218 221 { 219 222 const TGPicture *pic = gClient->GetPicture(name, width, height); 220 AddPicture(pic );223 AddPicture(pic, name); 221 224 return pic; 222 225 } -
trunk/MagicSoft/Mars/mbase/MGList.h
r1086 r1108 15 15 Bool_t IsExisting(TObject *obj) const; 16 16 17 void AddPicture(const TGPicture *pic );17 void AddPicture(const TGPicture *pic, const char *name); 18 18 19 19 public: -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r1085 r1108 149 149 Bool_t MReadTree::Notify() 150 150 { 151 fNotify->ForEach(TObject, Notify)(); 151 // 152 // FIXME: This is correct! 153 // 154 // fNotify->ForEach(TObject, Notify)(); 155 156 fTaskList->ReInit(); 157 152 158 return kTRUE; 153 159 } … … 209 215 // -------------------------------------------------------------------------- 210 216 // 217 // Set branch status of branch name 218 // 219 void MReadTree::SetBranchStatus(const char *name, Bool_t status) 220 { 221 fChain->SetBranchStatus(name, status); 222 223 *fLog << inf << (status ? "Enabled" : "Disabled"); 224 *fLog << " subbranch '" << name << "'." << endl; 225 } 226 227 // -------------------------------------------------------------------------- 228 // 211 229 // Checks whether a branch with the given name exists in the chain 212 230 // and sets the branch status of this branch corresponding to status. … … 222 240 // Check whether this branch really exists 223 241 // 224 if (!fChain->GetBranch(name)) 242 if (fChain->GetBranch(name)) 243 SetBranchStatus(name, status); 244 245 // 246 // Remove trailing '.' if one and try to enable the subbranch without 247 // the master barnch name. This is to be compatible with older mars 248 // and camera files. 249 // 250 const char *dot = strrchr(name, '.'); 251 if (!dot) 225 252 return; 226 253 227 // 228 // Set the branch status 229 // 230 fChain->SetBranchStatus(name, status); 231 *fLog << inf << (status ? "Enabled" : "Disabled"); 232 *fLog << " subbranch '" << name << "'." << endl; 254 if (fChain->GetBranch(dot+1)) 255 SetBranchStatus(dot+1, kTRUE); 233 256 } 234 257 … … 265 288 // check whether branch choosing must be switched on 266 289 // 267 EnableBranchChoosing();290 //EnableBranchChoosing(); 268 291 269 292 // … … 324 347 Bool_t MReadTree::PreProcess(MParList *pList) 325 348 { 349 fTaskList = (MTaskList*)pList->FindObject("MTaskList"); 350 326 351 // 327 352 // get number of events in this tree -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r1086 r1108 8 8 class TChain; 9 9 class TBranch; 10 class MTaskList; 10 11 class TGProgressBar; 11 12 … … 24 25 TList *fNotify; // List of TObjects to notify when switching files 25 26 27 MTaskList *fTaskList; //! Tasklist for reinitialization 26 28 TGProgressBar *fProgress; //! Possible display of status 27 29 28 30 void SetBranchStatus(const TList *list, Bool_t status); 29 31 void SetBranchStatus(TObject *branch, Bool_t status); 32 void SetBranchStatus(const char *name, Bool_t status); 30 33 31 34 void DisableSubBranches(TBranch *b); -
trunk/MagicSoft/Mars/mbase/MTask.cc
r1086 r1108 100 100 // recommended method is to call this function for exactly all 101 101 // branches you want to have, eg: 102 // AddToBranchList("MMcTrig.fNumFirstLevel"); 102 103 // AddToBranchList("MMcTrig;1.fNumFirstLevel"); 103 104 // AddToBranchList("MMcTrig;2.fNumFirstLevel"); … … 181 182 // -------------------------------------------------------------------------- 182 183 // 184 // This is reinit function 185 // 186 // This function is called asynchronously if the tasks in the tasklist need 187 // reinitialization. This for example happens when the eventloop switches 188 // from one group of events to another one (eg. switching between events 189 // of different runs means reading a new run header and a new run header 190 // may mean that some value must be reinitialized) 191 // 192 // the virtual implementation returns kTRUE 193 // 194 Bool_t MTask::ReInit(MParList *pList) 195 { 196 return kTRUE; 197 } 198 199 // -------------------------------------------------------------------------- 200 // 183 201 // This is processed before the eventloop starts 184 202 // -
trunk/MagicSoft/Mars/mbase/MTask.h
r1084 r1108 74 74 UInt_t GetNumExecutions() { return fNumExecutions; } 75 75 76 virtual Bool_t ReInit(MParList *pList); 77 76 78 virtual Bool_t CallPreProcess(MParList *plist); 77 79 virtual Bool_t CallProcess(); -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1086 r1108 214 214 // -------------------------------------------------------------------------- 215 215 // 216 // do reinit of all tasks in the task-list 217 // 218 Bool_t MTaskList::ReInit(MParList *pList) 219 { 220 *fLog << all << "Reinit... " << flush; 221 222 // 223 // create the Iterator over the tasklist 224 // 225 TIter Next(fTasks); 226 227 MTask *task=NULL; 228 229 // 230 // loop over all tasks for preproccesing 231 // 232 while ((task=(MTask*)Next())) 233 { 234 *fLog << all << task->GetName() << "... " << flush; 235 236 if (!task->ReInit(pList?fParList:pList)) 237 return kFALSE; 238 } 239 240 *fLog << all << endl; 241 242 return kTRUE; 243 } 244 245 // -------------------------------------------------------------------------- 246 // 216 247 // do pre processing (before eventloop) of all tasks in the task-list 217 248 // -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1083 r1108 42 42 TObject *FindObject(const TObject *obj) const; 43 43 44 Bool_t ReInit(MParList *pList=NULL); 45 44 46 Bool_t PreProcess(MParList *pList); 45 47 Bool_t Process(); -
trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
r1086 r1108 286 286 // The containers should be written in Splitlevel=1 287 287 // 288 branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress()); 288 TString branchname(cname); 289 branchname.Append("."); 290 branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress()); 289 291 290 292 *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
Note:
See TracChangeset
for help on using the changeset viewer.