ATLAS Offline Software
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 
11 namespace L1Bits
12 {
13  const uint32_t maskCtpId = 0x0fff; // mask ctpid bits
14  //const uint32_t maskDecis = 0x7000; // mask decision bits
15 }
16 
17 //--------------------------------------------------------------------------------------
19  :m_encoded(0x0)
20 {
21 }
22 
23 //--------------------------------------------------------------------------------------
25  :m_encoded(encoded)
26 {
27 }
28 
29 //--------------------------------------------------------------------------------------
30 void TrigMonL1Item::setCtpId(unsigned int ctpid)
31 {
32  //
33  // Set ctp id
34  //
35  if(ctpid < 4096) {
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 //--------------------------------------------------------------------------------------
79 void TrigMonL1Item::print(std::ostream &os) const
80 {
81  os << str(*this) << std::endl;
82 }
83 
84 //--------------------------------------------------------------------------------------
85 std::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 }
str
std::string str(const TrigMonL1Item &o)
Definition: TrigMonL1Item.cxx:85
TrigMonL1Item.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigMonL1Item::isPrescaled
bool isPrescaled() const
Definition: TrigMonL1Item.h:55
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigMonL1Item::Decision
Decision
Definition: TrigMonL1Item.h:28
TrigMonL1Item::kL1BeforePrescale
@ kL1BeforePrescale
Definition: TrigMonL1Item.h:33
TrigMonL1Item::kReset
@ kReset
Definition: TrigMonL1Item.h:29
TrigMonL1Item::TrigMonL1Item
TrigMonL1Item()
Definition: TrigMonL1Item.cxx:18
athena.value
value
Definition: athena.py:124
TrigMonL1Item::kL1AfterVeto
@ kL1AfterVeto
Definition: TrigMonL1Item.h:32
TrigMonL1Item::kL1AfterPrescale
@ kL1AfterPrescale
Definition: TrigMonL1Item.h:34
TrigMonL1Item::kPrescaled
@ kPrescaled
Definition: TrigMonL1Item.h:31
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigMonL1Item::setCtpId
void setCtpId(unsigned int ctpid)
Definition: TrigMonL1Item.cxx:30
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigMonL1Item::getCtpId
uint16_t getCtpId() const
Definition: TrigMonL1Item.cxx:58
TrigMonL1Item::kPassed
@ kPassed
Definition: TrigMonL1Item.h:30
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
L1Bits::maskCtpId
const uint32_t maskCtpId
Definition: TrigMonL1Item.cxx:13
errorcheck.h
Helpers for checking error return status codes and reporting errors.
TrigMonL1Item::m_encoded
uint16_t m_encoded
Definition: TrigMonL1Item.h:62
TrigMonL1Item
Encoded L1 decision for one item.
Definition: TrigMonL1Item.h:25
TrigMonL1Item::isPassed
bool isPassed() const
Definition: TrigMonL1Item.h:54
TrigMonL1Item::addDecision
void addDecision(Decision value)
Definition: TrigMonL1Item.cxx:46
TrigMonL1Item::isPassed
bool isPassed(Decision value) const
Definition: TrigMonL1Item.cxx:67
L1Bits
Definition: TrigMonL1Item.cxx:12
TrigMonL1Item::print
void print(std::ostream &os=std::cout) const
Definition: TrigMonL1Item.cxx:79