CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATTriggerEventProducer (const edm::ParameterSet &iConfig)
 
 ~PATTriggerEventProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginLuminosityBlock (const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
 
virtual void beginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
virtual 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
< L1GlobalTriggerReadoutRecord
l1GtToken_
 
std::string nameProcess_
 
edm::InputTag tagCondGt_
 
edm::EDGetTokenT
< edm::ConditionsInEventBlock
tagCondGtEventToken_
 
edm::EDGetTokenT
< edm::ConditionsInLumiBlock
tagCondGtLumiToken_
 
edm::EDGetTokenT
< edm::ConditionsInRunBlock
tagCondGtRunToken_
 
edm::InputTag tagL1Gt_
 
std::vector< edm::InputTagtagsTriggerMatcher_
 
edm::InputTag tagTriggerEvent_
 
edm::InputTag tagTriggerProducer_
 
edm::InputTag tagTriggerResults_
 
edm::EDGetTokenT
< TriggerAlgorithmCollection
triggerAlgorithmCollectionToken_
 
edm::EDGetTokenT
< TriggerConditionCollection
triggerConditionCollectionToken_
 
edm::EDGetTokenT
< TriggerFilterCollection
triggerFilterCollectionToken_
 
std::vector< edm::EDGetTokenT
< TriggerObjectStandAloneMatch > > 
triggerMatcherTokens_
 
edm::EDGetTokenT
< TriggerObjectCollection
triggerObjectCollectionToken_
 
edm::EDGetTokenT
< TriggerPathCollection
triggerPathCollectionToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 49 of file PATTriggerEventProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file PATTriggerEventProducer.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), l1GtToken_, GlobalPosition_Frontier_DevDB_cff::tag, tagCondGt_, tagCondGtEventToken_, tagCondGtLumiToken_, tagCondGtRunToken_, tagL1Gt_, tagsTriggerMatcher_, tagTriggerEvent_, tagTriggerProducer_, tagTriggerResults_, triggerAlgorithmCollectionToken_, triggerConditionCollectionToken_, triggerFilterCollectionToken_, triggerMatcherTokens_, triggerObjectCollectionToken_, triggerPathCollectionToken_, and edm::vector_transform().

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

Definition at line 54 of file PATTriggerEventProducer.h.

54 {};

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 140 of file PATTriggerEventProducer.cc.

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

141 {
142 
143  // Terminate, if auto process name determination failed
144  if ( nameProcess_ == "*" ) return;
145 
146  gtCondLumiInit_ = false;
147  if ( ! tagCondGt_.label().empty() ) {
148  Handle< ConditionsInLumiBlock > condLumiBlock;
149  iLuminosityBlock.getByToken( tagCondGtLumiToken_, condLumiBlock );
150  if ( condLumiBlock.isValid() ) {
151  condLumi_ = *condLumiBlock;
152  gtCondLumiInit_ = true;
153  } else {
154  LogError( "conditionsInEdm" ) << "ConditionsInLumiBlock product with InputTag '" << tagCondGt_.encode() << "' not in lumi";
155  }
156  }
157 
158 }
edm::EDGetTokenT< edm::ConditionsInLumiBlock > tagCondGtLumiToken_
std::string encode() const
Definition: InputTag.cc:164
bool isValid() const
Definition: HandleBase.h:76
std::string const & label() const
Definition: InputTag.h:42
edm::ConditionsInLumiBlock condLumi_
void PATTriggerEventProducer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 75 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::processConfiguration, edm::Run::processHistory(), HLTConfigProvider::size(), tagCondGt_, tagCondGtRunToken_, tagTriggerEvent_, and tagTriggerResults_.

76 {
77 
78  // Initialize process name
79  if ( autoProcessName_ ) {
80  // reset
81  nameProcess_ = "*";
82  // determine process name from last run TriggerSummaryProducerAOD module in process history of input
83  const ProcessHistory & processHistory( iRun.processHistory() );
85  ParameterSet processPSet;
86  // unbroken loop, which relies on time ordering (accepts the last found entry)
87  for ( ProcessHistory::const_iterator iHist = processHistory.begin(); iHist != processHistory.end(); ++iHist ) {
88  if ( processHistory.getConfigurationForProcess( iHist->processName(), processConfiguration ) &&
89  pset::Registry::instance()->getMapped( processConfiguration.parameterSetID(), processPSet ) &&
90  processPSet.exists( tagTriggerEvent_.label() )
91  ) {
92  nameProcess_ = iHist->processName();
93  LogDebug( "autoProcessName" ) << "HLT process name '" << nameProcess_ << "' discovered";
94  }
95  }
96  // terminate, if nothing is found
97  if ( nameProcess_ == "*" ) {
98  LogError( "autoProcessName" ) << "trigger::TriggerEvent product with label '" << tagTriggerEvent_.label() << "' not produced according to process history of input data\n"
99  << "No trigger information produced.";
100  return;
101  }
102  LogInfo( "autoProcessName" ) << "HLT process name " << nameProcess_ << " used for PAT trigger information";
103  }
104  // adapt configuration of used input tags
105  if ( tagTriggerResults_.process().empty() || tagTriggerResults_.process() == "*" ) {
107  } else if ( tagTriggerEvent_.process() != nameProcess_ ) {
108  LogWarning( "triggerResultsTag" ) << "TriggerResults process name '" << tagTriggerResults_.process() << "' differs from HLT process name '" << nameProcess_ << "'";
109  }
110 // triggerResultsToken_ = mayConsume< TriggerResults >( tagTriggerResults_ ); // FIXME: This works only in the c'tor!
111  if ( tagTriggerEvent_.process().empty() || tagTriggerEvent_.process() == "*" ) {
113  } else if ( tagTriggerEvent_.process() != nameProcess_ ) {
114  LogWarning( "triggerEventTag" ) << "TriggerEvent process name '" << tagTriggerEvent_.process() << "' differs from HLT process name '" << nameProcess_ << "'";
115  }
116 
117  gtCondRunInit_ = false;
118  if ( ! tagCondGt_.label().empty() ) {
119  Handle< ConditionsInRunBlock > condRunBlock;
120  iRun.getByToken( tagCondGtRunToken_, condRunBlock );
121  if ( condRunBlock.isValid() ) {
122  condRun_ = *condRunBlock;
123  gtCondRunInit_ = true;
124  } else {
125  LogError( "conditionsInEdm" ) << "ConditionsInRunBlock product with InputTag '" << tagCondGt_.encode() << "' not in run";
126  }
127  }
128 
129  // Initialize HLTConfigProvider
130  hltConfigInit_ = false;
131  bool changed( true );
132  if ( ! hltConfig_.init( iRun, iSetup, nameProcess_, changed ) ) {
133  LogError( "hltConfigExtraction" ) << "HLT config extraction error with process name '" << nameProcess_ << "'";
134  } else if ( hltConfig_.size() <= 0 ) {
135  LogError( "hltConfigSize" ) << "HLT config size error";
136  } else hltConfigInit_ = true;
137 
138 }
#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
processConfiguration
Definition: Schedule.cc:362
std::string encode() const
Definition: InputTag.cc:164
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:239
ProcessHistory const & processHistory() const
Definition: Run.cc:108
bool isValid() const
Definition: HandleBase.h:76
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:42
std::string const & process() const
Definition: InputTag.h:46
std::string const & instance() const
Definition: InputTag.h:43
void PATTriggerEventProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 161 of file PATTriggerEventProducer.cc.

References edm::ConditionsInRunBlock::BAvgCurrent, edm::ConditionsInRunBlock::beamMode, edm::ConditionsInRunBlock::beamMomentum, edm::ConditionsInRunBlock::BStartCurrent, edm::ConditionsInRunBlock::BStopCurrent, condLumi_, condRun_, edm::InputTag::encode(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::end(), edm::helper::Filler< Map >::fill(), edm::EventSetup::get(), edm::Event::get(), edm::Event::getByLabel(), edm::Event::getByToken(), gtCondLumiInit_, gtCondRunInit_, hltConfig_, hltConfigInit_, edm::helper::Filler< Map >::insert(), edm::EventBase::isRealData(), edm::HandleBase::isValid(), l1GtToken_, edm::InputTag::label(), edm::ConditionsInRunBlock::lhcFillNumber, 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_, and triggerPathCollectionToken_.

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

Member Data Documentation

bool pat::PATTriggerEventProducer::autoProcessName_
private

Definition at line 63 of file PATTriggerEventProducer.h.

Referenced by beginRun().

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

Definition at line 87 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and produce().

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

Definition at line 86 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

bool pat::PATTriggerEventProducer::gtCondLumiInit_
private

Definition at line 89 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and produce().

bool pat::PATTriggerEventProducer::gtCondRunInit_
private

Definition at line 88 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

HLTConfigProvider pat::PATTriggerEventProducer::hltConfig_
private

Definition at line 76 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

bool pat::PATTriggerEventProducer::hltConfigInit_
private

Definition at line 77 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 74 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 62 of file PATTriggerEventProducer.h.

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

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

Definition at line 85 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 84 of file PATTriggerEventProducer.h.

Referenced by beginLuminosityBlock(), and PATTriggerEventProducer().

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

Definition at line 83 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 73 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 70 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 80 of file PATTriggerEventProducer.h.

Referenced by beginRun(), and PATTriggerEventProducer().

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

Definition at line 64 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 78 of file PATTriggerEventProducer.h.

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

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

Definition at line 65 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 66 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 68 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 71 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 69 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().

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

Definition at line 67 of file PATTriggerEventProducer.h.

Referenced by PATTriggerEventProducer(), and produce().