20 produce_particle_ids(std::size_t
const nParticles)
22 auto particle_ids = std::make_unique<std::vector<int>>(nParticles);
23 auto i =
static_cast<int>(-nParticles);
24 std::generate(
begin(*particle_ids),
end(*particle_ids), [&i] {
33 static constexpr
unsigned maxParticleSize_{10u};
34 std::atomic<unsigned> nPOTs_{};
35 std::atomic<unsigned> nParticles_{};
40 using Parameters = EDProducer::Table<Config>;
41 explicit EventGenerator(Parameters
const&
ps) : EDProducer{ps}
43 produces<std::vector<int>>(
"GenParticles");
44 produces<unsigned, art::InSubRun>(
"nParticles");
45 produces<unsigned, art::InRun>(
"nPOTs");
51 auto const n = (e.
id().
event() % maxParticleSize_);
53 e.
put(produce_particle_ids(
n),
"GenParticles");
60 sr.
put(std::make_unique<unsigned>(nParticles_),
constexpr auto runFragment()
#define DEFINE_ART_MODULE(klass)
auto begin(Data< Value > const &data)
constexpr auto subRunFragment()
EventNumber_t event() const
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)