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");
103 std::string MsgLoggerCat =
"MEtoEDMConverter_endJob";
108 std::map<std::string,int> packages;
118 unsigned nTProfile = 0;
119 unsigned nTProfile2D = 0;
120 unsigned nDouble = 0;
122 unsigned nString = 0;
127 std::vector<MonitorElement *>::iterator mmi, mme;
128 std::vector<MonitorElement *>
items(
dbe->getAllContents(
""));
130 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
145 std::cout <<
" scalar: " << tobj->GetName() <<
": Int64\n";
151 std::cout <<
" scalar: " << tobj->GetName() <<
": Double\n";
157 std::cout <<
" scalar: " << tobj->GetName() <<
": String\n";
163 std::cout <<
" normal: " << tobj->GetName() <<
": TH1F\n";
169 std::cout <<
" normal: " << tobj->GetName() <<
": TH1S\n";
175 std::cout <<
" normal: " << tobj->GetName() <<
": TH1D\n";
181 std::cout <<
" normal: " << tobj->GetName() <<
": TH2F\n";
187 std::cout <<
" normal: " << tobj->GetName() <<
": TH2S\n";
193 std::cout <<
" normal: " << tobj->GetName() <<
": TH2D\n";
199 std::cout <<
" normal: " << tobj->GetName() <<
": TH3F\n";
205 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile\n";
211 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile2D\n";
217 <<
"' is neither a ROOT object nor a recognised " 218 <<
"simple object.\n";
224 std::cout <<
"Packages accessing DQM:" << std::endl;
225 std::map<std::string,int>::iterator pkgIter;
226 for (pkgIter = packages.begin(); pkgIter != packages.end(); ++pkgIter)
227 std::cout <<
" " << pkgIter->first <<
": " << pkgIter->second
230 std::cout <<
"We have " << nTH1F <<
" TH1F objects" << std::endl;
231 std::cout <<
"We have " << nTH1S <<
" TH1S objects" << std::endl;
232 std::cout <<
"We have " << nTH1D <<
" TH1D objects" << std::endl;
233 std::cout <<
"We have " << nTH2F <<
" TH2F objects" << std::endl;
234 std::cout <<
"We have " << nTH2S <<
" TH2S objects" << std::endl;
235 std::cout <<
"We have " << nTH2D <<
" TH2D objects" << std::endl;
236 std::cout <<
"We have " << nTH3F <<
" TH3F objects" << std::endl;
237 std::cout <<
"We have " << nTProfile <<
" TProfile objects" << std::endl;
238 std::cout <<
"We have " << nTProfile2D <<
" TProfile2D objects" << std::endl;
239 std::cout <<
"We have " << nDouble <<
" Double objects" << std::endl;
240 std::cout <<
"We have " << nInt64 <<
" Int64 objects" << std::endl;
241 std::cout <<
"We have " << nString <<
" String objects" << std::endl;
249 <<
"Terminating having processed " <<
iCount.size() <<
" runs.";
256 std::string MsgLoggerCat =
"MEtoEDMConverter_beginRun";
264 int nrun = iRun.
run();
271 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
275 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
280 std::vector<MonitorElement *>::iterator mmi, mme;
281 std::vector<MonitorElement *>
items(
dbe->getAllContents(
path));
283 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
337 <<
"' is neither a ROOT object nor a recognised " 338 <<
"simple object.\n";
352 dbe->scaleElements();
369 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
372 edm::LogInfo (MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
375 std::vector<MonitorElement *>::iterator mmi, mme;
376 std::vector<MonitorElement *>
items(
dbe->getAllContents(
path,
387 unsigned int nProf=0;
388 unsigned int nProf2=0;
389 unsigned int nDouble=0;
390 unsigned int nInt64=0;
391 unsigned int nString=0;
393 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
455 <<
"' is neither a ROOT object nor a recognised " 456 <<
"simple object.\n";
462 std::unique_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
463 std::unique_ptr<MEtoEDM<TString> > pOutString(
new MEtoEDM<TString>(nString));
464 std::unique_ptr<MEtoEDM<TH1F> > pOut1(
new MEtoEDM<TH1F>(n1F));
465 std::unique_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
466 std::unique_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
467 std::unique_ptr<MEtoEDM<TH2F> > pOut2(
new MEtoEDM<TH2F>(n2F));
468 std::unique_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
469 std::unique_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
470 std::unique_ptr<MEtoEDM<TH3F> > pOut3(
new MEtoEDM<TH3F>(n3F));
474 for (mmi =
items.begin (), mme =
items.end (); mmi != mme; ++mmi) {
537 <<
"' is neither a ROOT object nor a recognised " 538 <<
"simple object.\n";
553 sName =
fName +
"Lumi";
555 sName =
fName +
"Run";
LuminosityBlockID id() const
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
TProfile2D * getTProfile2D(void) const
TH3F * getTH3F(void) const
TH1D * getTH1D(void) const
TH2D * getTH2D(void) const
~MEtoEDMConverter() override
void endRunProduce(edm::Run &, const edm::EventSetup &) override
std::map< int, int > iCount
void produce(edm::Event &, const edm::EventSetup &) override
bool getLumiFlag(void) const
true if ME is meant to be stored for each luminosity section
const std::string & getPathname(void) const
get pathname of parent folder
DQMNet::TagList getTags(void) const
double getFloatValue(void) const
void endRun(edm::Run const &, const edm::EventSetup &) override
Kind kind(void) const
Get the type of the monitor element.
const std::string getFullname(void) const
get full name of ME including Pathname
const std::string & getStringValue(void) const
TObject * getRootObject(void) const
int64_t getIntValue(void) const
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
TProfile * getTProfile(void) const
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
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
void endLuminosityBlockProduce(edm::LuminosityBlock &, const edm::EventSetup &) override