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));