13 #include "classlib/utils/StringList.h"
14 #include "classlib/utils/StringOps.h"
21 std::string MsgLoggerCat =
"MEtoEDMConverter_MEtoEDMConverter";
34 edm::LogInfo(MsgLoggerCat) <<
"\n===============================\n"
35 <<
"Initialized as EDProducer with parameter values:\n"
36 <<
" Name = " <<
fName <<
"\n"
39 <<
" Path = " <<
path <<
"\n"
40 <<
"===============================\n";
47 sName =
fName +
"Run";
61 sName =
fName +
"Lumi";
75 consumesMany<DQMToken, edm::InLumi>();
76 consumesMany<DQMToken, edm::InRun>();
77 usesResource(
"DQMStore");
79 static_assert(
sizeof(int64_t) ==
sizeof(
long long),
"type int64_t is not the same length as long long");
90 return std::shared_ptr<meedm::Void>();
102 return std::shared_ptr<meedm::Void>();
114 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
117 edm::LogInfo(MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
120 std::vector<MonitorElement*>::iterator mmi, mme;
123 unsigned int n1F = 0;
124 unsigned int n1S = 0;
125 unsigned int n1D = 0;
126 unsigned int n2F = 0;
127 unsigned int n2S = 0;
128 unsigned int n2D = 0;
129 unsigned int n3F = 0;
130 unsigned int nProf = 0;
131 unsigned int nProf2 = 0;
132 unsigned int nDouble = 0;
133 unsigned int nInt64 = 0;
134 unsigned int nString = 0;
136 for (mmi =
items.begin(), mme =
items.end(); mmi != mme; ++mmi) {
141 if (iLumiOnly && !
me->getLumiFlag())
143 if (!iLumiOnly &&
me->getLumiFlag())
146 switch (
me->kind()) {
196 edm::LogError(MsgLoggerCat) <<
"ERROR: The DQM object '" <<
me->getFullname()
197 <<
"' is neither a ROOT object nor a recognised "
198 <<
"simple object.\n";
204 std::unique_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
205 std::unique_ptr<MEtoEDM<TString> > pOutString(
new MEtoEDM<TString>(nString));
206 std::unique_ptr<MEtoEDM<TH1F> > pOut1(
new MEtoEDM<TH1F>(n1F));
207 std::unique_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
208 std::unique_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
209 std::unique_ptr<MEtoEDM<TH2F> > pOut2(
new MEtoEDM<TH2F>(n2F));
210 std::unique_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
211 std::unique_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
212 std::unique_ptr<MEtoEDM<TH3F> > pOut3(
new MEtoEDM<TH3F>(n3F));
216 for (mmi =
items.begin(), mme =
items.end(); mmi != mme; ++mmi) {
222 assert(iLumiOnly ==
me->getLumiFlag());
225 switch (
me->kind()) {
227 pOutInt->putMEtoEdmObject(
me->getFullname(),
me->getIntValue());
231 pOutDouble->putMEtoEdmObject(
me->getFullname(),
me->getFloatValue());
235 pOutString->putMEtoEdmObject(
me->getFullname(),
me->getStringValue());
239 pOut1->putMEtoEdmObject(
me->getFullname(), *
me->getTH1F());
243 pOut1s->putMEtoEdmObject(
me->getFullname(), *
me->getTH1S());
247 pOut1d->putMEtoEdmObject(
me->getFullname(), *
me->getTH1D());
251 pOut2->putMEtoEdmObject(
me->getFullname(), *
me->getTH2F());
255 pOut2s->putMEtoEdmObject(
me->getFullname(), *
me->getTH2S());
259 pOut2d->putMEtoEdmObject(
me->getFullname(), *
me->getTH2D());
263 pOut3->putMEtoEdmObject(
me->getFullname(), *
me->getTH3F());
267 pOutProf->putMEtoEdmObject(
me->getFullname(), *
me->getTProfile());
271 pOutProf2->putMEtoEdmObject(
me->getFullname(), *
me->getTProfile2D());
275 edm::LogError(MsgLoggerCat) <<
"ERROR: The DQM object '" <<
me->getFullname()
276 <<
"' is neither a ROOT object nor a recognised "
277 <<
"simple object.\n";
286 sName =
fName +
"Lumi";
288 sName =
fName +
"Run";
293 iPutTo.put(
std::move(pOutDouble), sName);
294 iPutTo.put(
std::move(pOutString), sName);