CbmRoot
Loading...
Searching...
No Matches
CbmTofDigi.cxx
Go to the documentation of this file.
1/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer], Volker Friese, Pierre-Alain Loizeau */
4
11#include "CbmTofDigi.h"
12
13#include "CbmBmonDigi.h"
14
15#include <iomanip> // for hex, setw, setfill, fixed, setprecission
16#include <sstream> // for operator<<, basic_ostream, char_trait
17#include <string> // for basic_string
18
19CbmTofDigi::CbmTofDigi() : fdTime(0.), fdTot(-1.), fuAddress(0)
20// fMatch(nullptr)
21{
22}
23
24CbmTofDigi::CbmTofDigi(uint32_t address, double time, double tot) : fdTime(time), fdTot(tot), fuAddress(address)
25// fMatch(nullptr)
26{
27}
28
29CbmTofDigi::CbmTofDigi(uint32_t Sm, uint32_t Rpc, uint32_t Channel, double time, double tot, uint32_t Side,
30 uint32_t SmType)
31 : fdTime(time)
32 , fdTot(tot)
33 , fuAddress(0)
34// fMatch(nullptr)
35{
36 fuAddress = CbmTofAddress::GetUniqueAddress(Sm, Rpc, Channel, Side, SmType);
37}
38
40 : fdTime(digi.GetTime())
41 , fdTot(digi.GetCharge())
42 , fuAddress(digi.GetAddress())
43{
44}
45
47 : fdTime(digi->GetTime())
48 , fdTot(digi->GetCharge())
49 , fuAddress(digi->GetAddress())
50{
51}
52
54{
55 // if ( fMatch ) delete fMatch;
56}
57
58std::string CbmTofDigi::ToString() const
59{
60 // Example Output i
61 // CbmTofDigi: address = 0x05020026 time = 1017.181900 tot = 1.221741
62
63 std::stringstream ss;
64 ss << "CbmTofDigi: address = 0x" << std::uppercase << std::hex << std::setw(8) << std::setfill('0') << fuAddress
65 << " time = " << std::fixed << std::setprecision(6) << fdTime << " tot = " << fdTot;
66 return ss.str();
67}
68
69void CbmTofDigi::SetAddress(uint32_t Sm, uint32_t Rpc, uint32_t Channel, uint32_t Side, uint32_t SmType)
70{
71 fuAddress = CbmTofAddress::GetUniqueAddress(Sm, Rpc, Channel, Side, SmType);
72}
73
74#ifndef NO_ROOT
76#endif
ClassImp(CbmConverterManager)
Data class for a signal in the t-zero detector.
Definition CbmBmonDigi.h:30
static uint32_t GetUniqueAddress(uint32_t Sm, uint32_t Rpc, uint32_t Channel, uint32_t Side=0, uint32_t SmType=0, uint32_t RpcType=0)
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
std::string ToString() const
CbmTofDigi()
Default constructor.
double fdTot
Tot [ps].
Definition CbmTofDigi.h:173
~CbmTofDigi()
Destructor.
uint32_t fuAddress
Unique channel address.
Definition CbmTofDigi.h:174
double fdTime
Absolute time [ps].
Definition CbmTofDigi.h:172
void SetAddress(int32_t address)
Definition CbmTofDigi.h:163