14 #include "classlib/utils/StringList.h"
15 #include "classlib/utils/StringOps.h"
22 std::string MsgLoggerCat =
"MEtoEDMConverter_MEtoEDMConverter";
38 <<
"\n===============================\n"
39 <<
"Initialized as EDProducer with parameter values:\n"
40 <<
" Name = " <<
fName <<
"\n"
41 <<
" Verbosity = " << verbosity <<
"\n"
42 <<
" Frequency = " << frequency <<
"\n"
43 <<
" Path = " << path <<
"\n"
44 <<
"===============================\n";
55 sName =
fName +
"Run";
63 produces<MEtoEDM<TProfile>,
edm::InRun>(sName);
64 produces<MEtoEDM<TProfile2D>,
edm::InRun>(sName);
66 produces<MEtoEDM<long long>,
edm::InRun>(sName);
69 sName =
fName +
"Lumi";
85 assert(
sizeof(int64_t) ==
sizeof(
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;
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";
256 int nrun = iRun.
run();
263 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
267 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
272 std::vector<MonitorElement *>::iterator mmi, mme;
275 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
329 <<
"' is neither a ROOT object nor a recognised "
330 <<
"simple object.\n";
358 std::string MsgLoggerCat =
"MEtoEDMConverter_putData";
361 edm::LogInfo (MsgLoggerCat) <<
"\nStoring MEtoEDM dataformat histograms.";
364 std::vector<MonitorElement *>::iterator mmi, mme;
374 unsigned int nProf=0;
375 unsigned int nProf2=0;
376 unsigned int nDouble=0;
377 unsigned int nInt64=0;
378 unsigned int nString=0;
380 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
440 <<
"' is neither a ROOT object nor a recognised "
441 <<
"simple object.\n";
447 std::auto_ptr<MEtoEDM<double> > pOutDouble(
new MEtoEDM<double>(nDouble));
450 std::auto_ptr<MEtoEDM<TH1S> > pOut1s(
new MEtoEDM<TH1S>(n1S));
451 std::auto_ptr<MEtoEDM<TH1D> > pOut1d(
new MEtoEDM<TH1D>(n1D));
453 std::auto_ptr<MEtoEDM<TH2S> > pOut2s(
new MEtoEDM<TH2S>(n2S));
454 std::auto_ptr<MEtoEDM<TH2D> > pOut2d(
new MEtoEDM<TH2D>(n2D));
459 for (mmi = items.begin (), mme = items.end (); mmi != mme; ++mmi) {
520 <<
"' is neither a ROOT object nor a recognised "
521 <<
"simple object.\n";
536 sName =
fName +
"Lumi";
538 sName =
fName +
"Run";
542 iPutTo.put(pOutInt,sName);
543 iPutTo.put(pOutDouble,sName);
544 iPutTo.put(pOutString,sName);
545 iPutTo.put(pOut1,sName);
546 iPutTo.put(pOut1s,sName);
547 iPutTo.put(pOut1d,sName);
548 iPutTo.put(pOut2,sName);
549 iPutTo.put(pOut2s,sName);
550 iPutTo.put(pOut2d,sName);
551 iPutTo.put(pOut3,sName);
552 iPutTo.put(pOutProf,sName);
553 iPutTo.put(pOutProf2,sName);
virtual void produce(edm::Event &, const edm::EventSetup &)
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
virtual void endRun(edm::Run &, const edm::EventSetup &)
TH3F * getTH3F(void) const
TH1D * getTH1D(void) const
TH2D * getTH2D(void) const
std::map< int, int > iCount
std::vector< MonitorElement * > getAllContents(const std::string &path) const
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)
virtual void endLuminosityBlock(edm::LuminosityBlock &, const edm::EventSetup &)
double getFloatValue(void) const
virtual void beginLuminosityBlock(edm::LuminosityBlock &, const edm::EventSetup &)
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)
TProfile * getTProfile(void) const
perl if(1 lt scalar(@::datatypes))
MEtoEDMConverter(const edm::ParameterSet &)
TH2F * getTH2F(void) const
virtual void beginRun(edm::Run &, const edm::EventSetup &)
void Reset(void)
reset ME (ie. contents, errors, etc)