File indexing completed on 2024-04-06 12:30:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "SimG4Core/Watcher/interface/SimProducer.h"
0018 #include "SimG4Core/Watcher/interface/SimWatcherFactory.h"
0019
0020 class IntSimProducer : public SimProducer {
0021 public:
0022 IntSimProducer(const edm::ParameterSet &);
0023
0024 void produce(edm::Event &e, const edm::EventSetup &) override {
0025 std::unique_ptr<int> newInt(new int(++m_int));
0026 e.put(std::move(newInt));
0027 }
0028
0029 private:
0030 int m_int;
0031 };
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 IntSimProducer::IntSimProducer(const edm::ParameterSet &) {
0044 m_int = 0;
0045 produces<int>();
0046 }
0047
0048 DEFINE_SIMWATCHER(IntSimProducer);