18 runInputTag_(iPSet.getParameter<edm::InputTag>(
"runInputTag")),
19 lumiInputTag_(iPSet.getParameter<edm::InputTag>(
"lumiInputTag"))
21 std::string MsgLoggerCat =
"EDMtoMEConverter_EDMtoMEConverter";
42 <<
"\n===============================\n"
43 <<
"Initialized as EDAnalyzer with parameter values:\n"
44 <<
" Name = " <<
name <<
"\n"
45 <<
" Verbosity = " << verbosity <<
"\n"
46 <<
" Frequency = " << frequency <<
"\n"
47 <<
"===============================\n";
68 assert(
sizeof(int64_t) ==
sizeof(
long long));
80 std::string MsgLoggerCat =
"EDMtoMEConverter_endJob";
83 <<
"Terminating having processed " <<
iCount.size() <<
" runs across "
96 std::string MsgLoggerCat =
"EDMtoMEConverter_beginRun";
98 int nrun = iRun.
run();
105 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
109 <<
"Processing run " << nrun <<
" (" <<
iCount.size() <<
" runs total)";
148 std::string MsgLoggerCat =
"EDMtoMEConverter_getData";
151 edm::LogInfo (MsgLoggerCat) <<
"\nRestoring MonitorElements.";
153 for (
unsigned int ii = 0; ii <
classtypes.size(); ++ii) {
157 iGetFrom.getByLabel(*inputTag, metoedm);
165 std::vector<MEtoEDM<TH1F>::MEtoEDMObject> metoedmobject =
166 metoedm->getMEtoEdmObject();
168 me1.resize(metoedmobject.size());
170 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
175 std::string
pathname = metoedmobject[
i].name;
183 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
185 if (
j != fulldir.size() - 2) dir +=
"/";
190 me1[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
193 list.Add(&metoedmobject[
i].
object);
195 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
196 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
200 &metoedmobject[
i].
object);
202 if (!iEndRun)
me1[
i]->setLumiFlag();
208 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
216 iGetFrom.getByLabel(*inputTag, metoedm);
224 std::vector<MEtoEDM<TH1S>::MEtoEDMObject> metoedmobject =
225 metoedm->getMEtoEdmObject();
227 me1.resize(metoedmobject.size());
229 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
234 std::string
pathname = metoedmobject[
i].name;
242 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
244 if (
j != fulldir.size() - 2) dir +=
"/";
249 me1[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
250 if (
me1[
i] &&
me1[
i]->getTH1S() &&
me1[
i]->getTH1S()->TestBit(TH1::kCanRebin) ==
true) {
252 list.Add(&metoedmobject[
i].
object);
253 if (
me1[
i]->getTH1S()->Merge(&list) == -1)
254 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
255 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
259 &metoedmobject[
i].
object);
261 if (!iEndRun)
me1[
i]->setLumiFlag();
267 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
275 iGetFrom.getByLabel(*inputTag, metoedm);
283 std::vector<MEtoEDM<TH1D>::MEtoEDMObject> metoedmobject =
284 metoedm->getMEtoEdmObject();
286 me1.resize(metoedmobject.size());
288 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
293 std::string
pathname = metoedmobject[
i].name;
301 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
303 if (
j != fulldir.size() - 2) dir +=
"/";
308 me1[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
309 if (
me1[
i] &&
me1[
i]->getTH1D() &&
me1[
i]->getTH1D()->TestBit(TH1::kCanRebin) ==
true) {
311 list.Add(&metoedmobject[
i].
object);
312 if (
me1[
i]->getTH1D()->Merge(&list) == -1)
313 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
314 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
318 &metoedmobject[
i].
object);
320 if (!iEndRun)
me1[
i]->setLumiFlag();
326 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
334 iGetFrom.getByLabel(*inputTag, metoedm);
342 std::vector<MEtoEDM<TH2F>::MEtoEDMObject> metoedmobject =
343 metoedm->getMEtoEdmObject();
345 me2.resize(metoedmobject.size());
347 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
352 std::string
pathname = metoedmobject[
i].name;
360 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
362 if (
j != fulldir.size() - 2) dir +=
"/";
367 me2[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
370 list.Add(&metoedmobject[
i].
object);
372 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
373 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
377 &metoedmobject[
i].
object);
379 if (!iEndRun)
me2[
i]->setLumiFlag();
385 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
393 iGetFrom.getByLabel(*inputTag, metoedm);
401 std::vector<MEtoEDM<TH2S>::MEtoEDMObject> metoedmobject =
402 metoedm->getMEtoEdmObject();
404 me2.resize(metoedmobject.size());
406 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
411 std::string
pathname = metoedmobject[
i].name;
419 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
421 if (
j != fulldir.size() - 2) dir +=
"/";
426 me2[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
427 if (
me2[
i] &&
me2[
i]->getTH2S() &&
me2[
i]->getTH2S()->TestBit(TH1::kCanRebin) ==
true) {
429 list.Add(&metoedmobject[
i].
object);
430 if (
me2[
i]->getTH2S()->Merge(&list) == -1)
431 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
432 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
436 &metoedmobject[
i].
object);
438 if (!iEndRun)
me2[
i]->setLumiFlag();
444 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
452 iGetFrom.getByLabel(*inputTag, metoedm);
460 std::vector<MEtoEDM<TH2D>::MEtoEDMObject> metoedmobject =
461 metoedm->getMEtoEdmObject();
463 me2.resize(metoedmobject.size());
465 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
470 std::string
pathname = metoedmobject[
i].name;
478 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
480 if (
j != fulldir.size() - 2) dir +=
"/";
485 me2[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
486 if (
me2[
i] &&
me2[
i]->getTH2D() &&
me2[
i]->getTH2D()->TestBit(TH1::kCanRebin) ==
true) {
488 list.Add(&metoedmobject[
i].
object);
489 if (
me2[
i]->getTH2D()->Merge(&list) == -1)
490 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
491 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
495 &metoedmobject[
i].
object);
497 if (!iEndRun)
me2[
i]->setLumiFlag();
503 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
511 iGetFrom.getByLabel(*inputTag, metoedm);
519 std::vector<MEtoEDM<TH3F>::MEtoEDMObject> metoedmobject =
520 metoedm->getMEtoEdmObject();
522 me3.resize(metoedmobject.size());
524 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
529 std::string
pathname = metoedmobject[
i].name;
537 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
539 if (
j != fulldir.size() - 2) dir +=
"/";
544 me3[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
547 list.Add(&metoedmobject[
i].
object);
549 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
550 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
554 &metoedmobject[
i].
object);
556 if (!iEndRun)
me3[
i]->setLumiFlag();
562 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
570 iGetFrom.getByLabel(*inputTag, metoedm);
578 std::vector<MEtoEDM<TProfile>::MEtoEDMObject> metoedmobject =
579 metoedm->getMEtoEdmObject();
581 me4.resize(metoedmobject.size());
583 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
588 std::string
pathname = metoedmobject[
i].name;
596 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
598 if (
j != fulldir.size() - 2) dir +=
"/";
601 std::string
name = metoedmobject[
i].object.GetName();
604 me4[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
607 list.Add(&metoedmobject[
i].
object);
609 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
610 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
614 &metoedmobject[
i].
object);
616 if (!iEndRun)
me4[
i]->setLumiFlag();
622 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
630 iGetFrom.getByLabel(*inputTag, metoedm);
638 std::vector<MEtoEDM<TProfile2D>::MEtoEDMObject> metoedmobject =
639 metoedm->getMEtoEdmObject();
641 me5.resize(metoedmobject.size());
643 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
648 std::string
pathname = metoedmobject[
i].name;
656 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
658 if (
j != fulldir.size() - 2) dir +=
"/";
663 me5[
i] =
dbe->
get(dir+
"/"+metoedmobject[
i].
object.GetName());
666 list.Add(&metoedmobject[
i].
object);
668 std::cout <<
"ERROR EDMtoMEConverter::getData(): merge failed for '"
669 << metoedmobject[
i].object.GetName() <<
"'" << std::endl;
673 &metoedmobject[
i].
object);
675 if (!iEndRun)
me5[
i]->setLumiFlag();
681 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
689 iGetFrom.getByLabel(*inputTag, metoedm);
697 std::vector<MEtoEDM<double>::MEtoEDMObject> metoedmobject =
698 metoedm->getMEtoEdmObject();
700 me6.resize(metoedmobject.size());
702 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
707 std::string
pathname = metoedmobject[
i].name;
716 name = *(fulldir.end() - 1);
718 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
720 if (
j != fulldir.size() - 2) dir +=
"/";
727 me6[
i]->Fill(metoedmobject[
i].
object);
728 if (!iEndRun)
me6[
i]->setLumiFlag();
734 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
742 iGetFrom.getByLabel(*inputTag, metoedm);
750 std::vector<MEtoEDM<long long>::MEtoEDMObject> metoedmobject =
751 metoedm->getMEtoEdmObject();
753 me7.resize(metoedmobject.size());
755 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
760 std::string
pathname = metoedmobject[
i].name;
768 name = *(fulldir.end() - 1);
770 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
772 if (
j != fulldir.size() - 2) dir +=
"/";
780 if (name.find(
"processedEvents") != std::string::npos) {
782 ival = me->getIntValue();
787 me7[
i]->Fill(metoedmobject[
i].
object+ival);
788 if (!iEndRun)
me7[
i]->setLumiFlag();
794 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
802 iGetFrom.getByLabel(*inputTag, metoedm);
810 std::vector<MEtoEDM<int>::MEtoEDMObject> metoedmobject =
811 metoedm->getMEtoEdmObject();
813 me7.resize(metoedmobject.size());
815 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
820 std::string
pathname = metoedmobject[
i].name;
828 name = *(fulldir.end() - 1);
830 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
832 if (
j != fulldir.size() - 2) dir +=
"/";
840 if (name.find(
"processedEvents") != std::string::npos) {
842 ival = me->getIntValue();
847 me7[
i]->Fill(metoedmobject[
i].
object+ival);
848 if (!iEndRun)
me7[
i]->setLumiFlag();
854 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
862 iGetFrom.getByLabel(*inputTag, metoedm);
870 std::vector<MEtoEDM<TString>::MEtoEDMObject> metoedmobject =
871 metoedm->getMEtoEdmObject();
873 me8.resize(metoedmobject.size());
875 for (
unsigned int i = 0;
i < metoedmobject.size(); ++
i) {
880 std::string
pathname = metoedmobject[
i].name;
888 name = *(fulldir.end() - 1);
890 for (
unsigned j = 0;
j < fulldir.size() - 1; ++
j) {
892 if (
j != fulldir.size() - 2) dir +=
"/";
898 std::string scont = metoedmobject[
i].object.Data();
900 if (!iEndRun)
me8[
i]->setLumiFlag();
906 for (
unsigned int j = 0;
j < tags.size(); ++
j) {
915 std::vector<std::string> stags;
917 for (
unsigned int i = 0;
i < stags.size(); ++
i) {
918 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
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
EDMtoMEConverter(const edm::ParameterSet &)
std::vector< MonitorElement * > me6
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
std::vector< std::string > classtypes
MonitorElement * bookFloat(const char *name)
Book float.
void tag(MonitorElement *me, unsigned int myTag)
edm::InputTag lumiInputTag_
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< MonitorElement * > me8
MonitorElement * bookString(const char *name, const char *value)
Book string.
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)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void getAllTags(std::vector< std::string > &into) const
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)
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::vector< MonitorElement * > me3
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void setCurrentFolder(const std::string &fullpath)
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)
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")