44 m_l1GtMenu = menuRcd.product();
58 int IndexRefPrescaleFactors,
60 map<string, string>
out;
63 const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
64 const vector<vector<L1GtMuonTemplate> >* vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
65 const vector<vector<L1GtCaloTemplate> >* vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
66 const vector<vector<L1GtEnergySumTemplate> >* vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
69 const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
73 map<string, SingleObjectCondition> myConditions;
75 for (
unsigned int a = 0;
a < vMuonConditions->size();
a++) {
76 for (
unsigned int b = 0;
b < (*vMuonConditions)[
a].size();
b++) {
91 myConditions[MuonCondition->
condName()] = tCondition;
96 for (
unsigned int a = 0;
a < vCaloConditions->size();
a++) {
97 for (
unsigned int b = 0;
b < (*vCaloConditions)[
a].size();
b++) {
111 myConditions[CaloCondition->
condName()] = tCondition;
116 for (
unsigned int a = 0;
a < vEnergySumConditions->size();
a++) {
117 for (
unsigned int b = 0;
b < (*vEnergySumConditions)[
a].size();
b++) {
133 myConditions[EnergySumCondition->
condName()] = tCondition;
138 for (
CItAlgo iAlgo = theAlgoMap->begin(); iAlgo != theAlgoMap->end(); ++iAlgo) {
141 bool algoIsValid =
true;
143 int tAlgoMask = myUtils.
triggerMask(iAlgo->first, error);
145 unsigned int tQuality = 0;
146 unsigned int tEtaRange = 0;
150 bool isNoIsoEG =
false;
151 bool isIsoEG =
false;
152 bool isCenJet =
false;
153 bool isForJet =
false;
154 bool isTauJet =
false;
161 if (tAlgoMask != 0) {
174 map<string, SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
178 if (ciCond == myConditions.end()) {
185 if (maxThreshold < (*ciCond).second.threshold) {
186 maxThreshold = (*ciCond).second.threshold;
187 tObject = (*ciCond).second.object;
188 tQuality = (*ciCond).second.quality;
189 tEtaRange = (*ciCond).second.etaRange;
192 if ((*ciCond).second.object ==
Mu) {
194 }
else if ((*ciCond).second.object ==
NoIsoEG) {
196 }
else if ((*ciCond).second.object ==
IsoEG) {
198 }
else if ((*ciCond).second.object ==
CenJet) {
200 }
else if ((*ciCond).second.object ==
ForJet) {
202 }
else if ((*ciCond).second.object ==
TauJet) {
204 }
else if ((*ciCond).second.object ==
ETM) {
206 }
else if ((*ciCond).second.object ==
ETT) {
208 }
else if ((*ciCond).second.object ==
HTT) {
210 }
else if ((*ciCond).second.object ==
HTM) {
220 tTrigger.
alias = iAlgo->first;
221 tTrigger.
bit = (iAlgo->second).algoBitNumber();
222 tTrigger.
prescale = refPrescaleFactors[tTrigger.
bit];
224 tTrigger.
object = tObject;
263 if (nCond == 1 && isMu ==
true) {
265 m_vTrigMu.push_back(tTrigger);
266 }
else if (nCond == 2 && isNoIsoEG ==
true && isIsoEG ==
true) {
267 m_vTrigEG.push_back(tTrigger);
268 }
else if (nCond == 1 && isIsoEG ==
true) {
269 m_vTrigIsoEG.push_back(tTrigger);
270 }
else if (nCond == 3 && isCenJet ==
true && isForJet ==
true && isTauJet ==
true) {
271 m_vTrigJet.push_back(tTrigger);
272 }
else if (nCond == 1 && isCenJet ==
true) {
273 m_vTrigCenJet.push_back(tTrigger);
274 }
else if (nCond == 1 && isForJet ==
true) {
275 m_vTrigForJet.push_back(tTrigger);
276 }
else if (nCond == 1 && isTauJet ==
true) {
277 m_vTrigTauJet.push_back(tTrigger);
278 }
else if (nCond == 1 && isETT ==
true) {
279 m_vTrigETT.push_back(tTrigger);
280 }
else if (nCond == 1 && isETM ==
true) {
281 m_vTrigETM.push_back(tTrigger);
282 }
else if (nCond == 1 && isHTT ==
true) {
283 m_vTrigHTT.push_back(tTrigger);
284 }
else if (nCond == 1 && isHTM ==
true) {
285 m_vTrigHTM.push_back(tTrigger);
297 string selTrigMu =
"Undefined";
298 string selTrigEG =
"Undefined";
299 string selTrigIsoEG =
"Undefined";
300 string selTrigJet =
"Undefined";
301 string selTrigCenJet =
"Undefined";
302 string selTrigForJet =
"Undefined";
303 string selTrigTauJet =
"Undefined";
304 string selTrigETT =
"Undefined";
305 string selTrigETM =
"Undefined";
306 string selTrigHTT =
"Undefined";
307 string selTrigHTM =
"Undefined";
309 if (!m_vTrigMu.empty()) {
310 sort(m_vTrigMu.begin(), m_vTrigMu.end());
311 selTrigMu = m_vTrigMu[0].alias;
313 if (!m_vTrigEG.empty()) {
314 sort(m_vTrigEG.begin(), m_vTrigEG.end());
315 selTrigEG = m_vTrigEG[0].alias;
317 if (!m_vTrigIsoEG.empty()) {
318 sort(m_vTrigIsoEG.begin(), m_vTrigIsoEG.end());
319 selTrigIsoEG = m_vTrigIsoEG[0].alias;
321 if (!m_vTrigJet.empty()) {
322 sort(m_vTrigJet.begin(), m_vTrigJet.end());
323 selTrigJet = m_vTrigJet[0].alias;
325 if (!m_vTrigCenJet.empty()) {
326 sort(m_vTrigCenJet.begin(), m_vTrigCenJet.end());
327 selTrigCenJet = m_vTrigCenJet[0].alias;
329 if (!m_vTrigForJet.empty()) {
330 sort(m_vTrigForJet.begin(), m_vTrigForJet.end());
331 selTrigForJet = m_vTrigForJet[0].alias;
333 if (!m_vTrigTauJet.empty()) {
334 sort(m_vTrigTauJet.begin(), m_vTrigTauJet.end());
335 selTrigTauJet = m_vTrigTauJet[0].alias;
337 if (!m_vTrigETT.empty()) {
338 sort(m_vTrigETT.begin(), m_vTrigETT.end());
339 selTrigETT = m_vTrigETT[0].alias;
341 if (!m_vTrigETM.empty()) {
342 sort(m_vTrigETM.begin(), m_vTrigETM.end());
343 selTrigETM = m_vTrigETM[0].alias;
345 if (!m_vTrigHTT.empty()) {
346 sort(m_vTrigHTT.begin(), m_vTrigHTT.end());
347 selTrigHTT = m_vTrigHTT[0].alias;
349 if (!m_vTrigHTM.empty()) {
350 sort(m_vTrigHTM.begin(), m_vTrigHTM.end());
351 selTrigHTM = m_vTrigHTM[0].alias;
354 auto check = [](
const map<string, bool>& cats,
const char*
key) ->
bool {
355 auto it = cats.find(
key);
356 if (it != cats.end())
362 if (
check(iCategories,
"Mu")) {
363 out[
"Mu"] = selTrigMu;
365 if (
check(iCategories,
"EG")) {
366 out[
"EG"] = selTrigEG;
368 if (
check(iCategories,
"IsoEG")) {
369 out[
"IsoEG"] = selTrigIsoEG;
371 if (
check(iCategories,
"Jet")) {
372 out[
"Jet"] = selTrigJet;
374 if (
check(iCategories,
"CenJet")) {
375 out[
"CenJet"] = selTrigCenJet;
377 if (
check(iCategories,
"ForJet")) {
378 out[
"ForJet"] = selTrigForJet;
380 if (
check(iCategories,
"TauJet")) {
381 out[
"TauJet"] = selTrigTauJet;
383 if (
check(iCategories,
"ETT")) {
384 out[
"ETT"] = selTrigETT;
386 if (
check(iCategories,
"ETM")) {
387 out[
"ETM"] = selTrigETM;
389 if (
check(iCategories,
"HTT")) {
390 out[
"HTT"] = selTrigHTT;
392 if (
check(iCategories,
"HTM")) {
393 out[
"HTM"] = selTrigHTM;
400 map<string, string> iAlgos = _iAlgos;
402 const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
404 for (map<string, string>::const_iterator
i = iAlgos.begin(); iAlgos.end() !=
i;
i++) {
405 string tCategory = (*i).first;
406 string tTrigger = (*i).second;
408 if (tTrigger.empty()) {
409 iAlgos[tCategory] =
"Undefined";
411 if (theAlgoMap->find(tTrigger) == theAlgoMap->end()) {
412 iAlgos[tCategory] =
"Undefined (Wrong Name)";
465 out =
"HfRingEtSums";
494 switch (iConditionType) {
529 out =
"TypeJetCounts";
535 out =
"TypeHfBitCounts";
538 out =
"TypeHfRingEtSums";
544 out =
"TypeExternal";
561 switch (iConditionCategory) {
572 out =
"CondEnergySum";
575 out =
"CondJetCounts";
578 out =
"CondCorrelation";
584 out =
"CondHfBitCounts";
587 out =
"CondHfRingEtSums";
593 out =
"CondExternal";
607 if (iCategory ==
"Mu") {
608 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
609 if (m_vTrigMu[
i].
alias == iAlias) {
610 return m_vTrigMu[
i].prescale;
613 }
else if (iCategory ==
"EG") {
614 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
615 if (m_vTrigEG[
i].
alias == iAlias) {
616 return m_vTrigEG[
i].prescale;
619 }
else if (iCategory ==
"IsoEG") {
620 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
621 if (m_vTrigIsoEG[
i].
alias == iAlias) {
622 return m_vTrigIsoEG[
i].prescale;
625 }
else if (iCategory ==
"Jet") {
626 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
627 if (m_vTrigJet[
i].
alias == iAlias) {
628 return m_vTrigJet[
i].prescale;
631 }
else if (iCategory ==
"CenJet") {
632 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
633 if (m_vTrigCenJet[
i].
alias == iAlias) {
634 return m_vTrigCenJet[
i].prescale;
637 }
else if (iCategory ==
"ForJet") {
638 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
639 if (m_vTrigForJet[
i].
alias == iAlias) {
640 return m_vTrigForJet[
i].prescale;
643 }
else if (iCategory ==
"TauJet") {
644 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
645 if (m_vTrigTauJet[
i].
alias == iAlias) {
646 return m_vTrigTauJet[
i].prescale;
649 }
else if (iCategory ==
"ETT") {
650 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
651 if (m_vTrigETT[
i].
alias == iAlias) {
652 return m_vTrigETT[
i].prescale;
655 }
else if (iCategory ==
"ETM") {
656 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
657 if (m_vTrigETM[
i].
alias == iAlias) {
658 return m_vTrigETM[
i].prescale;
661 }
else if (iCategory ==
"HTT") {
662 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
663 if (m_vTrigHTT[
i].
alias == iAlias) {
664 return m_vTrigHTT[
i].prescale;
667 }
else if (iCategory ==
"HTM") {
668 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
669 if (m_vTrigHTM[
i].
alias == iAlias) {
670 return m_vTrigHTM[
i].prescale;
680 unsigned int out = -1;
682 if (iCategory ==
"Mu") {
683 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
684 if (m_vTrigMu[
i].
alias == iAlias) {
685 return m_vTrigMu[
i].etaRange;
688 }
else if (iCategory ==
"EG") {
689 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
690 if (m_vTrigEG[
i].
alias == iAlias) {
691 return m_vTrigEG[
i].etaRange;
694 }
else if (iCategory ==
"IsoEG") {
695 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
696 if (m_vTrigIsoEG[
i].
alias == iAlias) {
697 return m_vTrigIsoEG[
i].etaRange;
700 }
else if (iCategory ==
"Jet") {
701 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
702 if (m_vTrigJet[
i].
alias == iAlias) {
703 return m_vTrigJet[
i].etaRange;
706 }
else if (iCategory ==
"CenJet") {
707 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
708 if (m_vTrigCenJet[
i].
alias == iAlias) {
709 return m_vTrigCenJet[
i].etaRange;
712 }
else if (iCategory ==
"ForJet") {
713 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
714 if (m_vTrigForJet[
i].
alias == iAlias) {
715 return m_vTrigForJet[
i].etaRange;
718 }
else if (iCategory ==
"TauJet") {
719 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
720 if (m_vTrigTauJet[
i].
alias == iAlias) {
721 return m_vTrigTauJet[
i].etaRange;
724 }
else if (iCategory ==
"ETT") {
725 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
726 if (m_vTrigETT[
i].
alias == iAlias) {
727 return m_vTrigETT[
i].etaRange;
730 }
else if (iCategory ==
"ETM") {
731 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
732 if (m_vTrigETM[
i].
alias == iAlias) {
733 return m_vTrigETM[
i].etaRange;
736 }
else if (iCategory ==
"HTT") {
737 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
738 if (m_vTrigHTT[
i].
alias == iAlias) {
739 return m_vTrigHTT[
i].etaRange;
742 }
else if (iCategory ==
"HTM") {
743 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
744 if (m_vTrigHTM[
i].
alias == iAlias) {
745 return m_vTrigHTM[
i].etaRange;
755 unsigned int out = -1;
757 if (iCategory ==
"Mu") {
758 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
759 if (m_vTrigMu[
i].
alias == iAlias) {
760 return m_vTrigMu[
i].quality;
763 }
else if (iCategory ==
"EG") {
764 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
765 if (m_vTrigEG[
i].
alias == iAlias) {
766 return m_vTrigEG[
i].quality;
769 }
else if (iCategory ==
"IsoEG") {
770 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
771 if (m_vTrigIsoEG[
i].
alias == iAlias) {
772 return m_vTrigIsoEG[
i].quality;
775 }
else if (iCategory ==
"Jet") {
776 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
777 if (m_vTrigJet[
i].
alias == iAlias) {
778 return m_vTrigJet[
i].quality;
781 }
else if (iCategory ==
"CenJet") {
782 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
783 if (m_vTrigCenJet[
i].
alias == iAlias) {
784 return m_vTrigCenJet[
i].quality;
787 }
else if (iCategory ==
"ForJet") {
788 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
789 if (m_vTrigForJet[
i].
alias == iAlias) {
790 return m_vTrigForJet[
i].quality;
793 }
else if (iCategory ==
"TauJet") {
794 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
795 if (m_vTrigTauJet[
i].
alias == iAlias) {
796 return m_vTrigTauJet[
i].quality;
799 }
else if (iCategory ==
"ETT") {
800 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
801 if (m_vTrigETT[
i].
alias == iAlias) {
802 return m_vTrigETT[
i].quality;
805 }
else if (iCategory ==
"ETM") {
806 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
807 if (m_vTrigETM[
i].
alias == iAlias) {
808 return m_vTrigETM[
i].quality;
811 }
else if (iCategory ==
"HTT") {
812 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
813 if (m_vTrigHTT[
i].
alias == iAlias) {
814 return m_vTrigHTT[
i].quality;
817 }
else if (iCategory ==
"HTM") {
818 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
819 if (m_vTrigHTM[
i].
alias == iAlias) {
820 return m_vTrigHTM[
i].quality;
L1GtConditionCategory conditionCategory
const int nrObjects() const
get number of trigger objects
const std::string & condName() const
get / set condition name
L1GtConditionType conditionType
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
const std::vector< L1GtLogicParser::TokenRPN > & algoRpnVector() const
return the RPN vector
const std::vector< ObjectParameter > * objectParameter() const
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
const std::vector< ObjectParameter > * objectParameter() const
L1GtConditionCategory
condition categories
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
const int triggerMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const std::vector< ObjectParameter > * objectParameter() const
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts)