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"))
119 triggerResultsGetter_ =
121 tagTriggerResults_.instance(),
122 autoProcessName_ ?
std::string(
"") : nameProcess_)),
124 if (
iConfig.exists(
"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")) {
135 tagCondGtRunToken_ = mayConsume<ConditionsInRunBlock, InRun>(tagCondGt_);
136 tagCondGtLumiToken_ = mayConsume<ConditionsInLumiBlock, InLumi>(tagCondGt_);
137 tagCondGtEventToken_ = mayConsume<ConditionsInEventBlock>(tagCondGt_);
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>();
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";
264 iEvent.
getByToken(triggerConditionCollectionToken_, handleTriggerConditions);
266 iEvent.
getByToken(triggerPathCollectionToken_, handleTriggerPaths);
268 iEvent.
getByToken(triggerFilterCollectionToken_, handleTriggerFilters);
270 iEvent.
getByToken(triggerObjectCollectionToken_, handleTriggerObjects);
272 bool physDecl(
false);
276 if (handleL1GlobalTriggerReadoutRecord.
isValid()) {
277 L1GtFdlWord fdlWord = handleL1GlobalTriggerReadoutRecord->gtFdlWord();
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()) {
299 triggerEvent->setAlgorithms(handleTriggerAlgorithms);
301 LogError(
"triggerAlgorithmsValid") <<
"pat::TriggerAlgorithmCollection product with InputTag '"
304 if (handleTriggerConditions.
isValid()) {
305 triggerEvent->setConditions(handleTriggerConditions);
307 LogError(
"triggerConditionsValid") <<
"pat::TriggerConditionCollection product with InputTag '"
310 if (handleTriggerPaths.
isValid()) {
311 triggerEvent->setPaths(handleTriggerPaths);
313 LogError(
"triggerPathsValid") <<
"pat::TriggerPathCollection product with InputTag '"
316 if (handleTriggerFilters.
isValid()) {
317 triggerEvent->setFilters(handleTriggerFilters);
319 LogError(
"triggerFiltersValid") <<
"pat::TriggerFilterCollection product with InputTag '"
322 if (handleTriggerObjects.
isValid()) {
323 triggerEvent->setObjects(handleTriggerObjects);
325 LogError(
"triggerObjectsValid") <<
"pat::TriggerObjectCollection product with InputTag '"
343 if (condEventBlock.
isValid()) {
344 triggerEvent->setBstMasterStatus(condEventBlock->bstMasterStatus);
345 triggerEvent->setTurnCount(condEventBlock->turnCountNumber);
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);
378 matchFiller.insert(handleCands, indices.begin(), indices.end());
382 iEvent.
put(
std::move(triggerObjectMatch), labelTriggerObjectMatcher));
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 <<
"'";
unsigned int size() const
number of trigger paths in trigger table
collection_type::const_iterator const_iterator
uint32_t totalIntensityBeam1
edm::EDGetTokenT< TriggerObjectCollection > triggerObjectCollectionToken_
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
edm::EDGetTokenT< TriggerConditionCollection > triggerConditionCollectionToken_
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > handleL1GtTriggerMenuToken_
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::GetterOfProducts< edm::TriggerResults > triggerResultsGetter_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
edm::EDGetTokenT< TriggerPathCollection > triggerPathCollectionToken_
std::string const & processName() const
const std::string & tableName() const
HLT ConfDB table name.
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_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edm::ConditionsInEventBlock > tagCondGtEventToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
PATTriggerEventProducer(const edm::ParameterSet &iConfig)
edm::InputTag tagTriggerProducer_
bool get(ProductID const &oid, Handle< PROD > &result) const
ProcessHistory const & processHistory() const
HLTConfigProvider hltConfig_
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) 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 init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
edm::InputTag tagTriggerResults_
edm::ConditionsInRunBlock condRun_
std::vector< edm::InputTag > tagsTriggerMatcher_
edm::EDGetTokenT< TriggerFilterCollection > triggerFilterCollectionToken_
edm::ConditionsInLumiBlock condLumi_
~PATTriggerEventProducer() override
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override