18 #include "HLTrigger/HLTanalyzers/test/RateEff/L1GtLogicParser.h"
50 m_l1GtMenu = menuRcd .product();
53 myUtils.retrieveL1EventSetup(iSetup);
69 map<string,string>
out;
72 const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
73 const vector< vector<L1GtMuonTemplate> > *vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
74 const vector< vector<L1GtCaloTemplate> > *vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
75 const vector< vector<L1GtEnergySumTemplate> > *vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
78 const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
82 map<string,SingleObjectCondition> myConditions;
84 for(
unsigned int a=0 ;
a<vMuonConditions->size() ;
a++){
85 for(
unsigned int b=0 ;
b<(*vMuonConditions)[
a].size() ;
b++){
102 myConditions[MuonCondition->
condName()] = tCondition;
108 for(
unsigned int a=0 ;
a<vCaloConditions->size() ;
a++){
109 for(
unsigned int b=0 ;
b<(*vCaloConditions)[
a].size() ;
b++){
125 myConditions[CaloCondition->
condName()] = tCondition;
131 for(
unsigned int a=0 ;
a<vEnergySumConditions->size() ;
a++){
132 for(
unsigned int b=0 ;
b<(*vEnergySumConditions)[
a].size() ;
b++){
140 ) && EnergySumCondition->
nrObjects() == 1){
152 myConditions[EnergySumCondition->
condName()] = tCondition;
158 for (
CItAlgo iAlgo = theAlgoMap->begin(); iAlgo!=theAlgoMap->end(); ++iAlgo){
162 bool algoIsValid =
true;
163 unsigned int maxThreshold = 0;
164 int tAlgoMask = myUtils.triggerMask(iAlgo->first,error);
166 unsigned int tQuality = 0;
167 unsigned int tEtaRange = 0;
171 bool isNoIsoEG =
false;
172 bool isIsoEG =
false;
173 bool isCenJet =
false;
174 bool isForJet =
false;
175 bool isTauJet =
false;
200 map<string,SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
204 if(ciCond == myConditions.end()){
212 if(maxThreshold < (*ciCond).second.threshold){
213 maxThreshold = (*ciCond).second.threshold;
214 tObject = (*ciCond).second.object;
215 tQuality = (*ciCond).second.quality;
216 tEtaRange = (*ciCond).second.etaRange;
219 if ((*ciCond).second.object ==
Mu) {isMu =
true;}
220 else if((*ciCond).second.object ==
NoIsoEG){isNoIsoEG =
true;}
221 else if((*ciCond).second.object ==
IsoEG) {isIsoEG =
true;}
222 else if((*ciCond).second.object ==
CenJet) {isCenJet =
true;}
223 else if((*ciCond).second.object ==
ForJet) {isForJet =
true;}
224 else if((*ciCond).second.object ==
TauJet) {isTauJet =
true;}
225 else if((*ciCond).second.object ==
ETM) {isETM =
true;}
226 else if((*ciCond).second.object ==
ETT) {isETT =
true;}
227 else if((*ciCond).second.object ==
HTT) {isHTT =
true;}
228 else if((*ciCond).second.object ==
HTM) {isHTM =
true;}
238 tTrigger.
alias = iAlgo->first;
239 tTrigger.
bit = (iAlgo->second).algoBitNumber();
240 tTrigger.
prescale = refPrescaleFactors[tTrigger.
bit];
242 tTrigger.
object = tObject;
249 if(isNoIsoEG){nCond++;}
250 if(isIsoEG) {nCond++;}
251 if(isCenJet) {nCond++;}
252 if(isForJet) {nCond++;}
253 if(isTauJet) {nCond++;}
261 if (nCond==1 && isMu ==
true){
263 m_vTrigMu .push_back(tTrigger);
265 else if(nCond==2 && isNoIsoEG==
true && isIsoEG ==
true) {m_vTrigEG .push_back(tTrigger);}
266 else if(nCond==1 && isIsoEG ==
true) {m_vTrigIsoEG .push_back(tTrigger);}
267 else if(nCond==3 && isCenJet ==
true && isForJet==
true && isTauJet==
true){m_vTrigJet .push_back(tTrigger);}
268 else if(nCond==1 && isCenJet ==
true) {m_vTrigCenJet.push_back(tTrigger);}
269 else if(nCond==1 && isForJet ==
true) {m_vTrigForJet.push_back(tTrigger);}
270 else if(nCond==1 && isTauJet ==
true) {m_vTrigTauJet.push_back(tTrigger);}
271 else if(nCond==1 && isETT ==
true) {m_vTrigETT .push_back(tTrigger);}
272 else if(nCond==1 && isETM ==
true) {m_vTrigETM .push_back(tTrigger);}
273 else if(nCond==1 && isHTT ==
true) {m_vTrigHTT .push_back(tTrigger);}
274 else if(nCond==1 && isHTM ==
true) {m_vTrigHTM .push_back(tTrigger);}
286 string selTrigMu =
"Undefined";
287 string selTrigEG =
"Undefined";
288 string selTrigIsoEG =
"Undefined";
289 string selTrigJet =
"Undefined";
290 string selTrigCenJet =
"Undefined";
291 string selTrigForJet =
"Undefined";
292 string selTrigTauJet =
"Undefined";
293 string selTrigETT =
"Undefined";
294 string selTrigETM =
"Undefined";
295 string selTrigHTT =
"Undefined";
296 string selTrigHTM =
"Undefined";
298 if(m_vTrigMu .
size() > 0){
sort(m_vTrigMu .
begin(),m_vTrigMu .
end()); selTrigMu = m_vTrigMu [0].alias;}
299 if(m_vTrigEG .
size() > 0){
sort(m_vTrigEG .
begin(),m_vTrigEG .
end()); selTrigEG = m_vTrigEG [0].alias;}
300 if(m_vTrigIsoEG .
size() > 0){
sort(m_vTrigIsoEG .
begin(),m_vTrigIsoEG .
end()); selTrigIsoEG = m_vTrigIsoEG [0].alias;}
301 if(m_vTrigJet .
size() > 0){
sort(m_vTrigJet .
begin(),m_vTrigJet .
end()); selTrigJet = m_vTrigJet [0].alias;}
302 if(m_vTrigCenJet.size() > 0){
sort(m_vTrigCenJet.begin(),m_vTrigCenJet.end()); selTrigCenJet = m_vTrigCenJet[0].alias;}
303 if(m_vTrigForJet.size() > 0){
sort(m_vTrigForJet.begin(),m_vTrigForJet.end()); selTrigForJet = m_vTrigForJet[0].alias;}
304 if(m_vTrigTauJet.size() > 0){
sort(m_vTrigTauJet.begin(),m_vTrigTauJet.end()); selTrigTauJet = m_vTrigTauJet[0].alias;}
305 if(m_vTrigETT .
size() > 0){
sort(m_vTrigETT .
begin(),m_vTrigETT .
end()); selTrigETT = m_vTrigETT [0].alias;}
306 if(m_vTrigETM .
size() > 0){
sort(m_vTrigETM .
begin(),m_vTrigETM .
end()); selTrigETM = m_vTrigETM [0].alias;}
307 if(m_vTrigHTT .
size() > 0){
sort(m_vTrigHTT .
begin(),m_vTrigHTT .
end()); selTrigHTT = m_vTrigHTT [0].alias;}
308 if(m_vTrigHTM .
size() > 0){
sort(m_vTrigHTM .
begin(),m_vTrigHTM .
end()); selTrigHTM = m_vTrigHTM [0].alias;}
310 if(iCategories[
"Mu"]) {out[
"Mu"] = selTrigMu;}
311 if(iCategories[
"EG"]) {out[
"EG"] = selTrigEG;}
312 if(iCategories[
"IsoEG"]) {out[
"IsoEG"] = selTrigIsoEG;}
313 if(iCategories[
"Jet"]) {out[
"Jet"] = selTrigJet;}
314 if(iCategories[
"CenJet"]){out[
"CenJet"] = selTrigCenJet;}
315 if(iCategories[
"ForJet"]){out[
"ForJet"] = selTrigForJet;}
316 if(iCategories[
"TauJet"]){out[
"TauJet"] = selTrigTauJet;}
317 if(iCategories[
"ETT"]) {out[
"ETT"] = selTrigETT;}
318 if(iCategories[
"ETM"]) {out[
"ETM"] = selTrigETM;}
319 if(iCategories[
"HTT"]) {out[
"HTT"] = selTrigHTT;}
320 if(iCategories[
"HTM"]) {out[
"HTM"] = selTrigHTM;}
329 const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
331 for(map<string,string>::const_iterator
i = iAlgos.begin() ; iAlgos.end() !=
i ;
i++){
333 string tCategory = (*i).first;
334 string tTrigger = (*i).second;
336 if(tTrigger ==
"" ){iAlgos[tCategory] =
"Undefined";}
338 if(theAlgoMap->find(tTrigger) == theAlgoMap->end()){iAlgos[tCategory] =
"Undefined (Wrong Name)";}
356 case Mu: out =
"Mu";
break;
357 case NoIsoEG: out =
"NoIsoEG";
break;
358 case IsoEG: out =
"IsoEG";
break;
359 case CenJet: out =
"CenJet";
break;
360 case ForJet: out =
"ForJet";
break;
361 case TauJet: out =
"TauJet";
break;
362 case ETM: out =
"ETM";
break;
363 case ETT: out =
"ETT";
break;
364 case HTT: out =
"HTT";
break;
365 case HTM: out =
"HTM";
break;
366 case JetCounts: out =
"JetCounts";
break;
369 case TechTrig: out =
"TechTrig";
break;
370 case Castor: out =
"Castor";
break;
371 case BPTX: out =
"BPTX";
break;
373 default: out =
"Unknown";
break;
388 switch(iConditionType){
389 case TypeNull: out =
"TypeNull";
break;
390 case Type1s: out =
"Type1s";
break;
391 case Type2s: out =
"Type2s";
break;
392 case Type2wsc: out =
"Type2wsc";
break;
393 case Type2cor: out =
"Type2cor";
break;
394 case Type3s: out =
"Type3s";
break;
395 case Type4s: out =
"Type4s";
break;
396 case TypeETM: out =
"TypeETM";
break;
397 case TypeETT: out =
"TypeETT";
break;
398 case TypeHTT: out =
"TypeHTT";
break;
399 case TypeHTM: out =
"TypeHTM";
break;
404 case TypeBptx: out =
"TypeBptx";
break;
406 default: out =
"Unknown";
break;
421 switch(iConditionCategory){
422 case CondNull: out =
"CondNull";
break;
423 case CondMuon: out =
"CondMuon";
break;
424 case CondCalo: out =
"CondCalo";
break;
431 case CondBptx: out =
"CondBptx";
break;
433 default: out =
"Unknown";
break;
445 if(iCategory ==
"Mu"){
446 for(
unsigned int i=0 ;
i<m_vTrigMu.size() ;
i++){
if(m_vTrigMu[
i].alias==iAlias) {
return m_vTrigMu[
i].prescale;}}
447 }
else if(iCategory ==
"EG"){
448 for(
unsigned int i=0 ;
i<m_vTrigEG.size() ;
i++){
if(m_vTrigEG[
i].alias==iAlias) {
return m_vTrigEG[
i].prescale;}}
449 }
else if(iCategory ==
"IsoEG"){
450 for(
unsigned int i=0 ;
i<m_vTrigIsoEG.size() ;
i++){
if(m_vTrigIsoEG[
i].alias==iAlias) {
return m_vTrigIsoEG[
i].prescale;}}
451 }
else if(iCategory ==
"Jet"){
452 for(
unsigned int i=0 ;
i<m_vTrigJet.size() ;
i++){
if(m_vTrigJet[
i].alias==iAlias) {
return m_vTrigJet[
i].prescale;}}
453 }
else if(iCategory ==
"CenJet"){
454 for(
unsigned int i=0 ;
i<m_vTrigCenJet.size() ;
i++){
if(m_vTrigCenJet[
i].alias==iAlias){
return m_vTrigCenJet[
i].prescale;}}
455 }
else if(iCategory ==
"ForJet"){
456 for(
unsigned int i=0 ;
i<m_vTrigForJet.size() ;
i++){
if(m_vTrigForJet[
i].alias==iAlias){
return m_vTrigForJet[
i].prescale;}}
457 }
else if(iCategory ==
"TauJet"){
458 for(
unsigned int i=0 ;
i<m_vTrigTauJet.size() ;
i++){
if(m_vTrigTauJet[
i].alias==iAlias){
return m_vTrigTauJet[
i].prescale;}}
459 }
else if(iCategory ==
"ETT"){
460 for(
unsigned int i=0 ;
i<m_vTrigETT.size() ;
i++){
if(m_vTrigETT[
i].alias==iAlias) {
return m_vTrigETT[
i].prescale;}}
461 }
else if(iCategory ==
"ETM"){
462 for(
unsigned int i=0 ;
i<m_vTrigETM.size() ;
i++){
if(m_vTrigETM[
i].alias==iAlias) {
return m_vTrigETM[
i].prescale;}}
463 }
else if(iCategory ==
"HTT"){
464 for(
unsigned int i=0 ;
i<m_vTrigHTT.size() ;
i++){
if(m_vTrigHTT[
i].alias==iAlias) {
return m_vTrigHTT[
i].prescale;}}
465 }
else if(iCategory ==
"HTM"){
466 for(
unsigned int i=0 ;
i<m_vTrigHTM.size() ;
i++){
if(m_vTrigHTM[
i].alias==iAlias) {
return m_vTrigHTM[
i].prescale;}}
476 unsigned int out = -1;
478 if(iCategory ==
"Mu"){
479 for(
unsigned int i=0 ;
i<m_vTrigMu.size() ;
i++){
if(m_vTrigMu[
i].alias==iAlias) {
return m_vTrigMu[
i].etaRange;}}
480 }
else if(iCategory ==
"EG"){
481 for(
unsigned int i=0 ;
i<m_vTrigEG.size() ;
i++){
if(m_vTrigEG[
i].alias==iAlias) {
return m_vTrigEG[
i].etaRange;}}
482 }
else if(iCategory ==
"IsoEG"){
483 for(
unsigned int i=0 ;
i<m_vTrigIsoEG.size() ;
i++){
if(m_vTrigIsoEG[
i].alias==iAlias) {
return m_vTrigIsoEG[
i].etaRange;}}
484 }
else if(iCategory ==
"Jet"){
485 for(
unsigned int i=0 ;
i<m_vTrigJet.size() ;
i++){
if(m_vTrigJet[
i].alias==iAlias) {
return m_vTrigJet[
i].etaRange;}}
486 }
else if(iCategory ==
"CenJet"){
487 for(
unsigned int i=0 ;
i<m_vTrigCenJet.size() ;
i++){
if(m_vTrigCenJet[
i].alias==iAlias){
return m_vTrigCenJet[
i].etaRange;}}
488 }
else if(iCategory ==
"ForJet"){
489 for(
unsigned int i=0 ;
i<m_vTrigForJet.size() ;
i++){
if(m_vTrigForJet[
i].alias==iAlias){
return m_vTrigForJet[
i].etaRange;}}
490 }
else if(iCategory ==
"TauJet"){
491 for(
unsigned int i=0 ;
i<m_vTrigTauJet.size() ;
i++){
if(m_vTrigTauJet[
i].alias==iAlias){
return m_vTrigTauJet[
i].etaRange;}}
492 }
else if(iCategory ==
"ETT"){
493 for(
unsigned int i=0 ;
i<m_vTrigETT.size() ;
i++){
if(m_vTrigETT[
i].alias==iAlias) {
return m_vTrigETT[
i].etaRange;}}
494 }
else if(iCategory ==
"ETM"){
495 for(
unsigned int i=0 ;
i<m_vTrigETM.size() ;
i++){
if(m_vTrigETM[
i].alias==iAlias) {
return m_vTrigETM[
i].etaRange;}}
496 }
else if(iCategory ==
"HTT"){
497 for(
unsigned int i=0 ;
i<m_vTrigHTT.size() ;
i++){
if(m_vTrigHTT[
i].alias==iAlias) {
return m_vTrigHTT[
i].etaRange;}}
498 }
else if(iCategory ==
"HTM"){
499 for(
unsigned int i=0 ;
i<m_vTrigHTM.size() ;
i++){
if(m_vTrigHTM[
i].alias==iAlias) {
return m_vTrigHTM[
i].etaRange;}}
509 unsigned int out = -1;
511 if(iCategory ==
"Mu"){
512 for(
unsigned int i=0 ;
i<m_vTrigMu.size() ;
i++){
if(m_vTrigMu[
i].alias==iAlias) {
return m_vTrigMu[
i].quality;}}
513 }
else if(iCategory ==
"EG"){
514 for(
unsigned int i=0 ;
i<m_vTrigEG.size() ;
i++){
if(m_vTrigEG[
i].alias==iAlias) {
return m_vTrigEG[
i].quality;}}
515 }
else if(iCategory ==
"IsoEG"){
516 for(
unsigned int i=0 ;
i<m_vTrigIsoEG.size() ;
i++){
if(m_vTrigIsoEG[
i].alias==iAlias) {
return m_vTrigIsoEG[
i].quality;}}
517 }
else if(iCategory ==
"Jet"){
518 for(
unsigned int i=0 ;
i<m_vTrigJet.size() ;
i++){
if(m_vTrigJet[
i].alias==iAlias) {
return m_vTrigJet[
i].quality;}}
519 }
else if(iCategory ==
"CenJet"){
520 for(
unsigned int i=0 ;
i<m_vTrigCenJet.size() ;
i++){
if(m_vTrigCenJet[
i].alias==iAlias){
return m_vTrigCenJet[
i].quality;}}
521 }
else if(iCategory ==
"ForJet"){
522 for(
unsigned int i=0 ;
i<m_vTrigForJet.size() ;
i++){
if(m_vTrigForJet[
i].alias==iAlias){
return m_vTrigForJet[
i].quality;}}
523 }
else if(iCategory ==
"TauJet"){
524 for(
unsigned int i=0 ;
i<m_vTrigTauJet.size() ;
i++){
if(m_vTrigTauJet[
i].alias==iAlias){
return m_vTrigTauJet[
i].quality;}}
525 }
else if(iCategory ==
"ETT"){
526 for(
unsigned int i=0 ;
i<m_vTrigETT.size() ;
i++){
if(m_vTrigETT[
i].alias==iAlias) {
return m_vTrigETT[
i].quality;}}
527 }
else if(iCategory ==
"ETM"){
528 for(
unsigned int i=0 ;
i<m_vTrigETM.size() ;
i++){
if(m_vTrigETM[
i].alias==iAlias) {
return m_vTrigETM[
i].quality;}}
529 }
else if(iCategory ==
"HTT"){
530 for(
unsigned int i=0 ;
i<m_vTrigHTT.size() ;
i++){
if(m_vTrigHTT[
i].alias==iAlias) {
return m_vTrigHTT[
i].quality;}}
531 }
else if(iCategory ==
"HTM"){
532 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 std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const std::vector< ObjectParameter > * objectParameter() const
tuple size
Write out results.