47 m_l1GtMenu = menuRcd .product();
62 int IndexRefPrescaleFactors,
64 map<string,string>
out;
67 const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
68 const vector< vector<L1GtMuonTemplate> > *vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
69 const vector< vector<L1GtCaloTemplate> > *vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
70 const vector< vector<L1GtEnergySumTemplate> > *vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
73 const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
77 map<string,SingleObjectCondition> myConditions;
79 for(
unsigned int a=0 ;
a<vMuonConditions->size() ;
a++){
80 for(
unsigned int b=0 ;
b<(*vMuonConditions)[
a].size() ;
b++){
97 myConditions[MuonCondition->
condName()] = tCondition;
103 for(
unsigned int a=0 ;
a<vCaloConditions->size() ;
a++){
104 for(
unsigned int b=0 ;
b<(*vCaloConditions)[
a].size() ;
b++){
120 myConditions[CaloCondition->
condName()] = tCondition;
126 for(
unsigned int a=0 ;
a<vEnergySumConditions->size() ;
a++){
127 for(
unsigned int b=0 ;
b<(*vEnergySumConditions)[
a].size() ;
b++){
135 ) && EnergySumCondition->
nrObjects() == 1){
147 myConditions[EnergySumCondition->
condName()] = tCondition;
153 for (
CItAlgo iAlgo = theAlgoMap->begin(); iAlgo!=theAlgoMap->end(); ++iAlgo){
157 bool algoIsValid =
true;
158 unsigned int maxThreshold = 0;
159 int tAlgoMask = myUtils.
triggerMask(iAlgo->first,error);
161 unsigned int tQuality = 0;
162 unsigned int tEtaRange = 0;
166 bool isNoIsoEG =
false;
167 bool isIsoEG =
false;
168 bool isCenJet =
false;
169 bool isForJet =
false;
170 bool isTauJet =
false;
195 map<string,SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
199 if(ciCond == myConditions.end()){
207 if(maxThreshold < (*ciCond).second.threshold){
208 maxThreshold = (*ciCond).second.threshold;
209 tObject = (*ciCond).second.object;
210 tQuality = (*ciCond).second.quality;
211 tEtaRange = (*ciCond).second.etaRange;
214 if ((*ciCond).second.object ==
Mu) {isMu =
true;}
215 else if((*ciCond).second.object ==
NoIsoEG){isNoIsoEG =
true;}
216 else if((*ciCond).second.object ==
IsoEG) {isIsoEG =
true;}
217 else if((*ciCond).second.object ==
CenJet) {isCenJet =
true;}
218 else if((*ciCond).second.object ==
ForJet) {isForJet =
true;}
219 else if((*ciCond).second.object ==
TauJet) {isTauJet =
true;}
220 else if((*ciCond).second.object ==
ETM) {isETM =
true;}
221 else if((*ciCond).second.object ==
ETT) {isETT =
true;}
222 else if((*ciCond).second.object ==
HTT) {isHTT =
true;}
223 else if((*ciCond).second.object ==
HTM) {isHTM =
true;}
233 tTrigger.
alias = iAlgo->first;
234 tTrigger.
bit = (iAlgo->second).algoBitNumber();
235 tTrigger.
prescale = refPrescaleFactors[tTrigger.
bit];
237 tTrigger.
object = tObject;
244 if(isNoIsoEG){nCond++;}
245 if(isIsoEG) {nCond++;}
246 if(isCenJet) {nCond++;}
247 if(isForJet) {nCond++;}
248 if(isTauJet) {nCond++;}
256 if (nCond==1 && isMu ==
true){
258 m_vTrigMu .push_back(tTrigger);
260 else if(nCond==2 && isNoIsoEG==
true && isIsoEG ==
true) {m_vTrigEG .push_back(tTrigger);}
261 else if(nCond==1 && isIsoEG ==
true) {m_vTrigIsoEG .push_back(tTrigger);}
262 else if(nCond==3 && isCenJet ==
true && isForJet==
true && isTauJet==
true){m_vTrigJet .push_back(tTrigger);}
263 else if(nCond==1 && isCenJet ==
true) {m_vTrigCenJet.push_back(tTrigger);}
264 else if(nCond==1 && isForJet ==
true) {m_vTrigForJet.push_back(tTrigger);}
265 else if(nCond==1 && isTauJet ==
true) {m_vTrigTauJet.push_back(tTrigger);}
266 else if(nCond==1 && isETT ==
true) {m_vTrigETT .push_back(tTrigger);}
267 else if(nCond==1 && isETM ==
true) {m_vTrigETM .push_back(tTrigger);}
268 else if(nCond==1 && isHTT ==
true) {m_vTrigHTT .push_back(tTrigger);}
269 else if(nCond==1 && isHTM ==
true) {m_vTrigHTM .push_back(tTrigger);}
281 string selTrigMu =
"Undefined";
282 string selTrigEG =
"Undefined";
283 string selTrigIsoEG =
"Undefined";
284 string selTrigJet =
"Undefined";
285 string selTrigCenJet =
"Undefined";
286 string selTrigForJet =
"Undefined";
287 string selTrigTauJet =
"Undefined";
288 string selTrigETT =
"Undefined";
289 string selTrigETM =
"Undefined";
290 string selTrigHTT =
"Undefined";
291 string selTrigHTM =
"Undefined";
293 if(m_vTrigMu .
size() > 0){sort(m_vTrigMu .
begin(),m_vTrigMu .
end()); selTrigMu = m_vTrigMu [0].alias;}
294 if(m_vTrigEG .
size() > 0){sort(m_vTrigEG .
begin(),m_vTrigEG .
end()); selTrigEG = m_vTrigEG [0].alias;}
295 if(m_vTrigIsoEG .
size() > 0){sort(m_vTrigIsoEG .
begin(),m_vTrigIsoEG .
end()); selTrigIsoEG = m_vTrigIsoEG [0].alias;}
296 if(m_vTrigJet .
size() > 0){sort(m_vTrigJet .
begin(),m_vTrigJet .
end()); selTrigJet = m_vTrigJet [0].alias;}
297 if(m_vTrigCenJet.size() > 0){sort(m_vTrigCenJet.begin(),m_vTrigCenJet.end()); selTrigCenJet = m_vTrigCenJet[0].alias;}
298 if(m_vTrigForJet.size() > 0){sort(m_vTrigForJet.begin(),m_vTrigForJet.end()); selTrigForJet = m_vTrigForJet[0].alias;}
299 if(m_vTrigTauJet.size() > 0){sort(m_vTrigTauJet.begin(),m_vTrigTauJet.end()); selTrigTauJet = m_vTrigTauJet[0].alias;}
300 if(m_vTrigETT .
size() > 0){sort(m_vTrigETT .
begin(),m_vTrigETT .
end()); selTrigETT = m_vTrigETT [0].alias;}
301 if(m_vTrigETM .
size() > 0){sort(m_vTrigETM .
begin(),m_vTrigETM .
end()); selTrigETM = m_vTrigETM [0].alias;}
302 if(m_vTrigHTT .
size() > 0){sort(m_vTrigHTT .
begin(),m_vTrigHTT .
end()); selTrigHTT = m_vTrigHTT [0].alias;}
303 if(m_vTrigHTM .
size() > 0){sort(m_vTrigHTM .
begin(),m_vTrigHTM .
end()); selTrigHTM = m_vTrigHTM [0].alias;}
305 auto check = [](
const map<string,bool>& cats,
const char*
key) ->
bool {
306 auto it = cats.find(
key);
307 if (it != cats.end())
313 if (
check(iCategories,
"Mu" )) {out[
"Mu"] = selTrigMu;}
314 if (
check(iCategories,
"EG" )) {out[
"EG"] = selTrigEG;}
315 if (
check(iCategories,
"IsoEG" )) {out[
"IsoEG"] = selTrigIsoEG;}
316 if (
check(iCategories,
"Jet" )) {out[
"Jet"] = selTrigJet;}
317 if (
check(iCategories,
"CenJet")) {out[
"CenJet"] = selTrigCenJet;}
318 if (
check(iCategories,
"ForJet")) {out[
"ForJet"] = selTrigForJet;}
319 if (
check(iCategories,
"TauJet")) {out[
"TauJet"] = selTrigTauJet;}
320 if (
check(iCategories,
"ETT" )) {out[
"ETT"] = selTrigETT;}
321 if (
check(iCategories,
"ETM" )) {out[
"ETM"] = selTrigETM;}
322 if (
check(iCategories,
"HTT" )) {out[
"HTT"] = selTrigHTT;}
323 if (
check(iCategories,
"HTM" )) {out[
"HTM"] = selTrigHTM;}
330 map<string,string> iAlgos = _iAlgos;
332 const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
334 for(map<string,string>::const_iterator
i = iAlgos.begin() ; iAlgos.end() !=
i ;
i++){
336 string tCategory = (*i).first;
337 string tTrigger = (*i).second;
339 if(tTrigger ==
"" ){iAlgos[tCategory] =
"Undefined";}
341 if(theAlgoMap->find(tTrigger) == theAlgoMap->end()){iAlgos[tCategory] =
"Undefined (Wrong Name)";}
359 case Mu: out =
"Mu";
break;
360 case NoIsoEG: out =
"NoIsoEG";
break;
361 case IsoEG: out =
"IsoEG";
break;
362 case CenJet: out =
"CenJet";
break;
363 case ForJet: out =
"ForJet";
break;
364 case TauJet: out =
"TauJet";
break;
365 case ETM: out =
"ETM";
break;
366 case ETT: out =
"ETT";
break;
367 case HTT: out =
"HTT";
break;
368 case HTM: out =
"HTM";
break;
369 case JetCounts: out =
"JetCounts";
break;
372 case TechTrig: out =
"TechTrig";
break;
373 case Castor: out =
"Castor";
break;
374 case BPTX: out =
"BPTX";
break;
376 default: out =
"Unknown";
break;
391 switch(iConditionType){
392 case TypeNull: out =
"TypeNull";
break;
393 case Type1s: out =
"Type1s";
break;
394 case Type2s: out =
"Type2s";
break;
395 case Type2wsc: out =
"Type2wsc";
break;
396 case Type2cor: out =
"Type2cor";
break;
397 case Type3s: out =
"Type3s";
break;
398 case Type4s: out =
"Type4s";
break;
399 case TypeETM: out =
"TypeETM";
break;
400 case TypeETT: out =
"TypeETT";
break;
401 case TypeHTT: out =
"TypeHTT";
break;
402 case TypeHTM: out =
"TypeHTM";
break;
407 case TypeBptx: out =
"TypeBptx";
break;
409 default: out =
"Unknown";
break;
424 switch(iConditionCategory){
425 case CondNull: out =
"CondNull";
break;
426 case CondMuon: out =
"CondMuon";
break;
427 case CondCalo: out =
"CondCalo";
break;
434 case CondBptx: out =
"CondBptx";
break;
436 default: out =
"Unknown";
break;
448 if(iCategory ==
"Mu"){
449 for(
unsigned int i=0 ;
i<m_vTrigMu.size() ;
i++){
if(m_vTrigMu[
i].
alias==iAlias) {
return m_vTrigMu[
i].prescale;}}
450 }
else if(iCategory ==
"EG"){
451 for(
unsigned int i=0 ;
i<m_vTrigEG.size() ;
i++){
if(m_vTrigEG[
i].
alias==iAlias) {
return m_vTrigEG[
i].prescale;}}
452 }
else if(iCategory ==
"IsoEG"){
453 for(
unsigned int i=0 ;
i<m_vTrigIsoEG.size() ;
i++){
if(m_vTrigIsoEG[
i].
alias==iAlias) {
return m_vTrigIsoEG[
i].prescale;}}
454 }
else if(iCategory ==
"Jet"){
455 for(
unsigned int i=0 ;
i<m_vTrigJet.size() ;
i++){
if(m_vTrigJet[
i].
alias==iAlias) {
return m_vTrigJet[
i].prescale;}}
456 }
else if(iCategory ==
"CenJet"){
457 for(
unsigned int i=0 ;
i<m_vTrigCenJet.size() ;
i++){
if(m_vTrigCenJet[
i].
alias==iAlias){
return m_vTrigCenJet[
i].prescale;}}
458 }
else if(iCategory ==
"ForJet"){
459 for(
unsigned int i=0 ;
i<m_vTrigForJet.size() ;
i++){
if(m_vTrigForJet[
i].
alias==iAlias){
return m_vTrigForJet[
i].prescale;}}
460 }
else if(iCategory ==
"TauJet"){
461 for(
unsigned int i=0 ;
i<m_vTrigTauJet.size() ;
i++){
if(m_vTrigTauJet[
i].
alias==iAlias){
return m_vTrigTauJet[
i].prescale;}}
462 }
else if(iCategory ==
"ETT"){
463 for(
unsigned int i=0 ;
i<m_vTrigETT.size() ;
i++){
if(m_vTrigETT[
i].
alias==iAlias) {
return m_vTrigETT[
i].prescale;}}
464 }
else if(iCategory ==
"ETM"){
465 for(
unsigned int i=0 ;
i<m_vTrigETM.size() ;
i++){
if(m_vTrigETM[
i].
alias==iAlias) {
return m_vTrigETM[
i].prescale;}}
466 }
else if(iCategory ==
"HTT"){
467 for(
unsigned int i=0 ;
i<m_vTrigHTT.size() ;
i++){
if(m_vTrigHTT[
i].
alias==iAlias) {
return m_vTrigHTT[
i].prescale;}}
468 }
else if(iCategory ==
"HTM"){
469 for(
unsigned int i=0 ;
i<m_vTrigHTM.size() ;
i++){
if(m_vTrigHTM[
i].
alias==iAlias) {
return m_vTrigHTM[
i].prescale;}}
479 unsigned int out = -1;
481 if(iCategory ==
"Mu"){
482 for(
unsigned int i=0 ;
i<m_vTrigMu.size() ;
i++){
if(m_vTrigMu[
i].
alias==iAlias) {
return m_vTrigMu[
i].etaRange;}}
483 }
else if(iCategory ==
"EG"){
484 for(
unsigned int i=0 ;
i<m_vTrigEG.size() ;
i++){
if(m_vTrigEG[
i].
alias==iAlias) {
return m_vTrigEG[
i].etaRange;}}
485 }
else if(iCategory ==
"IsoEG"){
486 for(
unsigned int i=0 ;
i<m_vTrigIsoEG.size() ;
i++){
if(m_vTrigIsoEG[
i].
alias==iAlias) {
return m_vTrigIsoEG[
i].etaRange;}}
487 }
else if(iCategory ==
"Jet"){
488 for(
unsigned int i=0 ;
i<m_vTrigJet.size() ;
i++){
if(m_vTrigJet[
i].
alias==iAlias) {
return m_vTrigJet[
i].etaRange;}}
489 }
else if(iCategory ==
"CenJet"){
490 for(
unsigned int i=0 ;
i<m_vTrigCenJet.size() ;
i++){
if(m_vTrigCenJet[
i].
alias==iAlias){
return m_vTrigCenJet[
i].etaRange;}}
491 }
else if(iCategory ==
"ForJet"){
492 for(
unsigned int i=0 ;
i<m_vTrigForJet.size() ;
i++){
if(m_vTrigForJet[
i].
alias==iAlias){
return m_vTrigForJet[
i].etaRange;}}
493 }
else if(iCategory ==
"TauJet"){
494 for(
unsigned int i=0 ;
i<m_vTrigTauJet.size() ;
i++){
if(m_vTrigTauJet[
i].
alias==iAlias){
return m_vTrigTauJet[
i].etaRange;}}
495 }
else if(iCategory ==
"ETT"){
496 for(
unsigned int i=0 ;
i<m_vTrigETT.size() ;
i++){
if(m_vTrigETT[
i].
alias==iAlias) {
return m_vTrigETT[
i].etaRange;}}
497 }
else if(iCategory ==
"ETM"){
498 for(
unsigned int i=0 ;
i<m_vTrigETM.size() ;
i++){
if(m_vTrigETM[
i].
alias==iAlias) {
return m_vTrigETM[
i].etaRange;}}
499 }
else if(iCategory ==
"HTT"){
500 for(
unsigned int i=0 ;
i<m_vTrigHTT.size() ;
i++){
if(m_vTrigHTT[
i].
alias==iAlias) {
return m_vTrigHTT[
i].etaRange;}}
501 }
else if(iCategory ==
"HTM"){
502 for(
unsigned int i=0 ;
i<m_vTrigHTM.size() ;
i++){
if(m_vTrigHTM[
i].
alias==iAlias) {
return m_vTrigHTM[
i].etaRange;}}
512 unsigned int out = -1;
514 if(iCategory ==
"Mu"){
515 for(
unsigned int i=0 ;
i<m_vTrigMu.size() ;
i++){
if(m_vTrigMu[
i].
alias==iAlias) {
return m_vTrigMu[
i].quality;}}
516 }
else if(iCategory ==
"EG"){
517 for(
unsigned int i=0 ;
i<m_vTrigEG.size() ;
i++){
if(m_vTrigEG[
i].
alias==iAlias) {
return m_vTrigEG[
i].quality;}}
518 }
else if(iCategory ==
"IsoEG"){
519 for(
unsigned int i=0 ;
i<m_vTrigIsoEG.size() ;
i++){
if(m_vTrigIsoEG[
i].
alias==iAlias) {
return m_vTrigIsoEG[
i].quality;}}
520 }
else if(iCategory ==
"Jet"){
521 for(
unsigned int i=0 ;
i<m_vTrigJet.size() ;
i++){
if(m_vTrigJet[
i].
alias==iAlias) {
return m_vTrigJet[
i].quality;}}
522 }
else if(iCategory ==
"CenJet"){
523 for(
unsigned int i=0 ;
i<m_vTrigCenJet.size() ;
i++){
if(m_vTrigCenJet[
i].
alias==iAlias){
return m_vTrigCenJet[
i].quality;}}
524 }
else if(iCategory ==
"ForJet"){
525 for(
unsigned int i=0 ;
i<m_vTrigForJet.size() ;
i++){
if(m_vTrigForJet[
i].
alias==iAlias){
return m_vTrigForJet[
i].quality;}}
526 }
else if(iCategory ==
"TauJet"){
527 for(
unsigned int i=0 ;
i<m_vTrigTauJet.size() ;
i++){
if(m_vTrigTauJet[
i].
alias==iAlias){
return m_vTrigTauJet[
i].quality;}}
528 }
else if(iCategory ==
"ETT"){
529 for(
unsigned int i=0 ;
i<m_vTrigETT.size() ;
i++){
if(m_vTrigETT[
i].
alias==iAlias) {
return m_vTrigETT[
i].quality;}}
530 }
else if(iCategory ==
"ETM"){
531 for(
unsigned int i=0 ;
i<m_vTrigETM.size() ;
i++){
if(m_vTrigETM[
i].
alias==iAlias) {
return m_vTrigETM[
i].quality;}}
532 }
else if(iCategory ==
"HTT"){
533 for(
unsigned int i=0 ;
i<m_vTrigHTT.size() ;
i++){
if(m_vTrigHTT[
i].
alias==iAlias) {
return m_vTrigHTT[
i].quality;}}
534 }
else if(iCategory ==
"HTM"){
535 for(
unsigned int i=0 ;
i<m_vTrigHTM.size() ;
i++){
if(m_vTrigHTM[
i].
alias==iAlias) {
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)