// @(#) $Id$ // Original: AliHLTDataCompressorHelper.cxx,v 1.5 2004/06/15 10:26:57 hristov Exp $ //************************************************************************** //* This file is property of and copyright by the ALICE HLT Project * //* ALICE Experiment at CERN, All rights reserved. * //* * //* Primary Authors: Anders Vestbo * //* for The ALICE HLT Project. * //* * //* 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. * //************************************************************************** #include "AliHLTStdIncludes.h" #include "AliHLTTPCRootTypes.h" #include "AliHLTTPCTransform.h" #include "AliHLTTPCDataCompressorHelper.h" #if __GNUC__ >= 3 using namespace std; #endif //_____________________________________________________________ // // AliHLTTPCDataCompression // // Interface class; binary <-> AliROOT handling of TPC data compression classes. // ClassImp(AliHLTTPCDataCompressorHelper) AliHLTTPCDataCompressorHelper::AliHLTTPCDataCompressorHelper() { } AliHLTTPCDataCompressorHelper::~AliHLTTPCDataCompressorHelper() { } Int_t AliHLTTPCDataCompressorHelper::fgNumTimeBits = 12; Int_t AliHLTTPCDataCompressorHelper::fgNumPadBits = 12; Int_t AliHLTTPCDataCompressorHelper::fgNumChargeBits = 14; Int_t AliHLTTPCDataCompressorHelper::fgNumShapeBits = 14; Float_t AliHLTTPCDataCompressorHelper::fgXYResidualStep1 = 0.03; Float_t AliHLTTPCDataCompressorHelper::fgXYResidualStep2 = 0.03; Float_t AliHLTTPCDataCompressorHelper::fgXYResidualStep3 = 0.03; Float_t AliHLTTPCDataCompressorHelper::fgZResidualStep1 = 0.05; Float_t AliHLTTPCDataCompressorHelper::fgZResidualStep2 = 0.05; Float_t AliHLTTPCDataCompressorHelper::fgZResidualStep3 = 0.05; Float_t AliHLTTPCDataCompressorHelper::fgXYWidthStep = 0.005; Float_t AliHLTTPCDataCompressorHelper::fgZWidthStep = 0.005; Int_t AliHLTTPCDataCompressorHelper::fgClusterCharge = 100; Int_t AliHLTTPCDataCompressorHelper::fgNumPadBitsRemaining = 18; Int_t AliHLTTPCDataCompressorHelper::fgNumTimeBitsRemaining = 19; Int_t AliHLTTPCDataCompressorHelper::fgNumShapeBitsRemaining = 11; void AliHLTTPCDataCompressorHelper::SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape) { // sets the numbers of bits fgNumPadBits = pad; fgNumTimeBits = time; fgNumChargeBits = charge; fgNumShapeBits = shape; } void AliHLTTPCDataCompressorHelper::SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width) { // sets the transverse resolution fgXYResidualStep1 = res1; fgXYResidualStep2 = res2; fgXYResidualStep3 = res3; fgXYWidthStep = width; } void AliHLTTPCDataCompressorHelper::SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width) { // sets the longitudinal resolution fgZResidualStep1 = res1; fgZResidualStep2 = res2; fgZResidualStep3 = res3; fgZWidthStep = width; } void AliHLTTPCDataCompressorHelper::SetRemainingBitNumbers(Int_t pad,Int_t time,Int_t shape) { // sets the numbers of remaining bits fgNumPadBitsRemaining = pad; fgNumTimeBitsRemaining = time; fgNumShapeBitsRemaining = shape; } Float_t AliHLTTPCDataCompressorHelper::GetXYResidualStep(Int_t row) { // gets the XY residual step if(row < AliHLTTPCTransform::GetNRowLow()) return fgXYResidualStep1; else if(row < AliHLTTPCTransform::GetNRowLow() + AliHLTTPCTransform::GetNRowUp1()) return fgXYResidualStep2; else if(row < AliHLTTPCTransform::GetNRowLow() + AliHLTTPCTransform::GetNRowUp1() + AliHLTTPCTransform::GetNRowUp2()) return fgXYResidualStep3; else { cerr<<"AliHLTTPCDataCompressorHelper::GetXYResidualStep : Wrong row number "<=21) return 10000; if(nbits >= 18) return 1000; if(nbits >= 14) return 100; if(nbits >= 11) return 10; if(nbits >= 8) return 1; else { cerr<<"AliHLTTPCDataCompressorHelper::GetRemainingPadFactor : Too few bits for the pad direction: "<=23) return 10000; if(nbits >= 19) return 1000; if(nbits >= 16) return 100; if(nbits >= 13) return 10; if(nbits >= 9) return 1; else { cerr<<"AliHLTTPCDataCompressorHelper::GetRemainingPadFactor : Too few bits for the pad direction: "<= 0) { i = Int_t(x + 0.5); if (x + 0.5 == Double_t(i) && i & 1) i--; } else { i = Int_t(x - 0.5); if (x - 0.5 == Double_t(i) && i & 1) i++; } return i; }