X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FTPCLib%2FAliHLTTPCMemHandler.cxx;h=8f623a880924b6f5ea3b3966562b91237600043a;hb=1e21c76d9b624d6713624f512e31650496504c47;hp=ed3b4a3ed06a242fe5247f897b52b72bb705638e;hpb=0ba35c533a3f42462b34c57d590e82a74efe01ec;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/TPCLib/AliHLTTPCMemHandler.cxx b/HLT/TPCLib/AliHLTTPCMemHandler.cxx index ed3b4a3ed06..8f623a88092 100644 --- a/HLT/TPCLib/AliHLTTPCMemHandler.cxx +++ b/HLT/TPCLib/AliHLTTPCMemHandler.cxx @@ -1,94 +1,29 @@ // @(#) $Id$ // Original: AliHLTMemHandler.cxx,v 1.52 2005/06/14 10:55:21 cvetan -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: U. Frankenfeld, A. Vestbo, C. Loizides * - * Matthias Richter * - * 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. * - **************************************************************************/ - -/** @file AliHLTTPCMemHandler.cxx - @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by - Matthias Richter - @date - @brief input interface base class for the TPC tracking code before - migration to the HLT component framework - -// see below for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - */ -/** \class AliHLTTPCMemHandler -
-//_____________________________________________________________
-// AliHLTTPCMemHandler
-//
-// The HLT Binary File handler 
-//
-//  This class does all the memory I/O handling of HLT binary files.
-//  
-//  Examples:
-//  ---------
-//
-//  1) Reading a binary file:
-//  
-//  AliHLTTPCMemHandler file;
-//  file.SetBinaryInput(filename);
-//  file.Init(slice,patch);
-//
-//  UInt_t nrowss;
-//  AliHLTTPCDigitRowData *data = file.CompBinary2Memory(nrows);
-//  
-//  for(int i=0; ifDigitData;
-//    for(int j=0; jfNDigit; j++) 
-//      {
-//        pad = dataPt[j].fPad;
-//        time = dataPt[j].fTime;
-//        charge = dataPt[j].fCharge;
-//      }
-//     
-//    file.UpdateRowPointer(data);
-//  
-//    }
-//  file.CloseBinaryInput();
-//  ________________________
-//  
-//  2) Writing a binary file:
-//  
-//  //First of all you need to store the data in memory,
-//  //and have a pointer to it of type AliHLTTPCDigitRowData.
-//  //E.g. if you just want to write the data you read in example 1)
-//  //into a new file, you can do the following:
-//  
-//  AliHLTTPCMemHandler newfile;
-//  newfile.Init(slice,patch);
-//  newfile.SetBinaryOutput(newfilename);
-//  newfile.Memory2CompBinary((UInt_t)NumberOfRowsInPatch,(AliHLTTPCDigitRowData*)data);
-//  newfile.CloseBinaryOutput();
-//
-//
-// Compressed file format:
-// -----------------------
-//
-// The data is RLE encoded and currently using _10_ bit range for the ADC-values.
-
-*/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: U. Frankenfeld, A. Vestbo, C. Loizides * +//* Matthias Richter * +//* 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. * +//************************************************************************** + +// @file AliHLTTPCMemHandler.cxx +// @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by +// Matthias Richter +// @date +// @brief input interface base class for the TPC tracking code before +// migration to the HLT component framework #include #include "AliHLTTPCRootTypes.h" @@ -99,6 +34,7 @@ #include "AliHLTTPCSpacePointData.h" #include "AliHLTTPCTrackArray.h" #include "AliHLTTPCMemHandler.h" +#include "TMath.h" #if __GNUC__ >= 3 using namespace std; @@ -173,7 +109,7 @@ void AliHLTTPCMemHandler::ResetROI() } } -void AliHLTTPCMemHandler::SetROI(Float_t *eta,Int_t */*slice*/) +void AliHLTTPCMemHandler::SetROI(const Float_t *eta,Int_t */*slice*/) { // Init the Look-up table for the Region of Interest mode. // Here you can specify a certain etaregion, - all data @@ -184,7 +120,7 @@ void AliHLTTPCMemHandler::SetROI(Float_t *eta,Int_t */*slice*/) // slice[1] = maximum slice - if(eta[1]==0) + if(TMath::Abs(eta[1])<.00001) { LOG(AliHLTTPCLog::kWarning,"AliHLTTPCMemHandler::SetROI","Eta Values") <<"Bad ROI parameters."<fNDigit; - - if (szfRow=row; - Generate(row); - UShort_t npad = Read(comp,index,subindex); - for(UShort_t p=0;p=fEtaMinTimeBin[row]&&time<=fEtaMaxTimeBin[row]) - //AddData(rowPt->fDigitData,ndigit,row,pad,time,charge); - //seems we are using this function... but dont know why - AddDataRandom(rowPt->fDigitData,ndigit,row,pad,time,charge); - time++; - } - UShort_t tshift = Read(comp,index,subindex); - if(tshift == 0) break; - time += tshift; - } - } - rowPt->fNDigit = ndigit; - Int_t size = sizeof(AliHLTTPCDigitData) * rowPt->fNDigit+ - sizeof(AliHLTTPCDigitRowData); - Byte_t *bytePt =(Byte_t *) rowPt; - bytePt += size; - outsize += size; - rowPt = (AliHLTTPCDigitRowData *) bytePt; - } - sz = outsize; - return outsize; -} - UInt_t AliHLTTPCMemHandler::GetCompMemorySize(UInt_t nrow,AliHLTTPCDigitRowData *data) const { //Return the size of RLE data, after compressing data. @@ -946,7 +743,7 @@ UInt_t AliHLTTPCMemHandler::GetNRow(UInt_t *comp,UInt_t size) } Bool_t AliHLTTPCMemHandler::CompMemory2CompBinary(UInt_t nrow,UInt_t *comp, - UInt_t size) + UInt_t size) { //Write the RLE data in comp to the output file. @@ -973,45 +770,6 @@ Bool_t AliHLTTPCMemHandler::CompMemory2CompBinary(UInt_t nrow,UInt_t *comp, return kTRUE; } -Bool_t AliHLTTPCMemHandler::CompBinary2CompMemory(UInt_t & nrow,UInt_t *comp) -{ - //Read the RLE data from file, and store it in comp. No unpacking yet. - - if(!fInBinary){ - LOG(AliHLTTPCLog::kWarning,"AliHLTTPCMemHandler::CompBinary2CompMemory","File") - <<"No Output File"<SetBinaryInput(fInBinary); - UInt_t *comp =(UInt_t *)handler->Allocate(); - handler->CompBinary2CompMemory(nrow,comp); - UInt_t size = GetMemorySize(nrow,comp); - sz = size; - AliHLTTPCDigitRowData *data = (AliHLTTPCDigitRowData *)Allocate(size); - CompMemory2Memory(nrow,data,comp); - handler->Free(); - delete handler; - return data; -} Bool_t AliHLTTPCMemHandler::Memory2CompBinary(UInt_t nrow,AliHLTTPCDigitRowData *data) { @@ -1070,44 +828,6 @@ Bool_t AliHLTTPCMemHandler::Transform(UInt_t npoint,AliHLTTPCSpacePointData *dat return kTRUE; } -Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointData *data, UInt_t& sz) -{ - //Read the space points in inputfile, and store it in data. - if(!fInBinary){ - LOG(AliHLTTPCLog::kWarning,"AliHLTTPCMemHandler::Binary2Memory","File") - <<"No Input File"<fNPoints*sizeof(UInt_t); - if(fread(trackPt->fPointIDs,size,1,fInBinary)!=1) break; - Byte_t *bytePt = (Byte_t*) trackPt; - bytePt += sizeof(AliHLTTPCTrackSegmentData)+size; - trackPt = (AliHLTTPCTrackSegmentData*) bytePt; - ntrack++; - } - LOG(AliHLTTPCLog::kDebug,"AliHLTTPCMemHandler::Binary2Memory","File") - <fPad==b->fPad && a->fTime == b->fTime) return 0;