-//$Id$
+// @(#) $Id$
-// Original author: Marian Ivanov, GSI Darmstadt for AliROOT
-// migrated to L3 by Anders Vestbo <mailto:vestbo@fi.uib.no>
-//*-- Copyright & copy ASV
+// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
+//*-- Copyright & copy ALICE HLT Group
#include "AliL3StandardIncludes.h"
#include "AliL3TransBit.h"
-#if GCCVERSION == 3
+#if __GNUC__ == 3
using namespace std;
#endif
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+/** \class AliL3Transbit
+<pre>
//_____________________________________________________________
-// AliL3Transbit (taken from the offline AliROOT code)
+// AliL3Transbit (taken from the offline AliROOT code,
+// original author: Marian Ivanov, GSI Darmstadt for AliROOT)
//
// Time Projection Chamber ADC bit compresion lookup table
//
// Conversion equation:
-// For AliTransBit_v1
+// For AliTransBitV1
// dy/dx= Int_t(1+x/fX0)
//
-// For AliTransBit_v2
+// For AliTransBitV2
// y =(2**bit0) ln(1+x/fX0) / ln(1+(2**bit1-1)/fX0)
//
// where x0 is calculated in function GetOptimumX0()
// Int_t b0=10; // original number of bits
// Int_t b1=8; // compressed
//
-// AliTransBit_v1 trans;
+// AliTransBitV1 trans;
// Int_t x0=TMath::Nint(TMath::Exp(b0*TMath::Log(2)));
// Int_t x1=TMath::Nint(TMath::Exp(b1*TMath::Log(2)));
// trans.SetBits(b0,b1);
//
// for( Int_t i=0;i<x1-1;i++) cout<<i<<"\t"<<trans.Get1to0(i+1)-trans.Get1to0(i)<<"\n"; > tabled.txt
//
+</pre>
+*/
ClassImp(AliL3TransBit)
-ClassImp(AliL3TransBit_v1)
-ClassImp(AliL3TransBit_v2)
+ClassImp(AliL3TransBitV1)
+ClassImp(AliL3TransBitV2)
AliL3TransBit::AliL3TransBit()
{
+ // default constructor
fTable0 = 0;
fTable1 = 0;
fBit0 = 10;
AliL3TransBit::~AliL3TransBit()
{
- //default destructor
+ // destructor
if (fTable0!=0) delete [] fTable0;
if (fTable1!=0) delete [] fTable1;
}
-Double_t AliL3TransBit_v1::FindOptimumX0()
+Double_t AliL3TransBitV1::FindOptimumX0()
{
//find x0 for which derivation at xder1 is equal 1
Int_t x0=(Int_t)rint(exp(fBit0*log(2.)));
return fX0;
}
-void AliL3TransBit_v1::Update()
+void AliL3TransBitV1::Update()
{
//construct lookup tables for loosy compression from
if (fX0<1) fX0 = FindOptimumX0();
return;
}
-Double_t AliL3TransBit_v2::FindOptimumX0()
+Double_t AliL3TransBitV2::FindOptimumX0()
{
//find x0 for which derivation at xder1 is equal 1
- const Float_t xder1=1;
- const Float_t dx=0.1;
+ const Float_t kxder1=1;
+ const Float_t kdx=0.1;
Float_t x0=exp(fBit0*log(2.));
Float_t x1=exp(fBit1*log(2.));
Float_t deriv = 0;
Float_t x;
- for (x=x1;( (x>1)&&(deriv<1)) ;x-=dx)
+ for (x=x1;( (x>1)&&(deriv<1)) ;x-=kdx)
{
- deriv = (x1-1)/( log(1.+x0/x) *x *(1+xder1/x));
+ deriv = (x1-1)/( log(1.+x0/x) *x *(1+kxder1/x));
}
- x+=dx/2.;
+ x+=kdx/2.;
fX0 = x;
return fX0;
}
-void AliL3TransBit_v2::Update()
+void AliL3TransBitV2::Update()
{
//construct lookup tables for loosy compresion from
if (fX0<1) fX0 = FindOptimumX0();