//
if (fDigitMap) {
for (Int_t i=0; i<fMaxIndex; i++) delete[] fDigitMap[i];
+ delete [] fDigitMap;
}
}
////////////////////////////////////////////////////////////////////////
-Int_t AliTOFDigitMap::CheckedIndex(Int_t *vol) const
+Int_t AliTOFDigitMap::CheckedIndex(Int_t * const vol) const
{
//
// Return checked index for vol
// 0 means empty pad, we need to shift indeces by 1
if (fDigitMap[CheckedIndex(vol)][kMaxDigitsPerPad-1]!=0) {
- AliWarning(Form("For this volume (Se%i, Pl%i, St%i, PadR%i, Pad%i) there are not more possibility to add digits.", vol[0], vol[1], vol[2], vol[4], vol[3]));
- AliWarning(Form("Then, the digit number %i will be not inserted in the digit map, i.e. it will be lost.", idigit));
+ AliDebug(1,Form("In the volume (Se%i, Pl%i, St%i, PadR%i, Pad%i) there is not more possibility to add other digits.", vol[0], vol[1], vol[2], vol[4], vol[3]));
+ AliDebug(1,Form("Then, the digit number %i will be not inserted in the digit map, i.e. it will be lost.", idigit));
+ AliDebug(1,Form("Please, check the possibility to increase the digit map size (succently set to %i)", kMaxDigitsPerPad));
return;
}
//else continue;
}
+
}
////////////////////////////////////////////////////////////////////////
return -1;
}
- if (CheckedIndex(vol)==-1) return -1;
+ Int_t ci = CheckedIndex(vol);
+ if (ci==-1) return -1;
- Int_t dummy = fDigitMap[CheckedIndex(vol)][label];
+ Int_t dummy = fDigitMap[ci][label];
if (dummy>0) return dummy-1;
else return -1;
// Returns the number of filled cells of the TOF digit map
//
- Int_t volume[5] = {-1, -1, -1, -1, -1};
Int_t counter = 0;
- for (Int_t iSector=0; iSector<fNSector; iSector++)
- for (Int_t iPlate=0; iPlate<fNplate; iPlate++)
- for (Int_t iStrip=0; iStrip<fNstrip; iStrip++)
- for (Int_t iPadX=0; iPadX<fNpx; iPadX++)
- for (Int_t iPadZ=0; iPadZ<fNpz; iPadZ++)
- {
-
- volume[0] = iSector;
- volume[1] = iPlate;
- volume[2] = iStrip;
- volume[3] = iPadX;
- volume[4] = iPadZ;
-
- //if (CheckedIndex(volume)!=-1) counter++;
- if (GetDigitIndex(volume, 0)>0) counter++;
- }
+ for (Int_t index = 0; index < fMaxIndex; ++index)
+ {
+ for (Int_t label = 0; label < kMaxDigitsPerPad; ++label)
+ {
+ if (fDigitMap[index][label] > 0)
+ {
+ ++counter;
+ break;
+ }
+ }
+ }
return counter;
-
}
////////////////////////////////////////////////////////////////////////
{
volume[3] = iPadX;
volume[4] = iPadZ;
- if (GetDigitIndex(volume, 0)>=0) {
- counter = kTRUE;
- break;
+ for (Int_t label=0; label<kMaxDigitsPerPad; label++) {
+ if (GetDigitIndex(volume, label)>=0) {
+ counter = kTRUE;
+ break;
+ }
}
}
Int_t AliTOFDigitMap::DigitInStrip(Int_t iSector, Int_t iPlate, Int_t iStrip) const
{
//
- // Returns:
+ // Returns number of digits in the strip iStrip,
+ // in the plate iPlate of the sector iSector
//
Int_t volume[5] = {iSector, iPlate, iStrip, -1, -1};
for (Int_t label=0; label<kMaxDigitsPerPad; label++) {
volume[3] = iPadX;
volume[4] = iPadZ;
- if (GetDigitIndex(volume, label)<0) continue;
- counter++;
+ if (GetDigitIndex(volume, label)>=0)
+ counter++;
}
return counter;
}
+////////////////////////////////////////////////////////////////////////
+Int_t AliTOFDigitMap::FilledCellsInStrip(Int_t iSector, Int_t iPlate, Int_t iStrip) const
+{
+ //
+ // Returns number of digits in the strip iStrip,
+ // in the plate iPlate of the sector iSector
+ //
+
+ Int_t volume[5] = {iSector, iPlate, iStrip, -1, -1};
+ Int_t counter = 0;
+
+ for (Int_t iPadX=0; iPadX<fNpx; iPadX++)
+ for (Int_t iPadZ=0; iPadZ<fNpz; iPadZ++) {
+ volume[3] = iPadX;
+ volume[4] = iPadZ;
+ if (GetDigitIndex(volume, 0)>=0)
+ counter++;
+ }
+
+ return counter;
+
+}
+
////////////////////////////////////////////////////////////////////////
void AliTOFDigitMap::ResetDigitNumber(Int_t *vol, Int_t dig)
{
// Reset digit into pad vol
//
- Int_t dummy = -1;
-
for (Int_t slot=0; slot<kMaxDigitsPerPad; slot++) {
if (fDigitMap[CheckedIndex(vol)][slot]-1==dig) {
fDigitMap[CheckedIndex(vol)][slot] = 0;
- dummy = slot;
- }
- }
- /*
- if (dummy<kMaxDigitsPerPad-1) {
- for (Int_t ii=dummy; ii<kMaxDigitsPerPad-1; ii++) {
- fDigitMap[CheckedIndex(vol)][ii] =
- fDigitMap[CheckedIndex(vol)][ii+1];
}
}
- */
+
}
////////////////////////////////////////////////////////////////////////
//
// 0 means empty pad, we need to shift indeces by 1
- //for (Int_t slot=0; slot<kMaxDigitsPerPad; slot++) {
- //if (fDigitMap[CheckedIndex(vol)][slot]==dig)
- //fDigitMap[CheckedIndex(vol)][slot] = 0;
- //}
-
-
fDigitMap[CheckedIndex(vol)][dig] = 0;
- /*
- if (dig<kMaxDigitsPerPad-1) {
- for (Int_t ii=dig; ii<kMaxDigitsPerPad-1; ii++) {
- fDigitMap[CheckedIndex(vol)][ii] =
- fDigitMap[CheckedIndex(vol)][ii+1];
- }
- }
- */
+
}
+////////////////////////////////////////////////////////////////////////
void AliTOFDigitMap::ResetDigit(Int_t *vol)
{
//
}
+////////////////////////////////////////////////////////////////////////
Int_t AliTOFDigitMap::GetNumberOfDigits(Int_t *vol)
{
//
Int_t counter = 0;
for (Int_t slot=0; slot<kMaxDigitsPerPad; slot++)
- if (GetDigitIndex(vol, slot)!=-1) counter++;
+ if (GetDigitIndex(vol, slot)>=0) counter++;
return counter;