diff --git a/CondTools/DT/plugins/DTKeyedConfigDBDump.cc b/CondTools/DT/plugins/DTKeyedConfigDBDump.cc index fb9a62d4b1db8..0f850e975616e 100644 --- a/CondTools/DT/plugins/DTKeyedConfigDBDump.cc +++ b/CondTools/DT/plugins/DTKeyedConfigDBDump.cc @@ -7,11 +7,16 @@ * */ -//----------------------- -// This Class' Header -- -//----------------------- -#include "CondTools/DT/plugins/DTKeyedConfigDBDump.h" - +//---------------------- +// Base Class Headers -- +//---------------------- +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +//------------------------------------ +// Collaborating Class Declarations -- +//------------------------------------ +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" //------------------------------- // Collaborating Class Headers -- //------------------------------- @@ -21,12 +26,28 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" -//--------------- -// C++ Headers -- -//--------------- -#include -#include +//----------------------- +// This Class' Header -- +//----------------------- +class DTKeyedConfigDBDump : public edm::one::EDAnalyzer<> { +public: + /** Constructor + */ + explicit DTKeyedConfigDBDump(const edm::ParameterSet& ps); + + /** Destructor + */ + ~DTKeyedConfigDBDump() override; + + /** Operations + */ + /// + void beginJob() override; + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; +private: + edm::ESGetToken perskeylistToken_; +}; //------------------- // Initializations -- //------------------- @@ -34,7 +55,7 @@ //---------------- // Constructors -- //---------------- -DTKeyedConfigDBDump::DTKeyedConfigDBDump(const edm::ParameterSet& ps) {} +DTKeyedConfigDBDump::DTKeyedConfigDBDump(const edm::ParameterSet& ps) : perskeylistToken_(esConsumes()) {} //-------------- // Destructor -- @@ -46,28 +67,23 @@ DTKeyedConfigDBDump::~DTKeyedConfigDBDump() {} //-------------- void DTKeyedConfigDBDump::beginJob() { return; } -void DTKeyedConfigDBDump::analyze(const edm::Event& e, const edm::EventSetup& c) { +void DTKeyedConfigDBDump::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { edm::eventsetup::EventSetupRecordKey recordKey( edm::eventsetup::EventSetupRecordKey::TypeTag::findType("DTKeyedConfigListRcd")); if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) { //record not found - std::cout << "Record \"DTKeyedConfigListRcd " - << "\" does not exist " << std::endl; + edm::LogWarning("DTKeyedConfigDBDump") << "Record \"DTKeyedConfigListRcd " + << "\" does not exist " << std::endl; } - edm::ESHandle klh; - std::cout << "got eshandle" << std::endl; - c.get().get(klh); - std::cout << "got context" << std::endl; - cond::persistency::KeyList const& kl = *klh.product(); - cond::persistency::KeyList const* kp = &kl; - std::cout << "now load and get" << std::endl; + cond::persistency::KeyList const* kp = &iSetup.getData(perskeylistToken_); + edm::LogInfo("DTKeyedConfigDBDump") << "now load and get" << std::endl; auto pkc = kp->getUsingKey(999999999); - std::cout << "now check" << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << "now check" << std::endl; if (pkc.get()) - std::cout << pkc->getId() << " " << *(pkc->dataBegin()) << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << pkc->getId() << " " << *(pkc->dataBegin()) << std::endl; else - std::cout << "not found" << std::endl; - std::cout << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << "not found" << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << std::endl; return; } diff --git a/CondTools/DT/plugins/DTKeyedConfigDBDump.h b/CondTools/DT/plugins/DTKeyedConfigDBDump.h deleted file mode 100644 index fd3b2efc752c0..0000000000000 --- a/CondTools/DT/plugins/DTKeyedConfigDBDump.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef DTKeyedConfigDBDump_H -#define DTKeyedConfigDBDump_H -/** \class DTKeyedConfigDBDump - * - * Description: - * - * - * $Date: 2010/03/18 16:07:59 $ - * $Revision: 1.1.2.1 $ - * \author Paolo Ronchese INFN Padova - * - */ - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "FWCore/Framework/interface/EDAnalyzer.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -//--------------- -// C++ Headers -- -//--------------- -#include - -// --------------------- -// -- Class Interface -- -// --------------------- - -class DTKeyedConfigDBDump : public edm::EDAnalyzer { -public: - /** Constructor - */ - explicit DTKeyedConfigDBDump(const edm::ParameterSet& ps); - - /** Destructor - */ - ~DTKeyedConfigDBDump() override; - - /** Operations - */ - /// - void beginJob() override; - void analyze(const edm::Event& e, const edm::EventSetup& c) override; - -private: -}; - -#endif // DTKeyedConfigDBDump_H diff --git a/CondTools/DT/plugins/DTKeyedConfigDBInit.h b/CondTools/DT/plugins/DTKeyedConfigDBInit.h index 3ba081d05ce4c..acd8c9a26af5b 100644 --- a/CondTools/DT/plugins/DTKeyedConfigDBInit.h +++ b/CondTools/DT/plugins/DTKeyedConfigDBInit.h @@ -14,7 +14,7 @@ //---------------------- // Base Class Headers -- //---------------------- -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" //------------------------------------ // Collaborating Class Declarations -- @@ -32,7 +32,7 @@ // -- Class Interface -- // --------------------- -class DTKeyedConfigDBInit : public edm::EDAnalyzer { +class DTKeyedConfigDBInit : public edm::one::EDAnalyzer<> { public: /** Constructor */ diff --git a/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc b/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc index 58d3b3854a4c4..0f63bdb4bbdfe 100644 --- a/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc +++ b/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc @@ -13,27 +13,25 @@ class DTKeyedConfigPopConAnalyzer : public popcon::PopConAnalyzer(pset), - copyData(pset.getParameter("Source").getUntrackedParameter("copyData", true)) {} + copyData(pset.getParameter("Source").getUntrackedParameter("copyData", true)), + perskeylistToken_(esConsumes()) {} ~DTKeyedConfigPopConAnalyzer() override {} - void analyze(const edm::Event& e, const edm::EventSetup& s) override { + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override { if (!copyData) return; - - edm::ESHandle klh; - std::cout << "got eshandle" << std::endl; - s.get().get(klh); - std::cout << "got context" << std::endl; - cond::persistency::KeyList const& kl = *klh.product(); + edm::LogInfo("DTKeyedConfigPopConAnalyzer") << "got context" << std::endl; + cond::persistency::KeyList const& kl = iSetup.getData(perskeylistToken_); for (size_t i = 0; i < kl.size(); i++) { std::shared_ptr kelem = kl.getUsingIndex(i); if (kelem.get()) - std::cout << kelem->getId() << std::endl; + edm::LogInfo("DTKeyedConfigPopConAnalyzer") << kelem->getId() << std::endl; } source().setList(&kl); } private: bool copyData; + edm::ESGetToken perskeylistToken_; }; DEFINE_FWK_MODULE(DTKeyedConfigPopConAnalyzer); diff --git a/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc b/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc index 2087b2dbbf1a7..a8d8d06b92c55 100644 --- a/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc +++ b/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc @@ -12,23 +12,21 @@ class DTUserKeyedConfigPopConAnalyzer : public popcon::PopConAnalyzer { public: DTUserKeyedConfigPopConAnalyzer(const edm::ParameterSet& pset) - : popcon::PopConAnalyzer(pset) {} + : popcon::PopConAnalyzer(pset), perskeylistToken_(esConsumes()) {} ~DTUserKeyedConfigPopConAnalyzer() override {} - void analyze(const edm::Event& e, const edm::EventSetup& s) override { - edm::ESHandle klh; - std::cout << "got eshandle" << std::endl; - s.get().get(klh); - std::cout << "got context" << std::endl; - cond::persistency::KeyList const& kl = *klh.product(); + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override { + edm::LogInfo("DTUserKeyedConfigPopConAnalyzer") << "got eSdata" << std::endl; + cond::persistency::KeyList const& kl = iSetup.getData(perskeylistToken_); for (size_t i = 0; i < kl.size(); i++) { std::shared_ptr kentry = kl.getUsingIndex(i); if (kentry.get()) - std::cout << kentry->getId() << std::endl; + edm::LogInfo("DTUserKeyedConfigPopConAnalyzer") << kentry->getId() << std::endl; } source().setList(&kl); } private: + edm::ESGetToken perskeylistToken_; }; DEFINE_FWK_MODULE(DTUserKeyedConfigPopConAnalyzer); diff --git a/CondTools/DT/test/stubs/DTGeometryDump.cc b/CondTools/DT/test/stubs/DTGeometryDump.cc index de2a6d9a18a83..58c91d90e5546 100644 --- a/CondTools/DT/test/stubs/DTGeometryDump.cc +++ b/CondTools/DT/test/stubs/DTGeometryDump.cc @@ -18,17 +18,15 @@ Toy EDAnalyzer for testing purposes only. namespace edmtest { - DTGeometryDump::DTGeometryDump(edm::ParameterSet const& p) {} + DTGeometryDump::DTGeometryDump(edm::ParameterSet const& p) : dtgeomToken_(esConsumes()) {} - DTGeometryDump::DTGeometryDump(int i) {} + DTGeometryDump::DTGeometryDump(int i) : dtgeomToken_(esConsumes()) {} DTGeometryDump::~DTGeometryDump() {} void DTGeometryDump::analyze(const edm::Event& e, const edm::EventSetup& context) { using namespace edm::eventsetup; - edm::ESHandle muonGeom; - context.get().get(muonGeom); - + auto muonGeom = context.getHandle(dtgeomToken_); const std::vector& ch_cont = muonGeom->chambers(); std::vector::const_iterator ch_iter = ch_cont.begin(); std::vector::const_iterator ch_iend = ch_cont.end(); diff --git a/CondTools/DT/test/stubs/DTGeometryDump.h b/CondTools/DT/test/stubs/DTGeometryDump.h index 1fffd243055f1..fbc1c7519b80c 100644 --- a/CondTools/DT/test/stubs/DTGeometryDump.h +++ b/CondTools/DT/test/stubs/DTGeometryDump.h @@ -12,6 +12,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/ParameterSet/interface/ParameterSet.h" #include +class DTGeometry; +class MuonGeometryRecord; namespace edmtest { class DTGeometryDump : public edm::EDAnalyzer { @@ -22,5 +24,6 @@ namespace edmtest { virtual void analyze(const edm::Event& e, const edm::EventSetup& c); private: + edm::ESGetToken dtgeomToken_; }; } // namespace edmtest diff --git a/CondTools/DT/test/stubs/DTHVDump.cc b/CondTools/DT/test/stubs/DTHVDump.cc index 8eab8714f2626..503a426170f04 100644 --- a/CondTools/DT/test/stubs/DTHVDump.cc +++ b/CondTools/DT/test/stubs/DTHVDump.cc @@ -12,7 +12,6 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "CoralBase/TimeStamp.h" - #include "CondTools/DT/test/stubs/DTHVDump.h" #include "CondFormats/DTObjects/interface/DTHVStatus.h" #include "CondFormats/DataRecord/interface/DTHVStatusRcd.h" @@ -21,11 +20,11 @@ Toy EDAnalyzer for testing purposes only. namespace edmtest { - DTHVDump::DTHVDump(edm::ParameterSet const& p) { + DTHVDump::DTHVDump(edm::ParameterSet const& p) : dthvstatusToken_(esConsumes()) { // parameters to setup } - DTHVDump::DTHVDump(int i) {} + DTHVDump::DTHVDump(int i) : dthvstatusToken_(esConsumes()) {} DTHVDump::~DTHVDump() {} @@ -36,8 +35,7 @@ namespace edmtest { std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl; // get configuration for current run - edm::ESHandle hv; - context.get().get(hv); + auto hv = context.getHandle(dthvstatusToken_); std::cout << hv->version() << std::endl; std::cout << std::distance(hv->begin(), hv->end()) << " data in the container" << std::endl; edm::ValidityInterval iov(context.get().validityInterval()); diff --git a/CondTools/DT/test/stubs/DTHVDump.h b/CondTools/DT/test/stubs/DTHVDump.h index 5210572bd92dc..3f512bbe6d87d 100644 --- a/CondTools/DT/test/stubs/DTHVDump.h +++ b/CondTools/DT/test/stubs/DTHVDump.h @@ -12,7 +12,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/ParameterSet/interface/ParameterSet.h" #include - +class DTHVStatus; +class DTHVStatusRcd; namespace edmtest { class DTHVDump : public edm::EDAnalyzer { public: @@ -22,5 +23,6 @@ namespace edmtest { virtual void analyze(const edm::Event& e, const edm::EventSetup& c); private: + edm::ESGetToken dthvstatusToken_; }; } // namespace edmtest diff --git a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc index 6bb4b9f30ab39..eea3710803c09 100644 --- a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTCCBConfigRcd.h" DTCCBConfigValidateDBRead::DTCCBConfigValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtccbToken_(esConsumes()) {} -DTCCBConfigValidateDBRead::DTCCBConfigValidateDBRead(int i) {} +DTCCBConfigValidateDBRead::DTCCBConfigValidateDBRead(int i) : dtccbToken_(esConsumes()) {} DTCCBConfigValidateDBRead::~DTCCBConfigValidateDBRead() {} @@ -40,8 +42,7 @@ void DTCCBConfigValidateDBRead::analyze(const edm::Event& e, const edm::EventSet run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle conf; - context.get().get(conf); + auto conf = context.getHandle(dtccbToken_); std::cout << conf->version() << std::endl; std::cout << std::distance(conf->begin(), conf->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h index 2a32d7606ad91..7150f5c315431 100644 --- a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h +++ b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h @@ -1,4 +1,3 @@ - /*---------------------------------------------------------------------- Toy EDAnalyzer for testing purposes only. @@ -11,7 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" class DTConfigKey; - +class DTCCBConfig; +class DTCCBConfigRcd; class DTCCBConfigValidateDBRead : public edm::EDAnalyzer { public: explicit DTCCBConfigValidateDBRead(edm::ParameterSet const& p); @@ -23,7 +23,7 @@ class DTCCBConfigValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; - + edm::ESGetToken dtccbToken_; static bool cfrDiff(const std::vector& l_conf, const std::vector& r_conf); static bool cfrDiff(const std::vector& l_conf, const std::vector& r_conf); }; diff --git a/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc b/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc index 6464a23e32591..d5058ff51b376 100644 --- a/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h" DTCompMapValidateDBRead::DTCompMapValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtreadoutmappingToken_(esConsumes()) {} -DTCompMapValidateDBRead::DTCompMapValidateDBRead(int i) {} +DTCompMapValidateDBRead::DTCompMapValidateDBRead(int i) : dtreadoutmappingToken_(esConsumes()) {} DTCompMapValidateDBRead::~DTCompMapValidateDBRead() {} @@ -41,8 +43,7 @@ void DTCompMapValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup // std::ifstream chkFile( run_fn.str().c_str() ); std::ifstream chkFile(dataFileName.c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle ro; - context.get().get(ro); + auto ro = context.getHandle(dtreadoutmappingToken_); std::cout << ro->mapRobRos() << " " << ro->mapCellTdc() << std::endl; std::cout << std::distance(ro->begin(), ro->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTCompMapValidateDBRead.h b/CondTools/DT/test/validate/DTCompMapValidateDBRead.h index 932e4f7a7a538..c83caa8c71498 100644 --- a/CondTools/DT/test/validate/DTCompMapValidateDBRead.h +++ b/CondTools/DT/test/validate/DTCompMapValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTReadOutMapping; +class DTReadOutMappingRcd; class DTCompMapValidateDBRead : public edm::EDAnalyzer { public: explicit DTCompMapValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTCompMapValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtreadoutmappingToken_; }; diff --git a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc index 2333fb3a7bd94..f5989f5870c50 100644 --- a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h" DTDeadFlagValidateDBRead::DTDeadFlagValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtdeadflagToken_(esConsumes()) {} -DTDeadFlagValidateDBRead::DTDeadFlagValidateDBRead(int i) {} +DTDeadFlagValidateDBRead::DTDeadFlagValidateDBRead(int i) : dtdeadflagToken_(esConsumes()) {} DTDeadFlagValidateDBRead::~DTDeadFlagValidateDBRead() {} @@ -40,8 +42,7 @@ void DTDeadFlagValidateDBRead::analyze(const edm::Event& e, const edm::EventSetu run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle df; - context.get().get(df); + auto df = context.getHandle(dtdeadflagToken_); std::cout << df->version() << std::endl; std::cout << std::distance(df->begin(), df->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h index 160b4015c65d7..1255f9b7457f0 100644 --- a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h +++ b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h @@ -10,7 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - +class DTDeadFlag; +class DTDeadFlagRcd; class DTDeadFlagValidateDBRead : public edm::EDAnalyzer { public: explicit DTDeadFlagValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +23,5 @@ class DTDeadFlagValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtdeadflagToken_; }; diff --git a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc index e69811d95a74f..14fc6d432fd59 100644 --- a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTHVStatusRcd.h" DTHVStatusValidateDBRead::DTHVStatusValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dthvstatusToken_(esConsumes()) {} -DTHVStatusValidateDBRead::DTHVStatusValidateDBRead(int i) {} +DTHVStatusValidateDBRead::DTHVStatusValidateDBRead(int i) : dthvstatusToken_(esConsumes()) {} DTHVStatusValidateDBRead::~DTHVStatusValidateDBRead() {} @@ -40,8 +42,7 @@ void DTHVStatusValidateDBRead::analyze(const edm::Event& e, const edm::EventSetu run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle hv; - context.get().get(hv); + auto hv = context.getHandle(dthvstatusToken_); std::cout << hv->version() << std::endl; std::cout << std::distance(hv->begin(), hv->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h index 04578b31a2a1c..7d22769134d31 100644 --- a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h +++ b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h @@ -10,7 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - +class DTHVStatus; +class DTHVStatusRcd; class DTHVStatusValidateDBRead : public edm::EDAnalyzer { public: explicit DTHVStatusValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +23,5 @@ class DTHVStatusValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dthvstatusToken_; }; diff --git a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc index 5f934e1615fc0..f4d54eba544d8 100644 --- a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTLVStatusRcd.h" DTLVStatusValidateDBRead::DTLVStatusValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtlvstatusToken_(esConsumes()) {} -DTLVStatusValidateDBRead::DTLVStatusValidateDBRead(int i) {} +DTLVStatusValidateDBRead::DTLVStatusValidateDBRead(int i) : dtlvstatusToken_(esConsumes()) {} DTLVStatusValidateDBRead::~DTLVStatusValidateDBRead() {} @@ -40,8 +42,7 @@ void DTLVStatusValidateDBRead::analyze(const edm::Event& e, const edm::EventSetu run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle lv; - context.get().get(lv); + auto lv = context.getHandle(dtlvstatusToken_); std::cout << lv->version() << std::endl; std::cout << std::distance(lv->begin(), lv->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h index 27230c325f28c..8f24277d50ffe 100644 --- a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h +++ b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTLVStatus; +class DTLVStatusRcd; class DTLVStatusValidateDBRead : public edm::EDAnalyzer { public: explicit DTLVStatusValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTLVStatusValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtlvstatusToken_; }; diff --git a/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc b/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc index 39e3fbf6c5ea5..eb37bffff8cf5 100644 --- a/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc @@ -29,9 +29,11 @@ Toy EDAnalyzer for testing purposes only. DTMtimeValidateDBRead::DTMtimeValidateDBRead(edm::ParameterSet const& p) : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")), - readLegacyVDriftDB(p.getParameter("readLegacyVDriftDB")) {} + readLegacyVDriftDB(p.getParameter("readLegacyVDriftDB")), + dtmtTimeToken_(esConsumes()), + dtrecoCondToken_(esConsumes()) {} -DTMtimeValidateDBRead::DTMtimeValidateDBRead(int i) {} +DTMtimeValidateDBRead::DTMtimeValidateDBRead(int i) : dtmtTimeToken_(esConsumes()), dtrecoCondToken_(esConsumes()) {} DTMtimeValidateDBRead::~DTMtimeValidateDBRead() {} @@ -54,8 +56,7 @@ void DTMtimeValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& float ckmt; float ckrms; if (readLegacyVDriftDB) { //legacy format - edm::ESHandle mT; - context.get().get(mT); + auto mT = context.getHandle(dtmtTimeToken_); std::cout << mT->version() << std::endl; std::cout << std::distance(mT->begin(), mT->end()) << " data in the container" << std::endl; @@ -83,9 +84,9 @@ void DTMtimeValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& << ckmt << " " << ckrms << " -> " << mTime << " " << mTrms << std::endl; } } else { - edm::ESHandle hVdrift; - context.get().get(hVdrift); - const DTRecoConditions* vDriftMap_ = &*hVdrift; + //hVdrift; + //context.get().get(hVdrift); + const DTRecoConditions* vDriftMap_ = &context.getData(dtrecoCondToken_); // Consistency check: no parametrization is implemented for the time being int version = vDriftMap_->version(); if (version != 1) { diff --git a/CondTools/DT/test/validate/DTMtimeValidateDBRead.h b/CondTools/DT/test/validate/DTMtimeValidateDBRead.h index d59c29e7bae6c..ce81cccf8c893 100644 --- a/CondTools/DT/test/validate/DTMtimeValidateDBRead.h +++ b/CondTools/DT/test/validate/DTMtimeValidateDBRead.h @@ -11,6 +11,10 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTMtime; +class DTMtimeRcd; +class DTRecoConditions; +class DTRecoConditionsVdriftRcd; class DTMtimeValidateDBRead : public edm::EDAnalyzer { public: explicit DTMtimeValidateDBRead(edm::ParameterSet const& p); @@ -23,4 +27,6 @@ class DTMtimeValidateDBRead : public edm::EDAnalyzer { std::string dataFileName; std::string elogFileName; bool readLegacyVDriftDB; // which DB to use + edm::ESGetToken dtmtTimeToken_; + edm::ESGetToken dtrecoCondToken_; }; diff --git a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc index 9f90dc769dd25..7ea71c56d5cab 100644 --- a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTPerformanceRcd.h" DTPerformanceValidateDBRead::DTPerformanceValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtperfToken_(esConsumes()) {} -DTPerformanceValidateDBRead::DTPerformanceValidateDBRead(int i) {} +DTPerformanceValidateDBRead::DTPerformanceValidateDBRead(int i) : dtperfToken_(esConsumes()) {} DTPerformanceValidateDBRead::~DTPerformanceValidateDBRead() {} @@ -40,8 +42,7 @@ void DTPerformanceValidateDBRead::analyze(const edm::Event& e, const edm::EventS run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle mP; - context.get().get(mP); + auto mP = context.getHandle(dtperfToken_); std::cout << mP->version() << std::endl; std::cout << std::distance(mP->begin(), mP->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h index cd73087147c17..f789eb17f8dec 100644 --- a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h +++ b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTPerformance; +class DTPerformanceRcd; class DTPerformanceValidateDBRead : public edm::EDAnalyzer { public: explicit DTPerformanceValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTPerformanceValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtperfToken_; }; diff --git a/CondTools/DT/test/validate/DTROMapValidateDBRead.cc b/CondTools/DT/test/validate/DTROMapValidateDBRead.cc index a74ec0259a57a..7896e6c993b5e 100644 --- a/CondTools/DT/test/validate/DTROMapValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTROMapValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h" DTROMapValidateDBRead::DTROMapValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtreadoutmappingToken_(esConsumes()) {} -DTROMapValidateDBRead::DTROMapValidateDBRead(int i) {} +DTROMapValidateDBRead::DTROMapValidateDBRead(int i) : dtreadoutmappingToken_(esConsumes()) {} DTROMapValidateDBRead::~DTROMapValidateDBRead() {} @@ -41,8 +43,7 @@ void DTROMapValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& // std::ifstream chkFile( run_fn.str().c_str() ); std::ifstream chkFile(dataFileName.c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle ro; - context.get().get(ro); + auto ro = context.getHandle(dtreadoutmappingToken_); std::cout << ro->mapRobRos() << " " << ro->mapCellTdc() << std::endl; std::cout << std::distance(ro->begin(), ro->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTROMapValidateDBRead.h b/CondTools/DT/test/validate/DTROMapValidateDBRead.h index 754c0cb9aa5cf..ef436d1fe2ec2 100644 --- a/CondTools/DT/test/validate/DTROMapValidateDBRead.h +++ b/CondTools/DT/test/validate/DTROMapValidateDBRead.h @@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTReadOutMapping; +class DTReadOutMappingRcd; + class DTROMapValidateDBRead : public edm::EDAnalyzer { public: explicit DTROMapValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +25,5 @@ class DTROMapValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtreadoutmappingToken_; }; diff --git a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc index 532371c0ad27b..9d435269d3df3 100644 --- a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTRangeT0Rcd.h" DTRangeT0ValidateDBRead::DTRangeT0ValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtrangeToken_(esConsumes()) {} -DTRangeT0ValidateDBRead::DTRangeT0ValidateDBRead(int i) {} +DTRangeT0ValidateDBRead::DTRangeT0ValidateDBRead(int i) : dtrangeToken_(esConsumes()) {} DTRangeT0ValidateDBRead::~DTRangeT0ValidateDBRead() {} @@ -40,8 +42,7 @@ void DTRangeT0ValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle tR; - context.get().get(tR); + auto tR = context.getHandle(dtrangeToken_); std::cout << tR->version() << std::endl; std::cout << std::distance(tR->begin(), tR->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h index 6b7beeca7a50b..baf4ec326da8c 100644 --- a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h +++ b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h @@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTRangeT0; +class DTRangeT0Rcd; + class DTRangeT0ValidateDBRead : public edm::EDAnalyzer { public: explicit DTRangeT0ValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +25,5 @@ class DTRangeT0ValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtrangeToken_; }; diff --git a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc index 58b752d5ea0f4..b617adcacfea9 100644 --- a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h" DTStatusFlagValidateDBRead::DTStatusFlagValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtstatusFlagToken_(esConsumes()) {} -DTStatusFlagValidateDBRead::DTStatusFlagValidateDBRead(int i) {} +DTStatusFlagValidateDBRead::DTStatusFlagValidateDBRead(int i) : dtstatusFlagToken_(esConsumes()) {} DTStatusFlagValidateDBRead::~DTStatusFlagValidateDBRead() {} @@ -40,8 +42,7 @@ void DTStatusFlagValidateDBRead::analyze(const edm::Event& e, const edm::EventSe run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle sf; - context.get().get(sf); + auto sf = context.getHandle(dtstatusFlagToken_); std::cout << sf->version() << std::endl; std::cout << std::distance(sf->begin(), sf->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h index 02297c20d470c..fb8527f7b97b8 100644 --- a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h +++ b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTStatusFlag; +class DTStatusFlagRcd; class DTStatusFlagValidateDBRead : public edm::EDAnalyzer { public: explicit DTStatusFlagValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTStatusFlagValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtstatusFlagToken_; }; diff --git a/CondTools/DT/test/validate/DTT0ValidateDBRead.cc b/CondTools/DT/test/validate/DTT0ValidateDBRead.cc index 00d999dd38d88..325343d771175 100644 --- a/CondTools/DT/test/validate/DTT0ValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTT0ValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTT0Rcd.h" DTT0ValidateDBRead::DTT0ValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtT0Token_(esConsumes()) {} -DTT0ValidateDBRead::DTT0ValidateDBRead(int i) {} +DTT0ValidateDBRead::DTT0ValidateDBRead(int i) : dtT0Token_(esConsumes()) {} DTT0ValidateDBRead::~DTT0ValidateDBRead() {} @@ -40,8 +42,7 @@ void DTT0ValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& con run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle t0; - context.get().get(t0); + auto t0 = context.getHandle(dtT0Token_); std::cout << t0->version() << std::endl; std::cout << std::distance(t0->begin(), t0->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTT0ValidateDBRead.h b/CondTools/DT/test/validate/DTT0ValidateDBRead.h index 753563393a680..a99961d48f21f 100644 --- a/CondTools/DT/test/validate/DTT0ValidateDBRead.h +++ b/CondTools/DT/test/validate/DTT0ValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTT0; +class DTT0Rcd; class DTT0ValidateDBRead : public edm::EDAnalyzer { public: explicit DTT0ValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTT0ValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtT0Token_; }; diff --git a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc index 72e2ec817b12b..a208bb23ad85f 100644 --- a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTTPGParametersRcd.h" DTTPGParametersValidateDBRead::DTTPGParametersValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dttpgPramToken_(esConsumes()) {} -DTTPGParametersValidateDBRead::DTTPGParametersValidateDBRead(int i) {} +DTTPGParametersValidateDBRead::DTTPGParametersValidateDBRead(int i) : dttpgPramToken_(esConsumes()) {} DTTPGParametersValidateDBRead::~DTTPGParametersValidateDBRead() {} @@ -40,8 +42,7 @@ void DTTPGParametersValidateDBRead::analyze(const edm::Event& e, const edm::Even run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle tpg; - context.get().get(tpg); + auto tpg = context.getHandle(dttpgPramToken_); std::cout << tpg->version() << std::endl; std::cout << std::distance(tpg->begin(), tpg->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h index 0e9ec5cc5a137..6c6082d92154f 100644 --- a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h +++ b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTTPGParameters; +class DTTPGParametersRcd; class DTTPGParametersValidateDBRead : public edm::EDAnalyzer { public: explicit DTTPGParametersValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTTPGParametersValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dttpgPramToken_; }; diff --git a/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc b/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc index 2875b3da47988..bd9917d6f8d58 100644 --- a/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTTtrigRcd.h" DTTtrigValidateDBRead::DTTtrigValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtTrigToken_(esConsumes()) {} -DTTtrigValidateDBRead::DTTtrigValidateDBRead(int i) {} +DTTtrigValidateDBRead::DTTtrigValidateDBRead(int i) : dtTrigToken_(esConsumes()) {} DTTtrigValidateDBRead::~DTTtrigValidateDBRead() {} @@ -40,8 +42,7 @@ void DTTtrigValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle tT; - context.get().get(tT); + auto tT = context.getHandle(dtTrigToken_); std::cout << tT->version() << std::endl; std::cout << std::distance(tT->begin(), tT->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTTtrigValidateDBRead.h b/CondTools/DT/test/validate/DTTtrigValidateDBRead.h index 02c2a2938a160..925d47d137728 100644 --- a/CondTools/DT/test/validate/DTTtrigValidateDBRead.h +++ b/CondTools/DT/test/validate/DTTtrigValidateDBRead.h @@ -10,6 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTTtrig; +class DTTtrigRcd; class DTTtrigValidateDBRead : public edm::EDAnalyzer { public: @@ -22,4 +24,5 @@ class DTTtrigValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtTrigToken_; };