]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSresponseSDD.cxx
Accomodation for the new coordinate system: oposite sign of the track curvature ...
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.cxx
index 7578ac7b0dff49d0ed3a3ccd24da217c13129e9c..ad29999623eaa15a8e50eef98ef2ac87a707d57f 100644 (file)
@@ -138,6 +138,34 @@ AliITSresponseSDD::~AliITSresponseSDD() {
 
   if(fGaus) delete fGaus;
 }
+
+//______________________________________________________________________
+Int_t AliITSresponseSDD::Convert8to10(Int_t signal) const {
+  // Undo the lossive 10 to 8 bit compression.
+  // code from Davide C. and Albert W.
+  if(Do10to8()){  // kTRUE if the compression is active
+    if (signal < 0 || signal > 255) {
+      Warning("Convert8to10","out of range signal=%d",signal);
+      return 0;
+    } // end if signal <0 || signal >255
+
+    if (signal < 128) return signal;
+    if (signal < 192) {
+      if (TMath::Odd(signal)) return (128+((signal-128)<<1));
+      else  return (128+((signal-128)<<1)+1);
+    } // end if signal < 192
+    if (signal < 224) {
+      if (TMath::Odd(signal)) return (256+((signal-192)<<3)+3);
+      else  return (256+((signal-192)<<3)+4);
+    } // end if signal < 224
+    if (TMath::Odd(signal)) return (512+((signal-224)<<4)+7);
+    return (512+((signal-224)<<4)+8);
+  }
+  else {  
+    return signal;
+  }
+}
+
 //______________________________________________________________________
 void AliITSresponseSDD::SetCompressParam(Int_t  cp[8]){
   // set compression param