Skip to content

Seperated logging out from `TFCSParmaterizationBase`

Henry Day-Hall requested to merge hdayhall/athena:henry_logging_5 into 23.0

Logging in FastCaloSim was implemented as an in build feature of the class TFCSParametrizationBase. Specialised logging is needed to facilitate compiling and running as a submodule of https://gitlab.cern.ch/atlas-simulation-fastcalosim/FCSParametrization

Having the TFCSParametrizaionBase include the logging directly had become inconvenient. We wanted to develop classes that had no need to be derived from TFCSParametrizationBase, but would want to do logging. We are quite sensitive to memory requirements. Including TFCSParametrizationBase just for logging would be undesirable.

This is now implemented as a mixin class MLogging.h. All inline, it's mostly macros.

Also added one macro ATH_MSG_NOCLASS that will print things outside classes. It needs a logger to be created, which it uses to output the messages through the appropriate stream. Using a snippet like

#import "ISF_FastCaloSimEvent/MLogging"

...

ISF_FCS::MLogging logger;
ATH_MSG_NOCLASS(logger, "Hello world");

placed in the file /my/example/long/file/path.cxx at line 123 will create the print statement

             path.cxx:123 (NOCLASS) Hello world

this allows us to print things from stand alone functions and static functions through the proper channels.

All instances of cout in FCS have been replaced, as agreed on here; !61518 (comment 6526495). Because this is a lot of changes to code that isn't mine, I'm going to leave this in draft mode until I have used it a bit more. I've now worked with this a bit, and everything seems fine. In particular I have created a param file in FCSParameterization using this build, which worked fine.

Edited by Henry Day-Hall

Merge request reports