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 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
152 m_vecExternalTemplate = vecExternalTempl;
156 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
157 m_vecCorrelationTemplate = vecCorrelationTempl;
161 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
162 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
166 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
167 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
173 m_corMuonTemplate = corMuonTempl;
177 m_corCaloTemplate = corCaloTempl;
181 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
182 m_corEnergySumTemplate = corEnergySumTempl;
193 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
195 std::map<std::string, unsigned int> extBitMap;
198 for (
const auto& cit : condMap) {
200 if (condition.
getType() == esConditionType::Externals) {
203 for (
const auto&
object :
objects) {
204 if (
object.getType() == esObjectType::EXT) {
205 unsigned int channelID =
object.getExternalChannelId();
208 if (extBitMap.count(
name) == 0)
222 m_conditionMap.resize(m_numberConditionChips);
224 m_vecMuonTemplate.resize(m_numberConditionChips);
225 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
226 m_vecCaloTemplate.resize(m_numberConditionChips);
227 m_vecEnergySumTemplate.resize(m_numberConditionChips);
228 m_vecEnergySumZdcTemplate.resize(m_numberConditionChips);
229 m_vecAXOL1TLTemplate.resize(m_numberConditionChips);
230 m_vecExternalTemplate.resize(m_numberConditionChips);
232 m_vecCorrelationTemplate.resize(m_numberConditionChips);
233 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
234 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
235 m_corMuonTemplate.resize(m_numberConditionChips);
236 m_corCaloTemplate.resize(m_numberConditionChips);
237 m_corEnergySumTemplate.resize(m_numberConditionChips);
243 m_triggerMenuDescription = utmMenu->
getComment();
245 m_triggerMenuImplementation = (getMmHashN(utmMenu->
getFirmwareUuid()) & 0xFFFFFFFF);
246 m_triggerMenuName = utmMenu->
getName();
247 m_triggerMenuInterface = utmMenu->
getVersion();
248 m_triggerMenuUUID = (getMmHashN(utmMenu->
getName()) & 0xFFFFFFFF);
250 const std::map<std::string, L1TUtmAlgorithm>& algoMap = utmMenu->
getAlgorithmMap();
251 const std::map<std::string, L1TUtmCondition>& condMap = utmMenu->
getConditionMap();
253 const std::map<std::string, tmeventsetup::esScale> scaleMap(std::begin(utmMenu->
getScaleMap()),
258 parseScales(scaleMap);
261 for (
const auto& cit : algoMap) {
269 parseAlgorithm(
algo, chipNr);
272 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
273 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
281 if ((m_conditionMap[chipNr]).
count(condition.
getName()) == 0) {
283 if (condition.
getType() == esConditionType::SingleEgamma ||
284 condition.
getType() == esConditionType::DoubleEgamma ||
285 condition.
getType() == esConditionType::TripleEgamma ||
286 condition.
getType() == esConditionType::QuadEgamma || condition.
getType() == esConditionType::SingleTau ||
287 condition.
getType() == esConditionType::DoubleTau || condition.
getType() == esConditionType::TripleTau ||
288 condition.
getType() == esConditionType::QuadTau || condition.
getType() == esConditionType::SingleJet ||
289 condition.
getType() == esConditionType::DoubleJet || condition.
getType() == esConditionType::TripleJet ||
290 condition.
getType() == esConditionType::QuadJet) {
291 parseCalo(condition, chipNr,
false);
294 }
else if (condition.
getType() == esConditionType::TotalEt ||
295 condition.
getType() == esConditionType::TotalEtEM ||
296 condition.
getType() == esConditionType::TotalHt ||
297 condition.
getType() == esConditionType::MissingEt ||
298 condition.
getType() == esConditionType::MissingHt ||
299 condition.
getType() == esConditionType::MissingEtHF ||
300 condition.
getType() == esConditionType::TowerCount ||
301 condition.
getType() == esConditionType::MinBiasHFP0 ||
302 condition.
getType() == esConditionType::MinBiasHFM0 ||
303 condition.
getType() == esConditionType::MinBiasHFP1 ||
304 condition.
getType() == esConditionType::MinBiasHFM1 ||
305 condition.
getType() == esConditionType::AsymmetryEt ||
306 condition.
getType() == esConditionType::AsymmetryHt ||
307 condition.
getType() == esConditionType::AsymmetryEtHF ||
308 condition.
getType() == esConditionType::AsymmetryHtHF ||
309 condition.
getType() == esConditionType::Centrality0 ||
310 condition.
getType() == esConditionType::Centrality1 ||
311 condition.
getType() == esConditionType::Centrality2 ||
312 condition.
getType() == esConditionType::Centrality3 ||
313 condition.
getType() == esConditionType::Centrality4 ||
314 condition.
getType() == esConditionType::Centrality5 ||
315 condition.
getType() == esConditionType::Centrality6 ||
316 condition.
getType() == esConditionType::Centrality7) {
317 parseEnergySum(condition, chipNr,
false);
320 }
else if (condition.
getType() == esConditionType::ZDCPlus ||
321 condition.
getType() == esConditionType::ZDCMinus) {
322 parseEnergySumZdc(condition, chipNr,
false);
325 }
else if (condition.
getType() == esConditionType::Axol1tlTrigger ||
326 condition.
getType() == esConditionType::AnomalyDetectionTrigger) {
327 parseAXOL1TL(condition, chipNr);
331 condition.
getType() == esConditionType::DoubleMuon ||
332 condition.
getType() == esConditionType::TripleMuon ||
333 condition.
getType() == esConditionType::QuadMuon) {
334 parseMuon(condition, chipNr,
false);
336 }
else if (condition.
getType() == esConditionType::MuonShower0 ||
337 condition.
getType() == esConditionType::MuonShower1 ||
338 condition.
getType() == esConditionType::MuonShower2 ||
339 condition.
getType() == esConditionType::MuonShowerOutOfTime0 ||
340 condition.
getType() == esConditionType::MuonShowerOutOfTime1) {
341 parseMuonShower(condition, chipNr,
false);
344 }
else if (condition.
getType() == esConditionType::MuonMuonCorrelation ||
345 condition.
getType() == esConditionType::MuonEsumCorrelation ||
346 condition.
getType() == esConditionType::CaloMuonCorrelation ||
347 condition.
getType() == esConditionType::CaloCaloCorrelation ||
348 condition.
getType() == esConditionType::CaloEsumCorrelation ||
349 condition.
getType() == esConditionType::InvariantMass ||
350 condition.
getType() == esConditionType::InvariantMassDeltaR ||
351 condition.
getType() == esConditionType::TransverseMass ||
352 condition.
getType() == esConditionType::InvariantMassUpt) {
353 parseCorrelation(condition, chipNr);
356 }
else if (condition.
getType() == esConditionType::InvariantMass3) {
357 parseCorrelationThreeBody(condition, chipNr);
360 }
else if (condition.
getType() == esConditionType::Externals) {
361 parseExternal(condition, chipNr);
364 }
else if (condition.
getType() == esConditionType::CaloCaloCorrelationOvRm ||
365 condition.
getType() == esConditionType::InvariantMassOvRm ||
366 condition.
getType() == esConditionType::TransverseMassOvRm ||
367 condition.
getType() == esConditionType::DoubleJetOvRm ||
368 condition.
getType() == esConditionType::DoubleTauOvRm) {
369 parseCorrelationWithOverlapRemoval(condition, chipNr);
371 }
else if (condition.
getType() == esConditionType::SingleEgammaOvRm ||
372 condition.
getType() == esConditionType::DoubleEgammaOvRm ||
373 condition.
getType() == esConditionType::TripleEgammaOvRm ||
374 condition.
getType() == esConditionType::QuadEgammaOvRm ||
375 condition.
getType() == esConditionType::SingleTauOvRm ||
376 condition.
getType() == esConditionType::TripleTauOvRm ||
377 condition.
getType() == esConditionType::QuadTauOvRm ||
378 condition.
getType() == esConditionType::SingleJetOvRm ||
379 condition.
getType() == esConditionType::TripleJetOvRm ||
380 condition.
getType() == esConditionType::QuadJetOvRm) {
382 <<
"\n SingleEgammaOvRm" 383 <<
"\n DoubleEgammaOvRm" 384 <<
"\n TripleEgammaOvRm" 385 <<
"\n QuadEgammaOvRm" 386 <<
"\n SingleTauOvRm" 387 <<
"\n TripleTauOvRm" 389 <<
"\n SingleJetOvRm" 390 <<
"\n TripleJetOvRm" 392 <<
"\n The above conditions types OvRm are not implemented yet in the " 393 "parser. Please remove alogrithms that " 394 "use this type of condtion from L1T Menu!" 410 m_triggerMenuInterfaceAuthor =
val;
414 m_triggerMenuInterfaceDescription =
val;
432 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
436 itCondOnChip->clear();
440 m_algorithmMap.clear();
447 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 451 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
452 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
456 (m_conditionMap[chipNr])[cName] = &
cond;
457 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
470 if (m_algorithmMap.count(algName) != 0) {
471 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
472 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
476 if (m_algorithmAliasMap.count(algAlias) != 0) {
477 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
478 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
485 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 486 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
491 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
492 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
493 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
499 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
501 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
502 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 503 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
509 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
511 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
512 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 513 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
518 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
519 int iPin = (itAlgo->second)
520 .algoOutputPin(static_cast<int>(m_numberConditionChips),
521 static_cast<int>(m_pinsOnConditionChip),
522 m_orderConditionChip);
524 int iChip = (itAlgo->second)
525 .algoChipNumber(static_cast<int>(m_numberConditionChips),
526 static_cast<int>(m_pinsOnConditionChip),
527 m_orderConditionChip);
529 if ((outputPin == iPin) && (chipNr == iChip)) {
530 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
531 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 538 m_algorithmMap[algName] = alg;
539 m_algorithmAliasMap[algAlias] = alg;
548 template <
typename T>
550 std::stringstream
ss;
555 std::stringstream
ss;
586 for (std::map<std::string, tmeventsetup::esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end();
588 const tmeventsetup::esScale&
scale = cit->second;
592 scaleParam = &muScales;
593 else if (
scale.getObjectType() == esObjectType::Egamma)
594 scaleParam = &egScales;
596 scaleParam = &tauScales;
598 scaleParam = &jetScales;
600 scaleParam = &ettScales;
601 else if (
scale.getObjectType() == esObjectType::ETTEM)
602 scaleParam = &ettEmScales;
604 scaleParam = &etmScales;
605 else if (
scale.getObjectType() == esObjectType::ETMHF)
606 scaleParam = &etmHfScales;
608 scaleParam = &httScales;
610 scaleParam = &htmScales;
612 scaleParam = &zdcScales;
614 scaleParam =
nullptr;
616 if (scaleParam !=
nullptr) {
617 switch (
scale.getScaleType()) {
618 case esScaleType::EtScale: {
624 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
625 for (
unsigned int i = 0;
i < binsV.size();
i++) {
626 const tmeventsetup::esBin&
bin = binsV.at(
i);
627 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
628 scaleParam->
etBins.push_back(binLimits);
635 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
640 scale.getObjectType() == esObjectType::ETTEM) {
648 case esScaleType::UnconstrainedPtScale: {
654 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->
uptBins.push_back(binLimits);
661 case esScaleType::EtaScale: {
667 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
669 for (
unsigned int i = 0;
i < binsV.size();
i++) {
670 const tmeventsetup::esBin&
bin = binsV.at(
i);
671 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
672 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
675 case esScaleType::PhiScale: {
681 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
683 for (
unsigned int i = 0;
i < binsV.size();
i++) {
684 const tmeventsetup::esBin&
bin = binsV.at(
i);
685 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
686 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
697 m_gtScales.setMuonScales(muScales);
698 m_gtScales.setEGScales(egScales);
699 m_gtScales.setTauScales(tauScales);
700 m_gtScales.setJetScales(jetScales);
701 m_gtScales.setETTScales(ettScales);
702 m_gtScales.setETTEmScales(ettEmScales);
703 m_gtScales.setETMScales(etmScales);
704 m_gtScales.setETMHfScales(etmHfScales);
705 m_gtScales.setHTTScales(httScales);
706 m_gtScales.setHTMScales(htmScales);
707 m_gtScales.setHTMScales(zdcScales);
710 bool hasPrecision =
false;
711 std::map<std::string, unsigned int> precisions;
712 getPrecisions(precisions, scaleMap);
713 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
720 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
721 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
722 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
726 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
727 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
728 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
729 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
730 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
731 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
735 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
736 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
737 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
738 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
739 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
740 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
741 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
742 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
746 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
747 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
748 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
749 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
750 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
751 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
752 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
756 parseDeltaEta_Cosh_LUTS(
757 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
758 parseDeltaEta_Cosh_LUTS(
759 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
760 parseDeltaEta_Cosh_LUTS(
761 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
762 parseDeltaEta_Cosh_LUTS(
763 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
765 parseDeltaEta_Cosh_LUTS(
766 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
767 parseDeltaEta_Cosh_LUTS(
768 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
769 parseDeltaEta_Cosh_LUTS(
770 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
772 parseDeltaEta_Cosh_LUTS(
773 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
774 parseDeltaEta_Cosh_LUTS(
775 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
777 parseDeltaEta_Cosh_LUTS(
778 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
782 parseDeltaPhi_Cos_LUTS(
783 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
784 parseDeltaPhi_Cos_LUTS(
785 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
786 parseDeltaPhi_Cos_LUTS(
787 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
788 parseDeltaPhi_Cos_LUTS(
789 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
790 parseDeltaPhi_Cos_LUTS(
791 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
792 parseDeltaPhi_Cos_LUTS(
793 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
794 parseDeltaPhi_Cos_LUTS(
795 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
797 parseDeltaPhi_Cos_LUTS(
798 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
799 parseDeltaPhi_Cos_LUTS(
800 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
801 parseDeltaPhi_Cos_LUTS(
802 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
803 parseDeltaPhi_Cos_LUTS(
804 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
805 parseDeltaPhi_Cos_LUTS(
806 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
807 parseDeltaPhi_Cos_LUTS(
808 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
810 parseDeltaPhi_Cos_LUTS(
811 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
812 parseDeltaPhi_Cos_LUTS(
813 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
814 parseDeltaPhi_Cos_LUTS(
815 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
816 parseDeltaPhi_Cos_LUTS(
817 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
818 parseDeltaPhi_Cos_LUTS(
819 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
821 parseDeltaPhi_Cos_LUTS(
822 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
823 parseDeltaPhi_Cos_LUTS(
824 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
825 parseDeltaPhi_Cos_LUTS(
826 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
827 parseDeltaPhi_Cos_LUTS(
828 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
830 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
831 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
832 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
833 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
835 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
836 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
837 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
838 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
860 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
863 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
864 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
866 std::vector<long long> lut_cal_2_mu_eta;
867 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
872 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
887 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
890 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
891 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
893 std::vector<long long> lut_cal_2_mu_phi;
894 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
899 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
913 if (scaleMap.find(scLabel1) == scaleMap.end())
916 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
918 std::vector<long long> lut_pt;
919 getLut(lut_pt, scale1, prec);
921 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
936 if (scaleMap.find(scLabel1) == scaleMap.end())
939 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
941 std::vector<long long> lut_pt;
942 getLut(lut_pt, scale1, prec);
944 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
951 unsigned int prec2) {
961 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
964 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
965 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
966 std::vector<double> val_delta_eta;
967 std::vector<long long> lut_delta_eta;
968 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
969 setLut(lut_delta_eta, val_delta_eta, prec1);
973 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
976 std::vector<long long> lut_cosh;
977 applyCosh(val_delta_eta,
n);
978 setLut(lut_cosh, val_delta_eta, prec2);
979 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
986 unsigned int prec2) {
996 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
999 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
1000 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
1001 std::vector<double> val_delta_phi;
1002 std::vector<long long> lut_delta_phi;
1003 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
1004 setLut(lut_delta_phi, val_delta_phi, prec1);
1008 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
1011 std::vector<long long> lut_cos;
1012 applyCos(val_delta_phi,
n);
1013 setLut(lut_cos, val_delta_phi, prec2);
1014 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
1020 unsigned int prec) {
1027 if (scaleMap.find(scLabel) == scaleMap.end())
1032 const tmeventsetup::esScale*
scale = &scaleMap.find(scLabel)->second;
1037 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1041 for (
size_t ii = 0;
ii <
n;
ii++) {
1046 std::vector<long long> lut;
1049 setLut(lut,
array, prec);
1050 m_gtScales.setLUT_Sin(lutName, lut, prec);
1053 setLut(lut,
array, prec);
1054 m_gtScales.setLUT_Cos(lutName, lut, prec);
1084 }
else if (condMu.
getType() == esConditionType::DoubleMuon) {
1088 }
else if (condMu.
getType() == esConditionType::TripleMuon) {
1092 }
else if (condMu.
getType() == esConditionType::QuadMuon) {
1097 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1102 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1103 <<
"\nCan not determine number of trigger objects. " << std::endl;
1107 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1109 <<
"\n condition = " << condition <<
"\n particle = " << particle
1110 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1115 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1121 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1122 tmpValues.reserve(nrObj);
1124 if (
int(condMu.
getObjects().size()) != nrObj) {
1125 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1126 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1131 unsigned int chargeCorrelation = 1;
1132 const std::vector<L1TUtmCut>&
cuts = condMu.
getCuts();
1133 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1135 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1136 if (
cut.getData() ==
"ls")
1137 chargeCorrelation = 2;
1138 else if (
cut.getData() ==
"os")
1139 chargeCorrelation = 4;
1141 chargeCorrelation = 1;
1158 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1161 relativeBx =
object.getBxOffset();
1164 int upperUnconstrainedPtInd = -1;
1165 int lowerUnconstrainedPtInd = 0;
1166 int upperImpactParameterInd = -1;
1167 int lowerImpactParameterInd = 0;
1168 int upperThresholdInd = -1;
1169 int lowerThresholdInd = 0;
1170 int upperIndexInd = -1;
1171 int lowerIndexInd = 0;
1173 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1174 int isolationLUT = 0xF;
1175 int impactParameterLUT = 0xF;
1177 int qualityLUT = 0xFFFF;
1179 std::vector<MuonTemplate::Window> etaWindows;
1180 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1182 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1183 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1186 switch (
cut.getCutType()) {
1187 case esCutType::UnconstrainedPt:
1188 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1189 upperUnconstrainedPtInd =
cut.getMaximum().index;
1192 case esCutType::ImpactParameter:
1193 lowerImpactParameterInd =
cut.getMinimum().index;
1194 upperImpactParameterInd =
cut.getMaximum().index;
1195 impactParameterLUT = l1tstr2int(
cut.getData());
1199 lowerThresholdInd =
cut.getMinimum().index;
1200 upperThresholdInd =
cut.getMaximum().index;
1203 case esCutType::Slice:
1204 lowerIndexInd =
int(
cut.getMinimum().value);
1205 upperIndexInd =
int(
cut.getMaximum().value);
1208 case esCutType::Eta: {
1209 if (etaWindows.size() < 5) {
1210 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1213 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1220 phiWindow1Lower =
cut.getMinimum().index;
1221 phiWindow1Upper =
cut.getMaximum().index;
1222 }
else if (cntPhi == 1) {
1223 phiWindow2Lower =
cut.getMinimum().index;
1224 phiWindow2Upper =
cut.getMaximum().index;
1227 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1235 if (
cut.getData() ==
"positive")
1237 else if (
cut.getData() ==
"negative")
1244 qualityLUT = l1tstr2int(
cut.getData());
1247 case esCutType::Isolation: {
1248 isolationLUT = l1tstr2int(
cut.getData());
1252 case esCutType::Index: {
1253 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1263 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1264 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1265 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1266 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1267 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1269 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1270 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1272 objParameter[cnt].indexHigh = upperIndexInd;
1273 objParameter[cnt].indexLow = lowerIndexInd;
1275 objParameter[cnt].etaWindows = etaWindows;
1277 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1278 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1279 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1280 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1283 objParameter[cnt].enableMip =
false;
1284 objParameter[cnt].enableIso =
false;
1285 objParameter[cnt].requestIso =
false;
1287 objParameter[cnt].charge =
charge;
1288 objParameter[cnt].qualityLUT = qualityLUT;
1289 objParameter[cnt].isolationLUT = isolationLUT;
1291 objParameter[cnt].tfMuonIndexWindows = tfMuonIndexWindows;
1311 std::ostringstream myCoutStream;
1312 muonCond.
print(myCoutStream);
1313 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1317 if (!insertConditionIntoMap(muonCond, chipNr)) {
1318 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1321 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1323 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1325 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1326 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1348 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1349 <<
"\nCan not determine number of trigger objects. " << std::endl;
1353 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1355 <<
"\n condition = " << condition <<
"\n particle = " << particle
1356 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1361 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1367 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1368 tmpValues.reserve(nrObj);
1373 unsigned int chargeCorrelation = 0;
1374 if (str_chargeCorrelation ==
"ig")
1375 chargeCorrelation = 1;
1376 else if (str_chargeCorrelation ==
"ls")
1377 chargeCorrelation = 2;
1378 else if (str_chargeCorrelation ==
"os")
1379 chargeCorrelation = 4;
1395 int upperUnconstrainedPtInd = -1;
1396 int lowerUnconstrainedPtInd = 0;
1397 int upperImpactParameterInd = -1;
1398 int lowerImpactParameterInd = 0;
1399 int impactParameterLUT = 0xF;
1400 int upperThresholdInd = -1;
1401 int lowerThresholdInd = 0;
1402 int upperIndexInd = -1;
1403 int lowerIndexInd = 0;
1405 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1406 int isolationLUT = 0xF;
1408 int qualityLUT = 0xFFFF;
1410 std::vector<MuonTemplate::Window> etaWindows;
1411 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1413 const std::vector<L1TUtmCut>&
cuts = corrMu->
getCuts();
1414 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1417 switch (
cut.getCutType()) {
1418 case esCutType::UnconstrainedPt:
1419 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1420 upperUnconstrainedPtInd =
cut.getMaximum().index;
1423 case esCutType::ImpactParameter:
1424 lowerImpactParameterInd =
cut.getMinimum().index;
1425 upperImpactParameterInd =
cut.getMaximum().index;
1426 impactParameterLUT = l1tstr2int(
cut.getData());
1430 lowerThresholdInd =
cut.getMinimum().index;
1431 upperThresholdInd =
cut.getMaximum().index;
1434 case esCutType::Slice:
1435 lowerIndexInd =
int(
cut.getMinimum().value);
1436 upperIndexInd =
int(
cut.getMaximum().value);
1439 case esCutType::Eta: {
1440 if (etaWindows.size() < 5) {
1441 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1444 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1451 phiWindow1Lower =
cut.getMinimum().index;
1452 phiWindow1Upper =
cut.getMaximum().index;
1453 }
else if (cntPhi == 1) {
1454 phiWindow2Lower =
cut.getMinimum().index;
1455 phiWindow2Upper =
cut.getMaximum().index;
1458 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1466 if (
cut.getData() ==
"positive")
1468 else if (
cut.getData() ==
"negative")
1475 qualityLUT = l1tstr2int(
cut.getData());
1478 case esCutType::Isolation: {
1479 isolationLUT = l1tstr2int(
cut.getData());
1483 case esCutType::Index: {
1484 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1494 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1495 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1496 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1497 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1498 objParameter[0].impactParameterLUT = impactParameterLUT;
1500 objParameter[0].ptHighThreshold = upperThresholdInd;
1501 objParameter[0].ptLowThreshold = lowerThresholdInd;
1503 objParameter[0].indexHigh = upperIndexInd;
1504 objParameter[0].indexLow = lowerIndexInd;
1506 objParameter[0].etaWindows = etaWindows;
1508 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1509 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1510 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1511 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1514 objParameter[0].enableMip =
false;
1515 objParameter[0].enableIso =
false;
1516 objParameter[0].requestIso =
false;
1518 objParameter[0].charge =
charge;
1519 objParameter[0].qualityLUT = qualityLUT;
1520 objParameter[0].isolationLUT = isolationLUT;
1522 objParameter[0].tfMuonIndexWindows = tfMuonIndexWindows;
1538 std::ostringstream myCoutStream;
1539 muonCond.
print(myCoutStream);
1540 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1556 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1588 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1590 if (
int(condMu.
getObjects().size()) != nrObj) {
1591 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1592 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1598 int relativeBx =
object.getBxOffset();
1600 if (condMu.
getType() == esConditionType::MuonShower0) {
1601 objParameter[0].MuonShower0 =
true;
1602 }
else if (condMu.
getType() == esConditionType::MuonShower1) {
1603 objParameter[0].MuonShower1 =
true;
1604 }
else if (condMu.
getType() == esConditionType::MuonShower2) {
1605 objParameter[0].MuonShower2 =
true;
1606 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime0) {
1607 objParameter[0].MuonShowerOutOfTime0 =
true;
1608 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime1) {
1609 objParameter[0].MuonShowerOutOfTime1 =
true;
1625 std::ostringstream myCoutStream;
1626 muonShowerCond.
print(myCoutStream);
1630 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1631 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1634 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1662 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1663 <<
"\n (in parseCalo) " 1664 <<
"\n condition = " << condition <<
"\n particle = " << particle
1665 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1674 if (condCalo.
getType() == esConditionType::SingleEgamma) {
1679 }
else if (condCalo.
getType() == esConditionType::DoubleEgamma) {
1684 }
else if (condCalo.
getType() == esConditionType::TripleEgamma) {
1689 }
else if (condCalo.
getType() == esConditionType::QuadEgamma) {
1694 }
else if (condCalo.
getType() == esConditionType::SingleJet) {
1695 caloObjType =
gtJet;
1699 }
else if (condCalo.
getType() == esConditionType::DoubleJet) {
1700 caloObjType =
gtJet;
1704 }
else if (condCalo.
getType() == esConditionType::TripleJet) {
1705 caloObjType =
gtJet;
1709 }
else if (condCalo.
getType() == esConditionType::QuadJet) {
1710 caloObjType =
gtJet;
1714 }
else if (condCalo.
getType() == esConditionType::SingleTau) {
1715 caloObjType =
gtTau;
1719 }
else if (condCalo.
getType() == esConditionType::DoubleTau) {
1720 caloObjType =
gtTau;
1724 }
else if (condCalo.
getType() == esConditionType::TripleTau) {
1725 caloObjType =
gtTau;
1729 }
else if (condCalo.
getType() == esConditionType::QuadTau) {
1730 caloObjType =
gtTau;
1735 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1742 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1743 <<
"\nCan not determine number of trigger objects. " << std::endl;
1750 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1756 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1757 tmpValues.reserve(nrObj);
1759 if (
int(condCalo.
getObjects().size()) != nrObj) {
1760 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1761 <<
"condCalo.getObjects().size() = " << condCalo.
getObjects().size()
1779 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1782 relativeBx =
object.getBxOffset();
1785 int upperThresholdInd = -1;
1786 int lowerThresholdInd = 0;
1787 int upperIndexInd = -1;
1788 int lowerIndexInd = 0;
1790 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1791 int isolationLUT = 0xF;
1792 int qualityLUT = 0xF;
1793 int displacedLUT = 0x0;
1797 std::vector<CaloTemplate::Window> etaWindows;
1799 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1800 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1803 switch (
cut.getCutType()) {
1805 lowerThresholdInd =
cut.getMinimum().index;
1806 upperThresholdInd =
cut.getMaximum().index;
1808 case esCutType::Slice:
1809 lowerIndexInd =
int(
cut.getMinimum().value);
1810 upperIndexInd =
int(
cut.getMaximum().value);
1812 case esCutType::Eta: {
1813 if (etaWindows.size() < 5) {
1814 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1817 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1824 phiWindow1Lower =
cut.getMinimum().index;
1825 phiWindow1Upper =
cut.getMaximum().index;
1826 }
else if (cntPhi == 1) {
1827 phiWindow2Lower =
cut.getMinimum().index;
1828 phiWindow2Upper =
cut.getMaximum().index;
1831 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1839 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1844 qualityLUT = l1tstr2int(
cut.getData());
1847 case esCutType::Displaced: {
1848 displacedLUT = l1tstr2int(
cut.getData());
1851 case esCutType::Isolation: {
1852 isolationLUT = l1tstr2int(
cut.getData());
1862 objParameter[cnt].etHighThreshold = upperThresholdInd;
1863 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1864 objParameter[cnt].indexHigh = upperIndexInd;
1865 objParameter[cnt].indexLow = lowerIndexInd;
1866 objParameter[cnt].etaWindows = etaWindows;
1867 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1868 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1869 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1870 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1871 objParameter[cnt].isolationLUT = isolationLUT;
1872 objParameter[cnt].qualityLUT = qualityLUT;
1873 objParameter[cnt].displacedLUT = displacedLUT;
1877 std::ostringstream oss;
1878 oss <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " << std::hex
1879 << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold;
1880 for (
const auto&
window : objParameter[cnt].etaWindows) {
1881 oss <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" <<
window.lower <<
" / 0x" 1884 oss <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" << objParameter[cnt].phiWindow1Lower
1885 <<
" / 0x" << objParameter[cnt].phiWindow1Upper <<
"\n phiWindowVeto Lower / Upper for calo object " 1886 << cnt <<
" = 0x" << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1887 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].isolationLUT
1888 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].qualityLUT
1889 <<
"\n LLP DISP LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].displacedLUT;
1890 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
1897 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1915 std::ostringstream myCoutStream;
1916 caloCond.
print(myCoutStream);
1917 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1921 if (!insertConditionIntoMap(caloCond, chipNr)) {
1922 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1927 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1929 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1959 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1960 <<
"\n (in parseCalo) " 1961 <<
"\n condition = " << condition <<
"\n particle = " << particle
1962 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1971 if (corrCalo->
getType() == esObjectType::Egamma) {
1974 caloObjType =
gtJet;
1976 caloObjType =
gtTau;
1978 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1985 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1986 <<
"\nCan not determine number of trigger objects. " << std::endl;
1993 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1999 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
2000 tmpValues.reserve(nrObj);
2012 int upperThresholdInd = -1;
2013 int lowerThresholdInd = 0;
2014 int upperIndexInd = -1;
2015 int lowerIndexInd = 0;
2017 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2018 int isolationLUT = 0xF;
2019 int qualityLUT = 0xF;
2020 int displacedLUT = 0x0;
2024 std::vector<CaloTemplate::Window> etaWindows;
2026 const std::vector<L1TUtmCut>&
cuts = corrCalo->
getCuts();
2027 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2030 switch (
cut.getCutType()) {
2032 lowerThresholdInd =
cut.getMinimum().index;
2033 upperThresholdInd =
cut.getMaximum().index;
2035 case esCutType::Slice:
2036 lowerIndexInd =
int(
cut.getMinimum().value);
2037 upperIndexInd =
int(
cut.getMaximum().value);
2039 case esCutType::Eta: {
2040 if (etaWindows.size() < 5) {
2041 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
2044 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2051 phiWindow1Lower =
cut.getMinimum().index;
2052 phiWindow1Upper =
cut.getMaximum().index;
2053 }
else if (cntPhi == 1) {
2054 phiWindow2Lower =
cut.getMinimum().index;
2055 phiWindow2Upper =
cut.getMaximum().index;
2058 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2066 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2071 qualityLUT = l1tstr2int(
cut.getData());
2074 case esCutType::Displaced: {
2075 displacedLUT = l1tstr2int(
cut.getData());
2078 case esCutType::Isolation: {
2079 isolationLUT = l1tstr2int(
cut.getData());
2089 objParameter[0].etLowThreshold = lowerThresholdInd;
2090 objParameter[0].etHighThreshold = upperThresholdInd;
2091 objParameter[0].indexHigh = upperIndexInd;
2092 objParameter[0].indexLow = lowerIndexInd;
2093 objParameter[0].etaWindows = etaWindows;
2094 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2095 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2096 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2097 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2098 objParameter[0].isolationLUT = isolationLUT;
2099 objParameter[0].qualityLUT = qualityLUT;
2100 objParameter[0].displacedLUT = displacedLUT;
2104 std::ostringstream oss;
2105 oss <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2106 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold;
2107 for (
const auto&
window : objParameter[0].etaWindows) {
2108 oss <<
"\n etaWindow Lower / Upper for calo object " 2111 oss <<
"\n phiWindow Lower / Upper for calo object " 2112 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2113 <<
"\n phiWindowVeto Lower / Upper for calo object " 2114 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2115 <<
"\n Isolation LUT for calo object " 2116 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2117 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2118 <<
" = 0x" << objParameter[0].displacedLUT;
2119 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
2123 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2141 std::ostringstream myCoutStream;
2142 caloCond.
print(myCoutStream);
2143 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2160 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2187 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2188 <<
"\n (in parseEnergySum) " 2189 <<
"\n condition = " << condition <<
"\n type = " <<
type 2190 <<
"\n name = " <<
name << std::endl;
2196 if (condEnergySum.
getType() == esConditionType::MissingEt) {
2199 }
else if (condEnergySum.
getType() == esConditionType::TotalEt) {
2202 }
else if (condEnergySum.
getType() == esConditionType::TotalEtEM) {
2205 }
else if (condEnergySum.
getType() == esConditionType::TotalHt) {
2208 }
else if (condEnergySum.
getType() == esConditionType::MissingHt) {
2211 }
else if (condEnergySum.
getType() == esConditionType::MissingEtHF) {
2214 }
else if (condEnergySum.
getType() == esConditionType::TowerCount) {
2217 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP0) {
2220 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM0) {
2223 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP1) {
2226 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM1) {
2229 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEt) {
2232 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHt) {
2235 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEtHF) {
2238 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHtHF) {
2241 }
else if (condEnergySum.
getType() == esConditionType::Centrality0) {
2244 }
else if (condEnergySum.
getType() == esConditionType::Centrality1) {
2247 }
else if (condEnergySum.
getType() == esConditionType::Centrality2) {
2250 }
else if (condEnergySum.
getType() == esConditionType::Centrality3) {
2253 }
else if (condEnergySum.
getType() == esConditionType::Centrality4) {
2256 }
else if (condEnergySum.
getType() == esConditionType::Centrality5) {
2259 }
else if (condEnergySum.
getType() == esConditionType::Centrality6) {
2262 }
else if (condEnergySum.
getType() == esConditionType::Centrality7) {
2266 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2278 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2292 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2295 relativeBx =
object.getBxOffset();
2298 int lowerThresholdInd = 0;
2299 int upperThresholdInd = -1;
2301 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2303 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2304 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2307 switch (
cut.getCutType()) {
2309 lowerThresholdInd =
cut.getMinimum().index;
2310 upperThresholdInd =
cut.getMaximum().index;
2313 case esCutType::Eta:
2318 phiWindow1Lower =
cut.getMinimum().index;
2319 phiWindow1Upper =
cut.getMaximum().index;
2320 }
else if (cntPhi == 1) {
2321 phiWindow2Lower =
cut.getMinimum().index;
2322 phiWindow2Upper =
cut.getMaximum().index;
2324 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2331 case esCutType::Count:
2332 lowerThresholdInd =
cut.getMinimum().index;
2333 upperThresholdInd = 0xffffff;
2343 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2344 objParameter[cnt].etHighThreshold = upperThresholdInd;
2345 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2346 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2347 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2348 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2351 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2352 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2353 << objParameter[cnt].etHighThreshold
2354 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2355 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2356 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2357 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2364 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2379 std::ostringstream myCoutStream;
2380 energySumCond.
print(myCoutStream);
2381 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2385 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2386 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2391 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2394 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2414 unsigned int chipNr,
2415 const bool corrFlag) {
2426 <<
"\n ******************************************\n (in parseEnergySumZdc)\n condition = " << condition
2427 <<
"\n type = " <<
type <<
"\n name = " <<
name;
2433 if (condEnergySumZdc.
getType() == esConditionType::ZDCPlus) {
2434 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCPlus " << std::endl;
2437 }
else if (condEnergySumZdc.
getType() == esConditionType::ZDCMinus) {
2438 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCMinus " << std::endl;
2442 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for ZDC energy-sum condition (" <<
type <<
")" << std::endl;
2450 std::vector<EnergySumZdcTemplate::ObjectParameter> objParameter(nrObj);
2453 int lowerThresholdInd = 0;
2454 int upperThresholdInd = -1;
2468 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2471 relativeBx =
object.getBxOffset();
2474 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2475 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2478 switch (
cut.getCutType()) {
2480 lowerThresholdInd =
cut.getMinimum().index;
2481 upperThresholdInd =
cut.getMaximum().index;
2484 case esCutType::Count:
2485 lowerThresholdInd =
cut.getMinimum().index;
2486 upperThresholdInd = 0xffffff;
2496 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2497 objParameter[cnt].etHighThreshold = upperThresholdInd;
2500 LogDebug(
"TriggerMenuParser") <<
"\n EnergySumZdc ET high threshold (hex) for energy sum object " << cnt
2501 <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2502 << objParameter[cnt].etHighThreshold <<
std::dec;
2508 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2523 std::ostringstream myCoutStream;
2524 energySumCond.
print(myCoutStream);
2525 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2529 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2530 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2534 (m_vecEnergySumZdcTemplate[chipNr]).
push_back(energySumCond);
2561 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2562 <<
"\n (in parseEnergySum) " 2563 <<
"\n condition = " << condition <<
"\n type = " <<
type 2564 <<
"\n name = " <<
name << std::endl;
2576 }
else if (corrESum->
getType() == esObjectType::ETMHF) {
2579 }
else if (corrESum->
getType() == esObjectType::TOWERCOUNT) {
2583 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2596 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2612 int lowerThresholdInd = 0;
2613 int upperThresholdInd = -1;
2615 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2617 const std::vector<L1TUtmCut>&
cuts = corrESum->
getCuts();
2618 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2621 switch (
cut.getCutType()) {
2623 lowerThresholdInd =
cut.getMinimum().index;
2624 upperThresholdInd =
cut.getMaximum().index;
2627 case esCutType::Eta:
2632 phiWindow1Lower =
cut.getMinimum().index;
2633 phiWindow1Upper =
cut.getMaximum().index;
2634 }
else if (cntPhi == 1) {
2635 phiWindow2Lower =
cut.getMinimum().index;
2636 phiWindow2Upper =
cut.getMaximum().index;
2638 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2652 objParameter[0].etLowThreshold = lowerThresholdInd;
2653 objParameter[0].etHighThreshold = upperThresholdInd;
2654 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2655 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2656 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2657 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2660 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2661 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2662 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2663 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2664 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2665 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2669 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2684 std::ostringstream myCoutStream;
2685 energySumCond.
print(myCoutStream);
2686 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2704 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2729 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2730 <<
" (in parseAXOL1TL) " << std::endl
2731 <<
" condition = " << condition << std::endl
2732 <<
" type = " <<
type << std::endl
2733 <<
" name = " <<
name << std::endl;
2735 const int nrObj = 1;
2738 std::vector<AXOL1TLTemplate::ObjectParameter> objParameter(nrObj);
2740 if (
int(condAXOL1TL.
getObjects().size()) != nrObj) {
2741 edm::LogError(
"TriggerMenuParser") <<
" condAXOL1TL objects: nrObj = " << nrObj
2742 <<
"condAXOL1TL.getObjects().size() = " << condAXOL1TL.
getObjects().size()
2749 int relativeBx =
object.getBxOffset();
2750 bool gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2753 int lowerThresholdInd = 0;
2754 int upperThresholdInd = -1;
2760 if (
object.getType() == tmeventsetup::Axol1tl) {
2761 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2762 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2766 if (
cut.getCutType() == tmeventsetup::Model) {
2770 else if (
cut.getCutType() == esCutType::Score) {
2771 lowerThresholdInd =
cut.getMinimum().value;
2772 upperThresholdInd =
cut.getMaximum().value;
2778 else if (condAXOL1TL.
getType() == esConditionType::AnomalyDetectionTrigger) {
2782 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2783 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2785 if (
cut.getCutType() == esCutType::AnomalyScore) {
2786 lowerThresholdInd =
cut.getMinimum().value;
2787 upperThresholdInd =
cut.getMaximum().value;
2792 edm::LogError(
"TriggerMenuParser") <<
" Error: not a proper AXOL1TL condition" << std::endl;
2798 edm::LogError(
"TriggerMenuParser") <<
" Error: AXOL1TL movel version is empty" << std::endl;
2803 objParameter[0].minAXOL1TLThreshold = lowerThresholdInd;
2804 objParameter[0].maxAXOL1TLThreshold = upperThresholdInd;
2816 std::ostringstream myCoutStream;
2817 axol1tlCond.
print(myCoutStream);
2818 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2822 if (!insertConditionIntoMap(axol1tlCond, chipNr)) {
2823 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate AXOL1TL condition (" <<
name <<
")" << std::endl;
2827 (m_vecAXOL1TLTemplate[chipNr]).
push_back(axol1tlCond);
2852 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2853 <<
"\n (in parseExternal) " 2854 <<
"\n condition = " << condition <<
"\n particle = " << particle
2855 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2864 unsigned int channelID = 0;
2870 if (
object.getType() == esObjectType::EXT) {
2871 relativeBx =
object.getBxOffset();
2872 channelID =
object.getExternalChannelId();
2880 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2892 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2895 if (!insertConditionIntoMap(externalCond, chipNr)) {
2896 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2900 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2925 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2926 <<
" (in parseCorrelation) " << std::endl
2927 <<
" condition = " << condition << std::endl
2928 <<
" particle = " << particle << std::endl
2929 <<
" type = " <<
type << std::endl
2930 <<
" name = " <<
name << std::endl;
2936 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2937 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2948 const int nrObj = 2;
2951 int intGEq[nrObj] = {-1, -1};
2952 std::vector<GlobalObject>
objType(nrObj);
2953 std::vector<GtConditionCategory> condCateg(nrObj);
2956 const bool corrFlag =
true;
2957 int corrIndexVal[nrObj] = {-1, -1};
2965 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2966 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2969 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2970 if (
cut.getData() ==
"ls")
2972 else if (
cut.getData() ==
"os")
2980 double minV =
cut.getMinimum().value;
2981 double maxV =
cut.getMaximum().value;
2988 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2989 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2990 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2994 cutType = cutType | 0x1;
2996 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2997 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2998 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3002 cutType = cutType | 0x2;
3004 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
3005 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3006 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3010 cutType = cutType | 0x4;
3011 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
3015 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
3016 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3017 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3018 cutType = cutType | 0x20;
3020 (
cut.getCutType() == esCutType::MassDeltaR)) {
3021 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3022 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3023 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3028 if (corrCond.
getType() == esConditionType::TransverseMass) {
3029 cutType = cutType | 0x10;
3030 }
else if (corrCond.
getType() == esConditionType::InvariantMassDeltaR) {
3031 cutType = cutType | 0x80;
3033 cutType = cutType | 0x8;
3035 }
else if (
cut.getCutType() == esCutType::MassUpt) {
3036 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3037 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3038 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3042 cutType = cutType | 0x40;
3051 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3052 <<
" corrFlag " << corrFlag << std::endl;
3059 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3060 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3061 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3062 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3099 parseMuonCorr(&
object, chipNr);
3100 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3103 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3107 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3110 parseCaloCorr(&
object, chipNr);
3111 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3114 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3115 switch (
object.getType()) {
3116 case esObjectType::Egamma: {
3130 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3131 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3133 parseEnergySumCorr(&
object, chipNr);
3134 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3137 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3138 switch (
object.getType()) {
3145 case esObjectType::ETMHF: {
3148 case esObjectType::TOWERCOUNT: {
3157 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3158 <<
" for the correlation condition " <<
name << std::endl;
3167 if (intGEq[0] != intGEq[1]) {
3168 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3169 <<
" for the correlation condition " <<
name << std::endl;
3173 gEq = (intGEq[0] != 0);
3191 std::ostringstream myCoutStream;
3192 correlationCond.
print(myCoutStream);
3193 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3199 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
3225 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3226 <<
" (in parseCorrelationThreeBody) " << std::endl
3227 <<
" condition = " << condition << std::endl
3228 <<
" particle = " << particle << std::endl
3229 <<
" type = " <<
type << std::endl
3230 <<
" name = " <<
name << std::endl;
3236 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
3237 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3245 const int nrObj = 3;
3248 std::vector<GlobalObject>
objType(nrObj);
3249 std::vector<GtConditionCategory> condCateg(nrObj);
3252 const bool corrFlag =
true;
3253 int corrIndexVal[nrObj] = {-1, -1, -1};
3263 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3264 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
3267 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3268 if (
cut.getData() ==
"ls")
3270 else if (
cut.getData() ==
"os")
3279 double minV =
cut.getMinimum().value;
3280 double maxV =
cut.getMaximum().value;
3286 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3287 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3288 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3292 cutType = cutType | 0x8;
3293 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3297 cutType = cutType | 0x80;
3305 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3306 <<
" corrFlag " << corrFlag << std::endl;
3311 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3313 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3314 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3315 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3320 parseMuonCorr(&
object, chipNr);
3321 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).size() - 1;
3328 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3329 <<
" for the correlation condition " <<
name 3330 <<
": no three muons in the event!" << std::endl;
3350 std::ostringstream myCoutStream;
3351 correlationThreeBodyCond.
print(myCoutStream);
3352 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3358 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3384 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3385 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3386 <<
" condition = " << condition << std::endl
3387 <<
" particle = " << particle << std::endl
3388 <<
" type = " <<
type << std::endl
3389 <<
" name = " <<
name << std::endl;
3395 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3396 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3407 const int nrObj = 3;
3410 int intGEq[nrObj] = {-1, -1, -1};
3411 std::vector<GlobalObject>
objType(nrObj);
3412 std::vector<GtConditionCategory> condCateg(nrObj);
3415 const bool corrFlag =
true;
3416 int corrIndexVal[nrObj] = {-1, -1, -1};
3424 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3425 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3428 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3429 if (
cut.getData() ==
"ls")
3431 else if (
cut.getData() ==
"os")
3439 double minV =
cut.getMinimum().value;
3440 double maxV =
cut.getMaximum().value;
3451 cutType = cutType | 0x1;
3457 cutType = cutType | 0x2;
3463 cutType = cutType | 0x4;
3469 cutType = cutType | 0x8;
3470 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3474 cutType = cutType | 0x80;
3476 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3481 cutType = cutType | 0x10;
3482 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3487 cutType = cutType | 0x20;
3488 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3493 cutType = cutType | 0x40;
3503 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3504 << corrFlag << std::endl;
3511 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3512 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3513 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3514 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3515 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3552 parseMuonCorr(&
object, chipNr);
3553 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3556 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3560 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3563 parseCaloCorr(&
object, chipNr);
3564 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3567 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3568 switch (
object.getType()) {
3569 case esObjectType::Egamma: {
3583 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3584 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3586 parseEnergySumCorr(&
object, chipNr);
3587 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3590 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3591 switch (
object.getType()) {
3598 case esObjectType::ETMHF: {
3601 case esObjectType::TOWERCOUNT: {
3610 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3611 <<
" for the correlation condition " <<
name << std::endl;
3620 if (intGEq[0] != intGEq[1]) {
3621 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3622 <<
" for the correlation condition " <<
name << std::endl;
3626 gEq = (intGEq[0] != 0);
3646 std::ostringstream myCoutStream;
3647 correlationWORCond.
print(myCoutStream);
3648 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3654 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3676 if (algAlias.empty()) {
3678 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3679 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3683 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3684 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3691 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3692 <<
" Chip number: " << chipNr << std::endl;
3698 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3713 std::ostringstream myCoutStream;
3714 alg.
print(myCoutStream);
3715 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3719 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
Log< level::Error, false > LogError
const int getComparisonOperator() const
const std::string & getName() const
void setCondRelativeBx(const int &cRelativeBx)
std::vector< std::pair< double, double > > phiBins
void setCond0Category(const l1t::GtConditionCategory &)
void print(std::ostream &myCout) const override
print the condition
void setCondChipNr(const int &cChipNr)
const int algoChipNumber() const
get / set algorithm bit number
long long minMassCutValue
void print(std::ostream &myCout) const override
print the condition
long long maxMassCutValue
void setCorrelationWithOverlapRemovalParameter(const CorrelationWithOverlapRemovalParameter &corrParameter)
const int getBxOffset() const
void setCond0Category(const l1t::GtConditionCategory &)
Container::value_type value_type
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void setExternalChannel(unsigned int extCh)
set functions
long long minOverlapRemovalEtaCutValue
void setCond0Index(const int &)
virtual void print(std::ostream &myCout) const
print condition
const int getType() const
void print(std::ostream &myCout) const override
print the condition
long long minMassCutValue
long long minTBPTCutValue
void setCond1Category(const l1t::GtConditionCategory &)
unsigned int precOverlapRemovalEtaCut
long long minOverlapRemovalPhiCutValue
void setCond1Index(const int &)
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
unsigned int chargeCorrelation
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
const std::string & getName() const
void setObjectType(const std::vector< l1t::GlobalObject > &objType)
void setCond1Category(const l1t::GtConditionCategory &)
void setCond2Category(const l1t::GtConditionCategory &)
void setCond2Index(const int &)
long long maxOverlapRemovalDRCutValue
void setCond0Category(const l1t::GtConditionCategory &)
void print(std::ostream &myCout) const override
print the condition
void print(std::ostream &myCout) const override
print the condition
const std::vector< L1TUtmCut > & getCuts() const
unsigned int precOverlapRemovalDRCut
std::vector< std::pair< double, double > > etBins
void setAlgoChipNumber(const int algoChipNumberValue)
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
typedef for a single object template
long long maxOverlapRemovalPhiCutValue
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
typedef for correlation parameters
long long maxTBPTCutValue
char data[epos_bytes_allocation]
long long minOverlapRemovalDRCutValue
std::string const & algoAlias() const
get / set algorithm alias
std::vector< std::pair< double, double > > uptBins
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
typedef for correlation parameters
void print(std::ostream &myCout) const override
print the condition
void setCond1Category(const l1t::GtConditionCategory &)
typedef for correlation parameters
unsigned int chargeCorrelation
void setCond2Category(const l1t::GtConditionCategory &)
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
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 &)