31 #include "classlib/utils/StringList.h" 32 #include "classlib/utils/StringOps.h" 55 #include "TProfile2D.h" 56 #include "TObjString.h" 66 edm::LuminosityBlockCache<meedm::Void>,
67 edm::EndLuminosityBlockProducer,
69 edm::one::SharedResources> {
107 std::string MsgLoggerCat =
"MEtoEDMConverter_MEtoEDMConverter";
120 edm::LogInfo(MsgLoggerCat) <<
"\n===============================\n" 121 <<
"Initialized as EDProducer with parameter values:\n" 122 <<
" Name = " <<
fName <<
"\n" 125 <<
" Path = " <<
path <<
"\n" 126 <<
"===============================\n";
133 sName =
fName +
"Run";
149 sName =
fName +
"Lumi";
171 usesResource(
"DQMStore");
173 static_assert(
sizeof(int64_t) ==
sizeof(
long long),
"type int64_t is not the same length as long long");
182 return std::shared_ptr<meedm::Void>();
194 return std::shared_ptr<meedm::Void>();
206 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
209 edm::LogInfo(MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
212 std::vector<MonitorElement*>::iterator mmi, mme;
215 unsigned int n1F = 0;
216 unsigned int n1S = 0;
217 unsigned int n1D = 0;
218 unsigned int n1I = 0;
219 unsigned int n2F = 0;
220 unsigned int n2S = 0;
221 unsigned int n2D = 0;
222 unsigned int n2I = 0;
223 unsigned int n3F = 0;
224 unsigned int nProf = 0;
225 unsigned int nProf2 = 0;
226 unsigned int nDouble = 0;
227 unsigned int nInt64 = 0;
228 unsigned int nString = 0;
230 for (mmi =
items.begin(), mme =
items.end(); mmi != mme; ++mmi) {
235 if (iLumiOnly && !
me->getLumiFlag())
237 if (!iLumiOnly &&
me->getLumiFlag())
240 switch (
me->kind()) {
298 edm::LogError(MsgLoggerCat) <<
"ERROR: The DQM object '" <<
me->getFullname()
299 <<
"' is neither a ROOT object nor a recognised " 300 <<
"simple object.\n";
306 std::unique_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
307 std::unique_ptr<MEtoEDM<TString> > pOutString(
new MEtoEDM<TString>(nString));
308 std::unique_ptr<MEtoEDM<TH1F> > pOut1(
new MEtoEDM<TH1F>(n1F));
309 std::unique_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
310 std::unique_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
311 std::unique_ptr<MEtoEDM<TH1I> > pOut1i(
new MEtoEDM<TH1I>(n1I));
312 std::unique_ptr<MEtoEDM<TH2F> > pOut2(
new MEtoEDM<TH2F>(n2F));
313 std::unique_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
314 std::unique_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
315 std::unique_ptr<MEtoEDM<TH2I> > pOut2i(
new MEtoEDM<TH2I>(n2I));
316 std::unique_ptr<MEtoEDM<TH3F> > pOut3(
new MEtoEDM<TH3F>(n3F));
320 for (mmi =
items.begin(), mme =
items.end(); mmi != mme; ++mmi) {
326 assert(iLumiOnly ==
me->getLumiFlag());
329 switch (
me->kind()) {
331 pOutInt->putMEtoEdmObject(
me->getFullname(),
me->getIntValue());
335 pOutDouble->putMEtoEdmObject(
me->getFullname(),
me->getFloatValue());
339 pOutString->putMEtoEdmObject(
me->getFullname(),
me->getStringValue());
343 pOut1->putMEtoEdmObject(
me->getFullname(), *
me->getTH1F());
347 pOut1s->putMEtoEdmObject(
me->getFullname(), *
me->getTH1S());
351 pOut1d->putMEtoEdmObject(
me->getFullname(), *
me->getTH1D());
355 pOut1i->putMEtoEdmObject(
me->getFullname(), *
me->getTH1I());
359 pOut2->putMEtoEdmObject(
me->getFullname(), *
me->getTH2F());
363 pOut2s->putMEtoEdmObject(
me->getFullname(), *
me->getTH2S());
367 pOut2d->putMEtoEdmObject(
me->getFullname(), *
me->getTH2D());
371 pOut2i->putMEtoEdmObject(
me->getFullname(), *
me->getTH2I());
375 pOut3->putMEtoEdmObject(
me->getFullname(), *
me->getTH3F());
379 pOutProf->putMEtoEdmObject(
me->getFullname(), *
me->getTProfile());
383 pOutProf2->putMEtoEdmObject(
me->getFullname(), *
me->getTProfile2D());
387 edm::LogError(MsgLoggerCat) <<
"ERROR: The DQM object '" <<
me->getFullname()
388 <<
"' is neither a ROOT object nor a recognised " 389 <<
"simple object.\n";
398 sName =
fName +
"Lumi";
400 sName =
fName +
"Run";
405 iPutTo.put(
std::move(pOutDouble), sName);
406 iPutTo.put(
std::move(pOutString), sName);
edm::GetterOfProducts< DQMToken > rungetter_
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
LuminosityBlockNumber_t luminosityBlock() const
dqm::legacy::DQMStore DQMStore
edm::GetterOfProducts< DQMToken > lumigetter_
~MEtoEDMConverter() override
Log< level::Error, false > LogError
void endRunProduce(edm::Run &, const edm::EventSetup &) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::vector< uint32_t > TagList
T getUntrackedParameter(std::string const &, T const &) const
void produce(edm::Event &, const edm::EventSetup &) override
std::shared_ptr< meedm::Void > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
std::shared_ptr< meedm::Void > globalBeginRun(edm::Run const &, const edm::EventSetup &) const override
void meBookerGetter(iFunc f)
#define DEFINE_FWK_MODULE(type)
void globalEndRun(edm::Run const &, const edm::EventSetup &) override
Log< level::Info, false > LogInfo
LuminosityBlockID id() const
std::map< int, int > iCount
dqm::legacy::MonitorElement MonitorElement
MEtoEDMConverter(const edm::ParameterSet &)
void putData(DQMStore::IGetter &g, T &iPutTo, bool iLumiOnly, uint32_t run, uint32_t lumi)
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void endLuminosityBlockProduce(edm::LuminosityBlock &, const edm::EventSetup &) override