39 m_prescaleFactorsAlgoTrig =
53 int IndexRefPrescaleFactors,
55 map<string, string>
out;
58 const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
59 const vector<vector<L1GtMuonTemplate> >* vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
60 const vector<vector<L1GtCaloTemplate> >* vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
61 const vector<vector<L1GtEnergySumTemplate> >* vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
64 const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
68 map<string, SingleObjectCondition> myConditions;
70 for (
unsigned int a = 0;
a < vMuonConditions->size();
a++) {
71 for (
unsigned int b = 0;
b < (*vMuonConditions)[
a].size();
b++) {
86 myConditions[MuonCondition->
condName()] = tCondition;
91 for (
unsigned int a = 0;
a < vCaloConditions->size();
a++) {
92 for (
unsigned int b = 0;
b < (*vCaloConditions)[
a].size();
b++) {
106 myConditions[CaloCondition->
condName()] = tCondition;
111 for (
unsigned int a = 0;
a < vEnergySumConditions->size();
a++) {
112 for (
unsigned int b = 0;
b < (*vEnergySumConditions)[
a].size();
b++) {
128 myConditions[EnergySumCondition->
condName()] = tCondition;
133 for (
CItAlgo iAlgo = theAlgoMap->begin(); iAlgo != theAlgoMap->end(); ++iAlgo) {
136 bool algoIsValid =
true;
137 unsigned int maxThreshold = 0;
138 int tAlgoMask = myUtils.
triggerMask(iAlgo->first, error);
140 unsigned int tQuality = 0;
141 unsigned int tEtaRange = 0;
145 bool isNoIsoEG =
false;
146 bool isIsoEG =
false;
147 bool isCenJet =
false;
148 bool isForJet =
false;
149 bool isTauJet =
false;
156 if (tAlgoMask != 0) {
169 map<string, SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
173 if (ciCond == myConditions.end()) {
180 if (maxThreshold < (*ciCond).second.threshold) {
181 maxThreshold = (*ciCond).second.threshold;
182 tObject = (*ciCond).second.object;
183 tQuality = (*ciCond).second.quality;
184 tEtaRange = (*ciCond).second.etaRange;
187 if ((*ciCond).second.object ==
Mu) {
189 }
else if ((*ciCond).second.object ==
NoIsoEG) {
191 }
else if ((*ciCond).second.object ==
IsoEG) {
193 }
else if ((*ciCond).second.object ==
CenJet) {
195 }
else if ((*ciCond).second.object ==
ForJet) {
197 }
else if ((*ciCond).second.object ==
TauJet) {
199 }
else if ((*ciCond).second.object ==
ETM) {
201 }
else if ((*ciCond).second.object ==
ETT) {
203 }
else if ((*ciCond).second.object ==
HTT) {
205 }
else if ((*ciCond).second.object ==
HTM) {
215 tTrigger.
alias = iAlgo->first;
216 tTrigger.
bit = (iAlgo->second).algoBitNumber();
217 tTrigger.
prescale = refPrescaleFactors[tTrigger.
bit];
219 tTrigger.
object = tObject;
258 if (nCond == 1 && isMu ==
true) {
260 m_vTrigMu.push_back(tTrigger);
261 }
else if (nCond == 2 && isNoIsoEG ==
true && isIsoEG ==
true) {
262 m_vTrigEG.push_back(tTrigger);
263 }
else if (nCond == 1 && isIsoEG ==
true) {
264 m_vTrigIsoEG.push_back(tTrigger);
265 }
else if (nCond == 3 && isCenJet ==
true && isForJet ==
true && isTauJet ==
true) {
266 m_vTrigJet.push_back(tTrigger);
267 }
else if (nCond == 1 && isCenJet ==
true) {
268 m_vTrigCenJet.push_back(tTrigger);
269 }
else if (nCond == 1 && isForJet ==
true) {
270 m_vTrigForJet.push_back(tTrigger);
271 }
else if (nCond == 1 && isTauJet ==
true) {
272 m_vTrigTauJet.push_back(tTrigger);
273 }
else if (nCond == 1 && isETT ==
true) {
274 m_vTrigETT.push_back(tTrigger);
275 }
else if (nCond == 1 && isETM ==
true) {
276 m_vTrigETM.push_back(tTrigger);
277 }
else if (nCond == 1 && isHTT ==
true) {
278 m_vTrigHTT.push_back(tTrigger);
279 }
else if (nCond == 1 && isHTM ==
true) {
280 m_vTrigHTM.push_back(tTrigger);
292 string selTrigMu =
"Undefined";
293 string selTrigEG =
"Undefined";
294 string selTrigIsoEG =
"Undefined";
295 string selTrigJet =
"Undefined";
296 string selTrigCenJet =
"Undefined";
297 string selTrigForJet =
"Undefined";
298 string selTrigTauJet =
"Undefined";
299 string selTrigETT =
"Undefined";
300 string selTrigETM =
"Undefined";
301 string selTrigHTT =
"Undefined";
302 string selTrigHTM =
"Undefined";
304 if (!m_vTrigMu.empty()) {
305 sort(m_vTrigMu.begin(), m_vTrigMu.end());
306 selTrigMu = m_vTrigMu[0].alias;
308 if (!m_vTrigEG.empty()) {
309 sort(m_vTrigEG.begin(), m_vTrigEG.end());
310 selTrigEG = m_vTrigEG[0].alias;
312 if (!m_vTrigIsoEG.empty()) {
313 sort(m_vTrigIsoEG.begin(), m_vTrigIsoEG.end());
314 selTrigIsoEG = m_vTrigIsoEG[0].alias;
316 if (!m_vTrigJet.empty()) {
317 sort(m_vTrigJet.begin(), m_vTrigJet.end());
318 selTrigJet = m_vTrigJet[0].alias;
320 if (!m_vTrigCenJet.empty()) {
321 sort(m_vTrigCenJet.begin(), m_vTrigCenJet.end());
322 selTrigCenJet = m_vTrigCenJet[0].alias;
324 if (!m_vTrigForJet.empty()) {
325 sort(m_vTrigForJet.begin(), m_vTrigForJet.end());
326 selTrigForJet = m_vTrigForJet[0].alias;
328 if (!m_vTrigTauJet.empty()) {
329 sort(m_vTrigTauJet.begin(), m_vTrigTauJet.end());
330 selTrigTauJet = m_vTrigTauJet[0].alias;
332 if (!m_vTrigETT.empty()) {
333 sort(m_vTrigETT.begin(), m_vTrigETT.end());
334 selTrigETT = m_vTrigETT[0].alias;
336 if (!m_vTrigETM.empty()) {
337 sort(m_vTrigETM.begin(), m_vTrigETM.end());
338 selTrigETM = m_vTrigETM[0].alias;
340 if (!m_vTrigHTT.empty()) {
341 sort(m_vTrigHTT.begin(), m_vTrigHTT.end());
342 selTrigHTT = m_vTrigHTT[0].alias;
344 if (!m_vTrigHTM.empty()) {
345 sort(m_vTrigHTM.begin(), m_vTrigHTM.end());
346 selTrigHTM = m_vTrigHTM[0].alias;
349 auto check = [](
const map<string, bool>& cats,
const char*
key) ->
bool {
350 auto it = cats.find(
key);
351 if (it != cats.end())
357 if (
check(iCategories,
"Mu")) {
358 out[
"Mu"] = selTrigMu;
360 if (
check(iCategories,
"EG")) {
361 out[
"EG"] = selTrigEG;
363 if (
check(iCategories,
"IsoEG")) {
364 out[
"IsoEG"] = selTrigIsoEG;
366 if (
check(iCategories,
"Jet")) {
367 out[
"Jet"] = selTrigJet;
369 if (
check(iCategories,
"CenJet")) {
370 out[
"CenJet"] = selTrigCenJet;
372 if (
check(iCategories,
"ForJet")) {
373 out[
"ForJet"] = selTrigForJet;
375 if (
check(iCategories,
"TauJet")) {
376 out[
"TauJet"] = selTrigTauJet;
378 if (
check(iCategories,
"ETT")) {
379 out[
"ETT"] = selTrigETT;
381 if (
check(iCategories,
"ETM")) {
382 out[
"ETM"] = selTrigETM;
384 if (
check(iCategories,
"HTT")) {
385 out[
"HTT"] = selTrigHTT;
387 if (
check(iCategories,
"HTM")) {
388 out[
"HTM"] = selTrigHTM;
395 map<string, string> iAlgos = _iAlgos;
397 const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
399 for (map<string, string>::const_iterator
i = iAlgos.begin(); iAlgos.end() !=
i;
i++) {
400 string tCategory = (*i).first;
401 string tTrigger = (*i).second;
403 if (tTrigger.empty()) {
404 iAlgos[tCategory] =
"Undefined";
406 if (theAlgoMap->find(tTrigger) == theAlgoMap->end()) {
407 iAlgos[tCategory] =
"Undefined (Wrong Name)";
460 out =
"HfRingEtSums";
489 switch (iConditionType) {
524 out =
"TypeJetCounts";
530 out =
"TypeHfBitCounts";
533 out =
"TypeHfRingEtSums";
539 out =
"TypeExternal";
556 switch (iConditionCategory) {
567 out =
"CondEnergySum";
570 out =
"CondJetCounts";
573 out =
"CondCorrelation";
579 out =
"CondHfBitCounts";
582 out =
"CondHfRingEtSums";
588 out =
"CondExternal";
602 if (iCategory ==
"Mu") {
603 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
604 if (m_vTrigMu[
i].
alias == iAlias) {
605 return m_vTrigMu[
i].prescale;
608 }
else if (iCategory ==
"EG") {
609 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
610 if (m_vTrigEG[
i].
alias == iAlias) {
611 return m_vTrigEG[
i].prescale;
614 }
else if (iCategory ==
"IsoEG") {
615 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
616 if (m_vTrigIsoEG[
i].
alias == iAlias) {
617 return m_vTrigIsoEG[
i].prescale;
620 }
else if (iCategory ==
"Jet") {
621 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
622 if (m_vTrigJet[
i].
alias == iAlias) {
623 return m_vTrigJet[
i].prescale;
626 }
else if (iCategory ==
"CenJet") {
627 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
628 if (m_vTrigCenJet[
i].
alias == iAlias) {
629 return m_vTrigCenJet[
i].prescale;
632 }
else if (iCategory ==
"ForJet") {
633 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
634 if (m_vTrigForJet[
i].
alias == iAlias) {
635 return m_vTrigForJet[
i].prescale;
638 }
else if (iCategory ==
"TauJet") {
639 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
640 if (m_vTrigTauJet[
i].
alias == iAlias) {
641 return m_vTrigTauJet[
i].prescale;
644 }
else if (iCategory ==
"ETT") {
645 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
646 if (m_vTrigETT[
i].
alias == iAlias) {
647 return m_vTrigETT[
i].prescale;
650 }
else if (iCategory ==
"ETM") {
651 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
652 if (m_vTrigETM[
i].
alias == iAlias) {
653 return m_vTrigETM[
i].prescale;
656 }
else if (iCategory ==
"HTT") {
657 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
658 if (m_vTrigHTT[
i].
alias == iAlias) {
659 return m_vTrigHTT[
i].prescale;
662 }
else if (iCategory ==
"HTM") {
663 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
664 if (m_vTrigHTM[
i].
alias == iAlias) {
665 return m_vTrigHTM[
i].prescale;
675 unsigned int out = -1;
677 if (iCategory ==
"Mu") {
678 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
679 if (m_vTrigMu[
i].
alias == iAlias) {
680 return m_vTrigMu[
i].etaRange;
683 }
else if (iCategory ==
"EG") {
684 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
685 if (m_vTrigEG[
i].
alias == iAlias) {
686 return m_vTrigEG[
i].etaRange;
689 }
else if (iCategory ==
"IsoEG") {
690 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
691 if (m_vTrigIsoEG[
i].
alias == iAlias) {
692 return m_vTrigIsoEG[
i].etaRange;
695 }
else if (iCategory ==
"Jet") {
696 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
697 if (m_vTrigJet[
i].
alias == iAlias) {
698 return m_vTrigJet[
i].etaRange;
701 }
else if (iCategory ==
"CenJet") {
702 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
703 if (m_vTrigCenJet[
i].
alias == iAlias) {
704 return m_vTrigCenJet[
i].etaRange;
707 }
else if (iCategory ==
"ForJet") {
708 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
709 if (m_vTrigForJet[
i].
alias == iAlias) {
710 return m_vTrigForJet[
i].etaRange;
713 }
else if (iCategory ==
"TauJet") {
714 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
715 if (m_vTrigTauJet[
i].
alias == iAlias) {
716 return m_vTrigTauJet[
i].etaRange;
719 }
else if (iCategory ==
"ETT") {
720 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
721 if (m_vTrigETT[
i].
alias == iAlias) {
722 return m_vTrigETT[
i].etaRange;
725 }
else if (iCategory ==
"ETM") {
726 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
727 if (m_vTrigETM[
i].
alias == iAlias) {
728 return m_vTrigETM[
i].etaRange;
731 }
else if (iCategory ==
"HTT") {
732 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
733 if (m_vTrigHTT[
i].
alias == iAlias) {
734 return m_vTrigHTT[
i].etaRange;
737 }
else if (iCategory ==
"HTM") {
738 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
739 if (m_vTrigHTM[
i].
alias == iAlias) {
740 return m_vTrigHTM[
i].etaRange;
750 unsigned int out = -1;
752 if (iCategory ==
"Mu") {
753 for (
unsigned int i = 0;
i < m_vTrigMu.size();
i++) {
754 if (m_vTrigMu[
i].
alias == iAlias) {
755 return m_vTrigMu[
i].quality;
758 }
else if (iCategory ==
"EG") {
759 for (
unsigned int i = 0;
i < m_vTrigEG.size();
i++) {
760 if (m_vTrigEG[
i].
alias == iAlias) {
761 return m_vTrigEG[
i].quality;
764 }
else if (iCategory ==
"IsoEG") {
765 for (
unsigned int i = 0;
i < m_vTrigIsoEG.size();
i++) {
766 if (m_vTrigIsoEG[
i].
alias == iAlias) {
767 return m_vTrigIsoEG[
i].quality;
770 }
else if (iCategory ==
"Jet") {
771 for (
unsigned int i = 0;
i < m_vTrigJet.size();
i++) {
772 if (m_vTrigJet[
i].
alias == iAlias) {
773 return m_vTrigJet[
i].quality;
776 }
else if (iCategory ==
"CenJet") {
777 for (
unsigned int i = 0;
i < m_vTrigCenJet.size();
i++) {
778 if (m_vTrigCenJet[
i].
alias == iAlias) {
779 return m_vTrigCenJet[
i].quality;
782 }
else if (iCategory ==
"ForJet") {
783 for (
unsigned int i = 0;
i < m_vTrigForJet.size();
i++) {
784 if (m_vTrigForJet[
i].
alias == iAlias) {
785 return m_vTrigForJet[
i].quality;
788 }
else if (iCategory ==
"TauJet") {
789 for (
unsigned int i = 0;
i < m_vTrigTauJet.size();
i++) {
790 if (m_vTrigTauJet[
i].
alias == iAlias) {
791 return m_vTrigTauJet[
i].quality;
794 }
else if (iCategory ==
"ETT") {
795 for (
unsigned int i = 0;
i < m_vTrigETT.size();
i++) {
796 if (m_vTrigETT[
i].
alias == iAlias) {
797 return m_vTrigETT[
i].quality;
800 }
else if (iCategory ==
"ETM") {
801 for (
unsigned int i = 0;
i < m_vTrigETM.size();
i++) {
802 if (m_vTrigETM[
i].
alias == iAlias) {
803 return m_vTrigETM[
i].quality;
806 }
else if (iCategory ==
"HTT") {
807 for (
unsigned int i = 0;
i < m_vTrigHTT.size();
i++) {
808 if (m_vTrigHTT[
i].
alias == iAlias) {
809 return m_vTrigHTT[
i].quality;
812 }
else if (iCategory ==
"HTM") {
813 for (
unsigned int i = 0;
i < m_vTrigHTM.size();
i++) {
814 if (m_vTrigHTM[
i].
alias == iAlias) {
815 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
bool getData(T &iHolder) const
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
tuple key
prepare the HTCondor submission files and eventually submit them
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
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
const std::vector< ObjectParameter > * objectParameter() const