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
31 
32 // data format
35 
36 // helper files
37 #include <iostream>
38 #include <cstdlib>
39 #include <string>
40 #include <memory>
41 #include <vector>
42 #include <map>
43 #include <tuple>
44 
45 #include "TString.h"
46 #include "TList.h"
47 
48 #include "classlib/utils/StringList.h"
49 #include "classlib/utils/StringOps.h"
50 
51 class EDMtoMEConverter : public edm::one::EDProducer<edm::one::WatchRuns,
52  edm::one::WatchLuminosityBlocks,
53  edm::one::SharedResources,
54  edm::EndLuminosityBlockProducer,
55  edm::EndRunProducer> {
56 public:
59 
60  explicit EDMtoMEConverter(const edm::ParameterSet&);
61  ~EDMtoMEConverter() override;
62 
63  void beginJob() final{};
64  void endJob() final{};
65  void beginRun(const edm::Run&, const edm::EventSetup&) final{};
66  void endRun(const edm::Run&, const edm::EventSetup&) final{};
69  void produce(edm::Event&, edm::EventSetup const&) final{};
70 
72  void endRunProduce(edm::Run& run, edm::EventSetup const& setup) override;
73 
74  template <class T>
75  void getData(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter, T& iGetFrom);
76 
77  using TagList = std::vector<uint32_t>;
78 
79 private:
81  int verbosity;
82  int frequency;
83 
87 
88  template <typename T>
89  class Tokens {
90  public:
91  using type = T;
93 
94  Tokens() = default;
95 
97 
98  void getData(const edm::Run& iRun, edm::Handle<Product>& handle) const;
99  void getData(const edm::LuminosityBlock& iLumi, edm::Handle<Product>& handle) const;
100 
101  private:
104  };
105 
106  std::tuple<Tokens<TH1F>,
107  Tokens<TH1S>,
108  Tokens<TH1D>,
109  Tokens<TH2F>,
110  Tokens<TH2S>,
111  Tokens<TH2D>,
112  Tokens<TH3F>,
116  Tokens<int>,
120 
123 }; // end class declaration
124 
125 #endif
EDMtoMEConverter::endRunProduce
void endRunProduce(edm::Run &run, edm::EventSetup const &setup) override
Definition: EDMtoMEConverter.cc:310
EDMtoMEConverter::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) final
Definition: EDMtoMEConverter.h:68
EDMtoMEConverter::produce
void produce(edm::Event &, edm::EventSetup const &) final
Definition: EDMtoMEConverter.h:69
Handle.h
EDMtoMEConverter::Tokens
Definition: EDMtoMEConverter.h:89
EDProducer.h
MessageLogger.h
EDMtoMEConverter::dqmLumiToken_
edm::EDPutTokenT< DQMToken > dqmLumiToken_
Definition: EDMtoMEConverter.h:121
ESHandle.h
EDMtoMEConverter::tokens_
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_
Definition: EDMtoMEConverter.h:119
MEtoEDM
Definition: MEtoEDMFormat.h:37
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
patZpeak.handle
handle
Definition: patZpeak.py:23
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< Product >
LuminosityBlock.h
edm::EDPutTokenT< DQMToken >
EDMtoMEConverter::convertOnEndLumi
bool convertOnEndLumi
Definition: EDMtoMEConverter.h:84
EDMtoMEConverter::Tokens::set
void set(const edm::InputTag &runInputTag, const edm::InputTag &lumiInputTag, edm::ConsumesCollector &iC)
Definition: EDMtoMEConverter.cc:20
EDMtoMEConverter::Tokens::getData
void getData(const edm::Run &iRun, edm::Handle< Product > &handle) const
Definition: EDMtoMEConverter.cc:28
EDMtoMEConverter::Tokens::runToken
edm::EDGetTokenT< Product > runToken
Definition: EDMtoMEConverter.h:102
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::one::EDProducer
Definition: EDProducer.h:30
EDMtoMEConverter::verbosity
int verbosity
Definition: EDMtoMEConverter.h:81
EDMtoMEConverter::Tokens::type
T type
Definition: EDMtoMEConverter.h:91
edm::Handle
Definition: AssociativeIterator.h:50
EDMtoMEConverter::endJob
void endJob() final
Definition: EDMtoMEConverter.h:64
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
EDMtoMEConverter::convertOnEndRun
bool convertOnEndRun
Definition: EDMtoMEConverter.h:85
EDMtoMEConverter::frequency
int frequency
Definition: EDMtoMEConverter.h:82
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
MakerMacros.h
EDMtoMEConverter::reScope
MonitorElementData::Scope reScope
Definition: EDMtoMEConverter.h:86
EDMtoMEConverter::TagList
std::vector< uint32_t > TagList
Definition: EDMtoMEConverter.h:77
dqm::legacy::DQMStore
Definition: DQMStore.h:727
EDMtoMEConverter::beginJob
void beginJob() final
Definition: EDMtoMEConverter.h:63
DQMToken.h
EDMtoMEConverter::name
std::string name
Definition: EDMtoMEConverter.h:80
Service.h
EDMtoMEConverter::Tokens::lumiToken
edm::EDGetTokenT< Product > lumiToken
Definition: EDMtoMEConverter.h:103
Run.h
MonitorElementData::Scope
Scope
Definition: MonitorElementCollection.h:152
EDMtoMEConverter::getData
void getData(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, T &iGetFrom)
Definition: EDMtoMEConverter.cc:329
MEtoEDMFormat.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EDMtoMEConverter::EDMtoMEConverter
EDMtoMEConverter(const edm::ParameterSet &)
Definition: EDMtoMEConverter.cc:264
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
EDMtoMEConverter::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) final
Definition: EDMtoMEConverter.h:67
EDPutToken.h
EDMtoMEConverter_cfi.runInputTag
runInputTag
Definition: EDMtoMEConverter_cfi.py:12
EDMtoMEConverter::Tokens::Tokens
Tokens()=default
edm::EventSetup
Definition: EventSetup.h:57
EDMtoMEConverter::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: EDMtoMEConverter.h:57
InputTag.h
FileBlock.h
writedatasetfile.run
run
Definition: writedatasetfile.py:27
EDMtoMEConverter::endLuminosityBlockProduce
void endLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) override
Definition: EDMtoMEConverter.cc:319
Frameworkfwd.h
T
long double T
Definition: Basic3DVectorLD.h:48
EDMtoMEConverter::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) final
Definition: EDMtoMEConverter.h:65
EDMtoMEConverter::~EDMtoMEConverter
~EDMtoMEConverter() override
EventSetup.h
EDMtoMEConverter::dqmRunToken_
edm::EDPutTokenT< DQMToken > dqmRunToken_
Definition: EDMtoMEConverter.h:122
EDMtoMEConverter::endRun
void endRun(const edm::Run &, const edm::EventSetup &) final
Definition: EDMtoMEConverter.h:66
ParameterSet.h
dqm::legacy::DQMStore::IGetter
dqm::implementation::IGetter IGetter
Definition: DQMStore.h:730
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
EDMtoMEConverter
Definition: EDMtoMEConverter.h:51
EDMtoMEConverter::MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: EDMtoMEConverter.h:58
EDMtoMEConverter_cfi.lumiInputTag
lumiInputTag
Definition: EDMtoMEConverter_cfi.py:13