50 #include "tmEventSetup/tmEventSetup.hh" 51 #include "tmEventSetup/esTypes.hh" 59 #include "tmGrammar/Algorithm.hh" 65 : m_triggerMenuInterface(
"NULL"),
66 m_triggerMenuName(
"NULL"),
67 m_triggerMenuImplementation(0x0),
81 m_numberConditionChips = numberConditionChipsValue;
86 m_pinsOnConditionChip = pinsOnConditionChipValue;
92 m_orderConditionChip = orderConditionChipValue;
97 m_numberPhysTriggers = numberPhysTriggersValue;
105 m_triggerMenuInterface = menuInterface;
114 m_triggerMenuImplementation = menuImplementation;
122 m_vecMuonTemplate = vecMuonTempl;
126 const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTempl) {
127 m_vecMuonShowerTemplate = vecMuonShowerTempl;
131 m_vecCaloTemplate = vecCaloTempl;
135 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
136 m_vecEnergySumTemplate = vecEnergySumTempl;
140 const std::vector<std::vector<EnergySumZdcTemplate> >& vecEnergySumZdcTempl) {
141 m_vecEnergySumZdcTemplate = vecEnergySumZdcTempl;
145 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
146 m_vecExternalTemplate = vecExternalTempl;
150 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
151 m_vecCorrelationTemplate = vecCorrelationTempl;
155 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
156 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
160 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
161 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
167 m_corMuonTemplate = corMuonTempl;
171 m_corCaloTemplate = corCaloTempl;
175 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
176 m_corEnergySumTemplate = corEnergySumTempl;
187 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
189 std::map<std::string, unsigned int> extBitMap;
192 for (
const auto& cit : condMap) {
194 if (condition.
getType() == esConditionType::Externals) {
197 for (
const auto&
object :
objects) {
198 if (
object.getType() == esObjectType::EXT) {
199 unsigned int channelID =
object.getExternalChannelId();
202 if (extBitMap.count(
name) == 0)
216 m_conditionMap.resize(m_numberConditionChips);
218 m_vecMuonTemplate.resize(m_numberConditionChips);
219 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
220 m_vecCaloTemplate.resize(m_numberConditionChips);
221 m_vecEnergySumTemplate.resize(m_numberConditionChips);
222 m_vecEnergySumZdcTemplate.resize(m_numberConditionChips);
223 m_vecExternalTemplate.resize(m_numberConditionChips);
225 m_vecCorrelationTemplate.resize(m_numberConditionChips);
226 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
227 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
228 m_corMuonTemplate.resize(m_numberConditionChips);
229 m_corCaloTemplate.resize(m_numberConditionChips);
230 m_corEnergySumTemplate.resize(m_numberConditionChips);
236 m_triggerMenuDescription = utmMenu->
getComment();
238 m_triggerMenuImplementation = (getMmHashN(utmMenu->
getFirmwareUuid()) & 0xFFFFFFFF);
239 m_triggerMenuName = utmMenu->
getName();
240 m_triggerMenuInterface = utmMenu->
getVersion();
241 m_triggerMenuUUID = (getMmHashN(utmMenu->
getName()) & 0xFFFFFFFF);
243 const std::map<std::string, L1TUtmAlgorithm>& algoMap = utmMenu->
getAlgorithmMap();
244 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
246 const std::map<std::string, tmeventsetup::esScale> scaleMap(std::begin(utmMenu->
getScaleMap()),
251 parseScales(scaleMap);
254 for (
const auto& cit : algoMap) {
262 parseAlgorithm(
algo, chipNr);
265 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
266 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
274 if ((m_conditionMap[chipNr]).
count(condition.
getName()) == 0) {
276 if (condition.
getType() == esConditionType::SingleEgamma ||
277 condition.
getType() == esConditionType::DoubleEgamma ||
278 condition.
getType() == esConditionType::TripleEgamma ||
279 condition.
getType() == esConditionType::QuadEgamma || condition.
getType() == esConditionType::SingleTau ||
280 condition.
getType() == esConditionType::DoubleTau || condition.
getType() == esConditionType::TripleTau ||
281 condition.
getType() == esConditionType::QuadTau || condition.
getType() == esConditionType::SingleJet ||
282 condition.
getType() == esConditionType::DoubleJet || condition.
getType() == esConditionType::TripleJet ||
283 condition.
getType() == esConditionType::QuadJet) {
284 parseCalo(condition, chipNr,
false);
287 }
else if (condition.
getType() == esConditionType::TotalEt ||
288 condition.
getType() == esConditionType::TotalEtEM ||
289 condition.
getType() == esConditionType::TotalHt ||
290 condition.
getType() == esConditionType::MissingEt ||
291 condition.
getType() == esConditionType::MissingHt ||
292 condition.
getType() == esConditionType::MissingEtHF ||
293 condition.
getType() == esConditionType::TowerCount ||
294 condition.
getType() == esConditionType::MinBiasHFP0 ||
295 condition.
getType() == esConditionType::MinBiasHFM0 ||
296 condition.
getType() == esConditionType::MinBiasHFP1 ||
297 condition.
getType() == esConditionType::MinBiasHFM1 ||
298 condition.
getType() == esConditionType::AsymmetryEt ||
299 condition.
getType() == esConditionType::AsymmetryHt ||
300 condition.
getType() == esConditionType::AsymmetryEtHF ||
301 condition.
getType() == esConditionType::AsymmetryHtHF ||
302 condition.
getType() == esConditionType::Centrality0 ||
303 condition.
getType() == esConditionType::Centrality1 ||
304 condition.
getType() == esConditionType::Centrality2 ||
305 condition.
getType() == esConditionType::Centrality3 ||
306 condition.
getType() == esConditionType::Centrality4 ||
307 condition.
getType() == esConditionType::Centrality5 ||
308 condition.
getType() == esConditionType::Centrality6 ||
309 condition.
getType() == esConditionType::Centrality7) {
310 parseEnergySum(condition, chipNr,
false);
313 }
else if (condition.
getType() == esConditionType::ZDCPlus ||
314 condition.
getType() == esConditionType::ZDCMinus) {
315 parseEnergySumZdc(condition, chipNr,
false);
319 condition.
getType() == esConditionType::DoubleMuon ||
320 condition.
getType() == esConditionType::TripleMuon ||
321 condition.
getType() == esConditionType::QuadMuon) {
322 parseMuon(condition, chipNr,
false);
324 }
else if (condition.
getType() == esConditionType::MuonShower0 ||
325 condition.
getType() == esConditionType::MuonShower1 ||
326 condition.
getType() == esConditionType::MuonShower2 ||
327 condition.
getType() == esConditionType::MuonShowerOutOfTime0 ||
328 condition.
getType() == esConditionType::MuonShowerOutOfTime1) {
329 parseMuonShower(condition, chipNr,
false);
332 }
else if (condition.
getType() == esConditionType::MuonMuonCorrelation ||
333 condition.
getType() == esConditionType::MuonEsumCorrelation ||
334 condition.
getType() == esConditionType::CaloMuonCorrelation ||
335 condition.
getType() == esConditionType::CaloCaloCorrelation ||
336 condition.
getType() == esConditionType::CaloEsumCorrelation ||
337 condition.
getType() == esConditionType::InvariantMass ||
338 condition.
getType() == esConditionType::InvariantMassDeltaR ||
339 condition.
getType() == esConditionType::TransverseMass ||
340 condition.
getType() == esConditionType::InvariantMassUpt) {
341 parseCorrelation(condition, chipNr);
344 }
else if (condition.
getType() == esConditionType::InvariantMass3) {
345 parseCorrelationThreeBody(condition, chipNr);
348 }
else if (condition.
getType() == esConditionType::Externals) {
349 parseExternal(condition, chipNr);
352 }
else if (condition.
getType() == esConditionType::CaloCaloCorrelationOvRm ||
353 condition.
getType() == esConditionType::InvariantMassOvRm ||
354 condition.
getType() == esConditionType::TransverseMassOvRm ||
355 condition.
getType() == esConditionType::DoubleJetOvRm ||
356 condition.
getType() == esConditionType::DoubleTauOvRm) {
357 parseCorrelationWithOverlapRemoval(condition, chipNr);
359 }
else if (condition.
getType() == esConditionType::SingleEgammaOvRm ||
360 condition.
getType() == esConditionType::DoubleEgammaOvRm ||
361 condition.
getType() == esConditionType::TripleEgammaOvRm ||
362 condition.
getType() == esConditionType::QuadEgammaOvRm ||
363 condition.
getType() == esConditionType::SingleTauOvRm ||
364 condition.
getType() == esConditionType::TripleTauOvRm ||
365 condition.
getType() == esConditionType::QuadTauOvRm ||
366 condition.
getType() == esConditionType::SingleJetOvRm ||
367 condition.
getType() == esConditionType::TripleJetOvRm ||
368 condition.
getType() == esConditionType::QuadJetOvRm) {
370 <<
"\n SingleEgammaOvRm" 371 <<
"\n DoubleEgammaOvRm" 372 <<
"\n TripleEgammaOvRm" 373 <<
"\n QuadEgammaOvRm" 374 <<
"\n SingleTauOvRm" 375 <<
"\n TripleTauOvRm" 377 <<
"\n SingleJetOvRm" 378 <<
"\n TripleJetOvRm" 380 <<
"\n The above conditions types OvRm are not implemented yet in the " 381 "parser. Please remove alogrithms that " 382 "use this type of condtion from L1T Menu!" 398 m_triggerMenuInterfaceAuthor =
val;
402 m_triggerMenuInterfaceDescription =
val;
420 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
424 itCondOnChip->clear();
428 m_algorithmMap.clear();
435 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 439 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
440 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
444 (m_conditionMap[chipNr])[cName] = &
cond;
445 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
458 if (m_algorithmMap.count(algName) != 0) {
459 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
460 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
464 if (m_algorithmAliasMap.count(algAlias) != 0) {
465 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
466 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
473 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 474 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
479 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
480 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
481 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
487 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
489 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
490 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 491 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
497 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
499 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
500 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 501 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
506 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
507 int iPin = (itAlgo->second)
508 .algoOutputPin(static_cast<int>(m_numberConditionChips),
509 static_cast<int>(m_pinsOnConditionChip),
510 m_orderConditionChip);
512 int iChip = (itAlgo->second)
513 .algoChipNumber(static_cast<int>(m_numberConditionChips),
514 static_cast<int>(m_pinsOnConditionChip),
515 m_orderConditionChip);
517 if ((outputPin == iPin) && (chipNr == iChip)) {
518 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
519 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 526 m_algorithmMap[algName] = alg;
527 m_algorithmAliasMap[algAlias] = alg;
536 template <
typename T>
538 std::stringstream
ss;
543 std::stringstream
ss;
574 for (std::map<std::string, tmeventsetup::esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end();
576 const tmeventsetup::esScale&
scale = cit->second;
580 scaleParam = &muScales;
581 else if (
scale.getObjectType() == esObjectType::Egamma)
582 scaleParam = &egScales;
584 scaleParam = &tauScales;
586 scaleParam = &jetScales;
588 scaleParam = &ettScales;
589 else if (
scale.getObjectType() == esObjectType::ETTEM)
590 scaleParam = &ettEmScales;
592 scaleParam = &etmScales;
593 else if (
scale.getObjectType() == esObjectType::ETMHF)
594 scaleParam = &etmHfScales;
596 scaleParam = &httScales;
598 scaleParam = &htmScales;
600 scaleParam = &zdcScales;
602 scaleParam =
nullptr;
604 if (scaleParam !=
nullptr) {
605 switch (
scale.getScaleType()) {
606 case esScaleType::EtScale: {
612 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
613 for (
unsigned int i = 0;
i < binsV.size();
i++) {
614 const tmeventsetup::esBin&
bin = binsV.at(
i);
615 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
616 scaleParam->
etBins.push_back(binLimits);
623 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
628 scale.getObjectType() == esObjectType::ETTEM) {
636 case esScaleType::UnconstrainedPtScale: {
642 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
643 for (
unsigned int i = 0;
i < binsV.size();
i++) {
644 const tmeventsetup::esBin&
bin = binsV.at(
i);
645 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
646 scaleParam->
uptBins.push_back(binLimits);
649 case esScaleType::EtaScale: {
655 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
657 for (
unsigned int i = 0;
i < binsV.size();
i++) {
658 const tmeventsetup::esBin&
bin = binsV.at(
i);
659 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
660 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
663 case esScaleType::PhiScale: {
669 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
671 for (
unsigned int i = 0;
i < binsV.size();
i++) {
672 const tmeventsetup::esBin&
bin = binsV.at(
i);
673 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
674 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
685 m_gtScales.setMuonScales(muScales);
686 m_gtScales.setEGScales(egScales);
687 m_gtScales.setTauScales(tauScales);
688 m_gtScales.setJetScales(jetScales);
689 m_gtScales.setETTScales(ettScales);
690 m_gtScales.setETTEmScales(ettEmScales);
691 m_gtScales.setETMScales(etmScales);
692 m_gtScales.setETMHfScales(etmHfScales);
693 m_gtScales.setHTTScales(httScales);
694 m_gtScales.setHTMScales(htmScales);
695 m_gtScales.setHTMScales(zdcScales);
698 bool hasPrecision =
false;
699 std::map<std::string, unsigned int> precisions;
700 getPrecisions(precisions, scaleMap);
701 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
708 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
709 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
710 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
714 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
715 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
716 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
717 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
718 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
719 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
723 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
724 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
725 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
726 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
727 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
728 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
729 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
730 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
734 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
735 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
736 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
737 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
738 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
739 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
740 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
744 parseDeltaEta_Cosh_LUTS(
745 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
746 parseDeltaEta_Cosh_LUTS(
747 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
748 parseDeltaEta_Cosh_LUTS(
749 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
750 parseDeltaEta_Cosh_LUTS(
751 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
753 parseDeltaEta_Cosh_LUTS(
754 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
755 parseDeltaEta_Cosh_LUTS(
756 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
757 parseDeltaEta_Cosh_LUTS(
758 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
760 parseDeltaEta_Cosh_LUTS(
761 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
762 parseDeltaEta_Cosh_LUTS(
763 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
765 parseDeltaEta_Cosh_LUTS(
766 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
770 parseDeltaPhi_Cos_LUTS(
771 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
772 parseDeltaPhi_Cos_LUTS(
773 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
774 parseDeltaPhi_Cos_LUTS(
775 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
776 parseDeltaPhi_Cos_LUTS(
777 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
778 parseDeltaPhi_Cos_LUTS(
779 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
780 parseDeltaPhi_Cos_LUTS(
781 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
782 parseDeltaPhi_Cos_LUTS(
783 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
785 parseDeltaPhi_Cos_LUTS(
786 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
787 parseDeltaPhi_Cos_LUTS(
788 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
789 parseDeltaPhi_Cos_LUTS(
790 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
791 parseDeltaPhi_Cos_LUTS(
792 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
793 parseDeltaPhi_Cos_LUTS(
794 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
795 parseDeltaPhi_Cos_LUTS(
796 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
798 parseDeltaPhi_Cos_LUTS(
799 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
800 parseDeltaPhi_Cos_LUTS(
801 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
802 parseDeltaPhi_Cos_LUTS(
803 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
804 parseDeltaPhi_Cos_LUTS(
805 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
806 parseDeltaPhi_Cos_LUTS(
807 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
809 parseDeltaPhi_Cos_LUTS(
810 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
811 parseDeltaPhi_Cos_LUTS(
812 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
813 parseDeltaPhi_Cos_LUTS(
814 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
815 parseDeltaPhi_Cos_LUTS(
816 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
818 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
819 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
820 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
821 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
823 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
824 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
825 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
826 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
848 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
851 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
852 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
854 std::vector<long long> lut_cal_2_mu_eta;
855 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
860 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
875 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
878 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
879 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
881 std::vector<long long> lut_cal_2_mu_phi;
882 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
887 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
901 if (scaleMap.find(scLabel1) == scaleMap.end())
904 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
906 std::vector<long long> lut_pt;
907 getLut(lut_pt, scale1, prec);
909 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
924 if (scaleMap.find(scLabel1) == scaleMap.end())
927 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
929 std::vector<long long> lut_pt;
930 getLut(lut_pt, scale1, prec);
932 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
939 unsigned int prec2) {
949 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
952 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
953 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
954 std::vector<double> val_delta_eta;
955 std::vector<long long> lut_delta_eta;
956 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
957 setLut(lut_delta_eta, val_delta_eta, prec1);
961 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
964 std::vector<long long> lut_cosh;
965 applyCosh(val_delta_eta,
n);
966 setLut(lut_cosh, val_delta_eta, prec2);
967 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
974 unsigned int prec2) {
984 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
987 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
988 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
989 std::vector<double> val_delta_phi;
990 std::vector<long long> lut_delta_phi;
991 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
992 setLut(lut_delta_phi, val_delta_phi, prec1);
996 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
999 std::vector<long long> lut_cos;
1000 applyCos(val_delta_phi,
n);
1001 setLut(lut_cos, val_delta_phi, prec2);
1002 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
1008 unsigned int prec) {
1015 if (scaleMap.find(scLabel) == scaleMap.end())
1020 const tmeventsetup::esScale*
scale = &scaleMap.find(scLabel)->second;
1025 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1029 for (
size_t ii = 0;
ii <
n;
ii++) {
1034 std::vector<long long> lut;
1037 setLut(lut,
array, prec);
1038 m_gtScales.setLUT_Sin(lutName, lut, prec);
1041 setLut(lut,
array, prec);
1042 m_gtScales.setLUT_Cos(lutName, lut, prec);
1072 }
else if (condMu.
getType() == esConditionType::DoubleMuon) {
1076 }
else if (condMu.
getType() == esConditionType::TripleMuon) {
1080 }
else if (condMu.
getType() == esConditionType::QuadMuon) {
1085 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1090 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1091 <<
"\nCan not determine number of trigger objects. " << std::endl;
1095 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1097 <<
"\n condition = " << condition <<
"\n particle = " << particle
1098 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1103 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1109 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1110 tmpValues.reserve(nrObj);
1112 if (
int(condMu.
getObjects().size()) != nrObj) {
1113 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1114 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1119 unsigned int chargeCorrelation = 1;
1120 const std::vector<L1TUtmCut>&
cuts = condMu.
getCuts();
1121 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1123 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1124 if (
cut.getData() ==
"ls")
1125 chargeCorrelation = 2;
1126 else if (
cut.getData() ==
"os")
1127 chargeCorrelation = 4;
1129 chargeCorrelation = 1;
1146 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1149 relativeBx =
object.getBxOffset();
1152 int upperUnconstrainedPtInd = -1;
1153 int lowerUnconstrainedPtInd = 0;
1154 int upperImpactParameterInd = -1;
1155 int lowerImpactParameterInd = 0;
1156 int upperThresholdInd = -1;
1157 int lowerThresholdInd = 0;
1158 int upperIndexInd = -1;
1159 int lowerIndexInd = 0;
1161 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1162 int isolationLUT = 0xF;
1163 int impactParameterLUT = 0xF;
1165 int qualityLUT = 0xFFFF;
1167 std::vector<MuonTemplate::Window> etaWindows;
1168 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1170 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1171 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1174 switch (
cut.getCutType()) {
1175 case esCutType::UnconstrainedPt:
1176 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1177 upperUnconstrainedPtInd =
cut.getMaximum().index;
1180 case esCutType::ImpactParameter:
1181 lowerImpactParameterInd =
cut.getMinimum().index;
1182 upperImpactParameterInd =
cut.getMaximum().index;
1183 impactParameterLUT = l1tstr2int(
cut.getData());
1187 lowerThresholdInd =
cut.getMinimum().index;
1188 upperThresholdInd =
cut.getMaximum().index;
1191 case esCutType::Slice:
1192 lowerIndexInd =
int(
cut.getMinimum().value);
1193 upperIndexInd =
int(
cut.getMaximum().value);
1196 case esCutType::Eta: {
1197 if (etaWindows.size() < 5) {
1198 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1201 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1208 phiWindow1Lower =
cut.getMinimum().index;
1209 phiWindow1Upper =
cut.getMaximum().index;
1210 }
else if (cntPhi == 1) {
1211 phiWindow2Lower =
cut.getMinimum().index;
1212 phiWindow2Upper =
cut.getMaximum().index;
1215 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1223 if (
cut.getData() ==
"positive")
1225 else if (
cut.getData() ==
"negative")
1232 qualityLUT = l1tstr2int(
cut.getData());
1235 case esCutType::Isolation: {
1236 isolationLUT = l1tstr2int(
cut.getData());
1240 case esCutType::Index: {
1241 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1251 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1252 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1253 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1254 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1255 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1257 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1258 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1260 objParameter[cnt].indexHigh = upperIndexInd;
1261 objParameter[cnt].indexLow = lowerIndexInd;
1263 objParameter[cnt].etaWindows = etaWindows;
1265 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1266 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1267 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1268 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1271 objParameter[cnt].enableMip =
false;
1272 objParameter[cnt].enableIso =
false;
1273 objParameter[cnt].requestIso =
false;
1275 objParameter[cnt].charge =
charge;
1276 objParameter[cnt].qualityLUT = qualityLUT;
1277 objParameter[cnt].isolationLUT = isolationLUT;
1279 objParameter[cnt].tfMuonIndexWindows = tfMuonIndexWindows;
1299 std::ostringstream myCoutStream;
1300 muonCond.
print(myCoutStream);
1301 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1305 if (!insertConditionIntoMap(muonCond, chipNr)) {
1306 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1309 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1311 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1313 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1314 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1336 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1337 <<
"\nCan not determine number of trigger objects. " << std::endl;
1341 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1343 <<
"\n condition = " << condition <<
"\n particle = " << particle
1344 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1349 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1355 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1356 tmpValues.reserve(nrObj);
1361 unsigned int chargeCorrelation = 0;
1362 if (str_chargeCorrelation ==
"ig")
1363 chargeCorrelation = 1;
1364 else if (str_chargeCorrelation ==
"ls")
1365 chargeCorrelation = 2;
1366 else if (str_chargeCorrelation ==
"os")
1367 chargeCorrelation = 4;
1383 int upperUnconstrainedPtInd = -1;
1384 int lowerUnconstrainedPtInd = 0;
1385 int upperImpactParameterInd = -1;
1386 int lowerImpactParameterInd = 0;
1387 int impactParameterLUT = 0xF;
1388 int upperThresholdInd = -1;
1389 int lowerThresholdInd = 0;
1390 int upperIndexInd = -1;
1391 int lowerIndexInd = 0;
1393 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1394 int isolationLUT = 0xF;
1396 int qualityLUT = 0xFFFF;
1398 std::vector<MuonTemplate::Window> etaWindows;
1399 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1401 const std::vector<L1TUtmCut>&
cuts = corrMu->
getCuts();
1402 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1405 switch (
cut.getCutType()) {
1406 case esCutType::UnconstrainedPt:
1407 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1408 upperUnconstrainedPtInd =
cut.getMaximum().index;
1411 case esCutType::ImpactParameter:
1412 lowerImpactParameterInd =
cut.getMinimum().index;
1413 upperImpactParameterInd =
cut.getMaximum().index;
1414 impactParameterLUT = l1tstr2int(
cut.getData());
1418 lowerThresholdInd =
cut.getMinimum().index;
1419 upperThresholdInd =
cut.getMaximum().index;
1422 case esCutType::Slice:
1423 lowerIndexInd =
int(
cut.getMinimum().value);
1424 upperIndexInd =
int(
cut.getMaximum().value);
1427 case esCutType::Eta: {
1428 if (etaWindows.size() < 5) {
1429 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1432 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1439 phiWindow1Lower =
cut.getMinimum().index;
1440 phiWindow1Upper =
cut.getMaximum().index;
1441 }
else if (cntPhi == 1) {
1442 phiWindow2Lower =
cut.getMinimum().index;
1443 phiWindow2Upper =
cut.getMaximum().index;
1446 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1454 if (
cut.getData() ==
"positive")
1456 else if (
cut.getData() ==
"negative")
1463 qualityLUT = l1tstr2int(
cut.getData());
1466 case esCutType::Isolation: {
1467 isolationLUT = l1tstr2int(
cut.getData());
1471 case esCutType::Index: {
1472 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1482 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1483 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1484 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1485 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1486 objParameter[0].impactParameterLUT = impactParameterLUT;
1488 objParameter[0].ptHighThreshold = upperThresholdInd;
1489 objParameter[0].ptLowThreshold = lowerThresholdInd;
1491 objParameter[0].indexHigh = upperIndexInd;
1492 objParameter[0].indexLow = lowerIndexInd;
1494 objParameter[0].etaWindows = etaWindows;
1496 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1497 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1498 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1499 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1502 objParameter[0].enableMip =
false;
1503 objParameter[0].enableIso =
false;
1504 objParameter[0].requestIso =
false;
1506 objParameter[0].charge =
charge;
1507 objParameter[0].qualityLUT = qualityLUT;
1508 objParameter[0].isolationLUT = isolationLUT;
1510 objParameter[0].tfMuonIndexWindows = tfMuonIndexWindows;
1526 std::ostringstream myCoutStream;
1527 muonCond.
print(myCoutStream);
1528 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1544 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1576 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1578 if (
int(condMu.
getObjects().size()) != nrObj) {
1579 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1580 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1586 int relativeBx =
object.getBxOffset();
1588 if (condMu.
getType() == esConditionType::MuonShower0) {
1589 objParameter[0].MuonShower0 =
true;
1590 }
else if (condMu.
getType() == esConditionType::MuonShower1) {
1591 objParameter[0].MuonShower1 =
true;
1592 }
else if (condMu.
getType() == esConditionType::MuonShower2) {
1593 objParameter[0].MuonShower2 =
true;
1594 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime0) {
1595 objParameter[0].MuonShowerOutOfTime0 =
true;
1596 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime1) {
1597 objParameter[0].MuonShowerOutOfTime1 =
true;
1613 std::ostringstream myCoutStream;
1614 muonShowerCond.
print(myCoutStream);
1618 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1619 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1622 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1650 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1651 <<
"\n (in parseCalo) " 1652 <<
"\n condition = " << condition <<
"\n particle = " << particle
1653 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1662 if (condCalo.
getType() == esConditionType::SingleEgamma) {
1667 }
else if (condCalo.
getType() == esConditionType::DoubleEgamma) {
1672 }
else if (condCalo.
getType() == esConditionType::TripleEgamma) {
1677 }
else if (condCalo.
getType() == esConditionType::QuadEgamma) {
1682 }
else if (condCalo.
getType() == esConditionType::SingleJet) {
1683 caloObjType =
gtJet;
1687 }
else if (condCalo.
getType() == esConditionType::DoubleJet) {
1688 caloObjType =
gtJet;
1692 }
else if (condCalo.
getType() == esConditionType::TripleJet) {
1693 caloObjType =
gtJet;
1697 }
else if (condCalo.
getType() == esConditionType::QuadJet) {
1698 caloObjType =
gtJet;
1702 }
else if (condCalo.
getType() == esConditionType::SingleTau) {
1703 caloObjType =
gtTau;
1707 }
else if (condCalo.
getType() == esConditionType::DoubleTau) {
1708 caloObjType =
gtTau;
1712 }
else if (condCalo.
getType() == esConditionType::TripleTau) {
1713 caloObjType =
gtTau;
1717 }
else if (condCalo.
getType() == esConditionType::QuadTau) {
1718 caloObjType =
gtTau;
1723 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1730 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1731 <<
"\nCan not determine number of trigger objects. " << std::endl;
1738 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1744 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1745 tmpValues.reserve(nrObj);
1747 if (
int(condCalo.
getObjects().size()) != nrObj) {
1748 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1749 <<
"condCalo.getObjects().size() = " << condCalo.
getObjects().size()
1767 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1770 relativeBx =
object.getBxOffset();
1773 int upperThresholdInd = -1;
1774 int lowerThresholdInd = 0;
1775 int upperIndexInd = -1;
1776 int lowerIndexInd = 0;
1778 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1779 int isolationLUT = 0xF;
1780 int qualityLUT = 0xF;
1781 int displacedLUT = 0x0;
1785 std::vector<CaloTemplate::Window> etaWindows;
1787 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1788 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1791 switch (
cut.getCutType()) {
1793 lowerThresholdInd =
cut.getMinimum().index;
1794 upperThresholdInd =
cut.getMaximum().index;
1796 case esCutType::Slice:
1797 lowerIndexInd =
int(
cut.getMinimum().value);
1798 upperIndexInd =
int(
cut.getMaximum().value);
1800 case esCutType::Eta: {
1801 if (etaWindows.size() < 5) {
1802 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1805 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1812 phiWindow1Lower =
cut.getMinimum().index;
1813 phiWindow1Upper =
cut.getMaximum().index;
1814 }
else if (cntPhi == 1) {
1815 phiWindow2Lower =
cut.getMinimum().index;
1816 phiWindow2Upper =
cut.getMaximum().index;
1819 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1827 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1832 qualityLUT = l1tstr2int(
cut.getData());
1835 case esCutType::Displaced: {
1836 displacedLUT = l1tstr2int(
cut.getData());
1839 case esCutType::Isolation: {
1840 isolationLUT = l1tstr2int(
cut.getData());
1850 objParameter[cnt].etHighThreshold = upperThresholdInd;
1851 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1852 objParameter[cnt].indexHigh = upperIndexInd;
1853 objParameter[cnt].indexLow = lowerIndexInd;
1854 objParameter[cnt].etaWindows = etaWindows;
1855 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1856 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1857 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1858 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1859 objParameter[cnt].isolationLUT = isolationLUT;
1860 objParameter[cnt].qualityLUT = qualityLUT;
1861 objParameter[cnt].displacedLUT = displacedLUT;
1865 std::ostringstream oss;
1866 oss <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " << std::hex
1867 << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold;
1868 for (
const auto&
window : objParameter[cnt].etaWindows) {
1869 oss <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" <<
window.lower <<
" / 0x" 1872 oss <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" << objParameter[cnt].phiWindow1Lower
1873 <<
" / 0x" << objParameter[cnt].phiWindow1Upper <<
"\n phiWindowVeto Lower / Upper for calo object " 1874 << cnt <<
" = 0x" << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1875 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].isolationLUT
1876 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].qualityLUT
1877 <<
"\n LLP DISP LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].displacedLUT;
1878 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
1885 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1903 std::ostringstream myCoutStream;
1904 caloCond.
print(myCoutStream);
1905 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1909 if (!insertConditionIntoMap(caloCond, chipNr)) {
1910 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1915 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1917 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1947 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1948 <<
"\n (in parseCalo) " 1949 <<
"\n condition = " << condition <<
"\n particle = " << particle
1950 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1959 if (corrCalo->
getType() == esObjectType::Egamma) {
1962 caloObjType =
gtJet;
1964 caloObjType =
gtTau;
1966 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1973 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1974 <<
"\nCan not determine number of trigger objects. " << std::endl;
1981 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1987 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1988 tmpValues.reserve(nrObj);
2000 int upperThresholdInd = -1;
2001 int lowerThresholdInd = 0;
2002 int upperIndexInd = -1;
2003 int lowerIndexInd = 0;
2005 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2006 int isolationLUT = 0xF;
2007 int qualityLUT = 0xF;
2008 int displacedLUT = 0x0;
2012 std::vector<CaloTemplate::Window> etaWindows;
2014 const std::vector<L1TUtmCut>&
cuts = corrCalo->
getCuts();
2015 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2018 switch (
cut.getCutType()) {
2020 lowerThresholdInd =
cut.getMinimum().index;
2021 upperThresholdInd =
cut.getMaximum().index;
2023 case esCutType::Slice:
2024 lowerIndexInd =
int(
cut.getMinimum().value);
2025 upperIndexInd =
int(
cut.getMaximum().value);
2027 case esCutType::Eta: {
2028 if (etaWindows.size() < 5) {
2029 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
2032 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2039 phiWindow1Lower =
cut.getMinimum().index;
2040 phiWindow1Upper =
cut.getMaximum().index;
2041 }
else if (cntPhi == 1) {
2042 phiWindow2Lower =
cut.getMinimum().index;
2043 phiWindow2Upper =
cut.getMaximum().index;
2046 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2054 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2059 qualityLUT = l1tstr2int(
cut.getData());
2062 case esCutType::Displaced: {
2063 displacedLUT = l1tstr2int(
cut.getData());
2066 case esCutType::Isolation: {
2067 isolationLUT = l1tstr2int(
cut.getData());
2077 objParameter[0].etLowThreshold = lowerThresholdInd;
2078 objParameter[0].etHighThreshold = upperThresholdInd;
2079 objParameter[0].indexHigh = upperIndexInd;
2080 objParameter[0].indexLow = lowerIndexInd;
2081 objParameter[0].etaWindows = etaWindows;
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;
2092 std::ostringstream oss;
2093 oss <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2094 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold;
2095 for (
const auto&
window : objParameter[0].etaWindows) {
2096 oss <<
"\n etaWindow Lower / Upper for calo object " 2099 oss <<
"\n phiWindow Lower / Upper for calo object " 2100 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2101 <<
"\n phiWindowVeto Lower / Upper for calo object " 2102 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2103 <<
"\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;
2107 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
2111 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2129 std::ostringstream myCoutStream;
2130 caloCond.
print(myCoutStream);
2131 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2148 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2175 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2176 <<
"\n (in parseEnergySum) " 2177 <<
"\n condition = " << condition <<
"\n type = " <<
type 2178 <<
"\n name = " <<
name << std::endl;
2184 if (condEnergySum.
getType() == esConditionType::MissingEt) {
2187 }
else if (condEnergySum.
getType() == esConditionType::TotalEt) {
2190 }
else if (condEnergySum.
getType() == esConditionType::TotalEtEM) {
2193 }
else if (condEnergySum.
getType() == esConditionType::TotalHt) {
2196 }
else if (condEnergySum.
getType() == esConditionType::MissingHt) {
2199 }
else if (condEnergySum.
getType() == esConditionType::MissingEtHF) {
2202 }
else if (condEnergySum.
getType() == esConditionType::TowerCount) {
2205 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP0) {
2208 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM0) {
2211 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP1) {
2214 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM1) {
2217 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEt) {
2220 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHt) {
2223 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEtHF) {
2226 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHtHF) {
2229 }
else if (condEnergySum.
getType() == esConditionType::Centrality0) {
2232 }
else if (condEnergySum.
getType() == esConditionType::Centrality1) {
2235 }
else if (condEnergySum.
getType() == esConditionType::Centrality2) {
2238 }
else if (condEnergySum.
getType() == esConditionType::Centrality3) {
2241 }
else if (condEnergySum.
getType() == esConditionType::Centrality4) {
2244 }
else if (condEnergySum.
getType() == esConditionType::Centrality5) {
2247 }
else if (condEnergySum.
getType() == esConditionType::Centrality6) {
2250 }
else if (condEnergySum.
getType() == esConditionType::Centrality7) {
2254 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2266 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2280 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2283 relativeBx =
object.getBxOffset();
2286 int lowerThresholdInd = 0;
2287 int upperThresholdInd = -1;
2289 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2291 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2292 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2295 switch (
cut.getCutType()) {
2297 lowerThresholdInd =
cut.getMinimum().index;
2298 upperThresholdInd =
cut.getMaximum().index;
2301 case esCutType::Eta:
2306 phiWindow1Lower =
cut.getMinimum().index;
2307 phiWindow1Upper =
cut.getMaximum().index;
2308 }
else if (cntPhi == 1) {
2309 phiWindow2Lower =
cut.getMinimum().index;
2310 phiWindow2Upper =
cut.getMaximum().index;
2312 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2319 case esCutType::Count:
2320 lowerThresholdInd =
cut.getMinimum().index;
2321 upperThresholdInd = 0xffffff;
2331 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2332 objParameter[cnt].etHighThreshold = upperThresholdInd;
2333 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2334 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2335 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2336 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2339 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2340 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2341 << objParameter[cnt].etHighThreshold
2342 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2343 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2344 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2345 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2352 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2367 std::ostringstream myCoutStream;
2368 energySumCond.
print(myCoutStream);
2369 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2373 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2374 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2379 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2382 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2402 unsigned int chipNr,
2403 const bool corrFlag) {
2414 <<
"\n ******************************************\n (in parseEnergySumZdc)\n condition = " << condition
2415 <<
"\n type = " <<
type <<
"\n name = " <<
name;
2421 if (condEnergySumZdc.
getType() == esConditionType::ZDCPlus) {
2422 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCPlus " << std::endl;
2425 }
else if (condEnergySumZdc.
getType() == esConditionType::ZDCMinus) {
2426 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCMinus " << std::endl;
2430 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for ZDC energy-sum condition (" <<
type <<
")" << std::endl;
2438 std::vector<EnergySumZdcTemplate::ObjectParameter> objParameter(nrObj);
2441 int lowerThresholdInd = 0;
2442 int upperThresholdInd = -1;
2456 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2459 relativeBx =
object.getBxOffset();
2462 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2463 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2466 switch (
cut.getCutType()) {
2468 lowerThresholdInd =
cut.getMinimum().index;
2469 upperThresholdInd =
cut.getMaximum().index;
2472 case esCutType::Count:
2473 lowerThresholdInd =
cut.getMinimum().index;
2474 upperThresholdInd = 0xffffff;
2484 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2485 objParameter[cnt].etHighThreshold = upperThresholdInd;
2488 LogDebug(
"TriggerMenuParser") <<
"\n EnergySumZdc ET high threshold (hex) for energy sum object " << cnt
2489 <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2490 << objParameter[cnt].etHighThreshold <<
std::dec;
2496 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2511 std::ostringstream myCoutStream;
2512 energySumCond.
print(myCoutStream);
2513 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2517 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2518 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2522 (m_vecEnergySumZdcTemplate[chipNr]).
push_back(energySumCond);
2549 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2550 <<
"\n (in parseEnergySum) " 2551 <<
"\n condition = " << condition <<
"\n type = " <<
type 2552 <<
"\n name = " <<
name << std::endl;
2564 }
else if (corrESum->
getType() == esObjectType::ETMHF) {
2567 }
else if (corrESum->
getType() == esObjectType::TOWERCOUNT) {
2571 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2584 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2600 int lowerThresholdInd = 0;
2601 int upperThresholdInd = -1;
2603 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2605 const std::vector<L1TUtmCut>&
cuts = corrESum->
getCuts();
2606 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2609 switch (
cut.getCutType()) {
2611 lowerThresholdInd =
cut.getMinimum().index;
2612 upperThresholdInd =
cut.getMaximum().index;
2615 case esCutType::Eta:
2620 phiWindow1Lower =
cut.getMinimum().index;
2621 phiWindow1Upper =
cut.getMaximum().index;
2622 }
else if (cntPhi == 1) {
2623 phiWindow2Lower =
cut.getMinimum().index;
2624 phiWindow2Upper =
cut.getMaximum().index;
2626 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2640 objParameter[0].etLowThreshold = lowerThresholdInd;
2641 objParameter[0].etHighThreshold = upperThresholdInd;
2642 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2643 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2644 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2645 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2648 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2649 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2650 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2651 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2652 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2653 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2657 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2672 std::ostringstream myCoutStream;
2673 energySumCond.
print(myCoutStream);
2674 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2692 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2718 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2719 <<
"\n (in parseExternal) " 2720 <<
"\n condition = " << condition <<
"\n particle = " << particle
2721 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2730 unsigned int channelID = 0;
2736 if (
object.getType() == esObjectType::EXT) {
2737 relativeBx =
object.getBxOffset();
2738 channelID =
object.getExternalChannelId();
2746 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2758 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2761 if (!insertConditionIntoMap(externalCond, chipNr)) {
2762 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2766 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2791 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2792 <<
" (in parseCorrelation) " << std::endl
2793 <<
" condition = " << condition << std::endl
2794 <<
" particle = " << particle << std::endl
2795 <<
" type = " <<
type << std::endl
2796 <<
" name = " <<
name << std::endl;
2802 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2803 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2814 const int nrObj = 2;
2817 int intGEq[nrObj] = {-1, -1};
2818 std::vector<GlobalObject>
objType(nrObj);
2819 std::vector<GtConditionCategory> condCateg(nrObj);
2822 const bool corrFlag =
true;
2823 int corrIndexVal[nrObj] = {-1, -1};
2831 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2832 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2835 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2836 if (
cut.getData() ==
"ls")
2838 else if (
cut.getData() ==
"os")
2846 double minV =
cut.getMinimum().value;
2847 double maxV =
cut.getMaximum().value;
2854 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2855 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2856 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2860 cutType = cutType | 0x1;
2862 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2863 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2864 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2868 cutType = cutType | 0x2;
2870 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2871 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2872 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2876 cutType = cutType | 0x4;
2877 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2881 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2882 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2883 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2884 cutType = cutType | 0x20;
2886 (
cut.getCutType() == esCutType::MassDeltaR)) {
2887 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2888 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2889 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2894 if (corrCond.
getType() == esConditionType::TransverseMass) {
2895 cutType = cutType | 0x10;
2896 }
else if (corrCond.
getType() == esConditionType::InvariantMassDeltaR) {
2897 cutType = cutType | 0x80;
2899 cutType = cutType | 0x8;
2901 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2902 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2903 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2904 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2908 cutType = cutType | 0x40;
2917 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 2918 <<
" corrFlag " << corrFlag << std::endl;
2925 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2926 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2927 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2928 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2965 parseMuonCorr(&
object, chipNr);
2966 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2969 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2973 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
2976 parseCaloCorr(&
object, chipNr);
2977 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2980 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2981 switch (
object.getType()) {
2982 case esObjectType::Egamma: {
2996 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2997 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2999 parseEnergySumCorr(&
object, chipNr);
3000 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3003 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3004 switch (
object.getType()) {
3011 case esObjectType::ETMHF: {
3014 case esObjectType::TOWERCOUNT: {
3023 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3024 <<
" for the correlation condition " <<
name << std::endl;
3033 if (intGEq[0] != intGEq[1]) {
3034 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3035 <<
" for the correlation condition " <<
name << std::endl;
3039 gEq = (intGEq[0] != 0);
3057 std::ostringstream myCoutStream;
3058 correlationCond.
print(myCoutStream);
3059 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3065 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
3091 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3092 <<
" (in parseCorrelationThreeBody) " << std::endl
3093 <<
" condition = " << condition << std::endl
3094 <<
" particle = " << particle << std::endl
3095 <<
" type = " <<
type << std::endl
3096 <<
" name = " <<
name << std::endl;
3102 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
3103 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3111 const int nrObj = 3;
3114 std::vector<GlobalObject>
objType(nrObj);
3115 std::vector<GtConditionCategory> condCateg(nrObj);
3118 const bool corrFlag =
true;
3119 int corrIndexVal[nrObj] = {-1, -1, -1};
3129 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3130 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
3133 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3134 if (
cut.getData() ==
"ls")
3136 else if (
cut.getData() ==
"os")
3145 double minV =
cut.getMinimum().value;
3146 double maxV =
cut.getMaximum().value;
3152 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3153 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3154 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3158 cutType = cutType | 0x8;
3159 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3163 cutType = cutType | 0x80;
3171 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3172 <<
" corrFlag " << corrFlag << std::endl;
3177 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3179 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3180 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3181 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3186 parseMuonCorr(&
object, chipNr);
3187 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
3194 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3195 <<
" for the correlation condition " <<
name 3196 <<
": no three muons in the event!" << std::endl;
3216 std::ostringstream myCoutStream;
3217 correlationThreeBodyCond.
print(myCoutStream);
3218 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3224 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3250 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3251 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3252 <<
" condition = " << condition << std::endl
3253 <<
" particle = " << particle << std::endl
3254 <<
" type = " <<
type << std::endl
3255 <<
" name = " <<
name << std::endl;
3261 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3262 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3273 const int nrObj = 3;
3276 int intGEq[nrObj] = {-1, -1, -1};
3277 std::vector<GlobalObject>
objType(nrObj);
3278 std::vector<GtConditionCategory> condCateg(nrObj);
3281 const bool corrFlag =
true;
3282 int corrIndexVal[nrObj] = {-1, -1, -1};
3290 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3291 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3294 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3295 if (
cut.getData() ==
"ls")
3297 else if (
cut.getData() ==
"os")
3305 double minV =
cut.getMinimum().value;
3306 double maxV =
cut.getMaximum().value;
3317 cutType = cutType | 0x1;
3323 cutType = cutType | 0x2;
3329 cutType = cutType | 0x4;
3335 cutType = cutType | 0x8;
3336 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3340 cutType = cutType | 0x80;
3342 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3347 cutType = cutType | 0x10;
3348 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3353 cutType = cutType | 0x20;
3354 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3359 cutType = cutType | 0x40;
3369 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3370 << corrFlag << std::endl;
3377 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3378 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3379 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3380 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3381 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3418 parseMuonCorr(&
object, chipNr);
3419 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3422 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3426 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3429 parseCaloCorr(&
object, chipNr);
3430 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3433 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3434 switch (
object.getType()) {
3435 case esObjectType::Egamma: {
3449 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3450 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3452 parseEnergySumCorr(&
object, chipNr);
3453 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3456 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3457 switch (
object.getType()) {
3464 case esObjectType::ETMHF: {
3467 case esObjectType::TOWERCOUNT: {
3476 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3477 <<
" for the correlation condition " <<
name << std::endl;
3486 if (intGEq[0] != intGEq[1]) {
3487 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3488 <<
" for the correlation condition " <<
name << std::endl;
3492 gEq = (intGEq[0] != 0);
3512 std::ostringstream myCoutStream;
3513 correlationWORCond.
print(myCoutStream);
3514 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3520 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3542 if (algAlias.empty()) {
3544 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3545 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3549 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3550 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3557 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3558 <<
" Chip number: " << chipNr << std::endl;
3564 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3579 std::ostringstream myCoutStream;
3580 alg.
print(myCoutStream);
3581 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3585 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
void print(std::ostream &myCout) const override
print the 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
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
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
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
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 &)