]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFGeometry.cxx
Obsolete.
[u/mrichter/AliRoot.git] / TOF / AliTOFGeometry.cxx
index ea00f8d6e2ba6d43afae61a9fda398bbe8b786b3..77a4479759b81c1fe54ad793f2e5da5dabe349ca 100644 (file)
 
 /*
 $Log$
+Revision 1.20.1  2007/05/19 decaro
+         Added the following methods:
+             GetVolumeIndices(Int_t index, Int_t *det), to get
+          the volume indices (sector, plate, strip, padz, padx,
+          stored respectively in det[0], det[1], det[2], det[3], det[4])
+          from the calibration channel index;
+             NStrip(Int_t nPlate), to get the strips number
+          per each kind of TOF module.
+
 Revision 1.20  2007/10/08 17:52:55  decaro
 hole region in front of PHOS detector: update of sectors' numbers
 
@@ -106,10 +115,14 @@ Revision 0.01  2003/12/04 S.Arcelli
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "TGeoManager.h"
-#include "AliTOFGeometry.h"
+//#include "TGeoMatrix.h"
+#include "TMath.h"
+
 #include "AliLog.h"
 #include "AliConst.h"
 
+#include "AliTOFGeometry.h"
+
 extern TGeoManager *gGeoManager;
 
 ClassImp(AliTOFGeometry)
@@ -119,9 +132,9 @@ const Float_t AliTOFGeometry::fgkZlenB    = 146.5;    // length (cm) of the B mo
 const Float_t AliTOFGeometry::fgkZlenC    = 170.45;   // length (cm) of the C module
 const Float_t AliTOFGeometry::fgkMaxhZtof = 370.6;    // Max half z-size of TOF (cm)
 
-const Float_t AliTOFGeometry::fgkxTOF     = 371.-0.01;// Inner radius of the TOF for Reconstruction (cm)
-const Float_t AliTOFGeometry::fgkRmin     = 370.-0.01;// Inner radius of the TOF (cm)
-const Float_t AliTOFGeometry::fgkRmax     = 399.-0.01;// Outer radius of the TOF (cm)
+const Float_t AliTOFGeometry::fgkxTOF     = 372.00;// Inner radius of the TOF for Reconstruction (cm)
+const Float_t AliTOFGeometry::fgkRmin     = 371.00;// Inner radius of the TOF (cm)
+const Float_t AliTOFGeometry::fgkRmax     = 400.05;// Outer radius of the TOF (cm)
 
 const Int_t AliTOFGeometry::fgkTimeDiff   = 25000;  // Min signal separation (ps)
 const Float_t AliTOFGeometry::fgkXPad     = 2.5;    // Pad size in the x direction (cm)
@@ -1808,6 +1821,70 @@ Int_t AliTOFGeometry::GetIndex(Int_t *detId)
                ipadx;
   return idet;
 }
+//_____________________________________________________________________________
+
+void AliTOFGeometry::GetVolumeIndices(Int_t index, Int_t *detId)
+{
+  //
+  // Retrieve volume indices from the calibration channel index 
+  //
+
+  detId[0] = index/NpadXStrip()/NStripXSector();
+
+  Int_t dummyStripPerModule = 
+    ( index - ( NStripXSector()*NpadXStrip()*detId[0]) ) / NpadXStrip();
+  if (dummyStripPerModule<kNStripC) {
+    detId[1] = 0;
+    detId[2] = dummyStripPerModule;
+  }
+  else if (dummyStripPerModule>=kNStripC && dummyStripPerModule<kNStripC+kNStripB) {
+    detId[1] = 1;
+    detId[2] = dummyStripPerModule-kNStripC;
+  }
+  else if (dummyStripPerModule>=kNStripC+kNStripB && dummyStripPerModule<kNStripC+kNStripB+kNStripA) {
+    detId[1] = 2;
+    detId[2] = dummyStripPerModule-kNStripC-kNStripB;
+  }
+  else if (dummyStripPerModule>=kNStripC+kNStripB+kNStripA && dummyStripPerModule<kNStripC+kNStripB+kNStripA+kNStripB) {
+    detId[1] = 3;
+    detId[2] = dummyStripPerModule-kNStripC-kNStripB-kNStripA;
+  }
+  else if (dummyStripPerModule>=kNStripC+kNStripB+kNStripA+kNStripB && dummyStripPerModule<NStripXSector()) {
+    detId[1] = 4;
+    detId[2] = dummyStripPerModule-kNStripC-kNStripB-kNStripA-kNStripB;
+  }
+
+  Int_t padPerStrip = ( index - ( NStripXSector()*NpadXStrip()*detId[0]) ) - dummyStripPerModule*NpadXStrip();
+
+  detId[3] = padPerStrip / kNpadX;
+  detId[4] = padPerStrip - detId[3]*kNpadX;
+
+}
+//_____________________________________________________________________________
 
+Int_t AliTOFGeometry::NStrip(Int_t nPlate)
+{
+  //
+  // Returns the strips number for the plate number 'nPlate'
+  //
 
+  Int_t nStrips = kNStripC;
 
+  switch(nPlate) {
+  case 2:
+    nStrips = kNStripA;
+    break;
+  case 1:
+  case 3:
+    nStrips = kNStripB;
+    break;
+  case 0:
+  case 4:
+  default:
+    nStrips = kNStripC;
+    break;
+  }
+
+  return nStrips;
+
+}