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 <<
"'";