Skip to content

Commit

Permalink
change type of frequency property
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Oct 28, 2024
1 parent 4400e0a commit 85452c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions k4FWCore/components/EventCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class EventCounter final : public Gaudi::Functional::Consumer<void(const EventCo

void operator()(const EventContext& ctx) const override {
++m_count;
if ((m_frequency > 0) && (ctx.evt() % m_frequency == 0)) {
if (m_frequency && (ctx.evt() % m_frequency == 0)) {
info() << "Processing event " << ctx.evt() << endmsg;
}
}

private:
mutable Gaudi::Accumulators::Counter<> m_count{this, "count"};
Gaudi::Property<int> m_frequency{this, "Frequency", 1, "How often to print the event number"};
Gaudi::Property<unsigned int> m_frequency{this, "Frequency", 1, "How often to print the event number"};
};

DECLARE_COMPONENT(EventCounter)
2 changes: 1 addition & 1 deletion test/k4FWCoreTest/options/TestEventCounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, ShowDataFlow=True, OutputLevel=WARNING)

counter_1 = EventCounter("SilentEventCounter", Frequency=0, OutputLevel=INFO)
counter_1 = EventCounter("SilentEventCounter", Frequency=-2, OutputLevel=INFO)
counter_2 = EventCounter("EventCounter", Frequency=2, OutputLevel=INFO)


Expand Down

0 comments on commit 85452c7

Please sign in to comment.