Patch for the tracker
[u/mrichter/AliRoot.git] / TPC / AliSimDigits.h
CommitLineData
cc80f89e 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////////////////////////////////////////////////
9// Manager class generaol Alice segment digits
10// segment is for example one pad row in TPC //
11////////////////////////////////////////////////
e756ece8 12#include <TError.h>
13#include <TArrayI.h>
04fa961a 14#include <TClonesArray.h>
e756ece8 15#include "AliDigits.h"
1210abef 16
cc80f89e 17class AliH2F;
18
19
20class AliSimDigits : public AliDigits{
21public:
22 AliSimDigits();
179c6296 23 AliSimDigits(const AliSimDigits &param);
24 AliSimDigits &operator = (const AliSimDigits & digits);
73042f01 25 virtual ~AliSimDigits();
cc80f89e 26 void AllocateTrack(Int_t length); //construct empty buffer fTracks with size rows x column x length (number of tracks for one digit)
407ff276 27 Int_t *GetTracks(){return fTracks->GetArray();}
73042f01 28 Int_t GetTrackIDFast(Int_t row, Int_t column,Int_t level); //return track ID at given row and collumn
29 void SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level); //set ID track at given row and collumn
cc80f89e 30 virtual Int_t GetTrackID(Int_t row, Int_t column, Int_t level);
31 virtual void ExpandTrackBuffer(); //expand buffer to twodimensional array
32 virtual void CompresTrackBuffer(Int_t bufType); //compres buffer according buffertype algorithm
33 AliH2F * DrawTracks( const char *option=0,Int_t level=0,
34 Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw tracks
35 TClonesArray * GenerTPCClonesArray(TClonesArray * arr); //generate TClonnesArray of digits
36 //only for demonstration purpose
58c45a5e 37 void GlitchFilter();
73042f01 38private:
cc80f89e 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
e756ece8 49 TArrayI * fTracks; //buffer of track index
50 TArrayI * fTrIndex; //index position of column
cc80f89e 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
58c45a5e 54 ClassDef(AliSimDigits,3)
cc80f89e 55};
56
57
58
73042f01 59inline Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level)
cc80f89e 60{
61 //
62 //return track ID at given row and column
63 // return fTracks[level].At(fTrIndex[level][column]+row);
64 return fTracks->At(level*fNrows*fNcols+fNrows*column+row);
65}
66
73042f01 67inline void AliSimDigits::SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level)
cc80f89e 68{
73042f01 69 //
70 value+=2;
cc80f89e 71 //set ID track at given row and collumn
72 // fTracks[level][fTrIndex[level][column]+row]=value;
73 if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNcols) )
07695336 74 ::Error("AliSimDigits::SetTrackIDFast", "row %d col %d out of bounds (size: %d x %d, this: 0x%08lx)",
75 row, column, fNrows, fNcols, (ULong_t) this);
cc80f89e 76 if ( (level<0) || (level>=fNlevel)) ::Error("AliSimDigits::SetTrackIDFast", "index %d out of bounds", level);
77 (*fTracks)[level*fNrows*fNcols+fNrows*column+row]=value;
78}
79
80
81
82#endif
73042f01 83
84
85
86
87
88