1 #ifndef AliTRDSIGNALINDEX_H
2 #define AliTRDSIGNALINDEX_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
11 /////////////////////////////////////////////////////////////
12 // General container for data from TRD detector segments //
13 // Adapted from AliDigits, origin M.Ivanov //
14 /////////////////////////////////////////////////////////////
19 class AliTRDSignalIndex : public TObject
24 AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime);
25 AliTRDSignalIndex(const AliTRDSignalIndex &d);
26 virtual ~AliTRDSignalIndex(); // destructor
27 AliTRDSignalIndex &operator=(const AliTRDSignalIndex &d);
28 virtual void Copy(TObject &d) const;
29 virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
32 virtual void ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime);
33 virtual void ResetContent();
35 virtual void ResetCounters()
37 // reset the counters/iterators
39 fPositionCol = fPositionRow + 1;
46 fResetCounters = kTRUE;
49 virtual void ResetTbinCounter()
51 // reset the time bin counter
56 virtual void AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
58 Bool_t NextRCIndex(Int_t &row, Int_t &col); // get the next pad (row and column) and return kTRUE on success
59 Bool_t NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin); // get the next timebin of a pad (row and column) and return kTRUE on success
60 Bool_t NextTbinIndex(Int_t &tbin); // get the next active timebin and return kTRUE on success
62 Int_t GetCurrentRow() {return (*fIndex)[fPositionRow];} // current row
63 Int_t GetCurrentCol() {return (*fIndex)[fPositionCol];} // current col
64 Int_t GetCurtentTbin() {return (*fIndex)[fPositionCol + fPositionTbin];} //current tbin
66 void ClearAll(); // clear the array, actually destroy and recreate w/o allocating
68 //void Dump(); // printf content - one way of iterating demo
69 //void Dump2(); // printf content - another way of iterating demo
71 //Bool_t IsAllocated() const {if (fIndex) return kTRUE; else return kFALSE;}
72 Bool_t IsAllocated() const
74 // return kTRUE if array allocated and there is no need to call allocate
77 if (fIndex->GetSize() <= 0)
88 void SetStack(Int_t ix)
94 void SetChamber(Int_t ix)
100 void SetLayer(Int_t ix)
106 void SetPlane(Int_t ix)
112 void SetDetNumber(Int_t ix)
118 virtual Int_t GetDetNumber() const {return fDet;} // Get Det number
119 virtual Int_t GetLayer() const {return fLayer;} // Layer = Plane = position of the chamber in TRD
120 virtual Int_t GetPlane() const {return fLayer;} // Layer = Plane = position of the chamber in TRD
121 virtual Int_t GetStack() const {return fStack;} // Stack = Chameber = position of the chamber in TRD
122 virtual Int_t GetChamber() const {return fStack;} // Stack = Chameber = position of the chamber in TRD
123 virtual Int_t GetSM() const {return fSM;} // Super module of the TRD
125 virtual Bool_t HasEntry() const {return fHasEntry;} // Return status if has an entry
127 TArrayI *GetArray() const {return fIndex;} // Get the tarrayi pointer for god knows what reason
129 virtual Int_t GetNrow() const {return fNrows;} // Get Nrows
130 virtual Int_t GetNcol() const {return fNcols;} // Get Ncols
131 virtual Int_t GetNtime() const {return fNtbins;} // Get Ntbins
133 //enum { kMaxRows = 16, kMaxTbins = 24, kMaxCols = 144};
137 Int_t fDet; // det number
138 Int_t fLayer; // aka plane - position in the full TRD
139 Int_t fStack; // aka chamber - position in the full TRD
140 Int_t fSM; // super module - position in the full TRD
144 TArrayI *fIndex; //! monitor active pads and tbins
146 Int_t fPositionRow; // position in the index - jumps by 1 + 1 + fNtbins
147 Int_t fPositionCol; // position in the index - jumps by 1 + 1 + fNtbins
148 Int_t fPositionTbin; // position in the tbin - goes from 0 to fNtbins
150 Int_t fLastRow; // to keep track what is the RC combination
151 Int_t fLastCol; // to keep track what is the RC combination
152 Int_t fLastTbin; // to keep track what is the Tbin - will catch if raw data bogus
154 Int_t fNrows; // number of rows in the chamber
155 Int_t fNcols; // number of cols in the chamber
156 Int_t fNtbins; // number of tbins in the chamber
158 Int_t fMaxLimit; // max number of things in the array = nrow * ncol * ntime + nrow * ncol * 2
160 Bool_t fResetCounters; // reset counter status
162 Bool_t fHasEntry; // kTRUE flag if we have an entry
164 ClassDef(AliTRDSignalIndex,1) // Data container for one TRD detector segment