42 #include "tmEventSetup/tmEventSetup.hh"
43 #include "tmEventSetup/esTriggerMenu.hh"
44 #include "tmEventSetup/esAlgorithm.hh"
45 #include "tmEventSetup/esCondition.hh"
46 #include "tmEventSetup/esObject.hh"
47 #include "tmEventSetup/esCut.hh"
48 #include "tmEventSetup/esScale.hh"
49 #include "tmGrammar/Algorithm.hh"
54 : m_triggerMenuInterface(
"NULL"),
55 m_triggerMenuName(
"NULL"),
56 m_triggerMenuImplementation(0x0),
70 m_numberConditionChips = numberConditionChipsValue;
75 m_pinsOnConditionChip = pinsOnConditionChipValue;
81 m_orderConditionChip = orderConditionChipValue;
86 m_numberPhysTriggers = numberPhysTriggersValue;
94 m_triggerMenuInterface = menuInterface;
103 m_triggerMenuImplementation = menuImplementation;
111 m_vecMuonTemplate = vecMuonTempl;
115 m_vecCaloTemplate = vecCaloTempl;
119 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
120 m_vecEnergySumTemplate = vecEnergySumTempl;
124 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
125 m_vecExternalTemplate = vecExternalTempl;
129 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
130 m_vecCorrelationTemplate = vecCorrelationTempl;
134 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
135 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
139 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
140 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
146 m_corMuonTemplate = corMuonTempl;
150 m_corCaloTemplate = corCaloTempl;
154 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
155 m_corEnergySumTemplate = corEnergySumTempl;
165 using namespace tmeventsetup;
166 const esTriggerMenu*
menu = reinterpret_cast<const esTriggerMenu*>(utmMenu);
167 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
169 std::map<std::string, unsigned int> extBitMap;
172 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin(); cit != condMap.end(); cit++) {
173 const esCondition& condition = cit->second;
174 if (condition.getType() == esConditionType::Externals) {
176 const std::vector<esObject>&
objects = condition.getObjects();
179 if (
object.getType() == esObjectType::EXT) {
180 unsigned int channelID =
object.getExternalChannelId();
183 if (extBitMap.count(
name) == 0)
202 m_conditionMap.resize(m_numberConditionChips);
204 m_vecMuonTemplate.resize(m_numberConditionChips);
205 m_vecCaloTemplate.resize(m_numberConditionChips);
206 m_vecEnergySumTemplate.resize(m_numberConditionChips);
207 m_vecExternalTemplate.resize(m_numberConditionChips);
209 m_vecCorrelationTemplate.resize(m_numberConditionChips);
210 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
211 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
212 m_corMuonTemplate.resize(m_numberConditionChips);
213 m_corCaloTemplate.resize(m_numberConditionChips);
214 m_corEnergySumTemplate.resize(m_numberConditionChips);
216 using namespace tmeventsetup;
219 const esTriggerMenu*
menu = reinterpret_cast<const esTriggerMenu*>(utmMenu);
222 m_triggerMenuDescription =
menu->getComment();
223 m_triggerMenuDate =
menu->getDatetime();
224 m_triggerMenuImplementation = (getMmHashN(
menu->getFirmwareUuid()) & 0xFFFFFFFF);
225 m_triggerMenuName =
menu->getName();
226 m_triggerMenuInterface =
menu->getVersion();
227 m_triggerMenuUUID = (getMmHashN(
menu->getName()) & 0xFFFFFFFF);
229 const std::map<std::string, esAlgorithm>& algoMap =
menu->getAlgorithmMap();
230 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
231 const std::map<std::string, esScale>& scaleMap =
menu->getScaleMap();
234 m_gtScales.setScalesName(
menu->getScaleSetName());
235 parseScales(scaleMap);
238 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
243 const esAlgorithm&
algo = cit->second;
246 parseAlgorithm(
algo, chipNr);
249 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
250 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
255 const esCondition& condition = condMap.find(
token)->second;
258 if ((m_conditionMap[chipNr]).
count(condition.getName()) == 0) {
260 if (condition.getType() == esConditionType::SingleEgamma ||
261 condition.getType() == esConditionType::DoubleEgamma ||
262 condition.getType() == esConditionType::TripleEgamma ||
263 condition.getType() == esConditionType::QuadEgamma || condition.getType() == esConditionType::SingleTau ||
264 condition.getType() == esConditionType::DoubleTau || condition.getType() == esConditionType::TripleTau ||
265 condition.getType() == esConditionType::QuadTau || condition.getType() == esConditionType::SingleJet ||
266 condition.getType() == esConditionType::DoubleJet || condition.getType() == esConditionType::TripleJet ||
267 condition.getType() == esConditionType::QuadJet) {
268 parseCalo(condition, chipNr,
false);
271 }
else if (condition.getType() == esConditionType::TotalEt ||
272 condition.getType() == esConditionType::TotalEtEM ||
273 condition.getType() == esConditionType::TotalHt ||
274 condition.getType() == esConditionType::MissingEt ||
275 condition.getType() == esConditionType::MissingHt ||
276 condition.getType() == esConditionType::MissingEtHF ||
277 condition.getType() == esConditionType::TowerCount ||
278 condition.getType() == esConditionType::MinBiasHFP0 ||
279 condition.getType() == esConditionType::MinBiasHFM0 ||
280 condition.getType() == esConditionType::MinBiasHFP1 ||
281 condition.getType() == esConditionType::MinBiasHFM1 ||
282 condition.getType() == esConditionType::AsymmetryEt ||
283 condition.getType() == esConditionType::AsymmetryHt ||
284 condition.getType() == esConditionType::AsymmetryEtHF ||
285 condition.getType() == esConditionType::AsymmetryHtHF ||
286 condition.getType() == esConditionType::Centrality0 ||
287 condition.getType() == esConditionType::Centrality1 ||
288 condition.getType() == esConditionType::Centrality2 ||
289 condition.getType() == esConditionType::Centrality3 ||
290 condition.getType() == esConditionType::Centrality4 ||
291 condition.getType() == esConditionType::Centrality5 ||
292 condition.getType() == esConditionType::Centrality6 ||
293 condition.getType() == esConditionType::Centrality7) {
294 parseEnergySum(condition, chipNr,
false);
299 condition.getType() == esConditionType::TripleMuon ||
300 condition.getType() == esConditionType::QuadMuon) {
301 parseMuon(condition, chipNr,
false);
304 }
else if (condition.getType() == esConditionType::MuonMuonCorrelation ||
305 condition.getType() == esConditionType::MuonEsumCorrelation ||
306 condition.getType() == esConditionType::CaloMuonCorrelation ||
307 condition.getType() == esConditionType::CaloCaloCorrelation ||
308 condition.getType() == esConditionType::CaloEsumCorrelation ||
309 condition.getType() == esConditionType::InvariantMass ||
310 condition.getType() == esConditionType::TransverseMass ||
311 condition.getType() == esConditionType::InvariantMassUpt) {
312 parseCorrelation(condition, chipNr);
315 }
else if (condition.getType() == esConditionType::InvariantMass3) {
316 parseCorrelationThreeBody(condition, chipNr);
319 }
else if (condition.getType() == esConditionType::Externals) {
320 parseExternal(condition, chipNr);
322 }
else if (condition.getType() == esConditionType::SingleEgammaOvRm ||
323 condition.getType() == esConditionType::DoubleEgammaOvRm ||
324 condition.getType() == esConditionType::TripleEgammaOvRm ||
325 condition.getType() == esConditionType::QuadEgammaOvRm ||
326 condition.getType() == esConditionType::SingleTauOvRm ||
327 condition.getType() == esConditionType::DoubleTauOvRm ||
328 condition.getType() == esConditionType::TripleTauOvRm ||
329 condition.getType() == esConditionType::QuadTauOvRm ||
330 condition.getType() == esConditionType::SingleJetOvRm ||
331 condition.getType() == esConditionType::DoubleJetOvRm ||
332 condition.getType() == esConditionType::TripleJetOvRm ||
333 condition.getType() == esConditionType::QuadJetOvRm) {
336 <<
"SingleEgammaOvRm" << std::endl
337 <<
"DoubleEgammaOvRm" << std::endl
338 <<
"TripleEgammaOvRm" << std::endl
339 <<
"QuadEgammaOvRm" << std::endl
340 <<
"SingleTauOvRm" << std::endl
341 <<
"DoubleTauOvRm" << std::endl
342 <<
"TripleTauOvRm" << std::endl
343 <<
"QuadTauOvRm" << std::endl
344 <<
"SingleJetOvRm" << std::endl
345 <<
"DoubleJetOvRm" << std::endl
346 <<
"TripleJetOvRm" << std::endl
347 <<
"QuadJetOvRm" << std::endl
348 <<
"The above conditions types OvRm are not implemented yet in the parser. Please remove alogrithms that "
349 "use this type of condtion from L1T Menu!"
354 else if (condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
355 condition.getType() == esConditionType::InvariantMassOvRm ||
356 condition.getType() == esConditionType::TransverseMassOvRm) {
357 parseCorrelationWithOverlapRemoval(condition, chipNr);
372 m_triggerMenuInterfaceAuthor =
val;
376 m_triggerMenuInterfaceDescription =
val;
394 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
398 itCondOnChip->clear();
402 m_algorithmMap.clear();
409 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map."
413 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
414 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
418 (m_conditionMap[chipNr])[cName] = &
cond;
419 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
432 if (m_algorithmMap.count(algName) != 0) {
433 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
434 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
438 if (m_algorithmAliasMap.count(algAlias) != 0) {
439 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
440 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
447 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, "
448 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
453 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
454 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
455 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
461 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
463 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
464 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, "
465 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
471 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
473 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
474 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, "
475 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
480 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
481 int iPin = (itAlgo->second)
482 .algoOutputPin(static_cast<int>(m_numberConditionChips),
483 static_cast<int>(m_pinsOnConditionChip),
484 m_orderConditionChip);
486 int iChip = (itAlgo->second)
487 .algoChipNumber(static_cast<int>(m_numberConditionChips),
488 static_cast<int>(m_pinsOnConditionChip),
489 m_orderConditionChip);
491 if ((outputPin == iPin) && (chipNr == iChip)) {
492 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
493 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!"
500 m_algorithmMap[algName] = alg;
501 m_algorithmAliasMap[algAlias] = alg;
510 template <
typename T>
512 std::stringstream
ss;
517 std::stringstream
ss;
532 using namespace tmeventsetup;
547 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end(); cit++) {
548 const esScale&
scale = cit->second;
552 scaleParam = &muScales;
554 scaleParam = &egScales;
556 scaleParam = &tauScales;
558 scaleParam = &jetScales;
560 scaleParam = &ettScales;
561 else if (
scale.getObjectType() == esObjectType::ETTEM)
562 scaleParam = &ettEmScales;
564 scaleParam = &etmScales;
565 else if (
scale.getObjectType() == esObjectType::ETMHF)
566 scaleParam = &etmHfScales;
568 scaleParam = &httScales;
570 scaleParam = &htmScales;
572 scaleParam =
nullptr;
574 if (scaleParam !=
nullptr) {
575 switch (
scale.getScaleType()) {
576 case esScaleType::EtScale: {
582 const std::vector<esBin>& binsV =
scale.getBins();
583 for (
unsigned int i = 0;
i < binsV.size();
i++) {
584 const esBin&
bin = binsV.at(
i);
585 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
586 scaleParam->
etBins.push_back(binLimits);
593 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
598 scale.getObjectType() == esObjectType::ETTEM) {
606 case esScaleType::UnconstrainedPtScale: {
612 const std::vector<esBin>& binsV =
scale.getBins();
613 for (
unsigned int i = 0;
i < binsV.size();
i++) {
614 const esBin&
bin = binsV.at(
i);
615 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
616 scaleParam->
uptBins.push_back(binLimits);
619 case esScaleType::EtaScale: {
625 const std::vector<esBin>& binsV =
scale.getBins();
627 for (
unsigned int i = 0;
i < binsV.size();
i++) {
628 const esBin&
bin = binsV.at(
i);
629 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
630 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
633 case esScaleType::PhiScale: {
639 const std::vector<esBin>& binsV =
scale.getBins();
641 for (
unsigned int i = 0;
i < binsV.size();
i++) {
642 const esBin&
bin = binsV.at(
i);
643 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
644 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
655 m_gtScales.setMuonScales(muScales);
656 m_gtScales.setEGScales(egScales);
657 m_gtScales.setTauScales(tauScales);
658 m_gtScales.setJetScales(jetScales);
659 m_gtScales.setETTScales(ettScales);
660 m_gtScales.setETTEmScales(ettEmScales);
661 m_gtScales.setETMScales(etmScales);
662 m_gtScales.setETMHfScales(etmHfScales);
663 m_gtScales.setHTTScales(httScales);
664 m_gtScales.setHTMScales(htmScales);
667 bool hasPrecision =
false;
668 std::map<std::string, unsigned int> precisions;
669 getPrecisions(precisions, scaleMap);
670 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
677 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
678 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
679 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
683 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
684 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
685 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
686 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
687 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
688 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
692 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
693 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
694 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
695 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
696 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
697 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
698 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
699 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
703 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
704 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
705 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
706 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
707 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
708 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
709 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
713 parseDeltaEta_Cosh_LUTS(
714 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
715 parseDeltaEta_Cosh_LUTS(
716 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
717 parseDeltaEta_Cosh_LUTS(
718 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
719 parseDeltaEta_Cosh_LUTS(
720 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
722 parseDeltaEta_Cosh_LUTS(
723 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
724 parseDeltaEta_Cosh_LUTS(
725 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
726 parseDeltaEta_Cosh_LUTS(
727 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
729 parseDeltaEta_Cosh_LUTS(
730 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
731 parseDeltaEta_Cosh_LUTS(
732 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
734 parseDeltaEta_Cosh_LUTS(
735 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
739 parseDeltaPhi_Cos_LUTS(
740 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
741 parseDeltaPhi_Cos_LUTS(
742 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
743 parseDeltaPhi_Cos_LUTS(
744 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
745 parseDeltaPhi_Cos_LUTS(
746 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
747 parseDeltaPhi_Cos_LUTS(
748 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
749 parseDeltaPhi_Cos_LUTS(
750 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
751 parseDeltaPhi_Cos_LUTS(
752 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
754 parseDeltaPhi_Cos_LUTS(
755 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
756 parseDeltaPhi_Cos_LUTS(
757 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
758 parseDeltaPhi_Cos_LUTS(
759 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
760 parseDeltaPhi_Cos_LUTS(
761 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
762 parseDeltaPhi_Cos_LUTS(
763 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
764 parseDeltaPhi_Cos_LUTS(
765 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
767 parseDeltaPhi_Cos_LUTS(
768 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
769 parseDeltaPhi_Cos_LUTS(
770 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
771 parseDeltaPhi_Cos_LUTS(
772 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
773 parseDeltaPhi_Cos_LUTS(
774 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
775 parseDeltaPhi_Cos_LUTS(
776 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
778 parseDeltaPhi_Cos_LUTS(
779 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
780 parseDeltaPhi_Cos_LUTS(
781 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
782 parseDeltaPhi_Cos_LUTS(
783 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
784 parseDeltaPhi_Cos_LUTS(
785 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
787 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
788 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
789 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
790 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
792 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
793 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
794 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
795 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
808 using namespace tmeventsetup;
817 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
820 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
821 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
823 std::vector<long long> lut_cal_2_mu_eta;
824 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
829 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
835 using namespace tmeventsetup;
844 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
847 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
848 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
850 std::vector<long long> lut_cal_2_mu_phi;
851 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
856 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
863 using namespace tmeventsetup;
870 if (scaleMap.find(scLabel1) == scaleMap.end())
873 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
875 std::vector<long long> lut_pt;
876 getLut(lut_pt, scale1, prec);
878 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
886 using namespace tmeventsetup;
893 if (scaleMap.find(scLabel1) == scaleMap.end())
896 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
898 std::vector<long long> lut_pt;
899 getLut(lut_pt, scale1, prec);
901 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
908 unsigned int prec2) {
909 using namespace tmeventsetup;
918 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
921 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
922 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
923 std::vector<double> val_delta_eta;
924 std::vector<long long> lut_delta_eta;
925 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
926 setLut(lut_delta_eta, val_delta_eta, prec1);
930 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
933 std::vector<long long> lut_cosh;
934 applyCosh(val_delta_eta,
n);
935 setLut(lut_cosh, val_delta_eta, prec2);
936 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
943 unsigned int prec2) {
944 using namespace tmeventsetup;
953 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
956 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
957 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
958 std::vector<double> val_delta_phi;
959 std::vector<long long> lut_delta_phi;
960 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
961 setLut(lut_delta_phi, val_delta_phi, prec1);
965 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
968 std::vector<long long> lut_cos;
969 applyCos(val_delta_phi,
n);
970 setLut(lut_cos, val_delta_phi, prec2);
971 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
978 using namespace tmeventsetup;
984 if (scaleMap.find(scLabel) == scaleMap.end())
989 const esScale*
scale = &scaleMap.find(scLabel)->second;
994 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
998 for (
size_t ii = 0;
ii <
n;
ii++) {
1003 std::vector<long long> lut;
1006 setLut(lut,
array, prec);
1007 m_gtScales.setLUT_Sin(lutName, lut, prec);
1010 setLut(lut,
array, prec);
1011 m_gtScales.setLUT_Cos(lutName, lut, prec);
1027 using namespace tmeventsetup;
1046 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1050 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1055 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1060 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")"
1061 <<
"\nCan not determine number of trigger objects. " << std::endl;
1065 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
1067 <<
"\n condition = " << condition <<
"\n particle = " << particle
1068 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1073 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1079 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1080 tmpValues.reserve(nrObj);
1082 if (
int(condMu.getObjects().size()) != nrObj) {
1083 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1084 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1089 unsigned int chargeCorrelation = 1;
1090 const std::vector<esCut>&
cuts = condMu.getCuts();
1091 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1093 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1094 if (
cut.getData() ==
"ls")
1095 chargeCorrelation = 2;
1096 else if (
cut.getData() ==
"os")
1097 chargeCorrelation = 4;
1099 chargeCorrelation = 1;
1113 const std::vector<esObject>&
objects = condMu.getObjects();
1116 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1119 relativeBx =
object.getBxOffset();
1122 int upperUnconstrainedPtInd = -1;
1123 int lowerUnconstrainedPtInd = 0;
1124 int upperImpactParameterInd = -1;
1125 int lowerImpactParameterInd = 0;
1126 int upperThresholdInd = -1;
1127 int lowerThresholdInd = 0;
1128 int upperIndexInd = -1;
1129 int lowerIndexInd = 0;
1131 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1133 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1134 int isolationLUT = 0xF;
1135 int impactParameterLUT = 0xF;
1137 int qualityLUT = 0xFFFF;
1139 const std::vector<esCut>&
cuts =
object.getCuts();
1140 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1143 switch (
cut.getCutType()) {
1144 case esCutType::UnconstrainedPt:
1145 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1146 upperUnconstrainedPtInd =
cut.getMaximum().index;
1149 case esCutType::ImpactParameter:
1150 lowerImpactParameterInd =
cut.getMinimum().index;
1151 upperImpactParameterInd =
cut.getMaximum().index;
1152 impactParameterLUT = l1tstr2int(
cut.getData());
1156 lowerThresholdInd =
cut.getMinimum().index;
1157 upperThresholdInd =
cut.getMaximum().index;
1160 case esCutType::Slice:
1161 lowerIndexInd =
int(
cut.getMinimum().value);
1162 upperIndexInd =
int(
cut.getMaximum().value);
1165 case esCutType::Eta: {
1167 etaWindow1Lower =
cut.getMinimum().index;
1168 etaWindow1Upper =
cut.getMaximum().index;
1169 }
else if (cntEta == 1) {
1170 etaWindow2Lower =
cut.getMinimum().index;
1171 etaWindow2Upper =
cut.getMaximum().index;
1174 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1183 phiWindow1Lower =
cut.getMinimum().index;
1184 phiWindow1Upper =
cut.getMaximum().index;
1185 }
else if (cntPhi == 1) {
1186 phiWindow2Lower =
cut.getMinimum().index;
1187 phiWindow2Upper =
cut.getMaximum().index;
1190 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1198 if (
cut.getData() ==
"positive")
1200 else if (
cut.getData() ==
"negative")
1207 qualityLUT = l1tstr2int(
cut.getData());
1210 case esCutType::Isolation: {
1211 isolationLUT = l1tstr2int(
cut.getData());
1221 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1222 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1223 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1224 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1225 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1227 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1228 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1230 objParameter[cnt].indexHigh = upperIndexInd;
1231 objParameter[cnt].indexLow = lowerIndexInd;
1233 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1234 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1235 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1236 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1238 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1239 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1240 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1241 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1244 objParameter[cnt].enableMip =
false;
1245 objParameter[cnt].enableIso =
false;
1246 objParameter[cnt].requestIso =
false;
1248 objParameter[cnt].charge =
charge;
1249 objParameter[cnt].qualityLUT = qualityLUT;
1250 objParameter[cnt].isolationLUT = isolationLUT;
1270 std::ostringstream myCoutStream;
1271 muonCond.
print(myCoutStream);
1272 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1276 if (!insertConditionIntoMap(muonCond, chipNr)) {
1277 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1280 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1282 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1284 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1285 (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1295 using namespace tmeventsetup;
1307 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")"
1308 <<
"\nCan not determine number of trigger objects. " << std::endl;
1312 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
1314 <<
"\n condition = " << condition <<
"\n particle = " << particle
1315 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1320 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1326 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1327 tmpValues.reserve(nrObj);
1332 unsigned int chargeCorrelation = 0;
1333 if (str_chargeCorrelation ==
"ig")
1334 chargeCorrelation = 1;
1335 else if (str_chargeCorrelation ==
"ls")
1336 chargeCorrelation = 2;
1337 else if (str_chargeCorrelation ==
"os")
1338 chargeCorrelation = 4;
1348 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1351 relativeBx = corrMu->getBxOffset();
1354 int upperUnconstrainedPtInd = -1;
1355 int lowerUnconstrainedPtInd = 0;
1356 int upperImpactParameterInd = -1;
1357 int lowerImpactParameterInd = 0;
1358 int impactParameterLUT = 0xF;
1359 int upperThresholdInd = -1;
1360 int lowerThresholdInd = 0;
1361 int upperIndexInd = -1;
1362 int lowerIndexInd = 0;
1364 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1366 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1367 int isolationLUT = 0xF;
1369 int qualityLUT = 0xFFFF;
1371 const std::vector<esCut>&
cuts = corrMu->getCuts();
1372 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1375 switch (
cut.getCutType()) {
1376 case esCutType::UnconstrainedPt:
1377 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1378 upperUnconstrainedPtInd =
cut.getMaximum().index;
1381 case esCutType::ImpactParameter:
1382 lowerImpactParameterInd =
cut.getMinimum().index;
1383 upperImpactParameterInd =
cut.getMaximum().index;
1384 impactParameterLUT = l1tstr2int(
cut.getData());
1388 lowerThresholdInd =
cut.getMinimum().index;
1389 upperThresholdInd =
cut.getMaximum().index;
1392 case esCutType::Slice:
1393 lowerIndexInd =
int(
cut.getMinimum().value);
1394 upperIndexInd =
int(
cut.getMaximum().value);
1397 case esCutType::Eta: {
1399 etaWindow1Lower =
cut.getMinimum().index;
1400 etaWindow1Upper =
cut.getMaximum().index;
1401 }
else if (cntEta == 1) {
1402 etaWindow2Lower =
cut.getMinimum().index;
1403 etaWindow2Upper =
cut.getMaximum().index;
1406 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1415 phiWindow1Lower =
cut.getMinimum().index;
1416 phiWindow1Upper =
cut.getMaximum().index;
1417 }
else if (cntPhi == 1) {
1418 phiWindow2Lower =
cut.getMinimum().index;
1419 phiWindow2Upper =
cut.getMaximum().index;
1422 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1430 if (
cut.getData() ==
"positive")
1432 else if (
cut.getData() ==
"negative")
1439 qualityLUT = l1tstr2int(
cut.getData());
1442 case esCutType::Isolation: {
1443 isolationLUT = l1tstr2int(
cut.getData());
1453 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1454 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1455 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1456 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1457 objParameter[0].impactParameterLUT = impactParameterLUT;
1459 objParameter[0].ptHighThreshold = upperThresholdInd;
1460 objParameter[0].ptLowThreshold = lowerThresholdInd;
1462 objParameter[0].indexHigh = upperIndexInd;
1463 objParameter[0].indexLow = lowerIndexInd;
1465 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1466 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1467 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1468 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1470 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1471 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1472 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1473 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1476 objParameter[0].enableMip =
false;
1477 objParameter[0].enableIso =
false;
1478 objParameter[0].requestIso =
false;
1480 objParameter[0].charge =
charge;
1481 objParameter[0].qualityLUT = qualityLUT;
1482 objParameter[0].isolationLUT = isolationLUT;
1498 std::ostringstream myCoutStream;
1499 muonCond.
print(myCoutStream);
1500 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1516 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1535 using namespace tmeventsetup;
1544 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
1545 <<
"\n (in parseCalo) "
1546 <<
"\n condition = " << condition <<
"\n particle = " << particle
1547 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1556 if (condCalo.getType() == esConditionType::SingleEgamma) {
1561 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1566 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1571 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1576 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1577 caloObjType =
gtJet;
1581 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1582 caloObjType =
gtJet;
1586 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1587 caloObjType =
gtJet;
1591 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1592 caloObjType =
gtJet;
1596 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1597 caloObjType =
gtTau;
1601 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1602 caloObjType =
gtTau;
1606 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1607 caloObjType =
gtTau;
1611 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1612 caloObjType =
gtTau;
1617 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1624 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")"
1625 <<
"\nCan not determine number of trigger objects. " << std::endl;
1632 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1638 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1639 tmpValues.reserve(nrObj);
1641 if (
int(condCalo.getObjects().size()) != nrObj) {
1642 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1643 <<
"condCalo.getObjects().size() = " << condCalo.getObjects().size()
1658 const std::vector<esObject>&
objects = condCalo.getObjects();
1661 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1664 relativeBx =
object.getBxOffset();
1667 int upperThresholdInd = -1;
1668 int lowerThresholdInd = 0;
1669 int upperIndexInd = -1;
1670 int lowerIndexInd = 0;
1672 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1674 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1675 int isolationLUT = 0xF;
1676 int qualityLUT = 0xF;
1678 const std::vector<esCut>&
cuts =
object.getCuts();
1679 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1682 switch (
cut.getCutType()) {
1684 lowerThresholdInd =
cut.getMinimum().index;
1685 upperThresholdInd =
cut.getMaximum().index;
1687 case esCutType::Slice:
1688 lowerIndexInd =
int(
cut.getMinimum().value);
1689 upperIndexInd =
int(
cut.getMaximum().value);
1691 case esCutType::Eta: {
1693 etaWindow1Lower =
cut.getMinimum().index;
1694 etaWindow1Upper =
cut.getMaximum().index;
1695 }
else if (cntEta == 1) {
1696 etaWindow2Lower =
cut.getMinimum().index;
1697 etaWindow2Upper =
cut.getMaximum().index;
1700 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1709 phiWindow1Lower =
cut.getMinimum().index;
1710 phiWindow1Upper =
cut.getMaximum().index;
1711 }
else if (cntPhi == 1) {
1712 phiWindow2Lower =
cut.getMinimum().index;
1713 phiWindow2Upper =
cut.getMaximum().index;
1716 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1724 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1729 qualityLUT = l1tstr2int(
cut.getData());
1732 case esCutType::Isolation: {
1733 isolationLUT = l1tstr2int(
cut.getData());
1743 objParameter[cnt].etHighThreshold = upperThresholdInd;
1744 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1745 objParameter[cnt].indexHigh = upperIndexInd;
1746 objParameter[cnt].indexLow = lowerIndexInd;
1747 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1748 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1749 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1750 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1751 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1752 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1753 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1754 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1755 objParameter[cnt].isolationLUT = isolationLUT;
1756 objParameter[cnt].qualityLUT = qualityLUT;
1759 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" "
1760 << cnt <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - "
1761 << objParameter[cnt].etHighThreshold
1762 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x"
1763 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1764 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
1765 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1766 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
1767 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1768 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
1769 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1770 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x"
1771 << objParameter[cnt].isolationLUT <<
"\n Quality LUT for calo object " << cnt
1772 <<
" = 0x" << objParameter[cnt].qualityLUT <<
std::dec << std::endl;
1778 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1796 std::ostringstream myCoutStream;
1797 caloCond.
print(myCoutStream);
1798 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1802 if (!insertConditionIntoMap(caloCond, chipNr)) {
1803 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1808 (m_corCaloTemplate[chipNr]).push_back(caloCond);
1810 (m_vecCaloTemplate[chipNr]).push_back(caloCond);
1831 using namespace tmeventsetup;
1840 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
1841 <<
"\n (in parseCalo) "
1842 <<
"\n condition = " << condition <<
"\n particle = " << particle
1843 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1855 caloObjType =
gtJet;
1857 caloObjType =
gtTau;
1859 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1866 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")"
1867 <<
"\nCan not determine number of trigger objects. " << std::endl;
1874 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1880 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1881 tmpValues.reserve(nrObj);
1887 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1890 relativeBx = corrCalo->getBxOffset();
1893 int upperThresholdInd = -1;
1894 int lowerThresholdInd = 0;
1895 int upperIndexInd = -1;
1896 int lowerIndexInd = 0;
1898 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1900 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1901 int isolationLUT = 0xF;
1902 int qualityLUT = 0xF;
1904 const std::vector<esCut>&
cuts = corrCalo->getCuts();
1905 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1908 switch (
cut.getCutType()) {
1910 lowerThresholdInd =
cut.getMinimum().index;
1911 upperThresholdInd =
cut.getMaximum().index;
1913 case esCutType::Slice:
1914 lowerIndexInd =
int(
cut.getMinimum().value);
1915 upperIndexInd =
int(
cut.getMaximum().value);
1917 case esCutType::Eta: {
1919 etaWindow1Lower =
cut.getMinimum().index;
1920 etaWindow1Upper =
cut.getMaximum().index;
1921 }
else if (cntEta == 1) {
1922 etaWindow2Lower =
cut.getMinimum().index;
1923 etaWindow2Upper =
cut.getMaximum().index;
1926 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1935 phiWindow1Lower =
cut.getMinimum().index;
1936 phiWindow1Upper =
cut.getMaximum().index;
1937 }
else if (cntPhi == 1) {
1938 phiWindow2Lower =
cut.getMinimum().index;
1939 phiWindow2Upper =
cut.getMaximum().index;
1942 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1950 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1955 qualityLUT = l1tstr2int(
cut.getData());
1958 case esCutType::Isolation: {
1959 isolationLUT = l1tstr2int(
cut.getData());
1969 objParameter[0].etLowThreshold = lowerThresholdInd;
1970 objParameter[0].etHighThreshold = upperThresholdInd;
1971 objParameter[0].indexHigh = upperIndexInd;
1972 objParameter[0].indexLow = lowerIndexInd;
1973 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1974 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1975 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1976 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1977 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1978 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1979 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1980 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1981 objParameter[0].isolationLUT = isolationLUT;
1982 objParameter[0].qualityLUT = qualityLUT;
1985 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" "
1986 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - "
1987 << objParameter[0].etHighThreshold <<
"\n etaWindow Lower / Upper for calo object "
1988 <<
" = 0x" << objParameter[0].etaWindow1Lower <<
" / 0x"
1989 << objParameter[0].etaWindow1Upper
1990 <<
"\n etaWindowVeto Lower / Upper for calo object "
1991 <<
" = 0x" << objParameter[0].etaWindow2Lower <<
" / 0x"
1992 << objParameter[0].etaWindow2Upper <<
"\n phiWindow Lower / Upper for calo object "
1993 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x"
1994 << objParameter[0].phiWindow1Upper
1995 <<
"\n phiWindowVeto Lower / Upper for calo object "
1996 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x"
1997 << objParameter[0].phiWindow2Upper <<
"\n Isolation LUT for calo object "
1998 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object "
1999 <<
" = 0x" << objParameter[0].qualityLUT <<
std::dec << std::endl;
2002 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2020 std::ostringstream myCoutStream;
2021 caloCond.
print(myCoutStream);
2022 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2039 (m_corCaloTemplate[chipNr]).push_back(caloCond);
2057 unsigned int chipNr,
2058 const bool corrFlag) {
2060 using namespace tmeventsetup;
2068 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
2069 <<
"\n (in parseEnergySum) "
2070 <<
"\n condition = " << condition <<
"\n type = " <<
type
2071 <<
"\n name = " <<
name << std::endl;
2077 if (condEnergySum.getType() == esConditionType::MissingEt) {
2080 }
else if (condEnergySum.getType() == esConditionType::TotalEt) {
2083 }
else if (condEnergySum.getType() == esConditionType::TotalEtEM) {
2086 }
else if (condEnergySum.getType() == esConditionType::TotalHt) {
2089 }
else if (condEnergySum.getType() == esConditionType::MissingHt) {
2092 }
else if (condEnergySum.getType() == esConditionType::MissingEtHF) {
2095 }
else if (condEnergySum.getType() == esConditionType::TowerCount) {
2098 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP0) {
2101 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM0) {
2104 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP1) {
2107 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM1) {
2110 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEt) {
2113 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHt) {
2116 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEtHF) {
2119 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHtHF) {
2122 }
else if (condEnergySum.getType() == esConditionType::Centrality0) {
2125 }
else if (condEnergySum.getType() == esConditionType::Centrality1) {
2128 }
else if (condEnergySum.getType() == esConditionType::Centrality2) {
2131 }
else if (condEnergySum.getType() == esConditionType::Centrality3) {
2134 }
else if (condEnergySum.getType() == esConditionType::Centrality4) {
2137 }
else if (condEnergySum.getType() == esConditionType::Centrality5) {
2140 }
else if (condEnergySum.getType() == esConditionType::Centrality6) {
2143 }
else if (condEnergySum.getType() == esConditionType::Centrality7) {
2147 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2159 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2170 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2173 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2176 relativeBx =
object.getBxOffset();
2179 int lowerThresholdInd = 0;
2180 int upperThresholdInd = -1;
2182 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2184 const std::vector<esCut>&
cuts =
object.getCuts();
2185 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2188 switch (
cut.getCutType()) {
2190 lowerThresholdInd =
cut.getMinimum().index;
2191 upperThresholdInd =
cut.getMaximum().index;
2194 case esCutType::Eta:
2199 phiWindow1Lower =
cut.getMinimum().index;
2200 phiWindow1Upper =
cut.getMaximum().index;
2201 }
else if (cntPhi == 1) {
2202 phiWindow2Lower =
cut.getMinimum().index;
2203 phiWindow2Upper =
cut.getMaximum().index;
2205 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2212 case esCutType::Count:
2213 lowerThresholdInd =
cut.getMinimum().index;
2214 upperThresholdInd = 0xffffff;
2224 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2225 objParameter[cnt].etHighThreshold = upperThresholdInd;
2226 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2227 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2228 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2229 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2232 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2233 << std::hex << objParameter[cnt].etLowThreshold <<
" - "
2234 << objParameter[cnt].etHighThreshold
2235 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
2236 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2237 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
2238 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2245 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2260 std::ostringstream myCoutStream;
2261 energySumCond.
print(myCoutStream);
2262 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2266 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2267 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2272 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2275 (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2296 using namespace tmeventsetup;
2304 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
2305 <<
"\n (in parseEnergySum) "
2306 <<
"\n condition = " << condition <<
"\n type = " <<
type
2307 <<
"\n name = " <<
name << std::endl;
2319 }
else if (corrESum->getType() == esObjectType::ETMHF) {
2322 }
else if (corrESum->getType() == esObjectType::TOWERCOUNT) {
2326 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")"
2339 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2349 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2352 relativeBx = corrESum->getBxOffset();
2355 int lowerThresholdInd = 0;
2356 int upperThresholdInd = -1;
2358 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2360 const std::vector<esCut>&
cuts = corrESum->getCuts();
2361 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2364 switch (
cut.getCutType()) {
2366 lowerThresholdInd =
cut.getMinimum().index;
2367 upperThresholdInd =
cut.getMaximum().index;
2370 case esCutType::Eta:
2375 phiWindow1Lower =
cut.getMinimum().index;
2376 phiWindow1Upper =
cut.getMaximum().index;
2377 }
else if (cntPhi == 1) {
2378 phiWindow2Lower =
cut.getMinimum().index;
2379 phiWindow2Upper =
cut.getMaximum().index;
2381 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2395 objParameter[0].etLowThreshold = lowerThresholdInd;
2396 objParameter[0].etHighThreshold = upperThresholdInd;
2397 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2398 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2399 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2400 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2403 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2404 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2405 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
2406 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2407 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
2408 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2412 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2427 std::ostringstream myCoutStream;
2428 energySumCond.
print(myCoutStream);
2429 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2447 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2466 using namespace tmeventsetup;
2474 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** "
2475 <<
"\n (in parseExternal) "
2476 <<
"\n condition = " << condition <<
"\n particle = " << particle
2477 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2486 unsigned int channelID = 0;
2489 const std::vector<esObject>&
objects = condExt.getObjects();
2492 if (
object.getType() == esObjectType::EXT) {
2493 relativeBx =
object.getBxOffset();
2494 channelID =
object.getExternalChannelId();
2502 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2514 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2517 if (!insertConditionIntoMap(externalCond, chipNr)) {
2518 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2522 (m_vecExternalTemplate[chipNr]).push_back(externalCond);
2541 using namespace tmeventsetup;
2548 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2549 <<
" (in parseCorrelation) " << std::endl
2550 <<
" condition = " << condition << std::endl
2551 <<
" particle = " << particle << std::endl
2552 <<
" type = " <<
type << std::endl
2553 <<
" name = " <<
name << std::endl;
2559 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2560 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2571 const int nrObj = 2;
2574 int intGEq[nrObj] = {-1, -1};
2575 std::vector<GlobalObject>
objType(nrObj);
2576 std::vector<GtConditionCategory> condCateg(nrObj);
2579 const bool corrFlag =
true;
2580 int corrIndexVal[nrObj] = {-1, -1};
2588 const std::vector<esCut>&
cuts = corrCond.getCuts();
2589 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2592 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2593 if (
cut.getData() ==
"ls")
2595 else if (
cut.getData() ==
"os")
2603 double minV =
cut.getMinimum().value;
2604 double maxV =
cut.getMaximum().value;
2611 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2612 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2613 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2617 cutType = cutType | 0x1;
2619 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2620 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2621 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2625 cutType = cutType | 0x2;
2627 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2628 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2629 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2633 cutType = cutType | 0x4;
2634 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2638 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2639 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2640 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2641 cutType = cutType | 0x20;
2643 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2644 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2645 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2650 if (corrCond.getType() == esConditionType::TransverseMass) {
2651 cutType = cutType | 0x10;
2653 cutType = cutType | 0x8;
2655 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2656 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2657 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2658 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2662 cutType = cutType | 0x40;
2669 const std::vector<esObject>&
objects = corrCond.getObjects();
2671 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name
2672 <<
" corrFlag " << corrFlag << std::endl;
2679 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2680 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2681 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2682 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2719 parseMuonCorr(&
object, chipNr);
2720 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2723 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2730 parseCaloCorr(&
object, chipNr);
2731 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2734 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2735 switch (
object.getType()) {
2750 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2751 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2753 parseEnergySumCorr(&
object, chipNr);
2754 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2757 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2758 switch (
object.getType()) {
2765 case esObjectType::ETMHF: {
2768 case esObjectType::TOWERCOUNT: {
2777 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
2778 <<
" for the correlation condition " <<
name << std::endl;
2787 if (intGEq[0] != intGEq[1]) {
2788 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions "
2789 <<
" for the correlation condition " <<
name << std::endl;
2793 gEq = (intGEq[0] != 0);
2811 std::ostringstream myCoutStream;
2812 correlationCond.
print(myCoutStream);
2813 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2819 (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
2839 using namespace tmeventsetup;
2846 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2847 <<
" (in parseCorrelationThreeBody) " << std::endl
2848 <<
" condition = " << condition << std::endl
2849 <<
" particle = " << particle << std::endl
2850 <<
" type = " <<
type << std::endl
2851 <<
" name = " <<
name << std::endl;
2857 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2858 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2866 const int nrObj = 3;
2869 std::vector<GlobalObject>
objType(nrObj);
2870 std::vector<GtConditionCategory> condCateg(nrObj);
2873 const bool corrFlag =
true;
2874 int corrIndexVal[nrObj] = {-1, -1, -1};
2881 const std::vector<esCut>&
cuts = corrCond.getCuts();
2882 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
2883 const esCut
cut =
cuts.at(lll);
2888 double minV =
cut.getMinimum().value;
2889 double maxV =
cut.getMaximum().value;
2896 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2897 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2898 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2902 cutType = cutType | 0x8;
2908 const std::vector<esObject>&
objects = corrCond.getObjects();
2910 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name
2911 <<
" corrFlag " << corrFlag << std::endl;
2916 for (
size_t lll = 0; lll <
objects.size(); lll++) {
2917 const esObject
object =
objects.at(lll);
2918 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2919 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2920 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2925 parseMuonCorr(&
object, chipNr);
2926 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
2933 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
2934 <<
" for the correlation condition " <<
name
2935 <<
": no three muons in the event!" << std::endl;
2955 std::ostringstream myCoutStream;
2956 correlationThreeBodyCond.
print(myCoutStream);
2957 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2963 (m_vecCorrelationThreeBodyTemplate[chipNr]).push_back(correlationThreeBodyCond);
2983 unsigned int chipNr) {
2984 using namespace tmeventsetup;
2991 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2992 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
2993 <<
" condition = " << condition << std::endl
2994 <<
" particle = " << particle << std::endl
2995 <<
" type = " <<
type << std::endl
2996 <<
" name = " <<
name << std::endl;
3002 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3003 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3014 const int nrObj = 3;
3017 int intGEq[nrObj] = {-1, -1, -1};
3018 std::vector<GlobalObject>
objType(nrObj);
3019 std::vector<GtConditionCategory> condCateg(nrObj);
3022 const bool corrFlag =
true;
3023 int corrIndexVal[nrObj] = {-1, -1, -1};
3031 const std::vector<esCut>&
cuts = corrCond.getCuts();
3032 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3035 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3036 if (
cut.getData() ==
"ls")
3038 else if (
cut.getData() ==
"os")
3046 double minV =
cut.getMinimum().value;
3047 double maxV =
cut.getMaximum().value;
3058 cutType = cutType | 0x1;
3064 cutType = cutType | 0x2;
3070 cutType = cutType | 0x4;
3076 cutType = cutType | 0x8;
3078 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3083 cutType = cutType | 0x10;
3084 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3089 cutType = cutType | 0x20;
3090 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3095 cutType = cutType | 0x40;
3102 const std::vector<esObject>&
objects = corrCond.getObjects();
3105 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag "
3106 << corrFlag << std::endl;
3112 const esObject&
object =
objects.at(
jj);
3113 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3114 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3115 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3116 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3117 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3154 parseMuonCorr(&
object, chipNr);
3155 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3158 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3165 parseCaloCorr(&
object, chipNr);
3166 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3169 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3170 switch (
object.getType()) {
3185 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3186 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3188 parseEnergySumCorr(&
object, chipNr);
3189 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3192 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3193 switch (
object.getType()) {
3200 case esObjectType::ETMHF: {
3203 case esObjectType::TOWERCOUNT: {
3212 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3213 <<
" for the correlation condition " <<
name << std::endl;
3222 if (intGEq[0] != intGEq[1]) {
3223 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions "
3224 <<
" for the correlation condition " <<
name << std::endl;
3228 gEq = (intGEq[0] != 0);
3248 std::ostringstream myCoutStream;
3249 correlationWORCond.
print(myCoutStream);
3250 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3256 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).push_back(correlationWORCond);
3274 using namespace tmeventsetup;
3281 if (algAlias.empty()) {
3283 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name."
3284 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3288 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm."
3289 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3296 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3297 <<
" Chip number: " << chipNr << std::endl;
3303 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3318 std::ostringstream myCoutStream;
3319 alg.
print(myCoutStream);
3320 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3324 if (!insertAlgorithmIntoMap(alg)) {