46 #include "tmEventSetup/tmEventSetup.hh" 47 #include "tmEventSetup/esTriggerMenu.hh" 48 #include "tmEventSetup/esAlgorithm.hh" 49 #include "tmEventSetup/esCondition.hh" 50 #include "tmEventSetup/esObject.hh" 51 #include "tmEventSetup/esCut.hh" 52 #include "tmEventSetup/esScale.hh" 53 #include "tmGrammar/Algorithm.hh" 58 : m_triggerMenuInterface(
"NULL"),
59 m_triggerMenuName(
"NULL"),
60 m_triggerMenuImplementation(0x0),
74 m_numberConditionChips = numberConditionChipsValue;
79 m_pinsOnConditionChip = pinsOnConditionChipValue;
85 m_orderConditionChip = orderConditionChipValue;
90 m_numberPhysTriggers = numberPhysTriggersValue;
98 m_triggerMenuInterface = menuInterface;
107 m_triggerMenuImplementation = menuImplementation;
115 m_vecMuonTemplate = vecMuonTempl;
119 const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTempl) {
120 m_vecMuonShowerTemplate = vecMuonShowerTempl;
124 m_vecCaloTemplate = vecCaloTempl;
128 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
129 m_vecEnergySumTemplate = vecEnergySumTempl;
133 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
134 m_vecExternalTemplate = vecExternalTempl;
138 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
139 m_vecCorrelationTemplate = vecCorrelationTempl;
143 const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
144 m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
148 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
149 m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
155 m_corMuonTemplate = corMuonTempl;
159 m_corCaloTemplate = corCaloTempl;
163 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
164 m_corEnergySumTemplate = corEnergySumTempl;
175 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
>(utmMenu);
176 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
178 std::map<std::string, unsigned int> extBitMap;
181 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin(); cit != condMap.end(); cit++) {
182 const esCondition& condition = cit->second;
183 if (condition.getType() == esConditionType::Externals) {
185 const std::vector<esObject>&
objects = condition.getObjects();
188 if (
object.getType() == esObjectType::EXT) {
189 unsigned int channelID =
object.getExternalChannelId();
192 if (extBitMap.count(
name) == 0)
211 m_conditionMap.resize(m_numberConditionChips);
213 m_vecMuonTemplate.resize(m_numberConditionChips);
214 m_vecMuonShowerTemplate.resize(m_numberConditionChips);
215 m_vecCaloTemplate.resize(m_numberConditionChips);
216 m_vecEnergySumTemplate.resize(m_numberConditionChips);
217 m_vecExternalTemplate.resize(m_numberConditionChips);
219 m_vecCorrelationTemplate.resize(m_numberConditionChips);
220 m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
221 m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
222 m_corMuonTemplate.resize(m_numberConditionChips);
223 m_corCaloTemplate.resize(m_numberConditionChips);
224 m_corEnergySumTemplate.resize(m_numberConditionChips);
229 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
>(utmMenu);
232 m_triggerMenuDescription =
menu->getComment();
233 m_triggerMenuDate =
menu->getDatetime();
234 m_triggerMenuImplementation = (getMmHashN(
menu->getFirmwareUuid()) & 0xFFFFFFFF);
235 m_triggerMenuName =
menu->getName();
236 m_triggerMenuInterface =
menu->getVersion();
237 m_triggerMenuUUID = (getMmHashN(
menu->getName()) & 0xFFFFFFFF);
239 const std::map<std::string, esAlgorithm>& algoMap =
menu->getAlgorithmMap();
240 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
241 const std::map<std::string, esScale>& scaleMap =
menu->getScaleMap();
244 m_gtScales.setScalesName(
menu->getScaleSetName());
245 parseScales(scaleMap);
248 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
253 const esAlgorithm&
algo = cit->second;
256 parseAlgorithm(
algo, chipNr);
259 const std::vector<std::string>& rpn_vec =
algo.getRpnVector();
260 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++) {
265 const esCondition& condition = condMap.find(
token)->second;
268 if ((m_conditionMap[chipNr]).
count(condition.getName()) == 0) {
270 if (condition.getType() == esConditionType::SingleEgamma ||
271 condition.getType() == esConditionType::DoubleEgamma ||
272 condition.getType() == esConditionType::TripleEgamma ||
273 condition.getType() == esConditionType::QuadEgamma || condition.getType() == esConditionType::SingleTau ||
274 condition.getType() == esConditionType::DoubleTau || condition.getType() == esConditionType::TripleTau ||
275 condition.getType() == esConditionType::QuadTau || condition.getType() == esConditionType::SingleJet ||
276 condition.getType() == esConditionType::DoubleJet || condition.getType() == esConditionType::TripleJet ||
277 condition.getType() == esConditionType::QuadJet) {
278 parseCalo(condition, chipNr,
false);
281 }
else if (condition.getType() == esConditionType::TotalEt ||
282 condition.getType() == esConditionType::TotalEtEM ||
283 condition.getType() == esConditionType::TotalHt ||
284 condition.getType() == esConditionType::MissingEt ||
285 condition.getType() == esConditionType::MissingHt ||
286 condition.getType() == esConditionType::MissingEtHF ||
287 condition.getType() == esConditionType::TowerCount ||
288 condition.getType() == esConditionType::MinBiasHFP0 ||
289 condition.getType() == esConditionType::MinBiasHFM0 ||
290 condition.getType() == esConditionType::MinBiasHFP1 ||
291 condition.getType() == esConditionType::MinBiasHFM1 ||
292 condition.getType() == esConditionType::AsymmetryEt ||
293 condition.getType() == esConditionType::AsymmetryHt ||
294 condition.getType() == esConditionType::AsymmetryEtHF ||
295 condition.getType() == esConditionType::AsymmetryHtHF ||
296 condition.getType() == esConditionType::Centrality0 ||
297 condition.getType() == esConditionType::Centrality1 ||
298 condition.getType() == esConditionType::Centrality2 ||
299 condition.getType() == esConditionType::Centrality3 ||
300 condition.getType() == esConditionType::Centrality4 ||
301 condition.getType() == esConditionType::Centrality5 ||
302 condition.getType() == esConditionType::Centrality6 ||
303 condition.getType() == esConditionType::Centrality7) {
304 parseEnergySum(condition, chipNr,
false);
308 condition.getType() == esConditionType::DoubleMuon ||
309 condition.getType() == esConditionType::TripleMuon ||
310 condition.getType() == esConditionType::QuadMuon) {
311 parseMuon(condition, chipNr,
false);
313 }
else if (condition.getType() == esConditionType::MuonShower0 ||
314 condition.getType() == esConditionType::MuonShower1 ||
315 condition.getType() == esConditionType::MuonShower2 ||
316 condition.getType() == esConditionType::MuonShowerOutOfTime0 ||
317 condition.getType() == esConditionType::MuonShowerOutOfTime1) {
318 parseMuonShower(condition, chipNr,
false);
321 }
else if (condition.getType() == esConditionType::MuonMuonCorrelation ||
322 condition.getType() == esConditionType::MuonEsumCorrelation ||
323 condition.getType() == esConditionType::CaloMuonCorrelation ||
324 condition.getType() == esConditionType::CaloCaloCorrelation ||
325 condition.getType() == esConditionType::CaloEsumCorrelation ||
326 condition.getType() == esConditionType::InvariantMass ||
327 condition.getType() == esConditionType::InvariantMassDeltaR ||
328 condition.getType() == esConditionType::TransverseMass ||
329 condition.getType() == esConditionType::InvariantMassUpt) {
330 parseCorrelation(condition, chipNr);
333 }
else if (condition.getType() == esConditionType::InvariantMass3) {
334 parseCorrelationThreeBody(condition, chipNr);
337 }
else if (condition.getType() == esConditionType::Externals) {
338 parseExternal(condition, chipNr);
341 }
else if (condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
342 condition.getType() == esConditionType::InvariantMassOvRm ||
343 condition.getType() == esConditionType::TransverseMassOvRm ||
344 condition.getType() == esConditionType::DoubleJetOvRm ||
345 condition.getType() == esConditionType::DoubleTauOvRm) {
346 parseCorrelationWithOverlapRemoval(condition, chipNr);
348 }
else if (condition.getType() == esConditionType::SingleEgammaOvRm ||
349 condition.getType() == esConditionType::DoubleEgammaOvRm ||
350 condition.getType() == esConditionType::TripleEgammaOvRm ||
351 condition.getType() == esConditionType::QuadEgammaOvRm ||
352 condition.getType() == esConditionType::SingleTauOvRm ||
353 condition.getType() == esConditionType::TripleTauOvRm ||
354 condition.getType() == esConditionType::QuadTauOvRm ||
355 condition.getType() == esConditionType::SingleJetOvRm ||
356 condition.getType() == esConditionType::TripleJetOvRm ||
357 condition.getType() == esConditionType::QuadJetOvRm) {
359 <<
"\n SingleEgammaOvRm" 360 <<
"\n DoubleEgammaOvRm" 361 <<
"\n TripleEgammaOvRm" 362 <<
"\n QuadEgammaOvRm" 363 <<
"\n SingleTauOvRm" 364 <<
"\n TripleTauOvRm" 366 <<
"\n SingleJetOvRm" 367 <<
"\n TripleJetOvRm" 369 <<
"\n The above conditions types OvRm are not implemented yet in the " 370 "parser. Please remove alogrithms that " 371 "use this type of condtion from L1T Menu!" 387 m_triggerMenuInterfaceAuthor =
val;
391 m_triggerMenuInterfaceDescription =
val;
409 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
413 itCondOnChip->clear();
417 m_algorithmMap.clear();
424 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 428 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
429 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
433 (m_conditionMap[chipNr])[cName] = &
cond;
434 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
447 if (m_algorithmMap.count(algName) != 0) {
448 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
449 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
453 if (m_algorithmAliasMap.count(algAlias) != 0) {
454 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
455 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
462 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 463 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
468 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
469 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
470 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
476 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
478 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
479 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 480 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
486 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
488 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
489 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 490 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
495 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
496 int iPin = (itAlgo->second)
497 .algoOutputPin(static_cast<int>(m_numberConditionChips),
498 static_cast<int>(m_pinsOnConditionChip),
499 m_orderConditionChip);
501 int iChip = (itAlgo->second)
502 .algoChipNumber(static_cast<int>(m_numberConditionChips),
503 static_cast<int>(m_pinsOnConditionChip),
504 m_orderConditionChip);
506 if ((outputPin == iPin) && (chipNr == iChip)) {
507 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
508 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 515 m_algorithmMap[algName] = alg;
516 m_algorithmAliasMap[algAlias] = alg;
525 template <
typename T>
527 std::stringstream
ss;
532 std::stringstream
ss;
562 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end(); cit++) {
563 const esScale&
scale = cit->second;
567 scaleParam = &muScales;
568 else if (
scale.getObjectType() == esObjectType::Egamma)
569 scaleParam = &egScales;
571 scaleParam = &tauScales;
573 scaleParam = &jetScales;
575 scaleParam = &ettScales;
576 else if (
scale.getObjectType() == esObjectType::ETTEM)
577 scaleParam = &ettEmScales;
579 scaleParam = &etmScales;
580 else if (
scale.getObjectType() == esObjectType::ETMHF)
581 scaleParam = &etmHfScales;
583 scaleParam = &httScales;
585 scaleParam = &htmScales;
587 scaleParam =
nullptr;
589 if (scaleParam !=
nullptr) {
590 switch (
scale.getScaleType()) {
591 case esScaleType::EtScale: {
597 const std::vector<esBin>& binsV =
scale.getBins();
598 for (
unsigned int i = 0;
i < binsV.size();
i++) {
599 const esBin&
bin = binsV.at(
i);
600 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
601 scaleParam->
etBins.push_back(binLimits);
608 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
613 scale.getObjectType() == esObjectType::ETTEM) {
621 case esScaleType::UnconstrainedPtScale: {
627 const std::vector<esBin>& binsV =
scale.getBins();
628 for (
unsigned int i = 0;
i < binsV.size();
i++) {
629 const esBin&
bin = binsV.at(
i);
630 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
631 scaleParam->
uptBins.push_back(binLimits);
634 case esScaleType::EtaScale: {
640 const std::vector<esBin>& binsV =
scale.getBins();
642 for (
unsigned int i = 0;
i < binsV.size();
i++) {
643 const esBin&
bin = binsV.at(
i);
644 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
645 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
648 case esScaleType::PhiScale: {
654 const std::vector<esBin>& binsV =
scale.getBins();
656 for (
unsigned int i = 0;
i < binsV.size();
i++) {
657 const esBin&
bin = binsV.at(
i);
658 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
659 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
670 m_gtScales.setMuonScales(muScales);
671 m_gtScales.setEGScales(egScales);
672 m_gtScales.setTauScales(tauScales);
673 m_gtScales.setJetScales(jetScales);
674 m_gtScales.setETTScales(ettScales);
675 m_gtScales.setETTEmScales(ettEmScales);
676 m_gtScales.setETMScales(etmScales);
677 m_gtScales.setETMHfScales(etmHfScales);
678 m_gtScales.setHTTScales(httScales);
679 m_gtScales.setHTMScales(htmScales);
682 bool hasPrecision =
false;
683 std::map<std::string, unsigned int> precisions;
684 getPrecisions(precisions, scaleMap);
685 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
692 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
693 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
694 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
698 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
699 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
700 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
701 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
702 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
703 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
707 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
708 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
709 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
710 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
711 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
712 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
713 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
714 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
718 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
719 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
720 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
721 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
722 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
723 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
724 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
728 parseDeltaEta_Cosh_LUTS(
729 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
730 parseDeltaEta_Cosh_LUTS(
731 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
732 parseDeltaEta_Cosh_LUTS(
733 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
734 parseDeltaEta_Cosh_LUTS(
735 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
737 parseDeltaEta_Cosh_LUTS(
738 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
739 parseDeltaEta_Cosh_LUTS(
740 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
741 parseDeltaEta_Cosh_LUTS(
742 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
744 parseDeltaEta_Cosh_LUTS(
745 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
746 parseDeltaEta_Cosh_LUTS(
747 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
749 parseDeltaEta_Cosh_LUTS(
750 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
754 parseDeltaPhi_Cos_LUTS(
755 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
756 parseDeltaPhi_Cos_LUTS(
757 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
758 parseDeltaPhi_Cos_LUTS(
759 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
760 parseDeltaPhi_Cos_LUTS(
761 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
762 parseDeltaPhi_Cos_LUTS(
763 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
764 parseDeltaPhi_Cos_LUTS(
765 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
766 parseDeltaPhi_Cos_LUTS(
767 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
769 parseDeltaPhi_Cos_LUTS(
770 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
771 parseDeltaPhi_Cos_LUTS(
772 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
773 parseDeltaPhi_Cos_LUTS(
774 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
775 parseDeltaPhi_Cos_LUTS(
776 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
777 parseDeltaPhi_Cos_LUTS(
778 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
779 parseDeltaPhi_Cos_LUTS(
780 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
782 parseDeltaPhi_Cos_LUTS(
783 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
784 parseDeltaPhi_Cos_LUTS(
785 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
786 parseDeltaPhi_Cos_LUTS(
787 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
788 parseDeltaPhi_Cos_LUTS(
789 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
790 parseDeltaPhi_Cos_LUTS(
791 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
793 parseDeltaPhi_Cos_LUTS(
794 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
795 parseDeltaPhi_Cos_LUTS(
796 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
797 parseDeltaPhi_Cos_LUTS(
798 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
799 parseDeltaPhi_Cos_LUTS(
800 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
802 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
803 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
804 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
805 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
807 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
808 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
809 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
810 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
832 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
835 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
836 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
838 std::vector<long long> lut_cal_2_mu_eta;
839 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
844 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
859 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
862 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
863 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
865 std::vector<long long> lut_cal_2_mu_phi;
866 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
871 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
885 if (scaleMap.find(scLabel1) == scaleMap.end())
888 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
890 std::vector<long long> lut_pt;
891 getLut(lut_pt, scale1, prec);
893 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
908 if (scaleMap.find(scLabel1) == scaleMap.end())
911 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
913 std::vector<long long> lut_pt;
914 getLut(lut_pt, scale1, prec);
916 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
923 unsigned int prec2) {
933 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
936 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
937 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
938 std::vector<double> val_delta_eta;
939 std::vector<long long> lut_delta_eta;
940 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
941 setLut(lut_delta_eta, val_delta_eta, prec1);
945 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
948 std::vector<long long> lut_cosh;
949 applyCosh(val_delta_eta,
n);
950 setLut(lut_cosh, val_delta_eta, prec2);
951 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
958 unsigned int prec2) {
968 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
971 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
972 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
973 std::vector<double> val_delta_phi;
974 std::vector<long long> lut_delta_phi;
975 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
976 setLut(lut_delta_phi, val_delta_phi, prec1);
980 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
983 std::vector<long long> lut_cos;
984 applyCos(val_delta_phi,
n);
985 setLut(lut_cos, val_delta_phi, prec2);
986 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
999 if (scaleMap.find(scLabel) == scaleMap.end())
1004 const esScale*
scale = &scaleMap.find(scLabel)->second;
1009 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1013 for (
size_t ii = 0;
ii <
n;
ii++) {
1018 std::vector<long long> lut;
1021 setLut(lut,
array, prec);
1022 m_gtScales.setLUT_Sin(lutName, lut, prec);
1025 setLut(lut,
array, prec);
1026 m_gtScales.setLUT_Cos(lutName, lut, prec);
1057 }
else if (condMu.getType() == esConditionType::DoubleMuon) {
1061 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1065 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1070 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1075 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1076 <<
"\nCan not determine number of trigger objects. " << std::endl;
1080 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1082 <<
"\n condition = " << condition <<
"\n particle = " << particle
1083 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1088 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1094 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1095 tmpValues.reserve(nrObj);
1097 if (
int(condMu.getObjects().size()) != nrObj) {
1098 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1099 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1104 unsigned int chargeCorrelation = 1;
1105 const std::vector<esCut>&
cuts = condMu.getCuts();
1106 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1108 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1109 if (
cut.getData() ==
"ls")
1110 chargeCorrelation = 2;
1111 else if (
cut.getData() ==
"os")
1112 chargeCorrelation = 4;
1114 chargeCorrelation = 1;
1128 const std::vector<esObject>&
objects = condMu.getObjects();
1130 const esObject&
object =
objects.at(
jj);
1131 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1134 relativeBx =
object.getBxOffset();
1137 int upperUnconstrainedPtInd = -1;
1138 int lowerUnconstrainedPtInd = 0;
1139 int upperImpactParameterInd = -1;
1140 int lowerImpactParameterInd = 0;
1141 int upperThresholdInd = -1;
1142 int lowerThresholdInd = 0;
1143 int upperIndexInd = -1;
1144 int lowerIndexInd = 0;
1146 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1148 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1149 int isolationLUT = 0xF;
1150 int impactParameterLUT = 0xF;
1152 int qualityLUT = 0xFFFF;
1154 const std::vector<esCut>&
cuts =
object.getCuts();
1155 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1158 switch (
cut.getCutType()) {
1159 case esCutType::UnconstrainedPt:
1160 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1161 upperUnconstrainedPtInd =
cut.getMaximum().index;
1164 case esCutType::ImpactParameter:
1165 lowerImpactParameterInd =
cut.getMinimum().index;
1166 upperImpactParameterInd =
cut.getMaximum().index;
1167 impactParameterLUT = l1tstr2int(
cut.getData());
1171 lowerThresholdInd =
cut.getMinimum().index;
1172 upperThresholdInd =
cut.getMaximum().index;
1175 case esCutType::Slice:
1176 lowerIndexInd =
int(
cut.getMinimum().value);
1177 upperIndexInd =
int(
cut.getMaximum().value);
1180 case esCutType::Eta: {
1182 etaWindow1Lower =
cut.getMinimum().index;
1183 etaWindow1Upper =
cut.getMaximum().index;
1184 }
else if (cntEta == 1) {
1185 etaWindow2Lower =
cut.getMinimum().index;
1186 etaWindow2Upper =
cut.getMaximum().index;
1189 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1198 phiWindow1Lower =
cut.getMinimum().index;
1199 phiWindow1Upper =
cut.getMaximum().index;
1200 }
else if (cntPhi == 1) {
1201 phiWindow2Lower =
cut.getMinimum().index;
1202 phiWindow2Upper =
cut.getMaximum().index;
1205 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1213 if (
cut.getData() ==
"positive")
1215 else if (
cut.getData() ==
"negative")
1222 qualityLUT = l1tstr2int(
cut.getData());
1225 case esCutType::Isolation: {
1226 isolationLUT = l1tstr2int(
cut.getData());
1236 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1237 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1238 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1239 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1240 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1242 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1243 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1245 objParameter[cnt].indexHigh = upperIndexInd;
1246 objParameter[cnt].indexLow = lowerIndexInd;
1248 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1249 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1250 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1251 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1253 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1254 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1255 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1256 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1259 objParameter[cnt].enableMip =
false;
1260 objParameter[cnt].enableIso =
false;
1261 objParameter[cnt].requestIso =
false;
1263 objParameter[cnt].charge =
charge;
1264 objParameter[cnt].qualityLUT = qualityLUT;
1265 objParameter[cnt].isolationLUT = isolationLUT;
1285 std::ostringstream myCoutStream;
1286 muonCond.
print(myCoutStream);
1287 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1291 if (!insertConditionIntoMap(muonCond, chipNr)) {
1292 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1295 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1297 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1299 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1300 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1322 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1323 <<
"\nCan not determine number of trigger objects. " << std::endl;
1327 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1329 <<
"\n condition = " << condition <<
"\n particle = " << particle
1330 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1335 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1341 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1342 tmpValues.reserve(nrObj);
1347 unsigned int chargeCorrelation = 0;
1348 if (str_chargeCorrelation ==
"ig")
1349 chargeCorrelation = 1;
1350 else if (str_chargeCorrelation ==
"ls")
1351 chargeCorrelation = 2;
1352 else if (str_chargeCorrelation ==
"os")
1353 chargeCorrelation = 4;
1363 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1366 relativeBx = corrMu->getBxOffset();
1369 int upperUnconstrainedPtInd = -1;
1370 int lowerUnconstrainedPtInd = 0;
1371 int upperImpactParameterInd = -1;
1372 int lowerImpactParameterInd = 0;
1373 int impactParameterLUT = 0xF;
1374 int upperThresholdInd = -1;
1375 int lowerThresholdInd = 0;
1376 int upperIndexInd = -1;
1377 int lowerIndexInd = 0;
1379 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1381 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1382 int isolationLUT = 0xF;
1384 int qualityLUT = 0xFFFF;
1386 const std::vector<esCut>&
cuts = corrMu->getCuts();
1387 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1390 switch (
cut.getCutType()) {
1391 case esCutType::UnconstrainedPt:
1392 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1393 upperUnconstrainedPtInd =
cut.getMaximum().index;
1396 case esCutType::ImpactParameter:
1397 lowerImpactParameterInd =
cut.getMinimum().index;
1398 upperImpactParameterInd =
cut.getMaximum().index;
1399 impactParameterLUT = l1tstr2int(
cut.getData());
1403 lowerThresholdInd =
cut.getMinimum().index;
1404 upperThresholdInd =
cut.getMaximum().index;
1407 case esCutType::Slice:
1408 lowerIndexInd =
int(
cut.getMinimum().value);
1409 upperIndexInd =
int(
cut.getMaximum().value);
1412 case esCutType::Eta: {
1414 etaWindow1Lower =
cut.getMinimum().index;
1415 etaWindow1Upper =
cut.getMaximum().index;
1416 }
else if (cntEta == 1) {
1417 etaWindow2Lower =
cut.getMinimum().index;
1418 etaWindow2Upper =
cut.getMaximum().index;
1421 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1430 phiWindow1Lower =
cut.getMinimum().index;
1431 phiWindow1Upper =
cut.getMaximum().index;
1432 }
else if (cntPhi == 1) {
1433 phiWindow2Lower =
cut.getMinimum().index;
1434 phiWindow2Upper =
cut.getMaximum().index;
1437 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1445 if (
cut.getData() ==
"positive")
1447 else if (
cut.getData() ==
"negative")
1454 qualityLUT = l1tstr2int(
cut.getData());
1457 case esCutType::Isolation: {
1458 isolationLUT = l1tstr2int(
cut.getData());
1468 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1469 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1470 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1471 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1472 objParameter[0].impactParameterLUT = impactParameterLUT;
1474 objParameter[0].ptHighThreshold = upperThresholdInd;
1475 objParameter[0].ptLowThreshold = lowerThresholdInd;
1477 objParameter[0].indexHigh = upperIndexInd;
1478 objParameter[0].indexLow = lowerIndexInd;
1480 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1481 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1482 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1483 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1485 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1486 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1487 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1488 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1491 objParameter[0].enableMip =
false;
1492 objParameter[0].enableIso =
false;
1493 objParameter[0].requestIso =
false;
1495 objParameter[0].charge =
charge;
1496 objParameter[0].qualityLUT = qualityLUT;
1497 objParameter[0].isolationLUT = isolationLUT;
1513 std::ostringstream myCoutStream;
1514 muonCond.
print(myCoutStream);
1515 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1531 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1549 unsigned int chipNr,
1550 const bool corrFlag) {
1565 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1567 if (
int(condMu.getObjects().size()) != nrObj) {
1568 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1569 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1574 esObject
object = condMu.getObjects().at(0);
1575 int relativeBx =
object.getBxOffset();
1577 if (condMu.getType() == esConditionType::MuonShower0) {
1578 objParameter[0].MuonShower0 =
true;
1579 }
else if (condMu.getType() == esConditionType::MuonShower1) {
1580 objParameter[0].MuonShower1 =
true;
1581 }
else if (condMu.getType() == esConditionType::MuonShower2) {
1582 objParameter[0].MuonShower2 =
true;
1583 }
else if (condMu.getType() == esConditionType::MuonShowerOutOfTime0) {
1584 objParameter[0].MuonShowerOutOfTime0 =
true;
1585 }
else if (condMu.getType() == esConditionType::MuonShowerOutOfTime1) {
1586 objParameter[0].MuonShowerOutOfTime1 =
true;
1602 std::ostringstream myCoutStream;
1603 muonShowerCond.
print(myCoutStream);
1607 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1608 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1611 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1639 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1640 <<
"\n (in parseCalo) " 1641 <<
"\n condition = " << condition <<
"\n particle = " << particle
1642 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1651 if (condCalo.getType() == esConditionType::SingleEgamma) {
1656 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1661 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1666 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1671 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1672 caloObjType =
gtJet;
1676 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1677 caloObjType =
gtJet;
1681 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1682 caloObjType =
gtJet;
1686 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1687 caloObjType =
gtJet;
1691 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1692 caloObjType =
gtTau;
1696 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1697 caloObjType =
gtTau;
1701 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1702 caloObjType =
gtTau;
1706 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1707 caloObjType =
gtTau;
1712 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1719 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1720 <<
"\nCan not determine number of trigger objects. " << std::endl;
1727 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1733 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1734 tmpValues.reserve(nrObj);
1736 if (
int(condCalo.getObjects().size()) != nrObj) {
1737 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1738 <<
"condCalo.getObjects().size() = " << condCalo.getObjects().size()
1753 const std::vector<esObject>&
objects = condCalo.getObjects();
1755 const esObject&
object =
objects.at(
jj);
1756 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1759 relativeBx =
object.getBxOffset();
1762 int upperThresholdInd = -1;
1763 int lowerThresholdInd = 0;
1764 int upperIndexInd = -1;
1765 int lowerIndexInd = 0;
1767 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1769 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1770 int isolationLUT = 0xF;
1771 int qualityLUT = 0xF;
1772 int displacedLUT = 0x0;
1776 const std::vector<esCut>&
cuts =
object.getCuts();
1777 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1780 switch (
cut.getCutType()) {
1782 lowerThresholdInd =
cut.getMinimum().index;
1783 upperThresholdInd =
cut.getMaximum().index;
1785 case esCutType::Slice:
1786 lowerIndexInd =
int(
cut.getMinimum().value);
1787 upperIndexInd =
int(
cut.getMaximum().value);
1789 case esCutType::Eta: {
1791 etaWindow1Lower =
cut.getMinimum().index;
1792 etaWindow1Upper =
cut.getMaximum().index;
1793 }
else if (cntEta == 1) {
1794 etaWindow2Lower =
cut.getMinimum().index;
1795 etaWindow2Upper =
cut.getMaximum().index;
1798 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1807 phiWindow1Lower =
cut.getMinimum().index;
1808 phiWindow1Upper =
cut.getMaximum().index;
1809 }
else if (cntPhi == 1) {
1810 phiWindow2Lower =
cut.getMinimum().index;
1811 phiWindow2Upper =
cut.getMaximum().index;
1814 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1822 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1827 qualityLUT = l1tstr2int(
cut.getData());
1830 case esCutType::Displaced: {
1831 displacedLUT = l1tstr2int(
cut.getData());
1834 case esCutType::Isolation: {
1835 isolationLUT = l1tstr2int(
cut.getData());
1845 objParameter[cnt].etHighThreshold = upperThresholdInd;
1846 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1847 objParameter[cnt].indexHigh = upperIndexInd;
1848 objParameter[cnt].indexLow = lowerIndexInd;
1849 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1850 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1851 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1852 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1853 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1854 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1855 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1856 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1857 objParameter[cnt].isolationLUT = isolationLUT;
1858 objParameter[cnt].qualityLUT = qualityLUT;
1859 objParameter[cnt].displacedLUT = displacedLUT;
1862 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " 1863 << cnt <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 1864 << objParameter[cnt].etHighThreshold
1865 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1866 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1867 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1868 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1869 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1870 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1871 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1872 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1873 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1874 << objParameter[cnt].isolationLUT <<
"\n Quality LUT for calo object " << cnt
1875 <<
" = 0x" << objParameter[cnt].qualityLUT <<
"\n LLP DISP LUT for calo object " 1876 << cnt <<
" = 0x" << objParameter[cnt].displacedLUT <<
std::dec << std::endl;
1882 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1900 std::ostringstream myCoutStream;
1901 caloCond.
print(myCoutStream);
1902 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1906 if (!insertConditionIntoMap(caloCond, chipNr)) {
1907 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1912 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1914 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1944 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1945 <<
"\n (in parseCalo) " 1946 <<
"\n condition = " << condition <<
"\n particle = " << particle
1947 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1956 if (corrCalo->getType() == esObjectType::Egamma) {
1959 caloObjType =
gtJet;
1961 caloObjType =
gtTau;
1963 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1970 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1971 <<
"\nCan not determine number of trigger objects. " << std::endl;
1978 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1984 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1985 tmpValues.reserve(nrObj);
1991 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1994 relativeBx = corrCalo->getBxOffset();
1997 int upperThresholdInd = -1;
1998 int lowerThresholdInd = 0;
1999 int upperIndexInd = -1;
2000 int lowerIndexInd = 0;
2002 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
2004 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2005 int isolationLUT = 0xF;
2006 int qualityLUT = 0xF;
2007 int displacedLUT = 0x0;
2011 const std::vector<esCut>&
cuts = corrCalo->getCuts();
2012 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2015 switch (
cut.getCutType()) {
2017 lowerThresholdInd =
cut.getMinimum().index;
2018 upperThresholdInd =
cut.getMaximum().index;
2020 case esCutType::Slice:
2021 lowerIndexInd =
int(
cut.getMinimum().value);
2022 upperIndexInd =
int(
cut.getMaximum().value);
2024 case esCutType::Eta: {
2026 etaWindow1Lower =
cut.getMinimum().index;
2027 etaWindow1Upper =
cut.getMaximum().index;
2028 }
else if (cntEta == 1) {
2029 etaWindow2Lower =
cut.getMinimum().index;
2030 etaWindow2Upper =
cut.getMaximum().index;
2033 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2042 phiWindow1Lower =
cut.getMinimum().index;
2043 phiWindow1Upper =
cut.getMaximum().index;
2044 }
else if (cntPhi == 1) {
2045 phiWindow2Lower =
cut.getMinimum().index;
2046 phiWindow2Upper =
cut.getMaximum().index;
2049 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2057 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2062 qualityLUT = l1tstr2int(
cut.getData());
2065 case esCutType::Displaced: {
2066 displacedLUT = l1tstr2int(
cut.getData());
2069 case esCutType::Isolation: {
2070 isolationLUT = l1tstr2int(
cut.getData());
2080 objParameter[0].etLowThreshold = lowerThresholdInd;
2081 objParameter[0].etHighThreshold = upperThresholdInd;
2082 objParameter[0].indexHigh = upperIndexInd;
2083 objParameter[0].indexLow = lowerIndexInd;
2084 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2085 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2086 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2087 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2088 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2089 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2090 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2091 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2092 objParameter[0].isolationLUT = isolationLUT;
2093 objParameter[0].qualityLUT = qualityLUT;
2094 objParameter[0].displacedLUT = displacedLUT;
2097 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2098 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " 2099 << objParameter[0].etHighThreshold <<
"\n etaWindow Lower / Upper for calo object " 2100 <<
" = 0x" << objParameter[0].etaWindow1Lower <<
" / 0x" 2101 << objParameter[0].etaWindow1Upper
2102 <<
"\n etaWindowVeto Lower / Upper for calo object " 2103 <<
" = 0x" << objParameter[0].etaWindow2Lower <<
" / 0x" 2104 << objParameter[0].etaWindow2Upper <<
"\n phiWindow Lower / Upper for calo object " 2105 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" 2106 << objParameter[0].phiWindow1Upper
2107 <<
"\n phiWindowVeto Lower / Upper for calo object " 2108 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" 2109 << objParameter[0].phiWindow2Upper <<
"\n Isolation LUT for calo object " 2110 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2111 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2112 <<
" = 0x" << objParameter[0].displacedLUT <<
std::dec << std::endl;
2115 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2133 std::ostringstream myCoutStream;
2134 caloCond.
print(myCoutStream);
2135 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2152 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2170 unsigned int chipNr,
2171 const bool corrFlag) {
2181 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2182 <<
"\n (in parseEnergySum) " 2183 <<
"\n condition = " << condition <<
"\n type = " <<
type 2184 <<
"\n name = " <<
name << std::endl;
2190 if (condEnergySum.getType() == esConditionType::MissingEt) {
2193 }
else if (condEnergySum.getType() == esConditionType::TotalEt) {
2196 }
else if (condEnergySum.getType() == esConditionType::TotalEtEM) {
2199 }
else if (condEnergySum.getType() == esConditionType::TotalHt) {
2202 }
else if (condEnergySum.getType() == esConditionType::MissingHt) {
2205 }
else if (condEnergySum.getType() == esConditionType::MissingEtHF) {
2208 }
else if (condEnergySum.getType() == esConditionType::TowerCount) {
2211 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP0) {
2214 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM0) {
2217 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP1) {
2220 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM1) {
2223 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEt) {
2226 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHt) {
2229 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEtHF) {
2232 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHtHF) {
2235 }
else if (condEnergySum.getType() == esConditionType::Centrality0) {
2238 }
else if (condEnergySum.getType() == esConditionType::Centrality1) {
2241 }
else if (condEnergySum.getType() == esConditionType::Centrality2) {
2244 }
else if (condEnergySum.getType() == esConditionType::Centrality3) {
2247 }
else if (condEnergySum.getType() == esConditionType::Centrality4) {
2250 }
else if (condEnergySum.getType() == esConditionType::Centrality5) {
2253 }
else if (condEnergySum.getType() == esConditionType::Centrality6) {
2256 }
else if (condEnergySum.getType() == esConditionType::Centrality7) {
2260 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2272 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2283 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2285 const esObject&
object =
objects.at(
jj);
2286 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2289 relativeBx =
object.getBxOffset();
2292 int lowerThresholdInd = 0;
2293 int upperThresholdInd = -1;
2295 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2297 const std::vector<esCut>&
cuts =
object.getCuts();
2298 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2301 switch (
cut.getCutType()) {
2303 lowerThresholdInd =
cut.getMinimum().index;
2304 upperThresholdInd =
cut.getMaximum().index;
2307 case esCutType::Eta:
2312 phiWindow1Lower =
cut.getMinimum().index;
2313 phiWindow1Upper =
cut.getMaximum().index;
2314 }
else if (cntPhi == 1) {
2315 phiWindow2Lower =
cut.getMinimum().index;
2316 phiWindow2Upper =
cut.getMaximum().index;
2318 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2325 case esCutType::Count:
2326 lowerThresholdInd =
cut.getMinimum().index;
2327 upperThresholdInd = 0xffffff;
2337 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2338 objParameter[cnt].etHighThreshold = upperThresholdInd;
2339 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2340 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2341 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2342 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2345 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2346 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2347 << objParameter[cnt].etHighThreshold
2348 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2349 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2350 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2351 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2358 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2373 std::ostringstream myCoutStream;
2374 energySumCond.
print(myCoutStream);
2375 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2379 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2380 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2385 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2388 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2417 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2418 <<
"\n (in parseEnergySum) " 2419 <<
"\n condition = " << condition <<
"\n type = " <<
type 2420 <<
"\n name = " <<
name << std::endl;
2432 }
else if (corrESum->getType() == esObjectType::ETMHF) {
2435 }
else if (corrESum->getType() == esObjectType::TOWERCOUNT) {
2439 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2452 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2462 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2465 relativeBx = corrESum->getBxOffset();
2468 int lowerThresholdInd = 0;
2469 int upperThresholdInd = -1;
2471 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2473 const std::vector<esCut>&
cuts = corrESum->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::Eta:
2488 phiWindow1Lower =
cut.getMinimum().index;
2489 phiWindow1Upper =
cut.getMaximum().index;
2490 }
else if (cntPhi == 1) {
2491 phiWindow2Lower =
cut.getMinimum().index;
2492 phiWindow2Upper =
cut.getMaximum().index;
2494 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2508 objParameter[0].etLowThreshold = lowerThresholdInd;
2509 objParameter[0].etHighThreshold = upperThresholdInd;
2510 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2511 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2512 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2513 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2516 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2517 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2518 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2519 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2520 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2521 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2525 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2540 std::ostringstream myCoutStream;
2541 energySumCond.
print(myCoutStream);
2542 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2560 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2587 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2588 <<
"\n (in parseExternal) " 2589 <<
"\n condition = " << condition <<
"\n particle = " << particle
2590 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2599 unsigned int channelID = 0;
2602 const std::vector<esObject>&
objects = condExt.getObjects();
2604 const esObject&
object =
objects.at(
jj);
2605 if (
object.getType() == esObjectType::EXT) {
2606 relativeBx =
object.getBxOffset();
2607 channelID =
object.getExternalChannelId();
2615 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2627 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2630 if (!insertConditionIntoMap(externalCond, chipNr)) {
2631 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2635 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2661 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2662 <<
" (in parseCorrelation) " << std::endl
2663 <<
" condition = " << condition << std::endl
2664 <<
" particle = " << particle << std::endl
2665 <<
" type = " <<
type << std::endl
2666 <<
" name = " <<
name << std::endl;
2672 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2673 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2684 const int nrObj = 2;
2687 int intGEq[nrObj] = {-1, -1};
2688 std::vector<GlobalObject>
objType(nrObj);
2689 std::vector<GtConditionCategory> condCateg(nrObj);
2692 const bool corrFlag =
true;
2693 int corrIndexVal[nrObj] = {-1, -1};
2701 const std::vector<esCut>&
cuts = corrCond.getCuts();
2702 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2705 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2706 if (
cut.getData() ==
"ls")
2708 else if (
cut.getData() ==
"os")
2716 double minV =
cut.getMinimum().value;
2717 double maxV =
cut.getMaximum().value;
2724 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2725 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2726 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2730 cutType = cutType | 0x1;
2732 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2733 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2734 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2738 cutType = cutType | 0x2;
2740 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2741 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2742 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2746 cutType = cutType | 0x4;
2747 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2751 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2752 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2753 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2754 cutType = cutType | 0x20;
2756 (
cut.getCutType() == esCutType::MassDeltaR)) {
2757 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2758 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2759 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2764 if (corrCond.getType() == esConditionType::TransverseMass) {
2765 cutType = cutType | 0x10;
2766 }
else if (corrCond.getType() == esConditionType::InvariantMassDeltaR) {
2767 cutType = cutType | 0x80;
2769 cutType = cutType | 0x8;
2771 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2772 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2773 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2774 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2778 cutType = cutType | 0x40;
2785 const std::vector<esObject>&
objects = corrCond.getObjects();
2787 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 2788 <<
" corrFlag " << corrFlag << std::endl;
2794 const esObject&
object =
objects.at(
jj);
2795 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2796 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2797 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2798 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2835 parseMuonCorr(&
object, chipNr);
2836 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2839 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2843 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
2846 parseCaloCorr(&
object, chipNr);
2847 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2850 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2851 switch (
object.getType()) {
2852 case esObjectType::Egamma: {
2866 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2867 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2869 parseEnergySumCorr(&
object, chipNr);
2870 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2873 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2874 switch (
object.getType()) {
2881 case esObjectType::ETMHF: {
2884 case esObjectType::TOWERCOUNT: {
2893 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
2894 <<
" for the correlation condition " <<
name << std::endl;
2903 if (intGEq[0] != intGEq[1]) {
2904 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 2905 <<
" for the correlation condition " <<
name << std::endl;
2909 gEq = (intGEq[0] != 0);
2927 std::ostringstream myCoutStream;
2928 correlationCond.
print(myCoutStream);
2929 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2935 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
2962 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2963 <<
" (in parseCorrelationThreeBody) " << std::endl
2964 <<
" condition = " << condition << std::endl
2965 <<
" particle = " << particle << std::endl
2966 <<
" type = " <<
type << std::endl
2967 <<
" name = " <<
name << std::endl;
2973 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2974 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2982 const int nrObj = 3;
2985 std::vector<GlobalObject>
objType(nrObj);
2986 std::vector<GtConditionCategory> condCateg(nrObj);
2989 const bool corrFlag =
true;
2990 int corrIndexVal[nrObj] = {-1, -1, -1};
3000 const std::vector<esCut>&
cuts = corrCond.getCuts();
3001 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
3002 const esCut&
cut =
cuts.at(lll);
3004 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3005 if (
cut.getData() ==
"ls")
3007 else if (
cut.getData() ==
"os")
3016 double minV =
cut.getMinimum().value;
3017 double maxV =
cut.getMaximum().value;
3023 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3024 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3025 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3029 cutType = cutType | 0x8;
3030 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3034 cutType = cutType | 0x80;
3040 const std::vector<esObject>&
objects = corrCond.getObjects();
3042 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3043 <<
" corrFlag " << corrFlag << std::endl;
3048 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3049 const esObject&
object =
objects.at(lll);
3050 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3051 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3052 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3057 parseMuonCorr(&
object, chipNr);
3058 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
3065 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3066 <<
" for the correlation condition " <<
name 3067 <<
": no three muons in the event!" << std::endl;
3087 std::ostringstream myCoutStream;
3088 correlationThreeBodyCond.
print(myCoutStream);
3089 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3095 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3115 unsigned int chipNr) {
3123 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3124 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3125 <<
" condition = " << condition << std::endl
3126 <<
" particle = " << particle << std::endl
3127 <<
" type = " <<
type << std::endl
3128 <<
" name = " <<
name << std::endl;
3134 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3135 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3146 const int nrObj = 3;
3149 int intGEq[nrObj] = {-1, -1, -1};
3150 std::vector<GlobalObject>
objType(nrObj);
3151 std::vector<GtConditionCategory> condCateg(nrObj);
3154 const bool corrFlag =
true;
3155 int corrIndexVal[nrObj] = {-1, -1, -1};
3163 const std::vector<esCut>&
cuts = corrCond.getCuts();
3164 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3167 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3168 if (
cut.getData() ==
"ls")
3170 else if (
cut.getData() ==
"os")
3178 double minV =
cut.getMinimum().value;
3179 double maxV =
cut.getMaximum().value;
3190 cutType = cutType | 0x1;
3196 cutType = cutType | 0x2;
3202 cutType = cutType | 0x4;
3208 cutType = cutType | 0x8;
3209 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3213 cutType = cutType | 0x80;
3215 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3220 cutType = cutType | 0x10;
3221 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3226 cutType = cutType | 0x20;
3227 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3232 cutType = cutType | 0x40;
3239 const std::vector<esObject>&
objects = corrCond.getObjects();
3242 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3243 << corrFlag << std::endl;
3249 const esObject&
object =
objects.at(
jj);
3250 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3251 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3252 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3253 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3254 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3291 parseMuonCorr(&
object, chipNr);
3292 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3295 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3299 }
else if (
object.getType() == esObjectType::Egamma ||
object.getType() ==
esObjectType::Jet ||
3302 parseCaloCorr(&
object, chipNr);
3303 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3306 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3307 switch (
object.getType()) {
3308 case esObjectType::Egamma: {
3322 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3323 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3325 parseEnergySumCorr(&
object, chipNr);
3326 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3329 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3330 switch (
object.getType()) {
3337 case esObjectType::ETMHF: {
3340 case esObjectType::TOWERCOUNT: {
3349 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3350 <<
" for the correlation condition " <<
name << std::endl;
3359 if (intGEq[0] != intGEq[1]) {
3360 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3361 <<
" for the correlation condition " <<
name << std::endl;
3365 gEq = (intGEq[0] != 0);
3385 std::ostringstream myCoutStream;
3386 correlationWORCond.
print(myCoutStream);
3387 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3393 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3418 if (algAlias.empty()) {
3420 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3421 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3425 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3426 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3433 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3434 <<
" Chip number: " << chipNr << std::endl;
3440 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3455 std::ostringstream myCoutStream;
3456 alg.
print(myCoutStream);
3457 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3461 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)
void setCond0Index(const int &)
typedef for correlation three-body parameters
int algoBitNumber() const
get / set algorithm bit number
void setCorrelationThreeBodyParameter(const CorrelationThreeBodyParameter &corrThreeBodyParameter)
void setCond0Index(const int &)
void print(std::ostream &myCout) const override
print the condition
unsigned int chargeCorrelation
const int algoOutputPin(const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
get the output pin on the condition chip for the algorithm
void setCond1Index(const int &)
void setCondType(const l1t::GtConditionType &cType)
void setConditionParameter(const std::vector< ObjectParameter > &objParameter)
set functions
void setCorrelationParameter(const CorrelationParameter &corrParameter)
long long minMassCutValue
void print(std::ostream &myCout) const override
print the condition
Log< level::Error, false > LogError
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)
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
long long minMassCutValue
long long minTBPTCutValue
void setCond1Category(const l1t::GtConditionCategory &)
unsigned int precOverlapRemovalEtaCut
long long minOverlapRemovalPhiCutValue
void setCond1Index(const int &)
unsigned int chargeCorrelation
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
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
unsigned int precOverlapRemovalDRCut
std::vector< std::pair< double, double > > etBins
void setAlgoChipNumber(const int algoChipNumberValue)
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
typedef for a single object template
long long maxOverlapRemovalPhiCutValue
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
typedef for correlation parameters
long long maxTBPTCutValue
char data[epos_bytes_allocation]
long long minOverlapRemovalDRCutValue
std::string const & algoAlias() const
get / set algorithm alias
std::vector< std::pair< double, double > > uptBins
typedef for correlation parameters
void print(std::ostream &myCout) const override
print the condition
void setCond1Category(const l1t::GtConditionCategory &)
typedef for correlation parameters
unsigned int chargeCorrelation
void setCond2Category(const l1t::GtConditionCategory &)
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
Power< A, B >::type pow(const A &a, const B &b)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
const std::string algoName() const
get / set algorithm name
void setCond2Index(const int &)
long long maxMassCutValue
std::vector< std::pair< double, double > > etaBins
void setCond1Index(const int &)