File indexing completed on 2023-03-17 10:58:28
0001 #ifndef DQMOnline_Trigger_HLTDQMHistTnPColl_h
0002 #define DQMOnline_Trigger_HLTDQMHistTnPColl_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022
0023 #include "DQMOffline/Trigger/interface/HLTDQMFilterEffHists.h"
0024 #include "DQMOffline/Trigger/interface/UtilFuncs.h"
0025
0026 #include <string>
0027
0028 template <typename TagType, typename ProbeType = TagType>
0029 class HLTDQMFilterTnPEffHists {
0030 public:
0031 typedef dqm::legacy::MonitorElement MonitorElement;
0032 typedef dqm::legacy::DQMStore DQMStore;
0033
0034 HLTDQMFilterTnPEffHists(const edm::ParameterSet& config,
0035 const std::string& baseHistName,
0036 const std::string& hltProcess)
0037 : histColl_(config, baseHistName, hltProcess),
0038 tagExtraFilter_(config.getParameter<std::string>("tagExtraFilter")),
0039 hltProcess_(hltProcess) {}
0040
0041 static edm::ParameterSetDescription makePSetDescription() {
0042 edm::ParameterSetDescription desc = HLTDQMFilterEffHists<ProbeType>::makePSetDescription();
0043 desc.add<std::string>("tagExtraFilter", "");
0044 return desc;
0045 }
0046 static edm::ParameterSetDescription makePSetDescriptionHistConfigs() {
0047 return HLTDQMFilterEffHists<ProbeType>::makePSetDescriptionHistConfigs();
0048 }
0049
0050 void bookHists(DQMStore::IBooker& iBooker, const std::vector<edm::ParameterSet>& histConfigs) {
0051 histColl_.bookHists(iBooker, histConfigs);
0052 }
0053 void fillHists(const TagType& tag,
0054 const ProbeType& probe,
0055 const edm::Event& event,
0056 const edm::EventSetup& setup,
0057 const trigger::TriggerEvent& trigEvt) {
0058 if (tagExtraFilter_.empty() || hltdqm::passTrig(tag.eta(), tag.phi(), trigEvt, tagExtraFilter_, hltProcess_)) {
0059 histColl_.fillHists(probe, event, setup, trigEvt);
0060 }
0061 }
0062
0063 private:
0064
0065 HLTDQMFilterEffHists<ProbeType> histColl_;
0066 std::string tagExtraFilter_;
0067
0068
0069 std::string hltProcess_;
0070 };
0071
0072 #endif