CbmRoot
Loading...
Searching...
No Matches
CbmMuchDigi.h
Go to the documentation of this file.
1/* Copyright (C) 2007-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Mikhail Ryzhinskiy, Florian Uhlig, Volker Friese [committer], Pierre-Alain Loizeau */
4
20#ifndef CBMMUCHDIGI_H
21#define CBMMUCHDIGI_H 1
22
23#include "CbmDefs.h" // for kMuch
24#include "CbmMuchAddress.h" // for CbmMuchAddress, kMuchModule
25
26#ifndef NO_ROOT
27#include <Rtypes.h> // for ClassDef
28#endif
29
30#include <boost/serialization/access.hpp>
31#include <boost/serialization/base_object.hpp>
32
33#include <cstdint>
34#include <string> // for string
35
36
38public:
41
47 CbmMuchDigi(uint32_t address, uint16_t charge = 0, uint64_t time = 0)
48 : fTime(time)
49 , fAddress(address)
50 , fCharge(charge)
51 {
52 }
53 //fMatch will be created in the CbmMuchSignal and should be deleted by that class destructor only.
54 //fMatch = new CbmMatch();}
55
59
62
69 double GetCharge() const { return fCharge; }
70
71 //GetSystem is required due to CbmDigiManager
76
77
81 static const char* GetClassName() { return "CbmMuchDigi"; }
82
83
87 static const char* GetBranchName() { return "MuchDigi"; }
88
89
90 uint16_t GetAdc() const { return fCharge; }
91
92
93 int32_t GetAddress() const { return static_cast<int32_t>(fAddress); }
94 double GetTime() const { return static_cast<double>(fTime); }
95
96 // Setters
97 void SetAdc(int32_t adc);
98 void SetTime(uint64_t time);
99 void SetSaturation(bool saturate) { fSaturationFlag = saturate; }
100 void SetAddress(int32_t address) { fAddress = address; }
101
102 // Specially for littrack
103 // TODO remove after littrack fix
105 int32_t GetChannelId() const { return GetAddress(); }
106 int32_t GetADCCharge() const { return GetAdc(); }
107 int32_t GetDTime() const { return 0; }
108
109 std::string ToString() const { return std::string {""}; }
110
111 template<class Archive>
112 void serialize(Archive& ar, const unsigned int /*version*/)
113 {
114 ar& fAddress;
115 ar& fTime;
116 ar& fCharge;
117 ar& fSaturationFlag;
118 }
119
120
121private:
123
124 uint64_t fTime; // Absolute Time Stamp[ns]
125 uint32_t fAddress; // Unique detector address
126 uint16_t fCharge; // Charge [ADC Units]
127
128 //Below flag has to be set during the CbmMuchDigi Creation only.
130 0; //If adc value crosses the Maximum Adc value of actual electronics then SaturationFlag will be set.
131
132#ifndef NO_ROOT
134#endif
135};
136#endif
ECbmModuleId
Definition CbmDefs.h:39
@ kMuch
Muon detection system.
@ kMuchModule
Module.
static int32_t GetElementAddress(int32_t address, int32_t level)
uint32_t fAddress
CbmMuchDigi & operator=(const CbmMuchDigi &)
double GetCharge() const
Charge.
Definition CbmMuchDigi.h:69
int32_t GetDTime() const
void SetAddress(int32_t address)
bool fSaturationFlag
uint16_t GetAdc() const
Definition CbmMuchDigi.h:90
void SetTime(uint64_t time)
int32_t GetAddress() const
Definition CbmMuchDigi.h:93
void serialize(Archive &ar, const unsigned int)
int32_t GetADCCharge() const
void SetAdc(int32_t adc)
uint16_t fCharge
CbmMuchDigi(uint32_t address, uint16_t charge=0, uint64_t time=0)
Definition CbmMuchDigi.h:47
std::string ToString() const
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmMuchDigi.h:87
ClassDefNV(CbmMuchDigi, 4)
double GetTime() const
Definition CbmMuchDigi.h:94
friend class boost::serialization::access
uint64_t fTime
static ECbmModuleId GetSystem()
Definition CbmMuchDigi.h:75
int32_t GetDetectorId() const
void SetSaturation(bool saturate)
Definition CbmMuchDigi.h:99
static const char * GetClassName()
Class name (static)
Definition CbmMuchDigi.h:81
int32_t GetChannelId() const