fN1(0),
fClusters2(0),
fN2(0),
+ fFastCluster(),
fN(0),
fClusters(),
fIndex(),
AliTPCtrackerRow::~AliTPCtrackerRow(){
//
- for (Int_t i = 0; i < fN1; i++)
- fClusters1[i].~AliTPCclusterMI();
- delete [] fClusters1;
- for (Int_t i = 0; i < fN2; i++)
- fClusters2[i].~AliTPCclusterMI();
- delete [] fClusters2;
+ delete fClusters1;
+ delete fClusters2;
}
if (fN==0) {fIndex[0]=index; fClusters[fN++]=c; return;}
Int_t i=Find(c->GetZ());
- memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
- memmove(fIndex +i+1 ,fIndex +i,(fN-i)*sizeof(UInt_t));
+ if (i>=0 && i<=kMaxClusterPerRow-2) {
+ memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
+ memmove(fIndex +i+1 ,fIndex +i,(fN-i)*sizeof(UInt_t));
+ }
fIndex[i]=index; fClusters[i]=c; fN++;
}
//
// reset clusters
// MvL: Need to call destructors for AliTPCclusterMI, to delete fInfo
- for (Int_t i = 0; i < fN1; i++)
- fClusters1[i].~AliTPCclusterMI();
- delete [] fClusters1; fClusters1=0;
- for (Int_t i = 0; i < fN2; i++)
- fClusters2[i].~AliTPCclusterMI();
- delete [] fClusters2; fClusters2=0;
+ if (fClusters1) fClusters1->Clear("C");
+ if (fClusters2) fClusters2->Clear("C");
fN = 0;
fN1 = 0;
}
}
+
+void AliTPCtrackerRow::SetCluster1(Int_t i, const AliTPCclusterMI &cl)
+{
+ // attach cluster
+ if (!fClusters1) fClusters1 = new TClonesArray("AliTPCclusterMI",1000);
+ if (i<=fClusters1->GetLast() && fClusters1->UncheckedAt(i)) fClusters1->RemoveAt(i);
+ new( (*fClusters1)[fClusters1->GetEntriesFast()] ) AliTPCclusterMI(cl);
+ //
+}
+
+void AliTPCtrackerRow::SetCluster2(Int_t i, const AliTPCclusterMI &cl)
+{
+ // attach cluster
+ if (!fClusters2) fClusters2 = new TClonesArray("AliTPCclusterMI",1000);
+ if (i<=fClusters2->GetLast() && fClusters2->UncheckedAt(i)) fClusters2->RemoveAt(i);
+ new( (*fClusters2)[fClusters2->GetEntriesFast()] ) AliTPCclusterMI(cl);
+ //
+}
+
+
//_________________________________________________________________________
void AliTPCtrackerSector::Setup(const AliTPCParam *par, Int_t f) {
//-----------------------------------------------------------------------
if (left ==0){
tpcrow = fRow+row;
if(!tpcrow->GetClusters1()) {
- tpcrow->SetClusters1(new AliTPCclusterMI[size]);
tpcrow->SetN1(0);
}
if(size < kMaxClusterPerRow) {
if (left ==1){
tpcrow = fRow+row;
if(!tpcrow->GetClusters2()) {
- tpcrow->SetClusters2(new AliTPCclusterMI[size]);
tpcrow->SetN2(0);
}
if(size < kMaxClusterPerRow) {
}
}
-
-