]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity - Removing obsolete classes AliITSHuffman and AliITSRawData
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 19 Nov 2011 22:14:24 +0000 (22:14 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 19 Nov 2011 22:14:24 +0000 (22:14 +0000)
ITS/AliITSHuffman.cxx [deleted file]
ITS/AliITSHuffman.h [deleted file]
ITS/AliITSRawData.cxx [deleted file]
ITS/AliITSRawData.h [deleted file]
ITS/AliITSsimulationSDD.cxx
ITS/CMakelibITSbase.pkg
ITS/CMakelibITSsim.pkg
ITS/ITSbaseLinkDef.h
ITS/ITSsimLinkDef.h

diff --git a/ITS/AliITSHuffman.cxx b/ITS/AliITSHuffman.cxx
deleted file mode 100644 (file)
index 769312b..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-/**************************************************************************
- * Copyright(c) 2006-2008, 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.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-////////////////////////////////////////////////
-//                                            //
-//  RawData classes for set:ITS               //
-//                                            //
-////////////////////////////////////////////////
-
-#include <TMath.h>
-#include <TObjArray.h>
-#include <Riostream.h>
-
-#include "AliITSHuffman.h"
-
-ClassImp(AliITSHuffman)
-
-//_____________________________________________________________________________
-
-  AliITSHuffman::AliITSHNode::AliITSHNode(): 
-TObject(),
-fSymbol(),
-fFrequency(0),
-fLeft(),
-fRight(),
-fFather() {
-  // default constructor
-}
-//_____________________________________________________________________________
-
-AliITSHuffman::AliITSHNode::AliITSHNode(UChar_t sym, ULong_t freq):
-TObject(),
-fSymbol(sym),
-fFrequency(freq),
-fLeft(),
-fRight(),
-fFather() {
-  // standard constructor
-}
-
-//__________________________________________________________________________
-AliITSHuffman::AliITSHNode::AliITSHNode(const AliITSHNode &source): 
-TObject(source),
-fSymbol(source.fSymbol),
-fFrequency(source.fFrequency),
-fLeft(source.fLeft),
-fRight(source.fRight),
-fFather(source.fFather) {
-  //     Copy Constructor 
-  return;
-}
-
-//_________________________________________________________________________
-AliITSHuffman::AliITSHNode& 
-  AliITSHuffman::AliITSHNode::operator=(const AliITSHuffman::AliITSHNode &source) {
-  //    Assignment operator
-  if(&source == this) return *this;
-  this->fSymbol = source.fSymbol;
-  this->fFrequency = source.fFrequency;
-  this->fLeft = source.fLeft;
-  this->fRight = source.fRight;
-  this->fFather = source.fFather;
-  return *this;
-}
-
-//____________________________________________
-Int_t AliITSHuffman::AliITSHNode::Compare(const TObject *obj) const
-{
-  // function called by Sort method of TObjArray
-
-         AliITSHNode *node=(AliITSHNode *)obj;
-        ULong_t f=fFrequency;
-         ULong_t fo=node->fFrequency;
-         if (f>fo) return 1;
-         else if (f<fo) return -1;
-         else return 0;
-}
-
-
-//_____________________________________________________________________________
-
-AliITSHuffman::AliITSHuffman():
-TObject(),
-fSize(0),
-fCodeLen(),
-fCode(),
-fSym(),
-fHNodes(),
-fNnodes(0)
-{
-  // default constructor
-   
-}
-//_____________________________________________________________________________
-
-AliITSHuffman::AliITSHuffman(Int_t size):
-TObject(),
-fSize(size),
-fCodeLen(),
-fCode(),
-fSym(),
-fHNodes(),
-fNnodes(0)
-{
-  //
-  // Creates the look-up table for the 1D compression
-  //
-
-  //initialise
-
-  fCodeLen = new UChar_t[fSize]; 
-  fCode = new ULong_t[fSize]; 
-  fHNodes = new TObjArray;
-  fNnodes=0;
-  fSym= new Short_t[fSize];
-  for (Short_t i=0;i<fSize;i++) {
-       fSym[i]=i;
-  }
-  ClearTable(); 
-
-}
-
-//__________________________________________________________________________
-AliITSHuffman::AliITSHuffman(const AliITSHuffman &source) : 
-TObject(source),
-fSize(source.fSize),
-fCodeLen(source.fCodeLen),
-fCode(source.fCode),
-fSym(source.fSym),
-fHNodes(source.fHNodes),
-fNnodes(source.fNnodes)
-{
-  //     Copy Constructor 
-}
-
-//_________________________________________________________________________
-AliITSHuffman& 
-  AliITSHuffman::operator=(const AliITSHuffman &source) {
-  //    Assignment operator
-  if(&source == this) return *this;
-  this->fSize = source.fSize;
-  this->fCodeLen = source.fCodeLen;
-  this->fCode = source.fCode;
-  this->fSym = source.fSym;
-  this->fHNodes = source.fHNodes;
-  this->fNnodes = source.fNnodes;
-  return *this;
-}
-
-//_____________________________________________________________________________
-void AliITSHuffman::GetFrequencies(Int_t len, UChar_t *stream)
-{
-  // get frequencies
-  printf("Get Frequencies: sym %p \n",(void*)fSym);
-
-  // use temporarily the fCode array to store the frequencies
-  for (Int_t i=0; i< len; i++) {
-      Int_t idx=TMath::BinarySearch(fSize,fSym,(Short_t)stream[i]);
-      if (idx == (Int_t)stream[i]) fCode[idx]++;
-      // test
-      if(idx==134) cout<< "idx fCode[idx]  "<<idx<<" "<<fCode[idx]<<endl;
-      //printf("idx,fCode[i] %d %d\n",idx,(Int_t)fCode[idx]);
-  }
-
-
-}
-
-
-//_____________________________________________________________________________
-void AliITSHuffman::BuildHTable()
-{
-  // build Htable
-
-  for (Int_t i=0; i< fSize; i++) {
-    //printf("i,fCode[i] %d %d\n",i,(Int_t)fCode[i]);
-     if (fCode[i] > 0) {
-        fNnodes++;
-        cout<< "i fCode[i] fNnodes "<<i<<" "<<fCode[i]<<" "<<fNnodes<<endl;
-       //printf("i, fCode[i] fNnodes %d %d %d\n",i,fCode[i],fNnodes);
-        fHNodes->Add(new AliITSHuffman::AliITSHNode((UChar_t)i,fCode[i]));
-     }
-  }
-
-  Int_t nentries=fHNodes->GetEntriesFast();
-  Int_t nindex=nentries-1;  
-  printf("nentries fNnodes nindex %d %d %d\n",nentries,fNnodes,nindex);
-
-  while (nindex > 0) 
-    {
-
-     fHNodes->Sort(nindex);
-     AliITSHNode *aux = new AliITSHNode(0,0);
-     AliITSHNode *node= (AliITSHNode*)fHNodes->UncheckedAt(nindex-1);
-     AliITSHNode *node1= (AliITSHNode*)fHNodes->UncheckedAt(nindex);
-     aux->SetLeft(node);
-     aux->SetRight(node1);
-     aux->SetFrequency(node->GetFrequency() + node1->GetFrequency());
-     printf("symbol symbol1 freq freq1 %d %d %d %d\n",(int)node->GetSymbol(),(int)node1->GetSymbol(),(int)node->GetFrequency(),(int)node1->GetFrequency());
-     cout << "aux - frequency "<< (Int_t)(aux->GetFrequency()) <<endl;
-     fHNodes->RemoveAt(nindex-1);
-     fHNodes->AddAt(aux,nindex-1);
-     nindex--;
-     printf("nindex, obj at nindex %d %p \n",nindex,(void*)fHNodes->UncheckedAt(nindex));
-
-    }
-
-    ClearTable();
-
-    AliITSHNode *start= (AliITSHNode*)fHNodes->UncheckedAt(0);
-    SpanTree(start,0,0);
-    
-    // check the Huffman table
-
-    cout << "...Done, Huffman Table is: \n";
-    for (int c=0; c <= 255; c++) {
-      if (fCodeLen[c] > 0) cout << "Symbol " << c << " Coded as " << fCode[c] << " and long " << (int) fCodeLen[c] << " bits.\n"; 
-    }
-
-}
-
-//_____________________________________________________________________________
-AliITSHuffman::~AliITSHuffman()
-{
-  // HTable
-    printf("HTable destructor !\n");
-    if (fCodeLen) delete[] fCodeLen;
-    if (fCode) delete [] fCode;
-    if (fHNodes) {
-      fHNodes->Delete();
-      delete fHNodes;
-    }
-}
-
-
-//____________________________________________
-Bool_t AliITSHuffman::SpanTree(AliITSHNode *start, ULong_t code, UChar_t len)
-{
-  // span tree
-  AliITSHNode * visited;
-  visited = start;
-
-  printf("outside: code, len %d %d\n",(int)code,(int)len);
-
-  Int_t idx=(Int_t)visited->GetSymbol();
-  if (!visited->GetLeft()) {
-       fCode[idx] = code; 
-       fCodeLen[idx] = len;
-        printf("idx, fCode[idx], fCodeLen[idx] %d %d %d\n",idx,(int)fCode[idx],
-              (int)fCodeLen[idx]);
-       return kTRUE;
-  }
-
-// reccursive stuff
-
-  if (SpanTree(visited->GetLeft(), code << 1, len + 1)) {
-          printf("code, len %d %d\n",(int)code,(int)len);
-         if (visited->GetRight()) 
-                  SpanTree(visited->GetRight(), code << 1 | 0x01, len + 1);
-  }
-  return kTRUE;
-}
-
-//____________________________________________
-void AliITSHuffman::ResetHNodes()
-{
-    //
-    // Reset number of HNodes and the HNodes array 
-    //
-       if (fHNodes)  fHNodes->Clear();
-       if (fNnodes)  fNnodes=0;
-
-}
-
-//_____________________________________________________________________________
-void AliITSHuffman::ClearTable()
-{
-  // clear
-    memset(fCodeLen,0,sizeof(UChar_t)*fSize);
-    memset(fCode,0,sizeof(ULong_t)*fSize);
-}
-
diff --git a/ITS/AliITSHuffman.h b/ITS/AliITSHuffman.h
deleted file mode 100644 (file)
index 054b91b..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef AliITSHUFFMAN_H
-#define AliITSHUFFMAN_H
-
-///////////////////////////////////////////////////
-//  Huffman Table associated classes for set:ITS //
-///////////////////////////////////////////////////
-
-
-#include <TObject.h>
-
-class AliITSInStream;
-class TObjectArray;
-
-
-//___________________________________________
-class AliITSHuffman: public TObject{
-  
-public:
-class AliITSHNode : public TObject {
-
- public:
-  AliITSHNode();
-  AliITSHNode(UChar_t symbol, ULong_t freq);
-  virtual   ~AliITSHNode() {
-    // destructor
-  }
-  AliITSHNode(const AliITSHNode &source); // copy constructor
-  AliITSHNode& operator=(const AliITSHNode &source); // ass. op.
-
-  Bool_t IsSortable() const {
-    // is sortable
-    return kTRUE;
-  }
-  Int_t Compare(const TObject *obj) const;
-  UChar_t GetSymbol() const {return fSymbol;}
-  ULong_t GetFrequency() const {return fFrequency;}
-  AliITSHNode *GetLeft() const {return fLeft;}
-  AliITSHNode *GetRight() const {return fRight;}
-  AliITSHNode *GetFather() const {return fFather;}
-  //  void SetSymbol(UChar_r s){fSymbol=s;}
-  void SetFrequency(ULong_t fq){fFrequency=fq;}
-  void SetLeft(AliITSHNode *n){fLeft = n;}
-  void SetRight(AliITSHNode *n){fRight = n;}
-  void SetFather(AliITSHNode *n){fFather = n;}
-
-
- private:
-
-  UChar_t    fSymbol;        // comment to be written
-  ULong_t    fFrequency;     // comment to be written
-  AliITSHNode     *fLeft;    // comment to be written
-  AliITSHNode     *fRight;   // comment to be written
-  AliITSHNode     *fFather;  // not used
-};  
-  AliITSHuffman(); 
-  AliITSHuffman(Int_t size);
-  virtual   ~AliITSHuffman();
-  AliITSHuffman(const AliITSHuffman &source); // copy constructor
-  AliITSHuffman& operator=(const AliITSHuffman &source); // ass. op.
-  
-  Int_t  Size() const {
-    // size
-    return fSize;
-  }
-  UChar_t   *CodeLen() const {
-    // code len
-    return fCodeLen;
-  }
-  ULong_t *Code() const {
-    // code
-    return fCode;
-  }
-  TObjArray  *HNodes() const {
-    // HNodes
-    return fHNodes;
-  }
-  
-  
-  void GetFrequencies(Int_t len, UChar_t *stream);
-  void BuildHTable();   
-  Bool_t SpanTree(AliITSHuffman::AliITSHNode*start, ULong_t code, UChar_t len);
-  void ResetHNodes();
-  void ClearTable();
-
- protected:
-
-  Int_t          fSize;     // size of the arrays
-  UChar_t       *fCodeLen;  //![fSize] number of bits array
-  ULong_t       *fCode;     //![fSize] coded symbols array
-  
-  Short_t       *fSym;      //![fSize] array of input symbols
-  TObjArray     *fHNodes;   // array of nodes
-  Int_t          fNnodes;   // number of nodes
-
-  ClassDef(AliITSHuffman,1)     //Huffman Table  object for set:ITS
-    };
-
-#endif
diff --git a/ITS/AliITSRawData.cxx b/ITS/AliITSRawData.cxx
deleted file mode 100644 (file)
index c50f28a..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-////////////////////////////////////////////////
-//  RawData classes for set:ITS               //
-////////////////////////////////////////////////
-
-#include <cstring>
-#include "AliITSRawData.h"
-
-ClassImp(AliITSRawData)
-
-ClassImp(AliITSInStream)
-
-//_____________________________________________________________________________
-
-AliITSInStream::AliITSInStream():
-fStreamLen(0),
-fInStream(0){
-  //default constructor
-}
-//_____________________________________________________________________________
-
-AliITSInStream::AliITSInStream(UInt_t length):
-fStreamLen(length),
-fInStream(0){
-  //
-  // Creates a stream of unsigned chars
-  //
-  
-  fInStream = new UChar_t[length];   
-  ClearStream(); 
-  
-}
-
-//_____________________________________________________________________________
-AliITSInStream::~AliITSInStream()
-{
-  //destructor
-  if (fInStream) delete[] fInStream;
-}
-
-//__________________________________________________________________________
-AliITSInStream::AliITSInStream(const AliITSInStream &source) : TObject(source),
-fStreamLen(source.fStreamLen),
-fInStream(source.fInStream){
-  //     Copy Constructor 
-
-}
-
-//_________________________________________________________________________
-AliITSInStream& 
-  AliITSInStream::operator=(const AliITSInStream &source) {
-  //    Assignment operator
-  if(&source == this) return *this;
-  this->fStreamLen = source.fStreamLen;
-  this->fInStream = source.fInStream;
-  return *this;
-}
-
-//_____________________________________________________________________________
-void AliITSInStream::ClearStream()
-{
-  //clear the array
-  memset(fInStream,0,sizeof(UChar_t)*fStreamLen);
-}
-
-
-//_____________________________________________________________________________
-Bool_t AliITSInStream::CheckCount(UInt_t count) {
-  //check boundaries
-  if (count <= (UInt_t)fStreamLen) return kTRUE;
-  else {
-    Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
-    return kFALSE;
-  }
-}
-
-
-ClassImp(AliITSOutStream)
-  
-  //_______________________________________________________________________
-  
-AliITSOutStream::AliITSOutStream():
-fStreamLen(0),
-fOutStream(0){
-  //default constructor
-
-}
-
-//__________________________________________________________________________
-
-AliITSOutStream::AliITSOutStream(UInt_t length):
-fStreamLen(length),
-fOutStream(0){
-  //
-  // Creates a stream of unsigned chars
-  //
-  
-  fOutStream = new UInt_t[length];  
-  ClearStream(); 
-  
-}
-
-//_____________________________________________________________________________
-AliITSOutStream::~AliITSOutStream()
-{
-  //destructor
-  if (fOutStream) delete[] fOutStream;
-}
-
-//__________________________________________________________________________
-AliITSOutStream::AliITSOutStream(const AliITSOutStream &source):TObject(source),
-fStreamLen(source.fStreamLen),
-fOutStream(source.fOutStream){
-  //     Copy Constructor 
-
-}
-
-//_________________________________________________________________________
-AliITSOutStream& 
-  AliITSOutStream::operator=(const AliITSOutStream &source) {
-  //    Assignment operator
-  if(&source == this) return *this;
-  this->fStreamLen = source.fStreamLen;
-  this->fOutStream = source.fOutStream;
-  return *this;
-}
-
-//_____________________________________________________________________________
-void AliITSOutStream::ClearStream()
-{
-  // clear stream
-  memset(fOutStream,0,sizeof(UInt_t)*fStreamLen);
-}
-
-//_____________________________________________________________________________
-Bool_t AliITSOutStream::CheckCount(UInt_t count)
-{
-  //check boundaries
-  if (count < fStreamLen) return kTRUE;
-  else {
-    Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
-    return kFALSE;
-  }
-}
diff --git a/ITS/AliITSRawData.h b/ITS/AliITSRawData.h
deleted file mode 100644 (file)
index f37da07..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef ALIITSRAWDATA_H
-#define ALIITSRAWDATA_H
-
-////////////////////////////////////////////////
-//  RawData classes for set:ITS               //
-////////////////////////////////////////////////
-
-#include <TObject.h>
-
-
-
-class AliITSRawData: public TObject  {
-
-  // most probably it should have a class AliITSHeaderEvent as data member
-   
- public:
-    AliITSRawData() {
-      // constructor
-    }
-    virtual   ~AliITSRawData() {
-      // destructor
-    }
-
-    ClassDef(AliITSRawData,1)     //RawData object for set:ITS
-
-};
-
-//___________________________________________
-class AliITSInStream: public TObject{
-
- public:
-  AliITSInStream();
-  AliITSInStream(UInt_t length);
-  virtual   ~AliITSInStream();
-  AliITSInStream(const AliITSInStream &source); // copy constructor
-  AliITSInStream& operator=(const AliITSInStream &source); // ass. operator
-    
-  void ClearStream();
-  Bool_t CheckCount(UInt_t count);
-  UInt_t  StreamLength() {
-    // stream length
-    return fStreamLen;
-  }
-  UChar_t *Stream() {
-    // stream
-    return fInStream;
-  }
-  
-protected:
-  
-  // input stream of unsigned chars
-  
-  UInt_t     fStreamLen;       // Length of the array
-  UChar_t    *fInStream;        //[fStreamLen] Pointer to an array of input unsigned chararacters
-  
-  
-  
-  ClassDef(AliITSInStream,1)     //Input Stream  object for set:ITS
-    };
-
-//___________________________________________
-class AliITSOutStream: public TObject{
-  
-public:
-  AliITSOutStream();
-  
-  AliITSOutStream(UInt_t length);
-  virtual   ~AliITSOutStream();
-  AliITSOutStream(const AliITSOutStream &source); // copy constructor
-  AliITSOutStream& operator=(const AliITSOutStream &source); // assignment operator
-    
-  void ClearStream();
-  Bool_t CheckCount(UInt_t count);
-  UInt_t  StreamLength() {
-    // stream length
-    return fStreamLen;
-  }
-  UInt_t *Stream() {
-    // stream
-    return fOutStream;
-  }
-  
-protected:
-  
-  // output stream of unsigned chars
-  
-  UInt_t     fStreamLen;        // Length of the array
-  UInt_t    *fOutStream;        //[fStreamLen] Pointer to an array of unsigned long
-  
-  
-
-    ClassDef(AliITSOutStream,1)     //Output Stream  object for set:ITS
-};
-
-
-
-#endif
index efe968c097fb1efeec356cc7186e06001ec08ce5..6a52e36652bda59f9efe1b055bc160cebfc2edb1 100644 (file)
@@ -28,7 +28,6 @@
 #include <TROOT.h>
 #include "AliITS.h"
 #include "AliITSMapA2.h"
-#include "AliITSRawData.h"
 #include "AliITSdigitSPD.h"
 #include "AliITSetfSDD.h"
 #include "AliITSmodule.h"
index 43a632e39f97fd448fa045d81ac67bb8126ef778..c7c6929a037ae010e0ad7e5171275b384aa50831 100644 (file)
@@ -82,7 +82,6 @@ set ( SRCS
     AliITSRawStreamSPD.cxx 
     AliITSEventHeader.cxx 
     AliITSRawStreamSSDv1.cxx 
-    AliITSRawData.cxx 
     AliITSgeomTGeo.cxx 
     AliITSPlaneEff.cxx 
     AliITSPlaneEffSPD.cxx 
index 80351dd61ca9ca3de94e3062921da9bbd5671556..57f5bf7e021a36119b6e5231f0a73f641ac3916d 100644 (file)
@@ -38,8 +38,7 @@ set ( SRCS
     AliITSsimulationSDD.cxx 
     AliITSsimulationSSD.cxx 
     AliITSTableSSD.cxx 
-    AliITSetfSDD.cxx 
-    AliITSHuffman.cxx 
+    AliITSetfSDD.cxx  
     AliITSsDigitize.cxx 
     AliITSDigitizer.cxx 
     AliITSFOEfficiencySPD.cxx 
index 96b9ec26acdde519ab7ce96eb058dac35cd823d2..11885034eb08914c8dbc214c1689781914b4cbe2 100644 (file)
 #pragma link C++ class  AliITSDCSAnalyzerSDD+;
 #pragma link C++ class  AliITSDCSDataSDD+;
 
-#pragma link C++ class  AliITSRawData+;
-// These streamers must be formatted according to the raw data fromat
-#pragma link C++ class  AliITSInStream+;
-#pragma link C++ class  AliITSOutStream+;
 //
 // Raw data
 #pragma link C++ class AliITSDDLRawData+;
index 5c6ff4ad8d2d71b14113f080577378fa5c97b6b5..806b3c19ebfd45b4b3c8bfcc4372868d9008a3ea 100644 (file)
 #pragma link C++ class  AliITSsimulationFastPoints+;
 #pragma link C++ class  AliITSSimuParam+;
 #pragma link C++ class  AliITSDetTypeSim+;
-// These streamers must be formatted according to the raw data fromat
 
-//        #pragma link C++ class  AliITSHNode+;
-#pragma link C++ class  AliITSHuffman+;
 #pragma link C++ class  AliITSetfSDD+;
 // SSD simulation and reconstruction
 #pragma link C++ class AliITSsDigitize+;