52 #include "tmEventSetup/tmEventSetup.hh" 53 #include "tmEventSetup/esTypes.hh" 61 #include "tmGrammar/Algorithm.hh" 67 : m_triggerMenuInterface(
"NULL"),
68 m_triggerMenuName(
"NULL"),
69 m_triggerMenuImplementation(0x0),
83 m_numberConditionChips = numberConditionChipsValue;
88 m_pinsOnConditionChip = pinsOnConditionChipValue;
94 m_orderConditionChip = orderConditionChipValue;
99 m_numberPhysTriggers = numberPhysTriggersValue;
107 m_triggerMenuInterface = menuInterface;
116 m_triggerMenuImplementation = menuImplementation;
124 m_vecMuonTemplate = vecMuonTempl;
128 const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTempl) {
129 m_vecMuonShowerTemplate = vecMuonShowerTempl;
133 m_vecCaloTemplate = vecCaloTempl;
137 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
138 m_vecEnergySumTemplate = vecEnergySumTempl;
142 const std::vector<std::vector<EnergySumZdcTemplate> >& vecEnergySumZdcTempl) {
143 m_vecEnergySumZdcTemplate = vecEnergySumZdcTempl;
147 m_vecAXOL1TLTemplate = vecAXOL1TLTempl;
151 m_vecCICADATemplate = vecCICADATempl;
155 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
156 m_vecExternalTemplate = vecExternalTempl;
160 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
161 m_vecCorrelationTemplate = vecCorrelationTempl;
165 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
166 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
170 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
171 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
177 m_corMuonTemplate = corMuonTempl;
181 m_corCaloTemplate = corCaloTempl;
185 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
186 m_corEnergySumTemplate = corEnergySumTempl;
197 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
199 std::map<std::string, unsigned int> extBitMap;
202 for (
const auto& cit : condMap) {
204 if (condition.
getType() == esConditionType::Externals) {
207 for (
const auto&
object :
objects) {
208 if (
object.getType() == esObjectType::EXT) {
209 unsigned int channelID =
object.getExternalChannelId();
212 if (extBitMap.count(
name) == 0)
226 m_conditionMap.resize(m_numberConditionChips);
228 m_vecMuonTemplate.resize(m_numberConditionChips);
229 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
230 m_vecCaloTemplate.resize(m_numberConditionChips);
231 m_vecEnergySumTemplate.resize(m_numberConditionChips);
232 m_vecEnergySumZdcTemplate.resize(m_numberConditionChips);
233 m_vecAXOL1TLTemplate.resize(m_numberConditionChips);
234 m_vecCICADATemplate.resize(m_numberConditionChips);
235 m_vecExternalTemplate.resize(m_numberConditionChips);
237 m_vecCorrelationTemplate.resize(m_numberConditionChips);
238 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
239 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
240 m_corMuonTemplate.resize(m_numberConditionChips);
241 m_corCaloTemplate.resize(m_numberConditionChips);
242 m_corEnergySumTemplate.resize(m_numberConditionChips);
248 m_triggerMenuDescription = utmMenu->
getComment();
250 m_triggerMenuImplementation = (getMmHashN(utmMenu->
getFirmwareUuid()) & 0xFFFFFFFF);
251 m_triggerMenuName = utmMenu->
getName();
252 m_triggerMenuInterface = utmMenu->
getVersion();
253 m_triggerMenuUUID = (getMmHashN(utmMenu->
getName()) & 0xFFFFFFFF);
255 const std::map<std::string, L1TUtmAlgorithm>& algoMap = utmMenu->
getAlgorithmMap();
256 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
258 const std::map<std::string, tmeventsetup::esScale> scaleMap(std::begin(utmMenu->
getScaleMap()),
263 parseScales(scaleMap);
266 for (
const auto& cit : algoMap) {
274 parseAlgorithm(
algo, chipNr);
277 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
278 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
286 if ((m_conditionMap[chipNr]).
count(condition.
getName()) == 0) {
288 if (condition.
getType() == esConditionType::SingleEgamma ||
289 condition.
getType() == esConditionType::DoubleEgamma ||
290 condition.
getType() == esConditionType::TripleEgamma ||
291 condition.
getType() == esConditionType::QuadEgamma || condition.
getType() == esConditionType::SingleTau ||
292 condition.
getType() == esConditionType::DoubleTau || condition.
getType() == esConditionType::TripleTau ||
293 condition.
getType() == esConditionType::QuadTau || condition.
getType() == esConditionType::SingleJet ||
294 condition.
getType() == esConditionType::DoubleJet || condition.
getType() == esConditionType::TripleJet ||
295 condition.
getType() == esConditionType::QuadJet) {
296 parseCalo(condition, chipNr,
false);
299 }
else if (condition.
getType() == esConditionType::TotalEt ||
300 condition.
getType() == esConditionType::TotalEtEM ||
301 condition.
getType() == esConditionType::TotalHt ||
302 condition.
getType() == esConditionType::MissingEt ||
303 condition.
getType() == esConditionType::MissingHt ||
304 condition.
getType() == esConditionType::MissingEtHF ||
305 condition.
getType() == esConditionType::TowerCount ||
306 condition.
getType() == esConditionType::MinBiasHFP0 ||
307 condition.
getType() == esConditionType::MinBiasHFM0 ||
308 condition.
getType() == esConditionType::MinBiasHFP1 ||
309 condition.
getType() == esConditionType::MinBiasHFM1 ||
310 condition.
getType() == esConditionType::AsymmetryEt ||
311 condition.
getType() == esConditionType::AsymmetryHt ||
312 condition.
getType() == esConditionType::AsymmetryEtHF ||
313 condition.
getType() == esConditionType::AsymmetryHtHF ||
314 condition.
getType() == esConditionType::Centrality0 ||
315 condition.
getType() == esConditionType::Centrality1 ||
316 condition.
getType() == esConditionType::Centrality2 ||
317 condition.
getType() == esConditionType::Centrality3 ||
318 condition.
getType() == esConditionType::Centrality4 ||
319 condition.
getType() == esConditionType::Centrality5 ||
320 condition.
getType() == esConditionType::Centrality6 ||
321 condition.
getType() == esConditionType::Centrality7) {
322 parseEnergySum(condition, chipNr,
false);
325 }
else if (condition.
getType() == esConditionType::ZDCPlus ||
326 condition.
getType() == esConditionType::ZDCMinus) {
327 parseEnergySumZdc(condition, chipNr,
false);
330 }
else if (condition.
getType() == esConditionType::Axol1tlTrigger ||
331 condition.
getType() == esConditionType::AnomalyDetectionTrigger) {
332 parseAXOL1TL(condition, chipNr);
335 }
else if (condition.
getType() == esConditionType::CicadaTrigger) {
336 parseCICADA(condition, chipNr);
339 condition.
getType() == esConditionType::DoubleMuon ||
340 condition.
getType() == esConditionType::TripleMuon ||
341 condition.
getType() == esConditionType::QuadMuon) {
342 parseMuon(condition, chipNr,
false);
344 }
else if (condition.
getType() == esConditionType::MuonShower0 ||
345 condition.
getType() == esConditionType::MuonShower1 ||
346 condition.
getType() == esConditionType::MuonShower2 ||
347 condition.
getType() == esConditionType::MuonShowerOutOfTime0 ||
348 condition.
getType() == esConditionType::MuonShowerOutOfTime1) {
349 parseMuonShower(condition, chipNr,
false);
352 }
else if (condition.
getType() == esConditionType::MuonMuonCorrelation ||
353 condition.
getType() == esConditionType::MuonEsumCorrelation ||
354 condition.
getType() == esConditionType::CaloMuonCorrelation ||
355 condition.
getType() == esConditionType::CaloCaloCorrelation ||
356 condition.
getType() == esConditionType::CaloEsumCorrelation ||
357 condition.
getType() == esConditionType::InvariantMass ||
358 condition.
getType() == esConditionType::InvariantMassDeltaR ||
359 condition.
getType() == esConditionType::TransverseMass ||
360 condition.
getType() == esConditionType::InvariantMassUpt) {
361 parseCorrelation(condition, chipNr);
364 }
else if (condition.
getType() == esConditionType::InvariantMass3) {
365 parseCorrelationThreeBody(condition, chipNr);
368 }
else if (condition.
getType() == esConditionType::Externals) {
369 parseExternal(condition, chipNr);
372 }
else if (condition.
getType() == esConditionType::CaloCaloCorrelationOvRm ||
373 condition.
getType() == esConditionType::InvariantMassOvRm ||
374 condition.
getType() == esConditionType::TransverseMassOvRm ||
375 condition.
getType() == esConditionType::DoubleJetOvRm ||
376 condition.
getType() == esConditionType::DoubleTauOvRm) {
377 parseCorrelationWithOverlapRemoval(condition, chipNr);
379 }
else if (condition.
getType() == esConditionType::SingleEgammaOvRm ||
380 condition.
getType() == esConditionType::DoubleEgammaOvRm ||
381 condition.
getType() == esConditionType::TripleEgammaOvRm ||
382 condition.
getType() == esConditionType::QuadEgammaOvRm ||
383 condition.
getType() == esConditionType::SingleTauOvRm ||
384 condition.
getType() == esConditionType::TripleTauOvRm ||
385 condition.
getType() == esConditionType::QuadTauOvRm ||
386 condition.
getType() == esConditionType::SingleJetOvRm ||
387 condition.
getType() == esConditionType::TripleJetOvRm ||
388 condition.
getType() == esConditionType::QuadJetOvRm) {
390 <<
"\n SingleEgammaOvRm" 391 <<
"\n DoubleEgammaOvRm" 392 <<
"\n TripleEgammaOvRm" 393 <<
"\n QuadEgammaOvRm" 394 <<
"\n SingleTauOvRm" 395 <<
"\n TripleTauOvRm" 397 <<
"\n SingleJetOvRm" 398 <<
"\n TripleJetOvRm" 400 <<
"\n The above conditions types OvRm are not implemented yet in the " 401 "parser. Please remove alogrithms that " 402 "use this type of condtion from L1T Menu!" 418 m_triggerMenuInterfaceAuthor =
val;
422 m_triggerMenuInterfaceDescription =
val;
440 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
444 itCondOnChip->clear();
448 m_algorithmMap.clear();
455 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 459 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
460 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
464 (m_conditionMap[chipNr])[cName] = &
cond;
465 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
478 if (m_algorithmMap.count(algName) != 0) {
479 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
480 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
484 if (m_algorithmAliasMap.count(algAlias) != 0) {
485 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
486 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
493 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 494 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
499 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
500 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
501 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
507 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
509 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
510 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 511 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
517 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
519 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
520 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 521 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
526 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
527 int iPin = (itAlgo->second)
528 .algoOutputPin(static_cast<int>(m_numberConditionChips),
529 static_cast<int>(m_pinsOnConditionChip),
530 m_orderConditionChip);
532 int iChip = (itAlgo->second)
533 .algoChipNumber(static_cast<int>(m_numberConditionChips),
534 static_cast<int>(m_pinsOnConditionChip),
535 m_orderConditionChip);
537 if ((outputPin == iPin) && (chipNr == iChip)) {
538 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
539 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 546 m_algorithmMap[algName] = alg;
547 m_algorithmAliasMap[algAlias] = alg;
556 template <
typename T>
558 std::stringstream
ss;
563 std::stringstream
ss;
594 for (std::map<std::string, tmeventsetup::esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end();
596 const tmeventsetup::esScale&
scale = cit->second;
600 scaleParam = &muScales;
601 else if (
scale.getObjectType() == esObjectType::Egamma)
602 scaleParam = &egScales;
604 scaleParam = &tauScales;
606 scaleParam = &jetScales;
608 scaleParam = &ettScales;
609 else if (
scale.getObjectType() == esObjectType::ETTEM)
610 scaleParam = &ettEmScales;
612 scaleParam = &etmScales;
613 else if (
scale.getObjectType() == esObjectType::ETMHF)
614 scaleParam = &etmHfScales;
616 scaleParam = &httScales;
618 scaleParam = &htmScales;
620 scaleParam = &zdcScales;
622 scaleParam =
nullptr;
624 if (scaleParam !=
nullptr) {
625 switch (
scale.getScaleType()) {
626 case esScaleType::EtScale: {
632 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
633 for (
unsigned int i = 0;
i < binsV.size();
i++) {
634 const tmeventsetup::esBin&
bin = binsV.at(
i);
635 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
636 scaleParam->
etBins.push_back(binLimits);
643 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
648 scale.getObjectType() == esObjectType::ETTEM) {
656 case esScaleType::UnconstrainedPtScale: {
662 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
663 for (
unsigned int i = 0;
i < binsV.size();
i++) {
664 const tmeventsetup::esBin&
bin = binsV.at(
i);
665 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
666 scaleParam->
uptBins.push_back(binLimits);
669 case esScaleType::EtaScale: {
675 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
677 for (
unsigned int i = 0;
i < binsV.size();
i++) {
678 const tmeventsetup::esBin&
bin = binsV.at(
i);
679 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
680 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
683 case esScaleType::PhiScale: {
689 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
691 for (
unsigned int i = 0;
i < binsV.size();
i++) {
692 const tmeventsetup::esBin&
bin = binsV.at(
i);
693 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
694 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
705 m_gtScales.setMuonScales(muScales);
706 m_gtScales.setEGScales(egScales);
707 m_gtScales.setTauScales(tauScales);
708 m_gtScales.setJetScales(jetScales);
709 m_gtScales.setETTScales(ettScales);
710 m_gtScales.setETTEmScales(ettEmScales);
711 m_gtScales.setETMScales(etmScales);
712 m_gtScales.setETMHfScales(etmHfScales);
713 m_gtScales.setHTTScales(httScales);
714 m_gtScales.setHTMScales(htmScales);
715 m_gtScales.setHTMScales(zdcScales);
718 bool hasPrecision =
false;
719 std::map<std::string, unsigned int> precisions;
720 getPrecisions(precisions, scaleMap);
721 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
728 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
729 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
730 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
734 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
735 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
736 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
737 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
738 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
739 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
743 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
744 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
745 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
746 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
747 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
748 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
749 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
750 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
754 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
755 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
756 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
757 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
758 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
759 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
760 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
764 parseDeltaEta_Cosh_LUTS(
765 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
766 parseDeltaEta_Cosh_LUTS(
767 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
768 parseDeltaEta_Cosh_LUTS(
769 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
770 parseDeltaEta_Cosh_LUTS(
771 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
773 parseDeltaEta_Cosh_LUTS(
774 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
775 parseDeltaEta_Cosh_LUTS(
776 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
777 parseDeltaEta_Cosh_LUTS(
778 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
780 parseDeltaEta_Cosh_LUTS(
781 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
782 parseDeltaEta_Cosh_LUTS(
783 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
785 parseDeltaEta_Cosh_LUTS(
786 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
790 parseDeltaPhi_Cos_LUTS(
791 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
792 parseDeltaPhi_Cos_LUTS(
793 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
794 parseDeltaPhi_Cos_LUTS(
795 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
796 parseDeltaPhi_Cos_LUTS(
797 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
798 parseDeltaPhi_Cos_LUTS(
799 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
800 parseDeltaPhi_Cos_LUTS(
801 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
802 parseDeltaPhi_Cos_LUTS(
803 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
805 parseDeltaPhi_Cos_LUTS(
806 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
807 parseDeltaPhi_Cos_LUTS(
808 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
809 parseDeltaPhi_Cos_LUTS(
810 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
811 parseDeltaPhi_Cos_LUTS(
812 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
813 parseDeltaPhi_Cos_LUTS(
814 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
815 parseDeltaPhi_Cos_LUTS(
816 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
818 parseDeltaPhi_Cos_LUTS(
819 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
820 parseDeltaPhi_Cos_LUTS(
821 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
822 parseDeltaPhi_Cos_LUTS(
823 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
824 parseDeltaPhi_Cos_LUTS(
825 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
826 parseDeltaPhi_Cos_LUTS(
827 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
829 parseDeltaPhi_Cos_LUTS(
830 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
831 parseDeltaPhi_Cos_LUTS(
832 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
833 parseDeltaPhi_Cos_LUTS(
834 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
835 parseDeltaPhi_Cos_LUTS(
836 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
838 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
839 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
840 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
841 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
843 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
844 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
845 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
846 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
868 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
871 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
872 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
874 std::vector<long long> lut_cal_2_mu_eta;
875 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
880 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
895 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
898 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
899 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
901 std::vector<long long> lut_cal_2_mu_phi;
902 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
907 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
921 if (scaleMap.find(scLabel1) == scaleMap.end())
924 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
926 std::vector<long long> lut_pt;
927 getLut(lut_pt, scale1, prec);
929 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
944 if (scaleMap.find(scLabel1) == scaleMap.end())
947 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
949 std::vector<long long> lut_pt;
950 getLut(lut_pt, scale1, prec);
952 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
959 unsigned int prec2) {
969 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
972 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
973 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
974 std::vector<double> val_delta_eta;
975 std::vector<long long> lut_delta_eta;
976 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
977 setLut(lut_delta_eta, val_delta_eta, prec1);
981 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
984 std::vector<long long> lut_cosh;
985 applyCosh(val_delta_eta,
n);
986 setLut(lut_cosh, val_delta_eta, prec2);
987 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
994 unsigned int prec2) {
1004 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
1007 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
1008 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
1009 std::vector<double> val_delta_phi;
1010 std::vector<long long> lut_delta_phi;
1011 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
1012 setLut(lut_delta_phi, val_delta_phi, prec1);
1016 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
1019 std::vector<long long> lut_cos;
1020 applyCos(val_delta_phi,
n);
1021 setLut(lut_cos, val_delta_phi, prec2);
1022 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
1028 unsigned int prec) {
1035 if (scaleMap.find(scLabel) == scaleMap.end())
1040 const tmeventsetup::esScale*
scale = &scaleMap.find(scLabel)->second;
1045 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1049 for (
size_t ii = 0;
ii <
n;
ii++) {
1054 std::vector<long long> lut;
1057 setLut(lut,
array, prec);
1058 m_gtScales.setLUT_Sin(lutName, lut, prec);
1061 setLut(lut,
array, prec);
1062 m_gtScales.setLUT_Cos(lutName, lut, prec);
1092 }
else if (condMu.
getType() == esConditionType::DoubleMuon) {
1096 }
else if (condMu.
getType() == esConditionType::TripleMuon) {
1100 }
else if (condMu.
getType() == esConditionType::QuadMuon) {
1105 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1110 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1111 <<
"\nCan not determine number of trigger objects. " << std::endl;
1115 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1117 <<
"\n condition = " << condition <<
"\n particle = " << particle
1118 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1123 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1129 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1130 tmpValues.reserve(nrObj);
1132 if (
int(condMu.
getObjects().size()) != nrObj) {
1133 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1134 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1139 unsigned int chargeCorrelation = 1;
1140 const std::vector<L1TUtmCut>&
cuts = condMu.
getCuts();
1141 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1143 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1144 if (
cut.getData() ==
"ls")
1145 chargeCorrelation = 2;
1146 else if (
cut.getData() ==
"os")
1147 chargeCorrelation = 4;
1149 chargeCorrelation = 1;
1166 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1169 relativeBx =
object.getBxOffset();
1172 int upperUnconstrainedPtInd = -1;
1173 int lowerUnconstrainedPtInd = 0;
1174 int upperImpactParameterInd = -1;
1175 int lowerImpactParameterInd = 0;
1176 int upperThresholdInd = -1;
1177 int lowerThresholdInd = 0;
1178 int upperIndexInd = -1;
1179 int lowerIndexInd = 0;
1181 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1182 int isolationLUT = 0xF;
1183 int impactParameterLUT = 0xF;
1185 int qualityLUT = 0xFFFF;
1187 std::vector<MuonTemplate::Window> etaWindows;
1188 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1190 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1191 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1194 switch (
cut.getCutType()) {
1195 case esCutType::UnconstrainedPt:
1196 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1197 upperUnconstrainedPtInd =
cut.getMaximum().index;
1200 case esCutType::ImpactParameter:
1201 lowerImpactParameterInd =
cut.getMinimum().index;
1202 upperImpactParameterInd =
cut.getMaximum().index;
1203 impactParameterLUT = l1tstr2int(
cut.getData());
1207 lowerThresholdInd =
cut.getMinimum().index;
1208 upperThresholdInd =
cut.getMaximum().index;
1211 case esCutType::Slice:
1212 lowerIndexInd =
int(
cut.getMinimum().value);
1213 upperIndexInd =
int(
cut.getMaximum().value);
1216 case esCutType::Eta: {
1217 if (etaWindows.size() < 5) {
1218 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1221 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1228 phiWindow1Lower =
cut.getMinimum().index;
1229 phiWindow1Upper =
cut.getMaximum().index;
1230 }
else if (cntPhi == 1) {
1231 phiWindow2Lower =
cut.getMinimum().index;
1232 phiWindow2Upper =
cut.getMaximum().index;
1235 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1243 if (
cut.getData() ==
"positive")
1245 else if (
cut.getData() ==
"negative")
1252 qualityLUT = l1tstr2int(
cut.getData());
1255 case esCutType::Isolation: {
1256 isolationLUT = l1tstr2int(
cut.getData());
1260 case esCutType::Index: {
1261 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1271 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1272 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1273 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1274 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1275 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1277 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1278 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1280 objParameter[cnt].indexHigh = upperIndexInd;
1281 objParameter[cnt].indexLow = lowerIndexInd;
1283 objParameter[cnt].etaWindows = etaWindows;
1285 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1286 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1287 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1288 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1291 objParameter[cnt].enableMip =
false;
1292 objParameter[cnt].enableIso =
false;
1293 objParameter[cnt].requestIso =
false;
1295 objParameter[cnt].charge =
charge;
1296 objParameter[cnt].qualityLUT = qualityLUT;
1297 objParameter[cnt].isolationLUT = isolationLUT;
1299 objParameter[cnt].tfMuonIndexWindows = tfMuonIndexWindows;
1319 std::ostringstream myCoutStream;
1320 muonCond.
print(myCoutStream);
1321 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1325 if (!insertConditionIntoMap(muonCond, chipNr)) {
1326 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1329 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1331 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1333 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1334 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1356 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1357 <<
"\nCan not determine number of trigger objects. " << std::endl;
1361 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1363 <<
"\n condition = " << condition <<
"\n particle = " << particle
1364 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1369 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1375 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1376 tmpValues.reserve(nrObj);
1381 unsigned int chargeCorrelation = 0;
1382 if (str_chargeCorrelation ==
"ig")
1383 chargeCorrelation = 1;
1384 else if (str_chargeCorrelation ==
"ls")
1385 chargeCorrelation = 2;
1386 else if (str_chargeCorrelation ==
"os")
1387 chargeCorrelation = 4;
1403 int upperUnconstrainedPtInd = -1;
1404 int lowerUnconstrainedPtInd = 0;
1405 int upperImpactParameterInd = -1;
1406 int lowerImpactParameterInd = 0;
1407 int impactParameterLUT = 0xF;
1408 int upperThresholdInd = -1;
1409 int lowerThresholdInd = 0;
1410 int upperIndexInd = -1;
1411 int lowerIndexInd = 0;
1413 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1414 int isolationLUT = 0xF;
1416 int qualityLUT = 0xFFFF;
1418 std::vector<MuonTemplate::Window> etaWindows;
1419 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1421 const std::vector<L1TUtmCut>&
cuts = corrMu->
getCuts();
1422 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1425 switch (
cut.getCutType()) {
1426 case esCutType::UnconstrainedPt:
1427 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1428 upperUnconstrainedPtInd =
cut.getMaximum().index;
1431 case esCutType::ImpactParameter:
1432 lowerImpactParameterInd =
cut.getMinimum().index;
1433 upperImpactParameterInd =
cut.getMaximum().index;
1434 impactParameterLUT = l1tstr2int(
cut.getData());
1438 lowerThresholdInd =
cut.getMinimum().index;
1439 upperThresholdInd =
cut.getMaximum().index;
1442 case esCutType::Slice:
1443 lowerIndexInd =
int(
cut.getMinimum().value);
1444 upperIndexInd =
int(
cut.getMaximum().value);
1447 case esCutType::Eta: {
1448 if (etaWindows.size() < 5) {
1449 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1452 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1459 phiWindow1Lower =
cut.getMinimum().index;
1460 phiWindow1Upper =
cut.getMaximum().index;
1461 }
else if (cntPhi == 1) {
1462 phiWindow2Lower =
cut.getMinimum().index;
1463 phiWindow2Upper =
cut.getMaximum().index;
1466 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1474 if (
cut.getData() ==
"positive")
1476 else if (
cut.getData() ==
"negative")
1483 qualityLUT = l1tstr2int(
cut.getData());
1486 case esCutType::Isolation: {
1487 isolationLUT = l1tstr2int(
cut.getData());
1491 case esCutType::Index: {
1492 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1502 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1503 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1504 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1505 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1506 objParameter[0].impactParameterLUT = impactParameterLUT;
1508 objParameter[0].ptHighThreshold = upperThresholdInd;
1509 objParameter[0].ptLowThreshold = lowerThresholdInd;
1511 objParameter[0].indexHigh = upperIndexInd;
1512 objParameter[0].indexLow = lowerIndexInd;
1514 objParameter[0].etaWindows = etaWindows;
1516 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1517 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1518 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1519 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1522 objParameter[0].enableMip =
false;
1523 objParameter[0].enableIso =
false;
1524 objParameter[0].requestIso =
false;
1526 objParameter[0].charge =
charge;
1527 objParameter[0].qualityLUT = qualityLUT;
1528 objParameter[0].isolationLUT = isolationLUT;
1530 objParameter[0].tfMuonIndexWindows = tfMuonIndexWindows;
1546 std::ostringstream myCoutStream;
1547 muonCond.
print(myCoutStream);
1548 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1564 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1596 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1598 if (
int(condMu.
getObjects().size()) != nrObj) {
1599 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1600 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1606 int relativeBx =
object.getBxOffset();
1608 if (condMu.
getType() == esConditionType::MuonShower0) {
1609 objParameter[0].MuonShower0 =
true;
1610 }
else if (condMu.
getType() == esConditionType::MuonShower1) {
1611 objParameter[0].MuonShower1 =
true;
1612 }
else if (condMu.
getType() == esConditionType::MuonShower2) {
1613 objParameter[0].MuonShower2 =
true;
1614 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime0) {
1615 objParameter[0].MuonShowerOutOfTime0 =
true;
1616 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime1) {
1617 objParameter[0].MuonShowerOutOfTime1 =
true;
1633 std::ostringstream myCoutStream;
1634 muonShowerCond.
print(myCoutStream);
1638 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1639 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1642 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1670 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1671 <<
"\n (in parseCalo) " 1672 <<
"\n condition = " << condition <<
"\n particle = " << particle
1673 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1682 if (condCalo.
getType() == esConditionType::SingleEgamma) {
1687 }
else if (condCalo.
getType() == esConditionType::DoubleEgamma) {
1692 }
else if (condCalo.
getType() == esConditionType::TripleEgamma) {
1697 }
else if (condCalo.
getType() == esConditionType::QuadEgamma) {
1702 }
else if (condCalo.
getType() == esConditionType::SingleJet) {
1703 caloObjType =
gtJet;
1707 }
else if (condCalo.
getType() == esConditionType::DoubleJet) {
1708 caloObjType =
gtJet;
1712 }
else if (condCalo.
getType() == esConditionType::TripleJet) {
1713 caloObjType =
gtJet;
1717 }
else if (condCalo.
getType() == esConditionType::QuadJet) {
1718 caloObjType =
gtJet;
1722 }
else if (condCalo.
getType() == esConditionType::SingleTau) {
1723 caloObjType =
gtTau;
1727 }
else if (condCalo.
getType() == esConditionType::DoubleTau) {
1728 caloObjType =
gtTau;
1732 }
else if (condCalo.
getType() == esConditionType::TripleTau) {
1733 caloObjType =
gtTau;
1737 }
else if (condCalo.
getType() == esConditionType::QuadTau) {
1738 caloObjType =
gtTau;
1743 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1750 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1751 <<
"\nCan not determine number of trigger objects. " << std::endl;
1758 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1764 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1765 tmpValues.reserve(nrObj);
1767 if (
int(condCalo.
getObjects().size()) != nrObj) {
1768 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1769 <<
"condCalo.getObjects().size() = " << condCalo.
getObjects().size()
1787 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1790 relativeBx =
object.getBxOffset();
1793 int upperThresholdInd = -1;
1794 int lowerThresholdInd = 0;
1795 int upperIndexInd = -1;
1796 int lowerIndexInd = 0;
1798 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1799 int isolationLUT = 0xF;
1800 int qualityLUT = 0xF;
1801 int displacedLUT = 0x0;
1805 std::vector<CaloTemplate::Window> etaWindows;
1807 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1808 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1811 switch (
cut.getCutType()) {
1813 lowerThresholdInd =
cut.getMinimum().index;
1814 upperThresholdInd =
cut.getMaximum().index;
1816 case esCutType::Slice:
1817 lowerIndexInd =
int(
cut.getMinimum().value);
1818 upperIndexInd =
int(
cut.getMaximum().value);
1820 case esCutType::Eta: {
1821 if (etaWindows.size() < 5) {
1822 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1825 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1832 phiWindow1Lower =
cut.getMinimum().index;
1833 phiWindow1Upper =
cut.getMaximum().index;
1834 }
else if (cntPhi == 1) {
1835 phiWindow2Lower =
cut.getMinimum().index;
1836 phiWindow2Upper =
cut.getMaximum().index;
1839 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1847 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1852 qualityLUT = l1tstr2int(
cut.getData());
1855 case esCutType::Displaced: {
1856 displacedLUT = l1tstr2int(
cut.getData());
1859 case esCutType::Isolation: {
1860 isolationLUT = l1tstr2int(
cut.getData());
1870 objParameter[cnt].etHighThreshold = upperThresholdInd;
1871 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1872 objParameter[cnt].indexHigh = upperIndexInd;
1873 objParameter[cnt].indexLow = lowerIndexInd;
1874 objParameter[cnt].etaWindows = etaWindows;
1875 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1876 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1877 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1878 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1879 objParameter[cnt].isolationLUT = isolationLUT;
1880 objParameter[cnt].qualityLUT = qualityLUT;
1881 objParameter[cnt].displacedLUT = displacedLUT;
1885 std::ostringstream oss;
1886 oss <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " << std::hex
1887 << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold;
1888 for (
const auto&
window : objParameter[cnt].etaWindows) {
1889 oss <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" <<
window.lower <<
" / 0x" 1892 oss <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" << objParameter[cnt].phiWindow1Lower
1893 <<
" / 0x" << objParameter[cnt].phiWindow1Upper <<
"\n phiWindowVeto Lower / Upper for calo object " 1894 << cnt <<
" = 0x" << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1895 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].isolationLUT
1896 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].qualityLUT
1897 <<
"\n LLP DISP LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].displacedLUT;
1898 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
1905 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1923 std::ostringstream myCoutStream;
1924 caloCond.
print(myCoutStream);
1925 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1929 if (!insertConditionIntoMap(caloCond, chipNr)) {
1930 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1935 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1937 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1967 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1968 <<
"\n (in parseCalo) " 1969 <<
"\n condition = " << condition <<
"\n particle = " << particle
1970 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1979 if (corrCalo->
getType() == esObjectType::Egamma) {
1982 caloObjType =
gtJet;
1984 caloObjType =
gtTau;
1986 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1993 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1994 <<
"\nCan not determine number of trigger objects. " << std::endl;
2001 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
2007 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
2008 tmpValues.reserve(nrObj);
2020 int upperThresholdInd = -1;
2021 int lowerThresholdInd = 0;
2022 int upperIndexInd = -1;
2023 int lowerIndexInd = 0;
2025 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2026 int isolationLUT = 0xF;
2027 int qualityLUT = 0xF;
2028 int displacedLUT = 0x0;
2032 std::vector<CaloTemplate::Window> etaWindows;
2034 const std::vector<L1TUtmCut>&
cuts = corrCalo->
getCuts();
2035 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2038 switch (
cut.getCutType()) {
2040 lowerThresholdInd =
cut.getMinimum().index;
2041 upperThresholdInd =
cut.getMaximum().index;
2043 case esCutType::Slice:
2044 lowerIndexInd =
int(
cut.getMinimum().value);
2045 upperIndexInd =
int(
cut.getMaximum().value);
2047 case esCutType::Eta: {
2048 if (etaWindows.size() < 5) {
2049 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
2052 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2059 phiWindow1Lower =
cut.getMinimum().index;
2060 phiWindow1Upper =
cut.getMaximum().index;
2061 }
else if (cntPhi == 1) {
2062 phiWindow2Lower =
cut.getMinimum().index;
2063 phiWindow2Upper =
cut.getMaximum().index;
2066 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2074 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2079 qualityLUT = l1tstr2int(
cut.getData());
2082 case esCutType::Displaced: {
2083 displacedLUT = l1tstr2int(
cut.getData());
2086 case esCutType::Isolation: {
2087 isolationLUT = l1tstr2int(
cut.getData());
2097 objParameter[0].etLowThreshold = lowerThresholdInd;
2098 objParameter[0].etHighThreshold = upperThresholdInd;
2099 objParameter[0].indexHigh = upperIndexInd;
2100 objParameter[0].indexLow = lowerIndexInd;
2101 objParameter[0].etaWindows = etaWindows;
2102 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2103 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2104 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2105 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2106 objParameter[0].isolationLUT = isolationLUT;
2107 objParameter[0].qualityLUT = qualityLUT;
2108 objParameter[0].displacedLUT = displacedLUT;
2112 std::ostringstream oss;
2113 oss <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2114 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold;
2115 for (
const auto&
window : objParameter[0].etaWindows) {
2116 oss <<
"\n etaWindow Lower / Upper for calo object " 2119 oss <<
"\n phiWindow Lower / Upper for calo object " 2120 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2121 <<
"\n phiWindowVeto Lower / Upper for calo object " 2122 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2123 <<
"\n Isolation LUT for calo object " 2124 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2125 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2126 <<
" = 0x" << objParameter[0].displacedLUT;
2127 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
2131 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2149 std::ostringstream myCoutStream;
2150 caloCond.
print(myCoutStream);
2151 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2168 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2195 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2196 <<
"\n (in parseEnergySum) " 2197 <<
"\n condition = " << condition <<
"\n type = " <<
type 2198 <<
"\n name = " <<
name << std::endl;
2204 if (condEnergySum.
getType() == esConditionType::MissingEt) {
2207 }
else if (condEnergySum.
getType() == esConditionType::TotalEt) {
2210 }
else if (condEnergySum.
getType() == esConditionType::TotalEtEM) {
2213 }
else if (condEnergySum.
getType() == esConditionType::TotalHt) {
2216 }
else if (condEnergySum.
getType() == esConditionType::MissingHt) {
2219 }
else if (condEnergySum.
getType() == esConditionType::MissingEtHF) {
2222 }
else if (condEnergySum.
getType() == esConditionType::TowerCount) {
2225 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP0) {
2228 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM0) {
2231 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP1) {
2234 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM1) {
2237 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEt) {
2240 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHt) {
2243 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEtHF) {
2246 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHtHF) {
2249 }
else if (condEnergySum.
getType() == esConditionType::Centrality0) {
2252 }
else if (condEnergySum.
getType() == esConditionType::Centrality1) {
2255 }
else if (condEnergySum.
getType() == esConditionType::Centrality2) {
2258 }
else if (condEnergySum.
getType() == esConditionType::Centrality3) {
2261 }
else if (condEnergySum.
getType() == esConditionType::Centrality4) {
2264 }
else if (condEnergySum.
getType() == esConditionType::Centrality5) {
2267 }
else if (condEnergySum.
getType() == esConditionType::Centrality6) {
2270 }
else if (condEnergySum.
getType() == esConditionType::Centrality7) {
2274 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2286 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2300 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2303 relativeBx =
object.getBxOffset();
2306 int lowerThresholdInd = 0;
2307 int upperThresholdInd = -1;
2309 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2311 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2312 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2315 switch (
cut.getCutType()) {
2317 lowerThresholdInd =
cut.getMinimum().index;
2318 upperThresholdInd =
cut.getMaximum().index;
2321 case esCutType::Eta:
2326 phiWindow1Lower =
cut.getMinimum().index;
2327 phiWindow1Upper =
cut.getMaximum().index;
2328 }
else if (cntPhi == 1) {
2329 phiWindow2Lower =
cut.getMinimum().index;
2330 phiWindow2Upper =
cut.getMaximum().index;
2332 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2339 case esCutType::Count:
2340 lowerThresholdInd =
cut.getMinimum().index;
2341 upperThresholdInd = 0xffffff;
2351 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2352 objParameter[cnt].etHighThreshold = upperThresholdInd;
2353 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2354 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2355 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2356 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2359 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2360 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2361 << objParameter[cnt].etHighThreshold
2362 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2363 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2364 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2365 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2372 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2387 std::ostringstream myCoutStream;
2388 energySumCond.
print(myCoutStream);
2389 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2393 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2394 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2399 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2402 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2422 unsigned int chipNr,
2423 const bool corrFlag) {
2434 <<
"\n ******************************************\n (in parseEnergySumZdc)\n condition = " << condition
2435 <<
"\n type = " <<
type <<
"\n name = " <<
name;
2441 if (condEnergySumZdc.
getType() == esConditionType::ZDCPlus) {
2442 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCPlus " << std::endl;
2445 }
else if (condEnergySumZdc.
getType() == esConditionType::ZDCMinus) {
2446 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCMinus " << std::endl;
2450 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for ZDC energy-sum condition (" <<
type <<
")" << std::endl;
2458 std::vector<EnergySumZdcTemplate::ObjectParameter> objParameter(nrObj);
2461 int lowerThresholdInd = 0;
2462 int upperThresholdInd = -1;
2476 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2479 relativeBx =
object.getBxOffset();
2482 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2483 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2486 switch (
cut.getCutType()) {
2488 lowerThresholdInd =
cut.getMinimum().index;
2489 upperThresholdInd =
cut.getMaximum().index;
2492 case esCutType::Count:
2493 lowerThresholdInd =
cut.getMinimum().index;
2494 upperThresholdInd = 0xffffff;
2504 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2505 objParameter[cnt].etHighThreshold = upperThresholdInd;
2508 LogDebug(
"TriggerMenuParser") <<
"\n EnergySumZdc ET high threshold (hex) for energy sum object " << cnt
2509 <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2510 << objParameter[cnt].etHighThreshold <<
std::dec;
2516 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2531 std::ostringstream myCoutStream;
2532 energySumCond.
print(myCoutStream);
2533 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2537 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2538 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2542 (m_vecEnergySumZdcTemplate[chipNr]).
push_back(energySumCond);
2569 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2570 <<
"\n (in parseEnergySum) " 2571 <<
"\n condition = " << condition <<
"\n type = " <<
type 2572 <<
"\n name = " <<
name << std::endl;
2584 }
else if (corrESum->
getType() == esObjectType::ETMHF) {
2587 }
else if (corrESum->
getType() == esObjectType::TOWERCOUNT) {
2591 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2604 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2620 int lowerThresholdInd = 0;
2621 int upperThresholdInd = -1;
2623 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2625 const std::vector<L1TUtmCut>&
cuts = corrESum->
getCuts();
2626 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2629 switch (
cut.getCutType()) {
2631 lowerThresholdInd =
cut.getMinimum().index;
2632 upperThresholdInd =
cut.getMaximum().index;
2635 case esCutType::Eta:
2640 phiWindow1Lower =
cut.getMinimum().index;
2641 phiWindow1Upper =
cut.getMaximum().index;
2642 }
else if (cntPhi == 1) {
2643 phiWindow2Lower =
cut.getMinimum().index;
2644 phiWindow2Upper =
cut.getMaximum().index;
2646 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2660 objParameter[0].etLowThreshold = lowerThresholdInd;
2661 objParameter[0].etHighThreshold = upperThresholdInd;
2662 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2663 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2664 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2665 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2668 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2669 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2670 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2671 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2672 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2673 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2677 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2692 std::ostringstream myCoutStream;
2693 energySumCond.
print(myCoutStream);
2694 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2712 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2737 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2738 <<
" (in parseAXOL1TL) " << std::endl
2739 <<
" condition = " << condition << std::endl
2740 <<
" type = " <<
type << std::endl
2741 <<
" name = " <<
name << std::endl;
2743 const int nrObj = 1;
2746 std::vector<AXOL1TLTemplate::ObjectParameter> objParameter(nrObj);
2748 if (
int(condAXOL1TL.
getObjects().size()) != nrObj) {
2749 edm::LogError(
"TriggerMenuParser") <<
" condAXOL1TL objects: nrObj = " << nrObj
2750 <<
"condAXOL1TL.getObjects().size() = " << condAXOL1TL.
getObjects().size()
2757 int relativeBx =
object.getBxOffset();
2758 bool gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2761 int lowerThresholdInd = 0;
2762 int upperThresholdInd = -1;
2768 if (
object.getType() == tmeventsetup::Axol1tl) {
2769 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2770 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2774 if (
cut.getCutType() == tmeventsetup::Model) {
2778 else if (
cut.getCutType() == esCutType::Score) {
2779 lowerThresholdInd =
cut.getMinimum().value;
2780 upperThresholdInd =
cut.getMaximum().value;
2786 else if (condAXOL1TL.
getType() == esConditionType::AnomalyDetectionTrigger) {
2790 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2791 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2793 if (
cut.getCutType() == esCutType::AnomalyScore) {
2794 lowerThresholdInd =
cut.getMinimum().value;
2795 upperThresholdInd =
cut.getMaximum().value;
2800 edm::LogError(
"TriggerMenuParser") <<
" Error: not a proper AXOL1TL condition" << std::endl;
2806 edm::LogError(
"TriggerMenuParser") <<
" Error: AXOL1TL movel version is empty" << std::endl;
2811 objParameter[0].minAXOL1TLThreshold = lowerThresholdInd;
2812 objParameter[0].maxAXOL1TLThreshold = upperThresholdInd;
2824 std::ostringstream myCoutStream;
2825 axol1tlCond.
print(myCoutStream);
2826 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2830 if (!insertConditionIntoMap(axol1tlCond, chipNr)) {
2831 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate AXOL1TL condition (" <<
name <<
")" << std::endl;
2835 (m_vecAXOL1TLTemplate[chipNr]).
push_back(axol1tlCond);
2860 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2861 <<
"\n (in parseExternal) " 2862 <<
"\n condition = " << condition <<
"\n particle = " << particle
2863 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2872 unsigned int channelID = 0;
2878 if (
object.getType() == esObjectType::EXT) {
2879 relativeBx =
object.getBxOffset();
2880 channelID =
object.getExternalChannelId();
2888 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2900 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2903 if (!insertConditionIntoMap(externalCond, chipNr)) {
2904 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2908 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2922 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2923 <<
" (in parseCICADA) " << std::endl
2924 <<
" condition = " << condition << std::endl
2925 <<
" type = " <<
type << std::endl
2926 <<
" name = " <<
name << std::endl;
2927 const int nrObj = 1;
2930 std::vector<CICADATemplate::ObjectParameter> objParameter(nrObj);
2932 if (
int(condCICADA.
getObjects().size()) != nrObj) {
2933 edm::LogError(
"TriggerMenuParser") <<
" condCICADA objects: nrObj = " << nrObj
2934 <<
"condCICADA.getObjects().size() = " << condCICADA.
getObjects().size()
2940 int relativeBx =
object.getBxOffset();
2941 bool gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2943 float lowerThresholdInd = 0;
2944 float upperThresholdInd = -1;
2946 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2947 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2950 switch (
cut.getCutType()) {
2951 case esCutType::CicadaScore:
2952 lowerThresholdInd =
cut.getMinimum().value;
2953 upperThresholdInd =
cut.getMaximum().value;
2957 objParameter[0].minCICADAThreshold = lowerThresholdInd;
2958 objParameter[0].maxCICADAThreshold = upperThresholdInd;
2968 std::ostringstream myCoutStream;
2969 cicadaCond.
print(myCoutStream);
2970 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2973 if (!insertConditionIntoMap(cicadaCond, chipNr)) {
2974 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate CICADA condition (" <<
name <<
")" << std::endl;
2978 (m_vecCICADATemplate[chipNr]).
push_back(cicadaCond);
3002 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3003 <<
" (in parseCorrelation) " << std::endl
3004 <<
" condition = " << condition << std::endl
3005 <<
" particle = " << particle << std::endl
3006 <<
" type = " <<
type << std::endl
3007 <<
" name = " <<
name << std::endl;
3013 if (!insertConditionIntoMap(correlationCond, chipNr)) {
3014 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3025 const int nrObj = 2;
3028 int intGEq[nrObj] = {-1, -1};
3029 std::vector<GlobalObject>
objType(nrObj);
3030 std::vector<GtConditionCategory> condCateg(nrObj);
3033 const bool corrFlag =
true;
3034 int corrIndexVal[nrObj] = {-1, -1};
3042 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3043 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3046 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3047 if (
cut.getData() ==
"ls")
3049 else if (
cut.getData() ==
"os")
3057 double minV =
cut.getMinimum().value;
3058 double maxV =
cut.getMaximum().value;
3065 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
3066 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3067 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3071 cutType = cutType | 0x1;
3073 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
3074 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3075 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3079 cutType = cutType | 0x2;
3081 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
3082 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3083 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3087 cutType = cutType | 0x4;
3088 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
3092 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
3093 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3094 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3095 cutType = cutType | 0x20;
3097 (
cut.getCutType() == esCutType::MassDeltaR)) {
3098 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3099 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3100 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3105 if (corrCond.
getType() == esConditionType::TransverseMass) {
3106 cutType = cutType | 0x10;
3107 }
else if (corrCond.
getType() == esConditionType::InvariantMassDeltaR) {
3108 cutType = cutType | 0x80;
3110 cutType = cutType | 0x8;
3112 }
else if (
cut.getCutType() == esCutType::MassUpt) {
3113 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3114 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3115 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3119 cutType = cutType | 0x40;
3128 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3129 <<
" corrFlag " << corrFlag << std::endl;
3136 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3137 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3138 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3139 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3176 parseMuonCorr(&
object, chipNr);
3177 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3180 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3184 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3187 parseCaloCorr(&
object, chipNr);
3188 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3191 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3192 switch (
object.getType()) {
3193 case esObjectType::Egamma: {
3207 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3208 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3210 parseEnergySumCorr(&
object, chipNr);
3211 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3214 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3215 switch (
object.getType()) {
3222 case esObjectType::ETMHF: {
3225 case esObjectType::TOWERCOUNT: {
3234 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3235 <<
" for the correlation condition " <<
name << std::endl;
3244 if (intGEq[0] != intGEq[1]) {
3245 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3246 <<
" for the correlation condition " <<
name << std::endl;
3250 gEq = (intGEq[0] != 0);
3268 std::ostringstream myCoutStream;
3269 correlationCond.
print(myCoutStream);
3270 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3276 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
3302 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3303 <<
" (in parseCorrelationThreeBody) " << std::endl
3304 <<
" condition = " << condition << std::endl
3305 <<
" particle = " << particle << std::endl
3306 <<
" type = " <<
type << std::endl
3307 <<
" name = " <<
name << std::endl;
3313 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
3314 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3322 const int nrObj = 3;
3325 std::vector<GlobalObject>
objType(nrObj);
3326 std::vector<GtConditionCategory> condCateg(nrObj);
3329 const bool corrFlag =
true;
3330 int corrIndexVal[nrObj] = {-1, -1, -1};
3340 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3341 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
3344 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3345 if (
cut.getData() ==
"ls")
3347 else if (
cut.getData() ==
"os")
3356 double minV =
cut.getMinimum().value;
3357 double maxV =
cut.getMaximum().value;
3363 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3364 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3365 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3369 cutType = cutType | 0x8;
3370 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3374 cutType = cutType | 0x80;
3382 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3383 <<
" corrFlag " << corrFlag << std::endl;
3388 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3390 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3391 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3392 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3397 parseMuonCorr(&
object, chipNr);
3398 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).size() - 1;
3405 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3406 <<
" for the correlation condition " <<
name 3407 <<
": no three muons in the event!" << std::endl;
3427 std::ostringstream myCoutStream;
3428 correlationThreeBodyCond.
print(myCoutStream);
3429 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3435 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3461 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3462 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3463 <<
" condition = " << condition << std::endl
3464 <<
" particle = " << particle << std::endl
3465 <<
" type = " <<
type << std::endl
3466 <<
" name = " <<
name << std::endl;
3472 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3473 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3484 const int nrObj = 3;
3487 int intGEq[nrObj] = {-1, -1, -1};
3488 std::vector<GlobalObject>
objType(nrObj);
3489 std::vector<GtConditionCategory> condCateg(nrObj);
3492 const bool corrFlag =
true;
3493 int corrIndexVal[nrObj] = {-1, -1, -1};
3501 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3502 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3505 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3506 if (
cut.getData() ==
"ls")
3508 else if (
cut.getData() ==
"os")
3516 double minV =
cut.getMinimum().value;
3517 double maxV =
cut.getMaximum().value;
3528 cutType = cutType | 0x1;
3534 cutType = cutType | 0x2;
3540 cutType = cutType | 0x4;
3546 cutType = cutType | 0x8;
3547 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3551 cutType = cutType | 0x80;
3553 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3558 cutType = cutType | 0x10;
3559 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3564 cutType = cutType | 0x20;
3565 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3570 cutType = cutType | 0x40;
3580 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3581 << corrFlag << std::endl;
3588 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3589 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3590 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3591 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3592 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3629 parseMuonCorr(&
object, chipNr);
3630 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3633 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3637 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3640 parseCaloCorr(&
object, chipNr);
3641 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3644 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3645 switch (
object.getType()) {
3646 case esObjectType::Egamma: {
3660 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3661 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3663 parseEnergySumCorr(&
object, chipNr);
3664 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3667 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3668 switch (
object.getType()) {
3675 case esObjectType::ETMHF: {
3678 case esObjectType::TOWERCOUNT: {
3687 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3688 <<
" for the correlation condition " <<
name << std::endl;
3697 if (intGEq[0] != intGEq[1]) {
3698 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3699 <<
" for the correlation condition " <<
name << std::endl;
3703 gEq = (intGEq[0] != 0);
3723 std::ostringstream myCoutStream;
3724 correlationWORCond.
print(myCoutStream);
3725 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3731 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3753 if (algAlias.empty()) {
3755 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3756 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3760 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3761 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3768 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3769 <<
" Chip number: " << chipNr << std::endl;
3775 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3790 std::ostringstream myCoutStream;
3791 alg.
print(myCoutStream);
3792 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3796 if (!insertAlgorithmIntoMap(alg)) {
unsigned int chargeCorrelation
unsigned int precOverlapRemovalPhiCut
constexpr int32_t ceil(float num)
long long maxOverlapRemovalEtaCutValue
void setCondGEq(const bool &cGEq)
void setModelVersion(const std::string &modelversion)
long long maxMassCutValue
void setAlgoAlias(const std::string &algoAliasValue)
const int getType() const
const std::vector< L1TUtmCut > & getCuts() const
void setConditionParameter(const std::vector< ObjectParameter > &objParameter)
set functions
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 print(std::ostream &myCout) const override
print the condition
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
void print(std::ostream &myCout) const override
print 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})
void setConditionParameter(const std::vector< ObjectParameter > &objParameter)
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
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
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 &)