 |
Belle II Software
release-05-01-25
|
1 #include <mdst/dataobjects/TRGSummary.h>
3 #include <framework/logging/Logger.h>
4 #include <framework/database/DBObjPtr.h>
5 #include <mdst/dbobjects/TRGGDLDBInputBits.h>
6 #include <mdst/dbobjects/TRGGDLDBFTDLBits.h>
16 unsigned int ftdlBits[10],
17 unsigned int psnmBits[10],
20 for (
int i = 0; i < 10; i++) {
30 for (
unsigned int word = 0; word <
c_ntrgWords; word++) {
39 B2ERROR(
"Requested input trigger bit number is out of range" <<
LogVar(
"bit", bit));
50 B2ERROR(
"Requested ftdl trigger bit number is out of range" <<
LogVar(
"bit", bit));
61 B2ERROR(
"Requested psnm trigger bit number is out of range" <<
LogVar(
"bit", bit));
74 B2ERROR(
"The mapping of input trigger names does not exist in the given globaltags");
79 if (std::string(inputBits->getinbitname((
int)bit)) == name) {
84 B2ERROR(
"The requested input trigger name does not exist" <<
LogVar(
"name", name));
92 B2ERROR(
"The mapping of output trigger names does not exist in the given globaltags");
97 if (std::string(ftdlBits->getoutbitname((
int)bit)) == name) {
102 B2ERROR(
"The requested output trigger name does not exist" <<
LogVar(
"name", name));
108 std::stringstream htmlOutput;
110 htmlOutput <<
"<table>";
112 <<
"<tr><td></td><td bgcolor='#cccccc'>GDL Input</td><td bgcolor='#cccccc' colspan='2'>GDL Output</td></tr>";
114 <<
"<tr><td>Bit</td><td>Input Bits</td><td>Final Trg DL</td><td>Prescaled Trg and Mask</td></tr>";
116 for (
unsigned int currentBit = 0;
118 htmlOutput <<
"<tr>";
124 (
getFtdlBits(currentWord) & ((
unsigned int)1 << currentBitInWord)) > 0;
126 (
getPsnmBits(currentWord) & ((
unsigned int)1 << currentBitInWord)) > 0;
128 & ((
unsigned int)1 << currentBitInWord)) > 0;
130 htmlOutput <<
"<td>" << currentBit <<
"(word " << currentWord <<
" bit "
131 << currentBitInWord <<
")</td>";
135 htmlOutput <<
"</tr>";
137 htmlOutput <<
"</table>";
139 return htmlOutput.str();
146 const std::string colorNeutral = gROOT->GetColor(kWhite)->AsHexString();
147 const std::string colorAccept = gROOT->GetColor(kGreen)->AsHexString();
149 std::string color = bit > 0 ? colorAccept : colorNeutral;
150 std::stringstream outStream;
151 outStream <<
"<td bgcolor=\"" << color <<
"\">" << bit <<
"</td>";
152 return outStream.str();
unsigned int getFtdlBits(const unsigned i) const
get ftdl bits (directly determined by the trigger conditions)
bool testPsnm(unsigned int bit) const
check whether a psnm bit is set
bool testInput(unsigned int bit) const
check whether an input bit is set
unsigned int getPsnmBits(const unsigned i) const
get psnm bits (prescaled ftdl bits)
bool test() const
check whether any psnm bit is set
bool testFtdl(unsigned int bit) const
check whether a ftdl bit is set
Class for accessing objects in the database.
ETimingType m_timType
types of trigger timing source defined in b2tt firmware
unsigned int m_psnmBits[c_ntrgWords]
psnm (PreScale aNd Mask) bits.
unsigned int getOutputBitNumber(const std::string &name) const
get number of an output trigger bit
unsigned int getInputBitNumber(const std::string &name) const
get number of an input trigger bit
unsigned int getInputBits(const unsigned i) const
get input bits
Abstract base class for different kinds of events.
Class to store variables with their name which were sent to the logging service.
static const unsigned int c_trgWordSize
size of a l1 trigger word
static const unsigned int c_ntrgWords
number of l1 trigger words
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
std::string outputBitWithColor(bool bit) const
return the td part of an HTML table with green of the bit is > 0
TRGSummary()=default
default constructor: xxx
ETimingType
types of trigger timing source defined in b2tt firmware
unsigned int m_ftdlBits[c_ntrgWords]
ftdl (Final Trigger Decision Logic) bits.
unsigned int m_inputBits[c_ntrgWords]
input bits from subdetectors