16 runInputTag_(iPSet.getParameter<edm::
InputTag>(
"runInputTag")),
17 lumiInputTag_(iPSet.getParameter<edm::
InputTag>(
"lumiInputTag"))
19 std::string MsgLoggerCat =
"EDMtoMEConverter_EDMtoMEConverter";
40 <<
"\n===============================\n"
41 <<
"Initialized as EDAnalyzer with parameter values:\n"
42 <<
" Name = " <<
name <<
"\n"
43 <<
" Verbosity = " << verbosity <<
"\n"
44 <<
" Frequency = " << frequency <<
"\n"
45 <<
"===============================\n";
66 assert(
sizeof(int64_t) ==
sizeof(
long long));
78 std::string MsgLoggerCat =
"EDMtoMEConverter_endJob";
81 <<
"Terminating having processed " <<
iCount.size() <<
" runs across "
94 std::string MsgLoggerCat =
"EDMtoMEConverter_beginRun";
96 int nrun = iRun.
run();
103 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
107 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
146 std::string MsgLoggerCat =
"EDMtoMEConverter_getData";
149 edm::LogInfo (MsgLoggerCat) <<
"\nRestoring MonitorElements.";
155 iGetFrom.getByLabel(*inputTag, metoedm);
163 std::vector<MEtoEDM<TH1F>::MEtoEDMObject> metoedmobject =
164 metoedm->getMEtoEdmObject();
166 me1.resize(metoedmobject.size());
168 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
181 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
183 if (
j != fulldir.size() - 2) dir +=
"/";
188 me1[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
191 list.Add(&metoedmobject[
i].
object);
193 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
194 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
196 dbe->setCurrentFolder(dir);
197 me1[
i] =
dbe->book1D(metoedmobject[
i].
object.GetName(),
198 &metoedmobject[
i].
object);
200 if (!iEndRun)
me1[
i]->setLumiFlag();
206 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
207 dbe->tag(
me1[
i]->getFullname(),tags[
j]);
214 iGetFrom.getByLabel(*inputTag, metoedm);
222 std::vector<MEtoEDM<TH1S>::MEtoEDMObject> metoedmobject =
223 metoedm->getMEtoEdmObject();
225 me1.resize(metoedmobject.size());
227 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
240 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
242 if (
j != fulldir.size() - 2) dir +=
"/";
247 me1[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
248 if (
me1[
i] &&
me1[
i]->getTH1S() &&
me1[
i]->getTH1S()->TestBit(TH1::kCanRebin) ==
true) {
250 list.Add(&metoedmobject[
i].
object);
251 if (
me1[
i]->getTH1S()->Merge(&list) == -1)
252 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
253 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
255 dbe->setCurrentFolder(dir);
256 me1[
i] =
dbe->book1S(metoedmobject[
i].
object.GetName(),
257 &metoedmobject[
i].
object);
259 if (!iEndRun)
me1[
i]->setLumiFlag();
265 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
266 dbe->tag(
me1[
i]->getFullname(),tags[
j]);
273 iGetFrom.getByLabel(*inputTag, metoedm);
281 std::vector<MEtoEDM<TH1D>::MEtoEDMObject> metoedmobject =
282 metoedm->getMEtoEdmObject();
284 me1.resize(metoedmobject.size());
286 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
299 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
301 if (
j != fulldir.size() - 2) dir +=
"/";
306 me1[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
307 if (
me1[
i] &&
me1[
i]->getTH1D() &&
me1[
i]->getTH1D()->TestBit(TH1::kCanRebin) ==
true) {
309 list.Add(&metoedmobject[
i].
object);
310 if (
me1[
i]->getTH1D()->Merge(&list) == -1)
311 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
312 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
314 dbe->setCurrentFolder(dir);
315 me1[
i] =
dbe->book1DD(metoedmobject[
i].
object.GetName(),
316 &metoedmobject[
i].
object);
318 if (!iEndRun)
me1[
i]->setLumiFlag();
324 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
325 dbe->tag(
me1[
i]->getFullname(),tags[
j]);
332 iGetFrom.getByLabel(*inputTag, metoedm);
340 std::vector<MEtoEDM<TH2F>::MEtoEDMObject> metoedmobject =
341 metoedm->getMEtoEdmObject();
343 me2.resize(metoedmobject.size());
345 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
358 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
360 if (
j != fulldir.size() - 2) dir +=
"/";
365 me2[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
368 list.Add(&metoedmobject[
i].
object);
370 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
371 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
373 dbe->setCurrentFolder(dir);
374 me2[
i] =
dbe->book2D(metoedmobject[
i].
object.GetName(),
375 &metoedmobject[
i].
object);
377 if (!iEndRun)
me2[
i]->setLumiFlag();
383 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
384 dbe->tag(
me2[
i]->getFullname(),tags[
j]);
391 iGetFrom.getByLabel(*inputTag, metoedm);
399 std::vector<MEtoEDM<TH2S>::MEtoEDMObject> metoedmobject =
400 metoedm->getMEtoEdmObject();
402 me2.resize(metoedmobject.size());
404 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
417 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
419 if (
j != fulldir.size() - 2) dir +=
"/";
424 me2[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
425 if (
me2[
i] &&
me2[
i]->getTH2S() &&
me2[
i]->getTH2S()->TestBit(TH1::kCanRebin) ==
true) {
427 list.Add(&metoedmobject[
i].
object);
428 if (
me2[
i]->getTH2S()->Merge(&list) == -1)
429 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
430 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
432 dbe->setCurrentFolder(dir);
433 me2[
i] =
dbe->book2S(metoedmobject[
i].
object.GetName(),
434 &metoedmobject[
i].
object);
436 if (!iEndRun)
me2[
i]->setLumiFlag();
442 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
443 dbe->tag(
me2[
i]->getFullname(),tags[
j]);
450 iGetFrom.getByLabel(*inputTag, metoedm);
458 std::vector<MEtoEDM<TH2D>::MEtoEDMObject> metoedmobject =
459 metoedm->getMEtoEdmObject();
461 me2.resize(metoedmobject.size());
463 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
476 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
478 if (
j != fulldir.size() - 2) dir +=
"/";
483 me2[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
484 if (
me2[
i] &&
me2[
i]->getTH2D() &&
me2[
i]->getTH2D()->TestBit(TH1::kCanRebin) ==
true) {
486 list.Add(&metoedmobject[
i].
object);
487 if (
me2[
i]->getTH2D()->Merge(&list) == -1)
488 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
489 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
491 dbe->setCurrentFolder(dir);
492 me2[
i] =
dbe->book2DD(metoedmobject[
i].
object.GetName(),
493 &metoedmobject[
i].
object);
495 if (!iEndRun)
me2[
i]->setLumiFlag();
501 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
502 dbe->tag(
me2[
i]->getFullname(),tags[
j]);
509 iGetFrom.getByLabel(*inputTag, metoedm);
517 std::vector<MEtoEDM<TH3F>::MEtoEDMObject> metoedmobject =
518 metoedm->getMEtoEdmObject();
520 me3.resize(metoedmobject.size());
522 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
535 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
537 if (
j != fulldir.size() - 2) dir +=
"/";
542 me3[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
545 list.Add(&metoedmobject[
i].
object);
547 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
548 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
550 dbe->setCurrentFolder(dir);
551 me3[
i] =
dbe->book3D(metoedmobject[
i].
object.GetName(),
552 &metoedmobject[
i].
object);
554 if (!iEndRun)
me3[
i]->setLumiFlag();
560 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
561 dbe->tag(
me3[
i]->getFullname(),tags[
j]);
568 iGetFrom.getByLabel(*inputTag, metoedm);
576 std::vector<MEtoEDM<TProfile>::MEtoEDMObject> metoedmobject =
577 metoedm->getMEtoEdmObject();
579 me4.resize(metoedmobject.size());
581 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
594 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
596 if (
j != fulldir.size() - 2) dir +=
"/";
602 me4[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
605 list.Add(&metoedmobject[
i].
object);
607 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
608 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
610 dbe->setCurrentFolder(dir);
611 me4[
i] =
dbe->bookProfile(metoedmobject[
i].
object.GetName(),
612 &metoedmobject[
i].
object);
614 if (!iEndRun)
me4[
i]->setLumiFlag();
620 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
621 dbe->tag(
me4[
i]->getFullname(),tags[
j]);
628 iGetFrom.getByLabel(*inputTag, metoedm);
636 std::vector<MEtoEDM<TProfile2D>::MEtoEDMObject> metoedmobject =
637 metoedm->getMEtoEdmObject();
639 me5.resize(metoedmobject.size());
641 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
654 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
656 if (
j != fulldir.size() - 2) dir +=
"/";
661 me5[
i] =
dbe->get(dir+
"/"+metoedmobject[
i].
object.GetName());
664 list.Add(&metoedmobject[
i].
object);
666 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
667 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
669 dbe->setCurrentFolder(dir);
670 me5[
i] =
dbe->bookProfile2D(metoedmobject[
i].
object.GetName(),
671 &metoedmobject[
i].
object);
673 if (!iEndRun)
me5[
i]->setLumiFlag();
679 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
680 dbe->tag(
me5[
i]->getFullname(),tags[
j]);
687 iGetFrom.getByLabel(*inputTag, metoedm);
695 std::vector<MEtoEDM<double>::MEtoEDMObject> metoedmobject =
696 metoedm->getMEtoEdmObject();
698 me6.resize(metoedmobject.size());
700 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
714 name = *(fulldir.end() - 1);
716 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
718 if (
j != fulldir.size() - 2) dir +=
"/";
723 dbe->setCurrentFolder(dir);
725 me6[
i]->Fill(metoedmobject[
i].
object);
726 if (!iEndRun)
me6[
i]->setLumiFlag();
732 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
733 dbe->tag(
me6[
i]->getFullname(),tags[
j]);
740 iGetFrom.getByLabel(*inputTag, metoedm);
748 std::vector<MEtoEDM<long long>::MEtoEDMObject> metoedmobject =
749 metoedm->getMEtoEdmObject();
751 me7.resize(metoedmobject.size());
753 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
766 name = *(fulldir.end() - 1);
768 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
770 if (
j != fulldir.size() - 2) dir +=
"/";
775 dbe->setCurrentFolder(dir);
778 if (name.find(
"processedEvents") != std::string::npos) {
780 ival = me->getIntValue();
785 me7[
i]->Fill(metoedmobject[
i].
object+ival);
786 if (!iEndRun)
me7[
i]->setLumiFlag();
792 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
793 dbe->tag(
me7[
i]->getFullname(),tags[
j]);
800 iGetFrom.getByLabel(*inputTag, metoedm);
808 std::vector<MEtoEDM<int>::MEtoEDMObject> metoedmobject =
809 metoedm->getMEtoEdmObject();
811 me7.resize(metoedmobject.size());
813 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
826 name = *(fulldir.end() - 1);
828 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
830 if (
j != fulldir.size() - 2) dir +=
"/";
835 dbe->setCurrentFolder(dir);
838 if (name.find(
"processedEvents") != std::string::npos) {
840 ival = me->getIntValue();
845 me7[
i]->Fill(metoedmobject[
i].
object+ival);
846 if (!iEndRun)
me7[
i]->setLumiFlag();
852 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
853 dbe->tag(
me7[
i]->getFullname(),tags[
j]);
860 iGetFrom.getByLabel(*inputTag, metoedm);
868 std::vector<MEtoEDM<TString>::MEtoEDMObject> metoedmobject =
869 metoedm->getMEtoEdmObject();
871 me8.resize(metoedmobject.size());
873 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
886 name = *(fulldir.end() - 1);
888 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
890 if (
j != fulldir.size() - 2) dir +=
"/";
895 dbe->setCurrentFolder(dir);
897 me8[
i] =
dbe->bookString(name,scont);
898 if (!iEndRun)
me8[
i]->setLumiFlag();
904 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
905 dbe->tag(
me8[
i]->getFullname(),tags[
j]);
913 std::vector<std::string> stags;
914 dbe->getAllTags(stags);
915 for (
unsigned int i = 0;
i < stags.size(); ++
i) {
916 std::cout <<
"Tags: " << stags[
i] << std::endl;
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< uint32_t > TagList
T getUntrackedParameter(std::string const &, T const &) const
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
EDMtoMEConverter(const edm::ParameterSet &)
std::vector< MonitorElement * > me6
virtual void endRun(const edm::Run &, const edm::EventSetup &)
std::vector< std::string > classtypes
edm::InputTag lumiInputTag_
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< MonitorElement * > me8
TH3F * getTH3F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
std::vector< MonitorElement * > me7
std::vector< MonitorElement * > me1
edm::InputTag runInputTag_
std::vector< MonitorElement * > me4
std::vector< MonitorElement * > me5
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
TProfile2D * getTProfile2D(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
virtual void respondToOpenInputFile(const edm::FileBlock &)
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
std::vector< MonitorElement * > me2
virtual ~EDMtoMEConverter()
TH2F * getTH2F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
std::vector< MonitorElement * > me3
std::map< int, int > iCount
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void getData(T &iGetFrom, bool iEndRun)