Skip to content

Commit 462fceb

Browse files
Benedikt Volkelsawenzel
authored andcommitted
Disable field logging on request
1 parent 951505c commit 462fceb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

MCStepLogger/src/MCStepLoggerImpl.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ class StepLogger
336336
// pointers to dissallow construction at each library load
337337
StepLogger* logger;
338338
FieldLogger* fieldlogger;
339+
bool doFieldLogging = std::getenv("MCSTEPLOG_NO_FIELD") ? false : true;
339340
} // namespace o2
340341

341342
// a helper template kernel describing generically the redispatching prodecure
@@ -407,8 +408,10 @@ extern "C" void performLogging(TVirtualMCApplication* app)
407408

408409
extern "C" void logField(double const* p, double const* b)
409410
{
410-
static TVirtualMC* mc = TVirtualMC::GetMC();
411-
o2::fieldlogger->addStep(mc, p, b);
411+
if (o2::doFieldLogging) {
412+
static TVirtualMC* mc = TVirtualMC::GetMC();
413+
o2::fieldlogger->addStep(mc, p, b);
414+
}
412415
}
413416

414417
extern "C" void initLogger()

0 commit comments

Comments
 (0)