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);
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::MuonShowerOutOfTime0 ||
316 condition.getType() == esConditionType::MuonShowerOutOfTime1) {
317 parseMuonShower(condition, chipNr,
false);
320 }
else if (condition.getType() == esConditionType::MuonMuonCorrelation ||
321 condition.getType() == esConditionType::MuonEsumCorrelation ||
322 condition.getType() == esConditionType::CaloMuonCorrelation ||
323 condition.getType() == esConditionType::CaloCaloCorrelation ||
324 condition.getType() == esConditionType::CaloEsumCorrelation ||
325 condition.getType() == esConditionType::InvariantMass ||
326 condition.getType() == esConditionType::InvariantMassDeltaR ||
327 condition.getType() == esConditionType::TransverseMass ||
328 condition.getType() == esConditionType::InvariantMassUpt) {
329 parseCorrelation(condition, chipNr);
332 }
else if (condition.getType() == esConditionType::InvariantMass3) {
333 parseCorrelationThreeBody(condition, chipNr);
336 }
else if (condition.getType() == esConditionType::Externals) {
337 parseExternal(condition, chipNr);
340 }
else if (condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
341 condition.getType() == esConditionType::InvariantMassOvRm ||
342 condition.getType() == esConditionType::TransverseMassOvRm ||
343 condition.getType() == esConditionType::DoubleJetOvRm ||
344 condition.getType() == esConditionType::DoubleTauOvRm) {
345 parseCorrelationWithOverlapRemoval(condition, chipNr);
347 }
else if (condition.getType() == esConditionType::SingleEgammaOvRm ||
348 condition.getType() == esConditionType::DoubleEgammaOvRm ||
349 condition.getType() == esConditionType::TripleEgammaOvRm ||
350 condition.getType() == esConditionType::QuadEgammaOvRm ||
351 condition.getType() == esConditionType::SingleTauOvRm ||
352 condition.getType() == esConditionType::TripleTauOvRm ||
353 condition.getType() == esConditionType::QuadTauOvRm ||
354 condition.getType() == esConditionType::SingleJetOvRm ||
355 condition.getType() == esConditionType::TripleJetOvRm ||
356 condition.getType() == esConditionType::QuadJetOvRm) {
358 <<
"\n SingleEgammaOvRm" 359 <<
"\n DoubleEgammaOvRm" 360 <<
"\n TripleEgammaOvRm" 361 <<
"\n QuadEgammaOvRm" 362 <<
"\n SingleTauOvRm" 363 <<
"\n TripleTauOvRm" 365 <<
"\n SingleJetOvRm" 366 <<
"\n TripleJetOvRm" 368 <<
"\n The above conditions types OvRm are not implemented yet in the " 369 "parser. Please remove alogrithms that " 370 "use this type of condtion from L1T Menu!" 386 m_triggerMenuInterfaceAuthor =
val;
390 m_triggerMenuInterfaceDescription =
val;
408 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
412 itCondOnChip->clear();
416 m_algorithmMap.clear();
423 LogTrace(
"TriggerMenuParser") <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." 427 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
428 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName <<
" already exists - not inserted!" << std::endl;
432 (m_conditionMap[chipNr])[cName] = &
cond;
433 LogTrace(
"TriggerMenuParser") <<
" OK - condition inserted!" << std::endl;
446 if (m_algorithmMap.count(algName) != 0) {
447 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
448 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
452 if (m_algorithmAliasMap.count(algAlias) != 0) {
453 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
454 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
461 LogTrace(
"TriggerMenuParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, " 462 << m_numberPhysTriggers <<
") - algorithm not inserted!" << std::endl;
467 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
468 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " << m_numberPhysTriggers
469 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
475 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
477 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
478 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, " 479 << m_numberConditionChips <<
") - algorithm not inserted!" << std::endl;
485 static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
487 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
488 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, " 489 << m_pinsOnConditionChip <<
"] - algorithm not inserted!" << std::endl;
494 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
495 int iPin = (itAlgo->second)
496 .algoOutputPin(static_cast<int>(m_numberConditionChips),
497 static_cast<int>(m_pinsOnConditionChip),
498 m_orderConditionChip);
500 int iChip = (itAlgo->second)
501 .algoChipNumber(static_cast<int>(m_numberConditionChips),
502 static_cast<int>(m_pinsOnConditionChip),
503 m_orderConditionChip);
505 if ((outputPin == iPin) && (chipNr == iChip)) {
506 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
507 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 514 m_algorithmMap[algName] = alg;
515 m_algorithmAliasMap[algAlias] = alg;
524 template <
typename T>
526 std::stringstream
ss;
531 std::stringstream
ss;
561 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end(); cit++) {
562 const esScale&
scale = cit->second;
566 scaleParam = &muScales;
568 scaleParam = &egScales;
570 scaleParam = &tauScales;
572 scaleParam = &jetScales;
574 scaleParam = &ettScales;
575 else if (
scale.getObjectType() == esObjectType::ETTEM)
576 scaleParam = &ettEmScales;
578 scaleParam = &etmScales;
579 else if (
scale.getObjectType() == esObjectType::ETMHF)
580 scaleParam = &etmHfScales;
582 scaleParam = &httScales;
584 scaleParam = &htmScales;
586 scaleParam =
nullptr;
588 if (scaleParam !=
nullptr) {
589 switch (
scale.getScaleType()) {
590 case esScaleType::EtScale: {
596 const std::vector<esBin>& binsV =
scale.getBins();
597 for (
unsigned int i = 0;
i < binsV.size();
i++) {
598 const esBin&
bin = binsV.at(
i);
599 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
600 scaleParam->
etBins.push_back(binLimits);
607 scale.getObjectType() == esObjectType::ETTEM ||
scale.getObjectType() == esObjectType::ETMHF) {
612 scale.getObjectType() == esObjectType::ETTEM) {
620 case esScaleType::UnconstrainedPtScale: {
626 const std::vector<esBin>& binsV =
scale.getBins();
627 for (
unsigned int i = 0;
i < binsV.size();
i++) {
628 const esBin&
bin = binsV.at(
i);
629 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
630 scaleParam->
uptBins.push_back(binLimits);
633 case esScaleType::EtaScale: {
639 const std::vector<esBin>& binsV =
scale.getBins();
641 for (
unsigned int i = 0;
i < binsV.size();
i++) {
642 const esBin&
bin = binsV.at(
i);
643 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
644 scaleParam->
etaBins.at(
bin.hw_index) = binLimits;
647 case esScaleType::PhiScale: {
653 const std::vector<esBin>& binsV =
scale.getBins();
655 for (
unsigned int i = 0;
i < binsV.size();
i++) {
656 const esBin&
bin = binsV.at(
i);
657 std::pair<double, double> binLimits(
bin.minimum,
bin.maximum);
658 scaleParam->
phiBins.at(
bin.hw_index) = binLimits;
669 m_gtScales.setMuonScales(muScales);
670 m_gtScales.setEGScales(egScales);
671 m_gtScales.setTauScales(tauScales);
672 m_gtScales.setJetScales(jetScales);
673 m_gtScales.setETTScales(ettScales);
674 m_gtScales.setETTEmScales(ettEmScales);
675 m_gtScales.setETMScales(etmScales);
676 m_gtScales.setETMHfScales(etmHfScales);
677 m_gtScales.setHTTScales(httScales);
678 m_gtScales.setHTMScales(htmScales);
681 bool hasPrecision =
false;
682 std::map<std::string, unsigned int> precisions;
683 getPrecisions(precisions, scaleMap);
684 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
691 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
692 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
693 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
697 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
698 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
699 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
700 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
701 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
702 parseCalMuPhi_LUTS(scaleMap,
"ETMHF",
"MU");
706 parsePt_LUTS(scaleMap,
"Mass",
"EG", precisions[
"PRECISION-EG-MU-MassPt"]);
707 parsePt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
708 parseUpt_LUTS(scaleMap,
"Mass",
"MU", precisions[
"PRECISION-EG-MU-MassPt"]);
709 parsePt_LUTS(scaleMap,
"Mass",
"JET", precisions[
"PRECISION-EG-JET-MassPt"]);
710 parsePt_LUTS(scaleMap,
"Mass",
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"]);
711 parsePt_LUTS(scaleMap,
"Mass",
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"]);
712 parsePt_LUTS(scaleMap,
"Mass",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"]);
713 parsePt_LUTS(scaleMap,
"Mass",
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"]);
717 parsePt_LUTS(scaleMap,
"TwoBody",
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
718 parsePt_LUTS(scaleMap,
"TwoBody",
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"]);
719 parsePt_LUTS(scaleMap,
"TwoBody",
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"]);
720 parsePt_LUTS(scaleMap,
"TwoBody",
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"]);
721 parsePt_LUTS(scaleMap,
"TwoBody",
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"]);
722 parsePt_LUTS(scaleMap,
"TwoBody",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"]);
723 parsePt_LUTS(scaleMap,
"TwoBody",
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"]);
727 parseDeltaEta_Cosh_LUTS(
728 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
729 parseDeltaEta_Cosh_LUTS(
730 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
731 parseDeltaEta_Cosh_LUTS(
732 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
733 parseDeltaEta_Cosh_LUTS(
734 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
736 parseDeltaEta_Cosh_LUTS(
737 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
738 parseDeltaEta_Cosh_LUTS(
739 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
740 parseDeltaEta_Cosh_LUTS(
741 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
743 parseDeltaEta_Cosh_LUTS(
744 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
745 parseDeltaEta_Cosh_LUTS(
746 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
748 parseDeltaEta_Cosh_LUTS(
749 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
753 parseDeltaPhi_Cos_LUTS(
754 scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
755 parseDeltaPhi_Cos_LUTS(
756 scaleMap,
"EG",
"JET", precisions[
"PRECISION-EG-JET-Delta"], precisions[
"PRECISION-EG-JET-Math"]);
757 parseDeltaPhi_Cos_LUTS(
758 scaleMap,
"EG",
"TAU", precisions[
"PRECISION-EG-TAU-Delta"], precisions[
"PRECISION-EG-TAU-Math"]);
759 parseDeltaPhi_Cos_LUTS(
760 scaleMap,
"EG",
"ETM", precisions[
"PRECISION-EG-ETM-Delta"], precisions[
"PRECISION-EG-ETM-Math"]);
761 parseDeltaPhi_Cos_LUTS(
762 scaleMap,
"EG",
"ETMHF", precisions[
"PRECISION-EG-ETMHF-Delta"], precisions[
"PRECISION-EG-ETMHF-Math"]);
763 parseDeltaPhi_Cos_LUTS(
764 scaleMap,
"EG",
"HTM", precisions[
"PRECISION-EG-HTM-Delta"], precisions[
"PRECISION-EG-HTM-Math"]);
765 parseDeltaPhi_Cos_LUTS(
766 scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
768 parseDeltaPhi_Cos_LUTS(
769 scaleMap,
"JET",
"JET", precisions[
"PRECISION-JET-JET-Delta"], precisions[
"PRECISION-JET-JET-Math"]);
770 parseDeltaPhi_Cos_LUTS(
771 scaleMap,
"JET",
"TAU", precisions[
"PRECISION-JET-TAU-Delta"], precisions[
"PRECISION-JET-TAU-Math"]);
772 parseDeltaPhi_Cos_LUTS(
773 scaleMap,
"JET",
"ETM", precisions[
"PRECISION-JET-ETM-Delta"], precisions[
"PRECISION-JET-ETM-Math"]);
774 parseDeltaPhi_Cos_LUTS(
775 scaleMap,
"JET",
"ETMHF", precisions[
"PRECISION-JET-ETMHF-Delta"], precisions[
"PRECISION-JET-ETMHF-Math"]);
776 parseDeltaPhi_Cos_LUTS(
777 scaleMap,
"JET",
"HTM", precisions[
"PRECISION-JET-HTM-Delta"], precisions[
"PRECISION-JET-HTM-Math"]);
778 parseDeltaPhi_Cos_LUTS(
779 scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
781 parseDeltaPhi_Cos_LUTS(
782 scaleMap,
"TAU",
"TAU", precisions[
"PRECISION-TAU-TAU-Delta"], precisions[
"PRECISION-TAU-TAU-Math"]);
783 parseDeltaPhi_Cos_LUTS(
784 scaleMap,
"TAU",
"ETM", precisions[
"PRECISION-TAU-ETM-Delta"], precisions[
"PRECISION-TAU-ETM-Math"]);
785 parseDeltaPhi_Cos_LUTS(
786 scaleMap,
"TAU",
"ETMHF", precisions[
"PRECISION-TAU-ETMHF-Delta"], precisions[
"PRECISION-TAU-ETMHF-Math"]);
787 parseDeltaPhi_Cos_LUTS(
788 scaleMap,
"TAU",
"HTM", precisions[
"PRECISION-TAU-HTM-Delta"], precisions[
"PRECISION-TAU-HTM-Math"]);
789 parseDeltaPhi_Cos_LUTS(
790 scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
792 parseDeltaPhi_Cos_LUTS(
793 scaleMap,
"MU",
"ETM", precisions[
"PRECISION-MU-ETM-Delta"], precisions[
"PRECISION-MU-ETM-Math"]);
794 parseDeltaPhi_Cos_LUTS(
795 scaleMap,
"MU",
"ETMHF", precisions[
"PRECISION-MU-ETMHF-Delta"], precisions[
"PRECISION-MU-ETMHF-Math"]);
796 parseDeltaPhi_Cos_LUTS(
797 scaleMap,
"MU",
"HTM", precisions[
"PRECISION-MU-HTM-Delta"], precisions[
"PRECISION-MU-HTM-Math"]);
798 parseDeltaPhi_Cos_LUTS(
799 scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
801 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::COS, precisions[
"PRECISION-EG-EG-Math"]);
802 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::COS, precisions[
"PRECISION-JET-JET-Math"]);
803 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::COS, precisions[
"PRECISION-TAU-TAU-Math"]);
804 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::COS, precisions[
"PRECISION-MU-MU-Math"]);
806 parsePhi_Trig_LUTS(scaleMap,
"EG",
l1t::SIN, precisions[
"PRECISION-EG-EG-Math"]);
807 parsePhi_Trig_LUTS(scaleMap,
"JET",
l1t::SIN, precisions[
"PRECISION-JET-JET-Math"]);
808 parsePhi_Trig_LUTS(scaleMap,
"TAU",
l1t::SIN, precisions[
"PRECISION-TAU-TAU-Math"]);
809 parsePhi_Trig_LUTS(scaleMap,
"MU",
l1t::SIN, precisions[
"PRECISION-MU-MU-Math"]);
831 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
834 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
835 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
837 std::vector<long long> lut_cal_2_mu_eta;
838 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
843 m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
858 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
861 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
862 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
864 std::vector<long long> lut_cal_2_mu_phi;
865 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
870 m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
884 if (scaleMap.find(scLabel1) == scaleMap.end())
887 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
889 std::vector<long long> lut_pt;
890 getLut(lut_pt, scale1, prec);
892 m_gtScales.setLUT_Pt(lutpfx +
"_" + scLabel1, lut_pt, prec);
907 if (scaleMap.find(scLabel1) == scaleMap.end())
910 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
912 std::vector<long long> lut_pt;
913 getLut(lut_pt, scale1, prec);
915 m_gtScales.setLUT_Upt(lutpfx +
"_" + scLabel1, lut_pt, prec);
922 unsigned int prec2) {
932 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
935 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
936 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
937 std::vector<double> val_delta_eta;
938 std::vector<long long> lut_delta_eta;
939 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
940 setLut(lut_delta_eta, val_delta_eta, prec1);
944 m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
947 std::vector<long long> lut_cosh;
948 applyCosh(val_delta_eta,
n);
949 setLut(lut_cosh, val_delta_eta, prec2);
950 m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
957 unsigned int prec2) {
967 if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
970 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
971 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
972 std::vector<double> val_delta_phi;
973 std::vector<long long> lut_delta_phi;
974 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
975 setLut(lut_delta_phi, val_delta_phi, prec1);
979 m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
982 std::vector<long long> lut_cos;
983 applyCos(val_delta_phi,
n);
984 setLut(lut_cos, val_delta_phi, prec2);
985 m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
998 if (scaleMap.find(scLabel) == scaleMap.end())
1003 const esScale*
scale = &scaleMap.find(scLabel)->second;
1008 const size_t bitwidth =
std::ceil(std::log10(
n) / std::log10(2));
1012 for (
size_t ii = 0;
ii <
n;
ii++) {
1017 std::vector<long long> lut;
1020 setLut(lut,
array, prec);
1021 m_gtScales.setLUT_Sin(lutName, lut, prec);
1024 setLut(lut,
array, prec);
1025 m_gtScales.setLUT_Cos(lutName, lut, prec);
1060 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1064 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1069 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" <<
type <<
")" << std::endl;
1074 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1075 <<
"\nCan not determine number of trigger objects. " << std::endl;
1079 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1081 <<
"\n condition = " << condition <<
"\n particle = " << particle
1082 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1087 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1093 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1094 tmpValues.reserve(nrObj);
1096 if (
int(condMu.getObjects().size()) != nrObj) {
1097 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1098 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1103 unsigned int chargeCorrelation = 1;
1104 const std::vector<esCut>&
cuts = condMu.getCuts();
1105 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
1107 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
1108 if (
cut.getData() ==
"ls")
1109 chargeCorrelation = 2;
1110 else if (
cut.getData() ==
"os")
1111 chargeCorrelation = 4;
1113 chargeCorrelation = 1;
1127 const std::vector<esObject>&
objects = condMu.getObjects();
1130 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1133 relativeBx =
object.getBxOffset();
1136 int upperUnconstrainedPtInd = -1;
1137 int lowerUnconstrainedPtInd = 0;
1138 int upperImpactParameterInd = -1;
1139 int lowerImpactParameterInd = 0;
1140 int upperThresholdInd = -1;
1141 int lowerThresholdInd = 0;
1142 int upperIndexInd = -1;
1143 int lowerIndexInd = 0;
1145 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1147 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1148 int isolationLUT = 0xF;
1149 int impactParameterLUT = 0xF;
1151 int qualityLUT = 0xFFFF;
1153 const std::vector<esCut>&
cuts =
object.getCuts();
1154 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1157 switch (
cut.getCutType()) {
1158 case esCutType::UnconstrainedPt:
1159 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1160 upperUnconstrainedPtInd =
cut.getMaximum().index;
1163 case esCutType::ImpactParameter:
1164 lowerImpactParameterInd =
cut.getMinimum().index;
1165 upperImpactParameterInd =
cut.getMaximum().index;
1166 impactParameterLUT = l1tstr2int(
cut.getData());
1170 lowerThresholdInd =
cut.getMinimum().index;
1171 upperThresholdInd =
cut.getMaximum().index;
1174 case esCutType::Slice:
1175 lowerIndexInd =
int(
cut.getMinimum().value);
1176 upperIndexInd =
int(
cut.getMaximum().value);
1179 case esCutType::Eta: {
1181 etaWindow1Lower =
cut.getMinimum().index;
1182 etaWindow1Upper =
cut.getMaximum().index;
1183 }
else if (cntEta == 1) {
1184 etaWindow2Lower =
cut.getMinimum().index;
1185 etaWindow2Upper =
cut.getMaximum().index;
1188 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1197 phiWindow1Lower =
cut.getMinimum().index;
1198 phiWindow1Upper =
cut.getMaximum().index;
1199 }
else if (cntPhi == 1) {
1200 phiWindow2Lower =
cut.getMinimum().index;
1201 phiWindow2Upper =
cut.getMaximum().index;
1204 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1212 if (
cut.getData() ==
"positive")
1214 else if (
cut.getData() ==
"negative")
1221 qualityLUT = l1tstr2int(
cut.getData());
1224 case esCutType::Isolation: {
1225 isolationLUT = l1tstr2int(
cut.getData());
1235 objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1236 objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1237 objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1238 objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1239 objParameter[cnt].impactParameterLUT = impactParameterLUT;
1241 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1242 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1244 objParameter[cnt].indexHigh = upperIndexInd;
1245 objParameter[cnt].indexLow = lowerIndexInd;
1247 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1248 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1249 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1250 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1252 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1253 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1254 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1255 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1258 objParameter[cnt].enableMip =
false;
1259 objParameter[cnt].enableIso =
false;
1260 objParameter[cnt].requestIso =
false;
1262 objParameter[cnt].charge =
charge;
1263 objParameter[cnt].qualityLUT = qualityLUT;
1264 objParameter[cnt].isolationLUT = isolationLUT;
1284 std::ostringstream myCoutStream;
1285 muonCond.
print(myCoutStream);
1286 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1290 if (!insertConditionIntoMap(muonCond, chipNr)) {
1291 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1294 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1296 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1298 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1299 (m_vecMuonTemplate[chipNr]).
push_back(muonCond);
1321 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type <<
")" 1322 <<
"\nCan not determine number of trigger objects. " << std::endl;
1326 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1328 <<
"\n condition = " << condition <<
"\n particle = " << particle
1329 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1334 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1340 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1341 tmpValues.reserve(nrObj);
1346 unsigned int chargeCorrelation = 0;
1347 if (str_chargeCorrelation ==
"ig")
1348 chargeCorrelation = 1;
1349 else if (str_chargeCorrelation ==
"ls")
1350 chargeCorrelation = 2;
1351 else if (str_chargeCorrelation ==
"os")
1352 chargeCorrelation = 4;
1362 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1365 relativeBx = corrMu->getBxOffset();
1368 int upperUnconstrainedPtInd = -1;
1369 int lowerUnconstrainedPtInd = 0;
1370 int upperImpactParameterInd = -1;
1371 int lowerImpactParameterInd = 0;
1372 int impactParameterLUT = 0xF;
1373 int upperThresholdInd = -1;
1374 int lowerThresholdInd = 0;
1375 int upperIndexInd = -1;
1376 int lowerIndexInd = 0;
1378 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1380 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1381 int isolationLUT = 0xF;
1383 int qualityLUT = 0xFFFF;
1385 const std::vector<esCut>&
cuts = corrMu->getCuts();
1386 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1389 switch (
cut.getCutType()) {
1390 case esCutType::UnconstrainedPt:
1391 lowerUnconstrainedPtInd =
cut.getMinimum().index;
1392 upperUnconstrainedPtInd =
cut.getMaximum().index;
1395 case esCutType::ImpactParameter:
1396 lowerImpactParameterInd =
cut.getMinimum().index;
1397 upperImpactParameterInd =
cut.getMaximum().index;
1398 impactParameterLUT = l1tstr2int(
cut.getData());
1402 lowerThresholdInd =
cut.getMinimum().index;
1403 upperThresholdInd =
cut.getMaximum().index;
1406 case esCutType::Slice:
1407 lowerIndexInd =
int(
cut.getMinimum().value);
1408 upperIndexInd =
int(
cut.getMaximum().value);
1411 case esCutType::Eta: {
1413 etaWindow1Lower =
cut.getMinimum().index;
1414 etaWindow1Upper =
cut.getMaximum().index;
1415 }
else if (cntEta == 1) {
1416 etaWindow2Lower =
cut.getMinimum().index;
1417 etaWindow2Upper =
cut.getMaximum().index;
1420 <<
"Too Many Eta Cuts for muon-condition (" << particle <<
")" << std::endl;
1429 phiWindow1Lower =
cut.getMinimum().index;
1430 phiWindow1Upper =
cut.getMaximum().index;
1431 }
else if (cntPhi == 1) {
1432 phiWindow2Lower =
cut.getMinimum().index;
1433 phiWindow2Upper =
cut.getMaximum().index;
1436 <<
"Too Many Phi Cuts for muon-condition (" << particle <<
")" << std::endl;
1444 if (
cut.getData() ==
"positive")
1446 else if (
cut.getData() ==
"negative")
1453 qualityLUT = l1tstr2int(
cut.getData());
1456 case esCutType::Isolation: {
1457 isolationLUT = l1tstr2int(
cut.getData());
1467 objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd;
1468 objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd;
1469 objParameter[0].impactParameterHigh = upperImpactParameterInd;
1470 objParameter[0].impactParameterLow = lowerImpactParameterInd;
1471 objParameter[0].impactParameterLUT = impactParameterLUT;
1473 objParameter[0].ptHighThreshold = upperThresholdInd;
1474 objParameter[0].ptLowThreshold = lowerThresholdInd;
1476 objParameter[0].indexHigh = upperIndexInd;
1477 objParameter[0].indexLow = lowerIndexInd;
1479 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1480 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1481 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1482 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1484 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1485 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1486 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1487 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1490 objParameter[0].enableMip =
false;
1491 objParameter[0].enableIso =
false;
1492 objParameter[0].requestIso =
false;
1494 objParameter[0].charge =
charge;
1495 objParameter[0].qualityLUT = qualityLUT;
1496 objParameter[0].isolationLUT = isolationLUT;
1512 std::ostringstream myCoutStream;
1513 muonCond.
print(myCoutStream);
1514 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1530 (m_corMuonTemplate[chipNr]).
push_back(muonCond);
1548 unsigned int chipNr,
1549 const bool corrFlag) {
1564 std::vector<MuonShowerTemplate::ObjectParameter> objParameter(nrObj);
1566 if (
int(condMu.getObjects().size()) != nrObj) {
1567 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1568 <<
"condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1573 esObject
object = condMu.getObjects().at(0);
1574 int relativeBx =
object.getBxOffset();
1576 if (condMu.getType() == esConditionType::MuonShower0) {
1577 objParameter[0].MuonShower0 =
true;
1578 }
else if (condMu.getType() == esConditionType::MuonShower1) {
1579 objParameter[0].MuonShower1 =
true;
1580 }
else if (condMu.getType() == esConditionType::MuonShowerOutOfTime0) {
1581 objParameter[0].MuonShowerOutOfTime0 =
true;
1582 }
else if (condMu.getType() == esConditionType::MuonShowerOutOfTime1) {
1583 objParameter[0].MuonShowerOutOfTime1 =
true;
1599 std::ostringstream myCoutStream;
1600 muonShowerCond.
print(myCoutStream);
1604 if (!insertConditionIntoMap(muonShowerCond, chipNr)) {
1605 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1608 (m_vecMuonShowerTemplate[chipNr]).
push_back(muonShowerCond);
1636 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1637 <<
"\n (in parseCalo) " 1638 <<
"\n condition = " << condition <<
"\n particle = " << particle
1639 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1648 if (condCalo.getType() == esConditionType::SingleEgamma) {
1653 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1658 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1663 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1668 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1669 caloObjType =
gtJet;
1673 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1674 caloObjType =
gtJet;
1678 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1679 caloObjType =
gtJet;
1683 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1684 caloObjType =
gtJet;
1688 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1689 caloObjType =
gtTau;
1693 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1694 caloObjType =
gtTau;
1698 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1699 caloObjType =
gtTau;
1703 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1704 caloObjType =
gtTau;
1709 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1716 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1717 <<
"\nCan not determine number of trigger objects. " << std::endl;
1724 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1730 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1731 tmpValues.reserve(nrObj);
1733 if (
int(condCalo.getObjects().size()) != nrObj) {
1734 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1735 <<
"condCalo.getObjects().size() = " << condCalo.getObjects().size()
1750 const std::vector<esObject>&
objects = condCalo.getObjects();
1753 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1756 relativeBx =
object.getBxOffset();
1759 int upperThresholdInd = -1;
1760 int lowerThresholdInd = 0;
1761 int upperIndexInd = -1;
1762 int lowerIndexInd = 0;
1764 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1766 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1767 int isolationLUT = 0xF;
1768 int qualityLUT = 0xF;
1769 int displacedLUT = 0x0;
1773 const std::vector<esCut>&
cuts =
object.getCuts();
1774 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
1777 switch (
cut.getCutType()) {
1779 lowerThresholdInd =
cut.getMinimum().index;
1780 upperThresholdInd =
cut.getMaximum().index;
1782 case esCutType::Slice:
1783 lowerIndexInd =
int(
cut.getMinimum().value);
1784 upperIndexInd =
int(
cut.getMaximum().value);
1786 case esCutType::Eta: {
1788 etaWindow1Lower =
cut.getMinimum().index;
1789 etaWindow1Upper =
cut.getMaximum().index;
1790 }
else if (cntEta == 1) {
1791 etaWindow2Lower =
cut.getMinimum().index;
1792 etaWindow2Upper =
cut.getMaximum().index;
1795 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
1804 phiWindow1Lower =
cut.getMinimum().index;
1805 phiWindow1Upper =
cut.getMaximum().index;
1806 }
else if (cntPhi == 1) {
1807 phiWindow2Lower =
cut.getMinimum().index;
1808 phiWindow2Upper =
cut.getMaximum().index;
1811 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
1819 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
1824 qualityLUT = l1tstr2int(
cut.getData());
1827 case esCutType::Displaced: {
1828 displacedLUT = l1tstr2int(
cut.getData());
1831 case esCutType::Isolation: {
1832 isolationLUT = l1tstr2int(
cut.getData());
1842 objParameter[cnt].etHighThreshold = upperThresholdInd;
1843 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1844 objParameter[cnt].indexHigh = upperIndexInd;
1845 objParameter[cnt].indexLow = lowerIndexInd;
1846 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1847 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1848 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1849 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1850 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1851 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1852 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1853 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1854 objParameter[cnt].isolationLUT = isolationLUT;
1855 objParameter[cnt].qualityLUT = qualityLUT;
1856 objParameter[cnt].displacedLUT = displacedLUT;
1859 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " 1860 << cnt <<
" = " << std::hex << objParameter[cnt].etLowThreshold <<
" - " 1861 << objParameter[cnt].etHighThreshold
1862 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1863 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1864 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1865 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1866 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1867 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1868 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1869 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1870 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1871 << objParameter[cnt].isolationLUT <<
"\n Quality LUT for calo object " << cnt
1872 <<
" = 0x" << objParameter[cnt].qualityLUT <<
"\n LLP DISP LUT for calo object " 1873 << cnt <<
" = 0x" << objParameter[cnt].displacedLUT <<
std::dec << std::endl;
1879 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1897 std::ostringstream myCoutStream;
1898 caloCond.
print(myCoutStream);
1899 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1903 if (!insertConditionIntoMap(caloCond, chipNr)) {
1904 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1909 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
1911 (m_vecCaloTemplate[chipNr]).
push_back(caloCond);
1941 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 1942 <<
"\n (in parseCalo) " 1943 <<
"\n condition = " << condition <<
"\n particle = " << particle
1944 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
1956 caloObjType =
gtJet;
1958 caloObjType =
gtTau;
1960 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1967 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type <<
")" 1968 <<
"\nCan not determine number of trigger objects. " << std::endl;
1975 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1981 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1982 tmpValues.reserve(nrObj);
1988 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1991 relativeBx = corrCalo->getBxOffset();
1994 int upperThresholdInd = -1;
1995 int lowerThresholdInd = 0;
1996 int upperIndexInd = -1;
1997 int lowerIndexInd = 0;
1999 unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
2001 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2002 int isolationLUT = 0xF;
2003 int qualityLUT = 0xF;
2004 int displacedLUT = 0x0;
2008 const std::vector<esCut>&
cuts = corrCalo->getCuts();
2009 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2012 switch (
cut.getCutType()) {
2014 lowerThresholdInd =
cut.getMinimum().index;
2015 upperThresholdInd =
cut.getMaximum().index;
2017 case esCutType::Slice:
2018 lowerIndexInd =
int(
cut.getMinimum().value);
2019 upperIndexInd =
int(
cut.getMaximum().value);
2021 case esCutType::Eta: {
2023 etaWindow1Lower =
cut.getMinimum().index;
2024 etaWindow1Upper =
cut.getMaximum().index;
2025 }
else if (cntEta == 1) {
2026 etaWindow2Lower =
cut.getMinimum().index;
2027 etaWindow2Upper =
cut.getMaximum().index;
2030 <<
"Too Many Eta Cuts for calo-condition (" << particle <<
")" << std::endl;
2039 phiWindow1Lower =
cut.getMinimum().index;
2040 phiWindow1Upper =
cut.getMaximum().index;
2041 }
else if (cntPhi == 1) {
2042 phiWindow2Lower =
cut.getMinimum().index;
2043 phiWindow2Upper =
cut.getMaximum().index;
2046 <<
"Too Many Phi Cuts for calo-condition (" << particle <<
")" << std::endl;
2054 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" << particle <<
")" << std::endl;
2059 qualityLUT = l1tstr2int(
cut.getData());
2062 case esCutType::Displaced: {
2063 displacedLUT = l1tstr2int(
cut.getData());
2066 case esCutType::Isolation: {
2067 isolationLUT = l1tstr2int(
cut.getData());
2077 objParameter[0].etLowThreshold = lowerThresholdInd;
2078 objParameter[0].etHighThreshold = upperThresholdInd;
2079 objParameter[0].indexHigh = upperIndexInd;
2080 objParameter[0].indexLow = lowerIndexInd;
2081 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2082 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2083 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2084 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2085 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2086 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2087 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2088 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2089 objParameter[0].isolationLUT = isolationLUT;
2090 objParameter[0].qualityLUT = qualityLUT;
2091 objParameter[0].displacedLUT = displacedLUT;
2094 LogDebug(
"TriggerMenuParser") <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " 2095 <<
" = " << std::hex << objParameter[0].etLowThreshold <<
" - " 2096 << objParameter[0].etHighThreshold <<
"\n etaWindow Lower / Upper for calo object " 2097 <<
" = 0x" << objParameter[0].etaWindow1Lower <<
" / 0x" 2098 << objParameter[0].etaWindow1Upper
2099 <<
"\n etaWindowVeto Lower / Upper for calo object " 2100 <<
" = 0x" << objParameter[0].etaWindow2Lower <<
" / 0x" 2101 << objParameter[0].etaWindow2Upper <<
"\n phiWindow Lower / Upper for calo object " 2102 <<
" = 0x" << objParameter[0].phiWindow1Lower <<
" / 0x" 2103 << objParameter[0].phiWindow1Upper
2104 <<
"\n phiWindowVeto Lower / Upper for calo object " 2105 <<
" = 0x" << objParameter[0].phiWindow2Lower <<
" / 0x" 2106 << objParameter[0].phiWindow2Upper <<
"\n Isolation LUT for calo object " 2107 <<
" = 0x" << objParameter[0].isolationLUT <<
"\n Quality LUT for calo object " 2108 <<
" = 0x" << objParameter[0].qualityLUT <<
"\n LLP DISP LUT for calo object " 2109 <<
" = 0x" << objParameter[0].displacedLUT <<
std::dec << std::endl;
2112 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2130 std::ostringstream myCoutStream;
2131 caloCond.
print(myCoutStream);
2132 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2149 (m_corCaloTemplate[chipNr]).
push_back(caloCond);
2167 unsigned int chipNr,
2168 const bool corrFlag) {
2178 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2179 <<
"\n (in parseEnergySum) " 2180 <<
"\n condition = " << condition <<
"\n type = " <<
type 2181 <<
"\n name = " <<
name << std::endl;
2187 if (condEnergySum.getType() == esConditionType::MissingEt) {
2190 }
else if (condEnergySum.getType() == esConditionType::TotalEt) {
2193 }
else if (condEnergySum.getType() == esConditionType::TotalEtEM) {
2196 }
else if (condEnergySum.getType() == esConditionType::TotalHt) {
2199 }
else if (condEnergySum.getType() == esConditionType::MissingHt) {
2202 }
else if (condEnergySum.getType() == esConditionType::MissingEtHF) {
2205 }
else if (condEnergySum.getType() == esConditionType::TowerCount) {
2208 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP0) {
2211 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM0) {
2214 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFP1) {
2217 }
else if (condEnergySum.getType() == esConditionType::MinBiasHFM1) {
2220 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEt) {
2223 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHt) {
2226 }
else if (condEnergySum.getType() == esConditionType::AsymmetryEtHF) {
2229 }
else if (condEnergySum.getType() == esConditionType::AsymmetryHtHF) {
2232 }
else if (condEnergySum.getType() == esConditionType::Centrality0) {
2235 }
else if (condEnergySum.getType() == esConditionType::Centrality1) {
2238 }
else if (condEnergySum.getType() == esConditionType::Centrality2) {
2241 }
else if (condEnergySum.getType() == esConditionType::Centrality3) {
2244 }
else if (condEnergySum.getType() == esConditionType::Centrality4) {
2247 }
else if (condEnergySum.getType() == esConditionType::Centrality5) {
2250 }
else if (condEnergySum.getType() == esConditionType::Centrality6) {
2253 }
else if (condEnergySum.getType() == esConditionType::Centrality7) {
2257 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum condition (" <<
type <<
")" << std::endl;
2269 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2280 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2283 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2286 relativeBx =
object.getBxOffset();
2289 int lowerThresholdInd = 0;
2290 int upperThresholdInd = -1;
2292 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2294 const std::vector<esCut>&
cuts =
object.getCuts();
2295 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2298 switch (
cut.getCutType()) {
2300 lowerThresholdInd =
cut.getMinimum().index;
2301 upperThresholdInd =
cut.getMaximum().index;
2304 case esCutType::Eta:
2309 phiWindow1Lower =
cut.getMinimum().index;
2310 phiWindow1Upper =
cut.getMaximum().index;
2311 }
else if (cntPhi == 1) {
2312 phiWindow2Lower =
cut.getMinimum().index;
2313 phiWindow2Upper =
cut.getMaximum().index;
2315 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2322 case esCutType::Count:
2323 lowerThresholdInd =
cut.getMinimum().index;
2324 upperThresholdInd = 0xffffff;
2334 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2335 objParameter[cnt].etHighThreshold = upperThresholdInd;
2336 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2337 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2338 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2339 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2342 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2343 << std::hex << objParameter[cnt].etLowThreshold <<
" - " 2344 << objParameter[cnt].etHighThreshold
2345 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2346 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2347 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2348 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
2355 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2370 std::ostringstream myCoutStream;
2371 energySumCond.
print(myCoutStream);
2372 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2376 if (!insertConditionIntoMap(energySumCond, chipNr)) {
2377 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2382 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2385 (m_vecEnergySumTemplate[chipNr]).
push_back(energySumCond);
2414 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2415 <<
"\n (in parseEnergySum) " 2416 <<
"\n condition = " << condition <<
"\n type = " <<
type 2417 <<
"\n name = " <<
name << std::endl;
2429 }
else if (corrESum->getType() == esObjectType::ETMHF) {
2432 }
else if (corrESum->getType() == esObjectType::TOWERCOUNT) {
2436 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for energy-sum correclation condition (" <<
type <<
")" 2449 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2459 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2462 relativeBx = corrESum->getBxOffset();
2465 int lowerThresholdInd = 0;
2466 int upperThresholdInd = -1;
2468 unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2470 const std::vector<esCut>&
cuts = corrESum->getCuts();
2471 for (
size_t kk = 0;
kk <
cuts.size();
kk++) {
2474 switch (
cut.getCutType()) {
2476 lowerThresholdInd =
cut.getMinimum().index;
2477 upperThresholdInd =
cut.getMaximum().index;
2480 case esCutType::Eta:
2485 phiWindow1Lower =
cut.getMinimum().index;
2486 phiWindow1Upper =
cut.getMaximum().index;
2487 }
else if (cntPhi == 1) {
2488 phiWindow2Lower =
cut.getMinimum().index;
2489 phiWindow2Upper =
cut.getMaximum().index;
2491 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" <<
type <<
")" << std::endl;
2505 objParameter[0].etLowThreshold = lowerThresholdInd;
2506 objParameter[0].etHighThreshold = upperThresholdInd;
2507 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2508 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2509 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2510 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2513 LogDebug(
"TriggerMenuParser") <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2514 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2515 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2516 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2517 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2518 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2522 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2537 std::ostringstream myCoutStream;
2538 energySumCond.
print(myCoutStream);
2539 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2557 (m_corEnergySumTemplate[chipNr]).
push_back(energySumCond);
2584 LogDebug(
"TriggerMenuParser") <<
"\n ****************************************** " 2585 <<
"\n (in parseExternal) " 2586 <<
"\n condition = " << condition <<
"\n particle = " << particle
2587 <<
"\n type = " <<
type <<
"\n name = " <<
name << std::endl;
2596 unsigned int channelID = 0;
2599 const std::vector<esObject>&
objects = condExt.getObjects();
2602 if (
object.getType() == esObjectType::EXT) {
2603 relativeBx =
object.getBxOffset();
2604 channelID =
object.getExternalChannelId();
2612 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2624 LogTrace(
"TriggerMenuParser") << externalCond <<
"\n" << std::endl;
2627 if (!insertConditionIntoMap(externalCond, chipNr)) {
2628 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2632 (m_vecExternalTemplate[chipNr]).
push_back(externalCond);
2658 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2659 <<
" (in parseCorrelation) " << std::endl
2660 <<
" condition = " << condition << std::endl
2661 <<
" particle = " << particle << std::endl
2662 <<
" type = " <<
type << std::endl
2663 <<
" name = " <<
name << std::endl;
2669 if (!insertConditionIntoMap(correlationCond, chipNr)) {
2670 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2681 const int nrObj = 2;
2684 int intGEq[nrObj] = {-1, -1};
2685 std::vector<GlobalObject>
objType(nrObj);
2686 std::vector<GtConditionCategory> condCateg(nrObj);
2689 const bool corrFlag =
true;
2690 int corrIndexVal[nrObj] = {-1, -1};
2698 const std::vector<esCut>&
cuts = corrCond.getCuts();
2699 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
2702 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
2703 if (
cut.getData() ==
"ls")
2705 else if (
cut.getData() ==
"os")
2713 double minV =
cut.getMinimum().value;
2714 double maxV =
cut.getMaximum().value;
2721 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV
2722 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2723 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2727 cutType = cutType | 0x1;
2729 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV
2730 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2731 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2735 cutType = cutType | 0x2;
2737 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tDeltaR Cut minV = " << minV
2738 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2739 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2743 cutType = cutType | 0x4;
2744 }
else if (
cut.getCutType() == esCutType::TwoBodyPt) {
2748 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tTPBT Cut minV = " << minV
2749 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2750 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2751 cutType = cutType | 0x20;
2753 (
cut.getCutType() == esCutType::MassDeltaR)) {
2754 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2755 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2756 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2761 if (corrCond.getType() == esConditionType::TransverseMass) {
2762 cutType = cutType | 0x10;
2763 }
else if (corrCond.getType() == esConditionType::InvariantMassDeltaR) {
2764 cutType = cutType | 0x80;
2766 cutType = cutType | 0x8;
2768 }
else if (
cut.getCutType() == esCutType::MassUpt) {
2769 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
2770 <<
" Max = " << maxV <<
" precMin = " <<
cut.getMinimum().index
2771 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
2775 cutType = cutType | 0x40;
2782 const std::vector<esObject>&
objects = corrCond.getObjects();
2784 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 2785 <<
" corrFlag " << corrFlag << std::endl;
2792 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
2793 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
2794 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
2795 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
2832 parseMuonCorr(&
object, chipNr);
2833 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2836 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2843 parseCaloCorr(&
object, chipNr);
2844 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2847 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2848 switch (
object.getType()) {
2863 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
2864 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
2866 parseEnergySumCorr(&
object, chipNr);
2867 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2870 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2871 switch (
object.getType()) {
2878 case esObjectType::ETMHF: {
2881 case esObjectType::TOWERCOUNT: {
2890 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
2891 <<
" for the correlation condition " <<
name << std::endl;
2900 if (intGEq[0] != intGEq[1]) {
2901 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 2902 <<
" for the correlation condition " <<
name << std::endl;
2906 gEq = (intGEq[0] != 0);
2924 std::ostringstream myCoutStream;
2925 correlationCond.
print(myCoutStream);
2926 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2932 (m_vecCorrelationTemplate[chipNr]).
push_back(correlationCond);
2959 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2960 <<
" (in parseCorrelationThreeBody) " << std::endl
2961 <<
" condition = " << condition << std::endl
2962 <<
" particle = " << particle << std::endl
2963 <<
" type = " <<
type << std::endl
2964 <<
" name = " <<
name << std::endl;
2970 if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2971 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2979 const int nrObj = 3;
2982 std::vector<GlobalObject>
objType(nrObj);
2983 std::vector<GtConditionCategory> condCateg(nrObj);
2986 const bool corrFlag =
true;
2987 int corrIndexVal[nrObj] = {-1, -1, -1};
2997 const std::vector<esCut>&
cuts = corrCond.getCuts();
2998 for (
size_t lll = 0; lll <
cuts.size(); lll++) {
2999 const esCut
cut =
cuts.at(lll);
3001 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3002 if (
cut.getData() ==
"ls")
3004 else if (
cut.getData() ==
"os")
3013 double minV =
cut.getMinimum().value;
3014 double maxV =
cut.getMaximum().value;
3020 LogDebug(
"TriggerMenuParser") <<
"CutType: " <<
cut.getCutType() <<
"\tMass Cut minV = " << minV
3021 <<
"\tMass Cut maxV = " << maxV <<
" precMin = " <<
cut.getMinimum().index
3022 <<
" precMax = " <<
cut.getMaximum().index << std::endl;
3026 cutType = cutType | 0x8;
3027 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3031 cutType = cutType | 0x80;
3037 const std::vector<esObject>&
objects = corrCond.getObjects();
3039 edm::LogError(
"TriggerMenuParser") <<
"incorrect number of objects for the correlation condition " <<
name 3040 <<
" corrFlag " << corrFlag << std::endl;
3045 for (
size_t lll = 0; lll <
objects.size(); lll++) {
3046 const esObject
object =
objects.at(lll);
3047 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3048 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3049 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3054 parseMuonCorr(&
object, chipNr);
3055 corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).
size() - 1;
3062 edm::LogError(
"TriggerMenuParser") <<
"Checked the object Type " <<
object.getType()
3063 <<
" for the correlation condition " <<
name 3064 <<
": no three muons in the event!" << std::endl;
3084 std::ostringstream myCoutStream;
3085 correlationThreeBodyCond.
print(myCoutStream);
3086 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3092 (m_vecCorrelationThreeBodyTemplate[chipNr]).
push_back(correlationThreeBodyCond);
3112 unsigned int chipNr) {
3120 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3121 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3122 <<
" condition = " << condition << std::endl
3123 <<
" particle = " << particle << std::endl
3124 <<
" type = " <<
type << std::endl
3125 <<
" name = " <<
name << std::endl;
3131 if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3132 edm::LogError(
"TriggerMenuParser") <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
3143 const int nrObj = 3;
3146 int intGEq[nrObj] = {-1, -1, -1};
3147 std::vector<GlobalObject>
objType(nrObj);
3148 std::vector<GtConditionCategory> condCateg(nrObj);
3151 const bool corrFlag =
true;
3152 int corrIndexVal[nrObj] = {-1, -1, -1};
3160 const std::vector<esCut>&
cuts = corrCond.getCuts();
3161 for (
size_t jj = 0;
jj <
cuts.size();
jj++) {
3164 if (
cut.getCutType() == esCutType::ChargeCorrelation) {
3165 if (
cut.getData() ==
"ls")
3167 else if (
cut.getData() ==
"os")
3175 double minV =
cut.getMinimum().value;
3176 double maxV =
cut.getMaximum().value;
3187 cutType = cutType | 0x1;
3193 cutType = cutType | 0x2;
3199 cutType = cutType | 0x4;
3205 cutType = cutType | 0x8;
3206 }
else if (
cut.getCutType() == esCutType::MassDeltaR) {
3210 cutType = cutType | 0x80;
3212 if (
cut.getCutType() == esCutType::OvRmDeltaEta) {
3217 cutType = cutType | 0x10;
3218 }
else if (
cut.getCutType() == esCutType::OvRmDeltaPhi) {
3223 cutType = cutType | 0x20;
3224 }
else if (
cut.getCutType() == esCutType::OvRmDeltaR) {
3229 cutType = cutType | 0x40;
3236 const std::vector<esObject>&
objects = corrCond.getObjects();
3239 <<
"incorrect number of objects for the correlation condition with overlap removal " <<
name <<
" corrFlag " 3240 << corrFlag << std::endl;
3246 const esObject&
object =
objects.at(
jj);
3247 LogDebug(
"TriggerMenuParser") <<
" obj name = " <<
object.getName() <<
"\n";
3248 LogDebug(
"TriggerMenuParser") <<
" obj type = " <<
object.getType() <<
"\n";
3249 LogDebug(
"TriggerMenuParser") <<
" obj op = " <<
object.getComparisonOperator() <<
"\n";
3250 LogDebug(
"TriggerMenuParser") <<
" obj bx = " <<
object.getBxOffset() <<
"\n";
3251 LogDebug(
"TriggerMenuParser") <<
"type = done" << std::endl;
3288 parseMuonCorr(&
object, chipNr);
3289 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
3292 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3299 parseCaloCorr(&
object, chipNr);
3300 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
3303 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3304 switch (
object.getType()) {
3319 }
else if (
object.getType() ==
esObjectType::ETM ||
object.getType() == esObjectType::ETMHF ||
3320 object.getType() == esObjectType::TOWERCOUNT ||
object.getType() ==
esObjectType::HTM) {
3322 parseEnergySumCorr(&
object, chipNr);
3323 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
3326 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3327 switch (
object.getType()) {
3334 case esObjectType::ETMHF: {
3337 case esObjectType::TOWERCOUNT: {
3346 edm::LogError(
"TriggerMenuParser") <<
"Illegal Object Type " <<
object.getType()
3347 <<
" for the correlation condition " <<
name << std::endl;
3356 if (intGEq[0] != intGEq[1]) {
3357 edm::LogError(
"TriggerMenuParser") <<
"Inconsistent GEq flags for sub-conditions " 3358 <<
" for the correlation condition " <<
name << std::endl;
3362 gEq = (intGEq[0] != 0);
3382 std::ostringstream myCoutStream;
3383 correlationWORCond.
print(myCoutStream);
3384 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3390 (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).
push_back(correlationWORCond);
3415 if (algAlias.empty()) {
3417 LogDebug(
"TriggerMenuParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3418 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3422 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3423 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3430 LogDebug(
"TriggerMenuParser") <<
" Logical expression: " << logExpression
3431 <<
" Chip number: " << chipNr << std::endl;
3437 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin << std::endl;
3452 std::ostringstream myCoutStream;
3453 alg.
print(myCoutStream);
3454 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
3458 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)
pixelTrack::Quality Quality
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
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
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 &)