]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added new methods
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 May 2008 16:43:00 +0000 (16:43 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 May 2008 16:43:00 +0000 (16:43 +0000)
TOF/AliTOFGeometry.cxx
TOF/AliTOFGeometry.h

index 151c5f91e3c636ac1adc75093a73a378a4645d78..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
 
@@ -1812,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;
+
+}
index 4929a504aa70d3f5543711881b5727f6562cb645..18279bff390e643fb2a6db81909236aef7b86bad 100644 (file)
@@ -26,20 +26,21 @@ class AliTOFGeometry: public TObject{
   static  Int_t NStripA()     { return kNStripA;};
   static  Int_t NStripB()     { return kNStripB;};
   static  Int_t NStripC()     { return kNStripC;};
+  static  Int_t NStrip(Int_t nPlate);
   static  Int_t NMaxNstrip()  { return kMaxNstrip;};
   static  Int_t NpadX()       { return kNpadX;};
   static  Int_t NpadZ()       { return kNpadZ;};
   static  Int_t NpadXStrip()  { return kNpadX*kNpadZ;};
   static  Int_t NSectors()    { return kNSectors;};
   static  Int_t NPlates()     { return kNPlates;};
-  static Int_t NStripXSector() { return (kNStripA + 2*kNStripB +
+  static  Int_t NStripXSector() { return (kNStripA + 2*kNStripB +
                                                2*kNStripC);};
-  static Int_t NPadXSector() { return (kNStripA + 2*kNStripB +
+  static  Int_t NPadXSector() { return (kNStripA + 2*kNStripB +
                                        2*kNStripC)*kNpadX*kNpadZ;};
 
-  static Float_t RinTOF()  { return fgkxTOF;};
-  static Float_t Rmin()      { return fgkRmin;};
-  static Float_t Rmax()      { return fgkRmax;};
+  static  Float_t RinTOF()  { return fgkxTOF;};
+  static  Float_t Rmin()      { return fgkRmin;};
+  static  Float_t Rmax()      { return fgkRmax;};
 
   static  Float_t XPad()     { return fgkXPad;};
   static  Float_t ZPad()     { return fgkZPad;};
@@ -104,6 +105,7 @@ class AliTOFGeometry: public TObject{
   static Float_t GetDistances(Int_t iplate, Int_t istrip)  {return fgkDistances[iplate][istrip];};
 
   static Int_t GetIndex(Int_t *detId); // Get channel index from det Id (for calibration mainly)
+  static void GetVolumeIndices(Int_t index, Int_t *detId); // Get volume index from channel index
 
   private:
 
@@ -161,7 +163,7 @@ class AliTOFGeometry: public TObject{
   static const Float_t fgkTdcBin;   // time-of-flight bin width [ps]
   static const Float_t fgkToTBin;   // time-over-threshold bin width [ps]
 
-  ClassDef(AliTOFGeometry,5) // TOF Geometry base class
+  ClassDef(AliTOFGeometry,6) // TOF Geometry base class
 };
 
 #endif