]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDfeeParam.cxx
reduce binning and ranges
[u/mrichter/AliRoot.git] / TRD / AliTRDfeeParam.cxx
index b31b7e56ac81c2598bad7547ee6541493b04fd04..ffcf834398972c61e499135a5af3c2b408ffb05c 100644 (file)
@@ -241,7 +241,24 @@ Int_t AliTRDfeeParam::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
   if (iadc < 0 || iadc > fgkNadcMcm ) return -100;
   Int_t mcmcol = imcm%fgkNmcmRobInCol + GetRobSide(irob)*fgkNmcmRobInCol;  // MCM column number on ROC [0..7]
   Int_t padcol = mcmcol*fgkNcolMcm + fgkNcolMcm + 1 - iadc;
-  // if( padcol < 0 || padcol >= fgkNcol ) return -1;   // thisi s commented because of reson above KO
+  if( padcol < 0 || padcol >= fgkNcol ) return -1;   // this is commented because of reason above OK
+
+  return padcol;
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetExtendedPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
+{     
+  //
+  // Return which pad coresponds to the extended digit container pad numbering
+  // Extended digit container is designed to store all pad data including shared pad, 
+  // so we have to introduce new virtual pad numbering scheme for this purpose. 
+  //
+    
+  if (iadc < 0 || iadc > fgkNadcMcm ) return -100;
+  Int_t mcmcol = imcm%fgkNmcmRobInCol + GetRobSide(irob)*fgkNmcmRobInCol;  // MCM column number on ROC [0..7]
+  Int_t padcol = mcmcol*fgkNadcMcm + fgkNcolMcm + 2 - iadc;
 
   return padcol;
 
@@ -261,6 +278,28 @@ Int_t AliTRDfeeParam::GetMCMfromPad(Int_t irow, Int_t icol) const
 
 }
 
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetMCMfromSharedPad(Int_t irow, Int_t icol) const
+{
+  //
+  // Return on which MCM this pad is directry connected.
+  // Return -1 for error.
+  //
+  
+  if ( irow < 0 || icol < 0 || irow > fgkNrowC1 || icol > fgkNcol+8*3 ) return -1;
+
+  Int_t adc = 20 - (icol%18) -1;
+  switch(adc) {
+    case 2:  icol += 5; break;
+    case 18: icol -= 5; break;
+    case 19: icol -= 5; break;
+    default: icol += 0; break;
+  }
+
+  return (icol%(fgkNcol/2))/fgkNcolMcm + fgkNmcmRobInCol*(irow%fgkNmcmRobInRow);
+
+}
+
 //_____________________________________________________________________________
 Int_t AliTRDfeeParam::GetROBfromPad(Int_t irow, Int_t icol) const
 {
@@ -272,6 +311,18 @@ Int_t AliTRDfeeParam::GetROBfromPad(Int_t irow, Int_t icol) const
 
 }
 
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetROBfromSharedPad(Int_t irow, Int_t icol) const
+{
+  //
+  // Return on which rob this pad is for shared pads
+  //
+
+  if(icol<72) return (irow/fgkNmcmRobInRow)*2 + GetColSide(icol+5);
+  else return (irow/fgkNmcmRobInRow)*2 + GetColSide(icol-5);
+
+}
+
 //_____________________________________________________________________________
 Int_t AliTRDfeeParam::GetRobSide(Int_t irob) const
 {