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 ////////////////////////////////////////////////////////////////////////////
13 // General container for data from TRD detector segments //
14 // Adapted from AliDigits, origin M.Ivanov //
17 // Mateusz Ploskon (ploskon@ikf.uni-frankfurt.de) //
19 ////////////////////////////////////////////////////////////////////////////
23 class AliTRDSignalIndex : public TObject
29 AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime);
30 AliTRDSignalIndex(const AliTRDSignalIndex &d);
31 virtual ~AliTRDSignalIndex();
32 AliTRDSignalIndex &operator=(const AliTRDSignalIndex &d);
34 virtual void Copy(TObject &d) const;
35 virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
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; }
43 virtual void AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
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);
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]; }
56 // Clear the array, actually destroy and recreate w/o allocating
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;
63 void SetSM(Int_t ix) { fSM = ix; }
64 void SetStack(Int_t ix) { fStack = ix; }
65 void SetLayer(Int_t ix) { fLayer = ix; }
66 void SetDetNumber(Int_t ix) { fDet = ix; }
68 virtual Int_t GetDetNumber() const { return fDet; } // Get Det number
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
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
74 virtual Bool_t HasEntry() const { return fHasEntry; } // Return status if has an entry
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
82 Int_t fDet; // Detector number
83 Int_t fLayer; // Layer position in the full TRD
84 Int_t fStack; // Stack position in the full TRD
85 Int_t fSM; // Super module - position in the full TRD
87 TArrayI *fIndex; //! Monitor active pads and tbins
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
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
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
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
105 ClassDef(AliTRDSignalIndex,2) // Data container for one TRD detector segment