CbmRoot
Loading...
Searching...
No Matches
CbmTrdHit.h
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Matus Kalisky [committer], Florian Uhlig, Andrey Lebedev */
4
12#ifndef CBMTRDHIT_H_
13#define CBMTRDHIT_H_
14
15#include "CbmPixelHit.h" // for CbmPixelHit
16#include "CbmTrdAddress.h" // for CbmTrdAddress
17
18#include <Rtypes.h> // for CLRBIT, SETBIT, TESTBIT, ClassDef
19#include <RtypesCore.h> // for Double32_t
20
21#include <cstdint>
22#include <string> // for string
23
24class TVector3;
25
40class CbmTrdHit : public CbmPixelHit {
41public:
43 {
44 kType = 0
45 ,
47 ,
49 ,
50 kOvfl
51 };
55 CbmTrdHit();
56
66 CbmTrdHit(int32_t address, const TVector3& pos, const TVector3& dpos, double dxy, int32_t refId, double eLoss,
67 double time = 0., double timeError = 0.);
68
70 virtual ~CbmTrdHit();
71
73 int32_t GetPlaneId() const { return CbmTrdAddress::GetLayerId(GetAddress()); }
74
76 virtual std::string ToString() const;
77
79 double GetELoss() const { return fELoss; }
80 bool GetClassType() const { return TESTBIT(fDefine, kType); }
81 bool GetMaxType() const { return TESTBIT(fDefine, kMaxType); }
82 bool HasOverFlow() const { return TESTBIT(fDefine, kOvfl); }
83 bool IsRowCross() const { return TESTBIT(fDefine, kRowCross); }
84 bool IsUsed() const { return (GetRefId() < 0); }
85
87 void SetELoss(double loss) { fELoss = loss; }
89 void SetOverFlow(bool set = true) { set ? SETBIT(fDefine, kOvfl) : CLRBIT(fDefine, kOvfl); }
91 void SetRowCross(bool set = true) { set ? SETBIT(fDefine, kRowCross) : CLRBIT(fDefine, kRowCross); }
93 void SetClassType(bool set = true) { set ? SETBIT(fDefine, kType) : CLRBIT(fDefine, kType); }
95 void SetMaxType(bool set = true) { set ? SETBIT(fDefine, kMaxType) : CLRBIT(fDefine, kMaxType); }
96
97private:
98 uint8_t fDefine; // hit extra info
99 int32_t fNeighborId; // refId in case of row cross clusters
100 Double32_t fELoss; // Energy deposit due to TR + dEdx
101
103};
104
105#endif
TVector3 dpos
Helper class to convert unique channel ID back and forth.
#define SETBIT(n, i)
Definition RTypes.h:15
#define TESTBIT(n, i)
Definition RTypes.h:17
#define CLRBIT(n, i)
Definition RTypes.h:16
int32_t GetAddress() const
Definition CbmHit.h:74
int32_t GetRefId() const
Definition CbmHit.h:73
static uint32_t GetLayerId(uint32_t address)
Return layer ID from address.
data class for a reconstructed Energy-4D measurement in the TRD
Definition CbmTrdHit.h:40
double GetELoss() const
Definition CbmTrdHit.h:79
bool GetClassType() const
Definition CbmTrdHit.h:80
void SetELoss(double loss)
Definition CbmTrdHit.h:87
bool IsRowCross() const
Definition CbmTrdHit.h:83
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition CbmTrdHit.cxx:42
int32_t fNeighborId
Definition CbmTrdHit.h:99
void SetClassType(bool set=true)
Type of pad layout used in reconstruction R[0], T[1].
Definition CbmTrdHit.h:93
void SetOverFlow(bool set=true)
Mark overflow in one or more digits which define the hit.
Definition CbmTrdHit.h:89
bool IsUsed() const
Definition CbmTrdHit.h:84
Double32_t fELoss
Definition CbmTrdHit.h:100
virtual ~CbmTrdHit()
Destructor.
Definition CbmTrdHit.cxx:40
void SetMaxType(bool set=true)
Extra bool definition for the hit (e.g. the type of maximum for triangular pads).
Definition CbmTrdHit.h:95
ClassDef(CbmTrdHit, 4)
bool GetMaxType() const
Definition CbmTrdHit.h:81
@ kType
set type of pad layout
Definition CbmTrdHit.h:44
@ kOvfl
mark over-flow in the data
Definition CbmTrdHit.h:50
@ kMaxType
set type of pad on which the maximum charge is found
Definition CbmTrdHit.h:46
@ kRowCross
mark hit defined by 2 clusters
Definition CbmTrdHit.h:48
int32_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition CbmTrdHit.h:73
CbmTrdHit()
Default constructor.
Definition CbmTrdHit.cxx:21
bool HasOverFlow() const
Definition CbmTrdHit.h:82
void SetRowCross(bool set=true)
Mark hit reconstructed between pad rows.
Definition CbmTrdHit.h:91
uint8_t fDefine
Definition CbmTrdHit.h:98