ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMonL1Item.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// C/C++
6#include <sstream>
7
10
11namespace L1Bits
12{
13 const uint32_t maskCtpId = 0x0fff; // mask ctpid bits
14 //const uint32_t maskDecis = 0x7000; // mask decision bits
15}
16
17//--------------------------------------------------------------------------------------
22
23//--------------------------------------------------------------------------------------
25 :m_encoded(encoded)
26{
27}
28
29//--------------------------------------------------------------------------------------
30void TrigMonL1Item::setCtpId(unsigned int ctpid)
31{
32 //
33 // Set ctp id
34 //
35 if(ctpid < 4096) {
36 m_encoded = m_encoded & (~L1Bits::maskCtpId);
37 m_encoded |= ctpid;
38 }
39 else {
40 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigMonL1Item")
41 << "setCtpId error! Bad ctp id";
42 }
43}
44
45//--------------------------------------------------------------------------------------
47{
48 //
49 // Set trigger decision bits
50 //
51 if (value == kReset) { m_encoded = getCtpId(); }
52 else if(value == kL1AfterVeto) { m_encoded |= value; }
53 else if(value == kL1BeforePrescale) { m_encoded |= value; }
54 else if(value == kL1AfterPrescale) { m_encoded |= value; }
55}
56
57//--------------------------------------------------------------------------------------
59{
60 //
61 // Mask decision bits and return ctp id
62 //
64}
65
66//--------------------------------------------------------------------------------------
68{
69 //
70 // Check trigger decision value
71 //
72 if (value == kPassed) return isPassed();
73 else if(value == kPrescaled) return isPrescaled();
74
75 return m_encoded & value;
76}
77
78//--------------------------------------------------------------------------------------
79void TrigMonL1Item::print(std::ostream &os) const
80{
81 os << str(*this) << std::endl;
82}
83
84//--------------------------------------------------------------------------------------
85std::string str(const TrigMonL1Item &o)
86{
87 std::stringstream s;
88 s << "TrigMonL1Item: ctp id=" << o.getCtpId()
89 << " passed=" << o.isPassed(TrigMonL1Item::kPassed);
90
91 return s.str();
92}
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Encoded L1 decision for one item.
void print(std::ostream &os=std::cout) const
uint16_t getCtpId() const
bool isPassed() const
bool isPrescaled() const
void addDecision(Decision value)
bool isPassed(Decision value) const
uint16_t m_encoded
void setCtpId(unsigned int ctpid)
const uint32_t maskCtpId