LCOV - code coverage report
Current view: top level - TPC/TPCbase - AliSimDigits.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 10 70.0 %
Date: 2016-06-14 17:26:59 Functions: 4 8 50.0 %

          Line data    Source code
       1             : #ifndef ALISIMDIGITS_H
       2             : #define ALISIMDIGITS_H
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /* $Id$ */
       7             : 
       8             : /// \class AliSimDigits
       9             : ///
      10             : ///  Manager class generaol Alice segment digits
      11             : ///  segment is for example one pad row in TPC
      12             : 
      13             : #include <TError.h>
      14             : #include <TArrayI.h>
      15             : #include <TClonesArray.h>
      16             : #include   "AliDigits.h"
      17             : 
      18             : class AliH2F;
      19             : 
      20             : 
      21             : class AliSimDigits : public AliDigits{
      22             : public: 
      23             :   AliSimDigits();
      24             :   AliSimDigits(const AliSimDigits &param);
      25             :   AliSimDigits &operator = (const AliSimDigits & digits); 
      26             :   virtual ~AliSimDigits();
      27             :   void AllocateTrack(Int_t length);  //construct empty buffer fTracks with size rows x column x length (number of tracks for one digit)
      28           0 :   Int_t *GetTracks(){return fTracks->GetArray();}
      29             :   Int_t GetTrackIDFast(Int_t row, Int_t column,Int_t level);  //return track ID  at given row and collumn
      30             :   void  SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level);  //set ID track at given row and collumn
      31             :   virtual Int_t GetTrackID(Int_t row, Int_t column, Int_t level);
      32             :   virtual void ExpandTrackBuffer();  //expand buffer to twodimensional array
      33             :   virtual void CompresTrackBuffer(Int_t bufType); //compres buffer according buffertype algorithm 
      34             :   AliH2F *  DrawTracks( const char *option=0,Int_t level=0, 
      35             :                   Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw tracks
      36             :   //only for demonstration purpose
      37             :   void GlitchFilter();
      38             : private:
      39             :   void InvalidateTrack();
      40             :  
      41             :   Int_t GetTrackID1(Int_t row, Int_t column, Int_t level);  //returnb track ID of digits - for buffer compresion 1 
      42             :   void  ExpandTrackBuffer1(); //comress track according algorithm 1 (track ID comression independent to the digit compression) 
      43             :   void  CompresTrackBuffer1(); //comress track according algorithm 1 (track ID comression independent to the digit compression)
      44             :  
      45             :   Int_t GetTrackID2(Int_t row, Int_t column, Int_t level);  //returnb track ID of digits - for buffer compresion 2
      46             :   void  ExpandTrackBuffer2(); //comress track according algorithm 2 (track ID comression according  digit compression)
      47             :   void  CompresTrackBuffer2(); //comress track according algorithm 2 (track ID comression according  digit compression)
      48             : 
      49             :   TArrayI * fTracks;     ///< buffer of track index
      50             :   TArrayI * fTrIndex;    ///< index position of column
      51             :   Int_t       fNlevel;   ///< number of tracks etries  for one digit
      52             :   Int_t       fTrBufType;  ///< buffer type of the tracks
      53             :   // Bool_t      ClassError( ); //signalize class error 
      54             :   /// \cond CLASSIMP
      55          50 :   ClassDef(AliSimDigits,3) 
      56             :   /// \endcond
      57             : };
      58             : 
      59             : 
      60             : 
      61             : inline Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level)
      62             : {
      63             :   /// return track ID  at given row and column
      64             :   ///  return fTracks[level].At(fTrIndex[level][column]+row);
      65             : 
      66      194844 :   return fTracks->At(level*fNrows*fNcols+fNrows*column+row); 
      67             : }
      68             :  
      69             : inline void AliSimDigits::SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level)
      70             : {
      71             :   ///
      72             : 
      73    23160828 :   value+=2;
      74             :   //set ID track at given row and collumn
      75             :   //  fTracks[level][fTrIndex[level][column]+row]=value; 
      76    34741242 :   if ( (row<0) || (row>=fNrows)  || (column<0) || (column>=fNcols) ) 
      77           0 :        ::Error("AliSimDigits::SetTrackIDFast", "row %d  col %d out of bounds (size: %d x %d, this: 0x%08lx)", 
      78           0 :                row, column, fNrows, fNcols, (ULong_t) this);
      79    23160828 :   if ( (level<0) || (level>=fNlevel)) ::Error("AliSimDigits::SetTrackIDFast", "index %d out of bounds", level);
      80    11580414 :   (*fTracks)[level*fNrows*fNcols+fNrows*column+row]=value; 
      81    11580414 : }
      82             : 
      83             : 
      84             : 
      85             : #endif
      86             : 
      87             : 
      88             : 
      89             : 
      90             : 
      91             : 

Generated by: LCOV version 1.11