ATLAS Offline Software
HLTTriggerElement.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <iostream>
9 #include <fstream>
10 #include <stdexcept>
11 
12 using namespace std;
13 using namespace TrigConf;
14 
15 HLTTriggerElement::HLTTriggerElement() :
16  TrigConfData(""),
17  m_hashId(0),
18  m_level(0)
19 {}
20 
23  m_hashId(HLTUtils::string2hash(name)), // don't allow for external setting of trigger element id's
24  m_level(0)
25 {
26 }
27 
28 HLTTriggerElement::HLTTriggerElement( unsigned int, const string& name ) :
30  m_hashId(HLTUtils::string2hash(name) ), // don't allow for external setting of trigger element id's
31  m_level(0)
32 {
33 }
34 
35 HLTTriggerElement::HLTTriggerElement( const std::pair<unsigned int,string>& p ) :
37  m_hashId( HLTUtils::string2hash(p.second) ), // don't yet allow for external setting of trigger element id's
38  m_level(0)
39 {
40 }
41 
42 
43 void
44 HLTTriggerElement::writeXML(std::ofstream & xmlfile) {
45  xmlfile << " <TRIGGERELEMENT te_name=\""
46  << name() << "\"/>" << endl;
47  return;
48 }
49 
50 void
51 HLTTriggerElement::print(const std::string& indent, unsigned int /*detail*/) const {
52  std::cout << indent << *this;
53 }
54 
55 std::ostream &
56 TrigConf::operator<<(std::ostream & o, const HLTTriggerElement & te) {
57  o << "(\"" << te.name() << "\", " << te.m_hashId << ")";
58  return o;
59 }
60 
61 
62 bool
63 HLTTriggerElement::getLabel(unsigned int id, string & label) {
65  if (label=="UNKNOWN HASH ID") {
66  label = "";
67  return false;
68  }
69  return true;
70 }
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition: L1ThresholdBase.cxx:339
TrigConf::TrigConfData::name
const std::string & name() const
Definition: TrigConfData.h:22
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
TrigConf::HLTTriggerElement::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
print method
Definition: HLTTriggerElement.cxx:51
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
HLTUtils.h
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
TrigConf::HLTTriggerElement::getLabel
static bool getLabel(unsigned int id, std::string &label)
find name from ID in the map m_IdToLabel
Definition: HLTTriggerElement.cxx:63
TrigConf::TrigConfData
Definition: TrigConfData.h:13
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::HLTTriggerElement::m_hashId
unsigned int m_hashId
trigger element id
Definition: HLTTriggerElement.h:80
TrigConf::HLTTriggerElement
HLT trigger element configuration information.
Definition: HLTTriggerElement.h:26
TrigConf::HLTUtils::hash2string
static const std::string hash2string(HLTHash, const std::string &category="TE")
hash function translating identifiers into names (via internal dictionary)
HLTTriggerElement.h
TrigConf::HLTTriggerElement::writeXML
virtual void writeXML(std::ofstream &xmlfile)
Definition: HLTTriggerElement.cxx:44
HLTUtils.string2hash
def string2hash(string)
Definition: HLTUtils.py:5
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TrigConfData.cxx:23
TrigConf::HLTTriggerElement::HLTTriggerElement
HLTTriggerElement()
default constructor
Definition: HLTTriggerElement.cxx:15
HLTUtils
Definition: HLTUtils.py:1