ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerGroupAND Class Reference

#include <L1Emu.h>

Inheritance diagram for TriggerGroupAND:
Collaboration diagram for TriggerGroupAND:

Public Member Functions

 TriggerGroupAND ()
virtual bool evaluate (const std::unordered_map< std::string, size_t > &resultMap, bool debug=false) const override final
virtual std::string to_string () const override final
void append (std::unique_ptr< LogicalElement > pel)
std::set< std::pair< std::string, size_t > > getAllThresholdsMults () const
virtual bool isGroup () const override final

Protected Attributes

std::vector< std::unique_ptr< LogicalElement > > m_inputs {}

Detailed Description

Definition at line 64 of file L1Emu.h.

Constructor & Destructor Documentation

◆ TriggerGroupAND()

TriggerGroupAND::TriggerGroupAND ( )
inline

Definition at line 66 of file L1Emu.h.

66{};

Member Function Documentation

◆ append()

void TriggerGroup::append ( std::unique_ptr< LogicalElement > pel)
inherited

Definition at line 29 of file L1Emu.cxx.

29 {
30 m_inputs.emplace_back(std::move(pel));
31}
std::vector< std::unique_ptr< LogicalElement > > m_inputs
Definition L1Emu.h:51

◆ evaluate()

bool TriggerGroupAND::evaluate ( const std::unordered_map< std::string, size_t > & resultMap,
bool debug = false ) const
finaloverridevirtual

Implements LogicalElement.

Definition at line 51 of file L1Emu.cxx.

51 {
52 bool result = std::all_of(m_inputs.cbegin(),m_inputs.cend(),[resultMap](const std::unique_ptr<LogicalElement>& l) {return l->evaluate(resultMap);});
53 if(debug) {
54 std::cout << "AND of" << std::endl;
55 for(const auto& i : m_inputs) {
56 std::cout << " " << *i << " --> " << i->evaluate(resultMap, debug) << std::endl;
57 }
58 std::cout << " --> " << result << std::endl;
59 }
60 return result;
61}
const bool debug

◆ getAllThresholdsMults()

std::set< std::pair< std::string, size_t > > TriggerGroup::getAllThresholdsMults ( ) const
inherited

Definition at line 34 of file L1Emu.cxx.

34 {
35 std::set<std::pair<std::string,size_t> > out{};
36 for(const auto& i : m_inputs) {
37 if(i->isGroup()) {
38 const TriggerGroup* tg = static_cast<const TriggerGroup*>(i.get());
39 auto itm = tg->getAllThresholdsMults();
40 out.insert(itm.begin(),itm.end());
41 } else {
42 const TriggerElement* te = static_cast<const TriggerElement*>(i.get());
43 out.insert(std::make_pair(te->threshold(), te->multiplicity()));
44 }
45 }
46 return out;
47}
const std::string & threshold() const
Definition L1Emu.h:41
size_t multiplicity() const
Definition L1Emu.h:43
std::set< std::pair< std::string, size_t > > getAllThresholdsMults() const
Definition L1Emu.cxx:34

◆ isGroup()

virtual bool TriggerGroup::isGroup ( ) const
inlinefinaloverridevirtualinherited

Reimplemented from LogicalElement.

Definition at line 61 of file L1Emu.h.

61{return true;};

◆ to_string()

std::string TriggerGroupAND::to_string ( ) const
finaloverridevirtual

Implements LogicalElement.

Definition at line 64 of file L1Emu.cxx.

64 {
65 std::stringstream ss;
66 ss << "(";
67 for (size_t ii{1}; const auto& i : m_inputs) {
68 ss << *i;
69 if(ii<m_inputs.size()) {
70 ss << " & ";
71 }
72 ++ii;
73 }
74 ss << ")";
75 return ss.str();
76};
static Double_t ss

Member Data Documentation

◆ m_inputs

std::vector<std::unique_ptr<LogicalElement> > TriggerGroup::m_inputs {}
protectedinherited

Definition at line 51 of file L1Emu.h.

51{};

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