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 namespace cms {
25  class DDCompactView;
26 }
27 
28 class SimWatcher;
29 class SimProducer;
30 class DDDWorld;
31 class G4RunManagerKernel;
32 class SimTrackManager;
33 class DDCompactView;
34 
35 class GeometryProducer : public edm::one::EDProducer<edm::one::SharedResources, edm::one::WatchRuns> {
36 public:
37  typedef std::vector<std::shared_ptr<SimProducer>> Producers;
38 
39  explicit GeometryProducer(edm::ParameterSet const &p);
40  ~GeometryProducer() override;
41  void beginRun(const edm::Run &r, const edm::EventSetup &c) override;
42  void endRun(const edm::Run &r, const edm::EventSetup &c) override;
43  void produce(edm::Event &e, const edm::EventSetup &c) override;
45 
46  std::vector<std::shared_ptr<SimProducer>> producers() const { return m_producers; }
47  std::vector<SensitiveTkDetector *> &sensTkDetectors() { return m_sensTkDets; }
48  std::vector<SensitiveCaloDetector *> &sensCaloDetectors() { return m_sensCaloDets; }
49 
50 private:
51  void updateMagneticField(edm::EventSetup const &es);
52 
53  G4RunManagerKernel *m_kernel;
56  std::vector<std::shared_ptr<SimWatcher>> m_watchers;
57  std::vector<std::shared_ptr<SimProducer>> m_producers;
58  std::unique_ptr<sim::FieldBuilder> m_fieldBuilder;
59  std::unique_ptr<SimTrackManager> m_trackManager;
61  std::vector<SensitiveTkDetector *> m_sensTkDets;
62  std::vector<SensitiveCaloDetector *> m_sensCaloDets;
64 
65  mutable const DDCompactView *m_pDD;
66  mutable const cms::DDCompactView *m_pDD4hep;
67 
68  bool m_firstRun;
72 };
73 
74 #endif
GeometryProducer::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
Definition: GeometryProducer.cc:104
SimTrackManager
Definition: SimTrackManager.h:35
Handle.h
GeometryProducer::m_pDD4hep
const cms::DDCompactView * m_pDD4hep
Definition: GeometryProducer.h:66
GeometryProducer::m_p
edm::ParameterSet m_p
Definition: GeometryProducer.h:63
EDProducer.h
GeometryProducer::m_pUseSensitiveDetectors
bool m_pUseSensitiveDetectors
Definition: GeometryProducer.h:70
GeometryProducer::m_sensCaloDets
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: GeometryProducer.h:62
SensitiveCaloDetector.h
GeometryProducer::m_pGeoFromDD4hep
bool m_pGeoFromDD4hep
Definition: GeometryProducer.h:71
DDDWorld
Definition: DDDWorld.h:14
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
GeometryProducer::m_registry
SimActivityRegistry m_registry
Definition: GeometryProducer.h:55
GeometryProducer::producers
std::vector< std::shared_ptr< SimProducer > > producers() const
Definition: GeometryProducer.h:46
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GeometryProducer::sensTkDetectors
std::vector< SensitiveTkDetector * > & sensTkDetectors()
Definition: GeometryProducer.h:47
edm::one::EDProducer
Definition: EDProducer.h:30
GeometryProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: GeometryProducer.cc:113
SensitiveTkDetector.h
SimActivityRegistry.h
MakerMacros.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
Run.h
GeometryProducer::Producers
std::vector< std::shared_ptr< SimProducer > > Producers
Definition: GeometryProducer.h:37
GeometryProducer::m_attach
AttachSD * m_attach
Definition: GeometryProducer.h:60
GeometryProducer::endRun
void endRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: GeometryProducer.cc:111
GeometryProducer::updateMagneticField
void updateMagneticField(edm::EventSetup const &es)
Definition: GeometryProducer.cc:87
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SimProducer
Definition: SimProducer.h:64
sim
Definition: GeometryProducer.h:20
GeometryProducer::GeometryProducer
GeometryProducer(edm::ParameterSet const &p)
Definition: GeometryProducer.cc:62
GeometryProducer::m_fieldBuilder
std::unique_ptr< sim::FieldBuilder > m_fieldBuilder
Definition: GeometryProducer.h:58
SimWatcher
Definition: SimWatcher.h:33
GeometryProducer::m_kernel
G4RunManagerKernel * m_kernel
Definition: GeometryProducer.h:53
edm::EventSetup
Definition: EventSetup.h:57
GeometryProducer::m_sensTkDets
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: GeometryProducer.h:61
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
GeometryProducer::m_pDD
const DDCompactView * m_pDD
Definition: GeometryProducer.h:65
AttachSD.h
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GeometryProducer::sensCaloDetectors
std::vector< SensitiveCaloDetector * > & sensCaloDetectors()
Definition: GeometryProducer.h:48
GeometryProducer::m_producers
std::vector< std::shared_ptr< SimProducer > > m_producers
Definition: GeometryProducer.h:57
GeometryProducer::m_firstRun
bool m_firstRun
Definition: GeometryProducer.h:68
GeometryProducer::beginRun
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: GeometryProducer.cc:109
SimActivityRegistry
Definition: SimActivityRegistry.h:43
SensitiveDetector.h
cms::DDCompactView
Definition: DDCompactView.h:31
EventSetup.h
AttachSD
Definition: AttachSD.h:17
GeometryProducer::m_watchers
std::vector< std::shared_ptr< SimWatcher > > m_watchers
Definition: GeometryProducer.h:56
ParameterSet.h
GeometryProducer
Definition: GeometryProducer.h:35
GeometryProducer::m_trackManager
std::unique_ptr< SimTrackManager > m_trackManager
Definition: GeometryProducer.h:59
edm::Event
Definition: Event.h:73
GeometryProducer::m_pUseMagneticField
bool m_pUseMagneticField
Definition: GeometryProducer.h:69
GeometryProducer::~GeometryProducer
~GeometryProducer() override
Definition: GeometryProducer.cc:82
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
GeometryProducer::m_pField
edm::ParameterSet m_pField
Definition: GeometryProducer.h:54