Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:31

0001 // -*- C++ -*-
0002 //
0003 // Package:     Watcher
0004 // Class  :     IntSimProducer
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:
0010 //         Created:  Tue Nov 29 11:33:37 EST 2005
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
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 // constants, enums and typedefs
0034 //
0035 
0036 //
0037 // static data member definitions
0038 //
0039 
0040 //
0041 // constructors and destructor
0042 //
0043 IntSimProducer::IntSimProducer(const edm::ParameterSet &) {
0044   m_int = 0;
0045   produces<int>();
0046 }
0047 
0048 DEFINE_SIMWATCHER(IntSimProducer);