//_________________________________________________________________ void KVGVList::FillN(KVEvent* r) { // Calls FillN(KVEvent*) method of all N-body variables in the list TObjLink* lnk = fVGN.FirstLink(); while (lnk) { KVVarGlob* vg = (KVVarGlob*) lnk->GetObject(); vg->FillN(r); lnk = lnk->Next(); } }
//________________________________________________________ void GFHistManager::DrawObjects(Int_t layer, Int_t histNo) { // histNo starting at '0' // We must already be in the correct pad, layer and histNo must exist if(fObjLists && layer <= fObjLists->GetLast() && fObjLists->At(layer)){ TObjArray* layerLists = static_cast<TObjArray*>(fObjLists->At(layer)); if(histNo <= layerLists->GetLast() && layerLists->At(histNo)){ TObjLink *lnk = static_cast<TList*>(layerLists->At(histNo))->FirstLink(); while (lnk) { lnk->GetObject()->Draw(lnk->GetOption()); lnk = lnk->Next(); } } } }
//______________________________________________________________________________ Int_t THaCutList::RemoveBlock( const char* block ) { // Remove all cuts contained in the named block. THaNamedList* plist = FindBlock( block ); if( !plist ) return -1; Int_t i = 0; TObjLink* lnk = plist->FirstLink(); while( lnk ) { THaCut* pcut = static_cast<THaCut*>( lnk->GetObject() ); if( pcut ) i++; lnk = lnk->Next(); fCuts->Remove( pcut ); } plist->Delete(); // this should delete all pcuts fBlocks->Remove( plist ); delete plist; return i; }
//_____________________________________________________________________________ TObject* THaRTTI::FindRealDataVar( TList* lrd, TString& var ) { // Search list of TRealData 'lrd' for a variable named 'var', // stripping pointer prefixes "*" and array subscripts. // Return corresponding TRealData entry if found, else NULL. // Protected function used by Find(). TObjLink* lnk = lrd->FirstLink(); while (lnk) { TObject* obj = lnk->GetObject(); TString name( obj->GetName() ); name = name.Strip( TString::kLeading, '*' ); Ssiz_t i = name.Index( '[' ); if( i != kNPOS ) name = name(0,i); if( name == var ) return obj; lnk = lnk->Next(); } return NULL; }
//_______________________________________________________________________ Int_t ProcFileElements::Add(Long64_t fst, Long64_t lst) { // Add a new element to the list // Return 1 if a new element has been added, 0 if it has been merged // with an existing one, -1 in case of error if (!fElements) fElements = new TSortedList; if (!fElements) { Error("Add", "could not create internal list!"); return -1; } // Create (temporary element) ProcFileElements::ProcFileElement *ne = new ProcFileElements::ProcFileElement(fst, lst); // Check if if it is adjacent or overlapping with an existing one TIter nxe(fElements); ProcFileElements::ProcFileElement *e = 0; while ((e = (ProcFileElements::ProcFileElement *)nxe())) { if (e->MergeElement(ne) == 0) break; } Int_t rc = 0; // Remove and re-add the merged element to sort correctly its possibly new position if (e) { fElements->Remove(e); fElements->Add(e); SafeDelete(ne); } else { // Add the new element fElements->Add(ne); rc = 1; } // Make sure that all what can be merged is merged (because of the order, some elements // which could be merged are not merged, making the determination of fFirst and fLast below // to give incorrect values) ProcFileElements::ProcFileElement *ep = 0, *en = 0; TObjLink *olp = fElements->FirstLink(), *oln = 0; while (olp && (ep = (ProcFileElements::ProcFileElement *) olp->GetObject())) { oln = olp->Next(); while (oln) { if ((en = (ProcFileElements::ProcFileElement *) oln->GetObject())) { if (ep->MergeElement(en) == 0) { fElements->Remove(en); delete en; } } oln = oln->Next(); } olp = olp->Next(); } // New overall ranges if ((e = (ProcFileElements::ProcFileElement *) fElements->First())) fFirst = e->fFirst; if ((e = (ProcFileElements::ProcFileElement *) fElements->Last())) fLast = e->fLast; // Done return rc; }