]>
Commit | Line | Data |
---|---|---|
ca21baaa | 1 | #ifndef AliTRDSIGNALINDEX_H |
2 | #define AliTRDSIGNALINDEX_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | #include "TObject.h" | |
10 | ||
c8ab4518 | 11 | //////////////////////////////////////////////////////////////////////////// |
12 | // // | |
13 | // General container for data from TRD detector segments // | |
14 | // Adapted from AliDigits, origin M.Ivanov // | |
15 | // // | |
16 | // Author: // | |
17 | // Mateusz Ploskon (ploskon@ikf.uni-frankfurt.de) // | |
18 | // // | |
19 | //////////////////////////////////////////////////////////////////////////// | |
ca21baaa | 20 | |
ca21baaa | 21 | #include "TArrayI.h" |
22 | ||
23 | class AliTRDSignalIndex : public TObject | |
24 | { | |
c8ab4518 | 25 | |
ca21baaa | 26 | public: |
27 | ||
28 | AliTRDSignalIndex(); | |
29 | AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime); | |
30 | AliTRDSignalIndex(const AliTRDSignalIndex &d); | |
c8ab4518 | 31 | virtual ~AliTRDSignalIndex(); |
ca21baaa | 32 | AliTRDSignalIndex &operator=(const AliTRDSignalIndex &d); |
ca21baaa | 33 | |
c8ab4518 | 34 | virtual void Copy(TObject &d) const; |
35 | virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime); | |
001be664 | 36 | |
c8ab4518 | 37 | virtual void Reset(); |
38 | virtual void ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime); | |
39 | virtual void ResetContent(); | |
40 | virtual void ResetCounters(); | |
41 | virtual void ResetTbinCounter() { fPositionTbin = 1; } | |
001be664 | 42 | |
c8ab4518 | 43 | virtual void AddIndexTBin(Int_t row, Int_t col, Int_t tbin); |
001be664 | 44 | |
c8ab4518 | 45 | // Get the next pad (row and column) and return kTRUE on success |
46 | Bool_t NextRCIndex(Int_t &row, Int_t &col); | |
47 | // Get the next timebin of a pad (row and column) and return kTRUE on success | |
48 | Bool_t NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin); | |
49 | // Get the next active timebin and return kTRUE on success | |
50 | Bool_t NextTbinIndex(Int_t &tbin); | |
ca21baaa | 51 | |
c8ab4518 | 52 | Int_t GetCurrentRow() const { return (*fIndex)[fPositionRow]; } |
53 | Int_t GetCurrentCol() const { return (*fIndex)[fPositionCol]; } | |
54 | Int_t GetCurrentTbin() const { return (*fIndex)[fPositionCol + fPositionTbin]; } | |
55 | ||
56 | // Clear the array, actually destroy and recreate w/o allocating | |
57 | void ClearAll(); | |
58 | // Return kTRUE if array allocated and there is no need to call allocate | |
59 | Bool_t IsAllocated() const { if (!fIndex) return kFALSE; | |
60 | if (fIndex->GetSize() <= 0) return kFALSE; | |
61 | else return kTRUE; } | |
62 | ||
63 | void SetSM(Int_t ix) { fSM = ix; } | |
64 | void SetStack(Int_t ix) { fStack = ix; } | |
65 | void SetChamber(Int_t ix) { SetStack(ix); } | |
66 | void SetLayer(Int_t ix) { fLayer = ix; } | |
67 | void SetPlane(Int_t ix) { SetLayer(ix); } | |
68 | void SetDetNumber(Int_t ix) { fDet = ix; } | |
69 | ||
70 | virtual Int_t GetDetNumber() const { return fDet; } // Get Det number | |
71 | virtual Int_t GetLayer() const { return fLayer; } // Layer = Plane = position of the chamber in TRD | |
72 | virtual Int_t GetPlane() const { return fLayer; } // Layer = Plane = position of the chamber in TRD | |
73 | virtual Int_t GetStack() const { return fStack; } // Stack = Chameber = position of the chamber in TRD | |
74 | virtual Int_t GetChamber() const { return fStack; } // Stack = Chameber = position of the chamber in TRD | |
75 | virtual Int_t GetSM() const { return fSM; } // Super module of the TRD | |
76 | TArrayI *GetArray() const { return fIndex; } // Get the tarrayi pointer for god knows what reason | |
ca21baaa | 77 | |
c8ab4518 | 78 | virtual Bool_t HasEntry() const { return fHasEntry; } // Return status if has an entry |
ca21baaa | 79 | |
c8ab4518 | 80 | virtual Int_t GetNrow() const { return fNrows; } // Get Nrows |
81 | virtual Int_t GetNcol() const { return fNcols; } // Get Ncols | |
82 | virtual Int_t GetNtime() const { return fNtbins; } // Get Ntbins | |
ca21baaa | 83 | |
c8ab4518 | 84 | private: |
ca21baaa | 85 | |
c8ab4518 | 86 | Int_t fDet; // Detector number |
87 | Int_t fLayer; // Aka plane - position in the full TRD | |
88 | Int_t fStack; // Aka chamber - position in the full TRD | |
89 | Int_t fSM; // Super module - position in the full TRD | |
ca21baaa | 90 | |
c8ab4518 | 91 | TArrayI *fIndex; //! Monitor active pads and tbins |
ca21baaa | 92 | |
c8ab4518 | 93 | Int_t fPositionRow; // Position in the index - jumps by 1 + 1 + fNtbins |
94 | Int_t fPositionCol; // Position in the index - jumps by 1 + 1 + fNtbins | |
95 | Int_t fPositionTbin; // Position in the tbin - goes from 0 to fNtbins | |
ca21baaa | 96 | |
c8ab4518 | 97 | Int_t fLastRow; // To keep track what is the RC combination |
98 | Int_t fLastCol; // To keep track what is the RC combination | |
99 | Int_t fLastTbin; // To keep track what is the Tbin - will catch if raw data bogus | |
ca21baaa | 100 | |
c8ab4518 | 101 | Int_t fNrows; // Number of rows in the chamber |
102 | Int_t fNcols; // Number of cols in the chamber | |
103 | Int_t fNtbins; // Number of tbins in the chamber | |
ca21baaa | 104 | |
c8ab4518 | 105 | Int_t fMaxLimit; // Max number of things in the array = nrow*ncol*ntime + nrow*ncol*2 |
106 | Bool_t fResetCounters; // Reset counter status | |
107 | Bool_t fHasEntry; // kTRUE flag if we have an entry | |
ca21baaa | 108 | |
c8ab4518 | 109 | ClassDef(AliTRDSignalIndex,2) // Data container for one TRD detector segment |
ca21baaa | 110 | |
111 | }; | |
ca21baaa | 112 | #endif |