48 #include "tmEventSetup/tmEventSetup.hh" 49 #include "tmEventSetup/esTypes.hh" 57 #include "tmGrammar/Algorithm.hh" 63 : m_triggerMenuInterface(
"NULL"),
64 m_triggerMenuName(
"NULL"),
65 m_triggerMenuImplementation(0x0),
79 m_numberConditionChips = numberConditionChipsValue;
84 m_pinsOnConditionChip = pinsOnConditionChipValue;
90 m_orderConditionChip = orderConditionChipValue;
95 m_numberPhysTriggers = numberPhysTriggersValue;
103 m_triggerMenuInterface = menuInterface;
112 m_triggerMenuImplementation = menuImplementation;
120 m_vecMuonTemplate = vecMuonTempl;
124 const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTempl) {
125 m_vecMuonShowerTemplate = vecMuonShowerTempl;
129 m_vecCaloTemplate = vecCaloTempl;
133 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
134 m_vecEnergySumTemplate = vecEnergySumTempl;
138 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
139 m_vecExternalTemplate = vecExternalTempl;
143 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
144 m_vecCorrelationTemplate = vecCorrelationTempl;
148 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
149 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
153 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
154 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
160 m_corMuonTemplate = corMuonTempl;
164 m_corCaloTemplate = corCaloTempl;
168 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
169 m_corEnergySumTemplate = corEnergySumTempl;
180 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
182 std::map<std::string, unsigned int> extBitMap;
185 for (
const auto& cit : condMap) {
187 if (condition.
getType() == esConditionType::Externals) {
190 for (
const auto&
object :
objects) {
191 if (
object.getType() == esObjectType::EXT) {
192 unsigned int channelID =
object.getExternalChannelId();
195 if (extBitMap.count(
name) == 0)
209 m_conditionMap.resize(m_numberConditionChips);
211 m_vecMuonTemplate.resize(m_numberConditionChips);
212 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
213 m_vecCaloTemplate.resize(m_numberConditionChips);
214 m_vecEnergySumTemplate.resize(m_numberConditionChips);
215 m_vecExternalTemplate.resize(m_numberConditionChips);
217 m_vecCorrelationTemplate.resize(m_numberConditionChips);
218 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
219 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
220 m_corMuonTemplate.resize(m_numberConditionChips);
221 m_corCaloTemplate.resize(m_numberConditionChips);
222 m_corEnergySumTemplate.resize(m_numberConditionChips);
228 m_triggerMenuDescription = utmMenu->
getComment();
230 m_triggerMenuImplementation = (getMmHashN(utmMenu->
getFirmwareUuid()) & 0xFFFFFFFF);
231 m_triggerMenuName = utmMenu->
getName();
232 m_triggerMenuInterface = utmMenu->
getVersion();
233 m_triggerMenuUUID = (getMmHashN(utmMenu->
getName()) & 0xFFFFFFFF);
235 const std::map<std::string, L1TUtmAlgorithm>& algoMap = utmMenu->
getAlgorithmMap();
236 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
238 const std::map<std::string, tmeventsetup::esScale> scaleMap(std::begin(utmMenu->
getScaleMap()),
243 parseScales(scaleMap);
246 for (
const auto& cit : algoMap) {
254 parseAlgorithm(
algo, chipNr);
257 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
258 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
266 if ((m_conditionMap[chipNr]).
count(condition.
getName()) == 0) {
268 if (condition.
getType() == esConditionType::SingleEgamma ||
269 condition.
getType() == esConditionType::DoubleEgamma ||
270 condition.
getType() == esConditionType::TripleEgamma ||
271 condition.
getType() == esConditionType::QuadEgamma || condition.
getType() == esConditionType::SingleTau ||
272 condition.
getType() == esConditionType::DoubleTau || condition.
getType() == esConditionType::TripleTau ||
273 condition.
getType() == esConditionType::QuadTau || condition.
getType() == esConditionType::SingleJet ||
274 condition.
getType() == esConditionType::DoubleJet || condition.
getType() == esConditionType::TripleJet ||
275 condition.
getType() == esConditionType::QuadJet) {
276 parseCalo(condition, chipNr,
false);
279 }
else if (condition.
getType() == esConditionType::TotalEt ||
280 condition.
getType() == esConditionType::TotalEtEM ||
281 condition.
getType() == esConditionType::TotalHt ||
282 condition.
getType() == esConditionType::MissingEt ||
283 condition.
getType() == esConditionType::MissingHt ||
284 condition.
getType() == esConditionType::MissingEtHF ||
285 condition.
getType() == esConditionType::TowerCount ||
286 condition.
getType() == esConditionType::MinBiasHFP0 ||
287 condition.
getType() == esConditionType::MinBiasHFM0 ||
288 condition.
getType() == esConditionType::MinBiasHFP1 ||
289 condition.
getType() == esConditionType::MinBiasHFM1 ||
290 condition.
getType() == esConditionType::AsymmetryEt ||
291 condition.
getType() == esConditionType::AsymmetryHt ||
292 condition.
getType() == esConditionType::AsymmetryEtHF ||
293 condition.
getType() == esConditionType::AsymmetryHtHF ||
294 condition.
getType() == esConditionType::Centrality0 ||
295 condition.
getType() == esConditionType::Centrality1 ||
296 condition.
getType() == esConditionType::Centrality2 ||
297 condition.
getType() == esConditionType::Centrality3 ||
298 condition.
getType() == esConditionType::Centrality4 ||
299 condition.
getType() == esConditionType::Centrality5 ||
300 condition.
getType() == esConditionType::Centrality6 ||
301 condition.
getType() == esConditionType::Centrality7) {
302 parseEnergySum(condition, chipNr,
false);
306 condition.
getType() == esConditionType::DoubleMuon ||
307 condition.
getType() == esConditionType::TripleMuon ||
308 condition.
getType() == esConditionType::QuadMuon) {
309 parseMuon(condition, chipNr,
false);
311 }
else if (condition.
getType() == esConditionType::MuonShower0 ||
312 condition.
getType() == esConditionType::MuonShower1 ||
313 condition.
getType() == esConditionType::MuonShower2 ||
314 condition.
getType() == esConditionType::MuonShowerOutOfTime0 ||
315 condition.
getType() == esConditionType::MuonShowerOutOfTime1) {
316 parseMuonShower(condition, chipNr,
false);
319 }
else if (condition.
getType() == esConditionType::MuonMuonCorrelation ||
320 condition.
getType() == esConditionType::MuonEsumCorrelation ||
321 condition.
getType() == esConditionType::CaloMuonCorrelation ||
322 condition.
getType() == esConditionType::CaloCaloCorrelation ||
323 condition.
getType() == esConditionType::CaloEsumCorrelation ||
324 condition.
getType() == esConditionType::InvariantMass ||
325 condition.
getType() == esConditionType::InvariantMassDeltaR ||
326 condition.
getType() == esConditionType::TransverseMass ||
327 condition.
getType() == esConditionType::InvariantMassUpt) {
328 parseCorrelation(condition, chipNr);
331 }
else if (condition.
getType() == esConditionType::InvariantMass3) {
332 parseCorrelationThreeBody(condition, chipNr);
335 }
else if (condition.
getType() == esConditionType::Externals) {
336 parseExternal(condition, chipNr);
339 }
else if (condition.
getType() == esConditionType::CaloCaloCorrelationOvRm ||
340 condition.
getType() == esConditionType::InvariantMassOvRm ||
341 condition.
getType() == esConditionType::TransverseMassOvRm ||
342 condition.
getType() == esConditionType::DoubleJetOvRm ||
343 condition.
getType() == esConditionType::DoubleTauOvRm) {
344 parseCorrelationWithOverlapRemoval(condition, chipNr);
346 }
else if (condition.
getType() == esConditionType::SingleEgammaOvRm ||
347 condition.
getType() == esConditionType::DoubleEgammaOvRm ||
348 condition.
getType() == esConditionType::TripleEgammaOvRm ||
349 condition.
getType() == esConditionType::QuadEgammaOvRm ||
350 condition.
getType() == esConditionType::SingleTauOvRm ||
351 condition.
getType() == esConditionType::TripleTauOvRm ||
352 condition.
getType() == esConditionType::QuadTauOvRm ||
353 condition.
getType() == esConditionType::SingleJetOvRm ||
354 condition.
getType() == esConditionType::TripleJetOvRm ||
355 condition.
getType() == esConditionType::QuadJetOvRm) {
357 <<
"\n SingleEgammaOvRm" 358 <<
"\n DoubleEgammaOvRm" 359 <<
"\n TripleEgammaOvRm" 360 <<
"\n QuadEgammaOvRm" 361 <<
"\n SingleTauOvRm" 362 <<
"\n TripleTauOvRm" 364 <<
"\n SingleJetOvRm" 365 <<
"\n TripleJetOvRm" 367 <<
"\n The above conditions types OvRm are not implemented yet in the " 368 "parser. Please remove alogrithms that " 369 "use this type of condtion from L1T Menu!" 385 m_triggerMenuInterfaceAuthor =
val;
389 m_triggerMenuInterfaceDescription =
val;
407 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
411 itCondOnChip->clear();
415 m_algorithmMap.clear();
422 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 426 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
427 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
431 (m_conditionMap[chipNr])[cName] = &
cond;
432 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
445 if (m_algorithmMap.count(algName) != 0) {
446 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
447 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
451 if (m_algorithmAliasMap.count(algAlias) != 0) {
452 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
453 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
460 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 461 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
466 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
467 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
468 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
474 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
476 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
477 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 478 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
484 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
486 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
487 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 488 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
493 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
494 int iPin = (itAlgo->second)
495 .algoOutputPin(static_cast<int>(m_numberConditionChips),
496 static_cast<int>(m_pinsOnConditionChip),
497 m_orderConditionChip);
499 int iChip = (itAlgo->second)
500 .algoChipNumber(static_cast<int>(m_numberConditionChips),
501 static_cast<int>(m_pinsOnConditionChip),
502 m_orderConditionChip);
504 if ((outputPin == iPin) && (chipNr == iChip)) {
505 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
506 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 513 m_algorithmMap[algName] = alg;
514 m_algorithmAliasMap[algAlias] = alg;
523 template <
typename T>
525 std::stringstream
ss;
530 std::stringstream
ss;
560 for (std::map<std::string, tmeventsetup::esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end();
562 const tmeventsetup::esScale&
scale = cit->second;
566 scaleParam = &muScales;
567 else if (
scale.getObjectType() == esObjectType::Egamma)
568 scaleParam = &egScales;
570 scaleParam = &tauScales;
572 scaleParam = &jetScales;
574 scaleParam = &ettScales;
575 else if (
scale.getObjectType() == esObjectType::ETTEM)
576 scaleParam = &ettEmScales;
578 scaleParam = &etmScales;
579 else if (
scale.getObjectType() == esObjectType::ETMHF)
580 scaleParam = &etmHfScales;
582 scaleParam = &httScales;
584 scaleParam = &htmScales;
586 scaleParam =
nullptr;
588 if (scaleParam !=
nullptr) {
589 switch (
scale.getScaleType()) {
590 case esScaleType::EtScale: {
596 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
597 for (
unsigned int i = 0;
i < binsV.size();
i++) {
598 const tmeventsetup::esBin&
bin = binsV.at(
i);
599 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
600 scaleParam->
etBins.push_back(binLimits);
607 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
612 scale.getObjectType() == esObjectType::ETTEM) {
620 case esScaleType::UnconstrainedPtScale: {
626 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
627 for (
unsigned int i = 0;
i < binsV.size();
i++) {
628 const tmeventsetup::esBin&
bin = binsV.at(
i);
629 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
630 scaleParam->
uptBins.push_back(binLimits);
633 case esScaleType::EtaScale: {
639 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
641 for (
unsigned int i = 0;
i < binsV.size();
i++) {
642 const tmeventsetup::esBin&
bin = binsV.at(
i);
643 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
644 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
647 case esScaleType::PhiScale: {
653 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
655 for (
unsigned int i = 0;
i < binsV.size();
i++) {
656 const tmeventsetup::esBin&
bin = binsV.at(
i);
657 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
658 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
669 m_gtScales.setMuonScales(muScales);
670 m_gtScales.setEGScales(egScales);
671 m_gtScales.setTauScales(tauScales);
672 m_gtScales.setJetScales(jetScales);
673 m_gtScales.setETTScales(ettScales);
674 m_gtScales.setETTEmScales(ettEmScales);
675 m_gtScales.setETMScales(etmScales);
676 m_gtScales.setETMHfScales(etmHfScales);
677 m_gtScales.setHTTScales(httScales);
678 m_gtScales.setHTMScales(htmScales);
681 bool hasPrecision =
false;
682 std::map<std::string, unsigned int> precisions;
683 getPrecisions(precisions, scaleMap);
684 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
691 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
692 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
693 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
697 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
698 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
699 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
700 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
701 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
702 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
706 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
707 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
708 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
709 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
710 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
711 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
712 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
713 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
717 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
718 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
719 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
720 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
721 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
722 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
723 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
727 parseDeltaEta_Cosh_LUTS(
728 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
729 parseDeltaEta_Cosh_LUTS(
730 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
731 parseDeltaEta_Cosh_LUTS(
732 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
733 parseDeltaEta_Cosh_LUTS(
734 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
736 parseDeltaEta_Cosh_LUTS(
737 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
738 parseDeltaEta_Cosh_LUTS(
739 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
740 parseDeltaEta_Cosh_LUTS(
741 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
743 parseDeltaEta_Cosh_LUTS(
744 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
745 parseDeltaEta_Cosh_LUTS(
746 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
748 parseDeltaEta_Cosh_LUTS(
749 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
753 parseDeltaPhi_Cos_LUTS(
754 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
755 parseDeltaPhi_Cos_LUTS(
756 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
757 parseDeltaPhi_Cos_LUTS(
758 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
759 parseDeltaPhi_Cos_LUTS(
760 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
761 parseDeltaPhi_Cos_LUTS(
762 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
763 parseDeltaPhi_Cos_LUTS(
764 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
765 parseDeltaPhi_Cos_LUTS(
766 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
768 parseDeltaPhi_Cos_LUTS(
769 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
770 parseDeltaPhi_Cos_LUTS(
771 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
772 parseDeltaPhi_Cos_LUTS(
773 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
774 parseDeltaPhi_Cos_LUTS(
775 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
776 parseDeltaPhi_Cos_LUTS(
777 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
778 parseDeltaPhi_Cos_LUTS(
779 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
781 parseDeltaPhi_Cos_LUTS(
782 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
783 parseDeltaPhi_Cos_LUTS(
784 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
785 parseDeltaPhi_Cos_LUTS(
786 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
787 parseDeltaPhi_Cos_LUTS(
788 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
789 parseDeltaPhi_Cos_LUTS(
790 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
792 parseDeltaPhi_Cos_LUTS(
793 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
794 parseDeltaPhi_Cos_LUTS(
795 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
796 parseDeltaPhi_Cos_LUTS(
797 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
798 parseDeltaPhi_Cos_LUTS(
799 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
801 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
802 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
803 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
804 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
806 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
807 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
808 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
809 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
831 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
834 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
835 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
837 std::vector<long long> lut_cal_2_mu_eta;
838 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
843 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
858 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
861 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
862 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
864 std::vector<long long> lut_cal_2_mu_phi;
865 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
870 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
884 if (scaleMap.find(scLabel1) == scaleMap.end())
887 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
889 std::vector<long long> lut_pt;
890 getLut(lut_pt, scale1, prec);
892 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
907 if (scaleMap.find(scLabel1) == scaleMap.end())
910 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
912 std::vector<long long> lut_pt;
913 getLut(lut_pt, scale1, prec);
915 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
922 unsigned int prec2) {
932 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
935 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
936 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
937 std::vector<double> val_delta_eta;
938 std::vector<long long> lut_delta_eta;
939 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
940 setLut(lut_delta_eta, val_delta_eta, prec1);
944 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
947 std::vector<long long> lut_cosh;
948 applyCosh(val_delta_eta,
n);
949 setLut(lut_cosh, val_delta_eta, prec2);
950 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
957 unsigned int prec2) {
967 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
970 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
971 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
972 std::vector<double> val_delta_phi;
973 std::vector<long long> lut_delta_phi;
974 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
975 setLut(lut_delta_phi, val_delta_phi, prec1);
979 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
982 std::vector<long long> lut_cos;
983 applyCos(val_delta_phi,
n);
984 setLut(lut_cos, val_delta_phi, prec2);
985 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
998 if (scaleMap.find(scLabel) == scaleMap.end())
1003 const tmeventsetup::esScale*
scale = &scaleMap.find(scLabel)->second;
1008 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1012 for (
size_t ii = 0;
ii <
n;
ii++) {
1017 std::vector<long long> lut;
1020 setLut(lut,
array, prec);
1021 m_gtScales.setLUT_Sin(lutName, lut, prec);
1024 setLut(lut,
array, prec);
1025 m_gtScales.setLUT_Cos(lutName, lut, prec);
1055 }
else if (condMu.
getType() == esConditionType::DoubleMuon) {
1059 }
else if (condMu.
getType() == esConditionType::TripleMuon) {
1063 }
else if (condMu.
getType() == esConditionType::QuadMuon) {
1068 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1073 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1074 <<
"\nCan not determine number of trigger objects. " << std::endl;
1078 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1080 <<
"\n condition = " << condition <<
"\n particle = " << particle
1081 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1086 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1092 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1093 tmpValues.reserve(nrObj);
1095 if (
int(condMu.
getObjects().size()) != nrObj) {
1096 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1097 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1102 unsigned int chargeCorrelation = 1;
1103 const std::vector<L1TUtmCut>&
cuts = condMu.
getCuts();
1104 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1106 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1107 if (
cut.getData() ==
"ls")
1108 chargeCorrelation = 2;
1109 else if (
cut.getData() ==
"os")
1110 chargeCorrelation = 4;
1112 chargeCorrelation = 1;
1129 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1132 relativeBx =
object.getBxOffset();
1135 int upperUnconstrainedPtInd = -1;
1136 int lowerUnconstrainedPtInd = 0;
1137 int upperImpactParameterInd = -1;
1138 int lowerImpactParameterInd = 0;
1139 int upperThresholdInd = -1;
1140 int lowerThresholdInd = 0;
1141 int upperIndexInd = -1;
1142 int lowerIndexInd = 0;
1144 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1145 int isolationLUT = 0xF;
1146 int impactParameterLUT = 0xF;
1148 int qualityLUT = 0xFFFF;
1150 std::vector<MuonTemplate::Window> etaWindows;
1151 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1153 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1154 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1157 switch (
cut.getCutType()) {
1158 case esCutType::UnconstrainedPt:
1159 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1160 upperUnconstrainedPtInd =
cut.getMaximum().index;
1163 case esCutType::ImpactParameter:
1164 lowerImpactParameterInd =
cut.getMinimum().index;
1165 upperImpactParameterInd =
cut.getMaximum().index;
1166 impactParameterLUT = l1tstr2int(
cut.getData());
1170 lowerThresholdInd =
cut.getMinimum().index;
1171 upperThresholdInd =
cut.getMaximum().index;
1174 case esCutType::Slice:
1175 lowerIndexInd =
int(
cut.getMinimum().value);
1176 upperIndexInd =
int(
cut.getMaximum().value);
1179 case esCutType::Eta: {
1180 if (etaWindows.size() < 5) {
1181 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1184 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1191 phiWindow1Lower =
cut.getMinimum().index;
1192 phiWindow1Upper =
cut.getMaximum().index;
1193 }
else if (cntPhi == 1) {
1194 phiWindow2Lower =
cut.getMinimum().index;
1195 phiWindow2Upper =
cut.getMaximum().index;
1198 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1206 if (
cut.getData() ==
"positive")
1208 else if (
cut.getData() ==
"negative")
1215 qualityLUT = l1tstr2int(
cut.getData());
1218 case esCutType::Isolation: {
1219 isolationLUT = l1tstr2int(
cut.getData());
1223 case esCutType::Index: {
1224 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1234 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1235 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1236 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1237 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1238 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1240 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1241 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1243 objParameter[cnt].indexHigh = upperIndexInd;
1244 objParameter[cnt].indexLow = lowerIndexInd;
1246 objParameter[cnt].etaWindows = etaWindows;
1248 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1249 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1250 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1251 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1254 objParameter[cnt].enableMip =
false;
1255 objParameter[cnt].enableIso =
false;
1256 objParameter[cnt].requestIso =
false;
1258 objParameter[cnt].charge =
charge;
1259 objParameter[cnt].qualityLUT = qualityLUT;
1260 objParameter[cnt].isolationLUT = isolationLUT;
1262 objParameter[cnt].tfMuonIndexWindows = tfMuonIndexWindows;
1282 std::ostringstream myCoutStream;
1283 muonCond.
print(myCoutStream);
1284 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1288 if (!insertConditionIntoMap(muonCond, chipNr)) {
1289 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1292 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1294 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1296 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1297 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1319 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1320 <<
"\nCan not determine number of trigger objects. " << std::endl;
1324 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1326 <<
"\n condition = " << condition <<
"\n particle = " << particle
1327 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1332 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1338 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1339 tmpValues.reserve(nrObj);
1344 unsigned int chargeCorrelation = 0;
1345 if (str_chargeCorrelation ==
"ig")
1346 chargeCorrelation = 1;
1347 else if (str_chargeCorrelation ==
"ls")
1348 chargeCorrelation = 2;
1349 else if (str_chargeCorrelation ==
"os")
1350 chargeCorrelation = 4;
1366 int upperUnconstrainedPtInd = -1;
1367 int lowerUnconstrainedPtInd = 0;
1368 int upperImpactParameterInd = -1;
1369 int lowerImpactParameterInd = 0;
1370 int impactParameterLUT = 0xF;
1371 int upperThresholdInd = -1;
1372 int lowerThresholdInd = 0;
1373 int upperIndexInd = -1;
1374 int lowerIndexInd = 0;
1376 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1377 int isolationLUT = 0xF;
1379 int qualityLUT = 0xFFFF;
1381 std::vector<MuonTemplate::Window> etaWindows;
1382 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1384 const std::vector<L1TUtmCut>&
cuts = corrMu->
getCuts();
1385 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1388 switch (
cut.getCutType()) {
1389 case esCutType::UnconstrainedPt:
1390 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1391 upperUnconstrainedPtInd =
cut.getMaximum().index;
1394 case esCutType::ImpactParameter:
1395 lowerImpactParameterInd =
cut.getMinimum().index;
1396 upperImpactParameterInd =
cut.getMaximum().index;
1397 impactParameterLUT = l1tstr2int(
cut.getData());
1401 lowerThresholdInd =
cut.getMinimum().index;
1402 upperThresholdInd =
cut.getMaximum().index;
1405 case esCutType::Slice:
1406 lowerIndexInd =
int(
cut.getMinimum().value);
1407 upperIndexInd =
int(
cut.getMaximum().value);
1410 case esCutType::Eta: {
1411 if (etaWindows.size() < 5) {
1412 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1415 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1422 phiWindow1Lower =
cut.getMinimum().index;
1423 phiWindow1Upper =
cut.getMaximum().index;
1424 }
else if (cntPhi == 1) {
1425 phiWindow2Lower =
cut.getMinimum().index;
1426 phiWindow2Upper =
cut.getMaximum().index;
1429 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1437 if (
cut.getData() ==
"positive")
1439 else if (
cut.getData() ==
"negative")
1446 qualityLUT = l1tstr2int(
cut.getData());
1449 case esCutType::Isolation: {
1450 isolationLUT = l1tstr2int(
cut.getData());
1454 case esCutType::Index: {
1455 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1465 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1466 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1467 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1468 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1469 objParameter[0].impactParameterLUT = impactParameterLUT;
1471 objParameter[0].ptHighThreshold = upperThresholdInd;
1472 objParameter[0].ptLowThreshold = lowerThresholdInd;
1474 objParameter[0].indexHigh = upperIndexInd;
1475 objParameter[0].indexLow = lowerIndexInd;
1477 objParameter[0].etaWindows = etaWindows;
1479 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1480 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1481 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1482 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1485 objParameter[0].enableMip =
false;
1486 objParameter[0].enableIso =
false;
1487 objParameter[0].requestIso =
false;
1489 objParameter[0].charge =
charge;
1490 objParameter[0].qualityLUT = qualityLUT;
1491 objParameter[0].isolationLUT = isolationLUT;
1493 objParameter[0].tfMuonIndexWindows = tfMuonIndexWindows;
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 phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1762 int isolationLUT = 0xF;
1763 int qualityLUT = 0xF;
1764 int displacedLUT = 0x0;
1768 std::vector<CaloTemplate::Window> etaWindows;
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: {
1784 if (etaWindows.size() < 5) {
1785 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1788 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1795 phiWindow1Lower =
cut.getMinimum().index;
1796 phiWindow1Upper =
cut.getMaximum().index;
1797 }
else if (cntPhi == 1) {
1798 phiWindow2Lower =
cut.getMinimum().index;
1799 phiWindow2Upper =
cut.getMaximum().index;
1802 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1810 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1815 qualityLUT = l1tstr2int(
cut.getData());
1818 case esCutType::Displaced: {
1819 displacedLUT = l1tstr2int(
cut.getData());
1822 case esCutType::Isolation: {
1823 isolationLUT = l1tstr2int(
cut.getData());
1833 objParameter[cnt].etHighThreshold = upperThresholdInd;
1834 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1835 objParameter[cnt].indexHigh = upperIndexInd;
1836 objParameter[cnt].indexLow = lowerIndexInd;
1837 objParameter[cnt].etaWindows = etaWindows;
1838 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1839 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1840 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1841 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1842 objParameter[cnt].isolationLUT = isolationLUT;
1843 objParameter[cnt].qualityLUT = qualityLUT;
1844 objParameter[cnt].displacedLUT = displacedLUT;
1848 std::ostringstream oss;
1849 oss <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " << std::hex
1850 << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold;
1851 for (
const auto&
window : objParameter[cnt].etaWindows) {
1852 oss <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" <<
window.lower <<
" / 0x" 1855 oss <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" << objParameter[cnt].phiWindow1Lower
1856 <<
" / 0x" << objParameter[cnt].phiWindow1Upper <<
"\n phiWindowVeto Lower / Upper for calo object " 1857 << cnt <<
" = 0x" << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1858 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].isolationLUT
1859 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].qualityLUT
1860 <<
"\n LLP DISP LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].displacedLUT;
1861 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
1868 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1886 std::ostringstream myCoutStream;
1887 caloCond.
print(myCoutStream);
1888 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1892 if (!insertConditionIntoMap(caloCond, chipNr)) {
1893 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1898 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1900 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1930 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1931 <<
"\n (in parseCalo) " 1932 <<
"\n condition = " << condition <<
"\n particle = " << particle
1933 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1942 if (corrCalo->
getType() == esObjectType::Egamma) {
1945 caloObjType =
gtJet;
1947 caloObjType =
gtTau;
1949 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1956 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1957 <<
"\nCan not determine number of trigger objects. " << std::endl;
1964 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1970 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1971 tmpValues.reserve(nrObj);
1983 int upperThresholdInd = -1;
1984 int lowerThresholdInd = 0;
1985 int upperIndexInd = -1;
1986 int lowerIndexInd = 0;
1988 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1989 int isolationLUT = 0xF;
1990 int qualityLUT = 0xF;
1991 int displacedLUT = 0x0;
1995 std::vector<CaloTemplate::Window> etaWindows;
1997 const std::vector<L1TUtmCut>&
cuts = corrCalo->
getCuts();
1998 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2001 switch (
cut.getCutType()) {
2003 lowerThresholdInd =
cut.getMinimum().index;
2004 upperThresholdInd =
cut.getMaximum().index;
2006 case esCutType::Slice:
2007 lowerIndexInd =
int(
cut.getMinimum().value);
2008 upperIndexInd =
int(
cut.getMaximum().value);
2010 case esCutType::Eta: {
2011 if (etaWindows.size() < 5) {
2012 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
2015 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2022 phiWindow1Lower =
cut.getMinimum().index;
2023 phiWindow1Upper =
cut.getMaximum().index;
2024 }
else if (cntPhi == 1) {
2025 phiWindow2Lower =
cut.getMinimum().index;
2026 phiWindow2Upper =
cut.getMaximum().index;
2029 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2037 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2042 qualityLUT = l1tstr2int(
cut.getData());
2045 case esCutType::Displaced: {
2046 displacedLUT = l1tstr2int(
cut.getData());
2049 case esCutType::Isolation: {
2050 isolationLUT = l1tstr2int(
cut.getData());
2060 objParameter[0].etLowThreshold = lowerThresholdInd;
2061 objParameter[0].etHighThreshold = upperThresholdInd;
2062 objParameter[0].indexHigh = upperIndexInd;
2063 objParameter[0].indexLow = lowerIndexInd;
2064 objParameter[0].etaWindows = etaWindows;
2065 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2066 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2067 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2068 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2069 objParameter[0].isolationLUT = isolationLUT;
2070 objParameter[0].qualityLUT = qualityLUT;
2071 objParameter[0].displacedLUT = displacedLUT;
2075 std::ostringstream oss;
2076 oss <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2077 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold;
2078 for (
const auto&
window : objParameter[0].etaWindows) {
2079 oss <<
"\n etaWindow Lower / Upper for calo object " 2082 oss <<
"\n phiWindow Lower / Upper for calo object " 2083 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2084 <<
"\n phiWindowVeto Lower / Upper for calo object " 2085 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2086 <<
"\n Isolation LUT for calo object " 2087 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2088 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2089 <<
" = 0x" << objParameter[0].displacedLUT;
2090 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
2094 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2112 std::ostringstream myCoutStream;
2113 caloCond.
print(myCoutStream);
2114 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2131 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2158 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2159 <<
"\n (in parseEnergySum) " 2160 <<
"\n condition = " << condition <<
"\n type = " <<
type 2161 <<
"\n name = " <<
name << std::endl;
2167 if (condEnergySum.
getType() == esConditionType::MissingEt) {
2170 }
else if (condEnergySum.
getType() == esConditionType::TotalEt) {
2173 }
else if (condEnergySum.
getType() == esConditionType::TotalEtEM) {
2176 }
else if (condEnergySum.
getType() == esConditionType::TotalHt) {
2179 }
else if (condEnergySum.
getType() == esConditionType::MissingHt) {
2182 }
else if (condEnergySum.
getType() == esConditionType::MissingEtHF) {
2185 }
else if (condEnergySum.
getType() == esConditionType::TowerCount) {
2188 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP0) {
2191 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM0) {
2194 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP1) {
2197 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM1) {
2200 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEt) {
2203 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHt) {
2206 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEtHF) {
2209 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHtHF) {
2212 }
else if (condEnergySum.
getType() == esConditionType::Centrality0) {
2215 }
else if (condEnergySum.
getType() == esConditionType::Centrality1) {
2218 }
else if (condEnergySum.
getType() == esConditionType::Centrality2) {
2221 }
else if (condEnergySum.
getType() == esConditionType::Centrality3) {
2224 }
else if (condEnergySum.
getType() == esConditionType::Centrality4) {
2227 }
else if (condEnergySum.
getType() == esConditionType::Centrality5) {
2230 }
else if (condEnergySum.
getType() == esConditionType::Centrality6) {
2233 }
else if (condEnergySum.
getType() == esConditionType::Centrality7) {
2237 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2249 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2263 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2266 relativeBx =
object.getBxOffset();
2269 int lowerThresholdInd = 0;
2270 int upperThresholdInd = -1;
2272 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2274 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2275 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2278 switch (
cut.getCutType()) {
2280 lowerThresholdInd =
cut.getMinimum().index;
2281 upperThresholdInd =
cut.getMaximum().index;
2284 case esCutType::Eta:
2289 phiWindow1Lower =
cut.getMinimum().index;
2290 phiWindow1Upper =
cut.getMaximum().index;
2291 }
else if (cntPhi == 1) {
2292 phiWindow2Lower =
cut.getMinimum().index;
2293 phiWindow2Upper =
cut.getMaximum().index;
2295 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2302 case esCutType::Count:
2303 lowerThresholdInd =
cut.getMinimum().index;
2304 upperThresholdInd = 0xffffff;
2314 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2315 objParameter[cnt].etHighThreshold = upperThresholdInd;
2316 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2317 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2318 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2319 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2322 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2323 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2324 << objParameter[cnt].etHighThreshold
2325 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2326 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2327 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2328 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2335 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2350 std::ostringstream myCoutStream;
2351 energySumCond.
print(myCoutStream);
2352 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2356 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2357 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2362 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2365 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2394 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2395 <<
"\n (in parseEnergySum) " 2396 <<
"\n condition = " << condition <<
"\n type = " <<
type 2397 <<
"\n name = " <<
name << std::endl;
2409 }
else if (corrESum->
getType() == esObjectType::ETMHF) {
2412 }
else if (corrESum->
getType() == esObjectType::TOWERCOUNT) {
2416 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2429 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2445 int lowerThresholdInd = 0;
2446 int upperThresholdInd = -1;
2448 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2450 const std::vector<L1TUtmCut>&
cuts = corrESum->
getCuts();
2451 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2454 switch (
cut.getCutType()) {
2456 lowerThresholdInd =
cut.getMinimum().index;
2457 upperThresholdInd =
cut.getMaximum().index;
2460 case esCutType::Eta:
2465 phiWindow1Lower =
cut.getMinimum().index;
2466 phiWindow1Upper =
cut.getMaximum().index;
2467 }
else if (cntPhi == 1) {
2468 phiWindow2Lower =
cut.getMinimum().index;
2469 phiWindow2Upper =
cut.getMaximum().index;
2471 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2485 objParameter[0].etLowThreshold = lowerThresholdInd;
2486 objParameter[0].etHighThreshold = upperThresholdInd;
2487 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2488 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2489 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2490 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2493 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2494 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2495 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2496 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2497 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2498 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2502 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2517 std::ostringstream myCoutStream;
2518 energySumCond.
print(myCoutStream);
2519 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2537 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2563 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2564 <<
"\n (in parseExternal) " 2565 <<
"\n condition = " << condition <<
"\n particle = " << particle
2566 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2575 unsigned int channelID = 0;
2581 if (
object.getType() == esObjectType::EXT) {
2582 relativeBx =
object.getBxOffset();
2583 channelID =
object.getExternalChannelId();
2591 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2603 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2606 if (!insertConditionIntoMap(externalCond, chipNr)) {
2607 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2611 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2636 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2637 <<
" (in parseCorrelation) " << std::endl
2638 <<
" condition = " << condition << std::endl
2639 <<
" particle = " << particle << std::endl
2640 <<
" type = " <<
type << std::endl
2641 <<
" name = " <<
name << std::endl;
2647 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2648 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2659 const int nrObj = 2;
2662 int intGEq[nrObj] = {-1, -1};
2663 std::vector<GlobalObject>
objType(nrObj);
2664 std::vector<GtConditionCategory> condCateg(nrObj);
2667 const bool corrFlag =
true;
2668 int corrIndexVal[nrObj] = {-1, -1};
2676 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2677 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2680 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2681 if (
cut.getData() ==
"ls")
2683 else if (
cut.getData() ==
"os")
2691 double minV =
cut.getMinimum().value;
2692 double maxV =
cut.getMaximum().value;
2699 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2700 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2701 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2705 cutType = cutType | 0x1;
2707 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2708 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2709 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2713 cutType = cutType | 0x2;
2715 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2716 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2717 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2721 cutType = cutType | 0x4;
2722 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2726 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2727 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2728 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2729 cutType = cutType | 0x20;
2731 (
cut.getCutType() == esCutType::MassDeltaR)) {
2732 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2733 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2734 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2739 if (corrCond.
getType() == esConditionType::TransverseMass) {
2740 cutType = cutType | 0x10;
2741 }
else if (corrCond.
getType() == esConditionType::InvariantMassDeltaR) {
2742 cutType = cutType | 0x80;
2744 cutType = cutType | 0x8;
2746 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2747 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2748 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2749 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2753 cutType = cutType | 0x40;
2762 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 2763 <<
" corrFlag " << corrFlag << std::endl;
2770 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2771 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2772 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2773 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2810 parseMuonCorr(&
object, chipNr);
2811 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2814 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2818 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
2821 parseCaloCorr(&
object, chipNr);
2822 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2825 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2826 switch (
object.getType()) {
2827 case esObjectType::Egamma: {
2841 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2842 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2844 parseEnergySumCorr(&
object, chipNr);
2845 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2848 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2849 switch (
object.getType()) {
2856 case esObjectType::ETMHF: {
2859 case esObjectType::TOWERCOUNT: {
2868 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
2869 <<
" for the correlation condition " <<
name << std::endl;
2878 if (intGEq[0] != intGEq[1]) {
2879 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 2880 <<
" for the correlation condition " <<
name << std::endl;
2884 gEq = (intGEq[0] != 0);
2902 std::ostringstream myCoutStream;
2903 correlationCond.
print(myCoutStream);
2904 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2910 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
2936 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2937 <<
" (in parseCorrelationThreeBody) " << std::endl
2938 <<
" condition = " << condition << std::endl
2939 <<
" particle = " << particle << std::endl
2940 <<
" type = " <<
type << std::endl
2941 <<
" name = " <<
name << std::endl;
2947 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2948 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2956 const int nrObj = 3;
2959 std::vector<GlobalObject>
objType(nrObj);
2960 std::vector<GtConditionCategory> condCateg(nrObj);
2963 const bool corrFlag =
true;
2964 int corrIndexVal[nrObj] = {-1, -1, -1};
2974 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2975 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
2978 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2979 if (
cut.getData() ==
"ls")
2981 else if (
cut.getData() ==
"os")
2990 double minV =
cut.getMinimum().value;
2991 double maxV =
cut.getMaximum().value;
2997 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2998 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2999 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3003 cutType = cutType | 0x8;
3004 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3008 cutType = cutType | 0x80;
3016 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3017 <<
" corrFlag " << corrFlag << std::endl;
3022 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3024 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3025 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3026 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3031 parseMuonCorr(&
object, chipNr);
3032 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
3039 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3040 <<
" for the correlation condition " <<
name 3041 <<
": no three muons in the event!" << std::endl;
3061 std::ostringstream myCoutStream;
3062 correlationThreeBodyCond.
print(myCoutStream);
3063 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3069 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3095 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3096 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3097 <<
" condition = " << condition << std::endl
3098 <<
" particle = " << particle << std::endl
3099 <<
" type = " <<
type << std::endl
3100 <<
" name = " <<
name << std::endl;
3106 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3107 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3118 const int nrObj = 3;
3121 int intGEq[nrObj] = {-1, -1, -1};
3122 std::vector<GlobalObject>
objType(nrObj);
3123 std::vector<GtConditionCategory> condCateg(nrObj);
3126 const bool corrFlag =
true;
3127 int corrIndexVal[nrObj] = {-1, -1, -1};
3135 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3136 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3139 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3140 if (
cut.getData() ==
"ls")
3142 else if (
cut.getData() ==
"os")
3150 double minV =
cut.getMinimum().value;
3151 double maxV =
cut.getMaximum().value;
3162 cutType = cutType | 0x1;
3168 cutType = cutType | 0x2;
3174 cutType = cutType | 0x4;
3180 cutType = cutType | 0x8;
3181 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3185 cutType = cutType | 0x80;
3187 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3192 cutType = cutType | 0x10;
3193 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3198 cutType = cutType | 0x20;
3199 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3204 cutType = cutType | 0x40;
3214 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3215 << corrFlag << std::endl;
3222 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3223 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3224 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3225 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3226 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3263 parseMuonCorr(&
object, chipNr);
3264 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3267 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3271 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3274 parseCaloCorr(&
object, chipNr);
3275 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3278 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3279 switch (
object.getType()) {
3280 case esObjectType::Egamma: {
3294 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3295 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3297 parseEnergySumCorr(&
object, chipNr);
3298 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3301 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3302 switch (
object.getType()) {
3309 case esObjectType::ETMHF: {
3312 case esObjectType::TOWERCOUNT: {
3321 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3322 <<
" for the correlation condition " <<
name << std::endl;
3331 if (intGEq[0] != intGEq[1]) {
3332 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3333 <<
" for the correlation condition " <<
name << std::endl;
3337 gEq = (intGEq[0] != 0);
3357 std::ostringstream myCoutStream;
3358 correlationWORCond.
print(myCoutStream);
3359 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3365 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3387 if (algAlias.empty()) {
3389 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3390 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3394 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3395 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3402 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3403 <<
" Chip number: " << chipNr << std::endl;
3409 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3424 std::ostringstream myCoutStream;
3425 alg.
print(myCoutStream);
3426 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3430 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 &)
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
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 &)