30 nameProcess_( iConfig.getParameter< std::string >(
"processName" ) ),
31 autoProcessName_( nameProcess_ ==
"*" ),
32 tagTriggerProducer_(
"patTrigger" ),
33 tagsTriggerMatcher_(),
37 tagTriggerResults_(
"TriggerResults" ),
38 tagTriggerEvent_(
"hltTriggerSummaryAOD" ),
53 produces< TriggerEvent >();
71 if ( processHistory.getConfigurationForProcess( iHist->processName(), processConfiguration ) &&
72 pset::Registry::instance()->getMapped( processConfiguration.parameterSetID(), processPSet ) &&
81 LogError(
"autoProcessName" ) <<
"trigger::TriggerEvent product with label '" <<
tagTriggerEvent_.
label() <<
"' not produced according to process history of input data\n"
82 <<
"No trigger information produced.";
85 LogInfo(
"autoProcessName" ) <<
"HLT process name " <<
nameProcess_ <<
" used for PAT trigger information";
103 if ( condRunBlock.
isValid() ) {
107 LogError(
"conditionsInEdm" ) <<
"ConditionsInRunBlock product with InputTag '" <<
tagCondGt_.
encode() <<
"' not in run";
113 bool changed(
true );
115 LogError(
"hltConfigExtraction" ) <<
"HLT config extraction error with process name '" <<
nameProcess_ <<
"'";
117 LogError(
"hltConfigSize" ) <<
"HLT config size error";
132 if ( condLumiBlock.
isValid() ) {
136 LogError(
"conditionsInEdm" ) <<
"ConditionsInLumiBlock product with InputTag '" <<
tagCondGt_.
encode() <<
"' not in lumi";
155 if ( ! handleTriggerResults.
isValid() ) {
157 <<
"No trigger information produced";
172 assert( handleTriggerObjects->size() == handleTriggerObjectsStandAlone->size() );
174 bool physDecl(
false );
178 if ( handleL1GlobalTriggerReadoutRecord.
isValid() ) {
179 L1GtFdlWord fdlWord = handleL1GlobalTriggerReadoutRecord->gtFdlWord();
184 LogError(
"l1GlobalTriggerReadoutRecordValid" ) <<
"L1GlobalTriggerReadoutRecord product with InputTag '" <<
tagL1Gt_.
encode() <<
"' not in event";
193 std::auto_ptr< TriggerEvent > triggerEvent(
new TriggerEvent( handleL1GtTriggerMenu->gtTriggerMenuName(), std::string(
hltConfig_.
tableName() ), handleTriggerResults->wasrun(), handleTriggerResults->accept(), handleTriggerResults->error(), physDecl ) );
195 if ( handleTriggerAlgorithms.
isValid() ) {
196 triggerEvent->setAlgorithms( handleTriggerAlgorithms );
200 if ( handleTriggerConditions.
isValid() ) {
201 triggerEvent->setConditions( handleTriggerConditions );
205 if ( handleTriggerPaths.
isValid() ) {
206 triggerEvent->setPaths( handleTriggerPaths );
210 if ( handleTriggerFilters.
isValid() ) {
211 triggerEvent->setFilters( handleTriggerFilters );
215 if ( handleTriggerObjects.
isValid() ) {
216 triggerEvent->setObjects( handleTriggerObjects );
235 if ( condEventBlock.
isValid() ) {
236 triggerEvent->setBstMasterStatus( condEventBlock->bstMasterStatus );
237 triggerEvent->setTurnCount( condEventBlock->turnCountNumber );
239 LogError(
"conditionsInEdm" ) <<
"ConditionsInEventBlock product with InputTag '" <<
tagCondGt_.
encode() <<
"' not in event";
244 if ( handleTriggerObjects.
isValid() ) {
250 iEvent.
getByLabel( labelTriggerObjectMatcher, handleTriggerObjectStandAloneMatch );
251 if ( ! handleTriggerObjectStandAloneMatch.isValid() ) {
252 LogError(
"triggerMatchValid" ) <<
"pat::TriggerObjectStandAloneMatch product with InputTag '" << labelTriggerObjectMatcher <<
"' not in event";
257 if ( it != itEnd ) iEvent.
get( it->first.id(), handleCands );
258 std::vector< int > indices;
259 while ( it != itEnd ) {
260 indices.push_back( it->second.key() );
263 std::auto_ptr< TriggerObjectMatch > triggerObjectMatch(
new TriggerObjectMatch( handleTriggerObjects ) );
265 if ( handleCands.isValid() ) {
266 matchFiller.
insert( handleCands, indices.begin(), indices.
end() );
271 if ( ! handleTriggerObjectMatch.isValid() ) {
272 LogError(
"triggerMatchValid" ) <<
"pat::TriggerObjectMatch product with InputTag '" << labelTriggerObjectMatcher <<
"' not in event";
275 if ( ! ( triggerEvent->addObjectMatchResult( handleTriggerObjectMatch, labelTriggerObjectMatcher ) ) ) {
276 LogWarning(
"triggerObjectMatchReplication" ) <<
"pat::TriggerEvent contains already a pat::TriggerObjectMatch from matcher module '" << labelTriggerObjectMatcher <<
"'";
281 iEvent.
put( triggerEvent );
unsigned int size() const
number of trigger paths in trigger table
collection_type::const_iterator const_iterator
T getParameter(std::string const &) const
bool getByLabel(std::string const &label, Handle< PROD > &result) const
virtual void beginLuminosityBlock(edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup)
virtual void beginRun(edm::Run &iRun, const edm::EventSetup &iSetup)
edm::Association< TriggerObjectCollection > TriggerObjectMatch
Association of TriggerObjects to store matches to Candidates.
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
boost::uint32_t lhcFillNumber
bool exists(std::string const ¶meterName) const
checks if a parameter exists
boost::uint32_t totalIntensityBeam1
const std::string & tableName() const
HLT ConfDB table name.
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Produces the central entry point to full PAT trigger information.
edm::InputTag tagTriggerEvent_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
boost::uint32_t totalIntensityBeam2
Helper class that fetches some type of Ref given ProductID and index, using the edm::Event.
PATTriggerEventProducer(const edm::ParameterSet &iConfig)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
edm::InputTag tagTriggerProducer_
bool get(ProductID const &oid, Handle< PROD > &result) const
ProcessHistory const & processHistory() const
HLTConfigProvider hltConfig_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< edm::InputTag > tagsTriggerMatcher_
Analysis-level trigger event class.
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
edm::InputTag tagTriggerResults_
edm::ConditionsInRunBlock condRun_
const boost::uint16_t physicsDeclared() const
get/set "physics declared" bit
edm::ConditionsInLumiBlock condLumi_
boost::uint16_t beamMomentum