AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliSimDigits.h
Go to the documentation of this file.
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 
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  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;
50  TArrayI * fTrIndex;
51  Int_t fNlevel;
52  Int_t fTrBufType;
53  // Bool_t ClassError( ); //signalize class error
55  ClassDef(AliSimDigits,3)
56 
57 };
58 
59 
60 
61 inline Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level)
62 {
65 
66  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 {
72 
73  value+=2;
74  //set ID track at given row and collumn
75  // fTracks[level][fTrIndex[level][column]+row]=value;
76  if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNcols) )
77  ::Error("AliSimDigits::SetTrackIDFast", "row %d col %d out of bounds (size: %d x %d, this: 0x%08lx)",
78  row, column, fNrows, fNcols, (ULong_t) this);
79  if ( (level<0) || (level>=fNlevel)) ::Error("AliSimDigits::SetTrackIDFast", "index %d out of bounds", level);
80  (*fTracks)[level*fNrows*fNcols+fNrows*column+row]=value;
81 }
82 
83 
84 
85 #endif
86 
87 
88 
89 
90 
91 
Int_t * GetTracks()
Definition: AliSimDigits.h:28
virtual ~AliSimDigits()
void SetTrackIDFast(Int_t value, Int_t row, Int_t column, Int_t level)
Definition: AliSimDigits.h:69
void ExpandTrackBuffer2()
TArrayI * fTrIndex
index position of column
Definition: AliSimDigits.h:50
void GlitchFilter()
Int_t fNlevel
number of tracks etries for one digit
Definition: AliSimDigits.h:51
void AllocateTrack(Int_t length)
virtual Int_t GetTrackID(Int_t row, Int_t column, Int_t level)
void CompresTrackBuffer2()
void ExpandTrackBuffer1()
AliH2F * DrawTracks(const char *option=0, Int_t level=0, Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1)
TArrayI * fTracks
buffer of track index
Definition: AliSimDigits.h:49
virtual void CompresTrackBuffer(Int_t bufType)
Int_t GetTrackID2(Int_t row, Int_t column, Int_t level)
virtual void ExpandTrackBuffer()
Int_t GetTrackIDFast(Int_t row, Int_t column, Int_t level)
Definition: AliSimDigits.h:61
Definition: AliH2F.h:16
Int_t fNrows
number of rows in Segment
Definition: AliDigits.h:63
AliSimDigits & operator=(const AliSimDigits &digits)
Int_t fTrBufType
buffer type of the tracks
Definition: AliSimDigits.h:52
Int_t fNcols
number of collumns in Segment
Definition: AliDigits.h:64
void InvalidateTrack()
void CompresTrackBuffer1()
Int_t GetTrackID1(Int_t row, Int_t column, Int_t level)