Skip to content

Commit 31b85f4

Browse files
committed
late initialization of volume to module map
1 parent cd5a8ca commit 31b85f4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/MCStepLoggerImpl.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ class StepLogger
214214

215215
std::vector<StepInfo> container;
216216
bool mTTreeIO = false;
217+
bool mVolMapInitialized = false;
217218

218219
public:
219220
StepLogger()
@@ -223,15 +224,20 @@ class StepLogger
223224
if (std::getenv("MCSTEPLOG_TTREE")) {
224225
mTTreeIO = true;
225226
}
226-
// try to load the volumename -> modulename mapping
227-
initVolumeMap();
227+
228228

229229
// init the sensitive volume stuff
230230
StepInfo::lookupstructures.initSensitiveVolLookup(getSensitiveVolFile());
231231
}
232232

233233
void addStep(TVirtualMC* mc)
234234
{
235+
if (!mVolMapInitialized) {
236+
// try to load the volumename -> modulename mapping
237+
initVolumeMap();
238+
mVolMapInitialized = true;
239+
}
240+
235241
if (mTTreeIO) {
236242
container.emplace_back(mc);
237243
} else {

0 commit comments

Comments
 (0)