46 #include "tmEventSetup/tmEventSetup.hh" 47 #include "tmEventSetup/esTypes.hh" 55 #include "tmGrammar/Algorithm.hh" 61 : m_triggerMenuInterface(
"NULL"),
62 m_triggerMenuName(
"NULL"),
63 m_triggerMenuImplementation(0x0),
77 m_numberConditionChips = numberConditionChipsValue;
82 m_pinsOnConditionChip = pinsOnConditionChipValue;
88 m_orderConditionChip = orderConditionChipValue;
93 m_numberPhysTriggers = numberPhysTriggersValue;
101 m_triggerMenuInterface = menuInterface;
110 m_triggerMenuImplementation = menuImplementation;
118 m_vecMuonTemplate = vecMuonTempl;
122 const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTempl) {
123 m_vecMuonShowerTemplate = vecMuonShowerTempl;
127 m_vecCaloTemplate = vecCaloTempl;
131 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
132 m_vecEnergySumTemplate = vecEnergySumTempl;
136 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
137 m_vecExternalTemplate = vecExternalTempl;
141 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
142 m_vecCorrelationTemplate = vecCorrelationTempl;
146 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
147 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
151 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
152 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
158 m_corMuonTemplate = corMuonTempl;
162 m_corCaloTemplate = corCaloTempl;
166 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
167 m_corEnergySumTemplate = corEnergySumTempl;
178 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
180 std::map<std::string, unsigned int> extBitMap;
183 for (
const auto& cit : condMap) {
185 if (condition.
getType() == esConditionType::Externals) {
188 for (
const auto&
object :
objects) {
189 if (
object.getType() == esObjectType::EXT) {
190 unsigned int channelID =
object.getExternalChannelId();
193 if (extBitMap.count(
name) == 0)
207 m_conditionMap.resize(m_numberConditionChips);
209 m_vecMuonTemplate.resize(m_numberConditionChips);
210 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
211 m_vecCaloTemplate.resize(m_numberConditionChips);
212 m_vecEnergySumTemplate.resize(m_numberConditionChips);
213 m_vecExternalTemplate.resize(m_numberConditionChips);
215 m_vecCorrelationTemplate.resize(m_numberConditionChips);
216 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
217 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
218 m_corMuonTemplate.resize(m_numberConditionChips);
219 m_corCaloTemplate.resize(m_numberConditionChips);
220 m_corEnergySumTemplate.resize(m_numberConditionChips);
226 m_triggerMenuDescription = utmMenu->
getComment();
228 m_triggerMenuImplementation = (getMmHashN(utmMenu->
getFirmwareUuid()) & 0xFFFFFFFF);
229 m_triggerMenuName = utmMenu->
getName();
230 m_triggerMenuInterface = utmMenu->
getVersion();
231 m_triggerMenuUUID = (getMmHashN(utmMenu->
getName()) & 0xFFFFFFFF);
233 const std::map<std::string, L1TUtmAlgorithm>& algoMap = utmMenu->
getAlgorithmMap();
234 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
236 const std::map<std::string, tmeventsetup::esScale> scaleMap(std::begin(utmMenu->
getScaleMap()),
241 parseScales(scaleMap);
244 for (
const auto& cit : algoMap) {
252 parseAlgorithm(
algo, chipNr);
255 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
256 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
264 if ((m_conditionMap[chipNr]).
count(condition.
getName()) == 0) {
266 if (condition.
getType() == esConditionType::SingleEgamma ||
267 condition.
getType() == esConditionType::DoubleEgamma ||
268 condition.
getType() == esConditionType::TripleEgamma ||
269 condition.
getType() == esConditionType::QuadEgamma || condition.
getType() == esConditionType::SingleTau ||
270 condition.
getType() == esConditionType::DoubleTau || condition.
getType() == esConditionType::TripleTau ||
271 condition.
getType() == esConditionType::QuadTau || condition.
getType() == esConditionType::SingleJet ||
272 condition.
getType() == esConditionType::DoubleJet || condition.
getType() == esConditionType::TripleJet ||
273 condition.
getType() == esConditionType::QuadJet) {
274 parseCalo(condition, chipNr,
false);
277 }
else if (condition.
getType() == esConditionType::TotalEt ||
278 condition.
getType() == esConditionType::TotalEtEM ||
279 condition.
getType() == esConditionType::TotalHt ||
280 condition.
getType() == esConditionType::MissingEt ||
281 condition.
getType() == esConditionType::MissingHt ||
282 condition.
getType() == esConditionType::MissingEtHF ||
283 condition.
getType() == esConditionType::TowerCount ||
284 condition.
getType() == esConditionType::MinBiasHFP0 ||
285 condition.
getType() == esConditionType::MinBiasHFM0 ||
286 condition.
getType() == esConditionType::MinBiasHFP1 ||
287 condition.
getType() == esConditionType::MinBiasHFM1 ||
288 condition.
getType() == esConditionType::AsymmetryEt ||
289 condition.
getType() == esConditionType::AsymmetryHt ||
290 condition.
getType() == esConditionType::AsymmetryEtHF ||
291 condition.
getType() == esConditionType::AsymmetryHtHF ||
292 condition.
getType() == esConditionType::Centrality0 ||
293 condition.
getType() == esConditionType::Centrality1 ||
294 condition.
getType() == esConditionType::Centrality2 ||
295 condition.
getType() == esConditionType::Centrality3 ||
296 condition.
getType() == esConditionType::Centrality4 ||
297 condition.
getType() == esConditionType::Centrality5 ||
298 condition.
getType() == esConditionType::Centrality6 ||
299 condition.
getType() == esConditionType::Centrality7) {
300 parseEnergySum(condition, chipNr,
false);
304 condition.
getType() == esConditionType::DoubleMuon ||
305 condition.
getType() == esConditionType::TripleMuon ||
306 condition.
getType() == esConditionType::QuadMuon) {
307 parseMuon(condition, chipNr,
false);
309 }
else if (condition.
getType() == esConditionType::MuonShower0 ||
310 condition.
getType() == esConditionType::MuonShower1 ||
311 condition.
getType() == esConditionType::MuonShower2 ||
312 condition.
getType() == esConditionType::MuonShowerOutOfTime0 ||
313 condition.
getType() == esConditionType::MuonShowerOutOfTime1) {
314 parseMuonShower(condition, chipNr,
false);
317 }
else if (condition.
getType() == esConditionType::MuonMuonCorrelation ||
318 condition.
getType() == esConditionType::MuonEsumCorrelation ||
319 condition.
getType() == esConditionType::CaloMuonCorrelation ||
320 condition.
getType() == esConditionType::CaloCaloCorrelation ||
321 condition.
getType() == esConditionType::CaloEsumCorrelation ||
322 condition.
getType() == esConditionType::InvariantMass ||
323 condition.
getType() == esConditionType::InvariantMassDeltaR ||
324 condition.
getType() == esConditionType::TransverseMass ||
325 condition.
getType() == esConditionType::InvariantMassUpt) {
326 parseCorrelation(condition, chipNr);
329 }
else if (condition.
getType() == esConditionType::InvariantMass3) {
330 parseCorrelationThreeBody(condition, chipNr);
333 }
else if (condition.
getType() == esConditionType::Externals) {
334 parseExternal(condition, chipNr);
337 }
else if (condition.
getType() == esConditionType::CaloCaloCorrelationOvRm ||
338 condition.
getType() == esConditionType::InvariantMassOvRm ||
339 condition.
getType() == esConditionType::TransverseMassOvRm ||
340 condition.
getType() == esConditionType::DoubleJetOvRm ||
341 condition.
getType() == esConditionType::DoubleTauOvRm) {
342 parseCorrelationWithOverlapRemoval(condition, chipNr);
344 }
else if (condition.
getType() == esConditionType::SingleEgammaOvRm ||
345 condition.
getType() == esConditionType::DoubleEgammaOvRm ||
346 condition.
getType() == esConditionType::TripleEgammaOvRm ||
347 condition.
getType() == esConditionType::QuadEgammaOvRm ||
348 condition.
getType() == esConditionType::SingleTauOvRm ||
349 condition.
getType() == esConditionType::TripleTauOvRm ||
350 condition.
getType() == esConditionType::QuadTauOvRm ||
351 condition.
getType() == esConditionType::SingleJetOvRm ||
352 condition.
getType() == esConditionType::TripleJetOvRm ||
353 condition.
getType() == esConditionType::QuadJetOvRm) {
355 <<
"\n SingleEgammaOvRm" 356 <<
"\n DoubleEgammaOvRm" 357 <<
"\n TripleEgammaOvRm" 358 <<
"\n QuadEgammaOvRm" 359 <<
"\n SingleTauOvRm" 360 <<
"\n TripleTauOvRm" 362 <<
"\n SingleJetOvRm" 363 <<
"\n TripleJetOvRm" 365 <<
"\n The above conditions types OvRm are not implemented yet in the " 366 "parser. Please remove alogrithms that " 367 "use this type of condtion from L1T Menu!" 383 m_triggerMenuInterfaceAuthor =
val;
387 m_triggerMenuInterfaceDescription =
val;
405 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
409 itCondOnChip->clear();
413 m_algorithmMap.clear();
420 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 424 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
425 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
429 (m_conditionMap[chipNr])[cName] = &
cond;
430 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
443 if (m_algorithmMap.count(algName) != 0) {
444 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
445 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
449 if (m_algorithmAliasMap.count(algAlias) != 0) {
450 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
451 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
458 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 459 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
464 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
465 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
466 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
472 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
474 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
475 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 476 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
482 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
484 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
485 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 486 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
491 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
492 int iPin = (itAlgo->second)
493 .algoOutputPin(static_cast<int>(m_numberConditionChips),
494 static_cast<int>(m_pinsOnConditionChip),
495 m_orderConditionChip);
497 int iChip = (itAlgo->second)
498 .algoChipNumber(static_cast<int>(m_numberConditionChips),
499 static_cast<int>(m_pinsOnConditionChip),
500 m_orderConditionChip);
502 if ((outputPin == iPin) && (chipNr == iChip)) {
503 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
504 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 511 m_algorithmMap[algName] = alg;
512 m_algorithmAliasMap[algAlias] = alg;
521 template <
typename T>
523 std::stringstream
ss;
528 std::stringstream
ss;
558 for (std::map<std::string, tmeventsetup::esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end();
560 const tmeventsetup::esScale&
scale = cit->second;
564 scaleParam = &muScales;
565 else if (
scale.getObjectType() == esObjectType::Egamma)
566 scaleParam = &egScales;
568 scaleParam = &tauScales;
570 scaleParam = &jetScales;
572 scaleParam = &ettScales;
573 else if (
scale.getObjectType() == esObjectType::ETTEM)
574 scaleParam = &ettEmScales;
576 scaleParam = &etmScales;
577 else if (
scale.getObjectType() == esObjectType::ETMHF)
578 scaleParam = &etmHfScales;
580 scaleParam = &httScales;
582 scaleParam = &htmScales;
584 scaleParam =
nullptr;
586 if (scaleParam !=
nullptr) {
587 switch (
scale.getScaleType()) {
588 case esScaleType::EtScale: {
594 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
595 for (
unsigned int i = 0;
i < binsV.size();
i++) {
596 const tmeventsetup::esBin&
bin = binsV.at(
i);
597 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
598 scaleParam->
etBins.push_back(binLimits);
605 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
610 scale.getObjectType() == esObjectType::ETTEM) {
618 case esScaleType::UnconstrainedPtScale: {
624 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
625 for (
unsigned int i = 0;
i < binsV.size();
i++) {
626 const tmeventsetup::esBin&
bin = binsV.at(
i);
627 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
628 scaleParam->
uptBins.push_back(binLimits);
631 case esScaleType::EtaScale: {
637 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
639 for (
unsigned int i = 0;
i < binsV.size();
i++) {
640 const tmeventsetup::esBin&
bin = binsV.at(
i);
641 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
642 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
645 case esScaleType::PhiScale: {
651 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
653 for (
unsigned int i = 0;
i < binsV.size();
i++) {
654 const tmeventsetup::esBin&
bin = binsV.at(
i);
655 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
656 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
667 m_gtScales.setMuonScales(muScales);
668 m_gtScales.setEGScales(egScales);
669 m_gtScales.setTauScales(tauScales);
670 m_gtScales.setJetScales(jetScales);
671 m_gtScales.setETTScales(ettScales);
672 m_gtScales.setETTEmScales(ettEmScales);
673 m_gtScales.setETMScales(etmScales);
674 m_gtScales.setETMHfScales(etmHfScales);
675 m_gtScales.setHTTScales(httScales);
676 m_gtScales.setHTMScales(htmScales);
679 bool hasPrecision =
false;
680 std::map<std::string, unsigned int> precisions;
681 getPrecisions(precisions, scaleMap);
682 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
689 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
690 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
691 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
695 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
696 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
697 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
698 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
699 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
700 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
704 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
705 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
706 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
707 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
708 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
709 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
710 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
711 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
715 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
716 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
717 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
718 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
719 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
720 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
721 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
725 parseDeltaEta_Cosh_LUTS(
726 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
727 parseDeltaEta_Cosh_LUTS(
728 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
729 parseDeltaEta_Cosh_LUTS(
730 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
731 parseDeltaEta_Cosh_LUTS(
732 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
734 parseDeltaEta_Cosh_LUTS(
735 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
736 parseDeltaEta_Cosh_LUTS(
737 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
738 parseDeltaEta_Cosh_LUTS(
739 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
741 parseDeltaEta_Cosh_LUTS(
742 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
743 parseDeltaEta_Cosh_LUTS(
744 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
746 parseDeltaEta_Cosh_LUTS(
747 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
751 parseDeltaPhi_Cos_LUTS(
752 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
753 parseDeltaPhi_Cos_LUTS(
754 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
755 parseDeltaPhi_Cos_LUTS(
756 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
757 parseDeltaPhi_Cos_LUTS(
758 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
759 parseDeltaPhi_Cos_LUTS(
760 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
761 parseDeltaPhi_Cos_LUTS(
762 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
763 parseDeltaPhi_Cos_LUTS(
764 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
766 parseDeltaPhi_Cos_LUTS(
767 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
768 parseDeltaPhi_Cos_LUTS(
769 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
770 parseDeltaPhi_Cos_LUTS(
771 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
772 parseDeltaPhi_Cos_LUTS(
773 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
774 parseDeltaPhi_Cos_LUTS(
775 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
776 parseDeltaPhi_Cos_LUTS(
777 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
779 parseDeltaPhi_Cos_LUTS(
780 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
781 parseDeltaPhi_Cos_LUTS(
782 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
783 parseDeltaPhi_Cos_LUTS(
784 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
785 parseDeltaPhi_Cos_LUTS(
786 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
787 parseDeltaPhi_Cos_LUTS(
788 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
790 parseDeltaPhi_Cos_LUTS(
791 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
792 parseDeltaPhi_Cos_LUTS(
793 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
794 parseDeltaPhi_Cos_LUTS(
795 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
796 parseDeltaPhi_Cos_LUTS(
797 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
799 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
800 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
801 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
802 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
804 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
805 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
806 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
807 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
829 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
832 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
833 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
835 std::vector<long long> lut_cal_2_mu_eta;
836 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
841 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
856 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
859 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
860 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
862 std::vector<long long> lut_cal_2_mu_phi;
863 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
868 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
882 if (scaleMap.find(scLabel1) == scaleMap.end())
885 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
887 std::vector<long long> lut_pt;
888 getLut(lut_pt, scale1, prec);
890 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
905 if (scaleMap.find(scLabel1) == scaleMap.end())
908 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
910 std::vector<long long> lut_pt;
911 getLut(lut_pt, scale1, prec);
913 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
920 unsigned int prec2) {
930 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
933 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
934 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
935 std::vector<double> val_delta_eta;
936 std::vector<long long> lut_delta_eta;
937 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
938 setLut(lut_delta_eta, val_delta_eta, prec1);
942 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
945 std::vector<long long> lut_cosh;
946 applyCosh(val_delta_eta,
n);
947 setLut(lut_cosh, val_delta_eta, prec2);
948 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
955 unsigned int prec2) {
965 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
968 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
969 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
970 std::vector<double> val_delta_phi;
971 std::vector<long long> lut_delta_phi;
972 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
973 setLut(lut_delta_phi, val_delta_phi, prec1);
977 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
980 std::vector<long long> lut_cos;
981 applyCos(val_delta_phi,
n);
982 setLut(lut_cos, val_delta_phi, prec2);
983 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
996 if (scaleMap.find(scLabel) == scaleMap.end())
1001 const tmeventsetup::esScale*
scale = &scaleMap.find(scLabel)->second;
1006 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1010 for (
size_t ii = 0;
ii <
n;
ii++) {
1015 std::vector<long long> lut;
1018 setLut(lut,
array, prec);
1019 m_gtScales.setLUT_Sin(lutName, lut, prec);
1022 setLut(lut,
array, prec);
1023 m_gtScales.setLUT_Cos(lutName, lut, prec);
1053 }
else if (condMu.
getType() == esConditionType::DoubleMuon) {
1057 }
else if (condMu.
getType() == esConditionType::TripleMuon) {
1061 }
else if (condMu.
getType() == esConditionType::QuadMuon) {
1066 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1071 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1072 <<
"\nCan not determine number of trigger objects. " << std::endl;
1076 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1078 <<
"\n condition = " << condition <<
"\n particle = " << particle
1079 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1084 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1090 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1091 tmpValues.reserve(nrObj);
1093 if (
int(condMu.
getObjects().size()) != nrObj) {
1094 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1095 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1100 unsigned int chargeCorrelation = 1;
1101 const std::vector<L1TUtmCut>&
cuts = condMu.
getCuts();
1102 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1104 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1105 if (
cut.getData() ==
"ls")
1106 chargeCorrelation = 2;
1107 else if (
cut.getData() ==
"os")
1108 chargeCorrelation = 4;
1110 chargeCorrelation = 1;
1127 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1130 relativeBx =
object.getBxOffset();
1133 int upperUnconstrainedPtInd = -1;
1134 int lowerUnconstrainedPtInd = 0;
1135 int upperImpactParameterInd = -1;
1136 int lowerImpactParameterInd = 0;
1137 int upperThresholdInd = -1;
1138 int lowerThresholdInd = 0;
1139 int upperIndexInd = -1;
1140 int lowerIndexInd = 0;
1142 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1144 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1145 int isolationLUT = 0xF;
1146 int impactParameterLUT = 0xF;
1148 int qualityLUT = 0xFFFF;
1150 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1151 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1154 switch (
cut.getCutType()) {
1155 case esCutType::UnconstrainedPt:
1156 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1157 upperUnconstrainedPtInd =
cut.getMaximum().index;
1160 case esCutType::ImpactParameter:
1161 lowerImpactParameterInd =
cut.getMinimum().index;
1162 upperImpactParameterInd =
cut.getMaximum().index;
1163 impactParameterLUT = l1tstr2int(
cut.getData());
1167 lowerThresholdInd =
cut.getMinimum().index;
1168 upperThresholdInd =
cut.getMaximum().index;
1171 case esCutType::Slice:
1172 lowerIndexInd =
int(
cut.getMinimum().value);
1173 upperIndexInd =
int(
cut.getMaximum().value);
1176 case esCutType::Eta: {
1178 etaWindow1Lower =
cut.getMinimum().index;
1179 etaWindow1Upper =
cut.getMaximum().index;
1180 }
else if (cntEta == 1) {
1181 etaWindow2Lower =
cut.getMinimum().index;
1182 etaWindow2Upper =
cut.getMaximum().index;
1185 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1194 phiWindow1Lower =
cut.getMinimum().index;
1195 phiWindow1Upper =
cut.getMaximum().index;
1196 }
else if (cntPhi == 1) {
1197 phiWindow2Lower =
cut.getMinimum().index;
1198 phiWindow2Upper =
cut.getMaximum().index;
1201 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1209 if (
cut.getData() ==
"positive")
1211 else if (
cut.getData() ==
"negative")
1218 qualityLUT = l1tstr2int(
cut.getData());
1221 case esCutType::Isolation: {
1222 isolationLUT = l1tstr2int(
cut.getData());
1232 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1233 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1234 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1235 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1236 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1238 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1239 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1241 objParameter[cnt].indexHigh = upperIndexInd;
1242 objParameter[cnt].indexLow = lowerIndexInd;
1244 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1245 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1246 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1247 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1249 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1250 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1251 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1252 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1255 objParameter[cnt].enableMip =
false;
1256 objParameter[cnt].enableIso =
false;
1257 objParameter[cnt].requestIso =
false;
1259 objParameter[cnt].charge =
charge;
1260 objParameter[cnt].qualityLUT = qualityLUT;
1261 objParameter[cnt].isolationLUT = isolationLUT;
1281 std::ostringstream myCoutStream;
1282 muonCond.
print(myCoutStream);
1283 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1287 if (!insertConditionIntoMap(muonCond, chipNr)) {
1288 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1291 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1293 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1295 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1296 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1318 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1319 <<
"\nCan not determine number of trigger objects. " << std::endl;
1323 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1325 <<
"\n condition = " << condition <<
"\n particle = " << particle
1326 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1331 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1337 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1338 tmpValues.reserve(nrObj);
1343 unsigned int chargeCorrelation = 0;
1344 if (str_chargeCorrelation ==
"ig")
1345 chargeCorrelation = 1;
1346 else if (str_chargeCorrelation ==
"ls")
1347 chargeCorrelation = 2;
1348 else if (str_chargeCorrelation ==
"os")
1349 chargeCorrelation = 4;
1365 int upperUnconstrainedPtInd = -1;
1366 int lowerUnconstrainedPtInd = 0;
1367 int upperImpactParameterInd = -1;
1368 int lowerImpactParameterInd = 0;
1369 int impactParameterLUT = 0xF;
1370 int upperThresholdInd = -1;
1371 int lowerThresholdInd = 0;
1372 int upperIndexInd = -1;
1373 int lowerIndexInd = 0;
1375 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1377 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1378 int isolationLUT = 0xF;
1380 int qualityLUT = 0xFFFF;
1382 const std::vector<L1TUtmCut>&
cuts = corrMu->
getCuts();
1383 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1386 switch (
cut.getCutType()) {
1387 case esCutType::UnconstrainedPt:
1388 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1389 upperUnconstrainedPtInd =
cut.getMaximum().index;
1392 case esCutType::ImpactParameter:
1393 lowerImpactParameterInd =
cut.getMinimum().index;
1394 upperImpactParameterInd =
cut.getMaximum().index;
1395 impactParameterLUT = l1tstr2int(
cut.getData());
1399 lowerThresholdInd =
cut.getMinimum().index;
1400 upperThresholdInd =
cut.getMaximum().index;
1403 case esCutType::Slice:
1404 lowerIndexInd =
int(
cut.getMinimum().value);
1405 upperIndexInd =
int(
cut.getMaximum().value);
1408 case esCutType::Eta: {
1410 etaWindow1Lower =
cut.getMinimum().index;
1411 etaWindow1Upper =
cut.getMaximum().index;
1412 }
else if (cntEta == 1) {
1413 etaWindow2Lower =
cut.getMinimum().index;
1414 etaWindow2Upper =
cut.getMaximum().index;
1417 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1426 phiWindow1Lower =
cut.getMinimum().index;
1427 phiWindow1Upper =
cut.getMaximum().index;
1428 }
else if (cntPhi == 1) {
1429 phiWindow2Lower =
cut.getMinimum().index;
1430 phiWindow2Upper =
cut.getMaximum().index;
1433 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1441 if (
cut.getData() ==
"positive")
1443 else if (
cut.getData() ==
"negative")
1450 qualityLUT = l1tstr2int(
cut.getData());
1453 case esCutType::Isolation: {
1454 isolationLUT = l1tstr2int(
cut.getData());
1464 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1465 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1466 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1467 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1468 objParameter[0].impactParameterLUT = impactParameterLUT;
1470 objParameter[0].ptHighThreshold = upperThresholdInd;
1471 objParameter[0].ptLowThreshold = lowerThresholdInd;
1473 objParameter[0].indexHigh = upperIndexInd;
1474 objParameter[0].indexLow = lowerIndexInd;
1476 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1477 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1478 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1479 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1481 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1482 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1483 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1484 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1487 objParameter[0].enableMip =
false;
1488 objParameter[0].enableIso =
false;
1489 objParameter[0].requestIso =
false;
1491 objParameter[0].charge =
charge;
1492 objParameter[0].qualityLUT = qualityLUT;
1493 objParameter[0].isolationLUT = isolationLUT;
1509 std::ostringstream myCoutStream;
1510 muonCond.
print(myCoutStream);
1511 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1527 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1559 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1561 if (
int(condMu.
getObjects().size()) != nrObj) {
1562 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1563 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1569 int relativeBx =
object.getBxOffset();
1571 if (condMu.
getType() == esConditionType::MuonShower0) {
1572 objParameter[0].MuonShower0 =
true;
1573 }
else if (condMu.
getType() == esConditionType::MuonShower1) {
1574 objParameter[0].MuonShower1 =
true;
1575 }
else if (condMu.
getType() == esConditionType::MuonShower2) {
1576 objParameter[0].MuonShower2 =
true;
1577 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime0) {
1578 objParameter[0].MuonShowerOutOfTime0 =
true;
1579 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime1) {
1580 objParameter[0].MuonShowerOutOfTime1 =
true;
1596 std::ostringstream myCoutStream;
1597 muonShowerCond.
print(myCoutStream);
1601 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1602 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1605 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1633 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1634 <<
"\n (in parseCalo) " 1635 <<
"\n condition = " << condition <<
"\n particle = " << particle
1636 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1645 if (condCalo.
getType() == esConditionType::SingleEgamma) {
1650 }
else if (condCalo.
getType() == esConditionType::DoubleEgamma) {
1655 }
else if (condCalo.
getType() == esConditionType::TripleEgamma) {
1660 }
else if (condCalo.
getType() == esConditionType::QuadEgamma) {
1665 }
else if (condCalo.
getType() == esConditionType::SingleJet) {
1666 caloObjType =
gtJet;
1670 }
else if (condCalo.
getType() == esConditionType::DoubleJet) {
1671 caloObjType =
gtJet;
1675 }
else if (condCalo.
getType() == esConditionType::TripleJet) {
1676 caloObjType =
gtJet;
1680 }
else if (condCalo.
getType() == esConditionType::QuadJet) {
1681 caloObjType =
gtJet;
1685 }
else if (condCalo.
getType() == esConditionType::SingleTau) {
1686 caloObjType =
gtTau;
1690 }
else if (condCalo.
getType() == esConditionType::DoubleTau) {
1691 caloObjType =
gtTau;
1695 }
else if (condCalo.
getType() == esConditionType::TripleTau) {
1696 caloObjType =
gtTau;
1700 }
else if (condCalo.
getType() == esConditionType::QuadTau) {
1701 caloObjType =
gtTau;
1706 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1713 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1714 <<
"\nCan not determine number of trigger objects. " << std::endl;
1721 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1727 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1728 tmpValues.reserve(nrObj);
1730 if (
int(condCalo.
getObjects().size()) != nrObj) {
1731 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1732 <<
"condCalo.getObjects().size() = " << condCalo.
getObjects().size()
1750 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1753 relativeBx =
object.getBxOffset();
1756 int upperThresholdInd = -1;
1757 int lowerThresholdInd = 0;
1758 int upperIndexInd = -1;
1759 int lowerIndexInd = 0;
1761 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1763 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1764 int isolationLUT = 0xF;
1765 int qualityLUT = 0xF;
1766 int displacedLUT = 0x0;
1770 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1771 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1774 switch (
cut.getCutType()) {
1776 lowerThresholdInd =
cut.getMinimum().index;
1777 upperThresholdInd =
cut.getMaximum().index;
1779 case esCutType::Slice:
1780 lowerIndexInd =
int(
cut.getMinimum().value);
1781 upperIndexInd =
int(
cut.getMaximum().value);
1783 case esCutType::Eta: {
1785 etaWindow1Lower =
cut.getMinimum().index;
1786 etaWindow1Upper =
cut.getMaximum().index;
1787 }
else if (cntEta == 1) {
1788 etaWindow2Lower =
cut.getMinimum().index;
1789 etaWindow2Upper =
cut.getMaximum().index;
1792 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1801 phiWindow1Lower =
cut.getMinimum().index;
1802 phiWindow1Upper =
cut.getMaximum().index;
1803 }
else if (cntPhi == 1) {
1804 phiWindow2Lower =
cut.getMinimum().index;
1805 phiWindow2Upper =
cut.getMaximum().index;
1808 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1816 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1821 qualityLUT = l1tstr2int(
cut.getData());
1824 case esCutType::Displaced: {
1825 displacedLUT = l1tstr2int(
cut.getData());
1828 case esCutType::Isolation: {
1829 isolationLUT = l1tstr2int(
cut.getData());
1839 objParameter[cnt].etHighThreshold = upperThresholdInd;
1840 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1841 objParameter[cnt].indexHigh = upperIndexInd;
1842 objParameter[cnt].indexLow = lowerIndexInd;
1843 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1844 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1845 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1846 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1847 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1848 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1849 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1850 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1851 objParameter[cnt].isolationLUT = isolationLUT;
1852 objParameter[cnt].qualityLUT = qualityLUT;
1853 objParameter[cnt].displacedLUT = displacedLUT;
1856 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " 1857 << cnt <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 1858 << objParameter[cnt].etHighThreshold
1859 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1860 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1861 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1862 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1863 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1864 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1865 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1866 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1867 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1868 << objParameter[cnt].isolationLUT <<
"\n Quality LUT for calo object " << cnt
1869 <<
" = 0x" << objParameter[cnt].qualityLUT <<
"\n LLP DISP LUT for calo object " 1870 << cnt <<
" = 0x" << objParameter[cnt].displacedLUT <<
std::dec << std::endl;
1876 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1894 std::ostringstream myCoutStream;
1895 caloCond.
print(myCoutStream);
1896 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1900 if (!insertConditionIntoMap(caloCond, chipNr)) {
1901 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1906 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1908 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1938 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1939 <<
"\n (in parseCalo) " 1940 <<
"\n condition = " << condition <<
"\n particle = " << particle
1941 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1950 if (corrCalo->
getType() == esObjectType::Egamma) {
1953 caloObjType =
gtJet;
1955 caloObjType =
gtTau;
1957 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1964 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1965 <<
"\nCan not determine number of trigger objects. " << std::endl;
1972 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1978 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1979 tmpValues.reserve(nrObj);
1991 int upperThresholdInd = -1;
1992 int lowerThresholdInd = 0;
1993 int upperIndexInd = -1;
1994 int lowerIndexInd = 0;
1996 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1998 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1999 int isolationLUT = 0xF;
2000 int qualityLUT = 0xF;
2001 int displacedLUT = 0x0;
2005 const std::vector<L1TUtmCut>&
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: {
2020 etaWindow1Lower =
cut.getMinimum().index;
2021 etaWindow1Upper =
cut.getMaximum().index;
2022 }
else if (cntEta == 1) {
2023 etaWindow2Lower =
cut.getMinimum().index;
2024 etaWindow2Upper =
cut.getMaximum().index;
2027 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2036 phiWindow1Lower =
cut.getMinimum().index;
2037 phiWindow1Upper =
cut.getMaximum().index;
2038 }
else if (cntPhi == 1) {
2039 phiWindow2Lower =
cut.getMinimum().index;
2040 phiWindow2Upper =
cut.getMaximum().index;
2043 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2051 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2056 qualityLUT = l1tstr2int(
cut.getData());
2059 case esCutType::Displaced: {
2060 displacedLUT = l1tstr2int(
cut.getData());
2063 case esCutType::Isolation: {
2064 isolationLUT = l1tstr2int(
cut.getData());
2074 objParameter[0].etLowThreshold = lowerThresholdInd;
2075 objParameter[0].etHighThreshold = upperThresholdInd;
2076 objParameter[0].indexHigh = upperIndexInd;
2077 objParameter[0].indexLow = lowerIndexInd;
2078 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2079 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2080 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2081 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2082 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2083 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2084 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2085 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2086 objParameter[0].isolationLUT = isolationLUT;
2087 objParameter[0].qualityLUT = qualityLUT;
2088 objParameter[0].displacedLUT = displacedLUT;
2091 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2092 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " 2093 << objParameter[0].etHighThreshold <<
"\n etaWindow Lower / Upper for calo object " 2094 <<
" = 0x" << objParameter[0].etaWindow1Lower <<
" / 0x" 2095 << objParameter[0].etaWindow1Upper
2096 <<
"\n etaWindowVeto Lower / Upper for calo object " 2097 <<
" = 0x" << objParameter[0].etaWindow2Lower <<
" / 0x" 2098 << objParameter[0].etaWindow2Upper <<
"\n phiWindow Lower / Upper for calo object " 2099 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" 2100 << objParameter[0].phiWindow1Upper
2101 <<
"\n phiWindowVeto Lower / Upper for calo object " 2102 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" 2103 << objParameter[0].phiWindow2Upper <<
"\n Isolation LUT for calo object " 2104 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2105 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2106 <<
" = 0x" << objParameter[0].displacedLUT <<
std::dec << std::endl;
2109 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2127 std::ostringstream myCoutStream;
2128 caloCond.
print(myCoutStream);
2129 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2146 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2173 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2174 <<
"\n (in parseEnergySum) " 2175 <<
"\n condition = " << condition <<
"\n type = " <<
type 2176 <<
"\n name = " <<
name << std::endl;
2182 if (condEnergySum.
getType() == esConditionType::MissingEt) {
2185 }
else if (condEnergySum.
getType() == esConditionType::TotalEt) {
2188 }
else if (condEnergySum.
getType() == esConditionType::TotalEtEM) {
2191 }
else if (condEnergySum.
getType() == esConditionType::TotalHt) {
2194 }
else if (condEnergySum.
getType() == esConditionType::MissingHt) {
2197 }
else if (condEnergySum.
getType() == esConditionType::MissingEtHF) {
2200 }
else if (condEnergySum.
getType() == esConditionType::TowerCount) {
2203 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP0) {
2206 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM0) {
2209 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP1) {
2212 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM1) {
2215 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEt) {
2218 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHt) {
2221 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEtHF) {
2224 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHtHF) {
2227 }
else if (condEnergySum.
getType() == esConditionType::Centrality0) {
2230 }
else if (condEnergySum.
getType() == esConditionType::Centrality1) {
2233 }
else if (condEnergySum.
getType() == esConditionType::Centrality2) {
2236 }
else if (condEnergySum.
getType() == esConditionType::Centrality3) {
2239 }
else if (condEnergySum.
getType() == esConditionType::Centrality4) {
2242 }
else if (condEnergySum.
getType() == esConditionType::Centrality5) {
2245 }
else if (condEnergySum.
getType() == esConditionType::Centrality6) {
2248 }
else if (condEnergySum.
getType() == esConditionType::Centrality7) {
2252 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2264 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2278 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2281 relativeBx =
object.getBxOffset();
2284 int lowerThresholdInd = 0;
2285 int upperThresholdInd = -1;
2287 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2289 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2290 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2293 switch (
cut.getCutType()) {
2295 lowerThresholdInd =
cut.getMinimum().index;
2296 upperThresholdInd =
cut.getMaximum().index;
2299 case esCutType::Eta:
2304 phiWindow1Lower =
cut.getMinimum().index;
2305 phiWindow1Upper =
cut.getMaximum().index;
2306 }
else if (cntPhi == 1) {
2307 phiWindow2Lower =
cut.getMinimum().index;
2308 phiWindow2Upper =
cut.getMaximum().index;
2310 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2317 case esCutType::Count:
2318 lowerThresholdInd =
cut.getMinimum().index;
2319 upperThresholdInd = 0xffffff;
2329 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2330 objParameter[cnt].etHighThreshold = upperThresholdInd;
2331 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2332 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2333 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2334 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2337 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2338 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2339 << objParameter[cnt].etHighThreshold
2340 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2341 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2342 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2343 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2350 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2365 std::ostringstream myCoutStream;
2366 energySumCond.
print(myCoutStream);
2367 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2371 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2372 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2377 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2380 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2409 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2410 <<
"\n (in parseEnergySum) " 2411 <<
"\n condition = " << condition <<
"\n type = " <<
type 2412 <<
"\n name = " <<
name << std::endl;
2424 }
else if (corrESum->
getType() == esObjectType::ETMHF) {
2427 }
else if (corrESum->
getType() == esObjectType::TOWERCOUNT) {
2431 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2444 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2460 int lowerThresholdInd = 0;
2461 int upperThresholdInd = -1;
2463 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2465 const std::vector<L1TUtmCut>&
cuts = corrESum->
getCuts();
2466 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2469 switch (
cut.getCutType()) {
2471 lowerThresholdInd =
cut.getMinimum().index;
2472 upperThresholdInd =
cut.getMaximum().index;
2475 case esCutType::Eta:
2480 phiWindow1Lower =
cut.getMinimum().index;
2481 phiWindow1Upper =
cut.getMaximum().index;
2482 }
else if (cntPhi == 1) {
2483 phiWindow2Lower =
cut.getMinimum().index;
2484 phiWindow2Upper =
cut.getMaximum().index;
2486 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2500 objParameter[0].etLowThreshold = lowerThresholdInd;
2501 objParameter[0].etHighThreshold = upperThresholdInd;
2502 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2503 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2504 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2505 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2508 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2509 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2510 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2511 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2512 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2513 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2517 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2532 std::ostringstream myCoutStream;
2533 energySumCond.
print(myCoutStream);
2534 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2552 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2578 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2579 <<
"\n (in parseExternal) " 2580 <<
"\n condition = " << condition <<
"\n particle = " << particle
2581 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2590 unsigned int channelID = 0;
2596 if (
object.getType() == esObjectType::EXT) {
2597 relativeBx =
object.getBxOffset();
2598 channelID =
object.getExternalChannelId();
2606 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2618 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2621 if (!insertConditionIntoMap(externalCond, chipNr)) {
2622 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2626 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2651 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2652 <<
" (in parseCorrelation) " << std::endl
2653 <<
" condition = " << condition << std::endl
2654 <<
" particle = " << particle << std::endl
2655 <<
" type = " <<
type << std::endl
2656 <<
" name = " <<
name << std::endl;
2662 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2663 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2674 const int nrObj = 2;
2677 int intGEq[nrObj] = {-1, -1};
2678 std::vector<GlobalObject>
objType(nrObj);
2679 std::vector<GtConditionCategory> condCateg(nrObj);
2682 const bool corrFlag =
true;
2683 int corrIndexVal[nrObj] = {-1, -1};
2691 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2692 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2695 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2696 if (
cut.getData() ==
"ls")
2698 else if (
cut.getData() ==
"os")
2706 double minV =
cut.getMinimum().value;
2707 double maxV =
cut.getMaximum().value;
2714 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2715 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2716 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2720 cutType = cutType | 0x1;
2722 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2723 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2724 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2728 cutType = cutType | 0x2;
2730 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2731 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2732 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2736 cutType = cutType | 0x4;
2737 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2741 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2742 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2743 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2744 cutType = cutType | 0x20;
2746 (
cut.getCutType() == esCutType::MassDeltaR)) {
2747 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2748 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2749 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2754 if (corrCond.
getType() == esConditionType::TransverseMass) {
2755 cutType = cutType | 0x10;
2756 }
else if (corrCond.
getType() == esConditionType::InvariantMassDeltaR) {
2757 cutType = cutType | 0x80;
2759 cutType = cutType | 0x8;
2761 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2762 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2763 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2764 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2768 cutType = cutType | 0x40;
2777 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 2778 <<
" corrFlag " << corrFlag << std::endl;
2785 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2786 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2787 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2788 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2825 parseMuonCorr(&
object, chipNr);
2826 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2829 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2833 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
2836 parseCaloCorr(&
object, chipNr);
2837 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2840 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2841 switch (
object.getType()) {
2842 case esObjectType::Egamma: {
2856 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2857 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2859 parseEnergySumCorr(&
object, chipNr);
2860 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2863 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2864 switch (
object.getType()) {
2871 case esObjectType::ETMHF: {
2874 case esObjectType::TOWERCOUNT: {
2883 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
2884 <<
" for the correlation condition " <<
name << std::endl;
2893 if (intGEq[0] != intGEq[1]) {
2894 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 2895 <<
" for the correlation condition " <<
name << std::endl;
2899 gEq = (intGEq[0] != 0);
2917 std::ostringstream myCoutStream;
2918 correlationCond.
print(myCoutStream);
2919 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2925 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
2951 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2952 <<
" (in parseCorrelationThreeBody) " << std::endl
2953 <<
" condition = " << condition << std::endl
2954 <<
" particle = " << particle << std::endl
2955 <<
" type = " <<
type << std::endl
2956 <<
" name = " <<
name << std::endl;
2962 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2963 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2971 const int nrObj = 3;
2974 std::vector<GlobalObject>
objType(nrObj);
2975 std::vector<GtConditionCategory> condCateg(nrObj);
2978 const bool corrFlag =
true;
2979 int corrIndexVal[nrObj] = {-1, -1, -1};
2989 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2990 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
2993 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2994 if (
cut.getData() ==
"ls")
2996 else if (
cut.getData() ==
"os")
3005 double minV =
cut.getMinimum().value;
3006 double maxV =
cut.getMaximum().value;
3012 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3013 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3014 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3018 cutType = cutType | 0x8;
3019 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3023 cutType = cutType | 0x80;
3031 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3032 <<
" corrFlag " << corrFlag << std::endl;
3037 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3039 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3040 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3041 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3046 parseMuonCorr(&
object, chipNr);
3047 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
3054 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3055 <<
" for the correlation condition " <<
name 3056 <<
": no three muons in the event!" << std::endl;
3076 std::ostringstream myCoutStream;
3077 correlationThreeBodyCond.
print(myCoutStream);
3078 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3084 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3110 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3111 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3112 <<
" condition = " << condition << std::endl
3113 <<
" particle = " << particle << std::endl
3114 <<
" type = " <<
type << std::endl
3115 <<
" name = " <<
name << std::endl;
3121 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3122 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3133 const int nrObj = 3;
3136 int intGEq[nrObj] = {-1, -1, -1};
3137 std::vector<GlobalObject>
objType(nrObj);
3138 std::vector<GtConditionCategory> condCateg(nrObj);
3141 const bool corrFlag =
true;
3142 int corrIndexVal[nrObj] = {-1, -1, -1};
3150 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3151 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3154 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3155 if (
cut.getData() ==
"ls")
3157 else if (
cut.getData() ==
"os")
3165 double minV =
cut.getMinimum().value;
3166 double maxV =
cut.getMaximum().value;
3177 cutType = cutType | 0x1;
3183 cutType = cutType | 0x2;
3189 cutType = cutType | 0x4;
3195 cutType = cutType | 0x8;
3196 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3200 cutType = cutType | 0x80;
3202 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3207 cutType = cutType | 0x10;
3208 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3213 cutType = cutType | 0x20;
3214 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3219 cutType = cutType | 0x40;
3229 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3230 << corrFlag << std::endl;
3237 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3238 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3239 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3240 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3241 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3278 parseMuonCorr(&
object, chipNr);
3279 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3282 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3286 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3289 parseCaloCorr(&
object, chipNr);
3290 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3293 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3294 switch (
object.getType()) {
3295 case esObjectType::Egamma: {
3309 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3310 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3312 parseEnergySumCorr(&
object, chipNr);
3313 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3316 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3317 switch (
object.getType()) {
3324 case esObjectType::ETMHF: {
3327 case esObjectType::TOWERCOUNT: {
3336 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3337 <<
" for the correlation condition " <<
name << std::endl;
3346 if (intGEq[0] != intGEq[1]) {
3347 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3348 <<
" for the correlation condition " <<
name << std::endl;
3352 gEq = (intGEq[0] != 0);
3372 std::ostringstream myCoutStream;
3373 correlationWORCond.
print(myCoutStream);
3374 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3380 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3402 if (algAlias.empty()) {
3404 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3405 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3409 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3410 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3417 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3418 <<
" Chip number: " << chipNr << std::endl;
3424 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3439 std::ostringstream myCoutStream;
3440 alg.
print(myCoutStream);
3441 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3445 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)
const int getType() const
const std::vector< L1TUtmCut > & getCuts() const
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
const std::vector< L1TUtmObject > & getObjects() const
void print(std::ostream &myCout) const override
print the condition
Log< level::Error, false > LogError
const int getComparisonOperator() const
const std::string & getName() const
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)
const int getBxOffset() const
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
const int getType() const
long long minMassCutValue
long long minTBPTCutValue
void setCond1Category(const l1t::GtConditionCategory &)
unsigned int precOverlapRemovalEtaCut
long long minOverlapRemovalPhiCutValue
void setCond1Index(const int &)
unsigned int chargeCorrelation
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
const std::string & getName() const
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
const std::vector< L1TUtmCut > & getCuts() const
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 &)