23 : processName_(ps.getParameter<std::
string>(
"processName")),
24 triggerName_(ps.getParameter<std::
string>(
"triggerName")),
25 triggerResultsTag_(ps.getParameter<edm::
InputTag>(
"triggerResults")),
26 triggerResultsToken_(consumes<edm::TriggerResults>(triggerResultsTag_)),
27 triggerEventTag_(ps.getParameter<edm::
InputTag>(
"triggerEvent")),
28 triggerEventToken_(consumes<trigger::TriggerEvent>(triggerEventTag_)),
29 hltPrescaleProvider_(ps, consumesCollector(), *this) {
33 LogVerbatim(
"HLTEventAnalyzerAOD") <<
"HLTEventAnalyzerAOD configuration: " << endl
51 desc.
add<
unsigned int>(
"stageL1Trigger", 1);
52 descriptions.
add(
"hltEventAnalyzerAODDefault", desc);
68 const unsigned int n(hltConfig.
size());
70 if (triggerIndex >=
n) {
72 <<
"HLTEventAnalyzerAOD::analyze:"
73 <<
" TriggerName " <<
triggerName_ <<
" not available in (new) config!" << endl;
74 LogVerbatim(
"HLTEventAnalyzerAOD") <<
"Available TriggerNames are: " << endl;
75 hltConfig.
dump(
"Triggers");
78 hltConfig.
dump(
"ProcessName");
79 hltConfig.
dump(
"GlobalTag");
80 hltConfig.
dump(
"TableName");
81 hltConfig.
dump(
"Streams");
82 hltConfig.
dump(
"Datasets");
83 hltConfig.
dump(
"PrescaleTable");
84 hltConfig.
dump(
"ProcessPSet");
87 LogVerbatim(
"HLTEventAnalyzerAOD") <<
"HLTEventAnalyzerAOD::analyze:"
88 <<
" config extraction failure with process name " <<
processName_ << endl;
103 <<
"HLTEventAnalyzerAOD::analyze: Error in getting TriggerResults product from Event!" << endl;
109 <<
"HLTEventAnalyzerAOD::analyze: Error in getting TriggerEvent product from Event!" << endl;
121 for (
unsigned int i = 0;
i !=
n; ++
i) {
136 using namespace reco;
137 using namespace trigger;
144 const unsigned int triggerIndex(
hltConfig.triggerIndex(triggerName));
148 if (triggerIndex >=
n) {
149 LogVerbatim(
"HLTEventAnalyzerAOD") <<
"HLTEventAnalyzerAOD::analyzeTrigger: path " << triggerName <<
" - not found!"
155 LogVerbatim(
"HLTEventAnalyzerAOD") <<
"HLTEventAnalyzerAOD::analyzeTrigger: path " << triggerName <<
" ["
156 << triggerIndex <<
"] "
158 const std::pair<std::vector<std::pair<std::string, int> >,
int> prescalesInDetail(
160 std::ostringstream message;
161 for (
unsigned int i = 0;
i < prescalesInDetail.first.size(); ++
i) {
162 message <<
" " <<
i <<
":" << prescalesInDetail.first[
i].first <<
"/" << prescalesInDetail.first[
i].second;
164 LogVerbatim(
"HLTEventAnalyzerAOD") <<
"HLTEventAnalyzerAOD::analyzeTrigger: path " << triggerName <<
" ["
165 << triggerIndex <<
"] " << endl
166 <<
"prescales L1T: " << prescalesInDetail.first.size() << message.str() << endl
167 <<
" prescale HLT: " << prescalesInDetail.second << endl;
170 const unsigned int m(
hltConfig.size(triggerIndex));
171 const vector<string>& moduleLabels(
hltConfig.moduleLabels(triggerIndex));
174 LogVerbatim(
"HLTEventAnalyzerAOD") <<
" Trigger path status:"
179 LogVerbatim(
"HLTEventAnalyzerAOD") <<
" Last active module - label/type: " << moduleLabels[moduleIndex] <<
"/"
180 <<
hltConfig.moduleType(moduleLabels[moduleIndex]) <<
" [" << moduleIndex
181 <<
" out of 0-" << (
m - 1) <<
" on this path]" << endl;
186 for (
unsigned int j = 0;
j <= moduleIndex; ++
j) {
187 const string& moduleLabel(moduleLabels[
j]);
188 const string moduleType(
hltConfig.moduleType(moduleLabel));
191 if (filterIndex < triggerEventHandle_->sizeFilters()) {
192 LogVerbatim(
"HLTEventAnalyzerAOD") <<
" 'L3' filter in slot " << j <<
" - label/type " << moduleLabel <<
"/"
193 << moduleType << endl;
200 LogVerbatim(
"HLTEventAnalyzerAOD") <<
" " << n <<
" accepted 'L3' objects found: " << endl;
204 LogVerbatim(
"HLTEventAnalyzerAOD") <<
" " << i <<
" " << VIDS[
i] <<
"/" << KEYS[
i] <<
": " << TO.
id() <<
" "
205 << TO.
pt() <<
" " << TO.
eta() <<
" " << TO.
phi() <<
" " << TO.
mass() << endl;
unsigned int size() const
number of trigger paths in trigger table
Log< level::Info, true > LogVerbatim
void dump(const std::string &what) const
Dumping config info to cout.
virtual void analyzeTrigger(const edm::Event &, const edm::EventSetup &, const std::string &triggerName)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::InputTag triggerResultsTag_
const edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string triggerName_
unsigned int triggerIndex(std::string_view name) const
std::pair< std::vector< std::pair< std::string, TL1 > >, THLT > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
edm::Handle< trigger::TriggerEvent > triggerEventHandle_
const std::string processName_
module config parameters
HLTPrescaleProvider hltPrescaleProvider_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
const edm::InputTag triggerEventTag_
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.
void beginRun(edm::Run const &, edm::EventSetup const &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< trigger::TriggerEvent > triggerEventToken_
edm::Handle< edm::TriggerResults > triggerResultsHandle_
additional class data memebers
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
~HLTEventAnalyzerAOD() override
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< size_type > Keys
HLTEventAnalyzerAOD(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLTConfigProvider const & hltConfigProvider() const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)