21 triggerResultsToken_(consumes<
edm::TriggerResults>(ps.getParameter<
edm::InputTag>(
"triggerResults"))),
22 triggerEventTag_(ps.getParameter<
edm::InputTag>(
"triggerEvent")),
23 triggerEventToken_(consumes<
trigger::TriggerEvent>(triggerEventTag_)),
24 triggerName_(ps.getParameter<
std::
string>(
"triggerName")),
25 hltPrescaleProvider_(ps, consumesCollector(), *this)
32 produces<reco::CandidateCollection>();
51 "Error! Can't initialize HLTConfigProvider";
72 edm::LogError(
"CandidateTriggerObjectProducer" ) <<
"CandidateTriggerObjectProducer::analyze: Error in getting TriggerResults product from Event!" ;
77 edm::LogError(
"CandidateTriggerObjectProducer" ) <<
"CandidateTriggerObjectProducer::analyze: Error in getting TriggerEvent product from Event!" ;
88 const unsigned int n(hltConfig.
size());
89 std::vector<std::string> activeHLTPathsInThisEvent = hltConfig.
triggerNames();
90 std::map<std::string, bool> triggerInMenu;
91 std::map<std::string, bool> triggerUnprescaled;
93 for (std::vector<std::string>::const_iterator iHLT = activeHLTPathsInThisEvent.begin();
94 iHLT != activeHLTPathsInThisEvent.end(); ++iHLT)
97 if (TString(*iHLT).Contains(TRegexp(TString(
triggerName_))))
99 triggerInMenu[*iHLT] =
true;
101 if (prescales.first * prescales.second == 1)
102 triggerUnprescaled[*iHLT] =
true;
106 for (std::map<std::string, bool>::const_iterator iMyHLT = triggerInMenu.begin();
107 iMyHLT != triggerInMenu.end(); ++iMyHLT)
110 if (!(iMyHLT->second && triggerUnprescaled[iMyHLT->first]))
112 const unsigned int triggerIndex(hltConfig.
triggerIndex(iMyHLT->first));
117 if (triggerIndex>=
n) {
118 edm::LogError(
"CandidateTriggerObjectProducer" ) <<
"CandidateTriggerObjectProducer::analyzeTrigger: path " 125 const std::vector<std::string>& moduleLabels(hltConfig.
saveTagsModules(triggerIndex));
140 for (
unsigned int imodule=0;imodule<moduleLabels.size();++imodule)
142 const std::string& moduleLabel(moduleLabels[imodule]);
145 if (moduleType.find(
"Level1GTSeed") != std::string::npos)
149 if (filterIndex<triggerEventHandle_->sizeFilters()) {
unsigned int size() const
number of trigger paths in trigger table
bool wasrun() const
Was at least one path run?
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const std::string moduleType(const std::string &module) const
C++ class name of module.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
reco::Particle particle(reco::Particle::Charge q=0, const reco::Particle::Point &vertex=reco::Particle::Point(0, 0, 0), int status=0, bool integerCharge=true) const
edm::Handle< edm::TriggerResults > triggerResultsHandle_
additional class data memebers
CandidateTriggerObjectProducer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
const LorentzVector & p4() const
four-momentum Lorentz vector
edm::Handle< trigger::TriggerEvent > triggerEventHandle_
const std::vector< std::string > & saveTagsModules(unsigned int trigger) const
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
const Vids & filterIds(trigger::size_type index) const
#define DEFINE_FWK_MODULE(type)
unsigned int triggerIndex(std::string const &name) const
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_
const TriggerObjectCollection & getObjects() const
unsigned int size() const
Get number of paths stored.
bool error() const
Has any path encountered an error (exception)
math::XYZPoint Point
point in the space
edm::InputTag triggerEventTag_
HLTPrescaleProvider hltPrescaleProvider_
void beginRun(const edm::Run &iRun, edm::EventSetup const &iSetup) override
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< size_type > Keys
std::pair< int, int > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
HLTConfigProvider const & hltConfigProvider() const
~CandidateTriggerObjectProducer() override
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)