CbmRoot
Loading...
Searching...
No Matches
CbmPsdDigi.cxx
Go to the documentation of this file.
1/* Copyright (C) 2012-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Nikolay Karpushkin, Volker Friese [committer], Florian Uhlig */
4
12#include "CbmPsdDigi.h"
13
14#include <iomanip> // for hex, setw, setfill, fixed, setprecission
15#include <sstream> // for operator<<, basic_ostream, char_trait
16#include <string> // for basic_string
17
18// --- Copy constructor
19CbmPsdDigi::CbmPsdDigi(const CbmPsdDigi& other) : fuAddress(other.fuAddress), fdTime(other.fdTime), fdEdep(other.fdEdep)
20{
21}
22
23
24// --- Move constructor
25CbmPsdDigi::CbmPsdDigi(CbmPsdDigi&& other) : fuAddress(other.fuAddress), fdTime(other.fdTime), fdEdep(other.fdEdep) {}
26
27
28// --- Set address from module and section number
29void CbmPsdDigi::SetAddress(uint32_t moduleId, uint32_t sectionId)
30{
31 fuAddress = CbmPsdAddress::GetAddress(moduleId, sectionId);
32}
33
34
35// --- Info to string
36std::string CbmPsdDigi::ToString() const
37{
38 // Example output
39 // CbmPsdDigi: address = 0x00001018 Charge = 0.011590 Time = 1006.438294
40
41 std::stringstream ss;
42 ss << "CbmPsdDigi: address = 0x" << std::uppercase << std::hex << std::setw(8) << std::setfill('0') << fuAddress
43 << " Charge = " << std::fixed << std::setprecision(6) << fdEdep << " Time = " << fdTime;
44 return ss.str();
45}
46
47#ifndef NO_ROOT
49#endif
ClassImp(CbmConverterManager)
static uint32_t GetAddress(int32_t moduleId, int32_t sectionId)
Return address from system ID, module, Section.
Data class for PSD digital information.
Definition CbmPsdDigi.h:36
double fdEdep
Time of measurement [ns].
Definition CbmPsdDigi.h:156
double fdTime
Unique channel address.
Definition CbmPsdDigi.h:155
uint32_t fuAddress
Definition CbmPsdDigi.h:154
std::string ToString() const
String output.
void SetAddress(uint32_t address)
Definition CbmPsdDigi.h:141
CbmPsdDigi()
Default constructor.
Definition CbmPsdDigi.h:41