]>
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; } | |
c8ab4518 | 65 | void SetLayer(Int_t ix) { fLayer = ix; } |
c8ab4518 | 66 | void SetDetNumber(Int_t ix) { fDet = ix; } |
67 | ||
68 | virtual Int_t GetDetNumber() const { return fDet; } // Get Det number | |
053767a4 | 69 | virtual Int_t GetLayer() const { return fLayer; } // Layer position of the chamber in TRD |
70 | virtual Int_t GetStack() const { return fStack; } // Stack position of the chamber in TRD | |
c8ab4518 | 71 | virtual Int_t GetSM() const { return fSM; } // Super module of the TRD |
72 | TArrayI *GetArray() const { return fIndex; } // Get the tarrayi pointer for god knows what reason | |
ca21baaa | 73 | |
c8ab4518 | 74 | virtual Bool_t HasEntry() const { return fHasEntry; } // Return status if has an entry |
ca21baaa | 75 | |
c8ab4518 | 76 | virtual Int_t GetNrow() const { return fNrows; } // Get Nrows |
77 | virtual Int_t GetNcol() const { return fNcols; } // Get Ncols | |
78 | virtual Int_t GetNtime() const { return fNtbins; } // Get Ntbins | |
ca21baaa | 79 | |
c8ab4518 | 80 | private: |
ca21baaa | 81 | |
c8ab4518 | 82 | Int_t fDet; // Detector number |
053767a4 | 83 | Int_t fLayer; // Layer position in the full TRD |
84 | Int_t fStack; // Stack position in the full TRD | |
c8ab4518 | 85 | Int_t fSM; // Super module - position in the full TRD |
ca21baaa | 86 | |
c8ab4518 | 87 | TArrayI *fIndex; //! Monitor active pads and tbins |
ca21baaa | 88 | |
c8ab4518 | 89 | Int_t fPositionRow; // Position in the index - jumps by 1 + 1 + fNtbins |
90 | Int_t fPositionCol; // Position in the index - jumps by 1 + 1 + fNtbins | |
91 | Int_t fPositionTbin; // Position in the tbin - goes from 0 to fNtbins | |
ca21baaa | 92 | |
c8ab4518 | 93 | Int_t fLastRow; // To keep track what is the RC combination |
94 | Int_t fLastCol; // To keep track what is the RC combination | |
95 | Int_t fLastTbin; // To keep track what is the Tbin - will catch if raw data bogus | |
ca21baaa | 96 | |
c8ab4518 | 97 | Int_t fNrows; // Number of rows in the chamber |
98 | Int_t fNcols; // Number of cols in the chamber | |
99 | Int_t fNtbins; // Number of tbins in the chamber | |
ca21baaa | 100 | |
c8ab4518 | 101 | Int_t fMaxLimit; // Max number of things in the array = nrow*ncol*ntime + nrow*ncol*2 |
102 | Bool_t fResetCounters; // Reset counter status | |
103 | Bool_t fHasEntry; // kTRUE flag if we have an entry | |
ca21baaa | 104 | |
c8ab4518 | 105 | ClassDef(AliTRDSignalIndex,2) // Data container for one TRD detector segment |
ca21baaa | 106 | |
107 | }; | |
ca21baaa | 108 | #endif |