ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CTP
src
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
"
6
#include "
TrigConfData/LogicParser.h
"
7
#include "
TrigConfL1Data/TriggerItem.h
"
8
9
#include <exception>
10
11
LVL1CTP::CTPTriggerItem::CTPTriggerItem
()
12
{}
13
14
LVL1CTP::CTPTriggerItem::~CTPTriggerItem
()
15
{}
16
17
void
18
LVL1CTP::CTPTriggerItem::setPrescale
(
int
prescale
) {
19
m_prescale
=
prescale
;
20
}
21
22
23
int
24
LVL1CTP::CTPTriggerItem::prescale
()
const
{
25
return
m_prescale
;
26
}
27
28
void
29
LVL1CTP::CTPTriggerItem::setName
(
const
std::string &
name
) {
30
m_name
=
name
;
31
}
32
33
34
const
std::string &
35
LVL1CTP::CTPTriggerItem::name
()
const
{
36
return
m_name
;
37
}
38
39
unsigned
int
40
LVL1CTP::CTPTriggerItem::ctpId
()
const
{
41
return
m_ctpid
;
42
}
43
44
void
45
LVL1CTP::CTPTriggerItem::setCtpId
(
unsigned
int
ctpid ) {
46
m_ctpid
= ctpid;
47
}
48
49
void
50
LVL1CTP::CTPTriggerItem::setTriggerType
(
unsigned
char
triggerType
) {
51
m_TriggerType
= (
triggerType
& 0xff);
52
}
53
54
unsigned
char
55
LVL1CTP::CTPTriggerItem::triggerType
()
const
{
56
return
m_TriggerType
;
57
}
58
59
void
60
LVL1CTP::CTPTriggerItem::setLogic
(
const
std::string & logicExpr) {
61
TrigConf::LogicParser p;
62
m_logic
= p.parse(logicExpr);
63
}
64
65
66
const
std::shared_ptr<TrigConf::Logic> &
67
LVL1CTP::CTPTriggerItem::logic
()
const
{
68
return
m_logic
;
69
}
70
71
void
72
LVL1CTP::CTPTriggerItem::setBunchGroups
(
const
std::vector<std::string> &
bunchGroups
) {
73
m_bunchGroups
=
bunchGroups
;
74
}
75
76
const
std::vector<std::string> &
77
LVL1CTP::CTPTriggerItem::bunchGroups
()
const
{
78
return
m_bunchGroups
;
79
}
80
81
82
bool
83
LVL1CTP::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
}
CTPTriggerItem.h
LogicParser.h
TriggerItem.h
LVL1CTP::CTPTriggerItem::m_logic
std::shared_ptr< TrigConf::Logic > m_logic
the definition of the item turned into a Logic object
Definition
CTPTriggerItem.h:58
LVL1CTP::CTPTriggerItem::bunchGroups
const std::vector< std::string > & bunchGroups() const
Definition
CTPTriggerItem.cxx:77
LVL1CTP::CTPTriggerItem::setPrescale
void setPrescale(int prescale)
Definition
CTPTriggerItem.cxx:18
LVL1CTP::CTPTriggerItem::triggerType
unsigned char triggerType() const
Definition
CTPTriggerItem.cxx:55
LVL1CTP::CTPTriggerItem::setBunchGroups
void setBunchGroups(const std::vector< std::string > &bunchGroups)
Definition
CTPTriggerItem.cxx:72
LVL1CTP::CTPTriggerItem::CTPTriggerItem
CTPTriggerItem()
constructor setting trigger item and corresponding prescale
Definition
CTPTriggerItem.cxx:11
LVL1CTP::CTPTriggerItem::m_ctpid
unsigned int m_ctpid
CTPID.
Definition
CTPTriggerItem.h:55
LVL1CTP::CTPTriggerItem::~CTPTriggerItem
~CTPTriggerItem()
default destructor
Definition
CTPTriggerItem.cxx:14
LVL1CTP::CTPTriggerItem::setCtpId
void setCtpId(unsigned int ctpid)
Definition
CTPTriggerItem.cxx:45
LVL1CTP::CTPTriggerItem::setName
void setName(const std::string &name)
Definition
CTPTriggerItem.cxx:29
LVL1CTP::CTPTriggerItem::m_bunchGroups
std::vector< std::string > m_bunchGroups
the list of bunchgroups forming this item
Definition
CTPTriggerItem.h:59
LVL1CTP::CTPTriggerItem::logic
const std::shared_ptr< TrigConf::Logic > & logic() const
Definition
CTPTriggerItem.cxx:67
LVL1CTP::CTPTriggerItem::ctpId
unsigned int ctpId() const
Definition
CTPTriggerItem.cxx:40
LVL1CTP::CTPTriggerItem::setLogic
void setLogic(const std::string &logicExpr)
Definition
CTPTriggerItem.cxx:60
LVL1CTP::CTPTriggerItem::evaluate
bool evaluate(const std::map< std::string, unsigned int > &thrDecMap) const
Definition
CTPTriggerItem.cxx:83
LVL1CTP::CTPTriggerItem::setTriggerType
void setTriggerType(unsigned char triggerType)
Definition
CTPTriggerItem.cxx:50
LVL1CTP::CTPTriggerItem::name
const std::string & name() const
Definition
CTPTriggerItem.cxx:35
LVL1CTP::CTPTriggerItem::m_prescale
int m_prescale
prescale value
Definition
CTPTriggerItem.h:57
LVL1CTP::CTPTriggerItem::prescale
int prescale() const
Definition
CTPTriggerItem.cxx:24
LVL1CTP::CTPTriggerItem::m_name
std::string m_name
item name
Definition
CTPTriggerItem.h:54
LVL1CTP::CTPTriggerItem::m_TriggerType
unsigned char m_TriggerType
8 bit trigger type (4 bit for secondary partitions)
Definition
CTPTriggerItem.h:56
Generated on
for ATLAS Offline Software by
1.17.0