11 #include "tmEventSetup/tmEventSetup.hh"
12 #include "tmEventSetup/esTriggerMenu.hh"
13 #include "tmEventSetup/esAlgorithm.hh"
14 #include "tmEventSetup/esCondition.hh"
15 #include "tmEventSetup/esObject.hh"
16 #include "tmEventSetup/esCut.hh"
17 #include "tmEventSetup/esScale.hh"
18 #include "tmGrammar/Algorithm.hh"
34 using namespace tmeventsetup;
46 void endJob()
override;
68 const esTriggerMenu*
menu = reinterpret_cast<const esTriggerMenu*>(hmenu.
product());
70 const std::map<std::string, esAlgorithm>& algoMap =
menu->getAlgorithmMap();
71 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
72 const std::map<std::string, esScale>& scaleMap =
menu->getScaleMap();
74 bool hasPrecision =
false;
75 std::map<std::string, unsigned int> precisions;
76 getPrecisions(precisions, scaleMap);
77 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
78 std::cout << cit->first <<
" = " << cit->second <<
"\n";
83 std::map<std::string, esScale>::iterator it1, it2;
84 const esScale* scale1 = &scaleMap.find(
"EG-ETA")->second;
85 const esScale* scale2 = &scaleMap.find(
"MU-ETA")->second;
87 std::vector<long long> lut_eg_2_mu_eta;
88 getCaloMuonEtaConversionLut(lut_eg_2_mu_eta, scale1, scale2);
90 scale1 = &scaleMap.find(
"EG-PHI")->second;
91 scale2 = &scaleMap.find(
"MU-PHI")->second;
93 std::vector<long long> lut_eg_2_mu_phi;
94 getCaloMuonPhiConversionLut(lut_eg_2_mu_phi, scale1, scale2);
96 scale1 = &scaleMap.find(
"EG-ETA")->second;
97 scale2 = &scaleMap.find(
"MU-ETA")->second;
99 std::vector<double> eg_mu_delta_eta;
100 std::vector<long long> lut_eg_mu_delta_eta;
101 size_t n = getDeltaVector(eg_mu_delta_eta, scale1, scale2);
102 setLut(lut_eg_mu_delta_eta, eg_mu_delta_eta, precisions[
"PRECISION-EG-MU-Delta"]);
104 std::vector<long long> lut_eg_mu_cosh;
105 applyCosh(eg_mu_delta_eta,
n);
106 setLut(lut_eg_mu_cosh, eg_mu_delta_eta, precisions[
"PRECISION-EG-MU-Math"]);
108 scale1 = &scaleMap.find(
"EG-PHI")->second;
109 scale2 = &scaleMap.find(
"MU-PHI")->second;
111 std::vector<double> eg_mu_delta_phi;
112 std::vector<long long> lut_eg_mu_delta_phi;
113 n = getDeltaVector(eg_mu_delta_phi, scale1, scale2);
114 setLut(lut_eg_mu_delta_phi, eg_mu_delta_phi, precisions[
"PRECISION-EG-MU-Delta"]);
116 std::vector<long long> lut_eg_mu_cos;
117 applyCos(eg_mu_delta_phi,
n);
118 setLut(lut_eg_mu_cos, eg_mu_delta_phi, precisions[
"PRECISION-EG-MU-Math"]);
120 scale1 = &scaleMap.find(
"EG-ET")->second;
121 std::vector<long long> lut_eg_et;
122 getLut(lut_eg_et, scale1, precisions[
"PRECISION-EG-MU-MassPt"]);
124 scale1 = &scaleMap.find(
"MU-ET")->second;
125 std::vector<long long> lut_mu_et;
126 getLut(lut_mu_et, scale1, precisions[
"PRECISION-EG-MU-MassPt"]);
127 for (
size_t ii = 0;
ii < lut_mu_et.size();
ii++) {
132 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
133 const esAlgorithm&
algo = cit->second;
136 std::cout <<
"algo exp. in cond. = " <<
algo.getExpressionInCondition() <<
"\n";
138 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
139 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
141 if (Algorithm::isGate(
token))
143 const esCondition& condition = condMap.find(
token)->second;
144 std::cout <<
" cond type = " << condition.getType() <<
"\n";
146 const std::vector<esCut>&
cuts = condition.getCuts();
150 std::cout <<
" cut target = " <<
cut.getObjectType() <<
"\n";
151 std::cout <<
" cut type = " <<
cut.getCutType() <<
"\n";
152 std::cout <<
" cut min. value index = " <<
cut.getMinimum().value <<
" " <<
cut.getMinimum().index <<
"\n";
153 std::cout <<
" cut max. value index = " <<
cut.getMaximum().value <<
" " <<
cut.getMaximum().index <<
"\n";
157 const std::vector<esObject>&
objects = condition.getObjects();
160 std::cout <<
" obj name = " <<
object.getName() <<
"\n";
161 std::cout <<
" obj type = " <<
object.getType() <<
"\n";
162 std::cout <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
163 std::cout <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
164 if (
object.getType() == esObjectType::EXT) {
165 std::cout <<
" ext name = " <<
object.getExternalSignalName() <<
"\n";
166 std::cout <<
" ext ch id = " <<
object.getExternalChannelId() <<
"\n";
169 const std::vector<esCut>&
cuts =
object.getCuts();
173 std::cout <<
" cut target = " <<
cut.getObjectType() <<
"\n";
174 std::cout <<
" cut type = " <<
cut.getCutType() <<
"\n";
175 std::cout <<
" cut min. value index = " <<
cut.getMinimum().value <<
" " <<
cut.getMinimum().index
177 std::cout <<
" cut max. value index = " <<
cut.getMaximum().value <<
" " <<
cut.getMaximum().index