CbmRoot
Loading...
Searching...
No Matches
CbmHit.cxx
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: Andrey Lebedev, Florian Uhlig [committer], Volker Friese */
4
12#include "CbmHit.h"
13
14#include "CbmMatch.h" // for CbmMatch
15
16#include <TObject.h> // for TObject
17
18CbmHit::CbmHit() : CbmHit(kHIT, 0., 0., -1, -1, -1., -1.) {}
19
20CbmHit::CbmHit(HitType _type, double _z, double _dz, int32_t _refId, int32_t _address, double _time, double _timeError)
21 : TObject()
22 , fType(_type)
23 , fZ(_z)
24 , fDz(_dz)
25 , fRefId(_refId)
26 , fAddress(_address)
27 , fTime(_time)
28 , fTimeError(_timeError)
29 , fMatch(nullptr)
30{
31}
32
33// Only shallow copy needed
35 : TObject(rhs)
36 , fType(rhs.fType)
37 , fZ(rhs.fZ)
38 , fDz(rhs.fDz)
39 , fRefId(rhs.fRefId)
40 , fAddress(rhs.fAddress)
41 , fTime(rhs.fTime)
42 , fTimeError(rhs.fTimeError)
43 , fMatch(nullptr)
44{
45}
46
47// Only shallow copy needed
49{
50
51 if (this != &rhs) {
52 TObject::operator=(rhs);
53 fType = rhs.fType;
54 fZ = rhs.fZ;
55 fDz = rhs.fDz;
56 fRefId = rhs.fRefId;
57 fAddress = rhs.fAddress;
58 fTime = rhs.fTime;
60 fMatch = nullptr;
61 }
62 return *this;
63}
64
66{
67 if (fMatch) delete fMatch;
68}
69
71{
72 if (fMatch) delete fMatch;
73 fMatch = match;
74}
75
ClassImp(CbmHit)
HitType
Definition CbmHit.h:21
@ kHIT
Definition CbmHit.h:22
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 SetMatch(CbmMatch *match)
Definition CbmHit.cxx:70
double fDz
Z position error [cm].
Definition CbmHit.h:120
double fZ
Z position of hit [cm].
Definition CbmHit.h:119
HitType fType
hit type
Definition CbmHit.h:118
CbmHit & operator=(const CbmHit &)
Definition CbmHit.cxx:48
CbmMatch * fMatch
Monte-Carlo information.
Definition CbmHit.h:125
double fTime
Hit time [ns].
Definition CbmHit.h:123
virtual ~CbmHit()
Destructor.
Definition CbmHit.cxx:65
int32_t fAddress
detector unique identifier
Definition CbmHit.h:122
double fTimeError
Error of hit time [ns].
Definition CbmHit.h:124