CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
pat::PATTriggerEventProducer Class Reference

Produces the central entry point to full PAT trigger information. More...

Inheritance diagram for pat::PATTriggerEventProducer:
edm::stream::EDProducer<>

Public Member Functions

 PATTriggerEventProducer (const edm::ParameterSet &iConfig)
 
 ~PATTriggerEventProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
 
void beginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

bool autoProcessName_
 
edm::ConditionsInLumiBlock condLumi_
 
edm::ConditionsInRunBlock condRun_
 
bool gtCondLumiInit_ = false
 
bool gtCondRunInit_ = false
 
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcdhandleL1GtTriggerMenuToken_
 
HLTConfigProvider hltConfig_
 
bool hltConfigInit_
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordl1GtToken_
 
std::string nameProcess_
 
edm::InputTag tagCondGt_
 
edm::EDGetTokenT< edm::ConditionsInEventBlocktagCondGtEventToken_
 
edm::EDGetTokenT< edm::ConditionsInLumiBlocktagCondGtLumiToken_
 
edm::EDGetTokenT< edm::ConditionsInRunBlocktagCondGtRunToken_
 
edm::InputTag tagL1Gt_
 
std::vector< edm::InputTagtagsTriggerMatcher_
 
edm::InputTag tagTriggerEvent_
 
edm::InputTag tagTriggerProducer_
 
edm::InputTag tagTriggerResults_
 
edm::EDGetTokenT< TriggerAlgorithmCollectiontriggerAlgorithmCollectionToken_
 
edm::EDGetTokenT< TriggerConditionCollectiontriggerConditionCollectionToken_
 
edm::EDGetTokenT< TriggerFilterCollectiontriggerFilterCollectionToken_
 
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
 
edm::EDGetTokenT< TriggerObjectCollectiontriggerObjectCollectionToken_
 
edm::EDGetTokenT< TriggerPathCollectiontriggerPathCollectionToken_
 
edm::GetterOfProducts< edm::TriggerResultstriggerResultsGetter_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Produces the central entry point to full PAT trigger information.

This producer extract general trigger and conditions information from

For me information, s. https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger

Author
Volker Adler
Version
Id
PATTriggerEventProducer.h,v 1.11 2010/11/27 15:16:20 vadler Exp

Definition at line 53 of file PATTriggerEventProducer.cc.

Constructor & Destructor Documentation

◆ PATTriggerEventProducer()

PATTriggerEventProducer::PATTriggerEventProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 99 of file PATTriggerEventProducer.cc.

References deDxTools::esConsumes().

100  : nameProcess_(iConfig.getParameter<std::string>("processName")),
102  tagTriggerProducer_("patTrigger"),
104  // L1 configuration parameters
105  tagL1Gt_(),
106  // HLTConfigProvider
107  hltConfigInit_(false),
108  // HLT configuration parameters
109  tagTriggerResults_("TriggerResults"),
110  tagTriggerEvent_("hltTriggerSummaryAOD"),
111  // Conditions configuration parameters
112  tagCondGt_(),
113  // Conditions
114  condRun_(),
115  condLumi_(),
117  if (iConfig.exists("triggerResults"))
118  tagTriggerResults_ = iConfig.getParameter<InputTag>("triggerResults");
123  this);
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_);
138  }
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); });
146 
147  callWhenNewProductsRegistered([this](BranchDescription const& bd) {
148  if (not(this->autoProcessName_ and bd.processName() == this->moduleDescription().processName())) {
150  }
151  });
152 
153  for (size_t iMatch = 0; iMatch < tagsTriggerMatcher_.size(); ++iMatch) {
154  produces<TriggerObjectMatch>(tagsTriggerMatcher_.at(iMatch).label());
155  }
156  produces<TriggerEvent>();
157 }
edm::EDGetTokenT< TriggerObjectCollection > triggerObjectCollectionToken_
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
edm::EDGetTokenT< TriggerConditionCollection > triggerConditionCollectionToken_
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > handleL1GtTriggerMenuToken_
std::string const & instance() const
Definition: InputTag.h:37
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::GetterOfProducts< edm::TriggerResults > triggerResultsGetter_
std::string const & processName() const
edm::EDGetTokenT< TriggerPathCollection > triggerPathCollectionToken_
std::string const & label() const
Definition: InputTag.h:36
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 >
Definition: transform.h:11
edm::EDGetTokenT< edm::ConditionsInEventBlock > tagCondGtEventToken_
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > l1GtToken_
edm::EDGetTokenT< TriggerAlgorithmCollection > triggerAlgorithmCollectionToken_
edm::ConditionsInRunBlock condRun_
std::vector< edm::InputTag > tagsTriggerMatcher_
edm::EDGetTokenT< TriggerFilterCollection > triggerFilterCollectionToken_
edm::ConditionsInLumiBlock condLumi_

◆ ~PATTriggerEventProducer()

pat::PATTriggerEventProducer::~PATTriggerEventProducer ( )
inlineoverride

Definition at line 56 of file PATTriggerEventProducer.cc.

56 {};

Member Function Documentation

◆ beginLuminosityBlock()

void PATTriggerEventProducer::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 224 of file PATTriggerEventProducer.cc.

References condLumi_, edm::InputTag::encode(), edm::LuminosityBlock::getByToken(), gtCondLumiInit_, edm::HandleBase::isValid(), edm::InputTag::label(), nameProcess_, tagCondGt_, and tagCondGtLumiToken_.

224  {
225  // Terminate, if auto process name determination failed
226  if (nameProcess_ == "*")
227  return;
228 
229  gtCondLumiInit_ = false;
230  if (!tagCondGt_.label().empty()) {
231  Handle<ConditionsInLumiBlock> condLumiBlock;
232  iLuminosityBlock.getByToken(tagCondGtLumiToken_, condLumiBlock);
233  if (condLumiBlock.isValid()) {
234  condLumi_ = *condLumiBlock;
235  gtCondLumiInit_ = true;
236  } else {
237  LogError("conditionsInEdm") << "ConditionsInLumiBlock product with InputTag '" << tagCondGt_.encode()
238  << "' not in lumi";
239  }
240  }
241 }
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
std::string encode() const
Definition: InputTag.cc:159
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
bool isValid() const
Definition: HandleBase.h:70
edm::ConditionsInLumiBlock condLumi_

◆ beginRun()

void PATTriggerEventProducer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 159 of file PATTriggerEventProducer.cc.

References autoProcessName_, condRun_, edm::InputTag::encode(), edm::ParameterSet::exists(), edm::Run::getByToken(), gtCondRunInit_, hltConfig_, hltConfigInit_, HLTConfigProvider::init(), ProducerED_cfi::InputTag, edm::InputTag::instance(), instance, edm::HandleBase::isValid(), edm::InputTag::label(), LogDebug, nameProcess_, edm::InputTag::process(), edm::Run::processHistory(), HLTConfigProvider::size(), tagCondGt_, tagCondGtRunToken_, tagTriggerEvent_, and tagTriggerResults_.

159  {
160  // Initialize process name
161  if (autoProcessName_) {
162  // reset
163  nameProcess_ = "*";
164  // determine process name from last run TriggerSummaryProducerAOD module in process history of input
165  const ProcessHistory& processHistory(iRun.processHistory());
166  ProcessConfiguration processConfiguration;
167  ParameterSet processPSet;
168  // unbroken loop, which relies on time ordering (accepts the last found entry)
169  for (ProcessHistory::const_iterator iHist = processHistory.begin(); iHist != processHistory.end(); ++iHist) {
170  if (processHistory.getConfigurationForProcess(iHist->processName(), processConfiguration) &&
171  pset::Registry::instance()->getMapped(processConfiguration.parameterSetID(), processPSet) &&
172  processPSet.exists(tagTriggerEvent_.label())) {
173  nameProcess_ = iHist->processName();
174  LogDebug("autoProcessName") << "HLT process name '" << nameProcess_ << "' discovered";
175  }
176  }
177  // terminate, if nothing is found
178  if (nameProcess_ == "*") {
179  LogError("autoProcessName") << "trigger::TriggerEvent product with label '" << tagTriggerEvent_.label()
180  << "' not produced according to process history of input data\n"
181  << "No trigger information produced.";
182  return;
183  }
184  LogInfo("autoProcessName") << "HLT process name " << nameProcess_ << " used for PAT trigger information";
185  }
186  // adapt configuration of used input tags
187  if (tagTriggerResults_.process().empty() || tagTriggerResults_.process() == "*") {
189  } else if (tagTriggerResults_.process() != nameProcess_) {
190  LogWarning("triggerResultsTag") << "TriggerResults process name '" << tagTriggerResults_.process()
191  << "' differs from HLT process name '" << nameProcess_ << "'";
192  }
193  if (tagTriggerEvent_.process().empty() || tagTriggerEvent_.process() == "*") {
195  } else if (tagTriggerEvent_.process() != nameProcess_) {
196  LogWarning("triggerEventTag") << "TriggerEvent process name '" << tagTriggerEvent_.process()
197  << "' differs from HLT process name '" << nameProcess_ << "'";
198  }
199 
200  gtCondRunInit_ = false;
201  if (!tagCondGt_.label().empty()) {
202  Handle<ConditionsInRunBlock> condRunBlock;
203  iRun.getByToken(tagCondGtRunToken_, condRunBlock);
204  if (condRunBlock.isValid()) {
205  condRun_ = *condRunBlock;
206  gtCondRunInit_ = true;
207  } else {
208  LogError("conditionsInEdm") << "ConditionsInRunBlock product with InputTag '" << tagCondGt_.encode()
209  << "' not in run";
210  }
211  }
212 
213  // Initialize HLTConfigProvider
214  hltConfigInit_ = false;
215  bool changed(true);
216  if (!hltConfig_.init(iRun, iSetup, nameProcess_, changed)) {
217  LogError("hltConfigExtraction") << "HLT config extraction error with process name '" << nameProcess_ << "'";
218  } else if (hltConfig_.size() <= 0) {
219  LogError("hltConfigSize") << "HLT config size error";
220  } else
221  hltConfigInit_ = true;
222 }
collection_type::const_iterator const_iterator
static PFTauRenderPlugin instance
std::string encode() const
Definition: InputTag.cc:159
std::string const & instance() const
Definition: InputTag.h:37
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
unsigned int size() const
number of trigger paths in trigger table
ProcessHistory const & processHistory() const
Definition: Run.cc:115
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
Log< level::Info, false > LogInfo
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:318
edm::ConditionsInRunBlock condRun_
bool isValid() const
Definition: HandleBase.h:70
Log< level::Warning, false > LogWarning
std::string const & process() const
Definition: InputTag.h:40
#define LogDebug(id)

◆ produce()

void PATTriggerEventProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 243 of file PATTriggerEventProducer.cc.

References edm::HLTGlobalStatus::accept(), edm::ConditionsInRunBlock::BAvgCurrent, edm::ConditionsInRunBlock::beamMode, edm::ConditionsInRunBlock::beamMomentum, edm::ConditionsInRunBlock::BStartCurrent, edm::ConditionsInEventBlock::bstMasterStatus, edm::ConditionsInRunBlock::BStopCurrent, condLumi_, condRun_, edm::InputTag::encode(), edm::HLTGlobalStatus::error(), edm::EventSetup::getHandle(), gtCondLumiInit_, gtCondRunInit_, L1GlobalTriggerReadoutRecord::gtFdlWord(), handleL1GtTriggerMenuToken_, hltConfig_, hltConfigInit_, iEvent, dqmdumpme::indices, edm::HandleBase::isValid(), l1GtToken_, edm::InputTag::label(), edm::ConditionsInRunBlock::lhcFillNumber, eostools::move(), nameProcess_, L1GtFdlWord::physicsDeclared(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::tableName(), tagCondGt_, tagCondGtEventToken_, tagL1Gt_, tagsTriggerMatcher_, tagTriggerProducer_, tagTriggerResults_, edm::ConditionsInLumiBlock::totalIntensityBeam1, edm::ConditionsInLumiBlock::totalIntensityBeam2, triggerAlgorithmCollectionToken_, triggerConditionCollectionToken_, PDWG_DiPhoton_SD_cff::triggerEvent, triggerFilterCollectionToken_, triggerMatcherTokens_, triggerObjectCollectionToken_, triggerPathCollectionToken_, edm::ConditionsInEventBlock::turnCountNumber, and edm::HLTGlobalStatus::wasrun().

243  {
244  // Terminate, if auto process name determination failed
245  if (nameProcess_ == "*")
246  return;
247 
248  if (!hltConfigInit_)
249  return;
250 
251  auto handleL1GtTriggerMenu = iSetup.getHandle(handleL1GtTriggerMenuToken_);
252  Handle<TriggerResults> handleTriggerResults;
253  iEvent.getByLabel(tagTriggerResults_, handleTriggerResults);
254  // iEvent.getByToken( triggerResultsToken_, handleTriggerResults );
255  if (!handleTriggerResults.isValid()) {
256  LogError("triggerResultsValid") << "TriggerResults product with InputTag '" << tagTriggerResults_.encode()
257  << "' not in event\n"
258  << "No trigger information produced";
259  return;
260  }
261  Handle<TriggerAlgorithmCollection> handleTriggerAlgorithms;
262  iEvent.getByToken(triggerAlgorithmCollectionToken_, handleTriggerAlgorithms);
263  Handle<TriggerConditionCollection> handleTriggerConditions;
264  iEvent.getByToken(triggerConditionCollectionToken_, handleTriggerConditions);
265  Handle<TriggerPathCollection> handleTriggerPaths;
266  iEvent.getByToken(triggerPathCollectionToken_, handleTriggerPaths);
267  Handle<TriggerFilterCollection> handleTriggerFilters;
268  iEvent.getByToken(triggerFilterCollectionToken_, handleTriggerFilters);
269  Handle<TriggerObjectCollection> handleTriggerObjects;
270  iEvent.getByToken(triggerObjectCollectionToken_, handleTriggerObjects);
271 
272  bool physDecl(false);
273  if (iEvent.isRealData() && !tagL1Gt_.label().empty()) {
274  Handle<L1GlobalTriggerReadoutRecord> handleL1GlobalTriggerReadoutRecord;
275  iEvent.getByToken(l1GtToken_, handleL1GlobalTriggerReadoutRecord);
276  if (handleL1GlobalTriggerReadoutRecord.isValid()) {
277  L1GtFdlWord fdlWord = handleL1GlobalTriggerReadoutRecord->gtFdlWord();
278  if (fdlWord.physicsDeclared() == 1) {
279  physDecl = true;
280  }
281  } else {
282  LogError("l1GlobalTriggerReadoutRecordValid")
283  << "L1GlobalTriggerReadoutRecord product with InputTag '" << tagL1Gt_.encode() << "' not in event";
284  }
285  } else {
286  physDecl = true;
287  }
288 
289  // produce trigger event
290 
291  auto triggerEvent = std::make_unique<TriggerEvent>(handleL1GtTriggerMenu->gtTriggerMenuName(),
293  handleTriggerResults->wasrun(),
294  handleTriggerResults->accept(),
295  handleTriggerResults->error(),
296  physDecl);
297  // set product references to trigger collections
298  if (handleTriggerAlgorithms.isValid()) {
299  triggerEvent->setAlgorithms(handleTriggerAlgorithms);
300  } else {
301  LogError("triggerAlgorithmsValid") << "pat::TriggerAlgorithmCollection product with InputTag '"
302  << tagTriggerProducer_.encode() << "' not in event";
303  }
304  if (handleTriggerConditions.isValid()) {
305  triggerEvent->setConditions(handleTriggerConditions);
306  } else {
307  LogError("triggerConditionsValid") << "pat::TriggerConditionCollection product with InputTag '"
308  << tagTriggerProducer_.encode() << "' not in event";
309  }
310  if (handleTriggerPaths.isValid()) {
311  triggerEvent->setPaths(handleTriggerPaths);
312  } else {
313  LogError("triggerPathsValid") << "pat::TriggerPathCollection product with InputTag '"
314  << tagTriggerProducer_.encode() << "' not in event";
315  }
316  if (handleTriggerFilters.isValid()) {
317  triggerEvent->setFilters(handleTriggerFilters);
318  } else {
319  LogError("triggerFiltersValid") << "pat::TriggerFilterCollection product with InputTag '"
320  << tagTriggerProducer_.encode() << "' not in event";
321  }
322  if (handleTriggerObjects.isValid()) {
323  triggerEvent->setObjects(handleTriggerObjects);
324  } else {
325  LogError("triggerObjectsValid") << "pat::TriggerObjectCollection product with InputTag '"
326  << tagTriggerProducer_.encode() << "' not in event";
327  }
328  if (gtCondRunInit_) {
329  triggerEvent->setLhcFill(condRun_.lhcFillNumber);
330  triggerEvent->setBeamMode(condRun_.beamMode);
331  triggerEvent->setBeamMomentum(condRun_.beamMomentum);
332  triggerEvent->setBCurrentStart(condRun_.BStartCurrent);
333  triggerEvent->setBCurrentStop(condRun_.BStopCurrent);
334  triggerEvent->setBCurrentAvg(condRun_.BAvgCurrent);
335  }
336  if (gtCondLumiInit_) {
337  triggerEvent->setIntensityBeam1(condLumi_.totalIntensityBeam1);
338  triggerEvent->setIntensityBeam2(condLumi_.totalIntensityBeam2);
339  }
340  if (!tagCondGt_.label().empty()) {
341  Handle<ConditionsInEventBlock> condEventBlock;
342  iEvent.getByToken(tagCondGtEventToken_, condEventBlock);
343  if (condEventBlock.isValid()) {
344  triggerEvent->setBstMasterStatus(condEventBlock->bstMasterStatus);
345  triggerEvent->setTurnCount(condEventBlock->turnCountNumber);
346  } else {
347  LogError("conditionsInEdm") << "ConditionsInEventBlock product with InputTag '" << tagCondGt_.encode()
348  << "' not in event";
349  }
350  }
351 
352  // produce trigger match association and set references
353  if (handleTriggerObjects.isValid()) {
354  for (size_t iMatch = 0; iMatch < tagsTriggerMatcher_.size(); ++iMatch) {
355  const std::string labelTriggerObjectMatcher(tagsTriggerMatcher_.at(iMatch).label());
356  // copy trigger match association using TriggerObjectStandAlone to those using TriggerObject
357  // relying on the fact, that only one candidate collection is present in the association
358  Handle<TriggerObjectStandAloneMatch> handleTriggerObjectStandAloneMatch;
359  iEvent.getByToken(triggerMatcherTokens_.at(iMatch), handleTriggerObjectStandAloneMatch);
360  if (!handleTriggerObjectStandAloneMatch.isValid()) {
361  LogError("triggerMatchValid") << "pat::TriggerObjectStandAloneMatch product with InputTag '"
362  << labelTriggerObjectMatcher << "' not in event";
363  continue;
364  }
365  auto it = makeAssociativeIterator<reco::CandidateBaseRef>(*handleTriggerObjectStandAloneMatch, iEvent);
366  auto itEnd = it.end();
367  Handle<reco::CandidateView> handleCands;
368  if (it != itEnd)
369  iEvent.get(it->first.id(), handleCands);
370  std::vector<int> indices;
371  while (it != itEnd) {
372  indices.push_back(it->second.key());
373  ++it;
374  }
375  auto triggerObjectMatch = std::make_unique<TriggerObjectMatch>(handleTriggerObjects);
376  TriggerObjectMatch::Filler matchFiller(*triggerObjectMatch);
377  if (handleCands.isValid()) {
378  matchFiller.insert(handleCands, indices.begin(), indices.end());
379  }
380  matchFiller.fill();
381  OrphanHandle<TriggerObjectMatch> handleTriggerObjectMatch(
382  iEvent.put(std::move(triggerObjectMatch), labelTriggerObjectMatcher));
383  // set product reference to trigger match association
384  if (!handleTriggerObjectMatch.isValid()) {
385  LogError("triggerMatchValid") << "pat::TriggerObjectMatch product with InputTag '" << labelTriggerObjectMatcher
386  << "' not in event";
387  continue;
388  }
389  if (!(triggerEvent->addObjectMatchResult(handleTriggerObjectMatch, labelTriggerObjectMatcher))) {
390  LogWarning("triggerObjectMatchReplication")
391  << "pat::TriggerEvent contains already a pat::TriggerObjectMatch from matcher module '"
392  << labelTriggerObjectMatcher << "'";
393  }
394  }
395  }
396 
398 }
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< TriggerObjectCollection > triggerObjectCollectionToken_
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
edm::EDGetTokenT< TriggerConditionCollection > triggerConditionCollectionToken_
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:169
bool error() const
Has any path encountered an error (exception)
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > handleL1GtTriggerMenuToken_
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< TriggerPathCollection > triggerPathCollectionToken_
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
bool wasrun() const
Was at least one path run?
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::ConditionsInEventBlock > tagCondGtEventToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > l1GtToken_
edm::EDGetTokenT< TriggerAlgorithmCollection > triggerAlgorithmCollectionToken_
edm::ConditionsInRunBlock condRun_
bool isValid() const
Definition: HandleBase.h:70
const std::string & tableName() const
HLT ConfDB table name.
std::vector< edm::InputTag > tagsTriggerMatcher_
edm::EDGetTokenT< TriggerFilterCollection > triggerFilterCollectionToken_
edm::ConditionsInLumiBlock condLumi_
Log< level::Warning, false > LogWarning
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ autoProcessName_

bool pat::PATTriggerEventProducer::autoProcessName_
private

Definition at line 64 of file PATTriggerEventProducer.cc.

Referenced by beginRun().

◆ condLumi_

edm::ConditionsInLumiBlock pat::PATTriggerEventProducer::condLumi_
private

Definition at line 88 of file PATTriggerEventProducer.cc.

Referenced by beginLuminosityBlock(), and produce().

◆ condRun_

edm::ConditionsInRunBlock pat::PATTriggerEventProducer::condRun_
private

Definition at line 87 of file PATTriggerEventProducer.cc.

Referenced by beginRun(), and produce().

◆ gtCondLumiInit_

bool pat::PATTriggerEventProducer::gtCondLumiInit_ = false
private

Definition at line 90 of file PATTriggerEventProducer.cc.

Referenced by beginLuminosityBlock(), and produce().

◆ gtCondRunInit_

bool pat::PATTriggerEventProducer::gtCondRunInit_ = false
private

Definition at line 89 of file PATTriggerEventProducer.cc.

Referenced by beginRun(), and produce().

◆ handleL1GtTriggerMenuToken_

const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> pat::PATTriggerEventProducer::handleL1GtTriggerMenuToken_
private

Definition at line 91 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ hltConfig_

HLTConfigProvider pat::PATTriggerEventProducer::hltConfig_
private

Definition at line 77 of file PATTriggerEventProducer.cc.

Referenced by beginRun(), and produce().

◆ hltConfigInit_

bool pat::PATTriggerEventProducer::hltConfigInit_
private

Definition at line 78 of file PATTriggerEventProducer.cc.

Referenced by beginRun(), and produce().

◆ l1GtToken_

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> pat::PATTriggerEventProducer::l1GtToken_
private

Definition at line 75 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ nameProcess_

std::string pat::PATTriggerEventProducer::nameProcess_
private

Definition at line 63 of file PATTriggerEventProducer.cc.

Referenced by beginLuminosityBlock(), beginRun(), and produce().

◆ tagCondGt_

edm::InputTag pat::PATTriggerEventProducer::tagCondGt_
private

Definition at line 83 of file PATTriggerEventProducer.cc.

Referenced by beginLuminosityBlock(), beginRun(), and produce().

◆ tagCondGtEventToken_

edm::EDGetTokenT<edm::ConditionsInEventBlock> pat::PATTriggerEventProducer::tagCondGtEventToken_
private

Definition at line 86 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ tagCondGtLumiToken_

edm::EDGetTokenT<edm::ConditionsInLumiBlock> pat::PATTriggerEventProducer::tagCondGtLumiToken_
private

Definition at line 85 of file PATTriggerEventProducer.cc.

Referenced by beginLuminosityBlock().

◆ tagCondGtRunToken_

edm::EDGetTokenT<edm::ConditionsInRunBlock> pat::PATTriggerEventProducer::tagCondGtRunToken_
private

Definition at line 84 of file PATTriggerEventProducer.cc.

Referenced by beginRun().

◆ tagL1Gt_

edm::InputTag pat::PATTriggerEventProducer::tagL1Gt_
private

Definition at line 74 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ tagsTriggerMatcher_

std::vector<edm::InputTag> pat::PATTriggerEventProducer::tagsTriggerMatcher_
private

Definition at line 71 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ tagTriggerEvent_

edm::InputTag pat::PATTriggerEventProducer::tagTriggerEvent_
private

Definition at line 81 of file PATTriggerEventProducer.cc.

Referenced by beginRun().

◆ tagTriggerProducer_

edm::InputTag pat::PATTriggerEventProducer::tagTriggerProducer_
private

Definition at line 65 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ tagTriggerResults_

edm::InputTag pat::PATTriggerEventProducer::tagTriggerResults_
private

Definition at line 79 of file PATTriggerEventProducer.cc.

Referenced by beginRun(), and produce().

◆ triggerAlgorithmCollectionToken_

edm::EDGetTokenT<TriggerAlgorithmCollection> pat::PATTriggerEventProducer::triggerAlgorithmCollectionToken_
private

Definition at line 66 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ triggerConditionCollectionToken_

edm::EDGetTokenT<TriggerConditionCollection> pat::PATTriggerEventProducer::triggerConditionCollectionToken_
private

Definition at line 67 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ triggerFilterCollectionToken_

edm::EDGetTokenT<TriggerFilterCollection> pat::PATTriggerEventProducer::triggerFilterCollectionToken_
private

Definition at line 69 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ triggerMatcherTokens_

std::vector<edm::EDGetTokenT<TriggerObjectStandAloneMatch> > pat::PATTriggerEventProducer::triggerMatcherTokens_
private

Definition at line 72 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ triggerObjectCollectionToken_

edm::EDGetTokenT<TriggerObjectCollection> pat::PATTriggerEventProducer::triggerObjectCollectionToken_
private

Definition at line 70 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ triggerPathCollectionToken_

edm::EDGetTokenT<TriggerPathCollection> pat::PATTriggerEventProducer::triggerPathCollectionToken_
private

Definition at line 68 of file PATTriggerEventProducer.cc.

Referenced by produce().

◆ triggerResultsGetter_

edm::GetterOfProducts<edm::TriggerResults> pat::PATTriggerEventProducer::triggerResultsGetter_
private

Definition at line 80 of file PATTriggerEventProducer.cc.