]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliSimDigits.h
Changes suggested by Alessandra and Paolo to avoid overlapped
[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////////////////////////////////////////////////
12#include "TError.h"
13#include "AliArrayI.h"
14#include "AliArrayS.h"
1210abef 15#include "AliDigits.h"
16
cc80f89e 17class AliH2F;
18
19
20class AliSimDigits : public AliDigits{
21public:
22 AliSimDigits();
73042f01 23 virtual ~AliSimDigits();
cc80f89e 24 void AllocateTrack(Int_t length); //construct empty buffer fTracks with size rows x column x length (number of tracks for one digit)
73042f01 25 Int_t GetTrackIDFast(Int_t row, Int_t column,Int_t level); //return track ID at given row and collumn
26 void SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level); //set ID track at given row and collumn
cc80f89e 27 virtual Int_t GetTrackID(Int_t row, Int_t column, Int_t level);
28 virtual void ExpandTrackBuffer(); //expand buffer to twodimensional array
29 virtual void CompresTrackBuffer(Int_t bufType); //compres buffer according buffertype algorithm
30 AliH2F * DrawTracks( const char *option=0,Int_t level=0,
31 Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw tracks
32 TClonesArray * GenerTPCClonesArray(TClonesArray * arr); //generate TClonnesArray of digits
33 //only for demonstration purpose
73042f01 34private:
cc80f89e 35 void InvalidateTrack();
36
37 Int_t GetTrackID1(Int_t row, Int_t column, Int_t level); //returnb track ID of digits - for buffer compresion 1
38 void ExpandTrackBuffer1(); //comress track according algorithm 1 (track ID comression independent to the digit compression)
39 void CompresTrackBuffer1(); //comress track according algorithm 1 (track ID comression independent to the digit compression)
40
41 Int_t GetTrackID2(Int_t row, Int_t column, Int_t level); //returnb track ID of digits - for buffer compresion 2
42 void ExpandTrackBuffer2(); //comress track according algorithm 2 (track ID comression according digit compression)
43 void CompresTrackBuffer2(); //comress track according algorithm 2 (track ID comression according digit compression)
44
45 AliArrayI * fTracks; //buffer of track index
46 AliArrayI * fTrIndex; //index position of column
47 Int_t fNlevel; //number of tracks etries for one digit
48 Int_t fTrBufType; //buffer type of the tracks
49 // Bool_t ClassError( ); //signalize class error
50 ClassDef(AliSimDigits,1)
51};
52
53
54
73042f01 55inline Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level)
cc80f89e 56{
57 //
58 //return track ID at given row and column
59 // return fTracks[level].At(fTrIndex[level][column]+row);
60 return fTracks->At(level*fNrows*fNcols+fNrows*column+row);
61}
62
73042f01 63inline void AliSimDigits::SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level)
cc80f89e 64{
73042f01 65 //
66 value+=2;
cc80f89e 67 //set ID track at given row and collumn
68 // fTracks[level][fTrIndex[level][column]+row]=value;
69 if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNcols) )
70 ::Error("AliSimDigits::SetTrackIDFast", "row %d col %d out of bounds (size: %d x %d, this: 0x%08x)",
71 row, column, fNrows, fNcols, this);
72 if ( (level<0) || (level>=fNlevel)) ::Error("AliSimDigits::SetTrackIDFast", "index %d out of bounds", level);
73 (*fTracks)[level*fNrows*fNcols+fNrows*column+row]=value;
74}
75
76
77
78#endif
73042f01 79
80
81
82
83
84