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 packPrescales_( iConfig.existsAs<bool>(
"packTriggerPrescales") ? iConfig.getParameter<bool>(
"packTriggerPrescales") :
true )
90 if ( iConfig.
exists(
"l1ExtraMu" ) ) {
98 if ( iConfig.
exists(
"l1ExtraNoIsoEG" ) ) {
106 if ( iConfig.
exists(
"l1ExtraIsoEG" ) ) {
114 if ( iConfig.
exists(
"l1ExtraCenJet" ) ) {
122 if ( iConfig.
exists(
"l1ExtraForJet" ) ) {
130 if ( iConfig.
exists(
"l1ExtraTauJet" ) ) {
138 if ( iConfig.
exists(
"l1ExtraETM" ) ) {
146 if ( iConfig.
exists(
"l1ExtraHTM" ) ) {
163 if ( iConfig.
exists(
"hltPrescaleTable" ) ) {
184 if ( iConfig.
exists(
"hltPrescaleTable" ) ) {
192 produces< TriggerAlgorithmCollection >();
193 produces< TriggerConditionCollection >();
194 produces< TriggerPathCollection >();
195 produces< TriggerFilterCollection >();
196 produces< TriggerObjectCollection >();
199 produces< PackedTriggerPrescales >();
200 produces< PackedTriggerPrescales >(
"l1max");
201 produces< PackedTriggerPrescales >(
"l1min");
203 produces< TriggerObjectStandAloneCollection >();
236 LogError(
"autoProcessName" ) <<
"trigger::TriggerEvent product with label '" <<
tagTriggerEvent_.
label() <<
"' not produced according to process history of input data\n"
237 <<
"No trigger information produced";
240 LogInfo(
"autoProcessName" ) <<
"HLT process name' " <<
nameProcess_ <<
"' used for PAT trigger information";
264 bool changed(
true );
266 LogError(
"hltConfig" ) <<
"HLT config extraction error with process name '" <<
nameProcess_ <<
"'";
267 }
else if ( hltConfig.size() <= 0 ) {
268 LogError(
"hltConfig" ) <<
"HLT config size error";
282 if ( handleHltPrescaleTable.
isValid() ) {
305 if ( handleHltPrescaleTable.
isValid() ) {
322 std::auto_ptr< PackedTriggerPrescales > packedPrescales, packedPrescalesL1min, packedPrescalesL1max;
334 if( ! handleTriggerResults.
isValid() ) {
336 <<
"No HLT information produced";
338 }
else if ( ! handleTriggerEvent.
isValid() ) {
340 <<
"No HLT information produced";
356 if ( handleHltPrescaleTable.
isValid() ) {
357 hltPrescaleTable =
trigger::HLTPrescaleTable( handleHltPrescaleTable->set(), handleHltPrescaleTable->labels(), handleHltPrescaleTable->table() );
361 if ( hltPrescaleTable.size() == 0 ) {
364 <<
"Using default from event setup";
369 LogDebug(
"hltPrescaleTable" ) <<
"HLT prescale table found in event setup";
371 LogWarning(
"hltPrescaleSet" ) <<
"HLTPrescaleTable from event setup has error";
375 unsigned set( hltPrescaleTable.set() );
376 if ( hltPrescaleTable.size() > 0 ) {
378 bool foundPrescaleLabel(
false );
379 for (
unsigned iLabel = 0; iLabel < hltPrescaleTable.labels().size(); ++iLabel ) {
382 foundPrescaleLabel =
true;
386 if ( ! foundPrescaleLabel ) {
393 LogError(
"hltPrescaleTable" ) <<
"No HLT prescale table found\n"
394 <<
"Using default empty table with all prescales 1";
398 const unsigned sizePaths( hltConfig.
size() );
399 const unsigned sizeFilters( handleTriggerEvent->sizeFilters() );
400 const unsigned sizeObjects( handleTriggerEvent->sizeObjects() );
402 std::map< std::string, int > moduleStates;
406 triggerPaths->reserve( sizePaths );
407 const std::vector<std::string> & pathNames = hltConfig.
triggerNames();
408 for (
size_t indexPath = 0; indexPath < sizePaths; ++indexPath ) {
409 const std::string & namePath = pathNames.at( indexPath );
410 unsigned indexLastFilterPathModules( handleTriggerResults->index( indexPath ) + 1 );
411 unsigned indexLastFilterFilters( sizeFilters );
412 while ( indexLastFilterPathModules > 0 ) {
413 --indexLastFilterPathModules;
414 const std::string & labelLastFilterPathModules( hltConfig.
moduleLabel( indexPath, indexLastFilterPathModules ) );
415 indexLastFilterFilters = handleTriggerEvent->filterIndex(
InputTag( labelLastFilterPathModules,
"",
nameProcess_ ) );
416 if ( indexLastFilterFilters < sizeFilters ) {
417 if ( hltConfig.
moduleType( labelLastFilterPathModules ) ==
"HLTBool" )
continue;
421 TriggerPath triggerPath( namePath, indexPath, hltConfig.
prescaleValue( set, namePath ), handleTriggerResults->wasrun( indexPath ), handleTriggerResults->accept( indexPath ), handleTriggerResults->error( indexPath ), indexLastFilterPathModules, hltConfig.
saveTagsModules( namePath ).size() );
423 const unsigned sizeModulesPath( hltConfig.
size( indexPath ) );
424 assert( indexLastFilterPathModules < sizeModulesPath );
425 std::map< unsigned, std::string > indicesModules;
426 for (
size_t iM = 0; iM < sizeModulesPath; ++iM ) {
429 triggerPath.addModule( nameModule );
431 const unsigned indexFilter( handleTriggerEvent->filterIndex(
InputTag( nameModule,
"",
nameProcess_ ) ) );
432 if ( indexFilter < sizeFilters ) {
433 triggerPath.addFilterIndex( indexFilter );
435 const unsigned slotModule( hltConfig.
moduleIndex( indexPath, nameModule ) );
436 indicesModules.insert( std::pair< unsigned, std::string >( slotModule, nameModule ) );
440 for ( L1SeedCollection::const_iterator iSeed = l1Seeds.begin(); iSeed != l1Seeds.end(); ++iSeed ) {
441 triggerPath.addL1Seed( *iSeed );
444 triggerPaths->push_back( triggerPath );
446 for ( std::map< unsigned, std::string >::const_iterator iM = indicesModules.begin(); iM != indicesModules.end(); ++iM ) {
447 if ( iM->first < indexLastFilterPathModules ) {
448 moduleStates[ iM->second ] = 1;
449 }
else if ( iM->first == indexLastFilterPathModules ) {
450 moduleStates[ iM->second ] = handleTriggerResults->accept( indexPath );
451 }
else if ( moduleStates.find( iM->second ) == moduleStates.end() ) {
452 moduleStates[ iM->second ] = -1;
457 iEvent.
put( triggerPaths );
463 std::multimap< trigger::size_type, int > objectTypes;
464 std::multimap< trigger::size_type, std::string > filterLabels;
466 for (
size_t iF = 0; iF < sizeFilters; ++iF ) {
467 const std::string nameFilter( handleTriggerEvent->filterLabel( iF ) );
469 const trigger::Vids & types = handleTriggerEvent->filterIds( iF );
470 assert( types.size() == keys.size() );
471 for (
size_t iK = 0; iK < keys.size(); ++iK ) {
472 filterLabels.insert( std::pair< trigger::size_type, std::string >( keys[ iK ], nameFilter ) );
473 objectTypes.insert( std::pair< trigger::size_type, int >( keys[ iK ], types[ iK ] ) );
480 triggerObjectsStandAlone->reserve( sizeObjects );
482 const trigger::Keys & collectionKeys( handleTriggerEvent->collectionKeys() );
483 std::map< trigger::size_type, trigger::size_type > newObjectKeys;
484 for (
size_t iO = 0, iC = 0, nC = handleTriggerEvent->sizeCollections(); iO < sizeObjects && iC < nC; ++iO ) {
488 while ( iO >= collectionKeys[ iC ] ) ++iC;
489 triggerObject.
setCollection( handleTriggerEvent->collectionTagEncoded( iC ) );
491 typedef std::multimap< trigger::size_type, int >::const_iterator it_type;
492 for (std::pair<it_type,it_type> trange = objectTypes.equal_range(iO);
493 trange.first != trange.second; ++trange.first) {
494 triggerObject.addTriggerObjectType( trange.first->second );
500 bool excluded(
false );
508 if ( excluded )
continue;
509 typedef std::multimap< trigger::size_type, std::string >::const_iterator it_fl;
510 for (std::pair<it_fl,it_fl> frange = filterLabels.equal_range(iO); frange.first != frange.second; ++frange.first) {
513 for (std::vector<ModuleLabelToPathAndFlags::PathAndFlags>::const_iterator iP = paths.begin(); iP != paths.end(); ++iP) {
514 bool pathFired = handleTriggerResults->wasrun( iP->pathIndex ) && handleTriggerResults->accept( iP->pathIndex );
515 triggerObjectStandAlone.
addPathName( iP->pathName, pathFired && iP->lastFilter, pathFired && iP->l3Filter );
519 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
521 triggerObjects->push_back( triggerObject );
529 triggerFilters->reserve( sizeFilters );
530 for (
size_t iF = 0; iF < sizeFilters; ++iF ) {
531 const std::string nameFilter( handleTriggerEvent->filterTag( iF ).label() );
533 const trigger::Vids & types = handleTriggerEvent->filterIds( iF );
537 triggerFilter.
setType( typeFilter );
540 for (
size_t iK = 0; iK < keys.size(); ++iK ) {
542 if ( newObjectKeys.find( keys.at( iK ) ) != newObjectKeys.end() ) {
543 if ( newObjectKeys[ keys.at( iK ) ] == sizeObjects )
continue;
544 triggerFilter.
addObjectKey( newObjectKeys[ keys.at( iK ) ] );
547 LogWarning(
"triggerObjectKey" ) <<
"TriggerFilter '" << nameFilter <<
"' requests non-existing TriggerObject key " << keys.at( iK ) <<
"\n"
548 <<
"Skipping object assignment";
552 std::map< std::string, int >::iterator iS( moduleStates.find( nameFilter ) );
553 if ( iS != moduleStates.end() ) {
554 if ( ! triggerFilter.
setStatus( iS->second ) ) {
561 triggerFilters->push_back( triggerFilter );
564 iEvent.
put( triggerFilters );
573 for (
unsigned int i = 0,
n = names.
size();
i <
n; ++
i) {
576 if (pvdet.first.empty()) {
577 packedPrescalesL1max->addPrescaledTrigger(
i, 1);
578 packedPrescalesL1min->addPrescaledTrigger(
i, 1);
580 int pmin = -1, pmax = -1;
581 for (
const auto &
p : pvdet.first) {
583 if (
p.second > 0 && (pmin == -1 || pmin >
p.second)) pmin =
p.second;
585 packedPrescalesL1max->addPrescaledTrigger(
i, pmax);
586 packedPrescalesL1min->addPrescaledTrigger(
i, pmin);
589 packedPrescales->addPrescaledTrigger(
i, pvdet.second);
592 iEvent.
put( packedPrescales );
593 iEvent.
put( packedPrescalesL1max,
"l1max" );
594 iEvent.
put( packedPrescalesL1min,
"l1min" );
603 std::map< L1GtObject, std::vector< unsigned > > l1ObjectTypeMap;
607 if ( handleL1ExtraMu.
isValid() ) {
608 std::vector< unsigned > muKeys;
609 for (
size_t l1Mu = 0; l1Mu < handleL1ExtraMu->size(); ++l1Mu ) {
610 if (
mainBxOnly_ && handleL1ExtraMu->at( l1Mu ).bx() != 0 )
continue;
616 const reco::LeafCandidate leafCandidate( *( handleL1ExtraMu->at( l1Mu ).reco::LeafCandidate::clone() ) );
623 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
624 if ( handleL1ExtraMu->at( l1Mu ).bx() == 0 ) muKeys.push_back( triggerObjectsStandAlone->size() - 1 );
626 l1ObjectTypeMap.insert( std::make_pair(
Mu, muKeys ) );
627 }
else LogError(
"l1ExtraValid" ) <<
"l1extra::L1MuonParticleCollection product with InputTag '" <<
tagL1ExtraMu_.
encode() <<
"' not in event";
632 if ( handleL1ExtraNoIsoEG.
isValid() ) {
633 std::vector< unsigned > noIsoEGKeys;
634 for (
size_t l1NoIsoEG = 0; l1NoIsoEG < handleL1ExtraNoIsoEG->size(); ++l1NoIsoEG ) {
635 if (
mainBxOnly_ && handleL1ExtraNoIsoEG->at( l1NoIsoEG ).bx() != 0 )
continue;
641 const reco::LeafCandidate leafCandidate( *( handleL1ExtraNoIsoEG->at( l1NoIsoEG ).reco::LeafCandidate::clone() ) );
648 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
649 if ( handleL1ExtraNoIsoEG->at( l1NoIsoEG ).bx() == 0 ) noIsoEGKeys.push_back( triggerObjectsStandAlone->size() - 1 );
651 l1ObjectTypeMap.insert( std::make_pair(
NoIsoEG, noIsoEGKeys ) );
657 if ( handleL1ExtraIsoEG.
isValid() ) {
658 std::vector< unsigned > isoEGKeys;
659 for (
size_t l1IsoEG = 0; l1IsoEG < handleL1ExtraIsoEG->size(); ++l1IsoEG ) {
660 if (
mainBxOnly_ && handleL1ExtraIsoEG->at( l1IsoEG ).bx() != 0 )
continue;
666 const reco::LeafCandidate leafCandidate( *( handleL1ExtraIsoEG->at( l1IsoEG ).reco::LeafCandidate::clone() ) );
673 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
674 if ( handleL1ExtraIsoEG->at( l1IsoEG ).bx() == 0 ) isoEGKeys.push_back( triggerObjectsStandAlone->size() - 1 );
676 l1ObjectTypeMap.insert( std::make_pair(
IsoEG, isoEGKeys ) );
682 if ( handleL1ExtraCenJet.
isValid() ) {
683 std::vector< unsigned > cenJetKeys;
684 for (
size_t l1CenJet = 0; l1CenJet < handleL1ExtraCenJet->size(); ++l1CenJet ) {
685 if (
mainBxOnly_ && handleL1ExtraCenJet->at( l1CenJet ).bx() != 0 )
continue;
691 const reco::LeafCandidate leafCandidate( *( handleL1ExtraCenJet->at( l1CenJet ).reco::LeafCandidate::clone() ) );
698 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
699 if ( handleL1ExtraCenJet->at( l1CenJet ).bx() == 0 ) cenJetKeys.push_back( triggerObjectsStandAlone->size() - 1 );
701 l1ObjectTypeMap.insert( std::make_pair(
CenJet, cenJetKeys ) );
707 if ( handleL1ExtraForJet.
isValid() ) {
708 std::vector< unsigned > forJetKeys;
709 for (
size_t l1ForJet = 0; l1ForJet < handleL1ExtraForJet->size(); ++l1ForJet ) {
710 if (
mainBxOnly_ && handleL1ExtraForJet->at( l1ForJet ).bx() != 0 )
continue;
716 const reco::LeafCandidate leafCandidate( *( handleL1ExtraForJet->at( l1ForJet ).reco::LeafCandidate::clone() ) );
723 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
724 if ( handleL1ExtraForJet->at( l1ForJet ).bx() == 0 ) forJetKeys.push_back( triggerObjectsStandAlone->size() - 1 );
726 l1ObjectTypeMap.insert( std::make_pair(
ForJet, forJetKeys ) );
732 if ( handleL1ExtraTauJet.
isValid() ) {
733 std::vector< unsigned > tauJetKeys;
734 for (
size_t l1TauJet = 0; l1TauJet < handleL1ExtraTauJet->size(); ++l1TauJet ) {
735 if (
mainBxOnly_ && handleL1ExtraTauJet->at( l1TauJet ).bx() != 0 )
continue;
741 const reco::LeafCandidate leafCandidate( *( handleL1ExtraTauJet->at( l1TauJet ).reco::LeafCandidate::clone() ) );
748 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
749 if ( handleL1ExtraTauJet->at( l1TauJet ).bx() == 0 ) tauJetKeys.push_back( triggerObjectsStandAlone->size() - 1 );
751 l1ObjectTypeMap.insert( std::make_pair(
TauJet, tauJetKeys ) );
757 if ( handleL1ExtraETM.
isValid() ) {
758 std::vector< unsigned > etmKeys;
759 for (
size_t l1ETM = 0; l1ETM < handleL1ExtraETM->size(); ++l1ETM ) {
760 if (
mainBxOnly_ && handleL1ExtraETM->at( l1ETM ).bx() != 0 )
continue;
766 const reco::LeafCandidate leafCandidate( *( handleL1ExtraETM->at( l1ETM ).reco::LeafCandidate::clone() ) );
773 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
774 if ( handleL1ExtraETM->at( l1ETM ).bx() == 0 ) etmKeys.push_back( triggerObjectsStandAlone->size() - 1 );
776 l1ObjectTypeMap.insert( std::make_pair(
ETM, etmKeys ) );
777 }
else LogError(
"l1ExtraValid" ) <<
"l1extra::L1EtMissParticleCollection product with InputTag '" <<
tagL1ExtraETM_.
encode() <<
"' not in event";
782 if ( handleL1ExtraHTM.
isValid() ) {
783 std::vector< unsigned > htmKeys;
784 for (
size_t l1HTM = 0; l1HTM < handleL1ExtraHTM->size(); ++l1HTM ) {
785 if (
mainBxOnly_ && handleL1ExtraHTM->at( l1HTM ).bx() != 0 )
continue;
791 const reco::LeafCandidate leafCandidate( *( handleL1ExtraHTM->at( l1HTM ).reco::LeafCandidate::clone() ) );
798 triggerObjectsStandAlone->push_back( triggerObjectStandAlone );
799 if ( handleL1ExtraHTM->at( l1HTM ).bx() == 0 ) htmKeys.push_back( triggerObjectsStandAlone->size() - 1 );
801 l1ObjectTypeMap.insert( std::make_pair(
HTM, htmKeys ) );
802 }
else LogError(
"l1ExtraValid" ) <<
"l1extra::L1EtMissParticleCollection product with InputTag '" <<
tagL1ExtraHTM_.
encode() <<
"' not in event";
814 std::map< L1GtObject, trigger::TriggerObjectType > mapObjectTypes;
827 auto const & l1GtAlgorithms = handleL1GtTriggerMenu->gtAlgorithmMap();
828 auto const & l1GtTechTriggers = handleL1GtTriggerMenu->gtTechnicalTriggerMap();
829 auto const & l1GtConditionsVector = handleL1GtTriggerMenu->gtConditionMap();
832 for (
size_t iCv = 0; iCv < l1GtConditionsVector.size(); ++iCv ) {
833 l1GtConditions.insert( l1GtConditionsVector.at( iCv ).begin(), l1GtConditionsVector.at( iCv ).end() );
835 triggerAlgos->reserve( l1GtAlgorithms.size() + l1GtTechTriggers.size() );
838 if( ! handleL1GlobalTriggerObjectMaps.
isValid() ) {
840 <<
"No L1 objects and GTL results available for physics algorithms";
842 handleL1GlobalTriggerObjectMaps->consistencyCheck();
846 LogError(
"l1ObjectMap" ) <<
"ParameterSet registry not available\n"
847 <<
"Skipping conditions for all L1 physics algorithm names in this run";
851 LogInfo(
"l1ObjectMap" ) <<
"ParameterSet registry not available\n"
852 <<
"Skipping conditions for all L1 physics algorithm names in this event";
856 for (
CItAlgo iAlgo = l1GtAlgorithms.begin(); iAlgo != l1GtAlgorithms.end(); ++iAlgo ) {
857 const std::string & algoName( iAlgo->second.algoName() );
866 LogError(
"l1Algo" ) <<
"L1 physics algorithm '" << algoName <<
"' not found in the L1 menu\n"
871 LogError(
"l1Algo" ) <<
"L1 physics algorithm '" << algoName <<
"' does not have category 'AlgorithmTrigger' from 'L1GtUtils'\n"
875 bool decisionBeforeMask;
876 bool decisionAfterMask;
879 int error( l1GtUtils.
l1Results( iEvent, algoName, decisionBeforeMask, decisionAfterMask, prescale, mask ) );
881 LogError(
"l1Algo" ) <<
"L1 physics algorithm '" << algoName <<
"' decision has error code " <<
error <<
" from 'L1GtUtils'\n"
888 if( ! handleL1GlobalTriggerObjectMaps.
isValid() ) {
889 triggerAlgos->push_back( triggerAlgo );
892 if ( ! handleL1GlobalTriggerObjectMaps->algorithmExists(bit)) {
893 LogError(
"l1ObjectMap" ) <<
"L1 physics algorithm '" << algoName <<
"' is missing in L1GlobalTriggerObjectMaps\n"
894 <<
"Skipping conditions and GTL result";
895 triggerAlgos->push_back( triggerAlgo );
898 bool algorithmResult = handleL1GlobalTriggerObjectMaps->algorithmResult(bit);
900 if ( ( algorithmResult != decisionBeforeMask ) && ( decisionBeforeMask ==
true ) ) {
901 LogInfo(
"l1ObjectMap" ) <<
"L1 physics algorithm '" << algoName <<
"' with different decisions in\n"
902 <<
"L1GlobalTriggerObjectMaps (GTL result) : " << algorithmResult <<
"\n"
903 <<
"L1GlobalTriggerReadoutRecord (decision before mask): " << decisionBeforeMask;
909 triggerAlgos->push_back( triggerAlgo );
914 LogError(
"l1ObjectMap" ) <<
"L1 physics algorithm name '" << algoName <<
"' not available in ParameterSet registry\n"
915 <<
"Skipping conditions for this algorithm in this run";
917 LogInfo(
"l1ObjectMap" ) <<
"L1 physics algorithm name '" << algoName <<
"' not available in ParameterSet registry\n"
918 <<
"Skipping conditions for this algorithm in this event";
920 triggerAlgos->push_back( triggerAlgo );
923 std::vector<std::string> conditionNames(
l1PSet_->
getParameter<std::vector<std::string> >(algoName) );
925 for (
unsigned iT = 0; iT < conditionNames.size(); ++iT ) {
926 size_t key( triggerConditions->size() );
927 for (
size_t iC = 0; iC < triggerConditions->size(); ++iC ) {
928 if ( conditionNames.at(iT) == triggerConditions->at( iC ).name() ) {
933 if (
key == triggerConditions->size() ) {
935 LogError(
"l1CondMap" ) <<
"More condition names from ParameterSet registry than the " << conditions.
nConditions() <<
" conditions in L1GlobalTriggerObjectMaps\n"
936 <<
"Skipping condition " << conditionNames.at(iT) <<
" in algorithm " << algoName;
940 if ( l1GtConditions.find( triggerCond.name() ) != l1GtConditions.end() ) {
941 triggerCond.
setCategory( l1GtConditions[ triggerCond.name() ]->condCategory() );
942 triggerCond.setType( l1GtConditions[ triggerCond.name() ]->condType() );
943 const std::vector< L1GtObject > l1ObjectTypes( l1GtConditions[ triggerCond.name() ]->objectType() );
944 for (
size_t iType = 0 ; iType < l1ObjectTypes.size(); ++iType ) {
945 triggerCond.addTriggerObjectType( mapObjectTypes[ l1ObjectTypes.at( iType ) ] );
949 for (
size_t iVV = 0; iVV < combinations.
nCombinations(); ++iVV ) {
953 if ( iV >= l1ObjectTypes.size() ) {
954 LogError(
"l1CondMap" ) <<
"Index " << iV <<
" in combinations vector overshoots size " << l1ObjectTypes.size() <<
" of types vector in conditions map\n"
955 <<
"Skipping object key in condition " << triggerCond.name();
956 }
else if ( l1ObjectTypeMap.find( l1ObjectTypes.at( iV ) ) != l1ObjectTypeMap.end() ) {
957 if ( objectIndex >= l1ObjectTypeMap[ l1ObjectTypes.at( iV ) ].size() ) {
958 LogError(
"l1CondMap" ) <<
"Index " << objectIndex <<
" in combination overshoots number " << l1ObjectTypeMap[ l1ObjectTypes.at( iV ) ].size() <<
"of according trigger objects\n"
959 <<
"Skipping object key in condition " << triggerCond.name();
961 const unsigned objectKey( l1ObjectTypeMap[ l1ObjectTypes.at( iV ) ].at( objectIndex ) );
962 triggerCond.addObjectKey( objectKey );
964 triggerObjectsStandAlone->at( objectKey ).addAlgorithmName( triggerAlgo.
name(), ( triggerAlgo.
decision() && triggerCond.wasAccept() ) );
965 triggerObjectsStandAlone->at( objectKey ).addConditionName( triggerCond.name() );
970 LogWarning(
"l1CondMap" ) <<
"L1 conditions '" << triggerCond.name() <<
"' not found in the L1 menu\n"
971 <<
"Remains incomplete";
973 triggerConditions->push_back( triggerCond );
977 triggerAlgos->push_back( triggerAlgo );
980 for (
CItAlgo iAlgo = l1GtTechTriggers.begin(); iAlgo != l1GtTechTriggers.end(); ++iAlgo ) {
981 const std::string & algoName( iAlgo->second.algoName() );
990 LogError(
"l1Algo" ) <<
"L1 technical trigger '" << algoName <<
"' not found in the L1 menu\n"
995 LogError(
"l1Algo" ) <<
"L1 technical trigger '" << algoName <<
"' does not have category 'TechnicalTrigger' from 'L1GtUtils'\n"
999 bool decisionBeforeMask;
1000 bool decisionAfterMask;
1003 int error( l1GtUtils.
l1Results( iEvent, algoName, decisionBeforeMask, decisionAfterMask, prescale, mask ) );
1005 LogError(
"l1Algo" ) <<
"L1 technical trigger '" << algoName <<
"' decision has error code " <<
error <<
" from 'L1GtUtils'\n"
1011 triggerAlgos->push_back( triggerAlgo );
1016 iEvent.
put( triggerAlgos );
1017 iEvent.
put( triggerConditions );
1024 obj.packPathNames(names);
1028 iEvent.
put( triggerObjectsStandAlone );
1036 const std::vector<std::string> & pathNames = hltConfig.
triggerNames();
1037 unsigned int sizePaths = pathNames.size();
1038 for (
unsigned int indexPath = 0; indexPath < sizePaths; ++indexPath ) {
1039 const std::string & namePath = pathNames[indexPath];
1041 const std::vector<std::string> & nameModules = hltConfig.
moduleLabels(indexPath);
1042 unsigned int sizeModulesPath = nameModules.size();
1043 bool lastFilter =
true;
1044 unsigned int iM = sizeModulesPath;
1046 const std::string & nameFilter = nameModules[--iM];
1047 if (hltConfig.
moduleEDMType(nameFilter) !=
"EDFilter")
continue;
1048 if (hltConfig.
moduleType(nameFilter) ==
"HLTBool")
continue;
1050 insert( nameFilter, namePath, indexPath, lastFilter, saveTags );
1051 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
collection_type::const_iterator const_iterator
T getParameter(std::string const &) const
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
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 saveTags(const std::string &module) const
Is module an L3 filter (ie, tracked saveTags=true)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
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.
virtual void beginLuminosityBlock(const edm::LuminosityBlock &iLuminosityBlock, const edm::EventSetup &iSetup) override
edm::InputTag tagL1ExtraForJet_
const std::string moduleType(const std::string &module) const
C++ class name of module.
bool autoProcessNameL1ExtraHTM_
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_
virtual bool hasCollection(const std::string &collName) const
Checks, if a certain label of original collection is assigned (method overrides)
#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
const std::vector< std::string > & triggerNames() const
names of trigger paths
The single EDProduct containing the HLT Prescale Table.
void setGtlResult(bool gtlResult)
Set L1 algorithm GTL result.
edm::GetterOfProducts< trigger::TriggerEvent > triggerEventGetter_
unsigned short nObjectsPerCombination() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void insert(const std::string &filter, const std::string &path, unsigned int pathIndex, bool lastFilter, bool l3Filter)
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
virtual void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
edm::InputTag tagL1ExtraETM_
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type identifier.
std::string hltPrescaleLabel_
Strings::size_type size() const
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
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
Analysis-level trigger object class.
const std::map< std::string, std::vector< unsigned int > > & table() const
bool autoProcessNameL1ExtraMu_
void addFilterLabel(const std::string &filterLabel)
Methods.
bool autoProcessNameL1ExtraCenJet_
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraForJetGetter_
const std::vector< std::string > & saveTagsModules(unsigned int trigger) const
Single trigger physics object (e.g., an isolated muon)
std::vector< TriggerAlgorithm > TriggerAlgorithmCollection
Collection of TriggerAlgorithm.
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.
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.
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const std::vector< std::string > & labels() const
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraTauJetGetter_
trigger::HLTPrescaleTable hltPrescaleTableLumi_
const std::string & name() const
Get L1 algorithm name.
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.
void setLogicalExpression(const std::string &expression)
Set L1 algorithm logical expression.
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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_
std::vector< TriggerFilter > TriggerFilterCollection
Collection of TriggerFilter.
edm::InputTag tagL1ExtraMu_
ModuleLabelToPathAndFlags moduleLabelToPathAndFlags_
L1GtUtils const & l1GtUtils() const
void setCategory(L1GtConditionCategory category)
Set the condition category.
unsigned nCombinations() const
void init(const HLTConfigProvider &)
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::GetterOfProducts< l1extra::L1EmParticleCollection > l1ExtraIsoEGGetter_
bool autoProcessNameL1ExtraForJet_
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_
std::vector< TriggerObject > TriggerObjectCollection
Collection of TriggerObject.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
unsigned int prescaleSize() const
trigger::HLTPrescaleTable hltPrescaleTableRun_
bool getConditionResult(unsigned condition) const
std::vector< TriggerCondition > TriggerConditionCollection
Collection of TriggerCondition.
bool autoProcessNameL1ExtraETM_
std::vector< std::string > exludeCollections_
bool autoProcessNameL1ExtraNoIsoEG_
volatile std::atomic< bool > shutdown_flag false
std::vector< L1Seed > L1SeedCollection
Collection of L1Seed.
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type identifier.
static std::string const triggerPaths
std::vector< TriggerPath > TriggerPathCollection
Collection of TriggerPath.
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_