ATLAS Offline Software
Loading...
Searching...
No Matches
CTPTriggerItem.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "./CTPTriggerItem.h"
8
9#include <exception>
10
13
16
17void
21
22
23int
27
28void
29LVL1CTP::CTPTriggerItem::setName( const std::string & name ) {
30 m_name = name;
31}
32
33
34const std::string &
36 return m_name;
37}
38
39unsigned int
41 return m_ctpid;
42}
43
44void
45LVL1CTP::CTPTriggerItem::setCtpId( unsigned int ctpid ) {
46 m_ctpid = ctpid;
47}
48
49void
53
54unsigned char
58
59void
60LVL1CTP::CTPTriggerItem::setLogic(const std::string & logicExpr) {
61 TrigConf::LogicParser p;
62 m_logic = p.parse(logicExpr);
63}
64
65
66const std::shared_ptr<TrigConf::Logic> &
68 return m_logic;
69}
70
71void
75
76const std::vector<std::string> &
80
81
82bool
83LVL1CTP::CTPTriggerItem::evaluate( const std::map<std::string, unsigned int> & thrDecMap ) const
84{
85 if(m_logic) {
86 bool dec = m_logic->evaluate(thrDecMap);
87 if( dec && (! m_bunchGroups.empty()) ) {
88 // apply bunchgroups, if set (if not set, it is part of the logic)
89 for( auto & bgName : m_bunchGroups ) {
90 try {
91 if( thrDecMap.at(bgName) == 0 ) {
92 dec = false; break;
93 }
94 }
95 catch(std::exception &) {
96 throw std::runtime_error( "Problem accessing decision for bunchgroup " + bgName);
97 }
98 }
99 }
100 return dec;
101 } else {
102 std::cerr << "No logic set for this ctpItem " << name() << std::endl;
103 return false;
104 }
105}
std::shared_ptr< TrigConf::Logic > m_logic
the definition of the item turned into a Logic object
const std::vector< std::string > & bunchGroups() const
void setPrescale(int prescale)
unsigned char triggerType() const
void setBunchGroups(const std::vector< std::string > &bunchGroups)
CTPTriggerItem()
constructor setting trigger item and corresponding prescale
unsigned int m_ctpid
CTPID.
~CTPTriggerItem()
default destructor
void setCtpId(unsigned int ctpid)
void setName(const std::string &name)
std::vector< std::string > m_bunchGroups
the list of bunchgroups forming this item
const std::shared_ptr< TrigConf::Logic > & logic() const
unsigned int ctpId() const
void setLogic(const std::string &logicExpr)
bool evaluate(const std::map< std::string, unsigned int > &thrDecMap) const
void setTriggerType(unsigned char triggerType)
const std::string & name() const
int m_prescale
prescale value
std::string m_name
item name
unsigned char m_TriggerType
8 bit trigger type (4 bit for secondary partitions)