14 #include "CLHEP/Random/RandomEngine.h"
15 #include "CLHEP/Random/RandFlat.h"
17 #include "boost/algorithm/string.hpp"
18 #include <boost/tokenizer.hpp>
19 #include <boost/lexical_cast.hpp>
24 const std::string & itemName(
item.name() );
27 unsigned int ctpId =
item.ctpId();
37 m_map[ itemName ] = ctpItem;
45 for(
auto entry : m_map ) {
56 std::string definition = getDefinition(
item);
58 const std::string & itemName(
item->name() );
61 unsigned int ctpId =
item->ctpId();
70 m_map[ itemName ] = ctpItem;
71 m_itemNames.insert( itemName );
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 ) {