CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GeometryProducer.h
Go to the documentation of this file.
1 #ifndef SimG4Core_GeometryProducer_H
2 #define SimG4Core_GeometryProducer_H
3 
11 
17 
18 #include <memory>
19 
20 namespace sim { class FieldBuilder; }
21 
22 class SimWatcher;
23 class SimProducer;
24 class DDDWorld;
25 class G4RunManagerKernel;
26 class SimTrackManager;
27 
28 class GeometryProducer : public edm::one::EDProducer<edm::one::SharedResources, edm::one::WatchRuns>
29 {
30 public:
31  typedef std::vector<std::shared_ptr<SimProducer> > Producers;
32 
33  explicit GeometryProducer(edm::ParameterSet const & p);
34  virtual ~GeometryProducer() override;
35  virtual void beginRun(const edm::Run & r,const edm::EventSetup& c) override;
36  virtual void endRun(const edm::Run & r,const edm::EventSetup& c) override;
37  virtual void produce(edm::Event & e, const edm::EventSetup & c) override;
39 
40  std::vector<std::shared_ptr<SimProducer> > producers() const
41  { return m_producers; }
42  std::vector<SensitiveTkDetector*>& sensTkDetectors() { return m_sensTkDets; }
43  std::vector<SensitiveCaloDetector*>& sensCaloDetectors() { return m_sensCaloDets; }
44 
45 private:
46 
47  void updateMagneticField( edm::EventSetup const& es );
48 
49  G4RunManagerKernel * m_kernel;
54  std::vector<std::shared_ptr<SimWatcher> > m_watchers;
55  std::vector<std::shared_ptr<SimProducer> > m_producers;
56  std::auto_ptr<sim::FieldBuilder> m_fieldBuilder;
57  std::auto_ptr<SimTrackManager> m_trackManager;
59  std::vector<SensitiveTkDetector*> m_sensTkDets;
60  std::vector<SensitiveCaloDetector*> m_sensCaloDets;
62  bool m_firstRun;
63 };
64 
65 #endif
GeometryProducer(edm::ParameterSet const &p)
virtual void endRun(const edm::Run &r, const edm::EventSetup &c) override
std::vector< std::shared_ptr< SimProducer > > Producers
edm::ParameterSet m_pField
virtual ~GeometryProducer() override
std::auto_ptr< SimTrackManager > m_trackManager
Definition: sim.h:19
std::vector< SensitiveTkDetector * > & sensTkDetectors()
virtual void beginRun(const edm::Run &r, const edm::EventSetup &c) override
std::vector< std::shared_ptr< SimWatcher > > m_watchers
G4RunManagerKernel * m_kernel
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
std::vector< std::shared_ptr< SimProducer > > m_producers
SimActivityRegistry m_registry
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
void updateMagneticField(edm::EventSetup const &es)
std::vector< std::shared_ptr< SimProducer > > producers() const
std::vector< SensitiveTkDetector * > m_sensTkDets
std::auto_ptr< sim::FieldBuilder > m_fieldBuilder
void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
edm::ParameterSet m_p
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: Run.h:43