diff --git a/src/libraries/JANA/Components/JHasInputs.h b/src/libraries/JANA/Components/JHasInputs.h index 46ed8d360..3fb5e5a4f 100644 --- a/src/libraries/JANA/Components/JHasInputs.h +++ b/src/libraries/JANA/Components/JHasInputs.h @@ -87,6 +87,9 @@ struct JHasInputs { Input(JHasInputs* owner) { owner->RegisterInput(this); this->type_name = JTypeInfo::demangle(); + this->names.push_back(""); + // For non-PODIO inputs, these are technically tags for now, not names + this->levels.push_back(JEventLevel::None); } Input(JHasInputs* owner, const InputOptions& options) { @@ -137,6 +140,8 @@ struct JHasInputs { PodioInput(JHasInputs* owner) { owner->RegisterInput(this); this->type_name = JTypeInfo::demangle(); + this->names.push_back(this->type_name); + this->levels.push_back(JEventLevel::None); } PodioInput(JHasInputs* owner, const InputOptions& options) { diff --git a/src/plugins/JTest/JTestPlotter.h b/src/plugins/JTest/JTestPlotter.h index b13772b53..15a013fff 100644 --- a/src/plugins/JTest/JTestPlotter.h +++ b/src/plugins/JTest/JTestPlotter.h @@ -15,38 +15,34 @@ class JTestPlotter : public JEventProcessor { Parameter m_write_bytes {this, "bytes", 1000, "Bytes written during plotting"}; Parameter m_cputime_spread {this, "cputime_spread", 0.25, "Spread of time spent during plotting"}; Parameter m_write_spread {this, "bytes_spread", 0.25, "Spread of bytes written during plotting"}; - JBenchUtils m_bench_utils = JBenchUtils(); + + Input m_track_data {this}; + Input m_track_aux_data {this}; + + JBenchUtils m_bench_utils; public: JTestPlotter() { SetPrefix("plotter"); SetTypeName(NAME_OF_THIS); + SetCallbackStyle(CallbackStyle::ExpertMode); } - void Process(const std::shared_ptr& event) override { - - m_bench_utils.set_seed(event->GetEventNumber(), typeid(*this).name()); - - // Produce and acquire the track data - auto td = event->GetSingle(); - - // Produce and acquire the track aux data - auto tad = event->Get(); + void Process(const JEvent& event) override { - // Everything that happens after here is in a critical section - std::lock_guard lock(m_mutex); + m_bench_utils.set_seed(event.GetEventNumber(), typeid(*this).name()); // Read the track data - m_bench_utils.read_memory(td->buffer); + m_bench_utils.read_memory(m_track_data->at(0)->buffer); // Consume CPU - m_bench_utils.consume_cpu_ms(*m_cputime_ms + tad.at(0)->something, *m_cputime_spread); + m_bench_utils.consume_cpu_ms(*m_cputime_ms + m_track_aux_data->at(0)->something, *m_cputime_spread); // Write the histogram data auto hd = new JTestHistogramData; m_bench_utils.write_memory(hd->buffer, *m_write_bytes, *m_write_spread); - event->Insert(hd); + event.Insert(hd); } };