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
20// Entry 10 was removed so the assignment of values is explicit to keep
21// backward compatibility.
22// The correspondig value are stored in files and used during
23// reconstruction and analysis.
38
39#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
40#include <TObject.h> // for TObject
41
42#include <cstdint>
43#include <string> // for string, basic_string
44
45class CbmMatch;
46
47class CbmHit : public TObject {
48 public:
52 CbmHit();
53
64 CbmHit(HitType _type, double _z, double _dz, int32_t _refId, int32_t _address, double _time = -1.,
65 double _timeError = -1.);
66
70 virtual ~CbmHit();
71
72 /* Accessors */
73 HitType GetType() const { return fType; }
74 double GetZ() const { return fZ; }
75 double GetDz() const { return fDz; }
76 int32_t GetRefId() const { return fRefId; }
77 int32_t GetAddress() const { return fAddress; }
78 CbmMatch* GetMatch() const { return fMatch; }
79 double GetTime() const { return fTime; }
80 double GetTimeError() const { return fTimeError; }
81
82 /* Setters */
83 void SetZ(double z) { fZ = z; }
84 void SetDz(double dz) { fDz = dz; }
85 void SetRefId(int32_t refId) { fRefId = refId; }
86 void SetAddress(int32_t address) { fAddress = address; }
87 void SetMatch(CbmMatch* match);
88 void SetTime(double time) { fTime = time; }
89 void SetTime(double time, double error)
90 {
91 fTime = time;
92 fTimeError = error;
93 }
94 void SetTimeError(double error) { fTimeError = error; }
95
102 virtual int32_t GetPlaneId() const { return -1; }
103
108 virtual std::string ToString() const { return "Has to be implemented in derrived class"; }
109
110 protected:
115 void SetType(HitType type) { fType = type; }
116 CbmHit(const CbmHit&);
117 CbmHit& operator=(const CbmHit&);
118
119
120 private:
122 double fZ;
123 double fDz;
124 int32_t fRefId;
125 int32_t fAddress;
126 double fTime;
127 double fTimeError;
129
131};
132
133#endif /* CBMHIT_H_ */
HitType
Definition CbmHit.h:25
@ kSTSHIT
Definition CbmHit.h:29
@ kHIT
Definition CbmHit.h:26
@ kMUCHSTRAWHIT
Definition CbmHit.h:33
@ kTOFHIT
Definition CbmHit.h:35
@ kPIXELHIT
Definition CbmHit.h:27
@ kMVDHIT
Definition CbmHit.h:30
@ kFSDHIT
Definition CbmHit.h:36
@ kTRDHIT
Definition CbmHit.h:34
@ kSTRIPHIT
Definition CbmHit.h:28
@ kRICHHIT
Definition CbmHit.h:31
@ kMUCHPIXELHIT
Definition CbmHit.h:32
int32_t fRefId
some reference id (usually to cluster, digi or MC point)
Definition CbmHit.h:124
CbmHit()
Default constructor.
Definition CbmHit.cxx:18
void SetTimeError(double error)
Definition CbmHit.h:94
void SetMatch(CbmMatch *match)
Definition CbmHit.cxx:70
void SetDz(double dz)
Definition CbmHit.h:84
double GetTimeError() const
Definition CbmHit.h:80
void SetAddress(int32_t address)
Definition CbmHit.h:86
ClassDef(CbmHit, 3)
double fDz
Z position error [cm].
Definition CbmHit.h:123
double fZ
Z position of hit [cm].
Definition CbmHit.h:122
double GetDz() const
Definition CbmHit.h:75
HitType fType
hit type
Definition CbmHit.h:121
double GetTime() const
Definition CbmHit.h:79
void SetType(HitType type)
Sets hit type.
Definition CbmHit.h:115
CbmHit & operator=(const CbmHit &)
Definition CbmHit.cxx:48
int32_t GetAddress() const
Definition CbmHit.h:77
CbmMatch * fMatch
Monte-Carlo information.
Definition CbmHit.h:128
void SetZ(double z)
Definition CbmHit.h:83
HitType GetType() const
Definition CbmHit.h:73
double fTime
Hit time [ns].
Definition CbmHit.h:126
virtual std::string ToString() const
Virtual function. Must be implemented in derived class. Has to return string representation of the ob...
Definition CbmHit.h:108
virtual int32_t GetPlaneId() const
Definition CbmHit.h:102
void SetRefId(int32_t refId)
Definition CbmHit.h:85
double GetZ() const
Definition CbmHit.h:74
void SetTime(double time)
Definition CbmHit.h:88
void SetTime(double time, double error)
Definition CbmHit.h:89
virtual ~CbmHit()
Destructor.
Definition CbmHit.cxx:65
CbmMatch * GetMatch() const
Definition CbmHit.h:78
int32_t fAddress
detector unique identifier
Definition CbmHit.h:125
int32_t GetRefId() const
Definition CbmHit.h:76
double fTimeError
Error of hit time [ns].
Definition CbmHit.h:127