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...

#include "PhysicsTools/PatAlgos/plugins/PATTriggerEventProducer.h"

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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_
 
bool gtCondRunInit_
 
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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 47 of file PATTriggerEventProducer.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file PATTriggerEventProducer.cc.

References autoProcessName_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, edm::InputTag::instance(), l1GtToken_, edm::InputTag::label(), nameProcess_, edm::BranchDescription::processName(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, tagCondGt_, tagCondGtEventToken_, tagCondGtLumiToken_, tagCondGtRunToken_, tagL1Gt_, tagsTriggerMatcher_, tagTriggerEvent_, tagTriggerProducer_, tagTriggerResults_, triggerAlgorithmCollectionToken_, triggerConditionCollectionToken_, triggerFilterCollectionToken_, triggerMatcherTokens_, triggerObjectCollectionToken_, triggerPathCollectionToken_, triggerResultsGetter_, and edm::vector_transform().

27  : nameProcess_(iConfig.getParameter<std::string>("processName")),
29  tagTriggerProducer_("patTrigger"),
31  // L1 configuration parameters
32  tagL1Gt_(),
33  // HLTConfigProvider
34  hltConfigInit_(false),
35  // HLT configuration parameters
36  tagTriggerResults_("TriggerResults"),
37  tagTriggerEvent_("hltTriggerSummaryAOD"),
38  // Conditions configuration parameters
39  tagCondGt_(),
40  // Conditions
41  condRun_(),
42  condLumi_(),
43  gtCondRunInit_(false),
44  gtCondLumiInit_(false) {
45  if (iConfig.exists("triggerResults"))
46  tagTriggerResults_ = iConfig.getParameter<InputTag>("triggerResults");
51  this);
52  if (iConfig.exists("triggerEvent"))
53  tagTriggerEvent_ = iConfig.getParameter<InputTag>("triggerEvent");
54  if (iConfig.exists("patTriggerProducer"))
55  tagTriggerProducer_ = iConfig.getParameter<InputTag>("patTriggerProducer");
56  triggerAlgorithmCollectionToken_ = mayConsume<TriggerAlgorithmCollection>(tagTriggerProducer_);
57  triggerConditionCollectionToken_ = mayConsume<TriggerConditionCollection>(tagTriggerProducer_);
58  triggerPathCollectionToken_ = mayConsume<TriggerPathCollection>(tagTriggerProducer_);
59  triggerFilterCollectionToken_ = mayConsume<TriggerFilterCollection>(tagTriggerProducer_);
60  triggerObjectCollectionToken_ = mayConsume<TriggerObjectCollection>(tagTriggerProducer_);
61  if (iConfig.exists("condGtTag")) {
62  tagCondGt_ = iConfig.getParameter<InputTag>("condGtTag");
63  tagCondGtRunToken_ = mayConsume<ConditionsInRunBlock, InRun>(tagCondGt_);
64  tagCondGtLumiToken_ = mayConsume<ConditionsInLumiBlock, InLumi>(tagCondGt_);
65  tagCondGtEventToken_ = mayConsume<ConditionsInEventBlock>(tagCondGt_);
66  }
67  if (iConfig.exists("l1GtTag"))
68  tagL1Gt_ = iConfig.getParameter<InputTag>("l1GtTag");
69  l1GtToken_ = mayConsume<L1GlobalTriggerReadoutRecord>(tagL1Gt_);
70  if (iConfig.exists("patTriggerMatches"))
71  tagsTriggerMatcher_ = iConfig.getParameter<std::vector<InputTag> >("patTriggerMatches");
73  tagsTriggerMatcher_, [this](InputTag const& tag) { return mayConsume<TriggerObjectStandAloneMatch>(tag); });
74 
75  callWhenNewProductsRegistered([this](BranchDescription const& bd) {
76  if (not(this->autoProcessName_ and bd.processName() == this->moduleDescription().processName())) {
78  }
79  });
80 
81  for (size_t iMatch = 0; iMatch < tagsTriggerMatcher_.size(); ++iMatch) {
82  produces<TriggerObjectMatch>(tagsTriggerMatcher_.at(iMatch).label());
83  }
84  produces<TriggerEvent>();
85 }
edm::EDGetTokenT< TriggerObjectCollection > triggerObjectCollectionToken_
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
edm::EDGetTokenT< TriggerConditionCollection > triggerConditionCollectionToken_
edm::GetterOfProducts< edm::TriggerResults > triggerResultsGetter_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< TriggerPathCollection > triggerPathCollectionToken_
std::string const & processName() const
edm::EDGetTokenT< edm::ConditionsInEventBlock > tagCondGtEventToken_
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > l1GtToken_
edm::EDGetTokenT< TriggerAlgorithmCollection > triggerAlgorithmCollectionToken_
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::ConditionsInRunBlock condRun_
std::string const & label() const
Definition: InputTag.h:36
std::vector< edm::InputTag > tagsTriggerMatcher_
edm::EDGetTokenT< TriggerFilterCollection > triggerFilterCollectionToken_
edm::ConditionsInLumiBlock condLumi_
std::string const & instance() const
Definition: InputTag.h:37
pat::PATTriggerEventProducer::~PATTriggerEventProducer ( )
inlineoverride

Definition at line 50 of file PATTriggerEventProducer.h.

References beginLuminosityBlock(), beginRun(), iEvent, and produce().

50 {};

Member Function Documentation

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

Definition at line 152 of file PATTriggerEventProducer.cc.

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

Referenced by ~PATTriggerEventProducer().

152  {
153  // Terminate, if auto process name determination failed
154  if (nameProcess_ == "*")
155  return;
156 
157  gtCondLumiInit_ = false;
158  if (!tagCondGt_.label().empty()) {
159  Handle<ConditionsInLumiBlock> condLumiBlock;
160  iLuminosityBlock.getByToken(tagCondGtLumiToken_, condLumiBlock);
161  if (condLumiBlock.isValid()) {
162  condLumi_ = *condLumiBlock;
163  gtCondLumiInit_ = true;
164  } else {
165  LogError("conditionsInEdm") << "ConditionsInLumiBlock product with InputTag '" << tagCondGt_.encode()
166  << "' not in lumi";
167  }
168  }
169 }
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
std::string encode() const
Definition: InputTag.cc:159
bool isValid() const
Definition: HandleBase.h:70
std::string const & label() const
Definition: InputTag.h:36
edm::ConditionsInLumiBlock condLumi_
void PATTriggerEventProducer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 87 of file PATTriggerEventProducer.cc.

References autoProcessName_, condRun_, edm::InputTag::encode(), edm::ParameterSet::exists(), edm::Run::getByToken(), gtCondRunInit_, hltConfig_, hltConfigInit_, HLTConfigProvider::init(), HLT_2018_cff::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_.

Referenced by ~PATTriggerEventProducer().

87  {
88  // Initialize process name
89  if (autoProcessName_) {
90  // reset
91  nameProcess_ = "*";
92  // determine process name from last run TriggerSummaryProducerAOD module in process history of input
93  const ProcessHistory& processHistory(iRun.processHistory());
94  ProcessConfiguration processConfiguration;
95  ParameterSet processPSet;
96  // unbroken loop, which relies on time ordering (accepts the last found entry)
97  for (ProcessHistory::const_iterator iHist = processHistory.begin(); iHist != processHistory.end(); ++iHist) {
98  if (processHistory.getConfigurationForProcess(iHist->processName(), processConfiguration) &&
99  pset::Registry::instance()->getMapped(processConfiguration.parameterSetID(), processPSet) &&
100  processPSet.exists(tagTriggerEvent_.label())) {
101  nameProcess_ = iHist->processName();
102  LogDebug("autoProcessName") << "HLT process name '" << nameProcess_ << "' discovered";
103  }
104  }
105  // terminate, if nothing is found
106  if (nameProcess_ == "*") {
107  LogError("autoProcessName") << "trigger::TriggerEvent product with label '" << tagTriggerEvent_.label()
108  << "' not produced according to process history of input data\n"
109  << "No trigger information produced.";
110  return;
111  }
112  LogInfo("autoProcessName") << "HLT process name " << nameProcess_ << " used for PAT trigger information";
113  }
114  // adapt configuration of used input tags
115  if (tagTriggerResults_.process().empty() || tagTriggerResults_.process() == "*") {
117  } else if (tagTriggerEvent_.process() != nameProcess_) {
118  LogWarning("triggerResultsTag") << "TriggerResults process name '" << tagTriggerResults_.process()
119  << "' differs from HLT process name '" << nameProcess_ << "'";
120  }
121  if (tagTriggerEvent_.process().empty() || tagTriggerEvent_.process() == "*") {
123  } else if (tagTriggerEvent_.process() != nameProcess_) {
124  LogWarning("triggerEventTag") << "TriggerEvent process name '" << tagTriggerEvent_.process()
125  << "' differs from HLT process name '" << nameProcess_ << "'";
126  }
127 
128  gtCondRunInit_ = false;
129  if (!tagCondGt_.label().empty()) {
130  Handle<ConditionsInRunBlock> condRunBlock;
131  iRun.getByToken(tagCondGtRunToken_, condRunBlock);
132  if (condRunBlock.isValid()) {
133  condRun_ = *condRunBlock;
134  gtCondRunInit_ = true;
135  } else {
136  LogError("conditionsInEdm") << "ConditionsInRunBlock product with InputTag '" << tagCondGt_.encode()
137  << "' not in run";
138  }
139  }
140 
141  // Initialize HLTConfigProvider
142  hltConfigInit_ = false;
143  bool changed(true);
144  if (!hltConfig_.init(iRun, iSetup, nameProcess_, changed)) {
145  LogError("hltConfigExtraction") << "HLT config extraction error with process name '" << nameProcess_ << "'";
146  } else if (hltConfig_.size() <= 0) {
147  LogError("hltConfigSize") << "HLT config size error";
148  } else
149  hltConfigInit_ = true;
150 }
#define LogDebug(id)
unsigned int size() const
number of trigger paths in trigger table
collection_type::const_iterator const_iterator
static PFTauRenderPlugin instance
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string encode() const
Definition: InputTag.cc:159
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:315
ProcessHistory const & processHistory() const
Definition: Run.cc:106
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
bool isValid() const
Definition: HandleBase.h:70
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
edm::ConditionsInRunBlock condRun_
std::string const & label() const
Definition: InputTag.h:36
std::string const & process() const
Definition: InputTag.h:40
std::string const & instance() const
Definition: InputTag.h:37
void PATTriggerEventProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 171 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_, DEFINE_FWK_MODULE, edm::InputTag::encode(), edm::HLTGlobalStatus::error(), edm::EventSetup::get(), edm::Event::get(), edm::Event::getByLabel(), edm::Event::getByToken(), gtCondLumiInit_, gtCondRunInit_, L1GlobalTriggerReadoutRecord::gtFdlWord(), L1GtTriggerMenu::gtTriggerMenuName(), hltConfig_, hltConfigInit_, iEvent, bTagCombinedSVVariables_cff::indices, edm::EventBase::isRealData(), edm::HandleBase::isValid(), l1GtToken_, edm::InputTag::label(), edm::ConditionsInRunBlock::lhcFillNumber, eostools::move(), nameProcess_, L1GtFdlWord::physicsDeclared(), edm::Event::put(), 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().

Referenced by ~PATTriggerEventProducer().

171  {
172  // Terminate, if auto process name determination failed
173  if (nameProcess_ == "*")
174  return;
175 
176  if (!hltConfigInit_)
177  return;
178 
179  ESHandle<L1GtTriggerMenu> handleL1GtTriggerMenu;
180  iSetup.get<L1GtTriggerMenuRcd>().get(handleL1GtTriggerMenu);
181  Handle<TriggerResults> handleTriggerResults;
182  iEvent.getByLabel(tagTriggerResults_, handleTriggerResults);
183  // iEvent.getByToken( triggerResultsToken_, handleTriggerResults );
184  if (!handleTriggerResults.isValid()) {
185  LogError("triggerResultsValid") << "TriggerResults product with InputTag '" << tagTriggerResults_.encode()
186  << "' not in event\n"
187  << "No trigger information produced";
188  return;
189  }
190  Handle<TriggerAlgorithmCollection> handleTriggerAlgorithms;
191  iEvent.getByToken(triggerAlgorithmCollectionToken_, handleTriggerAlgorithms);
192  Handle<TriggerConditionCollection> handleTriggerConditions;
193  iEvent.getByToken(triggerConditionCollectionToken_, handleTriggerConditions);
194  Handle<TriggerPathCollection> handleTriggerPaths;
195  iEvent.getByToken(triggerPathCollectionToken_, handleTriggerPaths);
196  Handle<TriggerFilterCollection> handleTriggerFilters;
197  iEvent.getByToken(triggerFilterCollectionToken_, handleTriggerFilters);
198  Handle<TriggerObjectCollection> handleTriggerObjects;
199  iEvent.getByToken(triggerObjectCollectionToken_, handleTriggerObjects);
200 
201  bool physDecl(false);
202  if (iEvent.isRealData() && !tagL1Gt_.label().empty()) {
203  Handle<L1GlobalTriggerReadoutRecord> handleL1GlobalTriggerReadoutRecord;
204  iEvent.getByToken(l1GtToken_, handleL1GlobalTriggerReadoutRecord);
205  if (handleL1GlobalTriggerReadoutRecord.isValid()) {
206  L1GtFdlWord fdlWord = handleL1GlobalTriggerReadoutRecord->gtFdlWord();
207  if (fdlWord.physicsDeclared() == 1) {
208  physDecl = true;
209  }
210  } else {
211  LogError("l1GlobalTriggerReadoutRecordValid")
212  << "L1GlobalTriggerReadoutRecord product with InputTag '" << tagL1Gt_.encode() << "' not in event";
213  }
214  } else {
215  physDecl = true;
216  }
217 
218  // produce trigger event
219 
220  auto triggerEvent = std::make_unique<TriggerEvent>(handleL1GtTriggerMenu->gtTriggerMenuName(),
222  handleTriggerResults->wasrun(),
223  handleTriggerResults->accept(),
224  handleTriggerResults->error(),
225  physDecl);
226  // set product references to trigger collections
227  if (handleTriggerAlgorithms.isValid()) {
228  triggerEvent->setAlgorithms(handleTriggerAlgorithms);
229  } else {
230  LogError("triggerAlgorithmsValid") << "pat::TriggerAlgorithmCollection product with InputTag '"
231  << tagTriggerProducer_.encode() << "' not in event";
232  }
233  if (handleTriggerConditions.isValid()) {
234  triggerEvent->setConditions(handleTriggerConditions);
235  } else {
236  LogError("triggerConditionsValid") << "pat::TriggerConditionCollection product with InputTag '"
237  << tagTriggerProducer_.encode() << "' not in event";
238  }
239  if (handleTriggerPaths.isValid()) {
240  triggerEvent->setPaths(handleTriggerPaths);
241  } else {
242  LogError("triggerPathsValid") << "pat::TriggerPathCollection product with InputTag '"
243  << tagTriggerProducer_.encode() << "' not in event";
244  }
245  if (handleTriggerFilters.isValid()) {
246  triggerEvent->setFilters(handleTriggerFilters);
247  } else {
248  LogError("triggerFiltersValid") << "pat::TriggerFilterCollection product with InputTag '"
249  << tagTriggerProducer_.encode() << "' not in event";
250  }
251  if (handleTriggerObjects.isValid()) {
252  triggerEvent->setObjects(handleTriggerObjects);
253  } else {
254  LogError("triggerObjectsValid") << "pat::TriggerObjectCollection product with InputTag '"
255  << tagTriggerProducer_.encode() << "' not in event";
256  }
257  if (gtCondRunInit_) {
258  triggerEvent->setLhcFill(condRun_.lhcFillNumber);
259  triggerEvent->setBeamMode(condRun_.beamMode);
260  triggerEvent->setBeamMomentum(condRun_.beamMomentum);
261  triggerEvent->setBCurrentStart(condRun_.BStartCurrent);
262  triggerEvent->setBCurrentStop(condRun_.BStopCurrent);
263  triggerEvent->setBCurrentAvg(condRun_.BAvgCurrent);
264  }
265  if (gtCondLumiInit_) {
266  triggerEvent->setIntensityBeam1(condLumi_.totalIntensityBeam1);
267  triggerEvent->setIntensityBeam2(condLumi_.totalIntensityBeam2);
268  }
269  if (!tagCondGt_.label().empty()) {
270  Handle<ConditionsInEventBlock> condEventBlock;
271  iEvent.getByToken(tagCondGtEventToken_, condEventBlock);
272  if (condEventBlock.isValid()) {
273  triggerEvent->setBstMasterStatus(condEventBlock->bstMasterStatus);
274  triggerEvent->setTurnCount(condEventBlock->turnCountNumber);
275  } else {
276  LogError("conditionsInEdm") << "ConditionsInEventBlock product with InputTag '" << tagCondGt_.encode()
277  << "' not in event";
278  }
279  }
280 
281  // produce trigger match association and set references
282  if (handleTriggerObjects.isValid()) {
283  for (size_t iMatch = 0; iMatch < tagsTriggerMatcher_.size(); ++iMatch) {
284  const std::string labelTriggerObjectMatcher(tagsTriggerMatcher_.at(iMatch).label());
285  // copy trigger match association using TriggerObjectStandAlone to those using TriggerObject
286  // relying on the fact, that only one candidate collection is present in the association
287  Handle<TriggerObjectStandAloneMatch> handleTriggerObjectStandAloneMatch;
288  iEvent.getByToken(triggerMatcherTokens_.at(iMatch), handleTriggerObjectStandAloneMatch);
289  if (!handleTriggerObjectStandAloneMatch.isValid()) {
290  LogError("triggerMatchValid") << "pat::TriggerObjectStandAloneMatch product with InputTag '"
291  << labelTriggerObjectMatcher << "' not in event";
292  continue;
293  }
294  auto it = makeAssociativeIterator<reco::CandidateBaseRef>(*handleTriggerObjectStandAloneMatch, iEvent);
295  auto itEnd = it.end();
296  Handle<reco::CandidateView> handleCands;
297  if (it != itEnd)
298  iEvent.get(it->first.id(), handleCands);
299  std::vector<int> indices;
300  while (it != itEnd) {
301  indices.push_back(it->second.key());
302  ++it;
303  }
304  auto triggerObjectMatch = std::make_unique<TriggerObjectMatch>(handleTriggerObjects);
305  TriggerObjectMatch::Filler matchFiller(*triggerObjectMatch);
306  if (handleCands.isValid()) {
307  matchFiller.insert(handleCands, indices.begin(), indices.end());
308  }
309  matchFiller.fill();
310  OrphanHandle<TriggerObjectMatch> handleTriggerObjectMatch(
311  iEvent.put(std::move(triggerObjectMatch), labelTriggerObjectMatcher));
312  // set product reference to trigger match association
313  if (!handleTriggerObjectMatch.isValid()) {
314  LogError("triggerMatchValid") << "pat::TriggerObjectMatch product with InputTag '" << labelTriggerObjectMatcher
315  << "' not in event";
316  continue;
317  }
318  if (!(triggerEvent->addObjectMatchResult(handleTriggerObjectMatch, labelTriggerObjectMatcher))) {
319  LogWarning("triggerObjectMatchReplication")
320  << "pat::TriggerEvent contains already a pat::TriggerObjectMatch from matcher module '"
321  << labelTriggerObjectMatcher << "'";
322  }
323  }
324  }
325 
326  iEvent.put(std::move(triggerEvent));
327 }
const std::string & gtTriggerMenuName() const
edm::EDGetTokenT< TriggerObjectCollection > triggerObjectCollectionToken_
std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > triggerMatcherTokens_
bool wasrun() const
Was at least one path run?
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
edm::EDGetTokenT< TriggerConditionCollection > triggerConditionCollectionToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< TriggerPathCollection > triggerPathCollectionToken_
const std::string & tableName() const
HLT ConfDB table name.
bool isRealData() const
Definition: EventBase.h:62
std::string encode() const
Definition: InputTag.cc:159
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::ConditionsInEventBlock > tagCondGtEventToken_
bool error() const
Has any path encountered an error (exception)
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:334
bool isValid() const
Definition: HandleBase.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > l1GtToken_
edm::EDGetTokenT< TriggerAlgorithmCollection > triggerAlgorithmCollectionToken_
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:169
edm::ConditionsInRunBlock condRun_
std::string const & label() const
Definition: InputTag.h:36
std::vector< edm::InputTag > tagsTriggerMatcher_
T get() const
Definition: EventSetup.h:73
edm::EDGetTokenT< TriggerFilterCollection > triggerFilterCollectionToken_
edm::ConditionsInLumiBlock condLumi_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

bool pat::PATTriggerEventProducer::autoProcessName_
private

Definition at line 58 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 82 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and produce().

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

Definition at line 81 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

bool pat::PATTriggerEventProducer::gtCondLumiInit_
private

Definition at line 84 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and produce().

bool pat::PATTriggerEventProducer::gtCondRunInit_
private

Definition at line 83 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

HLTConfigProvider pat::PATTriggerEventProducer::hltConfig_
private

Definition at line 71 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

bool pat::PATTriggerEventProducer::hltConfigInit_
private

Definition at line 72 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 69 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

std::string pat::PATTriggerEventProducer::nameProcess_
private
edm::InputTag pat::PATTriggerEventProducer::tagCondGt_
private
edm::EDGetTokenT<edm::ConditionsInEventBlock> pat::PATTriggerEventProducer::tagCondGtEventToken_
private

Definition at line 80 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 79 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and PATTriggerEventProducer().

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

Definition at line 78 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 68 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 65 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 75 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 59 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 73 of file PATTriggerEventProducer.h.

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

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

Definition at line 60 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 61 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 63 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 66 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 64 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 62 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 74 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer().