TOF geometry updating (addition of AliTOFGeometry)
[u/mrichter/AliRoot.git] / TOF / AliTOFDigitMap.cxx
index ecfdd67802604d3390ab09e68f0d79e5900c0cf1..cb7f71f4457e8f1b557589dd5742cb0cefa45330 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "AliTOFDigitMap.h"
 #include "AliTOFdigit.h"
 
 #include "AliTOFDigitMap.h"
 #include "AliTOFdigit.h"
-#include "AliTOFConstants.h"
+#include "AliTOFGeometry.h"
 
 
 #include <TClonesArray.h>
 
 
 #include <TClonesArray.h>
@@ -62,12 +62,12 @@ AliTOFDigitMap::AliTOFDigitMap(TClonesArray *dig)
   // of course, these constants must not be hardwired
   // change later
   
   // of course, these constants must not be hardwired
   // change later
   
-  fNSector = AliTOFConstants::fgkNSectors;
-  fNplate = AliTOFConstants::fgkNPlates;
-  fNstrip = AliTOFConstants::fgkNStripC;
-  fNpx  = AliTOFConstants::fgkNpadX;
-  fNpy  = AliTOFConstants::fgkNpadZ;
-  fMaxIndex=fNSector*fNplate*fNstrip*fNpx*fNpy;
+  fNSector = AliTOFGeometry::NSectors();
+  fNplate = AliTOFGeometry::NPlates();
+  fNstrip = AliTOFGeometry::NStripC();
+  fNpx  = AliTOFGeometry::NpadX();
+  fNpz  = AliTOFGeometry::NpadZ();
+  fMaxIndex=fNSector*fNplate*fNstrip*fNpx*fNpz;
   fDigitMap = new Int_t[fMaxIndex];
   fDigits =  dig;
   Clear();
   fDigitMap = new Int_t[fMaxIndex];
   fDigits =  dig;
   Clear();
@@ -109,11 +109,11 @@ Int_t AliTOFDigitMap::CheckedIndex(Int_t *vol) const
 // Return checked indices for vol
 //
   Int_t index=
 // Return checked indices for vol
 //
   Int_t index=
-    (vol[0]-1)*fNplate*fNstrip*fNpx*fNpy+             // sector
-    (vol[1]-1)*fNstrip*fNpx*fNpy+                     // plate
-    (vol[2]-1)*fNpx*fNpy+                             // strip
-    (vol[3]-1)*fNpy+                                  // padx
-    (vol[4]-1);                                        // pady (=padz)
+    (vol[0]/*-1*/)*fNplate*fNstrip*fNpx*fNpz+             // sector
+    (vol[1]/*-1*/)*fNstrip*fNpx*fNpz+                     // plate
+    (vol[2]/*-1*/)*fNpx*fNpz+                             // strip
+    (vol[3]/*-1*/)*fNpz+                                  // padx
+    (vol[4]/*-1*/);                                       // padz
 
     if (index >= fMaxIndex) {
       Error("AliTOFDigitMap","CheckedIndex - input outside bounds");
 
     if (index >= fMaxIndex) {
       Error("AliTOFDigitMap","CheckedIndex - input outside bounds");