]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - TRD/AliTRDSignalIndex.h
Updating the main documentation page for new
[u/mrichter/AliRoot.git] / TRD / AliTRDSignalIndex.h
... / ...
CommitLineData
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
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////////////////////////////////////////////////////////////////////////////
20
21#include "TArrayI.h"
22
23class AliTRDSignalIndex : public TObject
24{
25
26 public:
27
28 AliTRDSignalIndex();
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);
33
34 virtual void Copy(TObject &d) const;
35 virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
36
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; }
42
43 virtual void AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
44
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);
51
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 SetLayer(Int_t ix) { fLayer = ix; }
66 void SetDetNumber(Int_t ix) { fDet = ix; }
67
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
73
74 virtual Bool_t HasEntry() const { return fHasEntry; } // Return status if has an entry
75
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
79
80 private:
81
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
86
87 TArrayI *fIndex; //! Monitor active pads and tbins
88
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
92
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
96
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
100
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
104
105 ClassDef(AliTRDSignalIndex,2) // Data container for one TRD detector segment
106
107};
108#endif