/*
$Log$
+Revision 1.12.6.1 2002/06/10 15:28:58 hristov
+Merged with v3-08-02
+
+Revision 1.13 2002/03/28 14:59:07 cblume
+Coding conventions
+
+Revision 1.12 2002/02/12 16:06:45 cblume
+Remove delete fTree
+
+Revision 1.11 2001/11/19 08:44:08 cblume
+Fix bugs reported by Rene
+
+Revision 1.10 2001/08/30 09:31:22 hristov
+The operator[] is replaced by At() or AddAt() in case of TObjArray.
+
+Revision 1.9 2001/07/27 13:03:15 hristov
+Default Branch split level set to 99
+
Revision 1.8 2001/01/26 19:56:57 hristov
Major upgrade of AliRoot code
SetClass(classname);
if (MakeArray(n) == kFALSE) {
- Error("AliTRDsegmentArrayBase","Cannot allocate %d segments in memory",n);
- return;
+ Error("AliTRDsegmentArrayBase","Cannot allocate %d segments in memory",n);
+ return;
}
}
delete fSegment;
}
- if (fTree) delete fTree;
+ //if (fTree) delete fTree;
if (fTreeIndex) delete fTreeIndex;
- if (fClass) delete fClass;
}
// Sets the classname of the stored object
//
- if (fClass != 0) {
- delete fClass;
- fClass = 0;
- }
if (fTree != 0) {
delete fTree;
fTree = 0;
}
//_____________________________________________________________________________
-AliTRDsegmentID * AliTRDsegmentArrayBase::NewSegment()
+AliTRDsegmentID *AliTRDsegmentArrayBase::NewSegment()
{
//
// Create a new object according to the class information
// Remove a segment from the active memory
//
- if ((*fSegment)[index]){
- delete (*fSegment)[index]; // because problem with deleting TClonesArray
- fSegment->RemoveAt(index);
+ //PH if ((*fSegment)[index]){
+ //PH delete (*fSegment)[index]; // because problem with deleting TClonesArray
+ //PH fSegment->RemoveAt(index);
+ //PH }
+ if (fSegment->At(index)){
+ delete fSegment->RemoveAt(index);
}
}
if (fTreeIndex == 0) return 0;
if (fBranch == 0) return 0;
if (index > fTreeIndex->fN) return 0;
- AliTRDsegmentID *s = (AliTRDsegmentID*) (*fSegment)[index];
+ //PH AliTRDsegmentID *s = (AliTRDsegmentID*) (*fSegment)[index];
+ AliTRDsegmentID *s = (AliTRDsegmentID*) fSegment->At(index);
if (s == 0) s = NewSegment();
s->SetID(index);
treeIndex--;
fBranch->SetAddress(&s);
fTree->GetEvent(treeIndex);
- (*fSegment)[index] = (TObject*) s;
+ //PH (*fSegment)[index] = (TObject*) s;
+ fSegment->AddAt((TObject*) s, index);
}
else
return 0;
Int_t nindex = s->GetID();
ClearSegment(nindex);
- (*fSegment)[nindex] = (TObject *) s;
+ //PH (*fSegment)[nindex] = (TObject *) s;
+ fSegment->AddAt((TObject *) s, nindex);
return s;
}
//_____________________________________________________________________________
-const AliTRDsegmentID * AliTRDsegmentArrayBase::operator[](Int_t i)
+const AliTRDsegmentID * AliTRDsegmentArrayBase::operator[](Int_t i) const
{
//
// Returns a segment with the given index <i>
//
if ((i < 0) || (i >= fNSegment)) return 0;
- return (AliTRDsegmentID *)((*fSegment)[i]);
+ //PH return (AliTRDsegmentID *)((*fSegment)[i]);
+ return (AliTRDsegmentID *) fSegment->At(i);
}