Skip to content

Commit

Permalink
Merge pull request #34479 from makortel/patch-5
Browse files Browse the repository at this point in the history
Get MagneticField in RunManagerMTWorker::beginRun() instead of produce()
  • Loading branch information
cmsbuild authored Jul 14, 2021
2 parents b6d0e85 + 9b6168c commit b3de1c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SimG4Core/Application/src/RunManagerMTWorker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ void RunManagerMTWorker::beginRun(edm::EventSetup const& es) {
for (auto& maker : m_sdMakers) {
maker.second->beginRun(es);
}
if (m_pUseMagneticField) {
m_pMagField = &es.getData(m_MagField);
}
}

void RunManagerMTWorker::endRun() {
Expand Down Expand Up @@ -312,7 +315,6 @@ void RunManagerMTWorker::initializeG4(RunManagerMT* runManagerMaster, const edm:
if (m_pUseMagneticField) {
const GlobalPoint g(0.f, 0.f, 0.f);

m_pMagField = &es.getData(m_MagField);
sim::FieldBuilder fieldBuilder(m_pMagField, m_pField);

CMSFieldManager* fieldManager = new CMSFieldManager();
Expand Down

0 comments on commit b3de1c2

Please sign in to comment.