ATLAS Offline Software
TrigConfAlg.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 <algorithm>
7 #include <sstream>
8 
11 
12 
13 //--------------------------------------------------------------------------------------
15  :m_index(0),
16  m_position(0),
17  m_name_id(0),
18  m_type_id(0),
19  m_name(),
20  m_type()
21 {
22 }
23 
24 //--------------------------------------------------------------------------------------
26  const uint32_t position,
27  const std::string& name,
28  const std::string& type,
29  const uint32_t name_id,
30  const uint32_t type_id)
31  :m_index(index),
32  m_position(position),
33  m_name_id(name_id),
34  m_type_id(type_id),
35  m_name(name),
36  m_type(type)
37 {
38  if(position >= 128) {
39  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigConfAlg") << "Position is too large";
40  }
41  if(index >= 65535) {
42  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigConfAlg") << "Index is too large";
43  }
44 }
45 
46 //--------------------------------------------------------------------------------------
48 {
49  //
50  // Clear all string variables
51  //
52  m_name.clear();
53  m_type.clear();
54 }
55 
56 //--------------------------------------------------------------------------------------
57 void TrigConfAlg::print(std::ostream &os) const
58 {
59  os << str(*this) << std::endl;
60 }
61 
62 //--------------------------------------------------------------------------------------
63 std::string str(const TrigConfAlg &o)
64 {
65  std::stringstream s;
66  s << "TrigConfAlg: " << o.getPosition() << " "
67  << o.getName() << "/" << o.getType() << " = "
68  << o.getNameId() << "/" << o.getTypeId();
69 
70  return s.str();
71 }
TrigConfAlg::getTypeId
uint32_t getTypeId() const
Definition: TrigConfAlg.h:45
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigConfAlg::clearStrings
void clearStrings()
Definition: TrigConfAlg.cxx:47
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
TrigConfAlg.h
TrigConfAlg::getNameId
uint32_t getNameId() const
Definition: TrigConfAlg.h:44
TrigConfAlg::m_type
std::string m_type
Definition: TrigConfAlg.h:57
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
TrigConfAlg::getType
const std::string & getType() const
Definition: TrigConfAlg.h:40
TrigConfAlg
Definition: TrigConfAlg.h:25
TrigConfAlg::getName
const std::string & getName() const
Definition: TrigConfAlg.h:39
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
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
TrigConfAlg::m_name
std::string m_name
Definition: TrigConfAlg.h:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigConfAlg::print
void print(std::ostream &os=std::cout) const
Definition: TrigConfAlg.cxx:57
TrigConfAlg::getPosition
uint8_t getPosition() const
Definition: TrigConfAlg.h:43
str
std::string str(const TrigConfAlg &o)
Definition: TrigConfAlg.cxx:63
TrigConfAlg::TrigConfAlg
TrigConfAlg()
Definition: TrigConfAlg.cxx:14