]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added AliTOFRawStream::GetIndex method for online calibration (C.Zampolli)
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Feb 2007 09:43:45 +0000 (09:43 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Feb 2007 09:43:45 +0000 (09:43 +0000)
TOF/AliTOFRawStream.cxx
TOF/AliTOFRawStream.h

index e5922f3d4f490740bef3c7909a0d94535352bc51..f66ac08ce8550be6057f361eeac694d772d58237 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.11  2007/02/20 15:57:00  decaro
+Raw data update: to read the TOF raw data defined in UNPACKED mode
+
 Revision 1.10  2006/12/15 14:01:38  cvetan
 Memory leak fixed
 
@@ -1348,3 +1351,55 @@ void AliTOFRawStream::EquipmentId2VolumeId(Int_t nDDL, Int_t nTRM, Int_t iChain,
   volume[4] = iPadZ;
 
 }
+//_____________________________________________________________________________
+
+Int_t AliTOFRawStream::GetIndex(Int_t *detId)
+{
+  //Retrieve calibration channel index
+  const Int_t nSectors = fTOFGeometry->NSectors();
+  const Int_t nPlates = fTOFGeometry->NPlates();
+  const Int_t nStripA = fTOFGeometry->NStripA();
+  const Int_t nStripB = fTOFGeometry->NStripB();
+  const Int_t nStripC = fTOFGeometry->NStripC();
+  const Int_t nPadX = fTOFGeometry->NpadX();
+  const Int_t nPadZ = fTOFGeometry->NpadZ();
+
+
+  Int_t isector = detId[0];
+  if (isector >= nSectors)
+    AliError(Form("Wrong sector number in TOF (%d) !",isector));
+  Int_t iplate = detId[1];
+  if (iplate >= nPlates)
+    AliError(Form("Wrong plate number in TOF (%d) !",iplate));
+  Int_t istrip = detId[2];
+  Int_t ipadz = detId[3];
+  Int_t ipadx = detId[4];
+  Int_t stripOffset = 0;
+  switch (iplate) {
+  case 0:
+    stripOffset = 0;
+    break;
+  case 1:
+    stripOffset = nStripC;
+    break;
+  case 2:
+    stripOffset = nStripC+nStripB;
+    break;
+  case 3:
+    stripOffset = nStripC+nStripB+nStripA;
+    break;
+  case 4:
+    stripOffset = nStripC+nStripB+nStripA+nStripB;
+    break;
+  default:
+    AliError(Form("Wrong plate number in TOF (%d) !",iplate));
+    break;
+  };
+
+  Int_t idet = ((2*(nStripC+nStripB)+nStripA)*nPadZ*nPadX)*isector +
+               (stripOffset*nPadZ*nPadX)+
+               (nPadZ*nPadX)*istrip+
+              (nPadX)*ipadz+
+               ipadx;
+  return idet;
+}
index 8fb228ace7d35910be2eeb45f0e94040f3aa8f85..f96a9e9ff3823655116f9507108e95cb336887be 100644 (file)
@@ -41,6 +41,7 @@ class AliTOFRawStream: public TObject {
   Int_t GetStrip()  const {return fStrip;};
   Int_t GetPadZ()   const {return fPadZ;};
   Int_t GetPadX()   const {return fPadX;};
+  Int_t GetIndex(Int_t *detId); // Get channel index for Online Calibration 
   
   Int_t GetTofBin() const {return fTime;};
   Int_t GetToTbin() const {return fToT;};