/*
$Log$
+Revision 1.5 2001/11/24 16:10:22 kowal2
+Faster algorithms.
+
+Revision 1.4 2000/10/05 16:01:49 kowal2
+Corrected for memory leaks.
+
Revision 1.3 2000/06/30 12:07:49 kowal2
Updated from the TPC-PreRelease branch
buf->Set(fNrows*fNcols*fNlevel); //lets have the nearly the "worst case"
AliArrayI * index = new AliArrayI;
index->Set(fNcols*fNlevel);
+ // Int_t * pindex =
+
Int_t icurrent=-1; //current index
Int_t izero; //number of zero
Int_t inum; //number of digits with the same current track id
- Int_t lastID =0; //last track id
+ Int_t lastID =0; //last track id
+
+ Int_t *cbuff=fTracks->GetArray(); //MI change
+
for (Int_t lev =0; lev<fNlevel; lev++){ //loop over levels
for (Int_t col = 0; col<fNcols; col++){ //loop over columns
izero = 0;
lastID = 0;
(*index)[lev*fNcols+col]=icurrent+1;//set collumn pointer
Int_t id=0; //current id
- for (Int_t row = 0; row< fNrows;row++){ //loop over rows
- id = GetTrackIDFast(row,col,lev);
+ for (Int_t row = 0; row< fNrows;row++){ //loop over rows
+ id = *cbuff; //MI change
+ // id = GetTrackIDFast(row,col,lev);
if (id <= 0) {
if ( inum> 0 ) { //if we have some tracks in buffer
icurrent++;
- if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2);
+ if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2+1); //MI change - allocate +1
(*buf)[icurrent] = inum;
icurrent++;
(*buf)[icurrent] = lastID;
if ( izero > 0 ) {
//if we have currently izero count of non tracks digits
icurrent++;
- if (icurrent>=buf->fN) buf->Expand(icurrent*2);
+ if (icurrent>=buf->fN) buf->Expand(icurrent*2+1);
(*buf)[icurrent]= -izero; //write how many under zero
inum++;
izero = 0;
else{
//if we change track id from another track id
icurrent++;
- if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2);
+ if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2+1);
(*buf)[icurrent] = inum;
icurrent++;
(*buf)[icurrent] = lastID;
else {
inum++;
}
-
- }//end of loop over rows
+ cbuff++; //MI change
+ }//end of loop over row
if ( izero > 0 ) {
//if we have currently izero count of non tracks digits
icurrent++;