23 triggerName_(ps.getParameter<
std::
string>(
"triggerName")),
24 hltPrescaleProvider_(ps, consumesCollector(), *this) {
29 produces<reco::CandidateCollection>();
42 edm::LogError(
"CandidateTriggerObjectProducer") <<
"Error! Can't initialize HLTConfigProvider";
60 if (!triggerResultsHandle.
isValid()) {
62 <<
"CandidateTriggerObjectProducer::analyze: Error in getting TriggerResults product from Event!";
67 if (!triggerEventHandle.
isValid()) {
69 <<
"CandidateTriggerObjectProducer::analyze: Error in getting TriggerEvent product from Event!";
81 std::vector<std::string> activeHLTPathsInThisEvent =
hltConfig.triggerNames();
82 std::map<std::string, bool> triggerInMenu;
83 std::map<std::string, bool> triggerUnprescaled;
85 for (std::vector<std::string>::const_iterator iHLT = activeHLTPathsInThisEvent.begin();
86 iHLT != activeHLTPathsInThisEvent.end();
89 if (TString(*iHLT).Contains(TRegexp(TString(
triggerName_)))) {
90 triggerInMenu[*iHLT] =
true;
93 triggerUnprescaled[*iHLT] =
true;
97 for (std::map<std::string, bool>::const_iterator iMyHLT = triggerInMenu.begin(); iMyHLT != triggerInMenu.end();
100 if (!(iMyHLT->second && triggerUnprescaled[iMyHLT->first]))
102 const unsigned int triggerIndex(
hltConfig.triggerIndex(iMyHLT->first));
104 assert(triggerIndex ==
iEvent.triggerNames(*triggerResultsHandle).triggerIndex(iMyHLT->first));
107 if (triggerIndex >=
n) {
109 <<
"CandidateTriggerObjectProducer::analyzeTrigger: path " <<
triggerName_ <<
" - not found!";
115 const std::vector<std::string>& moduleLabels(
hltConfig.saveTagsModules(triggerIndex));
118 if (!(triggerResultsHandle->
wasrun(triggerIndex)) || !(triggerResultsHandle->
accept(triggerIndex)) ||
119 (triggerResultsHandle->
error(triggerIndex))) {
128 for (
unsigned int imodule = 0; imodule < moduleLabels.size(); ++imodule) {
132 if (moduleType.find(
"Level1GTSeed") != std::string::npos)
136 if (filterIndex < triggerEventHandle->sizeFilters()) {
139 const Vids& VIDS(triggerEventHandle->
filterIds(filterIndex));
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
bool error() const
Has any path encountered an error (exception)
const std::string processName_
HLTConfigProvider const & hltConfigProvider() const
CandidateTriggerObjectProducer(const edm::ParameterSet &)
Log< level::Error, false > LogError
const LorentzVector & p4() const
four-momentum Lorentz vector
bool wasrun() const
Was at least one path run?
unsigned int size() const
Get number of paths stored.
void produce(edm::Event &, const edm::EventSetup &) override
std::pair< TL1, THLT > 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.
math::XYZPoint Point
point in the space
const TriggerObjectCollection & getObjects() const
HLTPrescaleProvider hltPrescaleProvider_
additional class data memebers
#define DEFINE_FWK_MODULE(type)
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)
const Vids & filterIds(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
const edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
module config parameters
std::vector< size_type > Keys
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
const std::string triggerName_
~CandidateTriggerObjectProducer() override
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
const edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_