CbmRoot
Loading...
Searching...
No Matches
CbmTrdCluster.h
Go to the documentation of this file.
1/* Copyright (C) 2010-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
11#ifndef CBMTRDCLUSTER_H
12#define CBMTRDCLUSTER_H
13
14#include "CbmCluster.h" // for CbmCluster
15
16#include <Rtypes.h> // for CLRBIT, SETBIT, TESTBIT, ClassDefr
17
18#include <cstdint>
19#include <string> // for string
20#include <vector> // for vector
21
27class CbmTrdCluster : public CbmCluster {
28public:
30 {
31 kFasp = 5
32 ,
33 kStart
34 ,
35 kStop
36 };
41 CbmTrdCluster(const CbmTrdCluster& ref);
42 CbmTrdCluster(const std::vector<int32_t>& indices, int32_t address);
52 CbmTrdCluster(int32_t address, int32_t idx, uint16_t chT, uint16_t chR, int32_t r, int32_t time);
56 virtual ~CbmTrdCluster();
57
59
64 bool AddChannel(bool r = true);
72 bool AddDigi(int32_t idx, uint16_t chT = 0xffff, uint16_t chR = 0, int32_t dt = 0);
74 void Clear(Option_t*);
76 uint16_t GetNCols() const { return fNCols; }
77 uint16_t GetNRows() const { return fNRows & 0x1f; }
78 uint16_t GetEndCh() const { return fStartCh + fNCols - 1; }
79 uint16_t GetRow() const { return GetNRows(); }
80 uint16_t GetSize() const { return GetNCols(); }
81 uint16_t GetStartCh() const { return fStartCh; }
82 uint32_t GetStartTime() const { return fStartTime; }
83 bool HasFaspDigis() const { return TESTBIT(fNRows, kFasp); }
84 bool HasStart() const { return TESTBIT(fNRows, kStart); }
85 bool HasStop() const { return TESTBIT(fNRows, kStop); }
86
92 int32_t IsChannelInRange(uint16_t chT, uint16_t chR) const;
98 bool Merge(CbmTrdCluster* second);
104 void ReInit(int32_t address, int32_t row, int32_t time);
106 void SetNCols(uint16_t ncols) { fNCols = ncols; }
107 void SetNRows(uint16_t nrows)
108 {
109 fNRows &= (7 << 5);
110 fNRows |= (nrows & 0x1f);
111 }
112 void SetFaspDigis(bool set = true) { set ? SETBIT(fNRows, kFasp) : CLRBIT(fNRows, kFasp); }
113 void SetStart(bool set = true) { set ? SETBIT(fNRows, kStart) : CLRBIT(fNRows, kStart); }
114 void SetStop(bool set = true) { set ? SETBIT(fNRows, kStop) : CLRBIT(fNRows, kStop); }
115
117 virtual std::string ToString() const;
118
119protected:
120 uint8_t fNCols = 0; //< number of columns with charge above threshold
121 uint8_t fNRows = 0x1f; //< cluster row info plus extra meta data. Use dedicated getters for the correct value
122 uint16_t fStartCh = 0xffff; //< channel address of first channel
123 uint32_t fStartTime = 0xffffffff;
124
125 ClassDef(CbmTrdCluster, 6) // cluster of digi for the TRD detector
126};
127#endif
Base class for cluster objects.
#define SETBIT(n, i)
Definition RTypes.h:15
#define TESTBIT(n, i)
Definition RTypes.h:17
#define CLRBIT(n, i)
Definition RTypes.h:16
Base class for cluster objects.
Definition CbmCluster.h:30
ClassDef(CbmCluster, 2)
Data Container for TRD clusters.
uint32_t GetStartTime() const
bool HasStart() const
CbmTrdCluster()
Default constructor.
uint32_t fStartTime
void ReInit(int32_t address, int32_t row, int32_t time)
Initialize basic parameters of the cluster.
uint16_t GetNRows() const
void SetStart(bool set=true)
int32_t IsChannelInRange(uint16_t chT, uint16_t chR) const
Query on RO channels list.
virtual ~CbmTrdCluster()
Destructor.
bool AddDigi(int32_t idx, uint16_t chT=0xffff, uint16_t chR=0, int32_t dt=0)
Append digi to cluster.
uint16_t GetRow() const
CbmTrdCluster & operator=(const CbmTrdCluster &ref)
@ kStop
only for triangular if no R in last col
@ kStart
only for triangular if no T in first col
@ kFasp
set type of FEE digis contained
bool AddChannel(bool r=true)
Append a channel to cluster edge. The usage is to account for the masked channels....
void SetStop(bool set=true)
bool HasFaspDigis() const
void SetNCols(uint16_t ncols)
void SetNRows(uint16_t nrows)
uint16_t GetSize() const
virtual std::string ToString() const
Extended functionality.
bool HasStop() const
bool Merge(CbmTrdCluster *second)
Merge current cluster with info from second.
void SetFaspDigis(bool set=true)
uint16_t fStartCh
uint16_t GetStartCh() const
uint16_t GetEndCh() const
void Clear(Option_t *)
reset cluster data
uint16_t GetNCols() const