13 #include "classlib/utils/StringList.h" 14 #include "classlib/utils/StringOps.h" 23 std::string MsgLoggerCat =
"MEtoEDMConverter_MEtoEDMConverter";
39 <<
"\n===============================\n" 40 <<
"Initialized as EDProducer with parameter values:\n" 41 <<
" Name = " <<
fName <<
"\n" 42 <<
" Verbosity = " << verbosity <<
"\n" 43 <<
" Frequency = " << frequency <<
"\n" 44 <<
" Path = " << path <<
"\n" 45 <<
"===============================\n";
55 sName =
fName +
"Run";
69 sName =
fName +
"Lumi";
83 consumesMany<DQMToken>();
85 static_assert(
sizeof(int64_t) ==
sizeof(
long long),
"type int64_t is not the same length as long long");
101 std::string MsgLoggerCat =
"MEtoEDMConverter_endJob";
106 std::map<std::string,int> packages;
116 unsigned nTProfile = 0;
117 unsigned nTProfile2D = 0;
118 unsigned nDouble = 0;
120 unsigned nString = 0;
125 std::vector<MonitorElement *>::iterator mmi, mme;
126 std::vector<MonitorElement *>
items(
dbe->getAllContents(
""));
128 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
143 std::cout <<
" scalar: " << tobj->GetName() <<
": Int64\n";
149 std::cout <<
" scalar: " << tobj->GetName() <<
": Double\n";
155 std::cout <<
" scalar: " << tobj->GetName() <<
": String\n";
161 std::cout <<
" normal: " << tobj->GetName() <<
": TH1F\n";
167 std::cout <<
" normal: " << tobj->GetName() <<
": TH1S\n";
173 std::cout <<
" normal: " << tobj->GetName() <<
": TH1D\n";
179 std::cout <<
" normal: " << tobj->GetName() <<
": TH2F\n";
185 std::cout <<
" normal: " << tobj->GetName() <<
": TH2S\n";
191 std::cout <<
" normal: " << tobj->GetName() <<
": TH2D\n";
197 std::cout <<
" normal: " << tobj->GetName() <<
": TH3F\n";
203 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile\n";
209 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile2D\n";
215 <<
"' is neither a ROOT object nor a recognised " 216 <<
"simple object.\n";
222 std::cout <<
"Packages accessing DQM:" << std::endl;
223 std::map<std::string,int>::iterator pkgIter;
224 for (pkgIter = packages.begin(); pkgIter != packages.end(); ++pkgIter)
225 std::cout <<
" " << pkgIter->first <<
": " << pkgIter->second
228 std::cout <<
"We have " << nTH1F <<
" TH1F objects" << std::endl;
229 std::cout <<
"We have " << nTH1S <<
" TH1S objects" << std::endl;
230 std::cout <<
"We have " << nTH1D <<
" TH1D objects" << std::endl;
231 std::cout <<
"We have " << nTH2F <<
" TH2F objects" << std::endl;
232 std::cout <<
"We have " << nTH2S <<
" TH2S objects" << std::endl;
233 std::cout <<
"We have " << nTH2D <<
" TH2D objects" << std::endl;
234 std::cout <<
"We have " << nTH3F <<
" TH3F objects" << std::endl;
235 std::cout <<
"We have " << nTProfile <<
" TProfile objects" << std::endl;
236 std::cout <<
"We have " << nTProfile2D <<
" TProfile2D objects" << std::endl;
237 std::cout <<
"We have " << nDouble <<
" Double objects" << std::endl;
238 std::cout <<
"We have " << nInt64 <<
" Int64 objects" << std::endl;
239 std::cout <<
"We have " << nString <<
" String objects" << std::endl;
247 <<
"Terminating having processed " <<
iCount.size() <<
" runs.";
254 std::string MsgLoggerCat =
"MEtoEDMConverter_beginRun";
262 int nrun = iRun.
run();
269 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
273 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
278 std::vector<MonitorElement *>::iterator mmi, mme;
279 std::vector<MonitorElement *>
items(
dbe->getAllContents(
path));
281 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
335 <<
"' is neither a ROOT object nor a recognised " 336 <<
"simple object.\n";
350 dbe->scaleElements();
367 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
370 edm::LogInfo (MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
373 std::vector<MonitorElement *>::iterator mmi, mme;
374 std::vector<MonitorElement *>
items(
dbe->getAllContents(
path,
385 unsigned int nProf=0;
386 unsigned int nProf2=0;
387 unsigned int nDouble=0;
388 unsigned int nInt64=0;
389 unsigned int nString=0;
391 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
453 <<
"' is neither a ROOT object nor a recognised " 454 <<
"simple object.\n";
460 std::unique_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
461 std::unique_ptr<MEtoEDM<TString> > pOutString(
new MEtoEDM<TString>(nString));
462 std::unique_ptr<MEtoEDM<TH1F> > pOut1(
new MEtoEDM<TH1F>(n1F));
463 std::unique_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
464 std::unique_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
465 std::unique_ptr<MEtoEDM<TH2F> > pOut2(
new MEtoEDM<TH2F>(n2F));
466 std::unique_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
467 std::unique_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
468 std::unique_ptr<MEtoEDM<TH3F> > pOut3(
new MEtoEDM<TH3F>(n3F));
472 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
535 <<
"' is neither a ROOT object nor a recognised " 536 <<
"simple object.\n";
551 sName =
fName +
"Lumi";
553 sName =
fName +
"Run";
LuminosityBlockID id() const
TProfile * getTProfile() const
T getUntrackedParameter(std::string const &, T const &) const
int64_t getIntValue() const
TProfile2D * getTProfile2D() const
const std::string & getPathname() const
get pathname of parent folder
double getFloatValue() const
TObject * getRootObject() const
const std::string & getName() const
get name of ME
~MEtoEDMConverter() override
void endRunProduce(edm::Run &, const edm::EventSetup &) override
std::map< int, int > iCount
void produce(edm::Event &, const edm::EventSetup &) override
void endRun(edm::Run const &, const edm::EventSetup &) override
void Reset()
reset ME (ie. contents, errors, etc)
const std::string & getStringValue() const
const std::string getFullname() const
get full name of ME including Pathname
LuminosityBlockNumber_t luminosityBlock() const
DQMNet::TagList getTags() const
bool getLumiFlag() const
true if ME is meant to be stored for each luminosity section
MEtoEDMConverter(const edm::ParameterSet &)
void putData(T &iPutTo, bool iLumiOnly, uint32_t run, uint32_t lumi)
void beginRun(edm::Run const &, const edm::EventSetup &) override
Kind kind() const
Get the type of the monitor element.
void endLuminosityBlockProduce(edm::LuminosityBlock &, const edm::EventSetup &) override