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 class DDCompactView;
30 
31 class GeometryProducer : public edm::one::EDProducer<edm::one::SharedResources, edm::one::WatchRuns> {
32 public:
33  typedef std::vector<std::shared_ptr<SimProducer>> Producers;
34 
35  explicit GeometryProducer(edm::ParameterSet const &p);
36  ~GeometryProducer() override;
37  void beginRun(const edm::Run &r, const edm::EventSetup &c) override;
38  void endRun(const edm::Run &r, const edm::EventSetup &c) override;
39  void produce(edm::Event &e, const edm::EventSetup &c) override;
40  void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &);
41 
42  std::vector<std::shared_ptr<SimProducer>> producers() const { return m_producers; }
43  std::vector<SensitiveTkDetector *> &sensTkDetectors() { return m_sensTkDets; }
44  std::vector<SensitiveCaloDetector *> &sensCaloDetectors() { return m_sensCaloDets; }
45 
46 private:
47  void updateMagneticField(edm::EventSetup const &es);
48 
49  G4RunManagerKernel *m_kernel;
52  std::vector<std::shared_ptr<SimWatcher>> m_watchers;
53  std::vector<std::shared_ptr<SimProducer>> m_producers;
54  std::unique_ptr<sim::FieldBuilder> m_fieldBuilder;
55  std::unique_ptr<SimTrackManager> m_trackManager;
57  std::vector<SensitiveTkDetector *> m_sensTkDets;
58  std::vector<SensitiveCaloDetector *> m_sensCaloDets;
60 
61  mutable const DDCompactView *m_pDD;
62 
63  bool m_firstRun;
66 };
67 
68 #endif
std::vector< SensitiveTkDetector * > m_sensTkDets
std::vector< std::shared_ptr< SimProducer > > Producers
const DDCompactView * m_pDD
edm::ParameterSet m_pField
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
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