100 : nameProcess_(iConfig.getParameter<
std::
string>(
"processName")),
101 autoProcessName_(nameProcess_ ==
"*"),
102 tagTriggerProducer_(
"patTrigger"),
103 tagsTriggerMatcher_(),
107 hltConfigInit_(
false),
109 tagTriggerResults_(
"TriggerResults"),
110 tagTriggerEvent_(
"hltTriggerSummaryAOD"),
117 if (iConfig.exists(
"triggerResults"))
118 tagTriggerResults_ = iConfig.getParameter<
InputTag>(
"triggerResults");
119 triggerResultsGetter_ =
121 tagTriggerResults_.instance(),
122 autoProcessName_ ?
std::string(
"") : nameProcess_)),
124 if (iConfig.exists(
"triggerEvent"))
125 tagTriggerEvent_ = iConfig.getParameter<
InputTag>(
"triggerEvent");
126 if (iConfig.exists(
"patTriggerProducer"))
127 tagTriggerProducer_ = iConfig.getParameter<
InputTag>(
"patTriggerProducer");
128 triggerAlgorithmCollectionToken_ = mayConsume<TriggerAlgorithmCollection>(tagTriggerProducer_);
129 triggerConditionCollectionToken_ = mayConsume<TriggerConditionCollection>(tagTriggerProducer_);
130 triggerPathCollectionToken_ = mayConsume<TriggerPathCollection>(tagTriggerProducer_);
131 triggerFilterCollectionToken_ = mayConsume<TriggerFilterCollection>(tagTriggerProducer_);
132 triggerObjectCollectionToken_ = mayConsume<TriggerObjectCollection>(tagTriggerProducer_);
133 if (iConfig.exists(
"condGtTag")) {
134 tagCondGt_ = iConfig.getParameter<
InputTag>(
"condGtTag");
135 tagCondGtRunToken_ = mayConsume<ConditionsInRunBlock, InRun>(tagCondGt_);
136 tagCondGtLumiToken_ = mayConsume<ConditionsInLumiBlock, InLumi>(tagCondGt_);
137 tagCondGtEventToken_ = mayConsume<ConditionsInEventBlock>(tagCondGt_);
139 if (iConfig.exists(
"l1GtTag"))
140 tagL1Gt_ = iConfig.getParameter<
InputTag>(
"l1GtTag");
141 l1GtToken_ = mayConsume<L1GlobalTriggerReadoutRecord>(tagL1Gt_);
142 if (iConfig.exists(
"patTriggerMatches"))
143 tagsTriggerMatcher_ = iConfig.getParameter<std::vector<InputTag> >(
"patTriggerMatches");
145 tagsTriggerMatcher_, [
this](
InputTag const&
tag) {
return mayConsume<TriggerObjectStandAloneMatch>(
tag); });
148 if (not(this->autoProcessName_ and bd.
processName() == this->moduleDescription().processName())) {
149 triggerResultsGetter_(bd);
153 for (
size_t iMatch = 0; iMatch < tagsTriggerMatcher_.size(); ++iMatch) {
154 produces<TriggerObjectMatch>(tagsTriggerMatcher_.at(iMatch).label());
156 produces<TriggerEvent>();
170 if (processHistory.getConfigurationForProcess(iHist->processName(), processConfiguration) &&
180 <<
"' not produced according to process history of input data\n" 181 <<
"No trigger information produced.";
184 LogInfo(
"autoProcessName") <<
"HLT process name " <<
nameProcess_ <<
" used for PAT trigger information";
191 <<
"' differs from HLT process name '" <<
nameProcess_ <<
"'";
197 <<
"' differs from HLT process name '" <<
nameProcess_ <<
"'";
217 LogError(
"hltConfigExtraction") <<
"HLT config extraction error with process name '" <<
nameProcess_ <<
"'";
219 LogError(
"hltConfigSize") <<
"HLT config size error";
255 if (!handleTriggerResults.
isValid()) {
257 <<
"' not in event\n" 258 <<
"No trigger information produced";
272 bool physDecl(
false);
276 if (handleL1GlobalTriggerReadoutRecord.
isValid()) {
282 LogError(
"l1GlobalTriggerReadoutRecordValid")
283 <<
"L1GlobalTriggerReadoutRecord product with InputTag '" <<
tagL1Gt_.
encode() <<
"' not in event";
291 auto triggerEvent = std::make_unique<TriggerEvent>(handleL1GtTriggerMenu->gtTriggerMenuName(),
293 handleTriggerResults->
wasrun(),
294 handleTriggerResults->
accept(),
295 handleTriggerResults->
error(),
298 if (handleTriggerAlgorithms.
isValid()) {
301 LogError(
"triggerAlgorithmsValid") <<
"pat::TriggerAlgorithmCollection product with InputTag '" 304 if (handleTriggerConditions.
isValid()) {
307 LogError(
"triggerConditionsValid") <<
"pat::TriggerConditionCollection product with InputTag '" 310 if (handleTriggerPaths.
isValid()) {
313 LogError(
"triggerPathsValid") <<
"pat::TriggerPathCollection product with InputTag '" 316 if (handleTriggerFilters.
isValid()) {
319 LogError(
"triggerFiltersValid") <<
"pat::TriggerFilterCollection product with InputTag '" 322 if (handleTriggerObjects.
isValid()) {
325 LogError(
"triggerObjectsValid") <<
"pat::TriggerObjectCollection product with InputTag '" 343 if (condEventBlock.
isValid()) {
353 if (handleTriggerObjects.
isValid()) {
360 if (!handleTriggerObjectStandAloneMatch.isValid()) {
361 LogError(
"triggerMatchValid") <<
"pat::TriggerObjectStandAloneMatch product with InputTag '" 362 << labelTriggerObjectMatcher <<
"' not in event";
365 auto it = makeAssociativeIterator<reco::CandidateBaseRef>(*handleTriggerObjectStandAloneMatch,
iEvent);
366 auto itEnd = it.end();
369 iEvent.get(it->first.id(), handleCands);
371 while (it != itEnd) {
372 indices.push_back(it->second.key());
375 auto triggerObjectMatch = std::make_unique<TriggerObjectMatch>(handleTriggerObjects);
384 if (!handleTriggerObjectMatch.isValid()) {
385 LogError(
"triggerMatchValid") <<
"pat::TriggerObjectMatch product with InputTag '" << labelTriggerObjectMatcher
389 if (!(
triggerEvent->addObjectMatchResult(handleTriggerObjectMatch, labelTriggerObjectMatcher))) {
391 <<
"pat::TriggerEvent contains already a pat::TriggerObjectMatch from matcher module '" 392 << labelTriggerObjectMatcher <<
"'";
collection_type::const_iterator const_iterator
uint32_t totalIntensityBeam1
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< TriggerObjectCollection > triggerObjectCollectionToken_
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
edm::EDGetTokenT< TriggerConditionCollection > triggerConditionCollectionToken_
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
bool error() const
Has any path encountered an error (exception)
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > handleL1GtTriggerMenuToken_
static PFTauRenderPlugin instance
bool exists(std::string const ¶meterName) const
checks if a parameter exists
edm::GetterOfProducts< edm::TriggerResults > triggerResultsGetter_
std::string const & processName() const
edm::EDGetTokenT< TriggerPathCollection > triggerPathCollectionToken_
Log< level::Error, false > LogError
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Produces the central entry point to full PAT trigger information.
edm::InputTag tagTriggerEvent_
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool wasrun() const
Was at least one path run?
edm::EDGetTokenT< edm::ConditionsInEventBlock > tagCondGtEventToken_
unsigned int size() const
number of trigger paths in trigger table
PATTriggerEventProducer(const edm::ParameterSet &iConfig)
edm::InputTag tagTriggerProducer_
#define DEFINE_FWK_MODULE(type)
ProcessHistory const & processHistory() const
HLTConfigProvider hltConfig_
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
uint32_t totalIntensityBeam2
Log< level::Info, false > LogInfo
void beginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > l1GtToken_
edm::EDGetTokenT< TriggerAlgorithmCollection > triggerAlgorithmCollectionToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
edm::InputTag tagTriggerResults_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::ConditionsInRunBlock condRun_
const std::string & tableName() const
HLT ConfDB table name.
std::vector< edm::InputTag > tagsTriggerMatcher_
edm::EDGetTokenT< TriggerFilterCollection > triggerFilterCollectionToken_
edm::ConditionsInLumiBlock condLumi_
~PATTriggerEventProducer() override
Log< level::Warning, false > LogWarning
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override