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 {
21  class FieldBuilder;
22 }
23 
24 class SimWatcher;
25 class SimProducer;
26 class DDDWorld;
27 class G4RunManagerKernel;
28 class SimTrackManager;
29 
30 class GeometryProducer : public edm::one::EDProducer<edm::one::SharedResources, edm::one::WatchRuns> {
31 public:
32  typedef std::vector<std::shared_ptr<SimProducer>> Producers;
33 
34  explicit GeometryProducer(edm::ParameterSet const &p);
35  ~GeometryProducer() override;
36  void beginRun(const edm::Run &r, const edm::EventSetup &c) override;
37  void endRun(const edm::Run &r, const edm::EventSetup &c) override;
38  void produce(edm::Event &e, const edm::EventSetup &c) override;
39  void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &);
40 
41  std::vector<std::shared_ptr<SimProducer>> producers() const { return m_producers; }
42  std::vector<SensitiveTkDetector *> &sensTkDetectors() { return m_sensTkDets; }
43  std::vector<SensitiveCaloDetector *> &sensCaloDetectors() { return m_sensCaloDets; }
44 
45 private:
46  void updateMagneticField(edm::EventSetup const &es);
47 
48  G4RunManagerKernel *m_kernel;
53  std::vector<std::shared_ptr<SimWatcher>> m_watchers;
54  std::vector<std::shared_ptr<SimProducer>> m_producers;
55  std::unique_ptr<sim::FieldBuilder> m_fieldBuilder;
56  std::unique_ptr<SimTrackManager> m_trackManager;
58  std::vector<SensitiveTkDetector *> m_sensTkDets;
59  std::vector<SensitiveCaloDetector *> m_sensCaloDets;
61  bool m_firstRun;
62 };
63 
64 #endif
std::vector< SensitiveTkDetector * > m_sensTkDets
std::vector< std::shared_ptr< SimProducer > > Producers
edm::ParameterSet m_pField
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
std::vector< std::shared_ptr< SimWatcher > > m_watchers
std::vector< SensitiveCaloDetector * > m_sensCaloDets
G4RunManagerKernel * m_kernel
std::vector< std::shared_ptr< SimProducer > > m_producers
SimActivityRegistry m_registry
std::vector< std::shared_ptr< SimProducer > > producers() const
std::unique_ptr< SimTrackManager > m_trackManager
std::unique_ptr< sim::FieldBuilder > m_fieldBuilder
std::vector< SensitiveTkDetector * > & sensTkDetectors()
edm::ParameterSet m_p
Definition: Run.h:45