27 #include "G4RunManagerKernel.hh" 28 #include "G4TransportationManager.hh" 34 std::vector<std::shared_ptr<SimWatcher> >& oWatchers,
35 std::vector<std::shared_ptr<SimProducer> >& oProds)
39 std::vector<ParameterSet> watchers;
40 try { watchers = iP.
getParameter<vector<ParameterSet> >(
"Watchers"); }
43 for(std::vector<ParameterSet>::iterator itWatcher = watchers.begin();
44 itWatcher != watchers.end(); ++itWatcher)
46 std::unique_ptr<SimWatcherMakerBase>
48 if(maker.get()==
nullptr) {
50 " createWatchers: Unable to find the requested Watcher");
53 std::shared_ptr<SimWatcher> watcherTemp;
54 std::shared_ptr<SimProducer> producerTemp;
55 maker->make(*itWatcher,iReg,watcherTemp,producerTemp);
56 oWatchers.push_back(watcherTemp);
57 if(producerTemp) oProds.push_back(producerTemp);
63 m_pUseMagneticField(p.getParameter<
bool>(
"UseMagneticField")),
65 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";
117 edm::LogInfo(
"GeometryProducer") <<
"Producing G4 Geom";
119 m_kernel = G4RunManagerKernel::GetRunManagerKernel();
121 edm::LogInfo(
"GeometryProducer") <<
" GeometryProducer initializing ";
135 edm::LogInfo(
"GeometryProducer") <<
" instantiating sensitive detectors ";
140 std::pair< std::vector<SensitiveTkDetector*>,
141 std::vector<SensitiveCaloDetector*> >
148 edm::LogInfo(
"GeometryProducer") <<
" Sensitive Detector building finished; found " 151 <<
" Calo type producers ";
156 (*itProd)->produce(e,es);
T getParameter(std::string const &) const
GeometryProducer(edm::ParameterSet const &p)
void endRun(const edm::Run &r, const edm::EventSetup &c) override
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const DDDWorld &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry ®) const
def create(alignables, pedeDump, additionalData, outputFile, config)
void connect(Observer< const BeginOfJob * > *iObject)
edm::ParameterSet m_pField
#define DEFINE_FWK_MODULE(type)
~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
std::vector< std::shared_ptr< SimWatcher > > m_watchers
G4RunManagerKernel * m_kernel
static void createWatchers(const edm::ParameterSet &iP, SimActivityRegistry &iReg, std::vector< std::shared_ptr< SimWatcher > > &oWatchers, std::vector< std::shared_ptr< SimProducer > > &oProds)
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::vector< SensitiveTkDetector * > m_sensTkDets
DDDWorldSignal dddWorldSignal_
std::unique_ptr< SimTrackManager > m_trackManager
void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
T const * product() const
T get(const Candidate &c)
std::vector< SensitiveCaloDetector * > m_sensCaloDets