CbmRoot
Loading...
Searching...
No Matches
CbmBmonDigi.h
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Volker Friese [committer] */
4
5
6#ifndef CBMBMONDIGI_H
7#define CBMBMONDIGI_H 1
8
9#include "CbmDefs.h"
10
11#ifndef NO_ROOT
12#include <Rtypes.h> // for ClassDef
13#endif
14
15#include <boost/serialization/access.hpp>
16#include <boost/serialization/base_object.hpp>
17
18#include <cstdint>
19
20#ifndef CBMTOFDIGI_H
21class CbmTofDigi; // For declaration of the conversion constructor without starting a cyclic dependency
22#endif // CBMTOFDIGI_H
23
31
32public:
35 CbmBmonDigi() = default;
36
42 CbmBmonDigi(int32_t addr, double time, float charge) : fAddress(addr), fTime(time), fCharge(charge) {};
43
44
48 CbmBmonDigi(const CbmTofDigi& digi);
49
50
54 CbmBmonDigi(const CbmTofDigi* digi);
55
56
59
63 static const char* GetBranchName() { return "BmonDigi"; }
64
65
69 static const char* GetClassName() { return "CbmBmonDigi"; }
70
71
76
80 int32_t GetAddress() const { return fAddress; }
81
82
86 double GetTime() const { return fTime; }
87
88
92 double GetCharge() const { return fCharge; }
93
94
98 void SetAddress(int32_t addr) { fAddress = addr; }
99
100
104 void SetTime(double time) { fTime = time; }
105
106
110 void SetCharge(float charge) { fCharge = charge; }
111
112
113private:
115 double fTime = -1.;
116 float fCharge = -1.;
117
119
120 template<class Archive>
121 void serialize(Archive& ar, const unsigned int /*version*/)
122 {
123 ar& fAddress;
124 ar& fTime;
125 ar& fCharge;
126 }
127
128#ifndef NO_ROOT
130#endif
131};
132
133#endif /* CBMBMONDIGI_H */
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Definition CbmDefs.h:29
ECbmModuleId
Definition CbmDefs.h:39
Data class for a signal in the t-zero detector.
Definition CbmBmonDigi.h:30
~CbmBmonDigi()
Destructor.
Definition CbmBmonDigi.h:58
double GetTime() const
Time.
Definition CbmBmonDigi.h:86
double GetCharge() const
Charge.
Definition CbmBmonDigi.h:92
static const char * GetBranchName()
Get the desired name of the branch for this objects in the cbm output tree (static)
Definition CbmBmonDigi.h:63
int32_t fAddress
Unique CBM address.
double fTime
Time of signal in BMON [ns].
void serialize(Archive &ar, const unsigned int)
void SetCharge(float charge)
Set the measured charge.
int32_t GetAddress() const
Address.
Definition CbmBmonDigi.h:80
static ECbmModuleId GetSystem()
Definition CbmBmonDigi.h:75
CbmBmonDigi(int32_t addr, double time, float charge)
Constructor.
Definition CbmBmonDigi.h:42
ClassDefNV(CbmBmonDigi, 1)
void SetAddress(int32_t addr)
Set the address.
Definition CbmBmonDigi.h:98
friend class boost::serialization::access
float fCharge
Charge.
static const char * GetClassName()
Class name (static)
Definition CbmBmonDigi.h:69
CbmBmonDigi()=default
Default Constructor.
void SetTime(double time)
Set the measurement time.
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47