CbmRoot
Loading...
Searching...
No Matches
CbmHit.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer], Andrey Lebedev, Volker Friese */
4
17#ifndef CBMHIT_H_
18#define CBMHIT_H_
19
35
36#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
37#include <TObject.h> // for TObject
38
39#include <cstdint>
40#include <string> // for string, basic_string
41
42class CbmMatch;
43
44class CbmHit : public TObject {
45public:
49 CbmHit();
50
61 CbmHit(HitType _type, double _z, double _dz, int32_t _refId, int32_t _address, double _time = -1.,
62 double _timeError = -1.);
63
67 virtual ~CbmHit();
68
69 /* Accessors */
70 HitType GetType() const { return fType; }
71 double GetZ() const { return fZ; }
72 double GetDz() const { return fDz; }
73 int32_t GetRefId() const { return fRefId; }
74 int32_t GetAddress() const { return fAddress; }
75 CbmMatch* GetMatch() const { return fMatch; }
76 double GetTime() const { return fTime; }
77 double GetTimeError() const { return fTimeError; }
78
79 /* Setters */
80 void SetZ(double z) { fZ = z; }
81 void SetDz(double dz) { fDz = dz; }
82 void SetRefId(int32_t refId) { fRefId = refId; }
83 void SetAddress(int32_t address) { fAddress = address; }
84 void SetMatch(CbmMatch* match);
85 void SetTime(double time) { fTime = time; }
86 void SetTime(double time, double error)
87 {
88 fTime = time;
89 fTimeError = error;
90 }
91 void SetTimeError(double error) { fTimeError = error; }
92
99 virtual int32_t GetPlaneId() const { return -1; }
100
105 virtual std::string ToString() const { return "Has to be implemented in derrived class"; }
106
107protected:
112 void SetType(HitType type) { fType = type; }
113 CbmHit(const CbmHit&);
114 CbmHit& operator=(const CbmHit&);
115
116
117private:
119 double fZ;
120 double fDz;
121 int32_t fRefId;
122 int32_t fAddress;
123 double fTime;
124 double fTimeError;
126
128};
129
130#endif /* CBMHIT_H_ */
HitType
Definition CbmHit.h:21
@ kSTSHIT
Definition CbmHit.h:25
@ kHIT
Definition CbmHit.h:22
@ kMUCHSTRAWHIT
Definition CbmHit.h:29
@ kTOFHIT
Definition CbmHit.h:31
@ kPIXELHIT
Definition CbmHit.h:23
@ kMVDHIT
Definition CbmHit.h:26
@ kFSDHIT
Definition CbmHit.h:33
@ kTRDHIT
Definition CbmHit.h:30
@ kSTRIPHIT
Definition CbmHit.h:24
@ kRICHHIT
Definition CbmHit.h:27
@ kECALHIT
Definition CbmHit.h:32
@ kMUCHPIXELHIT
Definition CbmHit.h:28
int32_t fRefId
some reference id (usually to cluster, digi or MC point)
Definition CbmHit.h:121
CbmHit()
Default constructor.
Definition CbmHit.cxx:18
void SetTimeError(double error)
Definition CbmHit.h:91
void SetMatch(CbmMatch *match)
Definition CbmHit.cxx:70
void SetDz(double dz)
Definition CbmHit.h:81
double GetTimeError() const
Definition CbmHit.h:77
void SetAddress(int32_t address)
Definition CbmHit.h:83
ClassDef(CbmHit, 3)
double fDz
Z position error [cm].
Definition CbmHit.h:120
double fZ
Z position of hit [cm].
Definition CbmHit.h:119
double GetDz() const
Definition CbmHit.h:72
HitType fType
hit type
Definition CbmHit.h:118
double GetTime() const
Definition CbmHit.h:76
void SetType(HitType type)
Sets hit type.
Definition CbmHit.h:112
CbmHit & operator=(const CbmHit &)
Definition CbmHit.cxx:48
int32_t GetAddress() const
Definition CbmHit.h:74
CbmMatch * fMatch
Monte-Carlo information.
Definition CbmHit.h:125
void SetZ(double z)
Definition CbmHit.h:80
HitType GetType() const
Definition CbmHit.h:70
double fTime
Hit time [ns].
Definition CbmHit.h:123
virtual std::string ToString() const
Virtual function. Must be implemented in derived class. Has to return string representation of the ob...
Definition CbmHit.h:105
virtual int32_t GetPlaneId() const
Definition CbmHit.h:99
void SetRefId(int32_t refId)
Definition CbmHit.h:82
double GetZ() const
Definition CbmHit.h:71
void SetTime(double time)
Definition CbmHit.h:85
void SetTime(double time, double error)
Definition CbmHit.h:86
virtual ~CbmHit()
Destructor.
Definition CbmHit.cxx:65
CbmMatch * GetMatch() const
Definition CbmHit.h:75
int32_t fAddress
detector unique identifier
Definition CbmHit.h:122
int32_t GetRefId() const
Definition CbmHit.h:73
double fTimeError
Error of hit time [ns].
Definition CbmHit.h:124