15 #include "classlib/utils/StringList.h"
16 #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";
56 sName =
fName +
"Run";
64 produces<MEtoEDM<TProfile>,
edm::InRun>(sName);
65 produces<MEtoEDM<TProfile2D>,
edm::InRun>(sName);
67 produces<MEtoEDM<long long>,
edm::InRun>(sName);
70 sName =
fName +
"Lumi";
86 assert(
sizeof(int64_t) ==
sizeof(
long long));
102 std::string MsgLoggerCat =
"MEtoEDMConverter_endJob";
107 std::map<std::string,int> packages;
117 unsigned nTProfile = 0;
118 unsigned nTProfile2D = 0;
119 unsigned nDouble = 0;
121 unsigned nString = 0;
126 std::vector<MonitorElement *>::iterator mmi, mme;
129 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
144 std::cout <<
" scalar: " << tobj->GetName() <<
": Int64\n";
150 std::cout <<
" scalar: " << tobj->GetName() <<
": Double\n";
156 std::cout <<
" scalar: " << tobj->GetName() <<
": String\n";
162 std::cout <<
" normal: " << tobj->GetName() <<
": TH1F\n";
168 std::cout <<
" normal: " << tobj->GetName() <<
": TH1S\n";
174 std::cout <<
" normal: " << tobj->GetName() <<
": TH1D\n";
180 std::cout <<
" normal: " << tobj->GetName() <<
": TH2F\n";
186 std::cout <<
" normal: " << tobj->GetName() <<
": TH2S\n";
192 std::cout <<
" normal: " << tobj->GetName() <<
": TH2D\n";
198 std::cout <<
" normal: " << tobj->GetName() <<
": TH3F\n";
204 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile\n";
210 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile2D\n";
216 <<
"' is neither a ROOT object nor a recognised "
217 <<
"simple object.\n";
223 std::cout <<
"Packages accessing DQM:" << std::endl;
224 std::map<std::string,int>::iterator pkgIter;
225 for (pkgIter = packages.begin(); pkgIter != packages.end(); ++pkgIter)
226 std::cout <<
" " << pkgIter->first <<
": " << pkgIter->second
229 std::cout <<
"We have " << nTH1F <<
" TH1F objects" << std::endl;
230 std::cout <<
"We have " << nTH1S <<
" TH1S objects" << std::endl;
231 std::cout <<
"We have " << nTH1D <<
" TH1D objects" << std::endl;
232 std::cout <<
"We have " << nTH2F <<
" TH2F objects" << std::endl;
233 std::cout <<
"We have " << nTH2S <<
" TH2S objects" << std::endl;
234 std::cout <<
"We have " << nTH2D <<
" TH2D objects" << std::endl;
235 std::cout <<
"We have " << nTH3F <<
" TH3F objects" << std::endl;
236 std::cout <<
"We have " << nTProfile <<
" TProfile objects" << std::endl;
237 std::cout <<
"We have " << nTProfile2D <<
" TProfile2D objects" << std::endl;
238 std::cout <<
"We have " << nDouble <<
" Double objects" << std::endl;
239 std::cout <<
"We have " << nInt64 <<
" Int64 objects" << std::endl;
240 std::cout <<
"We have " << nString <<
" String objects" << std::endl;
248 <<
"Terminating having processed " <<
iCount.size() <<
" runs.";
255 std::string MsgLoggerCat =
"MEtoEDMConverter_beginRun";
257 int nrun = iRun.
run();
264 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
268 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
273 std::vector<MonitorElement *>::iterator mmi, mme;
276 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
330 <<
"' is neither a ROOT object nor a recognised "
331 <<
"simple object.\n";
359 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
362 edm::LogInfo (MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
365 std::vector<MonitorElement *>::iterator mmi, mme;
375 unsigned int nProf=0;
376 unsigned int nProf2=0;
377 unsigned int nDouble=0;
378 unsigned int nInt64=0;
379 unsigned int nString=0;
381 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
443 <<
"' is neither a ROOT object nor a recognised "
444 <<
"simple object.\n";
450 std::auto_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
453 std::auto_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
454 std::auto_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
456 std::auto_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
457 std::auto_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
462 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
525 <<
"' is neither a ROOT object nor a recognised "
526 <<
"simple object.\n";
541 sName =
fName +
"Lumi";
543 sName =
fName +
"Run";
547 iPutTo.put(pOutInt,sName);
548 iPutTo.put(pOutDouble,sName);
549 iPutTo.put(pOutString,sName);
550 iPutTo.put(pOut1,sName);
551 iPutTo.put(pOut1s,sName);
552 iPutTo.put(pOut1d,sName);
553 iPutTo.put(pOut2,sName);
554 iPutTo.put(pOut2s,sName);
555 iPutTo.put(pOut2d,sName);
556 iPutTo.put(pOut3,sName);
557 iPutTo.put(pOutProf,sName);
558 iPutTo.put(pOutProf2,sName);
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
virtual void endRunProduce(edm::Run &, const edm::EventSetup &) override
virtual void beginJob() override
std::map< int, int > iCount
std::vector< MonitorElement * > getAllContents(const std::string &path) const
virtual 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
virtual ~MEtoEDMConverter()
DQMNet::TagList getTags(void) const
void removeElement(const std::string &name)
double getFloatValue(void) const
virtual 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
void putData(T &iPutTo, bool iLumiOnly)
virtual void endJob() override
TProfile * getTProfile(void) const
MEtoEDMConverter(const edm::ParameterSet &)
virtual void beginRun(edm::Run const &, const edm::EventSetup &) override
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
virtual void endLuminosityBlockProduce(edm::LuminosityBlock &, const edm::EventSetup &) override