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 21 of file ItemMap.cxx.
24 const std::string & itemName(
item.name() );
27 unsigned int ctpId =
item.ctpId();
29 CTPTriggerItem * ctpItem =
new CTPTriggerItem();
30 ctpItem->setPrescale( 1 );
31 ctpItem->setCtpId( ctpId );
32 ctpItem->setName(itemName);
33 ctpItem->setLogic(
item.definition());
34 ctpItem->setTriggerType(
item.triggerTypeAsUChar());
35 ctpItem->setBunchGroups(
item.bunchgroups());
37 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 51 of file ItemMap.cxx.
58 const std::string & itemName(
item->name() );
61 unsigned int ctpId =
item->ctpId();
63 CTPTriggerItem * ctpItem =
new CTPTriggerItem();
64 ctpItem->setPrescale(
prescales.prescales_float()[ ctpId ] );
65 ctpItem->setCtpId( ctpId );
66 ctpItem->setName(itemName);
67 ctpItem->setLogic(definition);
68 ctpItem->setTriggerType(
item->triggerType());
70 m_map[ itemName ] = ctpItem;
◆ ~ItemMap()
LVL1CTP::ItemMap::~ItemMap |
( |
| ) |
|
◆ getDefinition()
Definition at line 85 of file ItemMap.cxx.
88 std::vector<std::string> thresholdlist;
89 std::string logic, conditions;
90 item->buildLogic(logic, thresholdlist);
92 std::map<unsigned int, std::string> thrNames;
94 for(
const std::string & thrmult : thresholdlist) {
95 std::vector<std::string>
res;
98 std::string name_mult(
"");
102 name_mult =
res[2]+
"[x"+
res[0]+
"]";
104 thrNames[
idx++] = name_mult;
108 std::string def =
item->definition();
109 std::vector<std::string>
tokens;
111 for (
auto & tok : boost::tokenizer<boost::char_separator<char> > (
item->definition(), boost::char_separator<char>(
" ",
"()&|!")) ) {
113 int n = boost::lexical_cast<int,std::string>(tok);
114 tokens.emplace_back(thrNames[
n]);
116 catch(
const boost::bad_lexical_cast &) {
122 std::string definition(
"");
123 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: