ATLAS Offline Software
Loading...
Searching...
No Matches
TCS::TopoCoreSimResult Class Reference

#include <TopoCoreSimResult.h>

Inheritance diagram for TCS::TopoCoreSimResult:
Collaboration diagram for TCS::TopoCoreSimResult:

Public Member Functions

 TopoCoreSimResult ()
 ~TopoCoreSimResult ()
bool triggerDecision (const std::string &triggerName) const
const TCS::TOBArraytriggerOutput (const std::string &triggerName) const
const GlobalOutputglobalOutput () const
const std::vector< const TCS::TOBArray * > & output (const std::string &connName) const
StatusCode setupFromMenu (const std::map< std::string, TCS::DecisionConnector * > &outputConnectorMap, const std::map< std::string, TCS::CountingConnector * > &countConnectorMap)
StatusCode collectResult (TCS::DecisionConnector *outputConn=nullptr, TCS::CountingConnector *countConn=nullptr)
StatusCode reset ()
void setMsgLevel (TrigConf::MSGTC::Level lvl)
bool msgLvl (const MSGTC::Level lvl) const
 Test the output level.
MsgStreamTC & msg () const
 The standard message stream.
MsgStreamTC & msg (const MSGTC::Level lvl) const
 The standard message stream.
const std::string & getName () const
 name accessor

Private Attributes

GlobalOutput m_globalOutput
std::map< std::string, TCS::DecisionConnector * > m_outputConnectorMap
std::map< std::string, TCS::DecisionConnector * > m_triggerLocationDec
std::set< TCS::DecisionConnector * > m_outputConnectors
std::map< std::string, TCS::CountingConnector * > m_countConnectorMap
std::map< std::string, TCS::CountingConnector * > m_triggerLocationCount
std::set< TCS::CountingConnector * > m_countConnectors
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
 MsgStreamTC instance (a std::cout like with print-out levels)
std::string m_name

Friends

std::ostream & operator<< (std::ostream &o, const TCS::TopoCoreSimResult &simRes)

Detailed Description

Definition at line 36 of file TopoCoreSimResult.h.

Constructor & Destructor Documentation

◆ TopoCoreSimResult()

TopoCoreSimResult::TopoCoreSimResult ( )

Definition at line 26 of file TopoCoreSimResult.cxx.

26 :
27 TrigConfMessaging("TopoCoreSimResult")
28{}

◆ ~TopoCoreSimResult()

TopoCoreSimResult::~TopoCoreSimResult ( )

Definition at line 30 of file TopoCoreSimResult.cxx.

31{}

Member Function Documentation

◆ collectResult()

TCS::StatusCode TopoCoreSimResult::collectResult ( TCS::DecisionConnector * outputConn = nullptr,
TCS::CountingConnector * countConn = nullptr )

Definition at line 53 of file TopoCoreSimResult.cxx.

53 {
54 TCS::StatusCode sc = TCS::StatusCode::SUCCESS;
55 if ( (outputConn == nullptr ) && (countConn == nullptr) ) {
57 } else if ( !(outputConn == nullptr ) && (countConn == nullptr) ){
58 set<DecisionConnector*> c = { outputConn };
59 sc = m_globalOutput.collectOutput(c, m_countConnectors);
60 } else if ( (outputConn == nullptr ) && !(countConn == nullptr) ){
61 set<CountingConnector*> c = { countConn };
62 sc = m_globalOutput.collectOutput(m_outputConnectors, c);
63 } else {
64 set<DecisionConnector*> c1 = { outputConn };
65 set<CountingConnector*> c2 = { countConn };
66 sc = m_globalOutput.collectOutput(c1, c2);
67 }
68 return sc;
69}
static Double_t sc
std::set< TCS::CountingConnector * > m_countConnectors
std::set< TCS::DecisionConnector * > m_outputConnectors

◆ getName()

const std::string & TrigConf::TrigConfMessaging::getName ( ) const
inlineinherited

name accessor

Returns
the name

Definition at line 101 of file TrigConfMessaging.h.

101 {
102 return m_name;
103 }

◆ globalOutput()

const GlobalOutput & TCS::TopoCoreSimResult::globalOutput ( ) const
inline

Definition at line 45 of file TopoCoreSimResult.h.

45{ return m_globalOutput; }

◆ msg() [1/2]

MsgStreamTC & TrigConf::TrigConfMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 86 of file TrigConfMessaging.h.

87 {
88 MsgStreamTC* ms = m_msg_tls.get();
89 if (!ms) {
90 ms = new MsgStreamTC(m_name);
91 m_msg_tls.reset(ms);
92 }
93 return *ms;
94 }
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
MsgStreamTC instance (a std::cout like with print-out levels)

◆ msg() [2/2]

MsgStreamTC & TrigConf::TrigConfMessaging::msg ( const MSGTC::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 96 of file TrigConfMessaging.h.

97 {
98 return msg() << lvl;
99 }
MsgStreamTC & msg() const
The standard message stream.

◆ msgLvl()

bool TrigConf::TrigConfMessaging::msgLvl ( const MSGTC::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 75 of file TrigConfMessaging.h.

76 {
77 if (msg().level() <= lvl) {
78 msg() << lvl;
79 return true;
80 }
81 else {
82 return false;
83 }
84 }

◆ output()

const std::vector< const TCS::TOBArray * > & TCS::TopoCoreSimResult::output ( const std::string & connName) const

Definition at line 125 of file TopoCoreSimResult.cxx.

125 {
126
127 for( const DecisionConnector * conn : m_outputConnectors ) {
128 if( conn->name() != connName ) continue;
129 return conn->outputData();
130 }
131
132 // returns first matching connector as there should only be one, otherwise non match, arrive here and throw an exception.
133 TCS_EXCEPTION("No connector with name '" << connName << "'");
134
135 //return (*m_outputConnectors.begin())->outputData();
136}

◆ reset()

TCS::StatusCode TopoCoreSimResult::reset ( )

Definition at line 73 of file TopoCoreSimResult.cxx.

73 {
74 return m_globalOutput.resetOutput();
75}

◆ setMsgLevel()

void TopoCoreSimResult::setMsgLevel ( TrigConf::MSGTC::Level lvl)

Definition at line 160 of file TopoCoreSimResult.cxx.

160 {
161 msg().setLevel( lvl );
162
163 m_globalOutput.msg().setLevel( lvl );
164}
void setLevel(MSGTC::Level lvl)
Set message level of stream.

◆ setupFromMenu()

TCS::StatusCode TopoCoreSimResult::setupFromMenu ( const std::map< std::string, TCS::DecisionConnector * > & outputConnectorMap,
const std::map< std::string, TCS::CountingConnector * > & countConnectorMap )

Definition at line 79 of file TopoCoreSimResult.cxx.

79 {
80
81 // Set decision trigger lines
82
83 m_outputConnectorMap = outputConnectorMap;
84
85 vector<TrigConf::TriggerLine> triggerLinesDec;
86
87 for(auto & x : m_outputConnectorMap) {
88 // fill the set
89 m_outputConnectors.insert(x.second);
90
91 // fill the trigger line map (trigger name --> (TCS::DecisionConnector*,unsigned int index) )
92 for( const TrigConf::TriggerLine & trigger : x.second->triggers() ) {
93 m_triggerLocationDec[trigger.name()] = x.second;
94 triggerLinesDec.push_back(trigger);
95 }
96 }
97
98 m_globalOutput.setDecisionTriggerLines(triggerLinesDec);
99
100 // Set multiplicity trigger lines
101
102 m_countConnectorMap = countConnectorMap;
103
104 vector<TrigConf::TriggerLine> triggerLinesCount;
105
106 for(auto & x : m_countConnectorMap) {
107 // fill the set
108 m_countConnectors.insert(x.second);
109
110 // fill the trigger line map (trigger name --> (TCS::CountingConnector*,unsigned int index) )
111 for( const TrigConf::TriggerLine & trigger : x.second->triggers() ) {
112 m_triggerLocationCount[trigger.name()] = x.second;
113 triggerLinesCount.push_back(trigger);
114 }
115 }
116
117 m_globalOutput.setMultiplicityTriggerLines(triggerLinesDec);
118
120}
#define x
std::map< std::string, TCS::DecisionConnector * > m_triggerLocationDec
std::map< std::string, TCS::DecisionConnector * > m_outputConnectorMap
std::map< std::string, TCS::CountingConnector * > m_triggerLocationCount
std::map< std::string, TCS::CountingConnector * > m_countConnectorMap

◆ triggerDecision()

bool TopoCoreSimResult::triggerDecision ( const std::string & triggerName) const

Definition at line 35 of file TopoCoreSimResult.cxx.

35 {
36 auto x = m_triggerLocationDec.find(triggerName);
37 if( x == end(m_triggerLocationDec) )
38 TCS_EXCEPTION("No trigger with name '" << triggerName << "' defined");
39 return x->second->decision(triggerName);
40}

◆ triggerOutput()

const TCS::TOBArray * TopoCoreSimResult::triggerOutput ( const std::string & triggerName) const

Definition at line 43 of file TopoCoreSimResult.cxx.

43 {
44 auto x = m_triggerLocationDec.find(triggerName);
45 if( x == end(m_triggerLocationDec) )
46 TCS_EXCEPTION("No trigger with name '" << triggerName << "' defined");
47 return x->second->output(triggerName);
48}

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const TCS::TopoCoreSimResult & simRes )
friend

Definition at line 141 of file TopoCoreSimResult.cxx.

142 {
143
144 o << simRes.globalOutput();
145
146 for( const DecisionConnector * conn : simRes.m_outputConnectors ) {
147 o << conn->name() << endl;
148 // for(const TrigConf::TriggerLine & trigger : conn->triggers()) {
149 // o << " " << trigger << endl;
150 // }
151 for(const TCS::TOBArray* output : conn->outputData())
152 o << " output " << output << endl;
153 }
154
155 return o;
156}
const GlobalOutput & globalOutput() const
const std::vector< const TCS::TOBArray * > & output(const std::string &connName) const

Member Data Documentation

◆ m_countConnectorMap

std::map<std::string, TCS::CountingConnector*> TCS::TopoCoreSimResult::m_countConnectorMap
private

Definition at line 71 of file TopoCoreSimResult.h.

◆ m_countConnectors

std::set<TCS::CountingConnector*> TCS::TopoCoreSimResult::m_countConnectors
private

Definition at line 76 of file TopoCoreSimResult.h.

◆ m_globalOutput

GlobalOutput TCS::TopoCoreSimResult::m_globalOutput
private

Definition at line 60 of file TopoCoreSimResult.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls
mutableprivateinherited

MsgStreamTC instance (a std::cout like with print-out levels)

Definition at line 71 of file TrigConfMessaging.h.

◆ m_name

std::string TrigConf::TrigConfMessaging::m_name
privateinherited

Definition at line 72 of file TrigConfMessaging.h.

◆ m_outputConnectorMap

std::map<std::string, TCS::DecisionConnector*> TCS::TopoCoreSimResult::m_outputConnectorMap
private

Definition at line 63 of file TopoCoreSimResult.h.

◆ m_outputConnectors

std::set<TCS::DecisionConnector*> TCS::TopoCoreSimResult::m_outputConnectors
private

Definition at line 68 of file TopoCoreSimResult.h.

◆ m_triggerLocationCount

std::map<std::string, TCS::CountingConnector*> TCS::TopoCoreSimResult::m_triggerLocationCount
private

Definition at line 74 of file TopoCoreSimResult.h.

◆ m_triggerLocationDec

std::map<std::string, TCS::DecisionConnector*> TCS::TopoCoreSimResult::m_triggerLocationDec
private

Definition at line 66 of file TopoCoreSimResult.h.


The documentation for this class was generated from the following files: