]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFDigitMap.cxx
bugfix: corrected calculation of slice and partition from track point Id
[u/mrichter/AliRoot.git] / TOF / AliTOFDigitMap.cxx
index c3956616bf3663155b3be196909ccce227f19c4b..da9be4df8884db24481041af63fa9d88b06a4118 100644 (file)
@@ -130,7 +130,7 @@ void AliTOFDigitMap::Clear(const Option_t*)
 }
 
 ////////////////////////////////////////////////////////////////////////
-Int_t AliTOFDigitMap::CheckedIndex(Int_t *vol) const
+Int_t AliTOFDigitMap::CheckedIndex(Int_t * const vol) const
 {
   //
   // Return checked index for vol
@@ -160,8 +160,9 @@ void AliTOFDigitMap::AddDigit(Int_t *vol, Int_t idigit)
   // 0 means empty pad, we need to shift indeces by 1
 
   if (fDigitMap[CheckedIndex(vol)][kMaxDigitsPerPad-1]!=0) {
-    AliWarning(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]));
-    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;
   }
 
@@ -311,6 +312,29 @@ Int_t AliTOFDigitMap::DigitInStrip(Int_t iSector, Int_t iPlate, Int_t iStrip) co
 
 }
 
+////////////////////////////////////////////////////////////////////////
+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)
 {