CbmRoot
CbmTrdCluster.h
Go to the documentation of this file.
1 
7 #ifndef CBMTRDCLUSTER_H
8 #define CBMTRDCLUSTER_H
9 
10 #include <Rtypes.h> // for CLRBIT, SETBIT, TESTBIT, ClassDefr
11 #include <RtypesCore.h> // for Int_t, UShort_t, Bool_t, kTRUE, UChar_t, Opt...
12 
13 #include <string> // for string
14 #include <vector> // for vector
15 
16 #include "CbmCluster.h" // for CbmCluster
17 
23 class CbmTrdCluster : public CbmCluster {
24 public:
26  kTriang = 5
27  ,
29  ,
31  };
35  CbmTrdCluster();
36  CbmTrdCluster(const CbmTrdCluster& ref);
37  CbmTrdCluster(const std::vector<Int_t>& indices, Int_t address);
46  CbmTrdCluster(Int_t address, Int_t idx, Int_t ch, Int_t r, Int_t time);
50  virtual ~CbmTrdCluster();
51 
59  Bool_t
60  AddDigi(Int_t idx, Int_t channel = -1, Int_t terminator = 0, Int_t dt = 0);
62  void Clear(Option_t*);
64  UShort_t GetNCols() const { return fNCols; }
65  UShort_t GetNRows() const { return fNRows & 0x1f; }
66  UShort_t GetEndCh() const { return fStartCh + fNCols - 1; }
67  UShort_t GetRow() const { return GetNRows(); }
68  UShort_t GetStartCh() const { return fStartCh; }
69  UShort_t GetStartTime() const { return fStartTime; }
70  Bool_t HasTrianglePads() const { return TESTBIT(fNRows, kTriang); }
71  Bool_t HasOpenStart() const { return TESTBIT(fNRows, kProfileStart); }
72  Bool_t HasOpenStop() const { return TESTBIT(fNRows, kProfileStop); }
73 
78  Int_t IsChannelInRange(Int_t ch) const;
83  Bool_t Merge(CbmTrdCluster* second);
89  void ReInit(Int_t address, Int_t row, Int_t time);
91  void SetNCols(UShort_t ncols) { fNCols = ncols; }
92  void SetNRows(UShort_t nrows) {
93  fNRows &= (7 << 5);
94  fNRows |= (nrows & 0x1f);
95  }
96  void SetTrianglePads(Bool_t set = kTRUE) {
97  set ? SETBIT(fNRows, kTriang) : CLRBIT(fNRows, kTriang);
98  }
99  void SetProfileStart(Bool_t set = kTRUE) {
100  set ? SETBIT(fNRows, kProfileStart) : CLRBIT(fNRows, kProfileStart);
101  }
102  void SetProfileStop(Bool_t set = kTRUE) {
103  set ? SETBIT(fNRows, kProfileStop) : CLRBIT(fNRows, kProfileStop);
104  }
105 
107  virtual std::string ToString() const;
108 
109 protected:
110  UChar_t fNCols; // number of columns with charge above threshold
111  UChar_t
112  fNRows; // cluster row info plus extra. Use dedicated getters for the correct value
113  UShort_t fStartCh;
114  UShort_t fStartTime;
115 
116  ClassDef(CbmTrdCluster, 4) // cluster of digi for the TRD detector
117 };
118 #endif
CbmTrdCluster::fNRows
UChar_t fNRows
Definition: CbmTrdCluster.h:112
CbmTrdCluster::ReInit
void ReInit(Int_t address, Int_t row, Int_t time)
Initialize basic parameters of the cluster.
Definition: CbmTrdCluster.cxx:112
CbmTrdCluster::GetRow
UShort_t GetRow() const
Definition: CbmTrdCluster.h:67
CbmTrdCluster::SetNCols
void SetNCols(UShort_t ncols)
Definition: CbmTrdCluster.h:91
CbmTrdCluster::GetEndCh
UShort_t GetEndCh() const
Definition: CbmTrdCluster.h:66
CbmTrdCluster::kProfileStart
@ kProfileStart
only for triangular if no T in first col
Definition: CbmTrdCluster.h:28
CbmTrdCluster::IsChannelInRange
Int_t IsChannelInRange(Int_t ch) const
Query on RO channel list.
Definition: CbmTrdCluster.cxx:128
CbmTrdCluster::kTriang
@ kTriang
set type of pads on which the cluster is reconstructed
Definition: CbmTrdCluster.h:26
CbmTrdCluster::ToString
virtual std::string ToString() const
Extended functionality.
Definition: CbmTrdCluster.cxx:201
CbmTrdCluster
Data Container for TRD clusters.
Definition: CbmTrdCluster.h:23
CbmCluster::ClassDef
ClassDef(CbmCluster, 2)
CbmTrdCluster::CbmTrdClusterDef
CbmTrdClusterDef
Definition: CbmTrdCluster.h:25
CbmTrdCluster::CbmTrdCluster
CbmTrdCluster()
Default constructor.
Definition: CbmTrdCluster.cxx:19
CbmTrdCluster::SetTrianglePads
void SetTrianglePads(Bool_t set=kTRUE)
Definition: CbmTrdCluster.h:96
CbmTrdCluster::GetNRows
UShort_t GetNRows() const
Definition: CbmTrdCluster.h:65
CbmTrdCluster::GetStartCh
UShort_t GetStartCh() const
Definition: CbmTrdCluster.h:68
CbmTrdCluster::AddDigi
Bool_t AddDigi(Int_t idx, Int_t channel=-1, Int_t terminator=0, Int_t dt=0)
Append digi to cluster.
Definition: CbmTrdCluster.cxx:62
CbmTrdCluster::SetProfileStart
void SetProfileStart(Bool_t set=kTRUE)
Definition: CbmTrdCluster.h:99
CbmTrdCluster::~CbmTrdCluster
virtual ~CbmTrdCluster()
Destructor.
Definition: CbmTrdCluster.cxx:58
CbmTrdCluster::SetProfileStop
void SetProfileStop(Bool_t set=kTRUE)
Definition: CbmTrdCluster.h:102
CbmTrdCluster::GetNCols
UShort_t GetNCols() const
Definition: CbmTrdCluster.h:64
CbmTrdCluster::HasOpenStop
Bool_t HasOpenStop() const
Definition: CbmTrdCluster.h:72
CbmTrdCluster::GetStartTime
UShort_t GetStartTime() const
Definition: CbmTrdCluster.h:69
CbmCluster
Base class for cluster objects.
Definition: CbmCluster.h:26
CbmTrdCluster::Clear
void Clear(Option_t *)
reset cluster data
Definition: CbmTrdCluster.cxx:103
CbmTrdCluster::HasOpenStart
Bool_t HasOpenStart() const
Definition: CbmTrdCluster.h:71
CbmTrdCluster::HasTrianglePads
Bool_t HasTrianglePads() const
Definition: CbmTrdCluster.h:70
CbmTrdCluster::Merge
Bool_t Merge(CbmTrdCluster *second)
Merge current cluster with info from second.
Definition: CbmTrdCluster.cxx:139
CbmTrdCluster::fStartTime
UShort_t fStartTime
channel address of first channel
Definition: CbmTrdCluster.h:114
CbmTrdCluster::kProfileStop
@ kProfileStop
only for triangular if no R in last col
Definition: CbmTrdCluster.h:30
CbmCluster.h
Base class for cluster objects.
CbmTrdCluster::fNCols
UChar_t fNCols
Definition: CbmTrdCluster.h:110
CbmTrdCluster::SetNRows
void SetNRows(UShort_t nrows)
Definition: CbmTrdCluster.h:92
CbmTrdCluster::fStartCh
UShort_t fStartCh
Definition: CbmTrdCluster.h:113