CbmRoot
Loading...
Searching...
No Matches
CbmFsdDigi.h
Go to the documentation of this file.
1/* Copyright (C) 2023 Physikalisches Institut, Eberhard Karls Universitaet Tuebingen, Tuebingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese, Pierre-Alain Loizeau, Lukas Chlad [committer] */
4
19#ifndef CBMFSDDIGI_H
20#define CBMFSDDIGI_H 1
21
22#include "CbmDefs.h" // for ECbmModuleId::kFsd
23#include "CbmFsdAddress.h" // for CbmFsdAddress
24
25#ifndef NO_ROOT
26#include <Rtypes.h> // for ClassDefNV
27#endif
28
29#include <boost/serialization/access.hpp>
30#include <boost/serialization/base_object.hpp>
31
32#include <cstdint>
33#include <string> // for string
34
35
37
38public:
42
43
49 CbmFsdDigi(uint32_t address, double time, double edep) : fAddress(address), fTime(time), fEdep(edep) {}
50
51
59 CbmFsdDigi(uint32_t unitId, uint32_t moduleId, uint32_t photodetId, double time, double edep)
60 : fAddress(CbmFsdAddress::GetAddress(unitId, moduleId, photodetId))
61 , fTime(time)
62 , fEdep(edep)
63 {
64 }
65
66
69
70
74 static const char* GetClassName() { return "CbmFsdDigi"; }
75
76
80 uint32_t GetAddress() const { return fAddress; };
81
82
86 static const char* GetBranchName() { return "FsdDigi"; }
87
88
92 double GetTime() const { return fTime; };
93
94
100 double GetCharge() const { return fEdep; };
101
102
106 double GetEdep() const { return fEdep; };
107
108
112 double GetModuleID() const
113 {
115 }
116
117
121 double GetUnitID() const
122 {
124 }
125
126
130 double GetPhotoDetID() const
131 {
133 }
134
139
140
142 void SetAddress(uint32_t address) { fAddress = address; };
143 void SetAddress(uint32_t unitId, uint32_t moduleId, uint32_t photodetId);
144 void SetTime(double time) { fTime = time; }
145 void SetEdep(double edep) { fEdep = edep; }
146
147
151 std::string ToString() const;
152
153
154private:
155 uint32_t fAddress = 0;
156 double fTime = -1.;
157 double fEdep = 0.;
158
161 template<class Archive>
162 void serialize(Archive& ar, const unsigned int /*version*/)
163 {
164 ar& fAddress;
165 ar& fTime;
166 ar& fEdep;
167 }
168
169#ifndef NO_ROOT
171#endif
172};
173
174#endif // CBMFSDDIGI_H
ECbmModuleId
Definition CbmDefs.h:39
@ kFsd
Forward spectator detector.
Data class for FSD digital information.
Definition CbmFsdDigi.h:36
CbmFsdDigi()
Default constructor.
Definition CbmFsdDigi.h:41
void SetTime(double time)
Definition CbmFsdDigi.h:144
void SetEdep(double edep)
Definition CbmFsdDigi.h:145
double GetTime() const
Time.
Definition CbmFsdDigi.h:92
double fEdep
Time of measurement [ns].
Definition CbmFsdDigi.h:157
uint32_t GetAddress() const
Address.
Definition CbmFsdDigi.h:80
CbmFsdDigi(uint32_t address, double time, double edep)
Constructor with assignment.
Definition CbmFsdDigi.h:49
uint32_t fAddress
Definition CbmFsdDigi.h:155
std::string ToString() const
String output.
double GetCharge() const
Charge.
Definition CbmFsdDigi.h:100
double fTime
Unique channel address.
Definition CbmFsdDigi.h:156
void SetAddress(uint32_t address)
Definition CbmFsdDigi.h:142
ClassDefNV(CbmFsdDigi, 1)
double GetUnitID() const
Unit Identifier.
Definition CbmFsdDigi.h:121
friend class boost::serialization::access
Energy deposition from FPGA [MeV].
Definition CbmFsdDigi.h:160
CbmFsdDigi(uint32_t unitId, uint32_t moduleId, uint32_t photodetId, double time, double edep)
Constructor with detailed assignment.
Definition CbmFsdDigi.h:59
void serialize(Archive &ar, const unsigned int)
Definition CbmFsdDigi.h:162
static const char * GetClassName()
Class name (static)
Definition CbmFsdDigi.h:74
double GetEdep() const
Energy deposit.
Definition CbmFsdDigi.h:106
double GetModuleID() const
Module Identifier.
Definition CbmFsdDigi.h:112
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmFsdDigi.h:86
double GetPhotoDetID() const
PhotoDet Identifier.
Definition CbmFsdDigi.h:130
static ECbmModuleId GetSystem()
System identifier.
Definition CbmFsdDigi.h:138
Functions to encode or decode the address field of FSD data.
uint32_t GetElementId(int32_t address, int32_t level)
Get the index of an element.