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" 45 void endJob()
override;
66 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
>(hmenu.
product());
68 const std::map<std::string, esAlgorithm>& algoMap = menu->getAlgorithmMap();
69 const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
70 const std::map<std::string, esScale>& scaleMap = menu->getScaleMap();
72 bool hasPrecision =
false;
73 std::map<std::string, unsigned int> precisions;
74 getPrecisions(precisions, scaleMap);
75 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
76 std::cout << cit->first <<
" = " << cit->second <<
"\n";
81 std::map<std::string, esScale>::iterator it1, it2;
82 const esScale* scale1 = &scaleMap.find(
"EG-ETA")->second;
83 const esScale* scale2 = &scaleMap.find(
"MU-ETA")->second;
85 std::vector<long long> lut_eg_2_mu_eta;
86 getCaloMuonEtaConversionLut(lut_eg_2_mu_eta, scale1, scale2);
88 scale1 = &scaleMap.find(
"EG-PHI")->second;
89 scale2 = &scaleMap.find(
"MU-PHI")->second;
91 std::vector<long long> lut_eg_2_mu_phi;
92 getCaloMuonPhiConversionLut(lut_eg_2_mu_phi, scale1, scale2);
94 scale1 = &scaleMap.find(
"EG-ETA")->second;
95 scale2 = &scaleMap.find(
"MU-ETA")->second;
97 std::vector<double> eg_mu_delta_eta;
98 std::vector<long long> lut_eg_mu_delta_eta;
99 size_t n = getDeltaVector(eg_mu_delta_eta, scale1, scale2);
100 setLut(lut_eg_mu_delta_eta, eg_mu_delta_eta, precisions[
"PRECISION-EG-MU-Delta"]);
102 std::vector<long long> lut_eg_mu_cosh;
103 applyCosh(eg_mu_delta_eta, n);
104 setLut(lut_eg_mu_cosh, eg_mu_delta_eta, precisions[
"PRECISION-EG-MU-Math"]);
106 scale1 = &scaleMap.find(
"EG-PHI")->second;
107 scale2 = &scaleMap.find(
"MU-PHI")->second;
109 std::vector<double> eg_mu_delta_phi;
110 std::vector<long long> lut_eg_mu_delta_phi;
111 n = getDeltaVector(eg_mu_delta_phi, scale1, scale2);
112 setLut(lut_eg_mu_delta_phi, eg_mu_delta_phi, precisions[
"PRECISION-EG-MU-Delta"]);
114 std::vector<long long> lut_eg_mu_cos;
115 applyCos(eg_mu_delta_phi, n);
116 setLut(lut_eg_mu_cos, eg_mu_delta_phi, precisions[
"PRECISION-EG-MU-Math"]);
118 scale1 = &scaleMap.find(
"EG-ET")->second;
119 std::vector<long long> lut_eg_et;
120 getLut(lut_eg_et, scale1, precisions[
"PRECISION-EG-MU-MassPt"]);
122 scale1 = &scaleMap.find(
"MU-ET")->second;
123 std::vector<long long> lut_mu_et;
124 getLut(lut_mu_et, scale1, precisions[
"PRECISION-EG-MU-MassPt"]);
125 for (
size_t ii = 0;
ii < lut_mu_et.size();
ii++) {
130 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
131 const esAlgorithm&
algo = cit->second;
132 std::cout <<
"algo name = " << algo.getName() <<
"\n";
133 std::cout <<
"algo exp. = " << algo.getExpression() <<
"\n";
134 std::cout <<
"algo exp. in cond. = " << algo.getExpressionInCondition() <<
"\n";
136 const std::vector<std::string>& rpn_vec = algo.getRpnVector();
137 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
139 if (Algorithm::isGate(token))
141 const esCondition&
condition = condMap.find(token)->second;
142 std::cout <<
" cond type = " << condition.getType() <<
"\n";
144 const std::vector<esCut>&
cuts = condition.getCuts();
145 for (
size_t jj = 0;
jj < cuts.size();
jj++) {
146 const esCut&
cut = cuts.at(
jj);
147 std::cout <<
" cut name = " << cut.getName() <<
"\n";
148 std::cout <<
" cut target = " << cut.getObjectType() <<
"\n";
149 std::cout <<
" cut type = " << cut.getCutType() <<
"\n";
150 std::cout <<
" cut min. value index = " << cut.getMinimum().value <<
" " << cut.getMinimum().index <<
"\n";
151 std::cout <<
" cut max. value index = " << cut.getMaximum().value <<
" " << cut.getMaximum().index <<
"\n";
152 std::cout <<
" cut data = " << cut.getData() <<
"\n";
155 const std::vector<esObject>&
objects = condition.getObjects();
156 for (
size_t jj = 0;
jj < objects.size();
jj++) {
157 const esObject&
object = objects.at(
jj);
158 std::cout <<
" obj name = " <<
object.getName() <<
"\n";
159 std::cout <<
" obj type = " <<
object.getType() <<
"\n";
160 std::cout <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
161 std::cout <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
162 if (
object.getType() == esObjectType::EXT) {
163 std::cout <<
" ext name = " <<
object.getExternalSignalName() <<
"\n";
164 std::cout <<
" ext ch id = " <<
object.getExternalChannelId() <<
"\n";
167 const std::vector<esCut>& cuts =
object.getCuts();
168 for (
size_t kk = 0;
kk < cuts.size();
kk++) {
169 const esCut&
cut = cuts.at(
kk);
170 std::cout <<
" cut name = " << cut.getName() <<
"\n";
171 std::cout <<
" cut target = " << cut.getObjectType() <<
"\n";
172 std::cout <<
" cut type = " << cut.getCutType() <<
"\n";
173 std::cout <<
" cut min. value index = " << cut.getMinimum().value <<
" " << cut.getMinimum().index
175 std::cout <<
" cut max. value index = " << cut.getMaximum().value <<
" " << cut.getMaximum().index
177 std::cout <<
" cut data = " << cut.getData() <<
"\n";
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const