BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmBaseHit.h
Go to the documentation of this file.
1/**
2 * \file CbmBaseHit.h
3 * \author Andrey Lebedev <andrey.lebedev@gsi.de>
4 * \date 2009
5 *
6 * Base class for hits used for tracking in CBM.
7 * Derives from TObject.
8 * Each hit has its unique identifier of type HitType_o,
9 * which can be later use for safe type casting.
10 **/
11#ifndef CBMBASEHIT_H_
12#define CBMBASEHIT_H_
13
28
29#include "TObject.h"
30
31#include <string>
32using std::string;
34
35class CbmBaseHit : public TObject
36{
37 public:
38 /**
39 * \brief Default constructor.
40 */
41 CbmBaseHit();
42
43 /**
44 * \brief Destructor.
45 */
46 virtual ~CbmBaseHit();
47
48 /* Accessors */
49 HitType_o GetType() const { return fType; }
50 Double_t GetZ() const { return fZ; }
51 Double_t GetDz() const { return fDz; }
52 Int_t GetRefId() const { return fRefId; }
53 Int_t GetAddress() const { return fAddress; }
54 FairMultiLinkedData* GetLinks() const { return fLinks; }
55
56 /* Setters */
57 void SetZ(Double_t z) { fZ = z; }
58 void SetDz(Double_t dz) { fDz = dz; }
59 void SetRefId(Int_t refId) { fRefId = refId; }
60 void SetAddress(Int_t address) { fAddress = address; }
61 void SetLinks(FairMultiLinkedData* links) { fLinks = links; }
62
63 /**
64 * Pure virtual function. Must be implemented in derived class.
65 * Should return plane identifier of the hit. Usually this is station or layer
66 * number of the detector. Can be calculated using unique detector identifier
67 * or can use additional class member from the derived class to store the plane identifier.
68 **/
69 virtual Int_t GetPlaneId() const = 0;
70
71 /**
72 * \brief Pure virtual function. Must be implemented in derived class.
73 * Has to return string representation of the object.
74 **/
75 virtual string ToString() const = 0;
76
77 protected:
78 /**
79 * \brief Sets hit type.
80 * \param type hit type
81 **/
82 void SetType(HitType_o type) { fType = type; }
83
84 CbmBaseHit(const CbmBaseHit&);
86
87 private:
88 HitType_o fType; ///< hit type
89 Double_t fZ; ///< Z position of hit [cm]
90 Double_t fDz; ///< Z position error [cm]
91 Int_t fRefId; ///< some reference id (usually to cluster, digi or MC point)
92 Int_t fAddress; ///< detector unique identifier
93 FairMultiLinkedData* fLinks; ///< Monte-Carlo link collection
94
96};
97
98#endif /* CBMBASEHIT_H_ */
int Int_t
double Double_t
#define ClassDef(name, id)
HitType_o
Definition CbmBaseHit.h:15
@ kECALHIT_o
Definition CbmBaseHit.h:26
@ kMUCHSTRAWHIT_o
Definition CbmBaseHit.h:23
@ kSTRIPHIT_o
Definition CbmBaseHit.h:18
@ kTOFHIT_o
Definition CbmBaseHit.h:25
@ kHIT_o
Definition CbmBaseHit.h:16
@ kPIXELHIT_o
Definition CbmBaseHit.h:17
@ kMUCHPIXELHIT_o
Definition CbmBaseHit.h:22
@ kSTSHIT_o
Definition CbmBaseHit.h:19
@ kRICHHIT_o
Definition CbmBaseHit.h:21
@ kTRDHIT_o
Definition CbmBaseHit.h:24
@ kMVDHIT_o
Definition CbmBaseHit.h:20
Double_t GetZ() const
Definition CbmBaseHit.h:50
Double_t GetDz() const
Definition CbmBaseHit.h:51
CbmBaseHit & operator=(const CbmBaseHit &)
Int_t GetAddress() const
Definition CbmBaseHit.h:53
Double_t fDz
Z position error [cm].
Definition CbmBaseHit.h:90
void SetLinks(FairMultiLinkedData *links)
Definition CbmBaseHit.h:61
void SetRefId(Int_t refId)
Definition CbmBaseHit.h:59
Double_t fZ
Z position of hit [cm].
Definition CbmBaseHit.h:89
virtual Int_t GetPlaneId() const =0
Pure virtual function.
Int_t GetRefId() const
Definition CbmBaseHit.h:52
void SetDz(Double_t dz)
Definition CbmBaseHit.h:58
FairMultiLinkedData * GetLinks() const
Definition CbmBaseHit.h:54
void SetZ(Double_t z)
Definition CbmBaseHit.h:57
FairMultiLinkedData * fLinks
Monte-Carlo link collection.
Definition CbmBaseHit.h:93
HitType_o GetType() const
Definition CbmBaseHit.h:49
CbmBaseHit()
Default constructor.
void SetAddress(Int_t address)
Definition CbmBaseHit.h:60
Int_t fRefId
some reference id (usually to cluster, digi or MC point)
Definition CbmBaseHit.h:91
virtual string ToString() const =0
Pure virtual function.
Int_t fAddress
detector unique identifier
Definition CbmBaseHit.h:92
HitType_o fType
hit type
Definition CbmBaseHit.h:88
virtual ~CbmBaseHit()
Destructor.
void SetType(HitType_o type)
Sets hit type.
Definition CbmBaseHit.h:82
HitType_o
Definition CbmBaseHit.h:15