48 #include "tmEventSetup/tmEventSetup.hh" 49 #include "tmEventSetup/esTriggerMenu.hh" 50 #include "tmEventSetup/esAlgorithm.hh" 51 #include "tmEventSetup/esCondition.hh" 52 #include "tmEventSetup/esObject.hh" 53 #include "tmEventSetup/esCut.hh" 54 #include "tmEventSetup/esScale.hh" 55 #include "tmGrammar/Algorithm.hh" 60 : m_triggerMenuInterface(
"NULL"),
61 m_triggerMenuName(
"NULL"),
62 m_triggerMenuImplementation(0x0),
76 m_numberConditionChips = numberConditionChipsValue;
81 m_pinsOnConditionChip = pinsOnConditionChipValue;
87 m_orderConditionChip = orderConditionChipValue;
92 m_numberPhysTriggers = numberPhysTriggersValue;
100 m_triggerMenuInterface = menuInterface;
109 m_triggerMenuImplementation = menuImplementation;
117 m_vecMuonTemplate = vecMuonTempl;
121 const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTempl) {
122 m_vecMuonShowerTemplate = vecMuonShowerTempl;
126 m_vecCaloTemplate = vecCaloTempl;
130 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
131 m_vecEnergySumTemplate = vecEnergySumTempl;
135 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
136 m_vecExternalTemplate = vecExternalTempl;
140 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
141 m_vecCorrelationTemplate = vecCorrelationTempl;
145 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
146 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
150 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
151 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
157 m_corMuonTemplate = corMuonTempl;
161 m_corCaloTemplate = corCaloTempl;
165 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
166 m_corEnergySumTemplate = corEnergySumTempl;
177 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
>(utmMenu);
178 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
180 std::map<std::string, unsigned int> extBitMap;
183 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin(); cit != condMap.end(); cit++) {
184 const esCondition& condition = cit->second;
185 if (condition.getType() == esConditionType::Externals) {
187 const std::vector<esObject>&
objects = condition.getObjects();
190 if (
object.getType() == esObjectType::EXT) {
191 unsigned int channelID =
object.getExternalChannelId();
194 if (extBitMap.count(
name) == 0)
213 m_conditionMap.resize(m_numberConditionChips);
215 m_vecMuonTemplate.resize(m_numberConditionChips);
216 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
217 m_vecCaloTemplate.resize(m_numberConditionChips);
218 m_vecEnergySumTemplate.resize(m_numberConditionChips);
219 m_vecExternalTemplate.resize(m_numberConditionChips);
221 m_vecCorrelationTemplate.resize(m_numberConditionChips);
222 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
223 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
224 m_corMuonTemplate.resize(m_numberConditionChips);
225 m_corCaloTemplate.resize(m_numberConditionChips);
226 m_corEnergySumTemplate.resize(m_numberConditionChips);
231 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
>(utmMenu);
234 m_triggerMenuDescription =
menu->getComment();
235 m_triggerMenuDate =
menu->getDatetime();
236 m_triggerMenuImplementation = (getMmHashN(
menu->getFirmwareUuid()) & 0xFFFFFFFF);
237 m_triggerMenuName =
menu->getName();
238 m_triggerMenuInterface =
menu->getVersion();
239 m_triggerMenuUUID = (getMmHashN(
menu->getName()) & 0xFFFFFFFF);
241 const std::map<std::string, esAlgorithm>& algoMap =
menu->getAlgorithmMap();
242 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
243 const std::map<std::string, esScale>& scaleMap =
menu->getScaleMap();
246 m_gtScales.setScalesName(
menu->getScaleSetName());
247 parseScales(scaleMap);
250 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
255 const esAlgorithm&
algo = cit->second;
258 parseAlgorithm(
algo, chipNr);
261 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
262 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
267 const esCondition& condition = condMap.find(
token)->second;
270 if ((m_conditionMap[chipNr]).
count(condition.getName()) == 0) {
272 if (condition.getType() == esConditionType::SingleEgamma ||
273 condition.getType() == esConditionType::DoubleEgamma ||
274 condition.getType() == esConditionType::TripleEgamma ||
275 condition.getType() == esConditionType::QuadEgamma || condition.getType() == esConditionType::SingleTau ||
276 condition.getType() == esConditionType::DoubleTau || condition.getType() == esConditionType::TripleTau ||
277 condition.getType() == esConditionType::QuadTau || condition.getType() == esConditionType::SingleJet ||
278 condition.getType() == esConditionType::DoubleJet || condition.getType() == esConditionType::TripleJet ||
279 condition.getType() == esConditionType::QuadJet) {
280 parseCalo(condition, chipNr,
false);
283 }
else if (condition.getType() == esConditionType::TotalEt ||
284 condition.getType() == esConditionType::TotalEtEM ||
285 condition.getType() == esConditionType::TotalHt ||
286 condition.getType() == esConditionType::MissingEt ||
287 condition.getType() == esConditionType::MissingHt ||
288 condition.getType() == esConditionType::MissingEtHF ||
289 condition.getType() == esConditionType::TowerCount ||
290 condition.getType() == esConditionType::MinBiasHFP0 ||
291 condition.getType() == esConditionType::MinBiasHFM0 ||
292 condition.getType() == esConditionType::MinBiasHFP1 ||
293 condition.getType() == esConditionType::MinBiasHFM1 ||
294 condition.getType() == esConditionType::AsymmetryEt ||
295 condition.getType() == esConditionType::AsymmetryHt ||
296 condition.getType() == esConditionType::AsymmetryEtHF ||
297 condition.getType() == esConditionType::AsymmetryHtHF ||
298 condition.getType() == esConditionType::Centrality0 ||
299 condition.getType() == esConditionType::Centrality1 ||
300 condition.getType() == esConditionType::Centrality2 ||
301 condition.getType() == esConditionType::Centrality3 ||
302 condition.getType() == esConditionType::Centrality4 ||
303 condition.getType() == esConditionType::Centrality5 ||
304 condition.getType() == esConditionType::Centrality6 ||
305 condition.getType() == esConditionType::Centrality7) {
306 parseEnergySum(condition, chipNr,
false);
310 condition.getType() == esConditionType::DoubleMuon ||
311 condition.getType() == esConditionType::TripleMuon ||
312 condition.getType() == esConditionType::QuadMuon) {
313 parseMuon(condition, chipNr,
false);
315 }
else if (condition.getType() == esConditionType::MuonShower0 ||
316 condition.getType() == esConditionType::MuonShower1 ||
317 condition.getType() == esConditionType::MuonShower2 ||
318 condition.getType() == esConditionType::MuonShowerOutOfTime0 ||
319 condition.getType() == esConditionType::MuonShowerOutOfTime1) {
320 parseMuonShower(condition, chipNr,
false);
323 }
else if (condition.getType() == esConditionType::MuonMuonCorrelation ||
324 condition.getType() == esConditionType::MuonEsumCorrelation ||
325 condition.getType() == esConditionType::CaloMuonCorrelation ||
326 condition.getType() == esConditionType::CaloCaloCorrelation ||
327 condition.getType() == esConditionType::CaloEsumCorrelation ||
328 condition.getType() == esConditionType::InvariantMass ||
329 condition.getType() == esConditionType::InvariantMassDeltaR ||
330 condition.getType() == esConditionType::TransverseMass ||
331 condition.getType() == esConditionType::InvariantMassUpt) {
332 parseCorrelation(condition, chipNr);
335 }
else if (condition.getType() == esConditionType::InvariantMass3) {
336 parseCorrelationThreeBody(condition, chipNr);
339 }
else if (condition.getType() == esConditionType::Externals) {
340 parseExternal(condition, chipNr);
343 }
else if (condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
344 condition.getType() == esConditionType::InvariantMassOvRm ||
345 condition.getType() == esConditionType::TransverseMassOvRm ||
346 condition.getType() == esConditionType::DoubleJetOvRm ||
347 condition.getType() == esConditionType::DoubleTauOvRm) {
348 parseCorrelationWithOverlapRemoval(condition, chipNr);
350 }
else if (condition.getType() == esConditionType::SingleEgammaOvRm ||
351 condition.getType() == esConditionType::DoubleEgammaOvRm ||
352 condition.getType() == esConditionType::TripleEgammaOvRm ||
353 condition.getType() == esConditionType::QuadEgammaOvRm ||
354 condition.getType() == esConditionType::SingleTauOvRm ||
355 condition.getType() == esConditionType::TripleTauOvRm ||
356 condition.getType() == esConditionType::QuadTauOvRm ||
357 condition.getType() == esConditionType::SingleJetOvRm ||
358 condition.getType() == esConditionType::TripleJetOvRm ||
359 condition.getType() == esConditionType::QuadJetOvRm) {
361 <<
"\n SingleEgammaOvRm" 362 <<
"\n DoubleEgammaOvRm" 363 <<
"\n TripleEgammaOvRm" 364 <<
"\n QuadEgammaOvRm" 365 <<
"\n SingleTauOvRm" 366 <<
"\n TripleTauOvRm" 368 <<
"\n SingleJetOvRm" 369 <<
"\n TripleJetOvRm" 371 <<
"\n The above conditions types OvRm are not implemented yet in the " 372 "parser. Please remove alogrithms that " 373 "use this type of condtion from L1T Menu!" 389 m_triggerMenuInterfaceAuthor =
val;
393 m_triggerMenuInterfaceDescription =
val;
411 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
415 itCondOnChip->clear();
419 m_algorithmMap.clear();
426 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 430 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
431 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
435 (m_conditionMap[chipNr])[cName] = &
cond;
436 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
449 if (m_algorithmMap.count(algName) != 0) {
450 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
451 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
455 if (m_algorithmAliasMap.count(algAlias) != 0) {
456 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
457 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
464 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 465 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
470 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
471 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
472 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
478 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
480 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
481 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 482 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
488 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
490 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
491 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 492 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
497 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
498 int iPin = (itAlgo->second)
499 .algoOutputPin(static_cast<int>(m_numberConditionChips),
500 static_cast<int>(m_pinsOnConditionChip),
501 m_orderConditionChip);
503 int iChip = (itAlgo->second)
504 .algoChipNumber(static_cast<int>(m_numberConditionChips),
505 static_cast<int>(m_pinsOnConditionChip),
506 m_orderConditionChip);
508 if ((outputPin == iPin) && (chipNr == iChip)) {
509 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
510 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 517 m_algorithmMap[algName] = alg;
518 m_algorithmAliasMap[algAlias] = alg;
527 template <
typename T>
529 std::stringstream
ss;
534 std::stringstream
ss;
564 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end(); cit++) {
565 const esScale&
scale = cit->second;
569 scaleParam = &muScales;
570 else if (
scale.getObjectType() == esObjectType::Egamma)
571 scaleParam = &egScales;
573 scaleParam = &tauScales;
575 scaleParam = &jetScales;
577 scaleParam = &ettScales;
578 else if (
scale.getObjectType() == esObjectType::ETTEM)
579 scaleParam = &ettEmScales;
581 scaleParam = &etmScales;
582 else if (
scale.getObjectType() == esObjectType::ETMHF)
583 scaleParam = &etmHfScales;
585 scaleParam = &httScales;
587 scaleParam = &htmScales;
589 scaleParam =
nullptr;
591 if (scaleParam !=
nullptr) {
592 switch (
scale.getScaleType()) {
593 case esScaleType::EtScale: {
599 const std::vector<esBin>& binsV =
scale.getBins();
600 for (
unsigned int i = 0;
i < binsV.size();
i++) {
601 const esBin&
bin = binsV.at(
i);
602 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
603 scaleParam->
etBins.push_back(binLimits);
610 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
615 scale.getObjectType() == esObjectType::ETTEM) {
623 case esScaleType::UnconstrainedPtScale: {
629 const std::vector<esBin>& binsV =
scale.getBins();
630 for (
unsigned int i = 0;
i < binsV.size();
i++) {
631 const esBin&
bin = binsV.at(
i);
632 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
633 scaleParam->
uptBins.push_back(binLimits);
636 case esScaleType::EtaScale: {
642 const std::vector<esBin>& binsV =
scale.getBins();
644 for (
unsigned int i = 0;
i < binsV.size();
i++) {
645 const esBin&
bin = binsV.at(
i);
646 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
647 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
650 case esScaleType::PhiScale: {
656 const std::vector<esBin>& binsV =
scale.getBins();
658 for (
unsigned int i = 0;
i < binsV.size();
i++) {
659 const esBin&
bin = binsV.at(
i);
660 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
661 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
672 m_gtScales.setMuonScales(muScales);
673 m_gtScales.setEGScales(egScales);
674 m_gtScales.setTauScales(tauScales);
675 m_gtScales.setJetScales(jetScales);
676 m_gtScales.setETTScales(ettScales);
677 m_gtScales.setETTEmScales(ettEmScales);
678 m_gtScales.setETMScales(etmScales);
679 m_gtScales.setETMHfScales(etmHfScales);
680 m_gtScales.setHTTScales(httScales);
681 m_gtScales.setHTMScales(htmScales);
684 bool hasPrecision =
false;
685 std::map<std::string, unsigned int> precisions;
686 getPrecisions(precisions, scaleMap);
687 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
694 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
695 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
696 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
700 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
701 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
702 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
703 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
704 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
705 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
709 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
710 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
711 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
712 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
713 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
714 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
715 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
716 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
720 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
721 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
722 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
723 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
724 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
725 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
726 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
730 parseDeltaEta_Cosh_LUTS(
731 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
732 parseDeltaEta_Cosh_LUTS(
733 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
734 parseDeltaEta_Cosh_LUTS(
735 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
736 parseDeltaEta_Cosh_LUTS(
737 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
739 parseDeltaEta_Cosh_LUTS(
740 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
741 parseDeltaEta_Cosh_LUTS(
742 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
743 parseDeltaEta_Cosh_LUTS(
744 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
746 parseDeltaEta_Cosh_LUTS(
747 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
748 parseDeltaEta_Cosh_LUTS(
749 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
751 parseDeltaEta_Cosh_LUTS(
752 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
756 parseDeltaPhi_Cos_LUTS(
757 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
758 parseDeltaPhi_Cos_LUTS(
759 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
760 parseDeltaPhi_Cos_LUTS(
761 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
762 parseDeltaPhi_Cos_LUTS(
763 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
764 parseDeltaPhi_Cos_LUTS(
765 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
766 parseDeltaPhi_Cos_LUTS(
767 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
768 parseDeltaPhi_Cos_LUTS(
769 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
771 parseDeltaPhi_Cos_LUTS(
772 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
773 parseDeltaPhi_Cos_LUTS(
774 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
775 parseDeltaPhi_Cos_LUTS(
776 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
777 parseDeltaPhi_Cos_LUTS(
778 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
779 parseDeltaPhi_Cos_LUTS(
780 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
781 parseDeltaPhi_Cos_LUTS(
782 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
784 parseDeltaPhi_Cos_LUTS(
785 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
786 parseDeltaPhi_Cos_LUTS(
787 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
788 parseDeltaPhi_Cos_LUTS(
789 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
790 parseDeltaPhi_Cos_LUTS(
791 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
792 parseDeltaPhi_Cos_LUTS(
793 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
795 parseDeltaPhi_Cos_LUTS(
796 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
797 parseDeltaPhi_Cos_LUTS(
798 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
799 parseDeltaPhi_Cos_LUTS(
800 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
801 parseDeltaPhi_Cos_LUTS(
802 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
804 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
805 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
806 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
807 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
809 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
810 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
811 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
812 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
834 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
837 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
838 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
840 std::vector<long long> lut_cal_2_mu_eta;
841 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
846 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
861 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
864 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
865 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
867 std::vector<long long> lut_cal_2_mu_phi;
868 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
873 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
887 if (scaleMap.find(scLabel1) == scaleMap.end())
890 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
892 std::vector<long long> lut_pt;
893 getLut(lut_pt, scale1, prec);
895 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
910 if (scaleMap.find(scLabel1) == scaleMap.end())
913 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
915 std::vector<long long> lut_pt;
916 getLut(lut_pt, scale1, prec);
918 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
925 unsigned int prec2) {
935 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
938 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
939 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
940 std::vector<double> val_delta_eta;
941 std::vector<long long> lut_delta_eta;
942 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
943 setLut(lut_delta_eta, val_delta_eta, prec1);
947 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
950 std::vector<long long> lut_cosh;
951 applyCosh(val_delta_eta,
n);
952 setLut(lut_cosh, val_delta_eta, prec2);
953 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
960 unsigned int prec2) {
970 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
973 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
974 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
975 std::vector<double> val_delta_phi;
976 std::vector<long long> lut_delta_phi;
977 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
978 setLut(lut_delta_phi, val_delta_phi, prec1);
982 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
985 std::vector<long long> lut_cos;
986 applyCos(val_delta_phi,
n);
987 setLut(lut_cos, val_delta_phi, prec2);
988 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
1001 if (scaleMap.find(scLabel) == scaleMap.end())
1006 const esScale*
scale = &scaleMap.find(scLabel)->second;
1011 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1015 for (
size_t ii = 0;
ii <
n;
ii++) {
1020 std::vector<long long> lut;
1023 setLut(lut,
array, prec);
1024 m_gtScales.setLUT_Sin(lutName, lut, prec);
1027 setLut(lut,
array, prec);
1028 m_gtScales.setLUT_Cos(lutName, lut, prec);
1059 }
else if (condMu.getType() == esConditionType::DoubleMuon) {
1063 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1067 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1072 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1077 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1078 <<
"\nCan not determine number of trigger objects. " << std::endl;
1082 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1084 <<
"\n condition = " << condition <<
"\n particle = " << particle
1085 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1090 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1096 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1097 tmpValues.reserve(nrObj);
1099 if (
int(condMu.getObjects().size()) != nrObj) {
1100 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1101 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1106 unsigned int chargeCorrelation = 1;
1107 const std::vector<esCut>&
cuts = condMu.getCuts();
1108 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1110 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1111 if (
cut.getData() ==
"ls")
1112 chargeCorrelation = 2;
1113 else if (
cut.getData() ==
"os")
1114 chargeCorrelation = 4;
1116 chargeCorrelation = 1;
1130 const std::vector<esObject>&
objects = condMu.getObjects();
1132 const esObject&
object =
objects.at(
jj);
1133 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1136 relativeBx =
object.getBxOffset();
1139 int upperUnconstrainedPtInd = -1;
1140 int lowerUnconstrainedPtInd = 0;
1141 int upperImpactParameterInd = -1;
1142 int lowerImpactParameterInd = 0;
1143 int upperThresholdInd = -1;
1144 int lowerThresholdInd = 0;
1145 int upperIndexInd = -1;
1146 int lowerIndexInd = 0;
1148 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1149 int isolationLUT = 0xF;
1150 int impactParameterLUT = 0xF;
1152 int qualityLUT = 0xFFFF;
1155 std::vector<MuonTemplate::Window> etaWindows;
1156 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1158 const std::vector<esCut>&
cuts =
object.getCuts();
1159 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1162 switch (
cut.getCutType()) {
1163 case esCutType::UnconstrainedPt:
1164 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1165 upperUnconstrainedPtInd =
cut.getMaximum().index;
1168 case esCutType::ImpactParameter:
1169 lowerImpactParameterInd =
cut.getMinimum().index;
1170 upperImpactParameterInd =
cut.getMaximum().index;
1171 impactParameterLUT = l1tstr2int(
cut.getData());
1175 lowerThresholdInd =
cut.getMinimum().index;
1176 upperThresholdInd =
cut.getMaximum().index;
1179 case esCutType::Slice:
1180 lowerIndexInd =
int(
cut.getMinimum().value);
1181 upperIndexInd =
int(
cut.getMaximum().value);
1184 case esCutType::Eta: {
1185 if (etaWindows.size() < 5) {
1186 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1189 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1196 phiWindow1Lower =
cut.getMinimum().index;
1197 phiWindow1Upper =
cut.getMaximum().index;
1198 }
else if (cntPhi == 1) {
1199 phiWindow2Lower =
cut.getMinimum().index;
1200 phiWindow2Upper =
cut.getMaximum().index;
1203 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1211 if (
cut.getData() ==
"positive")
1213 else if (
cut.getData() ==
"negative")
1220 qualityLUT = l1tstr2int(
cut.getData());
1223 case esCutType::Isolation: {
1224 isolationLUT = l1tstr2int(
cut.getData());
1228 case esCutType::Index: {
1229 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1239 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1240 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1241 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1242 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1243 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1245 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1246 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1248 objParameter[cnt].indexHigh = upperIndexInd;
1249 objParameter[cnt].indexLow = lowerIndexInd;
1251 objParameter[cnt].etaWindows = etaWindows;
1253 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1254 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1255 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1256 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1259 objParameter[cnt].enableMip =
false;
1260 objParameter[cnt].enableIso =
false;
1261 objParameter[cnt].requestIso =
false;
1263 objParameter[cnt].charge =
charge;
1264 objParameter[cnt].qualityLUT = qualityLUT;
1265 objParameter[cnt].isolationLUT = isolationLUT;
1267 objParameter[cnt].tfMuonIndexWindows = tfMuonIndexWindows;
1287 std::ostringstream myCoutStream;
1288 muonCond.
print(myCoutStream);
1289 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1293 if (!insertConditionIntoMap(muonCond, chipNr)) {
1294 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1297 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1299 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1301 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1302 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1324 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1325 <<
"\nCan not determine number of trigger objects. " << std::endl;
1329 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1331 <<
"\n condition = " << condition <<
"\n particle = " << particle
1332 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1337 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1343 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1344 tmpValues.reserve(nrObj);
1349 unsigned int chargeCorrelation = 0;
1350 if (str_chargeCorrelation ==
"ig")
1351 chargeCorrelation = 1;
1352 else if (str_chargeCorrelation ==
"ls")
1353 chargeCorrelation = 2;
1354 else if (str_chargeCorrelation ==
"os")
1355 chargeCorrelation = 4;
1365 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1368 relativeBx = corrMu->getBxOffset();
1371 int upperUnconstrainedPtInd = -1;
1372 int lowerUnconstrainedPtInd = 0;
1373 int upperImpactParameterInd = -1;
1374 int lowerImpactParameterInd = 0;
1375 int impactParameterLUT = 0xF;
1376 int upperThresholdInd = -1;
1377 int lowerThresholdInd = 0;
1378 int upperIndexInd = -1;
1379 int lowerIndexInd = 0;
1381 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1382 int isolationLUT = 0xF;
1384 int qualityLUT = 0xFFFF;
1387 std::vector<MuonTemplate::Window> etaWindows;
1388 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1390 const std::vector<esCut>&
cuts = corrMu->getCuts();
1391 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1394 switch (
cut.getCutType()) {
1395 case esCutType::UnconstrainedPt:
1396 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1397 upperUnconstrainedPtInd =
cut.getMaximum().index;
1400 case esCutType::ImpactParameter:
1401 lowerImpactParameterInd =
cut.getMinimum().index;
1402 upperImpactParameterInd =
cut.getMaximum().index;
1403 impactParameterLUT = l1tstr2int(
cut.getData());
1407 lowerThresholdInd =
cut.getMinimum().index;
1408 upperThresholdInd =
cut.getMaximum().index;
1411 case esCutType::Slice:
1412 lowerIndexInd =
int(
cut.getMinimum().value);
1413 upperIndexInd =
int(
cut.getMaximum().value);
1416 case esCutType::Eta: {
1417 if (etaWindows.size() < 5) {
1418 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1421 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1428 phiWindow1Lower =
cut.getMinimum().index;
1429 phiWindow1Upper =
cut.getMaximum().index;
1430 }
else if (cntPhi == 1) {
1431 phiWindow2Lower =
cut.getMinimum().index;
1432 phiWindow2Upper =
cut.getMaximum().index;
1435 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1443 if (
cut.getData() ==
"positive")
1445 else if (
cut.getData() ==
"negative")
1452 qualityLUT = l1tstr2int(
cut.getData());
1455 case esCutType::Isolation: {
1456 isolationLUT = l1tstr2int(
cut.getData());
1460 case esCutType::Index: {
1461 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1471 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1472 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1473 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1474 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1475 objParameter[0].impactParameterLUT = impactParameterLUT;
1477 objParameter[0].ptHighThreshold = upperThresholdInd;
1478 objParameter[0].ptLowThreshold = lowerThresholdInd;
1480 objParameter[0].indexHigh = upperIndexInd;
1481 objParameter[0].indexLow = lowerIndexInd;
1483 objParameter[0].etaWindows = etaWindows;
1485 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1486 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1487 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1488 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1491 objParameter[0].enableMip =
false;
1492 objParameter[0].enableIso =
false;
1493 objParameter[0].requestIso =
false;
1495 objParameter[0].charge =
charge;
1496 objParameter[0].qualityLUT = qualityLUT;
1497 objParameter[0].isolationLUT = isolationLUT;
1499 objParameter[0].tfMuonIndexWindows = tfMuonIndexWindows;
1515 std::ostringstream myCoutStream;
1516 muonCond.
print(myCoutStream);
1517 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1533 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1551 unsigned int chipNr,
1552 const bool corrFlag) {
1567 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1569 if (
int(condMu.getObjects().size()) != nrObj) {
1570 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1571 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1576 esObject
object = condMu.getObjects().at(0);
1577 int relativeBx =
object.getBxOffset();
1579 if (condMu.getType() == esConditionType::MuonShower0) {
1580 objParameter[0].MuonShower0 =
true;
1581 }
else if (condMu.getType() == esConditionType::MuonShower1) {
1582 objParameter[0].MuonShower1 =
true;
1583 }
else if (condMu.getType() == esConditionType::MuonShower2) {
1584 objParameter[0].MuonShower2 =
true;
1585 }
else if (condMu.getType() == esConditionType::MuonShowerOutOfTime0) {
1586 objParameter[0].MuonShowerOutOfTime0 =
true;
1587 }
else if (condMu.getType() == esConditionType::MuonShowerOutOfTime1) {
1588 objParameter[0].MuonShowerOutOfTime1 =
true;
1604 std::ostringstream myCoutStream;
1605 muonShowerCond.
print(myCoutStream);
1609 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1610 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1613 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1641 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1642 <<
"\n (in parseCalo) " 1643 <<
"\n condition = " << condition <<
"\n particle = " << particle
1644 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1653 if (condCalo.getType() == esConditionType::SingleEgamma) {
1658 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1663 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1668 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1673 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1674 caloObjType =
gtJet;
1678 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1679 caloObjType =
gtJet;
1683 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1684 caloObjType =
gtJet;
1688 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1689 caloObjType =
gtJet;
1693 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1694 caloObjType =
gtTau;
1698 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1699 caloObjType =
gtTau;
1703 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1704 caloObjType =
gtTau;
1708 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1709 caloObjType =
gtTau;
1714 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1721 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1722 <<
"\nCan not determine number of trigger objects. " << std::endl;
1729 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1735 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1736 tmpValues.reserve(nrObj);
1738 if (
int(condCalo.getObjects().size()) != nrObj) {
1739 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1740 <<
"condCalo.getObjects().size() = " << condCalo.getObjects().size()
1755 const std::vector<esObject>&
objects = condCalo.getObjects();
1757 const esObject&
object =
objects.at(
jj);
1758 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1761 relativeBx =
object.getBxOffset();
1764 int upperThresholdInd = -1;
1765 int lowerThresholdInd = 0;
1766 int upperIndexInd = -1;
1767 int lowerIndexInd = 0;
1769 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1770 int isolationLUT = 0xF;
1771 int qualityLUT = 0xF;
1772 int displacedLUT = 0x0;
1777 std::vector<CaloTemplate::Window> etaWindows;
1779 const std::vector<esCut>&
cuts =
object.getCuts();
1780 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1783 switch (
cut.getCutType()) {
1785 lowerThresholdInd =
cut.getMinimum().index;
1786 upperThresholdInd =
cut.getMaximum().index;
1788 case esCutType::Slice:
1789 lowerIndexInd =
int(
cut.getMinimum().value);
1790 upperIndexInd =
int(
cut.getMaximum().value);
1792 case esCutType::Eta: {
1793 if (etaWindows.size() < 5) {
1794 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1797 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1803 phiWindow1Lower =
cut.getMinimum().index;
1804 phiWindow1Upper =
cut.getMaximum().index;
1805 }
else if (cntPhi == 1) {
1806 phiWindow2Lower =
cut.getMinimum().index;
1807 phiWindow2Upper =
cut.getMaximum().index;
1810 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1818 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1823 qualityLUT = l1tstr2int(
cut.getData());
1826 case esCutType::Displaced: {
1827 displacedLUT = l1tstr2int(
cut.getData());
1830 case esCutType::Isolation: {
1831 isolationLUT = l1tstr2int(
cut.getData());
1841 objParameter[cnt].etHighThreshold = upperThresholdInd;
1842 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1843 objParameter[cnt].indexHigh = upperIndexInd;
1844 objParameter[cnt].indexLow = lowerIndexInd;
1845 objParameter[cnt].etaWindows = etaWindows;
1846 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1847 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1848 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1849 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1850 objParameter[cnt].isolationLUT = isolationLUT;
1851 objParameter[cnt].qualityLUT = qualityLUT;
1852 objParameter[cnt].displacedLUT = displacedLUT;
1856 std::ostringstream oss;
1857 oss <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " << std::hex
1858 << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold;
1859 for (
const auto&
window : objParameter[cnt].etaWindows) {
1860 oss <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" <<
window.lower <<
" / 0x" <<
window.upper;
1862 oss <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" << objParameter[cnt].phiWindow1Lower
1863 <<
" / 0x" << objParameter[cnt].phiWindow1Upper <<
"\n phiWindowVeto Lower / Upper for calo object " 1864 << cnt <<
" = 0x" << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1865 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].isolationLUT
1866 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].qualityLUT
1867 <<
"\n LLP DISP LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].displacedLUT;
1868 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
1875 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1893 std::ostringstream myCoutStream;
1894 caloCond.
print(myCoutStream);
1895 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1899 if (!insertConditionIntoMap(caloCond, chipNr)) {
1900 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1905 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1907 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1937 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1938 <<
"\n (in parseCalo) " 1939 <<
"\n condition = " << condition <<
"\n particle = " << particle
1940 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1949 if (corrCalo->getType() == esObjectType::Egamma) {
1952 caloObjType =
gtJet;
1954 caloObjType =
gtTau;
1956 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1963 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1964 <<
"\nCan not determine number of trigger objects. " << std::endl;
1971 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1977 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1978 tmpValues.reserve(nrObj);
1984 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1987 relativeBx = corrCalo->getBxOffset();
1990 int upperThresholdInd = -1;
1991 int lowerThresholdInd = 0;
1992 int upperIndexInd = -1;
1993 int lowerIndexInd = 0;
1995 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1996 int isolationLUT = 0xF;
1997 int qualityLUT = 0xF;
1998 int displacedLUT = 0x0;
2003 std::vector<CaloTemplate::Window> etaWindows;
2005 const std::vector<esCut>&
cuts = corrCalo->getCuts();
2006 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2009 switch (
cut.getCutType()) {
2011 lowerThresholdInd =
cut.getMinimum().index;
2012 upperThresholdInd =
cut.getMaximum().index;
2014 case esCutType::Slice:
2015 lowerIndexInd =
int(
cut.getMinimum().value);
2016 upperIndexInd =
int(
cut.getMaximum().value);
2018 case esCutType::Eta: {
2019 if (etaWindows.size() < 5) {
2020 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
2023 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2029 phiWindow1Lower =
cut.getMinimum().index;
2030 phiWindow1Upper =
cut.getMaximum().index;
2031 }
else if (cntPhi == 1) {
2032 phiWindow2Lower =
cut.getMinimum().index;
2033 phiWindow2Upper =
cut.getMaximum().index;
2036 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2044 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2049 qualityLUT = l1tstr2int(
cut.getData());
2052 case esCutType::Displaced: {
2053 displacedLUT = l1tstr2int(
cut.getData());
2056 case esCutType::Isolation: {
2057 isolationLUT = l1tstr2int(
cut.getData());
2067 objParameter[0].etLowThreshold = lowerThresholdInd;
2068 objParameter[0].etHighThreshold = upperThresholdInd;
2069 objParameter[0].indexHigh = upperIndexInd;
2070 objParameter[0].indexLow = lowerIndexInd;
2071 objParameter[0].etaWindows = etaWindows;
2072 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2073 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2074 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2075 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2076 objParameter[0].isolationLUT = isolationLUT;
2077 objParameter[0].qualityLUT = qualityLUT;
2078 objParameter[0].displacedLUT = displacedLUT;
2082 std::ostringstream oss;
2083 oss <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2084 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold;
2085 for (
const auto&
window : objParameter[0].etaWindows) {
2086 oss <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x" <<
window.lower <<
" / 0x" <<
window.upper;
2088 oss <<
"\n phiWindow Lower / Upper for calo object " 2089 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2090 <<
"\n phiWindowVeto Lower / Upper for calo object " 2091 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2092 <<
"\n Isolation LUT for calo object " 2093 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2094 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2095 <<
" = 0x" << objParameter[0].displacedLUT;
2096 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
2100 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2118 std::ostringstream myCoutStream;
2119 caloCond.
print(myCoutStream);
2120 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2137 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2155 unsigned int chipNr,
2156 const bool corrFlag) {
2166 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2167 <<
"\n (in parseEnergySum) " 2168 <<
"\n condition = " << condition <<
"\n type = " <<
type 2169 <<
"\n name = " <<
name << std::endl;
2175 if (condEnergySum.getType() == esConditionType::MissingEt) {
2178 }
else if (condEnergySum.getType() == esConditionType::TotalEt) {
2181 }
else if (condEnergySum.getType() == esConditionType::TotalEtEM) {
2184 }
else if (condEnergySum.getType() == esConditionType::TotalHt) {
2187 }
else if (condEnergySum.getType() == esConditionType::MissingHt) {
2190 }
else if (condEnergySum.getType() == esConditionType::MissingEtHF) {
2193 }
else if (condEnergySum.getType() == esConditionType::TowerCount) {
2196 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP0) {
2199 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM0) {
2202 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP1) {
2205 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM1) {
2208 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEt) {
2211 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHt) {
2214 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEtHF) {
2217 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHtHF) {
2220 }
else if (condEnergySum.getType() == esConditionType::Centrality0) {
2223 }
else if (condEnergySum.getType() == esConditionType::Centrality1) {
2226 }
else if (condEnergySum.getType() == esConditionType::Centrality2) {
2229 }
else if (condEnergySum.getType() == esConditionType::Centrality3) {
2232 }
else if (condEnergySum.getType() == esConditionType::Centrality4) {
2235 }
else if (condEnergySum.getType() == esConditionType::Centrality5) {
2238 }
else if (condEnergySum.getType() == esConditionType::Centrality6) {
2241 }
else if (condEnergySum.getType() == esConditionType::Centrality7) {
2245 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2257 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2268 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2270 const esObject&
object =
objects.at(
jj);
2271 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2274 relativeBx =
object.getBxOffset();
2277 int lowerThresholdInd = 0;
2278 int upperThresholdInd = -1;
2280 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2282 const std::vector<esCut>&
cuts =
object.getCuts();
2283 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2286 switch (
cut.getCutType()) {
2288 lowerThresholdInd =
cut.getMinimum().index;
2289 upperThresholdInd =
cut.getMaximum().index;
2292 case esCutType::Eta:
2297 phiWindow1Lower =
cut.getMinimum().index;
2298 phiWindow1Upper =
cut.getMaximum().index;
2299 }
else if (cntPhi == 1) {
2300 phiWindow2Lower =
cut.getMinimum().index;
2301 phiWindow2Upper =
cut.getMaximum().index;
2303 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2310 case esCutType::Count:
2311 lowerThresholdInd =
cut.getMinimum().index;
2312 upperThresholdInd = 0xffffff;
2322 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2323 objParameter[cnt].etHighThreshold = upperThresholdInd;
2324 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2325 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2326 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2327 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2330 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2331 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2332 << objParameter[cnt].etHighThreshold
2333 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2334 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2335 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2336 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2343 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2358 std::ostringstream myCoutStream;
2359 energySumCond.
print(myCoutStream);
2360 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2364 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2365 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2370 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2373 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2402 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2403 <<
"\n (in parseEnergySum) " 2404 <<
"\n condition = " << condition <<
"\n type = " <<
type 2405 <<
"\n name = " <<
name << std::endl;
2417 }
else if (corrESum->getType() == esObjectType::ETMHF) {
2420 }
else if (corrESum->getType() == esObjectType::TOWERCOUNT) {
2424 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2437 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2447 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2450 relativeBx = corrESum->getBxOffset();
2453 int lowerThresholdInd = 0;
2454 int upperThresholdInd = -1;
2456 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2458 const std::vector<esCut>&
cuts = corrESum->getCuts();
2459 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2462 switch (
cut.getCutType()) {
2464 lowerThresholdInd =
cut.getMinimum().index;
2465 upperThresholdInd =
cut.getMaximum().index;
2468 case esCutType::Eta:
2473 phiWindow1Lower =
cut.getMinimum().index;
2474 phiWindow1Upper =
cut.getMaximum().index;
2475 }
else if (cntPhi == 1) {
2476 phiWindow2Lower =
cut.getMinimum().index;
2477 phiWindow2Upper =
cut.getMaximum().index;
2479 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2493 objParameter[0].etLowThreshold = lowerThresholdInd;
2494 objParameter[0].etHighThreshold = upperThresholdInd;
2495 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2496 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2497 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2498 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2501 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2502 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2503 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2504 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2505 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2506 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2510 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2525 std::ostringstream myCoutStream;
2526 energySumCond.
print(myCoutStream);
2527 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2545 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2572 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2573 <<
"\n (in parseExternal) " 2574 <<
"\n condition = " << condition <<
"\n particle = " << particle
2575 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2584 unsigned int channelID = 0;
2587 const std::vector<esObject>&
objects = condExt.getObjects();
2589 const esObject&
object =
objects.at(
jj);
2590 if (
object.getType() == esObjectType::EXT) {
2591 relativeBx =
object.getBxOffset();
2592 channelID =
object.getExternalChannelId();
2600 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2612 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2615 if (!insertConditionIntoMap(externalCond, chipNr)) {
2616 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2620 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2646 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2647 <<
" (in parseCorrelation) " << std::endl
2648 <<
" condition = " << condition << std::endl
2649 <<
" particle = " << particle << std::endl
2650 <<
" type = " <<
type << std::endl
2651 <<
" name = " <<
name << std::endl;
2657 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2658 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2669 const int nrObj = 2;
2672 int intGEq[nrObj] = {-1, -1};
2673 std::vector<GlobalObject>
objType(nrObj);
2674 std::vector<GtConditionCategory> condCateg(nrObj);
2677 const bool corrFlag =
true;
2678 int corrIndexVal[nrObj] = {-1, -1};
2686 const std::vector<esCut>&
cuts = corrCond.getCuts();
2687 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2690 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2691 if (
cut.getData() ==
"ls")
2693 else if (
cut.getData() ==
"os")
2701 double minV =
cut.getMinimum().value;
2702 double maxV =
cut.getMaximum().value;
2709 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2710 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2711 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2715 cutType = cutType | 0x1;
2717 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2718 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2719 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2723 cutType = cutType | 0x2;
2725 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2726 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2727 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2731 cutType = cutType | 0x4;
2732 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2736 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2737 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2738 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2739 cutType = cutType | 0x20;
2741 (
cut.getCutType() == esCutType::MassDeltaR)) {
2742 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2743 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2744 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2749 if (corrCond.getType() == esConditionType::TransverseMass) {
2750 cutType = cutType | 0x10;
2751 }
else if (corrCond.getType() == esConditionType::InvariantMassDeltaR) {
2752 cutType = cutType | 0x80;
2754 cutType = cutType | 0x8;
2756 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2757 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2758 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2759 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2763 cutType = cutType | 0x40;
2770 const std::vector<esObject>&
objects = corrCond.getObjects();
2772 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 2773 <<
" corrFlag " << corrFlag << std::endl;
2779 const esObject&
object =
objects.at(
jj);
2780 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2781 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2782 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2783 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2820 parseMuonCorr(&
object, chipNr);
2821 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2824 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2828 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
2831 parseCaloCorr(&
object, chipNr);
2832 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2835 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2836 switch (
object.getType()) {
2837 case esObjectType::Egamma: {
2851 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2852 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2854 parseEnergySumCorr(&
object, chipNr);
2855 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2858 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2859 switch (
object.getType()) {
2866 case esObjectType::ETMHF: {
2869 case esObjectType::TOWERCOUNT: {
2878 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
2879 <<
" for the correlation condition " <<
name << std::endl;
2888 if (intGEq[0] != intGEq[1]) {
2889 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 2890 <<
" for the correlation condition " <<
name << std::endl;
2894 gEq = (intGEq[0] != 0);
2912 std::ostringstream myCoutStream;
2913 correlationCond.
print(myCoutStream);
2914 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2920 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
2947 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2948 <<
" (in parseCorrelationThreeBody) " << std::endl
2949 <<
" condition = " << condition << std::endl
2950 <<
" particle = " << particle << std::endl
2951 <<
" type = " <<
type << std::endl
2952 <<
" name = " <<
name << std::endl;
2958 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2959 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2967 const int nrObj = 3;
2970 std::vector<GlobalObject>
objType(nrObj);
2971 std::vector<GtConditionCategory> condCateg(nrObj);
2974 const bool corrFlag =
true;
2975 int corrIndexVal[nrObj] = {-1, -1, -1};
2985 const std::vector<esCut>&
cuts = corrCond.getCuts();
2986 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
2987 const esCut&
cut =
cuts.at(lll);
2989 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2990 if (
cut.getData() ==
"ls")
2992 else if (
cut.getData() ==
"os")
3001 double minV =
cut.getMinimum().value;
3002 double maxV =
cut.getMaximum().value;
3008 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3009 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3010 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3014 cutType = cutType | 0x8;
3015 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3019 cutType = cutType | 0x80;
3025 const std::vector<esObject>&
objects = corrCond.getObjects();
3027 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3028 <<
" corrFlag " << corrFlag << std::endl;
3033 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3034 const esObject&
object =
objects.at(lll);
3035 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3036 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3037 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3042 parseMuonCorr(&
object, chipNr);
3043 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
3050 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3051 <<
" for the correlation condition " <<
name 3052 <<
": no three muons in the event!" << std::endl;
3072 std::ostringstream myCoutStream;
3073 correlationThreeBodyCond.
print(myCoutStream);
3074 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3080 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3100 unsigned int chipNr) {
3108 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3109 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3110 <<
" condition = " << condition << std::endl
3111 <<
" particle = " << particle << std::endl
3112 <<
" type = " <<
type << std::endl
3113 <<
" name = " <<
name << std::endl;
3119 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3120 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3131 const int nrObj = 3;
3134 int intGEq[nrObj] = {-1, -1, -1};
3135 std::vector<GlobalObject>
objType(nrObj);
3136 std::vector<GtConditionCategory> condCateg(nrObj);
3139 const bool corrFlag =
true;
3140 int corrIndexVal[nrObj] = {-1, -1, -1};
3148 const std::vector<esCut>&
cuts = corrCond.getCuts();
3149 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3152 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3153 if (
cut.getData() ==
"ls")
3155 else if (
cut.getData() ==
"os")
3163 double minV =
cut.getMinimum().value;
3164 double maxV =
cut.getMaximum().value;
3175 cutType = cutType | 0x1;
3181 cutType = cutType | 0x2;
3187 cutType = cutType | 0x4;
3193 cutType = cutType | 0x8;
3194 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3198 cutType = cutType | 0x80;
3200 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3205 cutType = cutType | 0x10;
3206 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3211 cutType = cutType | 0x20;
3212 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3217 cutType = cutType | 0x40;
3224 const std::vector<esObject>&
objects = corrCond.getObjects();
3227 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3228 << corrFlag << std::endl;
3234 const esObject&
object =
objects.at(
jj);
3235 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3236 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3237 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3238 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3239 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3276 parseMuonCorr(&
object, chipNr);
3277 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3280 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3284 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3287 parseCaloCorr(&
object, chipNr);
3288 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3291 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3292 switch (
object.getType()) {
3293 case esObjectType::Egamma: {
3307 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3308 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3310 parseEnergySumCorr(&
object, chipNr);
3311 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3314 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3315 switch (
object.getType()) {
3322 case esObjectType::ETMHF: {
3325 case esObjectType::TOWERCOUNT: {
3334 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3335 <<
" for the correlation condition " <<
name << std::endl;
3344 if (intGEq[0] != intGEq[1]) {
3345 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3346 <<
" for the correlation condition " <<
name << std::endl;
3350 gEq = (intGEq[0] != 0);
3370 std::ostringstream myCoutStream;
3371 correlationWORCond.
print(myCoutStream);
3372 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3378 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3403 if (algAlias.empty()) {
3405 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3406 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3410 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3411 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3418 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3419 <<
" Chip number: " << chipNr << std::endl;
3425 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3440 std::ostringstream myCoutStream;
3441 alg.
print(myCoutStream);
3442 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3446 if (!insertAlgorithmIntoMap(alg)) {
unsigned int chargeCorrelation
unsigned int precOverlapRemovalPhiCut
constexpr int32_t ceil(float num)
long long maxOverlapRemovalEtaCutValue
void setCondGEq(const bool &cGEq)
long long maxMassCutValue
void setAlgoAlias(const std::string &algoAliasValue)
void setCond0Index(const int &)
typedef for correlation three-body parameters
int algoBitNumber() const
get / set algorithm bit number
void setCorrelationThreeBodyParameter(const CorrelationThreeBodyParameter &corrThreeBodyParameter)
void setCond0Index(const int &)
void print(std::ostream &myCout) const override
print the condition
unsigned int chargeCorrelation
const int algoOutputPin(const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
get the output pin on the condition chip for the algorithm
void setCond1Index(const int &)
void setCondType(const l1t::GtConditionType &cType)
void setConditionParameter(const std::vector< ObjectParameter > &objParameter)
set functions
void setCorrelationParameter(const CorrelationParameter &corrParameter)
long long minMassCutValue
void print(std::ostream &myCout) const override
print the condition
Log< level::Error, false > LogError
void setCondRelativeBx(const int &cRelativeBx)
std::vector< std::pair< double, double > > phiBins
void setCond0Category(const l1t::GtConditionCategory &)
void print(std::ostream &myCout) const override
print the condition
void setCondChipNr(const int &cChipNr)
const int algoChipNumber() const
get / set algorithm bit number
long long minMassCutValue
void print(std::ostream &myCout) const override
print the condition
long long maxMassCutValue
void setCorrelationWithOverlapRemovalParameter(const CorrelationWithOverlapRemovalParameter &corrParameter)
void setCond0Category(const l1t::GtConditionCategory &)
Container::value_type value_type
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void setExternalChannel(unsigned int extCh)
set functions
long long minOverlapRemovalEtaCutValue
void setCond0Index(const int &)
virtual void print(std::ostream &myCout) const
print condition
long long minMassCutValue
long long minTBPTCutValue
void setCond1Category(const l1t::GtConditionCategory &)
unsigned int precOverlapRemovalEtaCut
long long minOverlapRemovalPhiCutValue
void setCond1Index(const int &)
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
unsigned int chargeCorrelation
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
void setObjectType(const std::vector< l1t::GlobalObject > &objType)
void setCond1Category(const l1t::GtConditionCategory &)
void setCond2Category(const l1t::GtConditionCategory &)
void setCond2Index(const int &)
long long maxOverlapRemovalDRCutValue
void setCond0Category(const l1t::GtConditionCategory &)
void print(std::ostream &myCout) const override
print the condition
void print(std::ostream &myCout) const override
print the condition
unsigned int precOverlapRemovalDRCut
std::vector< std::pair< double, double > > etBins
void setAlgoChipNumber(const int algoChipNumberValue)
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
typedef for a single object template
long long maxOverlapRemovalPhiCutValue
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
typedef for correlation parameters
long long maxTBPTCutValue
char data[epos_bytes_allocation]
long long minOverlapRemovalDRCutValue
std::string const & algoAlias() const
get / set algorithm alias
std::vector< std::pair< double, double > > uptBins
typedef for correlation parameters
void print(std::ostream &myCout) const override
print the condition
void setCond1Category(const l1t::GtConditionCategory &)
typedef for correlation parameters
unsigned int chargeCorrelation
void setCond2Category(const l1t::GtConditionCategory &)
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
Power< A, B >::type pow(const A &a, const B &b)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
const std::string algoName() const
get / set algorithm name
void setCond2Index(const int &)
long long maxMassCutValue
std::vector< std::pair< double, double > > etaBins
void setCond1Index(const int &)