Skip to content

Commit

Permalink
add WatchRuns transition watcher where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
francescobrivio committed Dec 9, 2021
1 parent ce3e23b commit 49807ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CondCore/ESSources/test/stubs/PedestalsAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Toy EDProducers and EDProducts for testing purposes only.
using namespace std;

namespace edmtest {
class PedestalsAnalyzer : public edm::one::EDAnalyzer<> {
class PedestalsAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit PedestalsAnalyzer(edm::ParameterSet const& p)
: thePedestalToken_(esConsumes()), theBeginRunPedestalToken_(esConsumes<edm::Transition::BeginRun>()) {
Expand All @@ -32,8 +32,9 @@ namespace edmtest {
explicit PedestalsAnalyzer(int i) { edm::LogPrint("PedestalsAnalyzer") << "PedestalsAnalyzer " << i; }
virtual ~PedestalsAnalyzer() { edm::LogPrint("PedestalsAnalyzer") << "~PedestalsAnalyzer "; }
virtual void beginJob();
virtual void beginRun(const edm::Run&, const edm::EventSetup& context);
virtual void beginRun(const edm::Run&, const edm::EventSetup& context) override;
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
virtual void endRun(const edm::Run&, const edm::EventSetup&) override;

private:
const edm::ESGetToken<Pedestals, PedestalsRcd> thePedestalToken_, theBeginRunPedestalToken_;
Expand Down Expand Up @@ -68,5 +69,6 @@ namespace edmtest {
f->WriteObjectAny(myped, "Pedestals", "Pedestals");
f->Close();
}
void PedestalsAnalyzer::endRun(const edm::Run&, const edm::EventSetup&) {}
DEFINE_FWK_MODULE(PedestalsAnalyzer);
} // namespace edmtest
4 changes: 2 additions & 2 deletions CondCore/ESSources/test/stubs/TestUpdater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ EVENTSETUP_RECORD_REG(OneIntRcd);

namespace condtest {

class TestUpdater : public edm::one::EDAnalyzer<> {
class TestUpdater : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit TestUpdater(edm::ParameterSet const&);
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
virtual void beginRun(const edm::Run&, const edm::EventSetup&);
virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;

static void update(int run);

Expand Down

0 comments on commit 49807ab

Please sign in to comment.