Allocate(fNrows, fNcols, fNtbins);
}
+//_____________________________________________________________________________
+void AliTRDSignalIndex::ResetContent()
+{
+ //
+ // Reset the array but keep the size - no realloc
+ //
+
+ fIndex->Reset(-1);
+ ResetCounters();
+ fHasEntry = kFALSE;
+}
+
+//_____________________________________________________________________________
+void AliTRDSignalIndex::ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime)
+{
+ //
+ // Reset the array but keep the size if no need to enlarge - no realloc
+ //
+
+ fDet = -1;
+ fLayer = -1;
+ fStack = -1;
+ fSM = -1;
+
+ if (nrow > fNrows || ncol > fNcols || ntime > fNtbins)
+ {
+ Allocate(nrow, ncol, ntime);
+ }
+ else
+ {
+ fIndex->Reset(-1);
+ ResetCounters();
+ fHasEntry = kFALSE;
+ }
+}
+
+
//_____________________________________________________________________________
void AliTRDSignalIndex::ClearAll()
{
// the RC index is updated to!!!
// this is to be used in the TRD clusterizer!
- if (fPositionCol + fNtbins >= fMaxLimit)
+ //if (fPositionCol + fNtbins >= fMaxLimit)
+ if (row * col * tbin + row * col * 2 >= fMaxLimit)
{
AliError(Form("Out-of-limits fPositionCol + fNtbins %d. Limit is: %d", fPositionCol + fNtbins, fMaxLimit));
return;
(*fIndex)[fPositionRow] = row;
(*fIndex)[fPositionCol] = col;
(*fIndex)[fPositionCol + fPositionTbin] = tbin;
-
+ //AliInfo(Form("x1: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
++fPositionTbin;
- //AliDebug(3, Form("fNRCindexed=%d", fNRCindexed));
}
else
{
// }
(*fIndex)[fPositionCol + fPositionTbin] = tbin;
+ //AliInfo(Form("x2: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
++fPositionTbin;
}
{
// return the position (index in the data array) of the next available pad
- if (fPositionCol + fNtbins >= fMaxLimit)
- {
- //AliDebug(8, "Out of index range");
- return kFALSE;
- }
-
if (fResetCounters == kTRUE)
{
fPositionRow = 0;
fPositionCol = 1;
fResetCounters = kFALSE;
- AliDebug(2, "Reset counters");
+ //AliDebug(2, "Reset counters");
}
else
{
fPositionCol += fNtbins + 2;
}
+ if (fPositionRow >= fMaxLimit)
+ {
+ //AliDebug(8, "Out of index range");
+ return kFALSE;
+ }
+
//AliDebug(8, Form("Next RC %d", fPositionRow / (fNtbins + 2)));
fPositionTbin = 1;
// return the position (index in the data array) of the next available tbin
// within the current pad
-// if (fNRCcounter >= fNRCindexed)
-// return kFALSE;
-
- if (fPositionCol + fNtbins >= fMaxLimit)
+ if (fPositionRow >= fMaxLimit)
{
+ //AliDebug(8, "Out of index range");
return kFALSE;
}
{
if (NextRCIndex(row, col))
{
- //return NextTbinIndex(tbin);
return NextRCTbinIndex(row, col, tbin);
}
}
// return the position (index in the data array) of the next available tbin
// within the current pad
-// if (fNRCcounter >= fNRCindexed)
-// return kFALSE;
-
- if (fPositionCol + fNtbins >= fMaxLimit || fPositionTbin > fNtbins)
+ if (fPositionCol + fPositionTbin >= fMaxLimit || fPositionTbin > fNtbins)
{
+ //AliDebug(8, "Out of index range");
return kFALSE;
}