40 m_prescaleFactorsAlgoTrig =
54 int IndexRefPrescaleFactors,
56 map<string, string>
out;
59 const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
60 const vector<vector<L1GtMuonTemplate> >* vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
61 const vector<vector<L1GtCaloTemplate> >* vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
62 const vector<vector<L1GtEnergySumTemplate> >* vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
65 const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
69 map<string, SingleObjectCondition> myConditions;
71 for (
unsigned int a = 0;
a < vMuonConditions->size();
a++) {
72 for (
unsigned int b = 0;
b < (*vMuonConditions)[
a].size();
b++) {
87 myConditions[MuonCondition->
condName()] = tCondition;
92 for (
unsigned int a = 0;
a < vCaloConditions->size();
a++) {
93 for (
unsigned int b = 0;
b < (*vCaloConditions)[
a].size();
b++) {
112 for (
unsigned int a = 0;
a < vEnergySumConditions->size();
a++) {
113 for (
unsigned int b = 0;
b < (*vEnergySumConditions)[
a].size();
b++) {
134 for (
CItAlgo iAlgo = theAlgoMap->begin(); iAlgo != theAlgoMap->end(); ++iAlgo) {
137 bool algoIsValid =
true;
141 unsigned int tQuality = 0;
142 unsigned int tEtaRange = 0;
146 bool isNoIsoEG =
false;
147 bool isIsoEG =
false;
148 bool isCenJet =
false;
149 bool isForJet =
false;
150 bool isTauJet =
false;
157 if (tAlgoMask != 0) {
170 map<string, SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
174 if (ciCond == myConditions.end()) {
183 tObject = (*ciCond).second.object;
184 tQuality = (*ciCond).second.quality;
185 tEtaRange = (*ciCond).second.etaRange;
188 if ((*ciCond).second.object ==
Mu) {
190 }
else if ((*ciCond).second.object ==
NoIsoEG) {
192 }
else if ((*ciCond).second.object ==
IsoEG) {
194 }
else if ((*ciCond).second.object ==
CenJet) {
196 }
else if ((*ciCond).second.object ==
ForJet) {
198 }
else if ((*ciCond).second.object ==
TauJet) {
200 }
else if ((*ciCond).second.object ==
ETM) {
202 }
else if ((*ciCond).second.object ==
ETT) {
204 }
else if ((*ciCond).second.object ==
HTT) {
206 }
else if ((*ciCond).second.object ==
HTM) {
216 tTrigger.
alias = iAlgo->first;
217 tTrigger.
bit = (iAlgo->second).algoBitNumber();
218 tTrigger.
prescale = refPrescaleFactors[tTrigger.
bit];
220 tTrigger.
object = tObject;
259 if (nCond == 1 &&
isMu ==
true) {
261 m_vTrigMu.push_back(tTrigger);
262 }
else if (nCond == 2 && isNoIsoEG ==
true && isIsoEG ==
true) {
263 m_vTrigEG.push_back(tTrigger);
264 }
else if (nCond == 1 && isIsoEG ==
true) {
265 m_vTrigIsoEG.push_back(tTrigger);
266 }
else if (nCond == 3 && isCenJet ==
true && isForJet ==
true && isTauJet ==
true) {
267 m_vTrigJet.push_back(tTrigger);
268 }
else if (nCond == 1 && isCenJet ==
true) {
269 m_vTrigCenJet.push_back(tTrigger);
270 }
else if (nCond == 1 && isForJet ==
true) {
271 m_vTrigForJet.push_back(tTrigger);
272 }
else if (nCond == 1 && isTauJet ==
true) {
273 m_vTrigTauJet.push_back(tTrigger);
274 }
else if (nCond == 1 && isETT ==
true) {
275 m_vTrigETT.push_back(tTrigger);
276 }
else if (nCond == 1 && isETM ==
true) {
277 m_vTrigETM.push_back(tTrigger);
278 }
else if (nCond == 1 && isHTT ==
true) {
279 m_vTrigHTT.push_back(tTrigger);
280 }
else if (nCond == 1 && isHTM ==
true) {
281 m_vTrigHTM.push_back(tTrigger);
293 string selTrigMu =
"Undefined";
294 string selTrigEG =
"Undefined";
295 string selTrigIsoEG =
"Undefined";
296 string selTrigJet =
"Undefined";
297 string selTrigCenJet =
"Undefined";
298 string selTrigForJet =
"Undefined";
299 string selTrigTauJet =
"Undefined";
300 string selTrigETT =
"Undefined";
301 string selTrigETM =
"Undefined";
302 string selTrigHTT =
"Undefined";
303 string selTrigHTM =
"Undefined";
305 if (!m_vTrigMu.empty()) {
306 sort(m_vTrigMu.begin(), m_vTrigMu.end());
307 selTrigMu = m_vTrigMu[0].alias;
309 if (!m_vTrigEG.empty()) {
310 sort(m_vTrigEG.begin(), m_vTrigEG.end());
311 selTrigEG = m_vTrigEG[0].alias;
313 if (!m_vTrigIsoEG.empty()) {
314 sort(m_vTrigIsoEG.begin(), m_vTrigIsoEG.end());
315 selTrigIsoEG = m_vTrigIsoEG[0].alias;
317 if (!m_vTrigJet.empty()) {
318 sort(m_vTrigJet.begin(), m_vTrigJet.end());
319 selTrigJet = m_vTrigJet[0].alias;
321 if (!m_vTrigCenJet.empty()) {
322 sort(m_vTrigCenJet.begin(), m_vTrigCenJet.end());
323 selTrigCenJet = m_vTrigCenJet[0].alias;
325 if (!m_vTrigForJet.empty()) {
326 sort(m_vTrigForJet.begin(), m_vTrigForJet.end());
327 selTrigForJet = m_vTrigForJet[0].alias;
329 if (!m_vTrigTauJet.empty()) {
330 sort(m_vTrigTauJet.begin(), m_vTrigTauJet.end());
331 selTrigTauJet = m_vTrigTauJet[0].alias;
333 if (!m_vTrigETT.empty()) {
334 sort(m_vTrigETT.begin(), m_vTrigETT.end());
335 selTrigETT = m_vTrigETT[0].alias;
337 if (!m_vTrigETM.empty()) {
338 sort(m_vTrigETM.begin(), m_vTrigETM.end());
339 selTrigETM = m_vTrigETM[0].alias;
341 if (!m_vTrigHTT.empty()) {
342 sort(m_vTrigHTT.begin(), m_vTrigHTT.end());
343 selTrigHTT = m_vTrigHTT[0].alias;
345 if (!m_vTrigHTM.empty()) {
346 sort(m_vTrigHTM.begin(), m_vTrigHTM.end());
347 selTrigHTM = m_vTrigHTM[0].alias;
350 auto check = [](
const map<string, bool>& cats,
const char*
key) ->
bool {
351 auto it = cats.find(
key);
352 if (it != cats.end())
358 if (
check(iCategories,
"Mu")) {
359 out[
"Mu"] = selTrigMu;
361 if (
check(iCategories,
"EG")) {
362 out[
"EG"] = selTrigEG;
364 if (
check(iCategories,
"IsoEG")) {
365 out[
"IsoEG"] = selTrigIsoEG;
367 if (
check(iCategories,
"Jet")) {
368 out[
"Jet"] = selTrigJet;
370 if (
check(iCategories,
"CenJet")) {
371 out[
"CenJet"] = selTrigCenJet;
373 if (
check(iCategories,
"ForJet")) {
374 out[
"ForJet"] = selTrigForJet;
376 if (
check(iCategories,
"TauJet")) {
377 out[
"TauJet"] = selTrigTauJet;
379 if (
check(iCategories,
"ETT")) {
380 out[
"ETT"] = selTrigETT;
382 if (
check(iCategories,
"ETM")) {
383 out[
"ETM"] = selTrigETM;
385 if (
check(iCategories,
"HTT")) {
386 out[
"HTT"] = selTrigHTT;
388 if (
check(iCategories,
"HTM")) {
389 out[
"HTM"] = selTrigHTM;
396 map<string, string> iAlgos = _iAlgos;
398 const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
400 for (map<string, string>::const_iterator
i = iAlgos.begin(); iAlgos.end() !=
i;
i++) {
401 string tCategory = (*i).first;
402 string tTrigger = (*i).second;
404 if (tTrigger.empty()) {
405 iAlgos[tCategory] =
"Undefined";
407 if (theAlgoMap->find(tTrigger) == theAlgoMap->end()) {
408 iAlgos[tCategory] =
"Undefined (Wrong Name)";
461 out =
"HfRingEtSums";
490 switch (iConditionType) {
525 out =
"TypeJetCounts";
531 out =
"TypeHfBitCounts";
534 out =
"TypeHfRingEtSums";
540 out =
"TypeExternal";
557 switch (iConditionCategory) {
568 out =
"CondEnergySum";
571 out =
"CondJetCounts";
574 out =
"CondCorrelation";
580 out =
"CondHfBitCounts";
583 out =
"CondHfRingEtSums";
589 out =
"CondExternal";
603 if (iCategory ==
"Mu") {
604 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
605 if (m_vTrigMu[
i].
alias == iAlias) {
606 return m_vTrigMu[
i].prescale;
609 }
else if (iCategory ==
"EG") {
610 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
611 if (m_vTrigEG[
i].
alias == iAlias) {
612 return m_vTrigEG[
i].prescale;
615 }
else if (iCategory ==
"IsoEG") {
616 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
617 if (m_vTrigIsoEG[
i].
alias == iAlias) {
618 return m_vTrigIsoEG[
i].prescale;
621 }
else if (iCategory ==
"Jet") {
622 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
623 if (m_vTrigJet[
i].
alias == iAlias) {
624 return m_vTrigJet[
i].prescale;
627 }
else if (iCategory ==
"CenJet") {
628 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
629 if (m_vTrigCenJet[
i].
alias == iAlias) {
630 return m_vTrigCenJet[
i].prescale;
633 }
else if (iCategory ==
"ForJet") {
634 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
635 if (m_vTrigForJet[
i].
alias == iAlias) {
636 return m_vTrigForJet[
i].prescale;
639 }
else if (iCategory ==
"TauJet") {
640 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
641 if (m_vTrigTauJet[
i].
alias == iAlias) {
642 return m_vTrigTauJet[
i].prescale;
645 }
else if (iCategory ==
"ETT") {
646 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
647 if (m_vTrigETT[
i].
alias == iAlias) {
648 return m_vTrigETT[
i].prescale;
651 }
else if (iCategory ==
"ETM") {
652 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
653 if (m_vTrigETM[
i].
alias == iAlias) {
654 return m_vTrigETM[
i].prescale;
657 }
else if (iCategory ==
"HTT") {
658 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
659 if (m_vTrigHTT[
i].
alias == iAlias) {
660 return m_vTrigHTT[
i].prescale;
663 }
else if (iCategory ==
"HTM") {
664 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
665 if (m_vTrigHTM[
i].
alias == iAlias) {
666 return m_vTrigHTM[
i].prescale;
676 unsigned int out = -1;
678 if (iCategory ==
"Mu") {
679 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
680 if (m_vTrigMu[
i].
alias == iAlias) {
681 return m_vTrigMu[
i].etaRange;
684 }
else if (iCategory ==
"EG") {
685 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
686 if (m_vTrigEG[
i].
alias == iAlias) {
687 return m_vTrigEG[
i].etaRange;
690 }
else if (iCategory ==
"IsoEG") {
691 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
692 if (m_vTrigIsoEG[
i].
alias == iAlias) {
693 return m_vTrigIsoEG[
i].etaRange;
696 }
else if (iCategory ==
"Jet") {
697 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
698 if (m_vTrigJet[
i].
alias == iAlias) {
699 return m_vTrigJet[
i].etaRange;
702 }
else if (iCategory ==
"CenJet") {
703 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
704 if (m_vTrigCenJet[
i].
alias == iAlias) {
705 return m_vTrigCenJet[
i].etaRange;
708 }
else if (iCategory ==
"ForJet") {
709 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
710 if (m_vTrigForJet[
i].
alias == iAlias) {
711 return m_vTrigForJet[
i].etaRange;
714 }
else if (iCategory ==
"TauJet") {
715 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
716 if (m_vTrigTauJet[
i].
alias == iAlias) {
717 return m_vTrigTauJet[
i].etaRange;
720 }
else if (iCategory ==
"ETT") {
721 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
722 if (m_vTrigETT[
i].
alias == iAlias) {
723 return m_vTrigETT[
i].etaRange;
726 }
else if (iCategory ==
"ETM") {
727 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
728 if (m_vTrigETM[
i].
alias == iAlias) {
729 return m_vTrigETM[
i].etaRange;
732 }
else if (iCategory ==
"HTT") {
733 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
734 if (m_vTrigHTT[
i].
alias == iAlias) {
735 return m_vTrigHTT[
i].etaRange;
738 }
else if (iCategory ==
"HTM") {
739 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
740 if (m_vTrigHTM[
i].
alias == iAlias) {
741 return m_vTrigHTM[
i].etaRange;
751 unsigned int out = -1;
753 if (iCategory ==
"Mu") {
754 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
755 if (m_vTrigMu[
i].
alias == iAlias) {
756 return m_vTrigMu[
i].quality;
759 }
else if (iCategory ==
"EG") {
760 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
761 if (m_vTrigEG[
i].
alias == iAlias) {
762 return m_vTrigEG[
i].quality;
765 }
else if (iCategory ==
"IsoEG") {
766 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
767 if (m_vTrigIsoEG[
i].
alias == iAlias) {
768 return m_vTrigIsoEG[
i].quality;
771 }
else if (iCategory ==
"Jet") {
772 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
773 if (m_vTrigJet[
i].
alias == iAlias) {
774 return m_vTrigJet[
i].quality;
777 }
else if (iCategory ==
"CenJet") {
778 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
779 if (m_vTrigCenJet[
i].
alias == iAlias) {
780 return m_vTrigCenJet[
i].quality;
783 }
else if (iCategory ==
"ForJet") {
784 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
785 if (m_vTrigForJet[
i].
alias == iAlias) {
786 return m_vTrigForJet[
i].quality;
789 }
else if (iCategory ==
"TauJet") {
790 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
791 if (m_vTrigTauJet[
i].
alias == iAlias) {
792 return m_vTrigTauJet[
i].quality;
795 }
else if (iCategory ==
"ETT") {
796 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
797 if (m_vTrigETT[
i].
alias == iAlias) {
798 return m_vTrigETT[
i].quality;
801 }
else if (iCategory ==
"ETM") {
802 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
803 if (m_vTrigETM[
i].
alias == iAlias) {
804 return m_vTrigETM[
i].quality;
807 }
else if (iCategory ==
"HTT") {
808 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
809 if (m_vTrigHTT[
i].
alias == iAlias) {
810 return m_vTrigHTT[
i].quality;
813 }
else if (iCategory ==
"HTM") {
814 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
815 if (m_vTrigHTM[
i].
alias == iAlias) {
816 return m_vTrigHTM[
i].quality;