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::AnomalyDetectionTrigger) {
326 parseAXOL1TL(condition, chipNr);
330 condition.
getType() == esConditionType::DoubleMuon ||
331 condition.
getType() == esConditionType::TripleMuon ||
332 condition.
getType() == esConditionType::QuadMuon) {
333 parseMuon(condition, chipNr,
false);
335 }
else if (condition.
getType() == esConditionType::MuonShower0 ||
336 condition.
getType() == esConditionType::MuonShower1 ||
337 condition.
getType() == esConditionType::MuonShower2 ||
338 condition.
getType() == esConditionType::MuonShowerOutOfTime0 ||
339 condition.
getType() == esConditionType::MuonShowerOutOfTime1) {
340 parseMuonShower(condition, chipNr,
false);
343 }
else if (condition.
getType() == esConditionType::MuonMuonCorrelation ||
344 condition.
getType() == esConditionType::MuonEsumCorrelation ||
345 condition.
getType() == esConditionType::CaloMuonCorrelation ||
346 condition.
getType() == esConditionType::CaloCaloCorrelation ||
347 condition.
getType() == esConditionType::CaloEsumCorrelation ||
348 condition.
getType() == esConditionType::InvariantMass ||
349 condition.
getType() == esConditionType::InvariantMassDeltaR ||
350 condition.
getType() == esConditionType::TransverseMass ||
351 condition.
getType() == esConditionType::InvariantMassUpt) {
352 parseCorrelation(condition, chipNr);
355 }
else if (condition.
getType() == esConditionType::InvariantMass3) {
356 parseCorrelationThreeBody(condition, chipNr);
359 }
else if (condition.
getType() == esConditionType::Externals) {
360 parseExternal(condition, chipNr);
363 }
else if (condition.
getType() == esConditionType::CaloCaloCorrelationOvRm ||
364 condition.
getType() == esConditionType::InvariantMassOvRm ||
365 condition.
getType() == esConditionType::TransverseMassOvRm ||
366 condition.
getType() == esConditionType::DoubleJetOvRm ||
367 condition.
getType() == esConditionType::DoubleTauOvRm) {
368 parseCorrelationWithOverlapRemoval(condition, chipNr);
370 }
else if (condition.
getType() == esConditionType::SingleEgammaOvRm ||
371 condition.
getType() == esConditionType::DoubleEgammaOvRm ||
372 condition.
getType() == esConditionType::TripleEgammaOvRm ||
373 condition.
getType() == esConditionType::QuadEgammaOvRm ||
374 condition.
getType() == esConditionType::SingleTauOvRm ||
375 condition.
getType() == esConditionType::TripleTauOvRm ||
376 condition.
getType() == esConditionType::QuadTauOvRm ||
377 condition.
getType() == esConditionType::SingleJetOvRm ||
378 condition.
getType() == esConditionType::TripleJetOvRm ||
379 condition.
getType() == esConditionType::QuadJetOvRm) {
381 <<
"\n SingleEgammaOvRm" 382 <<
"\n DoubleEgammaOvRm" 383 <<
"\n TripleEgammaOvRm" 384 <<
"\n QuadEgammaOvRm" 385 <<
"\n SingleTauOvRm" 386 <<
"\n TripleTauOvRm" 388 <<
"\n SingleJetOvRm" 389 <<
"\n TripleJetOvRm" 391 <<
"\n The above conditions types OvRm are not implemented yet in the " 392 "parser. Please remove alogrithms that " 393 "use this type of condtion from L1T Menu!" 409 m_triggerMenuInterfaceAuthor =
val;
413 m_triggerMenuInterfaceDescription =
val;
431 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
435 itCondOnChip->clear();
439 m_algorithmMap.clear();
446 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 450 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
451 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
455 (m_conditionMap[chipNr])[cName] = &
cond;
456 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
469 if (m_algorithmMap.count(algName) != 0) {
470 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
471 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
475 if (m_algorithmAliasMap.count(algAlias) != 0) {
476 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
477 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
484 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 485 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
490 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
491 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
492 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
498 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
500 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
501 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 502 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
508 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
510 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
511 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 512 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
517 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
518 int iPin = (itAlgo->second)
519 .algoOutputPin(static_cast<int>(m_numberConditionChips),
520 static_cast<int>(m_pinsOnConditionChip),
521 m_orderConditionChip);
523 int iChip = (itAlgo->second)
524 .algoChipNumber(static_cast<int>(m_numberConditionChips),
525 static_cast<int>(m_pinsOnConditionChip),
526 m_orderConditionChip);
528 if ((outputPin == iPin) && (chipNr == iChip)) {
529 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
530 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 537 m_algorithmMap[algName] = alg;
538 m_algorithmAliasMap[algAlias] = alg;
547 template <
typename T>
549 std::stringstream
ss;
554 std::stringstream
ss;
585 for (std::map<std::string, tmeventsetup::esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end();
587 const tmeventsetup::esScale&
scale = cit->second;
591 scaleParam = &muScales;
592 else if (
scale.getObjectType() == esObjectType::Egamma)
593 scaleParam = &egScales;
595 scaleParam = &tauScales;
597 scaleParam = &jetScales;
599 scaleParam = &ettScales;
600 else if (
scale.getObjectType() == esObjectType::ETTEM)
601 scaleParam = &ettEmScales;
603 scaleParam = &etmScales;
604 else if (
scale.getObjectType() == esObjectType::ETMHF)
605 scaleParam = &etmHfScales;
607 scaleParam = &httScales;
609 scaleParam = &htmScales;
611 scaleParam = &zdcScales;
613 scaleParam =
nullptr;
615 if (scaleParam !=
nullptr) {
616 switch (
scale.getScaleType()) {
617 case esScaleType::EtScale: {
623 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
624 for (
unsigned int i = 0;
i < binsV.size();
i++) {
625 const tmeventsetup::esBin&
bin = binsV.at(
i);
626 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
627 scaleParam->
etBins.push_back(binLimits);
634 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
639 scale.getObjectType() == esObjectType::ETTEM) {
647 case esScaleType::UnconstrainedPtScale: {
653 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
654 for (
unsigned int i = 0;
i < binsV.size();
i++) {
655 const tmeventsetup::esBin&
bin = binsV.at(
i);
656 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
657 scaleParam->
uptBins.push_back(binLimits);
660 case esScaleType::EtaScale: {
666 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
668 for (
unsigned int i = 0;
i < binsV.size();
i++) {
669 const tmeventsetup::esBin&
bin = binsV.at(
i);
670 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
671 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
674 case esScaleType::PhiScale: {
680 const std::vector<tmeventsetup::esBin>& binsV =
scale.getBins();
682 for (
unsigned int i = 0;
i < binsV.size();
i++) {
683 const tmeventsetup::esBin&
bin = binsV.at(
i);
684 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
685 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
696 m_gtScales.setMuonScales(muScales);
697 m_gtScales.setEGScales(egScales);
698 m_gtScales.setTauScales(tauScales);
699 m_gtScales.setJetScales(jetScales);
700 m_gtScales.setETTScales(ettScales);
701 m_gtScales.setETTEmScales(ettEmScales);
702 m_gtScales.setETMScales(etmScales);
703 m_gtScales.setETMHfScales(etmHfScales);
704 m_gtScales.setHTTScales(httScales);
705 m_gtScales.setHTMScales(htmScales);
706 m_gtScales.setHTMScales(zdcScales);
709 bool hasPrecision =
false;
710 std::map<std::string, unsigned int> precisions;
711 getPrecisions(precisions, scaleMap);
712 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
719 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
720 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
721 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
725 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
726 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
727 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
728 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
729 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
730 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
734 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
735 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
736 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
737 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
738 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
739 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
740 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
741 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
745 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
746 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
747 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
748 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
749 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
750 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
751 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
755 parseDeltaEta_Cosh_LUTS(
756 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
757 parseDeltaEta_Cosh_LUTS(
758 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
759 parseDeltaEta_Cosh_LUTS(
760 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
761 parseDeltaEta_Cosh_LUTS(
762 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
764 parseDeltaEta_Cosh_LUTS(
765 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
766 parseDeltaEta_Cosh_LUTS(
767 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
768 parseDeltaEta_Cosh_LUTS(
769 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
771 parseDeltaEta_Cosh_LUTS(
772 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
773 parseDeltaEta_Cosh_LUTS(
774 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
776 parseDeltaEta_Cosh_LUTS(
777 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
781 parseDeltaPhi_Cos_LUTS(
782 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
783 parseDeltaPhi_Cos_LUTS(
784 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
785 parseDeltaPhi_Cos_LUTS(
786 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
787 parseDeltaPhi_Cos_LUTS(
788 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
789 parseDeltaPhi_Cos_LUTS(
790 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
791 parseDeltaPhi_Cos_LUTS(
792 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
793 parseDeltaPhi_Cos_LUTS(
794 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
796 parseDeltaPhi_Cos_LUTS(
797 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
798 parseDeltaPhi_Cos_LUTS(
799 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
800 parseDeltaPhi_Cos_LUTS(
801 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
802 parseDeltaPhi_Cos_LUTS(
803 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
804 parseDeltaPhi_Cos_LUTS(
805 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
806 parseDeltaPhi_Cos_LUTS(
807 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
809 parseDeltaPhi_Cos_LUTS(
810 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
811 parseDeltaPhi_Cos_LUTS(
812 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
813 parseDeltaPhi_Cos_LUTS(
814 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
815 parseDeltaPhi_Cos_LUTS(
816 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
817 parseDeltaPhi_Cos_LUTS(
818 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
820 parseDeltaPhi_Cos_LUTS(
821 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
822 parseDeltaPhi_Cos_LUTS(
823 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
824 parseDeltaPhi_Cos_LUTS(
825 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
826 parseDeltaPhi_Cos_LUTS(
827 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
829 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
830 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
831 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
832 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
834 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
835 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
836 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
837 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
859 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
862 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
863 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
865 std::vector<long long> lut_cal_2_mu_eta;
866 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
871 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
886 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
889 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
890 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
892 std::vector<long long> lut_cal_2_mu_phi;
893 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
898 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
912 if (scaleMap.find(scLabel1) == scaleMap.end())
915 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
917 std::vector<long long> lut_pt;
918 getLut(lut_pt, scale1, prec);
920 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
935 if (scaleMap.find(scLabel1) == scaleMap.end())
938 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
940 std::vector<long long> lut_pt;
941 getLut(lut_pt, scale1, prec);
943 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
950 unsigned int prec2) {
960 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
963 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
964 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
965 std::vector<double> val_delta_eta;
966 std::vector<long long> lut_delta_eta;
967 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
968 setLut(lut_delta_eta, val_delta_eta, prec1);
972 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
975 std::vector<long long> lut_cosh;
976 applyCosh(val_delta_eta,
n);
977 setLut(lut_cosh, val_delta_eta, prec2);
978 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
985 unsigned int prec2) {
995 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
998 const tmeventsetup::esScale* scale1 = &scaleMap.find(scLabel1)->second;
999 const tmeventsetup::esScale* scale2 = &scaleMap.find(scLabel2)->second;
1000 std::vector<double> val_delta_phi;
1001 std::vector<long long> lut_delta_phi;
1002 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
1003 setLut(lut_delta_phi, val_delta_phi, prec1);
1007 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
1010 std::vector<long long> lut_cos;
1011 applyCos(val_delta_phi,
n);
1012 setLut(lut_cos, val_delta_phi, prec2);
1013 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
1019 unsigned int prec) {
1026 if (scaleMap.find(scLabel) == scaleMap.end())
1031 const tmeventsetup::esScale*
scale = &scaleMap.find(scLabel)->second;
1036 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1040 for (
size_t ii = 0;
ii <
n;
ii++) {
1045 std::vector<long long> lut;
1048 setLut(lut,
array, prec);
1049 m_gtScales.setLUT_Sin(lutName, lut, prec);
1052 setLut(lut,
array, prec);
1053 m_gtScales.setLUT_Cos(lutName, lut, prec);
1083 }
else if (condMu.
getType() == esConditionType::DoubleMuon) {
1087 }
else if (condMu.
getType() == esConditionType::TripleMuon) {
1091 }
else if (condMu.
getType() == esConditionType::QuadMuon) {
1096 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1101 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1102 <<
"\nCan not determine number of trigger objects. " << std::endl;
1106 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1108 <<
"\n condition = " << condition <<
"\n particle = " << particle
1109 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1114 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1120 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1121 tmpValues.reserve(nrObj);
1123 if (
int(condMu.
getObjects().size()) != nrObj) {
1124 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1125 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1130 unsigned int chargeCorrelation = 1;
1131 const std::vector<L1TUtmCut>&
cuts = condMu.
getCuts();
1132 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1134 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1135 if (
cut.getData() ==
"ls")
1136 chargeCorrelation = 2;
1137 else if (
cut.getData() ==
"os")
1138 chargeCorrelation = 4;
1140 chargeCorrelation = 1;
1157 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1160 relativeBx =
object.getBxOffset();
1163 int upperUnconstrainedPtInd = -1;
1164 int lowerUnconstrainedPtInd = 0;
1165 int upperImpactParameterInd = -1;
1166 int lowerImpactParameterInd = 0;
1167 int upperThresholdInd = -1;
1168 int lowerThresholdInd = 0;
1169 int upperIndexInd = -1;
1170 int lowerIndexInd = 0;
1172 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1173 int isolationLUT = 0xF;
1174 int impactParameterLUT = 0xF;
1176 int qualityLUT = 0xFFFF;
1178 std::vector<MuonTemplate::Window> etaWindows;
1179 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1181 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1182 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1185 switch (
cut.getCutType()) {
1186 case esCutType::UnconstrainedPt:
1187 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1188 upperUnconstrainedPtInd =
cut.getMaximum().index;
1191 case esCutType::ImpactParameter:
1192 lowerImpactParameterInd =
cut.getMinimum().index;
1193 upperImpactParameterInd =
cut.getMaximum().index;
1194 impactParameterLUT = l1tstr2int(
cut.getData());
1198 lowerThresholdInd =
cut.getMinimum().index;
1199 upperThresholdInd =
cut.getMaximum().index;
1202 case esCutType::Slice:
1203 lowerIndexInd =
int(
cut.getMinimum().value);
1204 upperIndexInd =
int(
cut.getMaximum().value);
1207 case esCutType::Eta: {
1208 if (etaWindows.size() < 5) {
1209 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1212 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1219 phiWindow1Lower =
cut.getMinimum().index;
1220 phiWindow1Upper =
cut.getMaximum().index;
1221 }
else if (cntPhi == 1) {
1222 phiWindow2Lower =
cut.getMinimum().index;
1223 phiWindow2Upper =
cut.getMaximum().index;
1226 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1234 if (
cut.getData() ==
"positive")
1236 else if (
cut.getData() ==
"negative")
1243 qualityLUT = l1tstr2int(
cut.getData());
1246 case esCutType::Isolation: {
1247 isolationLUT = l1tstr2int(
cut.getData());
1251 case esCutType::Index: {
1252 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1262 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1263 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1264 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1265 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1266 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1268 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1269 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1271 objParameter[cnt].indexHigh = upperIndexInd;
1272 objParameter[cnt].indexLow = lowerIndexInd;
1274 objParameter[cnt].etaWindows = etaWindows;
1276 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1277 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1278 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1279 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1282 objParameter[cnt].enableMip =
false;
1283 objParameter[cnt].enableIso =
false;
1284 objParameter[cnt].requestIso =
false;
1286 objParameter[cnt].charge =
charge;
1287 objParameter[cnt].qualityLUT = qualityLUT;
1288 objParameter[cnt].isolationLUT = isolationLUT;
1290 objParameter[cnt].tfMuonIndexWindows = tfMuonIndexWindows;
1310 std::ostringstream myCoutStream;
1311 muonCond.
print(myCoutStream);
1312 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1316 if (!insertConditionIntoMap(muonCond, chipNr)) {
1317 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1320 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1322 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1324 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1325 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1347 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1348 <<
"\nCan not determine number of trigger objects. " << std::endl;
1352 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1354 <<
"\n condition = " << condition <<
"\n particle = " << particle
1355 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1360 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1366 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1367 tmpValues.reserve(nrObj);
1372 unsigned int chargeCorrelation = 0;
1373 if (str_chargeCorrelation ==
"ig")
1374 chargeCorrelation = 1;
1375 else if (str_chargeCorrelation ==
"ls")
1376 chargeCorrelation = 2;
1377 else if (str_chargeCorrelation ==
"os")
1378 chargeCorrelation = 4;
1394 int upperUnconstrainedPtInd = -1;
1395 int lowerUnconstrainedPtInd = 0;
1396 int upperImpactParameterInd = -1;
1397 int lowerImpactParameterInd = 0;
1398 int impactParameterLUT = 0xF;
1399 int upperThresholdInd = -1;
1400 int lowerThresholdInd = 0;
1401 int upperIndexInd = -1;
1402 int lowerIndexInd = 0;
1404 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1405 int isolationLUT = 0xF;
1407 int qualityLUT = 0xFFFF;
1409 std::vector<MuonTemplate::Window> etaWindows;
1410 std::vector<MuonTemplate::Window> tfMuonIndexWindows;
1412 const std::vector<L1TUtmCut>&
cuts = corrMu->
getCuts();
1413 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1416 switch (
cut.getCutType()) {
1417 case esCutType::UnconstrainedPt:
1418 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1419 upperUnconstrainedPtInd =
cut.getMaximum().index;
1422 case esCutType::ImpactParameter:
1423 lowerImpactParameterInd =
cut.getMinimum().index;
1424 upperImpactParameterInd =
cut.getMaximum().index;
1425 impactParameterLUT = l1tstr2int(
cut.getData());
1429 lowerThresholdInd =
cut.getMinimum().index;
1430 upperThresholdInd =
cut.getMaximum().index;
1433 case esCutType::Slice:
1434 lowerIndexInd =
int(
cut.getMinimum().value);
1435 upperIndexInd =
int(
cut.getMaximum().value);
1438 case esCutType::Eta: {
1439 if (etaWindows.size() < 5) {
1440 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1443 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1450 phiWindow1Lower =
cut.getMinimum().index;
1451 phiWindow1Upper =
cut.getMaximum().index;
1452 }
else if (cntPhi == 1) {
1453 phiWindow2Lower =
cut.getMinimum().index;
1454 phiWindow2Upper =
cut.getMaximum().index;
1457 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1465 if (
cut.getData() ==
"positive")
1467 else if (
cut.getData() ==
"negative")
1474 qualityLUT = l1tstr2int(
cut.getData());
1477 case esCutType::Isolation: {
1478 isolationLUT = l1tstr2int(
cut.getData());
1482 case esCutType::Index: {
1483 tfMuonIndexWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1493 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1494 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1495 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1496 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1497 objParameter[0].impactParameterLUT = impactParameterLUT;
1499 objParameter[0].ptHighThreshold = upperThresholdInd;
1500 objParameter[0].ptLowThreshold = lowerThresholdInd;
1502 objParameter[0].indexHigh = upperIndexInd;
1503 objParameter[0].indexLow = lowerIndexInd;
1505 objParameter[0].etaWindows = etaWindows;
1507 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1508 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1509 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1510 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1513 objParameter[0].enableMip =
false;
1514 objParameter[0].enableIso =
false;
1515 objParameter[0].requestIso =
false;
1517 objParameter[0].charge =
charge;
1518 objParameter[0].qualityLUT = qualityLUT;
1519 objParameter[0].isolationLUT = isolationLUT;
1521 objParameter[0].tfMuonIndexWindows = tfMuonIndexWindows;
1537 std::ostringstream myCoutStream;
1538 muonCond.
print(myCoutStream);
1539 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1555 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1587 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1589 if (
int(condMu.
getObjects().size()) != nrObj) {
1590 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1591 <<
"condMu.getObjects().size() = " << condMu.
getObjects().size() << std::endl;
1597 int relativeBx =
object.getBxOffset();
1599 if (condMu.
getType() == esConditionType::MuonShower0) {
1600 objParameter[0].MuonShower0 =
true;
1601 }
else if (condMu.
getType() == esConditionType::MuonShower1) {
1602 objParameter[0].MuonShower1 =
true;
1603 }
else if (condMu.
getType() == esConditionType::MuonShower2) {
1604 objParameter[0].MuonShower2 =
true;
1605 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime0) {
1606 objParameter[0].MuonShowerOutOfTime0 =
true;
1607 }
else if (condMu.
getType() == esConditionType::MuonShowerOutOfTime1) {
1608 objParameter[0].MuonShowerOutOfTime1 =
true;
1624 std::ostringstream myCoutStream;
1625 muonShowerCond.
print(myCoutStream);
1629 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1630 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1633 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1661 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1662 <<
"\n (in parseCalo) " 1663 <<
"\n condition = " << condition <<
"\n particle = " << particle
1664 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1673 if (condCalo.
getType() == esConditionType::SingleEgamma) {
1678 }
else if (condCalo.
getType() == esConditionType::DoubleEgamma) {
1683 }
else if (condCalo.
getType() == esConditionType::TripleEgamma) {
1688 }
else if (condCalo.
getType() == esConditionType::QuadEgamma) {
1693 }
else if (condCalo.
getType() == esConditionType::SingleJet) {
1694 caloObjType =
gtJet;
1698 }
else if (condCalo.
getType() == esConditionType::DoubleJet) {
1699 caloObjType =
gtJet;
1703 }
else if (condCalo.
getType() == esConditionType::TripleJet) {
1704 caloObjType =
gtJet;
1708 }
else if (condCalo.
getType() == esConditionType::QuadJet) {
1709 caloObjType =
gtJet;
1713 }
else if (condCalo.
getType() == esConditionType::SingleTau) {
1714 caloObjType =
gtTau;
1718 }
else if (condCalo.
getType() == esConditionType::DoubleTau) {
1719 caloObjType =
gtTau;
1723 }
else if (condCalo.
getType() == esConditionType::TripleTau) {
1724 caloObjType =
gtTau;
1728 }
else if (condCalo.
getType() == esConditionType::QuadTau) {
1729 caloObjType =
gtTau;
1734 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1741 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1742 <<
"\nCan not determine number of trigger objects. " << std::endl;
1749 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1755 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1756 tmpValues.reserve(nrObj);
1758 if (
int(condCalo.
getObjects().size()) != nrObj) {
1759 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1760 <<
"condCalo.getObjects().size() = " << condCalo.
getObjects().size()
1778 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1781 relativeBx =
object.getBxOffset();
1784 int upperThresholdInd = -1;
1785 int lowerThresholdInd = 0;
1786 int upperIndexInd = -1;
1787 int lowerIndexInd = 0;
1789 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1790 int isolationLUT = 0xF;
1791 int qualityLUT = 0xF;
1792 int displacedLUT = 0x0;
1796 std::vector<CaloTemplate::Window> etaWindows;
1798 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
1799 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1802 switch (
cut.getCutType()) {
1804 lowerThresholdInd =
cut.getMinimum().index;
1805 upperThresholdInd =
cut.getMaximum().index;
1807 case esCutType::Slice:
1808 lowerIndexInd =
int(
cut.getMinimum().value);
1809 upperIndexInd =
int(
cut.getMaximum().value);
1811 case esCutType::Eta: {
1812 if (etaWindows.size() < 5) {
1813 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
1816 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1823 phiWindow1Lower =
cut.getMinimum().index;
1824 phiWindow1Upper =
cut.getMaximum().index;
1825 }
else if (cntPhi == 1) {
1826 phiWindow2Lower =
cut.getMinimum().index;
1827 phiWindow2Upper =
cut.getMaximum().index;
1830 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1838 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1843 qualityLUT = l1tstr2int(
cut.getData());
1846 case esCutType::Displaced: {
1847 displacedLUT = l1tstr2int(
cut.getData());
1850 case esCutType::Isolation: {
1851 isolationLUT = l1tstr2int(
cut.getData());
1861 objParameter[cnt].etHighThreshold = upperThresholdInd;
1862 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1863 objParameter[cnt].indexHigh = upperIndexInd;
1864 objParameter[cnt].indexLow = lowerIndexInd;
1865 objParameter[cnt].etaWindows = etaWindows;
1866 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1867 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1868 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1869 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1870 objParameter[cnt].isolationLUT = isolationLUT;
1871 objParameter[cnt].qualityLUT = qualityLUT;
1872 objParameter[cnt].displacedLUT = displacedLUT;
1876 std::ostringstream oss;
1877 oss <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " << std::hex
1878 << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold;
1879 for (
const auto&
window : objParameter[cnt].etaWindows) {
1880 oss <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" <<
window.lower <<
" / 0x" 1883 oss <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" << objParameter[cnt].phiWindow1Lower
1884 <<
" / 0x" << objParameter[cnt].phiWindow1Upper <<
"\n phiWindowVeto Lower / Upper for calo object " 1885 << cnt <<
" = 0x" << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1886 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].isolationLUT
1887 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].qualityLUT
1888 <<
"\n LLP DISP LUT for calo object " << cnt <<
" = 0x" << objParameter[cnt].displacedLUT;
1889 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
1896 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1914 std::ostringstream myCoutStream;
1915 caloCond.
print(myCoutStream);
1916 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1920 if (!insertConditionIntoMap(caloCond, chipNr)) {
1921 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1926 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1928 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1958 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1959 <<
"\n (in parseCalo) " 1960 <<
"\n condition = " << condition <<
"\n particle = " << particle
1961 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1970 if (corrCalo->
getType() == esObjectType::Egamma) {
1973 caloObjType =
gtJet;
1975 caloObjType =
gtTau;
1977 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1984 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1985 <<
"\nCan not determine number of trigger objects. " << std::endl;
1992 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1998 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1999 tmpValues.reserve(nrObj);
2011 int upperThresholdInd = -1;
2012 int lowerThresholdInd = 0;
2013 int upperIndexInd = -1;
2014 int lowerIndexInd = 0;
2016 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2017 int isolationLUT = 0xF;
2018 int qualityLUT = 0xF;
2019 int displacedLUT = 0x0;
2023 std::vector<CaloTemplate::Window> etaWindows;
2025 const std::vector<L1TUtmCut>&
cuts = corrCalo->
getCuts();
2026 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2029 switch (
cut.getCutType()) {
2031 lowerThresholdInd =
cut.getMinimum().index;
2032 upperThresholdInd =
cut.getMaximum().index;
2034 case esCutType::Slice:
2035 lowerIndexInd =
int(
cut.getMinimum().value);
2036 upperIndexInd =
int(
cut.getMaximum().value);
2038 case esCutType::Eta: {
2039 if (etaWindows.size() < 5) {
2040 etaWindows.push_back({
cut.getMinimum().index,
cut.getMaximum().index});
2043 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2050 phiWindow1Lower =
cut.getMinimum().index;
2051 phiWindow1Upper =
cut.getMaximum().index;
2052 }
else if (cntPhi == 1) {
2053 phiWindow2Lower =
cut.getMinimum().index;
2054 phiWindow2Upper =
cut.getMaximum().index;
2057 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2065 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2070 qualityLUT = l1tstr2int(
cut.getData());
2073 case esCutType::Displaced: {
2074 displacedLUT = l1tstr2int(
cut.getData());
2077 case esCutType::Isolation: {
2078 isolationLUT = l1tstr2int(
cut.getData());
2088 objParameter[0].etLowThreshold = lowerThresholdInd;
2089 objParameter[0].etHighThreshold = upperThresholdInd;
2090 objParameter[0].indexHigh = upperIndexInd;
2091 objParameter[0].indexLow = lowerIndexInd;
2092 objParameter[0].etaWindows = etaWindows;
2093 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2094 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2095 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2096 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2097 objParameter[0].isolationLUT = isolationLUT;
2098 objParameter[0].qualityLUT = qualityLUT;
2099 objParameter[0].displacedLUT = displacedLUT;
2103 std::ostringstream oss;
2104 oss <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2105 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold;
2106 for (
const auto&
window : objParameter[0].etaWindows) {
2107 oss <<
"\n etaWindow Lower / Upper for calo object " 2110 oss <<
"\n phiWindow Lower / Upper for calo object " 2111 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2112 <<
"\n phiWindowVeto Lower / Upper for calo object " 2113 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2114 <<
"\n Isolation LUT for calo object " 2115 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2116 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2117 <<
" = 0x" << objParameter[0].displacedLUT;
2118 LogDebug(
"TriggerMenuParser") << oss.str() << std::endl;
2122 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2140 std::ostringstream myCoutStream;
2141 caloCond.
print(myCoutStream);
2142 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2159 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2186 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2187 <<
"\n (in parseEnergySum) " 2188 <<
"\n condition = " << condition <<
"\n type = " <<
type 2189 <<
"\n name = " <<
name << std::endl;
2195 if (condEnergySum.
getType() == esConditionType::MissingEt) {
2198 }
else if (condEnergySum.
getType() == esConditionType::TotalEt) {
2201 }
else if (condEnergySum.
getType() == esConditionType::TotalEtEM) {
2204 }
else if (condEnergySum.
getType() == esConditionType::TotalHt) {
2207 }
else if (condEnergySum.
getType() == esConditionType::MissingHt) {
2210 }
else if (condEnergySum.
getType() == esConditionType::MissingEtHF) {
2213 }
else if (condEnergySum.
getType() == esConditionType::TowerCount) {
2216 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP0) {
2219 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM0) {
2222 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFP1) {
2225 }
else if (condEnergySum.
getType() == esConditionType::MinBiasHFM1) {
2228 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEt) {
2231 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHt) {
2234 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryEtHF) {
2237 }
else if (condEnergySum.
getType() == esConditionType::AsymmetryHtHF) {
2240 }
else if (condEnergySum.
getType() == esConditionType::Centrality0) {
2243 }
else if (condEnergySum.
getType() == esConditionType::Centrality1) {
2246 }
else if (condEnergySum.
getType() == esConditionType::Centrality2) {
2249 }
else if (condEnergySum.
getType() == esConditionType::Centrality3) {
2252 }
else if (condEnergySum.
getType() == esConditionType::Centrality4) {
2255 }
else if (condEnergySum.
getType() == esConditionType::Centrality5) {
2258 }
else if (condEnergySum.
getType() == esConditionType::Centrality6) {
2261 }
else if (condEnergySum.
getType() == esConditionType::Centrality7) {
2265 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2277 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2291 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2294 relativeBx =
object.getBxOffset();
2297 int lowerThresholdInd = 0;
2298 int upperThresholdInd = -1;
2300 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2302 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2303 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2306 switch (
cut.getCutType()) {
2308 lowerThresholdInd =
cut.getMinimum().index;
2309 upperThresholdInd =
cut.getMaximum().index;
2312 case esCutType::Eta:
2317 phiWindow1Lower =
cut.getMinimum().index;
2318 phiWindow1Upper =
cut.getMaximum().index;
2319 }
else if (cntPhi == 1) {
2320 phiWindow2Lower =
cut.getMinimum().index;
2321 phiWindow2Upper =
cut.getMaximum().index;
2323 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2330 case esCutType::Count:
2331 lowerThresholdInd =
cut.getMinimum().index;
2332 upperThresholdInd = 0xffffff;
2342 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2343 objParameter[cnt].etHighThreshold = upperThresholdInd;
2344 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2345 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2346 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2347 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2350 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2351 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2352 << objParameter[cnt].etHighThreshold
2353 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2354 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2355 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2356 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2363 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2378 std::ostringstream myCoutStream;
2379 energySumCond.
print(myCoutStream);
2380 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2384 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2385 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2390 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2393 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2413 unsigned int chipNr,
2414 const bool corrFlag) {
2425 <<
"\n ******************************************\n (in parseEnergySumZdc)\n condition = " << condition
2426 <<
"\n type = " <<
type <<
"\n name = " <<
name;
2432 if (condEnergySumZdc.
getType() == esConditionType::ZDCPlus) {
2433 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCPlus " << std::endl;
2436 }
else if (condEnergySumZdc.
getType() == esConditionType::ZDCMinus) {
2437 LogDebug(
"TriggerMenuParser") <<
"ZDC signals: esConditionType::ZDCMinus " << std::endl;
2441 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for ZDC energy-sum condition (" <<
type <<
")" << std::endl;
2449 std::vector<EnergySumZdcTemplate::ObjectParameter> objParameter(nrObj);
2452 int lowerThresholdInd = 0;
2453 int upperThresholdInd = -1;
2467 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2470 relativeBx =
object.getBxOffset();
2473 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2474 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2477 switch (
cut.getCutType()) {
2479 lowerThresholdInd =
cut.getMinimum().index;
2480 upperThresholdInd =
cut.getMaximum().index;
2483 case esCutType::Count:
2484 lowerThresholdInd =
cut.getMinimum().index;
2485 upperThresholdInd = 0xffffff;
2495 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2496 objParameter[cnt].etHighThreshold = upperThresholdInd;
2499 LogDebug(
"TriggerMenuParser") <<
"\n EnergySumZdc ET high threshold (hex) for energy sum object " << cnt
2500 <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2501 << objParameter[cnt].etHighThreshold <<
std::dec;
2507 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2522 std::ostringstream myCoutStream;
2523 energySumCond.
print(myCoutStream);
2524 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2528 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2529 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2533 (m_vecEnergySumZdcTemplate[chipNr]).
push_back(energySumCond);
2560 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2561 <<
"\n (in parseEnergySum) " 2562 <<
"\n condition = " << condition <<
"\n type = " <<
type 2563 <<
"\n name = " <<
name << std::endl;
2575 }
else if (corrESum->
getType() == esObjectType::ETMHF) {
2578 }
else if (corrESum->
getType() == esObjectType::TOWERCOUNT) {
2582 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2595 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2611 int lowerThresholdInd = 0;
2612 int upperThresholdInd = -1;
2614 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2616 const std::vector<L1TUtmCut>&
cuts = corrESum->
getCuts();
2617 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2620 switch (
cut.getCutType()) {
2622 lowerThresholdInd =
cut.getMinimum().index;
2623 upperThresholdInd =
cut.getMaximum().index;
2626 case esCutType::Eta:
2631 phiWindow1Lower =
cut.getMinimum().index;
2632 phiWindow1Upper =
cut.getMaximum().index;
2633 }
else if (cntPhi == 1) {
2634 phiWindow2Lower =
cut.getMinimum().index;
2635 phiWindow2Upper =
cut.getMaximum().index;
2637 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2651 objParameter[0].etLowThreshold = lowerThresholdInd;
2652 objParameter[0].etHighThreshold = upperThresholdInd;
2653 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2654 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2655 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2656 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2659 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2660 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2661 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2662 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2663 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2664 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2668 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2683 std::ostringstream myCoutStream;
2684 energySumCond.
print(myCoutStream);
2685 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2703 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2728 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2729 <<
" (in parseAXOL1TL) " << std::endl
2730 <<
" condition = " << condition << std::endl
2731 <<
" type = " <<
type << std::endl
2732 <<
" name = " <<
name << std::endl;
2734 const int nrObj = 1;
2737 std::vector<AXOL1TLTemplate::ObjectParameter> objParameter(nrObj);
2739 if (
int(condAXOL1TL.
getObjects().size()) != nrObj) {
2740 edm::LogError(
"TriggerMenuParser") <<
" condAXOL1TL objects: nrObj = " << nrObj
2741 <<
"condAXOL1TL.getObjects().size() = " << condAXOL1TL.
getObjects().size()
2748 int relativeBx =
object.getBxOffset();
2749 bool gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2752 int lowerThresholdInd = 0;
2753 int upperThresholdInd = -1;
2755 const std::vector<L1TUtmCut>&
cuts =
object.getCuts();
2756 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2759 switch (
cut.getCutType()) {
2760 case esCutType::AnomalyScore:
2761 lowerThresholdInd =
cut.getMinimum().value;
2762 upperThresholdInd =
cut.getMaximum().value;
2770 objParameter[0].minAXOL1TLThreshold = lowerThresholdInd;
2771 objParameter[0].maxAXOL1TLThreshold = upperThresholdInd;
2782 std::ostringstream myCoutStream;
2783 axol1tlCond.
print(myCoutStream);
2784 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2788 if (!insertConditionIntoMap(axol1tlCond, chipNr)) {
2789 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate AXOL1TL condition (" <<
name <<
")" << std::endl;
2793 (m_vecAXOL1TLTemplate[chipNr]).
push_back(axol1tlCond);
2818 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2819 <<
"\n (in parseExternal) " 2820 <<
"\n condition = " << condition <<
"\n particle = " << particle
2821 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2830 unsigned int channelID = 0;
2836 if (
object.getType() == esObjectType::EXT) {
2837 relativeBx =
object.getBxOffset();
2838 channelID =
object.getExternalChannelId();
2846 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2858 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2861 if (!insertConditionIntoMap(externalCond, chipNr)) {
2862 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2866 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2891 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2892 <<
" (in parseCorrelation) " << std::endl
2893 <<
" condition = " << condition << std::endl
2894 <<
" particle = " << particle << std::endl
2895 <<
" type = " <<
type << std::endl
2896 <<
" name = " <<
name << std::endl;
2902 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2903 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2914 const int nrObj = 2;
2917 int intGEq[nrObj] = {-1, -1};
2918 std::vector<GlobalObject>
objType(nrObj);
2919 std::vector<GtConditionCategory> condCateg(nrObj);
2922 const bool corrFlag =
true;
2923 int corrIndexVal[nrObj] = {-1, -1};
2931 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
2932 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2935 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2936 if (
cut.getData() ==
"ls")
2938 else if (
cut.getData() ==
"os")
2946 double minV =
cut.getMinimum().value;
2947 double maxV =
cut.getMaximum().value;
2954 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2955 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2956 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2960 cutType = cutType | 0x1;
2962 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2963 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2964 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2968 cutType = cutType | 0x2;
2970 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2971 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2972 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2976 cutType = cutType | 0x4;
2977 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2981 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2982 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2983 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2984 cutType = cutType | 0x20;
2986 (
cut.getCutType() == esCutType::MassDeltaR)) {
2987 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2988 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2989 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2994 if (corrCond.
getType() == esConditionType::TransverseMass) {
2995 cutType = cutType | 0x10;
2996 }
else if (corrCond.
getType() == esConditionType::InvariantMassDeltaR) {
2997 cutType = cutType | 0x80;
2999 cutType = cutType | 0x8;
3001 }
else if (
cut.getCutType() == esCutType::MassUpt) {
3002 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3003 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3004 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3008 cutType = cutType | 0x40;
3017 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3018 <<
" corrFlag " << corrFlag << std::endl;
3025 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3026 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3027 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3028 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3065 parseMuonCorr(&
object, chipNr);
3066 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3069 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3073 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3076 parseCaloCorr(&
object, chipNr);
3077 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3080 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3081 switch (
object.getType()) {
3082 case esObjectType::Egamma: {
3096 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3097 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3099 parseEnergySumCorr(&
object, chipNr);
3100 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3103 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3104 switch (
object.getType()) {
3111 case esObjectType::ETMHF: {
3114 case esObjectType::TOWERCOUNT: {
3123 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3124 <<
" for the correlation condition " <<
name << std::endl;
3133 if (intGEq[0] != intGEq[1]) {
3134 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3135 <<
" for the correlation condition " <<
name << std::endl;
3139 gEq = (intGEq[0] != 0);
3157 std::ostringstream myCoutStream;
3158 correlationCond.
print(myCoutStream);
3159 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3165 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
3191 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3192 <<
" (in parseCorrelationThreeBody) " << std::endl
3193 <<
" condition = " << condition << std::endl
3194 <<
" particle = " << particle << std::endl
3195 <<
" type = " <<
type << std::endl
3196 <<
" name = " <<
name << std::endl;
3202 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
3203 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3211 const int nrObj = 3;
3214 std::vector<GlobalObject>
objType(nrObj);
3215 std::vector<GtConditionCategory> condCateg(nrObj);
3218 const bool corrFlag =
true;
3219 int corrIndexVal[nrObj] = {-1, -1, -1};
3229 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3230 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
3233 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3234 if (
cut.getData() ==
"ls")
3236 else if (
cut.getData() ==
"os")
3245 double minV =
cut.getMinimum().value;
3246 double maxV =
cut.getMaximum().value;
3252 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3253 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3254 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3258 cutType = cutType | 0x8;
3259 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3263 cutType = cutType | 0x80;
3271 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3272 <<
" corrFlag " << corrFlag << std::endl;
3277 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3279 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3280 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3281 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3286 parseMuonCorr(&
object, chipNr);
3287 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).size() - 1;
3294 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3295 <<
" for the correlation condition " <<
name 3296 <<
": no three muons in the event!" << std::endl;
3316 std::ostringstream myCoutStream;
3317 correlationThreeBodyCond.
print(myCoutStream);
3318 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3324 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3350 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3351 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3352 <<
" condition = " << condition << std::endl
3353 <<
" particle = " << particle << std::endl
3354 <<
" type = " <<
type << std::endl
3355 <<
" name = " <<
name << std::endl;
3361 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3362 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3373 const int nrObj = 3;
3376 int intGEq[nrObj] = {-1, -1, -1};
3377 std::vector<GlobalObject>
objType(nrObj);
3378 std::vector<GtConditionCategory> condCateg(nrObj);
3381 const bool corrFlag =
true;
3382 int corrIndexVal[nrObj] = {-1, -1, -1};
3390 const std::vector<L1TUtmCut>&
cuts = corrCond.
getCuts();
3391 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3394 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3395 if (
cut.getData() ==
"ls")
3397 else if (
cut.getData() ==
"os")
3405 double minV =
cut.getMinimum().value;
3406 double maxV =
cut.getMaximum().value;
3417 cutType = cutType | 0x1;
3423 cutType = cutType | 0x2;
3429 cutType = cutType | 0x4;
3435 cutType = cutType | 0x8;
3436 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3440 cutType = cutType | 0x80;
3442 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3447 cutType = cutType | 0x10;
3448 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3453 cutType = cutType | 0x20;
3454 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3459 cutType = cutType | 0x40;
3469 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3470 << corrFlag << std::endl;
3477 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3478 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3479 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3480 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3481 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3518 parseMuonCorr(&
object, chipNr);
3519 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3522 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3526 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3529 parseCaloCorr(&
object, chipNr);
3530 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3533 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3534 switch (
object.getType()) {
3535 case esObjectType::Egamma: {
3549 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3550 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3552 parseEnergySumCorr(&
object, chipNr);
3553 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3556 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3557 switch (
object.getType()) {
3564 case esObjectType::ETMHF: {
3567 case esObjectType::TOWERCOUNT: {
3576 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3577 <<
" for the correlation condition " <<
name << std::endl;
3586 if (intGEq[0] != intGEq[1]) {
3587 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3588 <<
" for the correlation condition " <<
name << std::endl;
3592 gEq = (intGEq[0] != 0);
3612 std::ostringstream myCoutStream;
3613 correlationWORCond.
print(myCoutStream);
3614 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3620 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3642 if (algAlias.empty()) {
3644 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3645 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3649 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3650 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3657 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3658 <<
" Chip number: " << chipNr << std::endl;
3664 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3679 std::ostringstream myCoutStream;
3680 alg.
print(myCoutStream);
3681 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3685 if (!insertAlgorithmIntoMap(alg)) {
unsigned int chargeCorrelation
unsigned int precOverlapRemovalPhiCut
constexpr int32_t ceil(float num)
long long maxOverlapRemovalEtaCutValue
void setCondGEq(const bool &cGEq)
long long maxMassCutValue
void setAlgoAlias(const std::string &algoAliasValue)
const int getType() const
const std::vector< L1TUtmCut > & getCuts() const
void 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
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 &)