File indexing completed on 2024-04-06 12:12:48
0001 #ifndef EDM_ML_DEBUG
0002 #define EDM_ML_DEBUG
0003 #endif
0004
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/Framework/interface/MakerMacros.h"
0007 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010
0011 namespace edmtest {
0012
0013 class UTC_Vd1 : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
0014 public:
0015 explicit UTC_Vd1(edm::ParameterSet const& ps) : ev(0) {
0016 identifier = ps.getUntrackedParameter<int>("identifier", 99);
0017 }
0018
0019 void analyze(edm::Event const&, edm::EventSetup const&) override;
0020
0021 void beginJob() override;
0022 void beginRun(edm::Run const&, edm::EventSetup const&) override;
0023 void endRun(edm::Run const&, edm::EventSetup const&) override;
0024 void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0025 void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0026
0027 private:
0028 int identifier;
0029 int ev;
0030 };
0031
0032 class UTC_Vd2 : public edm::one::EDAnalyzer<> {
0033 public:
0034 explicit UTC_Vd2(edm::ParameterSet const& ps) : ev(0) {
0035 identifier = ps.getUntrackedParameter<int>("identifier", 98);
0036 }
0037
0038 void analyze(edm::Event const&, edm::EventSetup const&) override;
0039
0040 private:
0041 int identifier;
0042 int ev;
0043 };
0044
0045 void UTC_Vd1::analyze(edm::Event const&, edm::EventSetup const&) {
0046 edm::LogError("cat_A") << "T1 analyze error with identifier " << identifier << " event " << ev;
0047 edm::LogWarning("cat_A") << "T1 analyze warning with identifier " << identifier << " event " << ev;
0048 edm::LogInfo("cat_A") << "T1 analyze info with identifier " << identifier << " event " << ev;
0049 LogDebug("cat_A") << "T1 analyze debug with identifier " << identifier << " event " << ev;
0050 ev++;
0051 }
0052
0053 void UTC_Vd1::beginJob() {
0054 edm::LogWarning("cat_BJ") << "T1 beginJob warning with identifier " << identifier << " event " << ev;
0055 LogDebug("cat_BJ") << "T1 beginJob debug with identifier " << identifier << " event " << ev;
0056 }
0057
0058 void UTC_Vd1::beginRun(edm::Run const&, edm::EventSetup const&) {
0059 edm::LogInfo("cat_BR") << "T1 beginRun info with identifier " << identifier << " event " << ev;
0060 LogDebug("cat_BJ") << "T1 beginRun debug with identifier " << identifier << " event " << ev;
0061 }
0062
0063 void UTC_Vd1::endRun(edm::Run const&, edm::EventSetup const&) {}
0064
0065 void UTC_Vd1::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {
0066 edm::LogWarning("cat_BL") << "T1 beginLumi warning with identifier " << identifier << " event " << ev;
0067 LogDebug("cat_BL") << "T1 beginLumi debug with identifier " << identifier << " event " << ev;
0068 }
0069
0070 void UTC_Vd1::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {}
0071
0072 void UTC_Vd2::analyze(edm::Event const&, edm::EventSetup const&) {
0073 edm::LogError("cat_A") << "T1 analyze error with identifier " << identifier << " event " << ev;
0074 edm::LogWarning("cat_A") << "T1 analyze warning with identifier " << identifier << " event " << ev;
0075 edm::LogInfo("cat_A") << "T1 analyze info with identifier " << identifier << " event " << ev;
0076 ev++;
0077 }
0078
0079 }
0080
0081 using edmtest::UTC_Vd1;
0082 using edmtest::UTC_Vd2;
0083 DEFINE_FWK_MODULE(UTC_Vd1);
0084 DEFINE_FWK_MODULE(UTC_Vd2);