47 nameProcess_( iConfig.getParameter<
std::
string >(
"processName" ) ),
48 autoProcessName_( nameProcess_ ==
"*" ),
49 onlyStandAlone_( iConfig.getParameter<
bool >(
"onlyStandAlone" ) ),
53 tagL1GlobalTriggerObjectMaps_(
"l1L1GtObjectMap" ),
62 autoProcessNameL1ExtraMu_(
false ),
63 autoProcessNameL1ExtraNoIsoEG_(
false ),
64 autoProcessNameL1ExtraIsoEG_(
false ),
65 autoProcessNameL1ExtraCenJet_(
false ),
66 autoProcessNameL1ExtraForJet_(
false ),
67 autoProcessNameL1ExtraTauJet_(
false ),
68 autoProcessNameL1ExtraETM_(
false ),
69 autoProcessNameL1ExtraHTM_(
false ),
72 hltPrescaleProvider_(iConfig, consumesCollector(), *this),
73 hltConfigInit_(
false ),
75 tagTriggerResults_(
"TriggerResults" ),
76 tagTriggerEvent_(
"hltTriggerSummaryAOD" ),
78 labelHltPrescaleTable_(),
79 hltPrescaleTableRun_(),
80 hltPrescaleTableLumi_(),
81 addPathModuleLabels_(
false ),
82 packPathNames_( iConfig.existsAs<
bool>(
"packTriggerPathNames") ? iConfig.getParameter<
bool>(
"packTriggerPathNames") :
false ),
83 packLabels_( iConfig.existsAs<
bool>(
"packTriggerLabels") ? iConfig.getParameter<
bool>(
"packTriggerLabels") :
true ),
84 packPrescales_( iConfig.existsAs<
bool>(
"packTriggerPrescales") ? iConfig.getParameter<
bool>(
"packTriggerPrescales") :
true )
91 if ( iConfig.
exists(
"l1ExtraMu" ) ) {
99 if ( iConfig.
exists(
"l1ExtraNoIsoEG" ) ) {
107 if ( iConfig.
exists(
"l1ExtraIsoEG" ) ) {
115 if ( iConfig.
exists(
"l1ExtraCenJet" ) ) {
123 if ( iConfig.
exists(
"l1ExtraForJet" ) ) {
131 if ( iConfig.
exists(
"l1ExtraTauJet" ) ) {
139 if ( iConfig.
exists(
"l1ExtraETM" ) ) {
147 if ( iConfig.
exists(
"l1ExtraHTM" ) ) {
164 if ( iConfig.
exists(
"hltPrescaleTable" ) ) {
174 callWhenNewProductsRegistered( [
this, &iConfig ](
BranchDescription const& bd ) {
187 if ( iConfig.
exists(
"hltPrescaleTable" ) ) {
195 produces< TriggerAlgorithmCollection >();
196 produces< TriggerConditionCollection >();
197 produces< TriggerPathCollection >();
198 produces< TriggerFilterCollection >();
199 produces< TriggerObjectCollection >();
202 produces< PackedTriggerPrescales >();
203 produces< PackedTriggerPrescales >(
"l1max");
204 produces< PackedTriggerPrescales >(
"l1min");
206 produces< TriggerObjectStandAloneCollection >();
229 if ( processHistory.getConfigurationForProcess( iHist->processName(), processConfiguration ) &&
239 LogError(
"autoProcessName" ) <<
"trigger::TriggerEvent product with label '" <<
tagTriggerEvent_.
label() <<
"' not produced according to process history of input data\n" 240 <<
"No trigger information produced";
243 LogInfo(
"autoProcessName" ) <<
"HLT process name' " <<
nameProcess_ <<
"' used for PAT trigger information";
267 bool changed(
true );
269 LogError(
"hltConfig" ) <<
"HLT config extraction error with process name '" <<
nameProcess_ <<
"'";
270 }
else if ( hltConfig.size() <= 0 ) {
271 LogError(
"hltConfig" ) <<
"HLT config size error";
285 if ( handleHltPrescaleTable.
isValid() ) {
308 if ( handleHltPrescaleTable.
isValid() ) {
323 auto triggerObjects = std::make_unique<TriggerObjectCollection>();
324 auto triggerObjectsStandAlone = std::make_unique<TriggerObjectStandAloneCollection>();
325 std::unique_ptr<PackedTriggerPrescales> packedPrescales, packedPrescalesL1min, packedPrescalesL1max;
337 if( ! handleTriggerResults.
isValid() ) {
339 <<
"No HLT information produced";
341 }
else if ( ! handleTriggerEvent.
isValid() ) {
343 <<
"No HLT information produced";
359 if ( handleHltPrescaleTable.
isValid() ) {
364 if ( hltPrescaleTable.size() == 0 ) {
367 <<
"Using default from event setup";
372 LogDebug(
"hltPrescaleTable" ) <<
"HLT prescale table found in event setup";
374 LogWarning(
"hltPrescaleSet" ) <<
"HLTPrescaleTable from event setup has error";
378 unsigned set( hltPrescaleTable.set() );
379 if ( hltPrescaleTable.size() > 0 ) {
381 bool foundPrescaleLabel(
false );
382 for (
unsigned iLabel = 0; iLabel < hltPrescaleTable.labels().size(); ++iLabel ) {
385 foundPrescaleLabel =
true;
389 if ( ! foundPrescaleLabel ) {
396 LogError(
"hltPrescaleTable" ) <<
"No HLT prescale table found\n" 397 <<
"Using default empty table with all prescales 1";
401 const unsigned sizePaths( hltConfig.
size() );
402 const unsigned sizeFilters( handleTriggerEvent->
sizeFilters() );
403 const unsigned sizeObjects( handleTriggerEvent->
sizeObjects() );
405 std::map< std::string, int > moduleStates;
408 auto triggerPaths = std::make_unique<TriggerPathCollection>();
410 const std::vector<std::string> & pathNames = hltConfig.
triggerNames();
411 for (
size_t indexPath = 0; indexPath < sizePaths; ++indexPath ) {
412 const std::string & namePath = pathNames.at( indexPath );
413 unsigned indexLastFilterPathModules( handleTriggerResults->
index( indexPath ) + 1 );
414 while ( indexLastFilterPathModules > 0 ) {
415 --indexLastFilterPathModules;
416 const std::string & labelLastFilterPathModules( hltConfig.
moduleLabel( indexPath, indexLastFilterPathModules ) );
418 if ( indexLastFilterFilters < sizeFilters ) {
419 if ( hltConfig.
moduleType( labelLastFilterPathModules ) ==
"HLTBool" )
continue;
423 TriggerPath triggerPath( namePath, indexPath, hltConfig.
prescaleValue(
set, namePath ), handleTriggerResults->
wasrun( indexPath ), handleTriggerResults->
accept( indexPath ), handleTriggerResults->
error( indexPath ), indexLastFilterPathModules, hltConfig.
saveTagsModules( namePath ).size() );
425 const unsigned sizeModulesPath( hltConfig.
size( indexPath ) );
426 assert( indexLastFilterPathModules < sizeModulesPath );
427 std::map< unsigned, std::string > indicesModules;
428 for (
size_t iM = 0; iM < sizeModulesPath; ++iM ) {
431 triggerPath.addModule( nameModule );
434 if ( indexFilter < sizeFilters ) {
435 triggerPath.addFilterIndex( indexFilter );
437 const unsigned slotModule( hltConfig.
moduleIndex( indexPath, nameModule ) );
438 indicesModules.insert( std::pair< unsigned, std::string >( slotModule, nameModule ) );
442 for ( L1SeedCollection::const_iterator iSeed = l1Seeds.begin(); iSeed != l1Seeds.end(); ++iSeed ) {
443 triggerPath.addL1Seed( *iSeed );
448 for ( std::map< unsigned, std::string >::const_iterator iM = indicesModules.begin(); iM != indicesModules.end(); ++iM ) {
449 if ( iM->first < indexLastFilterPathModules ) {
450 moduleStates[ iM->second ] = 1;
451 }
else if ( iM->first == indexLastFilterPathModules ) {
452 moduleStates[ iM->second ] = handleTriggerResults->
accept( indexPath );
453 }
else if ( moduleStates.find( iM->second ) == moduleStates.end() ) {
454 moduleStates[ iM->second ] = -1;
465 std::multimap< trigger::size_type, int > objectTypes;
466 std::multimap< trigger::size_type, std::string > filterLabels;
468 for (
size_t iF = 0; iF < sizeFilters; ++iF ) {
472 assert( types.size() == keys.size() );
473 for (
size_t iK = 0; iK < keys.size(); ++iK ) {
474 filterLabels.insert( std::pair< trigger::size_type, std::string >( keys[ iK ], nameFilter ) );
475 objectTypes.insert( std::pair< trigger::size_type, int >( keys[ iK ], types[ iK ] ) );
482 triggerObjectsStandAlone->reserve( sizeObjects );
485 std::map< trigger::size_type, trigger::size_type > newObjectKeys;
486 for (
size_t iO = 0, iC = 0, nC = handleTriggerEvent->
sizeCollections(); iO < sizeObjects && iC < nC; ++iO ) {
490 while ( iO >= collectionKeys[ iC ] ) ++iC;
493 typedef std::multimap< trigger::size_type, int >::const_iterator it_type;
494 for (std::pair<it_type,it_type> trange = objectTypes.equal_range(iO);
495 trange.first != trange.second; ++trange.first) {
496 triggerObject.addTriggerObjectType( trange.first->second );
502 bool excluded(
false );
510 if ( excluded )
continue;
511 typedef std::multimap< trigger::size_type, std::string >::const_iterator it_fl;
512 for (std::pair<it_fl,it_fl> frange = filterLabels.equal_range(iO); frange.first != frange.second; ++frange.first) {
515 for (std::vector<ModuleLabelToPathAndFlags::PathAndFlags>::const_iterator iP = paths.begin(); iP != paths.end(); ++iP) {
516 bool pathFired = handleTriggerResults->
wasrun( iP->pathIndex ) && handleTriggerResults->
accept( iP->pathIndex );
517 triggerObjectStandAlone.
addPathName( iP->pathName, pathFired && iP->lastFilter, pathFired && iP->l3Filter );
521 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
530 auto triggerFilters = std::make_unique<TriggerFilterCollection>();
531 triggerFilters->reserve( sizeFilters );
532 for (
size_t iF = 0; iF < sizeFilters; ++iF ) {
539 triggerFilter.
setType( typeFilter );
542 for (
size_t iK = 0; iK < keys.size(); ++iK ) {
544 if ( newObjectKeys.find( keys.at( iK ) ) != newObjectKeys.end() ) {
545 if ( newObjectKeys[ keys.at( iK ) ] == sizeObjects )
continue;
546 triggerFilter.
addObjectKey( newObjectKeys[ keys.at( iK ) ] );
549 LogWarning(
"triggerObjectKey" ) <<
"TriggerFilter '" << nameFilter <<
"' requests non-existing TriggerObject key " << keys.at( iK ) <<
"\n" 550 <<
"Skipping object assignment";
554 std::map< std::string, int >::iterator iS( moduleStates.find( nameFilter ) );
555 if ( iS != moduleStates.end() ) {
556 if ( ! triggerFilter.
setStatus( iS->second ) ) {
563 triggerFilters->push_back( triggerFilter );
575 for (
unsigned int i = 0,
n = names.
size();
i <
n; ++
i) {
578 if (pvdet.first.empty()) {
579 packedPrescalesL1max->addPrescaledTrigger(
i, 1);
580 packedPrescalesL1min->addPrescaledTrigger(
i, 1);
582 int pmin = -1, pmax = -1;
583 for (
const auto &
p : pvdet.first) {
585 if (
p.second > 0 && (pmin == -1 || pmin >
p.second)) pmin =
p.second;
587 packedPrescalesL1max->addPrescaledTrigger(
i, pmax);
588 packedPrescalesL1min->addPrescaledTrigger(
i, pmin);
591 packedPrescales->addPrescaledTrigger(
i, pvdet.second);
605 std::map< L1GtObject, std::vector< unsigned > > l1ObjectTypeMap;
609 if ( handleL1ExtraMu.
isValid() ) {
610 std::vector< unsigned > muKeys;
611 for (
size_t l1Mu = 0; l1Mu < handleL1ExtraMu->size(); ++l1Mu ) {
612 if (
mainBxOnly_ && handleL1ExtraMu->at( l1Mu ).bx() != 0 )
continue;
618 const reco::LeafCandidate leafCandidate( *( handleL1ExtraMu->at( l1Mu ).reco::LeafCandidate::clone() ) );
625 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
626 if ( handleL1ExtraMu->at( l1Mu ).bx() == 0 ) muKeys.push_back( triggerObjectsStandAlone->size() - 1 );
628 l1ObjectTypeMap.insert( std::make_pair(
Mu, muKeys ) );
629 }
else LogError(
"l1ExtraValid" ) <<
"l1extra::L1MuonParticleCollection product with InputTag '" <<
tagL1ExtraMu_.
encode() <<
"' not in event";
634 if ( handleL1ExtraNoIsoEG.
isValid() ) {
635 std::vector< unsigned > noIsoEGKeys;
636 for (
size_t l1NoIsoEG = 0; l1NoIsoEG < handleL1ExtraNoIsoEG->size(); ++l1NoIsoEG ) {
637 if (
mainBxOnly_ && handleL1ExtraNoIsoEG->at( l1NoIsoEG ).bx() != 0 )
continue;
643 const reco::LeafCandidate leafCandidate( *( handleL1ExtraNoIsoEG->at( l1NoIsoEG ).reco::LeafCandidate::clone() ) );
650 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
651 if ( handleL1ExtraNoIsoEG->at( l1NoIsoEG ).bx() == 0 ) noIsoEGKeys.push_back( triggerObjectsStandAlone->size() - 1 );
653 l1ObjectTypeMap.insert( std::make_pair(
NoIsoEG, noIsoEGKeys ) );
659 if ( handleL1ExtraIsoEG.
isValid() ) {
660 std::vector< unsigned > isoEGKeys;
661 for (
size_t l1IsoEG = 0; l1IsoEG < handleL1ExtraIsoEG->size(); ++l1IsoEG ) {
662 if (
mainBxOnly_ && handleL1ExtraIsoEG->at( l1IsoEG ).bx() != 0 )
continue;
668 const reco::LeafCandidate leafCandidate( *( handleL1ExtraIsoEG->at( l1IsoEG ).reco::LeafCandidate::clone() ) );
675 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
676 if ( handleL1ExtraIsoEG->at( l1IsoEG ).bx() == 0 ) isoEGKeys.push_back( triggerObjectsStandAlone->size() - 1 );
678 l1ObjectTypeMap.insert( std::make_pair(
IsoEG, isoEGKeys ) );
684 if ( handleL1ExtraCenJet.
isValid() ) {
685 std::vector< unsigned > cenJetKeys;
686 for (
size_t l1CenJet = 0; l1CenJet < handleL1ExtraCenJet->size(); ++l1CenJet ) {
687 if (
mainBxOnly_ && handleL1ExtraCenJet->at( l1CenJet ).bx() != 0 )
continue;
693 const reco::LeafCandidate leafCandidate( *( handleL1ExtraCenJet->at( l1CenJet ).reco::LeafCandidate::clone() ) );
700 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
701 if ( handleL1ExtraCenJet->at( l1CenJet ).bx() == 0 ) cenJetKeys.push_back( triggerObjectsStandAlone->size() - 1 );
703 l1ObjectTypeMap.insert( std::make_pair(
CenJet, cenJetKeys ) );
709 if ( handleL1ExtraForJet.
isValid() ) {
710 std::vector< unsigned > forJetKeys;
711 for (
size_t l1ForJet = 0; l1ForJet < handleL1ExtraForJet->size(); ++l1ForJet ) {
712 if (
mainBxOnly_ && handleL1ExtraForJet->at( l1ForJet ).bx() != 0 )
continue;
718 const reco::LeafCandidate leafCandidate( *( handleL1ExtraForJet->at( l1ForJet ).reco::LeafCandidate::clone() ) );
725 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
726 if ( handleL1ExtraForJet->at( l1ForJet ).bx() == 0 ) forJetKeys.push_back( triggerObjectsStandAlone->size() - 1 );
728 l1ObjectTypeMap.insert( std::make_pair(
ForJet, forJetKeys ) );
734 if ( handleL1ExtraTauJet.
isValid() ) {
735 std::vector< unsigned > tauJetKeys;
736 for (
size_t l1TauJet = 0; l1TauJet < handleL1ExtraTauJet->size(); ++l1TauJet ) {
737 if (
mainBxOnly_ && handleL1ExtraTauJet->at( l1TauJet ).bx() != 0 )
continue;
743 const reco::LeafCandidate leafCandidate( *( handleL1ExtraTauJet->at( l1TauJet ).reco::LeafCandidate::clone() ) );
750 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
751 if ( handleL1ExtraTauJet->at( l1TauJet ).bx() == 0 ) tauJetKeys.push_back( triggerObjectsStandAlone->size() - 1 );
753 l1ObjectTypeMap.insert( std::make_pair(
TauJet, tauJetKeys ) );
759 if ( handleL1ExtraETM.
isValid() ) {
760 std::vector< unsigned > etmKeys;
761 for (
size_t l1ETM = 0; l1ETM < handleL1ExtraETM->size(); ++l1ETM ) {
762 if (
mainBxOnly_ && handleL1ExtraETM->at( l1ETM ).bx() != 0 )
continue;
768 const reco::LeafCandidate leafCandidate( *( handleL1ExtraETM->at( l1ETM ).reco::LeafCandidate::clone() ) );
775 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
776 if ( handleL1ExtraETM->at( l1ETM ).bx() == 0 ) etmKeys.push_back( triggerObjectsStandAlone->size() - 1 );
778 l1ObjectTypeMap.insert( std::make_pair(
ETM, etmKeys ) );
779 }
else LogError(
"l1ExtraValid" ) <<
"l1extra::L1EtMissParticleCollection product with InputTag '" <<
tagL1ExtraETM_.
encode() <<
"' not in event";
784 if ( handleL1ExtraHTM.
isValid() ) {
785 std::vector< unsigned > htmKeys;
786 for (
size_t l1HTM = 0; l1HTM < handleL1ExtraHTM->size(); ++l1HTM ) {
787 if (
mainBxOnly_ && handleL1ExtraHTM->at( l1HTM ).bx() != 0 )
continue;
793 const reco::LeafCandidate leafCandidate( *( handleL1ExtraHTM->at( l1HTM ).reco::LeafCandidate::clone() ) );
800 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
801 if ( handleL1ExtraHTM->at( l1HTM ).bx() == 0 ) htmKeys.push_back( triggerObjectsStandAlone->size() - 1 );
803 l1ObjectTypeMap.insert( std::make_pair(
HTM, htmKeys ) );
804 }
else LogError(
"l1ExtraValid" ) <<
"l1extra::L1EtMissParticleCollection product with InputTag '" <<
tagL1ExtraHTM_.
encode() <<
"' not in event";
812 auto triggerAlgos = std::make_unique<TriggerAlgorithmCollection>();
816 std::map< L1GtObject, trigger::TriggerObjectType > mapObjectTypes;
829 auto const & l1GtAlgorithms = handleL1GtTriggerMenu->
gtAlgorithmMap();
831 auto const & l1GtConditionsVector = handleL1GtTriggerMenu->
gtConditionMap();
834 for (
size_t iCv = 0; iCv < l1GtConditionsVector.size(); ++iCv ) {
835 l1GtConditions.insert( l1GtConditionsVector.at( iCv ).begin(), l1GtConditionsVector.at( iCv ).end() );
837 triggerAlgos->reserve( l1GtAlgorithms.size() + l1GtTechTriggers.size() );
840 if( ! handleL1GlobalTriggerObjectMaps.
isValid() ) {
842 <<
"No L1 objects and GTL results available for physics algorithms";
848 LogError(
"l1ObjectMap" ) <<
"ParameterSet registry not available\n" 849 <<
"Skipping conditions for all L1 physics algorithm names in this run";
853 LogInfo(
"l1ObjectMap" ) <<
"ParameterSet registry not available\n" 854 <<
"Skipping conditions for all L1 physics algorithm names in this event";
858 for (
CItAlgo iAlgo = l1GtAlgorithms.begin(); iAlgo != l1GtAlgorithms.end(); ++iAlgo ) {
868 LogError(
"l1Algo" ) <<
"L1 physics algorithm '" <<
algoName <<
"' not found in the L1 menu\n" 873 LogError(
"l1Algo" ) <<
"L1 physics algorithm '" <<
algoName <<
"' does not have category 'AlgorithmTrigger' from 'L1GtUtils'\n" 877 bool decisionBeforeMask;
878 bool decisionAfterMask;
881 int error( l1GtUtils.
l1Results( iEvent,
algoName, decisionBeforeMask, decisionAfterMask, prescale, mask ) );
883 LogError(
"l1Algo" ) <<
"L1 physics algorithm '" <<
algoName <<
"' decision has error code " <<
error <<
" from 'L1GtUtils'\n" 890 if( ! handleL1GlobalTriggerObjectMaps.
isValid() ) {
891 triggerAlgos->push_back( triggerAlgo );
895 LogError(
"l1ObjectMap" ) <<
"L1 physics algorithm '" <<
algoName <<
"' is missing in L1GlobalTriggerObjectMaps\n" 896 <<
"Skipping conditions and GTL result";
897 triggerAlgos->push_back( triggerAlgo );
900 bool algorithmResult = handleL1GlobalTriggerObjectMaps->
algorithmResult(bit);
902 if ( ( algorithmResult != decisionBeforeMask ) && ( decisionBeforeMask ==
true ) ) {
903 LogInfo(
"l1ObjectMap" ) <<
"L1 physics algorithm '" <<
algoName <<
"' with different decisions in\n" 904 <<
"L1GlobalTriggerObjectMaps (GTL result) : " << algorithmResult <<
"\n" 905 <<
"L1GlobalTriggerReadoutRecord (decision before mask): " << decisionBeforeMask;
911 triggerAlgos->push_back( triggerAlgo );
916 LogError(
"l1ObjectMap" ) <<
"L1 physics algorithm name '" <<
algoName <<
"' not available in ParameterSet registry\n" 917 <<
"Skipping conditions for this algorithm in this run";
919 LogInfo(
"l1ObjectMap" ) <<
"L1 physics algorithm name '" <<
algoName <<
"' not available in ParameterSet registry\n" 920 <<
"Skipping conditions for this algorithm in this event";
922 triggerAlgos->push_back( triggerAlgo );
927 for (
unsigned iT = 0; iT < conditionNames.size(); ++iT ) {
928 size_t key( triggerConditions->size() );
929 for (
size_t iC = 0; iC < triggerConditions->size(); ++iC ) {
930 if ( conditionNames.at(iT) == triggerConditions->at( iC ).name() ) {
935 if (
key == triggerConditions->size() ) {
937 LogError(
"l1CondMap" ) <<
"More condition names from ParameterSet registry than the " << conditions.
nConditions() <<
" conditions in L1GlobalTriggerObjectMaps\n" 938 <<
"Skipping condition " << conditionNames.at(iT) <<
" in algorithm " <<
algoName;
942 if ( l1GtConditions.find( triggerCond.name() ) != l1GtConditions.end() ) {
943 triggerCond.
setCategory( l1GtConditions[ triggerCond.name() ]->condCategory() );
944 triggerCond.setType( l1GtConditions[ triggerCond.name() ]->condType() );
945 const std::vector< L1GtObject > l1ObjectTypes( l1GtConditions[ triggerCond.name() ]->objectType() );
946 for (
size_t iType = 0 ; iType < l1ObjectTypes.size(); ++iType ) {
947 triggerCond.addTriggerObjectType( mapObjectTypes[ l1ObjectTypes.at( iType ) ] );
951 for (
size_t iVV = 0; iVV < combinations.
nCombinations(); ++iVV ) {
955 if ( iV >= l1ObjectTypes.size() ) {
956 LogError(
"l1CondMap" ) <<
"Index " << iV <<
" in combinations vector overshoots size " << l1ObjectTypes.size() <<
" of types vector in conditions map\n" 957 <<
"Skipping object key in condition " << triggerCond.name();
958 }
else if ( l1ObjectTypeMap.find( l1ObjectTypes.at( iV ) ) != l1ObjectTypeMap.end() ) {
959 if ( objectIndex >= l1ObjectTypeMap[ l1ObjectTypes.at( iV ) ].size() ) {
960 LogError(
"l1CondMap" ) <<
"Index " << objectIndex <<
" in combination overshoots number " << l1ObjectTypeMap[ l1ObjectTypes.at( iV ) ].size() <<
"of according trigger objects\n" 961 <<
"Skipping object key in condition " << triggerCond.name();
963 const unsigned objectKey( l1ObjectTypeMap[ l1ObjectTypes.at( iV ) ].at( objectIndex ) );
964 triggerCond.addObjectKey( objectKey );
966 triggerObjectsStandAlone->at( objectKey ).addAlgorithmName( triggerAlgo.
name(), ( triggerAlgo.
decision() && triggerCond.wasAccept() ) );
967 triggerObjectsStandAlone->at( objectKey ).addConditionName( triggerCond.name() );
972 LogWarning(
"l1CondMap" ) <<
"L1 conditions '" << triggerCond.name() <<
"' not found in the L1 menu\n" 973 <<
"Remains incomplete";
975 triggerConditions->push_back( triggerCond );
979 triggerAlgos->push_back( triggerAlgo );
982 for (
CItAlgo iAlgo = l1GtTechTriggers.begin(); iAlgo != l1GtTechTriggers.end(); ++iAlgo ) {
992 LogError(
"l1Algo" ) <<
"L1 technical trigger '" <<
algoName <<
"' not found in the L1 menu\n" 997 LogError(
"l1Algo" ) <<
"L1 technical trigger '" <<
algoName <<
"' does not have category 'TechnicalTrigger' from 'L1GtUtils'\n" 1001 bool decisionBeforeMask;
1002 bool decisionAfterMask;
1005 int error( l1GtUtils.
l1Results( iEvent,
algoName, decisionBeforeMask, decisionAfterMask, prescale, mask ) );
1007 LogError(
"l1Algo" ) <<
"L1 technical trigger '" <<
algoName <<
"' decision has error code " <<
error <<
" from 'L1GtUtils'\n" 1013 triggerAlgos->push_back( triggerAlgo );
1031 if(
packLabels_)
obj.packFilterLabels(iEvent,*handleTriggerResults);
1043 const std::vector<std::string> & pathNames = hltConfig.
triggerNames();
1044 unsigned int sizePaths = pathNames.size();
1045 for (
unsigned int indexPath = 0; indexPath < sizePaths; ++indexPath ) {
1046 const std::string & namePath = pathNames[indexPath];
1048 const std::vector<std::string> & nameModules = hltConfig.
moduleLabels(indexPath);
1049 unsigned int sizeModulesPath = nameModules.size();
1050 bool lastFilter =
true;
1051 unsigned int iM = sizeModulesPath;
1053 const std::string & nameFilter = nameModules[--iM];
1054 if (hltConfig.
moduleEDMType(nameFilter) !=
"EDFilter")
continue;
1055 if (hltConfig.
moduleType(nameFilter) ==
"HLTBool")
continue;
1056 bool saveTags = hltConfig.
saveTags(nameFilter);
1057 insert( nameFilter, namePath, indexPath, lastFilter, saveTags );
1058 if (saveTags) lastFilter =
false;
unsigned int set() const
low-level const accessors for data members
unsigned int size() const
number of trigger paths in trigger table
const std::string & collectionTagEncoded(trigger::size_type index) const
collection_type::const_iterator const_iterator
T getParameter(std::string const &) const
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > l1ExtraMuGetter_
edm::GetterOfProducts< trigger::HLTPrescaleTable > hltPrescaleTableEventGetter_
bool getByLabel(std::string const &label, Handle< PROD > &result) const
unsigned char getObjectIndex(unsigned combination, unsigned object) const
bool wasrun() const
Was at least one path run?
bool saveTags(const std::string &module) const
Is module an L3 filter (ie, tracked saveTags=true)
std::pair< std::vector< std::pair< std::string, int > >, int > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Analysis-level L1 trigger algorithm class.
void beginLuminosityBlock(const edm::LuminosityBlock &iLuminosityBlock, const edm::EventSetup &iSetup) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::InputTag tagL1ExtraForJet_
const std::string moduleType(const std::string &module) const
C++ class name of module.
bool autoProcessNameL1ExtraHTM_
trigger::size_type sizeFilters() const
bool autoProcessNameL1ExtraIsoEG_
static const HistoName names[]
edm::InputTag tagTriggerEvent_
PATTriggerProducer(const edm::ParameterSet &iConfig)
bool setStatus(int status)
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
bool autoProcessNameL1ExtraTauJet_
#define DEFINE_FWK_MODULE(type)
edm::InputTag tagTriggerResults_
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
static const unsigned int NumberTechnicalTriggers
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() const
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const Keys & filterKeys(trigger::size_type index) const
The single EDProduct containing the HLT Prescale Table.
void setGtlResult(bool gtlResult)
Set L1 algorithm GTL result.
edm::GetterOfProducts< trigger::TriggerEvent > triggerEventGetter_
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
unsigned short nObjectsPerCombination() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
edm::InputTag tagL1ExtraETM_
std::string const & processName() const
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type identifier.
std::string hltPrescaleLabel_
Strings::size_type size() const
void consistencyCheck() const
void addObjectKey(unsigned objectKey)
Add a new trigger object collection index.
edm::GetterOfProducts< trigger::HLTPrescaleTable > hltPrescaleTableLumiGetter_
bool getByLabel(std::string const &label, Handle< PROD > &result) const
const std::map< std::string, std::vector< unsigned int > > & prescaleTable() const
bool hasCollection(const std::string &collName) const override
Checks, if a certain label of original collection is assigned (method overrides)
const std::map< std::string, std::vector< unsigned int > > & table() const
bool autoProcessNameL1ExtraMu_
void addFilterLabel(const std::string &filterLabel)
Adds a new HLT filter label.
bool autoProcessNameL1ExtraCenJet_
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraForJetGetter_
bool algorithmExists(int algorithmBitNumber) const
Returns true if there is an entry for this algorithm bit number.
const Keys & collectionKeys() const
const std::vector< std::string > & saveTagsModules(unsigned int trigger) const
Single trigger physics object (e.g., an isolated muon)
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
void addPathName(const std::string &pathName, bool pathLastFilterAccepted=true, bool pathL3FilterAccepted=true)
Adds a new HLT path name.
bool addPathModuleLabels_
Analysis-level HLTrigger filter class.
const Vids & filterIds(trigger::size_type index) const
Produces the full or stand-alone PAT trigger information collections.
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
ParameterSetID const & parameterSetID() const
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
edm::ParameterSetID const & namesParameterSetID() const
edm::InputTag tagL1ExtraIsoEG_
void setCollection(const std::string &collName)
Methods.
Analysis-level L1 trigger condition class.
Analysis-level HLTrigger path class.
static const unsigned int NumberPhysTriggersExtended
const TriggerObjectCollection & getObjects() const
const std::vector< std::string > & labels() const
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraTauJetGetter_
trigger::HLTPrescaleTable hltPrescaleTableLumi_
ProcessHistory const & processHistory() const override
const std::string & name() const
Get L1 algorithm name.
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
std::string filterLabel(trigger::size_type index) const
bool error() const
Has any path encountered an error (exception)
ProcessHistory const & processHistory() const
const int l1Results(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > l1ExtraHTMGetter_
static const unsigned int NumberPhysTriggers
void setSaveTags(bool saveTags)
Set the L3 status.
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
void setLogicalExpression(const std::string &expression)
Set L1 algorithm logical expression.
edm::EDGetTokenT< L1GlobalTriggerObjectMaps > l1GlobalTriggerObjectMapsToken_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned nConditions() const
edm::GetterOfProducts< l1extra::L1EmParticleCollection > l1ExtraNoIsoEGGetter_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > l1ExtraETMGetter_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
edm::GetterOfProducts< trigger::HLTPrescaleTable > hltPrescaleTableRunGetter_
edm::InputTag tagL1GlobalTriggerObjectMaps_
edm::InputTag tagL1ExtraMu_
const edm::InputTag filterTag(trigger::size_type index) const
ModuleLabelToPathAndFlags moduleLabelToPathAndFlags_
L1GtUtils const & l1GtUtils() const
void setCategory(L1GtConditionCategory category)
Set the condition category.
CombinationsInCondition getCombinationsInCondition(int algorithmBitNumber, unsigned conditionNumber) const
unsigned nCombinations() const
void init(const HLTConfigProvider &)
trigger::size_type sizeObjects() const
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::GetterOfProducts< l1extra::L1EmParticleCollection > l1ExtraIsoEGGetter_
bool autoProcessNameL1ExtraForJet_
trigger::size_type sizeCollections() const
other
const std::vector< std::string > & prescaleLabels() const
low-level data member access
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraCenJetGetter_
HLTConfigProvider const & hltConfigProvider() const
void addConditionKey(unsigned conditionKey)
Add a new trigger condition collection index.
void setType(const std::string &type)
Set the filter module type.
edm::GetterOfProducts< edm::TriggerResults > triggerResultsGetter_
edm::InputTag tagL1ExtraTauJet_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
unsigned int prescaleSize() const
trigger::HLTPrescaleTable hltPrescaleTableRun_
bool getConditionResult(unsigned condition) const
ConditionsInAlgorithm getConditionsInAlgorithm(int algorithmBitNumber) const
bool autoProcessNameL1ExtraETM_
std::vector< std::string > exludeCollections_
bool autoProcessNameL1ExtraNoIsoEG_
std::vector< L1Seed > L1SeedCollection
Collection of L1Seed.
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type identifier.
bool algorithmResult(int algorithmBitNumber) const
Returns whether an algorithm trigger passed or failed.
static std::string const triggerPaths
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
edm::InputTag tagL1ExtraNoIsoEG_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
edm::InputTag tagL1ExtraCenJet_
HLTPrescaleProvider hltPrescaleProvider_
Analysis-level trigger object class (stand-alone)
edm::InputTag tagL1ExtraHTM_
edm::ParameterSet * l1PSet_
std::string labelHltPrescaleTable_