CMS 3D CMS Logo

HLTTagAndProbeOfflineSource.cc
Go to the documentation of this file.
1 
4 
6 
15 
20 
22 
23 
24 
25 #include <vector>
26 #include <string>
27 
28 
29 template <typename TagType,typename TagCollType,typename ProbeType=TagType,typename ProbeCollType=TagCollType>
31  public:
33  ~HLTTagAndProbeOfflineSource() override =default;
36 
37  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
38 
39  void analyze(const edm::Event&, const edm::EventSetup&) override;
40  void bookHistograms(DQMStore::IBooker &, edm::Run const & run, edm::EventSetup const & c) override;
41  void dqmBeginRun(edm::Run const& run, edm::EventSetup const& c) override{}
42 
43 private:
44  std::vector<HLTDQMTagAndProbeEff<TagType,TagCollType,ProbeType,ProbeCollType> > tagAndProbeEffs_;
45 
46 };
47 
48 template <typename TagType,typename TagCollType,typename ProbeType,typename ProbeCollType>
51 {
52  auto histCollConfigs = config.getParameter<std::vector<edm::ParameterSet> >("tagAndProbeCollections");
53  for(auto& histCollConfig : histCollConfigs){
54  tagAndProbeEffs_.emplace_back(HLTDQMTagAndProbeEff<TagType,TagCollType,ProbeType,ProbeCollType>(histCollConfig,consumesCollector()));
55  }
56 }
57 
58 
59 template <typename TagType,typename TagCollType,typename ProbeType,typename ProbeCollType>
62 {
64  desc.add<edm::InputTag>("objs", edm::InputTag(""));
65  desc.addVPSet("tagAndProbeCollections",
67  std::vector<edm::ParameterSet>());
68 
69  // addDefault must be used here instead of add unless this function is specialized
70  // for different sets of template parameter types. Each specialization would need
71  // a different module label. Otherwise the generated cfi filenames will conflict
72  // for the different plugins.
73  descriptions.addDefault(desc);
74 }
75 
76 template <typename TagType,typename TagCollType,typename ProbeType,typename ProbeCollType>
79 {
80  for(auto& tpEff : tagAndProbeEffs_) tpEff.bookHists(iBooker);
81 }
82 
83 template <typename TagType,typename TagCollType,typename ProbeType,typename ProbeCollType>
86 {
87  for(auto& tpEff : tagAndProbeEffs_) tpEff.fill(event,setup);
88 }
89 
109 
T getParameter(std::string const &) const
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void analyze(const edm::Event &, const edm::EventSetup &) override
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
Definition: config.py:1
HLTTagAndProbeOfflineSource(const edm::ParameterSet &)
std::vector< HLTDQMTagAndProbeEff< TagType, TagCollType, ProbeType, ProbeCollType > > tagAndProbeEffs_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void addDefault(ParameterSetDescription const &psetDescription)
HLTTagAndProbeOfflineSource & operator=(const HLTTagAndProbeOfflineSource &)=delete
void dqmBeginRun(edm::Run const &run, edm::EventSetup const &c) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &run, edm::EventSetup const &c) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
~HLTTagAndProbeOfflineSource() override=default
Definition: event.py:1
Definition: Run.h:45
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)