13 #include "classlib/utils/StringList.h"
14 #include "classlib/utils/StringOps.h"
21 std::string MsgLoggerCat =
"MEtoEDMConverter_MEtoEDMConverter";
37 <<
"\n===============================\n"
38 <<
"Initialized as EDProducer with parameter values:\n"
39 <<
" Name = " <<
fName <<
"\n"
40 <<
" Verbosity = " << verbosity <<
"\n"
41 <<
" Frequency = " << frequency <<
"\n"
42 <<
" Path = " << path <<
"\n"
43 <<
"===============================\n";
54 sName =
fName +
"Run";
62 produces<MEtoEDM<TProfile>,
edm::InRun>(sName);
63 produces<MEtoEDM<TProfile2D>,
edm::InRun>(sName);
65 produces<MEtoEDM<long long>,
edm::InRun>(sName);
68 sName =
fName +
"Lumi";
84 assert(
sizeof(int64_t) ==
sizeof(
long long));
100 std::string MsgLoggerCat =
"MEtoEDMConverter_endJob";
105 std::map<std::string,int> packages;
115 unsigned nTProfile = 0;
116 unsigned nTProfile2D = 0;
117 unsigned nDouble = 0;
119 unsigned nString = 0;
124 std::vector<MonitorElement *>::iterator mmi, mme;
125 std::vector<MonitorElement *> items(dbe->getAllContents(
""));
127 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
142 std::cout <<
" scalar: " << tobj->GetName() <<
": Int64\n";
148 std::cout <<
" scalar: " << tobj->GetName() <<
": Double\n";
154 std::cout <<
" scalar: " << tobj->GetName() <<
": String\n";
160 std::cout <<
" normal: " << tobj->GetName() <<
": TH1F\n";
166 std::cout <<
" normal: " << tobj->GetName() <<
": TH1S\n";
172 std::cout <<
" normal: " << tobj->GetName() <<
": TH1D\n";
178 std::cout <<
" normal: " << tobj->GetName() <<
": TH2F\n";
184 std::cout <<
" normal: " << tobj->GetName() <<
": TH2S\n";
190 std::cout <<
" normal: " << tobj->GetName() <<
": TH2D\n";
196 std::cout <<
" normal: " << tobj->GetName() <<
": TH3F\n";
202 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile\n";
208 std::cout <<
" normal: " << tobj->GetName() <<
": TProfile2D\n";
214 <<
"' is neither a ROOT object nor a recognised "
215 <<
"simple object.\n";
221 std::cout <<
"Packages accessing DQM:" << std::endl;
222 std::map<std::string,int>::iterator pkgIter;
223 for (pkgIter = packages.begin(); pkgIter != packages.end(); ++pkgIter)
224 std::cout <<
" " << pkgIter->first <<
": " << pkgIter->second
227 std::cout <<
"We have " << nTH1F <<
" TH1F objects" << std::endl;
228 std::cout <<
"We have " << nTH1S <<
" TH1S objects" << std::endl;
229 std::cout <<
"We have " << nTH1D <<
" TH1D objects" << std::endl;
230 std::cout <<
"We have " << nTH2F <<
" TH2F objects" << std::endl;
231 std::cout <<
"We have " << nTH2S <<
" TH2S objects" << std::endl;
232 std::cout <<
"We have " << nTH2D <<
" TH2D objects" << std::endl;
233 std::cout <<
"We have " << nTH3F <<
" TH3F objects" << std::endl;
234 std::cout <<
"We have " << nTProfile <<
" TProfile objects" << std::endl;
235 std::cout <<
"We have " << nTProfile2D <<
" TProfile2D objects" << std::endl;
236 std::cout <<
"We have " << nDouble <<
" Double objects" << std::endl;
237 std::cout <<
"We have " << nInt64 <<
" Int64 objects" << std::endl;
238 std::cout <<
"We have " << nString <<
" String objects" << std::endl;
246 <<
"Terminating having processed " << iCount.size() <<
" runs.";
253 std::string MsgLoggerCat =
"MEtoEDMConverter_beginRun";
258 if (enableMultiThread_)
261 int nrun = iRun.
run();
268 <<
"Processing run " << nrun <<
" (" << iCount.size() <<
" runs total)";
270 if (nrun%frequency == 0 || iCount.size() == 1) {
272 <<
"Processing run " << nrun <<
" (" << iCount.size() <<
" runs total)";
277 std::vector<MonitorElement *>::iterator mmi, mme;
278 std::vector<MonitorElement *> items(dbe->getAllContents(
path));
280 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
334 <<
"' is neither a ROOT object nor a recognised "
335 <<
"simple object.\n";
349 dbe->scaleElements();
350 putData(iRun,
false, iRun.
run(), 0);
366 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
369 edm::LogInfo (MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
372 std::vector<MonitorElement *>::iterator mmi, mme;
373 std::vector<MonitorElement *> items(dbe->getAllContents(
path,
374 enableMultiThread_ ? run : 0,
375 enableMultiThread_ ? lumi : 0));
384 unsigned int nProf=0;
385 unsigned int nProf2=0;
386 unsigned int nDouble=0;
387 unsigned int nInt64=0;
388 unsigned int nString=0;
390 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
452 <<
"' is neither a ROOT object nor a recognised "
453 <<
"simple object.\n";
459 std::auto_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
462 std::auto_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
463 std::auto_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
465 std::auto_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
466 std::auto_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
471 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
534 <<
"' is neither a ROOT object nor a recognised "
535 <<
"simple object.\n";
550 sName = fName +
"Lumi";
552 sName = fName +
"Run";
556 iPutTo.put(pOutInt,sName);
557 iPutTo.put(pOutDouble,sName);
558 iPutTo.put(pOutString,sName);
559 iPutTo.put(pOut1,sName);
560 iPutTo.put(pOut1s,sName);
561 iPutTo.put(pOut1d,sName);
562 iPutTo.put(pOut2,sName);
563 iPutTo.put(pOut2s,sName);
564 iPutTo.put(pOut2d,sName);
565 iPutTo.put(pOut3,sName);
566 iPutTo.put(pOutProf,sName);
567 iPutTo.put(pOutProf2,sName);
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
virtual void endRunProduce(edm::Run &, const edm::EventSetup &) override
virtual void beginJob() override
std::map< int, int > iCount
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
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
LuminosityBlockNumber_t luminosityBlock() const
virtual void endJob() override
TProfile * getTProfile(void) const
volatile std::atomic< bool > shutdown_flag false
MEtoEDMConverter(const edm::ParameterSet &)
void putData(T &iPutTo, bool iLumiOnly, uint32_t run, uint32_t lumi)
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