Project
Loading...
Searching...
No Matches
TriggerTRUDCS.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14#include <fairlogger/Logger.h>
15
16#include <bitset>
17#include <iomanip>
18#include <iostream>
19#include <sstream>
20
21using namespace o2::emcal;
22
23TriggerTRUDCS::TriggerTRUDCS(uint64_t selpf, uint64_t l0sel, uint64_t l0cosm,
24 uint64_t gthrl0, uint64_t rlbkstu, uint64_t fw,
25 std::array<uint32_t, 6> maskReg) : mSELPF(selpf),
26 mL0SEL(l0sel),
27 mL0COSM(l0cosm),
28 mGTHRL0(gthrl0),
29 mRLBKSTU(rlbkstu),
30 mFw(fw),
31 mMaskReg(maskReg)
32{
33}
34
36{
37 return (mSELPF == other.mSELPF) && (mL0SEL == other.mL0SEL) && (mL0COSM == other.mL0COSM) && (mGTHRL0 == other.mGTHRL0) && (mRLBKSTU == other.mRLBKSTU) && (mFw == other.mFw) && (mMaskReg == other.mMaskReg);
38}
39
40void TriggerTRUDCS::PrintStream(std::ostream& stream) const
41{
42 stream << "SELPF: 0x" << std::hex << mSELPF << ", L0SEL: 0x" << std::hex << mL0SEL << ", L0COSM: 0x" << std::hex
43 << mL0COSM << ", GTHRL0: 0x" << std::hex << mGTHRL0 << ", RLBKSTU: 0x" << std::hex << mRLBKSTU << ", FW: 0x" << std::hex
44 << mFw << std::dec << std::endl;
45
46 for (int ireg = 0; ireg < 6; ireg++) {
47 stream << "Reg" << ireg << ": b'" << std::bitset<sizeof(uint32_t) * 8>(mMaskReg[ireg]) << " (" << mMaskReg[ireg] << ")" << std::endl;
48 }
49}
50
51std::ostream& o2::emcal::operator<<(std::ostream& stream, const TriggerTRUDCS& tru)
52{
54 return stream;
55}
56
57std::string TriggerTRUDCS::toJSON() const
58{
59 std::stringstream jsonstring;
60 jsonstring << "{"
61 << "\"mSELPF\":" << mSELPF << ","
62 << "\"mL0SEL\":" << mL0SEL << ","
63 << "\"mL0COSM\":" << mL0COSM << ","
64 << "\"mGTHRL0\":" << mGTHRL0 << ","
65 << "\"mRLBKSTU\":" << mRLBKSTU << ","
66 << "\"mFw\":" << mFw << ","
67 << "\"mMaskReg\":[" << mMaskReg[0] << "," << mMaskReg[1] << "," << mMaskReg[2] << "," << mMaskReg[3] << "," << mMaskReg[4] << "," << mMaskReg[5] << "]"
68 << "}";
69 return jsonstring.str();
70}
CCDB container for TRU DCS data in EMCAL.
std::string toJSON() const
Serialize object to JSON format.
bool operator==(const TriggerTRUDCS &other) const
Comparison of two TRU data.
void PrintStream(std::ostream &stream) const
Print TRUs on a given stream.
TriggerTRUDCS()=default
default constructor
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.
Definition Cell.cxx:355
VectorOfTObjectPtrs other