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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 50 of file PATTriggerEventProducer.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file PATTriggerEventProducer.cc.

References autoProcessName_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), 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().

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

Definition at line 55 of file PATTriggerEventProducer.h.

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

55 {};

Member Function Documentation

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

Definition at line 148 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().

149 {
150 
151  // Terminate, if auto process name determination failed
152  if ( nameProcess_ == "*" ) return;
153 
154  gtCondLumiInit_ = false;
155  if ( ! tagCondGt_.label().empty() ) {
156  Handle< ConditionsInLumiBlock > condLumiBlock;
157  iLuminosityBlock.getByToken( tagCondGtLumiToken_, condLumiBlock );
158  if ( condLumiBlock.isValid() ) {
159  condLumi_ = *condLumiBlock;
160  gtCondLumiInit_ = true;
161  } else {
162  LogError( "conditionsInEdm" ) << "ConditionsInLumiBlock product with InputTag '" << tagCondGt_.encode() << "' not in lumi";
163  }
164  }
165 
166 }
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
std::string encode() const
Definition: InputTag.cc:159
bool isValid() const
Definition: HandleBase.h:74
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 84 of file PATTriggerEventProducer.cc.

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

85 {
86 
87  // Initialize process name
88  if ( autoProcessName_ ) {
89  // reset
90  nameProcess_ = "*";
91  // determine process name from last run TriggerSummaryProducerAOD module in process history of input
92  const ProcessHistory & processHistory( iRun.processHistory() );
93  ProcessConfiguration processConfiguration;
94  ParameterSet processPSet;
95  // unbroken loop, which relies on time ordering (accepts the last found entry)
96  for ( ProcessHistory::const_iterator iHist = processHistory.begin(); iHist != processHistory.end(); ++iHist ) {
97  if ( processHistory.getConfigurationForProcess( iHist->processName(), processConfiguration ) &&
98  pset::Registry::instance()->getMapped( processConfiguration.parameterSetID(), processPSet ) &&
99  processPSet.exists( tagTriggerEvent_.label() )
100  ) {
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() << "' not produced according to process history of input data\n"
108  << "No trigger information produced.";
109  return;
110  }
111  LogInfo( "autoProcessName" ) << "HLT process name " << nameProcess_ << " used for PAT trigger information";
112  }
113  // adapt configuration of used input tags
114  if ( tagTriggerResults_.process().empty() || tagTriggerResults_.process() == "*" ) {
116  } else if ( tagTriggerEvent_.process() != nameProcess_ ) {
117  LogWarning( "triggerResultsTag" ) << "TriggerResults process name '" << tagTriggerResults_.process() << "' differs from HLT process name '" << nameProcess_ << "'";
118  }
119  if ( tagTriggerEvent_.process().empty() || tagTriggerEvent_.process() == "*" ) {
121  } else if ( tagTriggerEvent_.process() != nameProcess_ ) {
122  LogWarning( "triggerEventTag" ) << "TriggerEvent process name '" << tagTriggerEvent_.process() << "' differs from HLT process name '" << nameProcess_ << "'";
123  }
124 
125  gtCondRunInit_ = false;
126  if ( ! tagCondGt_.label().empty() ) {
127  Handle< ConditionsInRunBlock > condRunBlock;
128  iRun.getByToken( tagCondGtRunToken_, condRunBlock );
129  if ( condRunBlock.isValid() ) {
130  condRun_ = *condRunBlock;
131  gtCondRunInit_ = true;
132  } else {
133  LogError( "conditionsInEdm" ) << "ConditionsInRunBlock product with InputTag '" << tagCondGt_.encode() << "' not in run";
134  }
135  }
136 
137  // Initialize HLTConfigProvider
138  hltConfigInit_ = false;
139  bool changed( true );
140  if ( ! hltConfig_.init( iRun, iSetup, nameProcess_, changed ) ) {
141  LogError( "hltConfigExtraction" ) << "HLT config extraction error with process name '" << nameProcess_ << "'";
142  } else if ( hltConfig_.size() <= 0 ) {
143  LogError( "hltConfigSize" ) << "HLT config size error";
144  } else hltConfigInit_ = true;
145 
146 }
#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
bool isValid() const
Definition: HandleBase.h:74
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
edm::ConditionsInRunBlock condRun_
edm::EDGetTokenT< edm::ConditionsInRunBlock > tagCondGtRunToken_
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 169 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, 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_, triggerFilterCollectionToken_, triggerMatcherTokens_, triggerObjectCollectionToken_, triggerPathCollectionToken_, edm::ConditionsInEventBlock::turnCountNumber, and edm::HLTGlobalStatus::wasrun().

Referenced by ~PATTriggerEventProducer().

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

Member Data Documentation

bool pat::PATTriggerEventProducer::autoProcessName_
private

Definition at line 64 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 88 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and produce().

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

Definition at line 87 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

bool pat::PATTriggerEventProducer::gtCondLumiInit_
private

Definition at line 90 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and produce().

bool pat::PATTriggerEventProducer::gtCondRunInit_
private

Definition at line 89 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

HLTConfigProvider pat::PATTriggerEventProducer::hltConfig_
private

Definition at line 77 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

bool pat::PATTriggerEventProducer::hltConfigInit_
private

Definition at line 78 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 75 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 86 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 85 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and PATTriggerEventProducer().

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

Definition at line 84 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 74 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 71 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 81 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 65 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 79 of file PATTriggerEventProducer.h.

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

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

Definition at line 66 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 67 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 69 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 72 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 70 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 68 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 80 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer().