CbmRoot
Loading...
Searching...
No Matches
CbmLitHit.h
Go to the documentation of this file.
1/* Copyright (C) 2008-2017 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer], Semen Lebedev */
4
12#ifndef CBMLITHIT_H_
13#define CBMLITHIT_H_
14
15#include "TObject.h"
16#include "base/CbmLitEnums.h"
17#include "base/CbmLitFloat.h"
18
19#include <functional>
20#include <string>
21using std::string;
22
29class CbmLitHit {
30 public:
34 CbmLitHit() : fRefId(0), fHitType(kLITPIXELHIT), fZ(0.), fDz(0.), fT(0.), fDt(0.), fDetectorId(0) {}
35
39 virtual ~CbmLitHit() {}
40
41 /* Getters */
42 Int_t GetRefId() const { return fRefId; }
43 LitHitType GetType() const { return fHitType; }
44 litfloat GetZ() const { return fZ; }
45 litfloat GetDz() const { return fDz; }
46 litfloat GetT() const { return fT; }
47 litfloat GetDt() const { return fDt; }
49 Int_t GetStation() const { return (fDetectorId & (WL_STATION << SB_STATION)) >> SB_STATION; }
50
51 /* Setters */
52 void SetRefId(Int_t refId) { fRefId = refId; }
53 void SetHitType(LitHitType hitType) { fHitType = hitType; }
54 void SetZ(litfloat z) { fZ = z; }
55 void SetDz(litfloat dz) { fDz = dz; }
56 void SetT(litfloat t) { fT = t; }
57 void SetDt(litfloat dt) { fDt = dt; }
58 void SetDetectorId(LitSystemId sysId, Int_t station) { fDetectorId = (sysId << SB_SYSTEM) | (station << SB_STATION); }
59
64 virtual string ToString() const { return ""; }
65
66 private:
67 Int_t fRefId; // reference to MC
68 LitHitType fHitType; // type of the hit (strip, pixel, etc). Used to safely cast to the proper type.
69 litfloat fZ; // Z position of the hit [cm]
70 litfloat fDz; // Z position error of the hit [cm]
73
74 // The detector ID consists of:
75 // system ID (0-15), bits 0-3
76 // station number (0-31), bits 4-9
77 Int_t fDetectorId; // Unique detector ID
78
79 // Length of the index of the corresponding volume
80 static const Int_t WL_SYSTEM = 15;
81 static const Int_t WL_STATION = 31;
82 // Start bit for each volume
83 static const Int_t SB_SYSTEM = 0;
84 static const Int_t SB_STATION = 4;
85};
86
87#endif /*CBMLITHIT_H_*/
Define enumerations used in littrack.
LitHitType
Definition CbmLitEnums.h:19
@ kLITPIXELHIT
Definition CbmLitEnums.h:21
LitSystemId
Definition CbmLitEnums.h:48
Define floating point number type litfloat.
double litfloat
Definition CbmLitFloat.h:19
Base data class for hits.
Definition CbmLitHit.h:29
void SetRefId(Int_t refId)
Definition CbmLitHit.h:52
litfloat fDt
Definition CbmLitHit.h:72
LitSystemId GetSystem() const
Definition CbmLitHit.h:48
litfloat fZ
Definition CbmLitHit.h:69
static const Int_t WL_STATION
Definition CbmLitHit.h:81
litfloat GetZ() const
Definition CbmLitHit.h:44
virtual string ToString() const
Return string representation of class.
Definition CbmLitHit.h:64
void SetHitType(LitHitType hitType)
Definition CbmLitHit.h:53
LitHitType GetType() const
Definition CbmLitHit.h:43
static const Int_t WL_SYSTEM
Definition CbmLitHit.h:80
litfloat fT
Definition CbmLitHit.h:71
litfloat GetT() const
Definition CbmLitHit.h:46
static const Int_t SB_STATION
Definition CbmLitHit.h:84
Int_t fDetectorId
Definition CbmLitHit.h:77
virtual ~CbmLitHit()
Destructor.
Definition CbmLitHit.h:39
litfloat GetDt() const
Definition CbmLitHit.h:47
LitHitType fHitType
Definition CbmLitHit.h:68
static const Int_t SB_SYSTEM
Definition CbmLitHit.h:83
litfloat GetDz() const
Definition CbmLitHit.h:45
Int_t GetStation() const
Definition CbmLitHit.h:49
void SetT(litfloat t)
Definition CbmLitHit.h:56
void SetZ(litfloat z)
Definition CbmLitHit.h:54
Int_t fRefId
Definition CbmLitHit.h:67
void SetDetectorId(LitSystemId sysId, Int_t station)
Definition CbmLitHit.h:58
litfloat fDz
Definition CbmLitHit.h:70
CbmLitHit()
Constructor.
Definition CbmLitHit.h:34
void SetDt(litfloat dt)
Definition CbmLitHit.h:57
Int_t GetRefId() const
Definition CbmLitHit.h:42
void SetDz(litfloat dz)
Definition CbmLitHit.h:55