27 #include "G4RunManagerKernel.hh" 28 #include "G4TransportationManager.hh" 34 std::vector<std::shared_ptr<SimWatcher>> &oWatchers,
35 std::vector<std::shared_ptr<SimProducer>> &oProds) {
38 std::vector<ParameterSet> watchers;
40 watchers = iP.
getParameter<vector<ParameterSet>>(
"Watchers");
44 for (std::vector<ParameterSet>::iterator itWatcher = watchers.begin(); itWatcher != watchers.end(); ++itWatcher) {
45 std::unique_ptr<SimWatcherMakerBase> maker(
47 if (maker.get() ==
nullptr) {
48 throw cms::Exception(
"SimG4CoreGeometryProducer",
" createWatchers: Unable to find the requested Watcher");
51 std::shared_ptr<SimWatcher> watcherTemp;
52 std::shared_ptr<SimProducer> producerTemp;
53 maker->make(*itWatcher, iReg, watcherTemp, producerTemp);
54 oWatchers.push_back(watcherTemp);
56 oProds.push_back(producerTemp);
67 m_pUseMagneticField(p.getParameter<
bool>(
"UseMagneticField")),
68 m_pUseSensitiveDetectors(p.getParameter<
bool>(
"UseSensitiveDetectors")) {
93 G4TransportationManager *tM = G4TransportationManager::GetTransportationManager();
94 tM->SetFieldManager(fieldManager);
95 fieldBuilder.build(fieldManager, tM->GetPropagatorInField());
96 edm::LogInfo(
"GeometryProducer") <<
"Magentic field is built";
116 m_kernel = G4RunManagerKernel::GetRunManagerKernel();
118 m_kernel =
new G4RunManagerKernel();
132 if (
nullptr != world)
133 edm::LogVerbatim(
"GeometryProducer") <<
" World Volume: " << world->GetName();
134 m_kernel->DefineWorldVolume(world,
true);
142 edm::LogInfo(
"GeometryProducer") <<
" instantiating sensitive detectors ";
148 std::pair<std::vector<SensitiveTkDetector *>, std::vector<SensitiveCaloDetector *>> sensDets =
156 <<
" Tk type Producers, and " <<
m_sensCaloDets.size() <<
" Calo type producers ";
160 (*itProd)->produce(e, es);
std::vector< SensitiveTkDetector * > m_sensTkDets
T getParameter(std::string const &) const
GeometryProducer(edm::ParameterSet const &p)
void endRun(const edm::Run &r, const edm::EventSetup &c) override
def create(alignables, pedeDump, additionalData, outputFile, config)
const DDCompactView * m_pDD
void connect(Observer< const BeginOfJob * > *iObject)
edm::ParameterSet m_pField
~GeometryProducer() override
bool m_pUseSensitiveDetectors
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
#define DEFINE_FWK_MODULE(type)
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
void produce(edm::Event &e, const edm::EventSetup &c) override
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
void updateMagneticField(edm::EventSetup const &es)
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry ®) const
DDDWorldSignal dddWorldSignal_
G4VPhysicalVolume * GetWorldVolumeForWorker() const
T const * product() const
std::unique_ptr< SimTrackManager > m_trackManager
void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
static void createWatchers(const edm::ParameterSet &iP, SimActivityRegistry &iReg, std::vector< std::shared_ptr< SimWatcher >> &oWatchers, std::vector< std::shared_ptr< SimProducer >> &oProds)
T const * product() const
T get(const Candidate &c)