CMS 3D CMS Logo

EDMtoMEConverter.h
Go to the documentation of this file.
1 #ifndef EDMtoMEConverter_h
2 #define EDMtoMEConverter_h
3 
12 // framework & common header files
27 
28 //DQM services
32 
33 // data format
36 
37 // helper files
38 #include <iostream>
39 #include <cstdlib>
40 #include <string>
41 #include <memory>
42 #include <vector>
43 #include <map>
44 #include <tuple>
45 
46 #include "TString.h"
47 #include "TList.h"
48 
49 #include "classlib/utils/StringList.h"
50 #include "classlib/utils/StringOps.h"
51 
52 class EDMtoMEConverter : public edm::one::EDProducer<edm::one::WatchRuns,
53  edm::one::WatchLuminosityBlocks,
54  edm::one::SharedResources,
55  edm::EndLuminosityBlockProducer,
56  edm::EndRunProducer>
57 {
58 
59  public:
60 
61  explicit EDMtoMEConverter(const edm::ParameterSet&);
62  ~EDMtoMEConverter() override;
63 
64  void beginJob() final {};
65  void endJob() final {};
66  void beginRun(const edm::Run&, const edm::EventSetup&) final {};
67  void endRun(const edm::Run&, const edm::EventSetup&) final {};
70  void produce(edm::Event&, edm::EventSetup const&) final {};
71 
73  void endRunProduce(edm::Run& run, edm::EventSetup const& setup) override;
74 
75  template <class T>
76  void getData(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, T& iGetFrom);
77 
78  using TagList = std::vector<uint32_t>;
79 
80  private:
81 
83  int verbosity;
84  int frequency;
85 
88 
89  template <typename T>
90  class Tokens {
91  public:
92  using type = T;
94 
95  Tokens() = default;
96 
97  void set(const edm::InputTag& runInputTag, const edm::InputTag& lumiInputTag, edm::ConsumesCollector& iC);
98 
99  void getData(const edm::Run& iRun, edm::Handle<Product>& handle) const;
100  void getData(const edm::LuminosityBlock& iLumi, edm::Handle<Product>& handle) const;
101 
102  private:
105  };
106 
107  std::tuple<
108  Tokens<TH1F>,
109  Tokens<TH1S>,
110  Tokens<TH1D>,
111  Tokens<TH2F>,
112  Tokens<TH2S>,
113  Tokens<TH2D>,
114  Tokens<TH3F>,
118  Tokens<int>,
122 
125 }; // end class declaration
126 
127 #endif
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) final
void endLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) override
EDMtoMEConverter(const edm::ParameterSet &)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
void beginRun(const edm::Run &, const edm::EventSetup &) final
~EDMtoMEConverter() override
void endRunProduce(edm::Run &run, edm::EventSetup const &setup) override
std::tuple< Tokens< TH1F >, Tokens< TH1S >, Tokens< TH1D >, Tokens< TH2F >, Tokens< TH2S >, Tokens< TH2D >, Tokens< TH3F >, Tokens< TProfile >, Tokens< TProfile2D >, Tokens< double >, Tokens< int >, Tokens< long long >, Tokens< TString > > tokens_
edm::EDGetTokenT< Product > runToken
void endRun(const edm::Run &, const edm::EventSetup &) final
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) final
void produce(edm::Event &, edm::EventSetup const &) final
edm::EDPutTokenT< DQMToken > dqmRunToken_
edm::EDPutTokenT< DQMToken > dqmLumiToken_
void beginJob() final
std::vector< uint32_t > TagList
void endJob() final
void getData(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, T &iGetFrom)
void getData(const edm::Run &iRun, edm::Handle< Product > &handle) const
long double T
edm::EDGetTokenT< Product > lumiToken
Definition: Run.h:43