CMS 3D CMS Logo

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  ~GeometryProducer() override;
35  void beginRun(const edm::Run & r,const edm::EventSetup& c) override;
36  void endRun(const edm::Run & r,const edm::EventSetup& c) override;
37  void produce(edm::Event & e, const edm::EventSetup & c) override;
38  void beginLuminosityBlock(edm::LuminosityBlock&, edm::EventSetup const&);
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::unique_ptr<sim::FieldBuilder> m_fieldBuilder;
57  std::unique_ptr<SimTrackManager> m_trackManager;
59  std::vector<SensitiveTkDetector*> m_sensTkDets;
60  std::vector<SensitiveCaloDetector*> m_sensCaloDets;
62  bool m_firstRun;
63 };
64 
65 #endif
std::vector< std::shared_ptr< SimProducer > > Producers
edm::ParameterSet m_pField
std::vector< SensitiveTkDetector * > & sensTkDetectors()
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
Definition: RunManager.h:28
std::vector< std::shared_ptr< SimProducer > > producers() const
std::vector< SensitiveTkDetector * > m_sensTkDets
std::unique_ptr< SimTrackManager > m_trackManager
std::unique_ptr< sim::FieldBuilder > m_fieldBuilder
edm::ParameterSet m_p
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: Run.h:44