Map associating item name to CTPTriggerItem objects.
More...
#include <ItemMap.h>
Map associating item name to CTPTriggerItem objects.
Definition at line 37 of file ItemMap.h.
◆ ItemMap() [1/2]
Definition at line 22 of file ItemMap.cxx.
25 const std::string & itemName(
item.name() );
28 unsigned int ctpId =
item.ctpId();
30 CTPTriggerItem * ctpItem =
new CTPTriggerItem();
31 ctpItem->setPrescale( 1 );
32 ctpItem->setCtpId( ctpId );
33 ctpItem->setName(itemName);
34 ctpItem->setLogic(
item.definition());
35 ctpItem->setTriggerType(
item.triggerTypeAsUChar());
36 ctpItem->setBunchGroups(
item.bunchgroups());
38 m_map[ itemName ] = ctpItem;
◆ ItemMap() [2/2]
constructor setting list of trigger items and associated prescales (random prescale offset if randEngine is given)
Definition at line 52 of file ItemMap.cxx.
59 const std::string & itemName(
item->name() );
62 unsigned int ctpId =
item->ctpId();
64 CTPTriggerItem * ctpItem =
new CTPTriggerItem();
65 ctpItem->setPrescale(
prescales.prescales_float()[ ctpId ] );
66 ctpItem->setCtpId( ctpId );
67 ctpItem->setName(itemName);
68 ctpItem->setLogic(definition);
69 ctpItem->setTriggerType(
item->triggerType());
71 m_map[ itemName ] = ctpItem;
◆ ~ItemMap()
LVL1CTP::ItemMap::~ItemMap |
( |
| ) |
|
◆ getDefinition()
Definition at line 86 of file ItemMap.cxx.
89 std::vector<std::string> thresholdlist;
90 std::string logic, conditions;
91 item->buildLogic(logic, thresholdlist);
93 std::map<unsigned int, std::string> thrNames;
95 for(
const std::string & thrmult : thresholdlist) {
96 std::vector<std::string>
res;
99 std::string name_mult(
"");
100 if(
res.size() == 1) {
103 name_mult =
res[2]+
"[x"+
res[0]+
"]";
105 thrNames[
idx++] = name_mult;
109 std::string def =
item->definition();
110 std::vector<std::string>
tokens;
112 for (
auto & tok : boost::tokenizer<boost::char_separator<char> > (
item->definition(), boost::char_separator<char>(
" ",
"()&|!")) ) {
114 auto [
ptr, ec] = std::from_chars(tok.data(), tok.data() + tok.size(),
n);
115 if (ec == std::errc()) {
116 tokens.emplace_back(thrNames[
n]);
123 std::string definition(
"");
124 for(
auto & tok :
tokens ) {
◆ getItem()
Definition at line 50 of file ItemMap.h.
51 {
return m_map.find( itemName )->second; }
◆ itemNames()
const std::set<std::string>& LVL1CTP::ItemMap::itemNames |
( |
| ) |
const |
|
inline |
◆ m_itemNames
std::set<std::string> LVL1CTP::ItemMap::m_itemNames {} |
|
private |
◆ m_map
The documentation for this class was generated from the following files: