Project
Loading...
Searching...
No Matches
TriggerSTUDCS.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
23TriggerSTUDCS::TriggerSTUDCS(std::array<int, 3> Gammahigh, std::array<int, 3> Jethigh,
24 std::array<int, 3> Gammalow, std::array<int, 3> Jetlow,
25 int rawData, int region, int fw, int patchSize, int median,
26 std::array<int, 4> phosScale) : mGammaHigh(Gammahigh),
27 mJetHigh(Jethigh),
28 mGammaLow(Gammalow),
29 mJetLow(Jetlow),
30 mGetRawData(rawData),
31 mRegion(region),
32 mFw(fw),
33 mPatchSize(patchSize),
34 mMedian(median),
35 mPHOSScale(phosScale)
36{
37}
38
40{
41 return (mGetRawData == other.mGetRawData) && (mRegion == other.mRegion) &&
42 (mFw == other.mFw) && (mPatchSize == other.mPatchSize) && (mMedian == other.mMedian) &&
43 (mPHOSScale == other.mPHOSScale) && (mGammaHigh == other.mGammaHigh) &&
44 (mJetHigh == other.mJetHigh) && (mGammaLow == other.mGammaLow) && (mJetLow == other.mJetLow);
45}
46
47void TriggerSTUDCS::PrintStream(std::ostream& stream) const
48{
49 stream << "PatchSize: " << mPatchSize
50 << ", GetRawData: " << mGetRawData
51 << ", Region: 0x" << std::hex << mRegion << std::dec << " (b'" << std::bitset<sizeof(mRegion) * 8>(mRegion) << ")"
52 << ", Median: " << mMedian
53 << ", Firmware: 0x" << std::hex << mFw << std::dec << std::endl;
54 stream << "Gamma High: (" << mGammaHigh[0] << ", " << mGammaHigh[1] << ", " << mGammaHigh[2] << ")" << std::endl;
55 stream << "Gamma Low: (" << mGammaLow[0] << ", " << mGammaLow[1] << ", " << mGammaLow[2] << ")" << std::endl;
56 stream << "Jet High: (" << mJetHigh[0] << ", " << mJetHigh[1] << ", " << mJetHigh[2] << ")" << std::endl;
57 stream << "Jet Low: (" << mJetLow[0] << ", " << mJetLow[1] << ", " << mJetLow[2] << ")" << std::endl;
58}
59
60std::ostream& o2::emcal::operator<<(std::ostream& stream, const TriggerSTUDCS& stu)
61{
63 return stream;
64}
65
66std::string TriggerSTUDCS::toJSON() const
67{
68 std::stringstream jsonstring;
69 jsonstring << "{"
70 << "\"mGammaHigh\":[[" << mGammaHigh[0] << "," << mGammaHigh[1] << "," << mGammaHigh[2] << "],[" << mGammaLow[0] << "," << mGammaLow[1] << "," << mGammaLow[2] << "]],"
71 << "\"mJetHigh\":[[" << mJetHigh[0] << "," << mJetHigh[1] << "," << mJetHigh[2] << "],[" << mJetLow[0] << "," << mJetLow[1] << "," << mJetLow[2] << "]],"
72 << "\"mRawData\":" << mGetRawData << ","
73 << "\"mRegion\":" << mRegion << ","
74 << "\"mFirmware\":" << mFw << ","
75 << "\"mMedian\":" << mMedian << ","
76 << "\"mPHOSScale\":[" << mPHOSScale[0] << "," << mPHOSScale[1] << "," << mPHOSScale[2] << "," << mPHOSScale[3] << "]"
77 << "}";
78
79 return jsonstring.str();
80}
CCDB container for STU DCS data in EMCAL.
void PrintStream(std::ostream &stream) const
Print STUs on a given stream.
std::string toJSON() const
Serialize object to JSON format.
bool operator==(const TriggerSTUDCS &other) const
Comparison of two STU data.
TriggerSTUDCS()=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