|
|
Go to the documentation of this file.
28 #include "G4RunManagerKernel.hh"
29 #include "G4TransportationManager.hh"
36 std::vector<std::shared_ptr<SimWatcher>> &oWatchers,
37 std::vector<std::shared_ptr<SimProducer>> &oProds) {
40 std::vector<ParameterSet> watchers;
42 watchers = iP.
getParameter<vector<ParameterSet>>(
"Watchers");
46 for (std::vector<ParameterSet>::iterator itWatcher = watchers.begin(); itWatcher != watchers.end(); ++itWatcher) {
47 std::unique_ptr<SimWatcherMakerBase> maker(
49 if (maker.get() ==
nullptr) {
50 throw cms::Exception(
"SimG4CoreGeometryProducer",
" 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);
58 oProds.push_back(producerTemp);
70 m_pUseMagneticField(
p.getParameter<
bool>(
"UseMagneticField")),
71 m_pUseSensitiveDetectors(
p.getParameter<
bool>(
"UseSensitiveDetectors")),
72 m_pGeoFromDD4hep(
false) {
97 G4TransportationManager *tM = G4TransportationManager::GetTransportationManager();
98 tM->SetFieldManager(fieldManager);
99 fieldBuilder.build(fieldManager, tM->GetPropagatorInField());
100 edm::LogInfo(
"GeometryProducer") <<
"Magentic field is built";
120 m_kernel = G4RunManagerKernel::GetRunManagerKernel();
122 m_kernel =
new G4RunManagerKernel();
138 if (
nullptr != world)
139 edm::LogVerbatim(
"GeometryProducer") <<
" World Volume: " << world->GetName();
140 m_kernel->DefineWorldVolume(world,
true);
148 edm::LogInfo(
"GeometryProducer") <<
" instantiating sensitive detectors ";
154 std::pair<std::vector<SensitiveTkDetector *>, std::vector<SensitiveCaloDetector *>> sensDets =
162 <<
" Tk type Producers, and " <<
m_sensCaloDets.size() <<
" Calo type producers ";
166 (*itProd)->produce(
e, es);
T const * product() const
void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const cms::DDCompactView * m_pDD4hep
bool m_pUseSensitiveDetectors
std::vector< SensitiveCaloDetector * > m_sensCaloDets
T const * product() const
SimActivityRegistry m_registry
DDDWorldSignal dddWorldSignal_
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry ®) const
void produce(edm::Event &e, const edm::EventSetup &c) override
Log< level::Info, false > LogInfo
def create(alignables, pedeDump, additionalData, outputFile, config)
#define DEFINE_FWK_MODULE(type)
void endRun(const edm::Run &r, const edm::EventSetup &c) override
void updateMagneticField(edm::EventSetup const &es)
G4VPhysicalVolume * GetWorldVolume() const
GeometryProducer(edm::ParameterSet const &p)
G4RunManagerKernel * m_kernel
std::vector< SensitiveTkDetector * > m_sensTkDets
static void createWatchers(const edm::ParameterSet &iP, SimActivityRegistry &iReg, std::vector< std::shared_ptr< SimWatcher >> &oWatchers, std::vector< std::shared_ptr< SimProducer >> &oProds)
const DDCompactView * m_pDD
std::vector< std::shared_ptr< SimProducer > > m_producers
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
Log< level::Info, true > LogVerbatim
void connect(Observer< const BeginOfJob * > *iObject)
T getParameter(std::string const &) const
std::vector< std::shared_ptr< SimWatcher > > m_watchers
std::unique_ptr< SimTrackManager > m_trackManager
~GeometryProducer() override
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
edm::ParameterSet m_pField