fN1(0),
fClusters2(0),
fN2(0),
+ fFastCluster(),
fN(0),
- fX(0.)
+ fClusters(),
+ fIndex(),
+ fX(0.)
{
//
// default constructor
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++;
}
//
// Set cluster info for fast navigation
//
- if (i>510|| i<0){
+ if (i>=510|| i<0){
}else{
fFastCluster[i]=cl;
}
//
if (left ==0){
tpcrow = fRow+row;
- if(!tpcrow->GetClusters1()) tpcrow->SetClusters1(new AliTPCclusterMI[size]);
+ if(!tpcrow->GetClusters1()) {
+ tpcrow->SetClusters1(new AliTPCclusterMI[size]);
+ tpcrow->SetN1(0);
+ }
if(size < kMaxClusterPerRow) {
tpcrow->SetCluster1(tpcrow->GetN1(), *cl);
- //printf("inner: size %d, tpcrow->GetN1() %d sec %d row %d tpcrow %p \n", size, tpcrow->GetN1(), sec, row, tpcrow);
+ //printf("inner: size %d, tpcrow->GetN1() %d sec %d row %d tpcrow %p cl %p\n", size, tpcrow->GetN1(), sec, row, tpcrow, cl);
tpcrow->IncrementN1();
}
}
if (left ==1){
tpcrow = fRow+row;
- if(!tpcrow->GetClusters2()) tpcrow->SetClusters2(new AliTPCclusterMI[size]);
+ if(!tpcrow->GetClusters2()) {
+ tpcrow->SetClusters2(new AliTPCclusterMI[size]);
+ tpcrow->SetN2(0);
+ }
if(size < kMaxClusterPerRow) {
tpcrow->SetCluster2(tpcrow->GetN2(), *cl);
- //printf("outer: size %d, tpcrow->GetN2() %d sec %d row %d tpcrow %p \n", size, tpcrow->GetN2(), sec, row, tpcrow);
+ //printf("outer: size %d, tpcrow->GetN2() %d sec %d row %d tpcrow %p cl %p\n", size, tpcrow->GetN2(), sec, row, tpcrow, cl);
tpcrow->IncrementN2();
}