ATLAS Offline Software
HLTSignature.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <iostream>
9 #include <fstream>
10 
11 using namespace std;
12 using namespace TrigConf;
13 
14 HLTSignature::HLTSignature() :
15  m_signature_counter(1),
16  m_logic(1),
17  m_label("")
18 {}
19 
20 HLTSignature::HLTSignature( unsigned int signature_counter, int logic,
21  vector<HLTTriggerElement*>&& outputTEs) :
22  m_signature_counter(signature_counter),
23  m_logic(logic),
24  m_outputTEs(std::move(outputTEs)),
25  m_label("")
26 {}
27 
28 
30  m_signature_counter( o.m_signature_counter ),
31  m_logic( o.m_logic ),
32  m_label( o.m_label )
33 {
34  // deep copy to ensure ownership (maybe should use shared_ptr in the future)
35  for(HLTTriggerElement* te : o.m_outputTEs)
36  m_outputTEs.push_back(new HLTTriggerElement(*te));
37 }
38 
39 
41  for(HLTTriggerElement* te : m_outputTEs) delete te;
42 }
43 
44 
45 void TrigConf::HLTSignature::writeXML(std::ofstream & xmlfile)
46 {
47  xmlfile << " <SIGNATURE logic=\"" << m_logic << "\" "
48  << "signature_counter=\"" << m_signature_counter << "\">"
49  << std::endl;
50 
51  //write TEs
52  for (TrigConf::HLTTriggerElement* outputTE : m_outputTEs) {
53  outputTE->writeXML(xmlfile);
54  }
55 
56  xmlfile << " </SIGNATURE>" << std::endl;
57 
58  return;
59 }
60 
61 void
62 TrigConf::HLTSignature::print(const std::string& indent, unsigned int /*detail*/) const {
63  cout << indent << "signature " << signature_counter()
64  << " (logic=" << logic() << ") output TEs ("<< m_outputTEs.size() <<"):";
65 
66  for( HLTTriggerElement* te : m_outputTEs ) {
67  if( te!=0 ) cout << *te << " "; else cout << "(0) ";
68  }
69  cout << endl;
70 }
71 
72 std::ostream &
73 TrigConf::operator<<(std::ostream & o, const TrigConf::HLTSignature & s) {
74  o << "signature: " << s.signature_counter() << " (logic=" << s.logic() << ")" << endl;
75  o << "outputTE(s)";
76 
77  for( HLTTriggerElement* te : s.m_outputTEs ) {
78  o << ", ";
79  if( te!=0 ) o << *te; else o << "(0)";
80  }
81  o << endl;
82  return o;
83 }
84 
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition: L1ThresholdBase.cxx:339
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigConf::HLTSignature::print
void print(const std::string &indent="", unsigned int detail=1) const
print method
Definition: HLTSignature.cxx:62
TrigConf::HLTSignature::~HLTSignature
~HLTSignature(void)
destructor
Definition: HLTSignature.cxx:40
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::HLTSignature::m_outputTEs
std::vector< HLTTriggerElement * > m_outputTEs
list of trigger elements (same elements can appear multiple times to indicate their multiplicities)
Definition: HLTSignature.h:77
TrigConf::HLTSignature
HLT signature configuration information.
Definition: HLTSignature.h:29
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
HLTSignature.h
TrigConf::HLTSignature::writeXML
void writeXML(std::ofstream &xmlfile)
Definition: HLTSignature.cxx:45
TrigConf::HLTTriggerElement
HLT trigger element configuration information.
Definition: HLTTriggerElement.h:26
HLTTriggerElement.h
TrigConf::HLTSignature::HLTSignature
HLTSignature(void)
default constructor
Definition: HLTSignature.cxx:14