ATLAS Offline Software
L1TopoMenu.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 TXC;
13 
14 L1TopoMenu::L1TopoMenu() {}
15 
16 L1TopoMenu::L1TopoMenu(const std::string & name, const std::string & version) :
17  m_name(name),
18  m_version(version),
19  m_smk(0)
20 {}
21 
22 
23 
25 
26 void
28  m_algos.emplace_back(std::move(alg));
29 }
30 
31 const L1TopoConfigAlg &
32 L1TopoMenu::algorithm(const std::string& name) const {
33  for(const L1TopoConfigAlg & alg: m_algos)
34  if(alg.name() == name) return alg;
35  TCS_EXCEPTION("L1TopoMenu: algorithm of name " << name << " doesn't exist");
36 }
37 
38 
41 
43 
44  const L1TopoConfigAlg & alg = algorithm( out.algoname() );
45 
46  if(! alg.isDecAlg()) {
47  TCS_EXCEPTION("L1TopoMenu: output list contains an algorithm " << out.algoname() << " that is not an decision algorithm");
48  }
49 
50  unsigned int bit = out.firstbit();
51  for (const string& outputname : alg.getOutputNames() ) {
52  m_outputlist.addTriggerLine( TriggerLine(outputname, out.algoname(),
53  out.algoid(), out.module(), out.fpga(), out.clock(),
54  bit++) );
55  }
56  }
57 
59 
61 }
62 
63 // print menu
64 void TXC::L1TopoMenu::print() const {
65 
66  cout << "==========================================" << endl
67  << "Menu Name : " << getName() << endl
68  << "Menu Version: " << getVersion() << endl
69  << m_topoconfig << endl;
70 
71  for(const TXC::L1TopoConfigAlg & alg: getL1TopoConfigAlgs())
72  cout << alg << endl;
73 
74  cout << m_outputlist << endl;
75 
76 }
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TXC::L1TopoMenu::~L1TopoMenu
~L1TopoMenu()
Definition: L1TopoMenu.cxx:24
TXC::L1TopoConfigOutputList::addTriggerLine
void addTriggerLine(const TriggerLine &trigger)
Definition: L1TopoConfigOutputList.cxx:34
L1TopoMenu.h
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
TXC::L1TopoMenu::m_algos
std::vector< TXC::L1TopoConfigAlg > m_algos
Definition: L1TopoMenu.h:94
TXC::L1TopoConfigOutputList::sort
void sort()
Definition: L1TopoConfigOutputList.cxx:73
TXC::L1TopoConfigOutputList::getOutputList
const std::vector< OutputListElement > & getOutputList() const
Definition: L1TopoConfigOutputList.h:103
dumpTruth.getName
getName
Definition: dumpTruth.py:34
TXC::L1TopoMenu::m_outputlist
TXC::L1TopoConfigOutputList m_outputlist
Definition: L1TopoMenu.h:96
TXC::L1TopoMenu::print
void print() const
print menu
Definition: L1TopoMenu.cxx:64
TXC::OutputListElement
Definition: L1TopoConfigOutputList.h:57
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TXC
Definition: IL1TopoMenuLoader.h:10
TXC::L1TopoMenu::addAlgorithm
void addAlgorithm(TXC::L1TopoConfigAlg &&alg)
add algorithm
Definition: L1TopoMenu.cxx:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TXC::TriggerLine
Definition: L1TopoConfigOutputList.h:15
TXC::L1TopoMenu::algorithm
const L1TopoConfigAlg & algorithm(const std::string &name) const
Definition: L1TopoMenu.cxx:32
TXC::L1TopoConfigAlg
Definition: L1TopoConfigAlg.h:56
get_generator_info.version
version
Definition: get_generator_info.py:33
TXC::L1TopoMenu::setTriggerList
TCS::StatusCode setTriggerList()
Definition: L1TopoMenu.cxx:40
Exception.h
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15