GaugiKernel

Contents of core/GaugiKernel

namespace Gaugi

Gaugi namespace.

namespace

class AlgTool : public Gaugi::IAlgTool, public MsgService, public Gaugi::PropertyService

Subclassed by AnomalyGenerator, ConstrainedOptimalFilter, OptimalFilter, PulseGenerator, ShowerShapes

Public Functions

AlgTool()

Constructor

inline virtual ~AlgTool()
const std::string &name() const

Protected Attributes

int m_outputLevel

Output level message

Defines

CHECK_INIT()
namespace Gaugi

Gaugi namespace.

namespace

class Algorithm : public Gaugi::IAlgorithm, public MsgService, public Gaugi::PropertyService

Subclassed by CaloCellMaker, CaloCellMerge, CaloClusterMaker, CaloHitMaker, CaloHitMerge, CaloRingsMaker, CaloRingsMerge, CrossTalkMaker, ElectronMaker, PileupMerge, RootStreamAODMaker, RootStreamAODReader, RootStreamESDMaker, RootStreamESDReader, RootStreamHITMaker, RootStreamHITReader, RootStreamNtupleMaker

Public Functions

Algorithm()

Constructor

inline virtual ~Algorithm()

Destructor

const std::string &name() const

=====================================================================

Return the name of the algorithm

Protected Functions

void initLock()

=====================================================================

void finaLock()

=====================================================================

bool isInitialized() const

=====================================================================

bool isFinalized() const

=====================================================================

Protected Attributes

int m_outputLevel

Level message

Private Members

bool m_isInitialized
bool m_isFinalized
namespace SG
template<class T>
class Collection : public SG::DataHandle

Public Functions

Collection() = default

Contructor

~Collection()

Destructor

inline bool insert(unsigned long int id, T*)

Add a new calo cell into the collection

inline bool retrieve(unsigned long int id, T *&obj) const
inline const std::map<unsigned long int, T*> &operator*() const

Private Members

std::map<unsigned long int, T*> m_collection

Hold all object pointers

namespace Gaugi

Gaugi namespace.

namespace

class ComponentAccumulator : public MsgService, public Gaugi::PropertyService

Public Functions

ComponentAccumulator(std::string name)

=====================================================================

Constructor

virtual ~ComponentAccumulator()

=====================================================================

Destructor

void push_back(Gaugi::Algorithm*)

=====================================================================

add tool

void initialize()

=====================================================================

void bookHistograms(SG::EventContext *ctx) const

=====================================================================

void run(SG::EventContext *ctx, int evt) const

=====================================================================

void finalize()

=====================================================================

Private Functions

long get_mem_usage() const

Private Members

std::vector<Gaugi::Algorithm*> m_toolHandles
namespace Experimental
namespace SG
class DataHandle

Subclassed by SG::Collection< T >, SG::DataVector< T >

Public Functions

DataHandle() = default
inline virtual ~DataHandle()
class EventContext : public MsgService

Public Functions

EventContext(std::string name)

Contructor

~EventContext()

Destructor

template<class T>
void record(std::string &sgkey, std::unique_ptr<T> &container)

Record only Containers of type DataVector<OBJECT>

template<class T>
const T *get(std::string &sgkey)

get the pointer given a key

void clear()

Clear all data handlers map

inline void setStoreGateSvc(StoreGate *store)

Set the store gate service

inline StoreGate *getStoreGateSvc()

Get the store gate service

inline void setThreadId(int id)
inline int getThreadId()
inline void setNumberOfThreads(int numberOfThreads)
inline int getNumberOfThreads()
inline std::vector<std::string> keys() const

Get all keys into the storage

Private Members

std::map<std::string, std::unique_ptr<const DataHandle>> m_storable_ptr
StoreGate *m_store
int m_threadId
int m_numberOfThreads
template<class T>
class ReadHandle

Public Functions

ReadHandle(std::string sgkey, EventContext&)
~ReadHandle()
const T *operator->()
const T *operator*()
const T *ptr()
std::string key()
bool isValid()

Private Members

std::string m_sgkey
const T *m_ptr
bool m_isValid
template<class T>
class WriteHandle

Public Functions

WriteHandle(std::string sgkey, EventContext&)
WriteHandle()
~WriteHandle()
T *operator->()
T &operator*()
void record(std::unique_ptr<T> ptr)
std::string key()

Private Members

std::string m_sgkey

Storage key

std::unique_ptr<T> m_ptr

Hold the container until this object will to out of scope

EventContext *m_ctx

Hold the event context. The destructor will pass the pointer to the event context

namespace SG
template<class T>
class DataVector : public SG::DataHandle

Public Functions

DataVector() = default

Constructor

~DataVector()

Destructor

inline size_t size() const

Return the number of objects into this container

inline void push_back(const T *obj)

Add a new object into the container

inline const std::vector<const T*> &operator*() const

Private Members

std::vector<const T*> m_data

Hold all object pointers

namespace Gaugi

Gaugi namespace.

namespace

class EDM

Subclassed by xAOD::CaloCell, xAOD::CaloCluster, xAOD::CaloDetDescriptor, xAOD::CaloHit, xAOD::CaloRings, xAOD::Electron, xAOD::EventInfo, xAOD::Seed, xAOD::SpacePoint, xAOD::TruthParticle

Public Functions

EDM() = default
~EDM() = default
namespace xAOD

simulator includes

simulator includes geant 4 includes standard includes

simulator libs geant 4 libs standard libs

namespace Gaugi

Gaugi namespace.

namespace

class IAlgTool

Subclassed by Gaugi::AlgTool

Public Functions

inline virtual ~IAlgTool()

Destructor

virtual StatusCode initialize() = 0

Create all resouces here

virtual StatusCode execute(SG::EventContext &ctx, Gaugi::EDM*) const = 0
virtual StatusCode finalize() = 0

Destroy all allocated memory and close all services

Warning

doxygenfile: Found multiple matches for file “IAlgorithm.h

Warning

doxygenfile: Found multiple matches for file “LinkDef.h

Defines

MSG_LVL_CHK(xmsg, lvl)

Macro to be used within MsgService inherited classes.

It will check if message is above level before requesting to enter it into MsgStreamMirror to check it.

MSG_DEBUG(xmsg)

Macro for check and displaying DEBUG messages.

MSG_INFO(xmsg)

Macro for displaying INFO messages

MSG_WARNING(xmsg)

Macro for displaying WARNING messages

MSG_ERROR(xmsg)

Macro for displaying VERBOSE messages

MSG_FATAL(xmsg)

Macro for displaying FATAL messages

It will also raise a std::runtime_error with same message.

endreq

Functions

inline const char *to_str(const MSG::Level lvl)

Get C string from enum.

inline std::ostringstream &operator<<(std::ostringstream &s, MSG::Level)

Overload ostringstream to accept MSG::Level.

In fact, we only need this prototype for the compile to accept the macros declared above. It is implemented only for convinience, as it should be the wanted behavior in case anyone decides to enter the MSG::Level accidently to an ostringstream.

template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &vec)

Overload operator << to accept display vectors.

inline MsgStreamMirror &endmsg(MsgStreamMirror &s)

MsgStreamMirror Modifier: endmsg. Calls the output method of the MsgStreamMirror.

inline MsgStreamMirror &operator<<(MsgStreamMirror &s, const char *arg)

Specialization to avoid the generation of implementations for char[].

See also

{bug #87340}

template<typename T>
MsgStreamMirror &operator<<(MsgStreamMirror &lhs, const T &arg)

General templated stream operator.

inline std::ostream &operator<<(std::ostream &stream, MsgStreamMirror::Message &msg)
class MsgStreamMirror
#include <MsgStream.h>

Adds logging capability to inherited classes.

Based on Athena framework’s MsgStream (almost a copy, but without using Gaudi infrastructure). It cannot have the same name as the Asg class, otherwise we’ll have conflicts on PyROOT usage.

Unnamed Group

inline MsgStreamMirror()

Ctor using standard configuration

inline explicit MsgStreamMirror(const std::string &logname, const int msgLevel)

Ctor using integer for setting logname and msgLevel.

inline explicit MsgStreamMirror(const std::string &logname, const MSG::Level msgLevel)

Ctor setting logname and msgLevel.

inline explicit MsgStreamMirror(const std::string &logname, const int msgLevel, const bool useColor)

Ctor using integer for setting logname and msgLevel and color.

inline explicit MsgStreamMirror(const std::string &logname, const MSG::Level msgLevel, const bool useColor)

Ctor setting logname and msgLevel.

inline MsgStreamMirror(const MsgStreamMirror &msg)

Copy constructor.

Unnamed Group

inline MSG::Level level() const

Inline methods

Retrieve current message level

inline const std::string &logName() const

Retrieve a reference to current logname.

inline bool useColor()

Change logger level.

inline void setLevel(MSG::Level msgLevel)

Change logger level.

inline void setUseColor(const bool useColor)

Change logger level.

inline void setLogName(const std::string &logName)

Change this logger name.

inline MsgStreamMirror &flush()

oMsgStreamMirror flush emulation

inline MsgStreamMirror &operator<<(MsgStreamMirror &(*_f)(MsgStreamMirror&))

Operators overload:

Accept MsgStreamMirror modifiers (this will call endreq/endmsg)

inline MsgStreamMirror &operator<<(std::ostream &(*_f)(std::ostream&))

Accept oMsgStreamMirror modifiers.

inline MsgStreamMirror &operator<<(std::ios &(*_f)(std::ios&))

Accept ios modifiers.

inline MsgStreamMirror &operator<<(MSG::Level level)

Accept MsgStreamMirror activation using MsgStreamMirrorer operator.

inline MsgStreamMirror &operator<<(long long arg)

Accept MsgStreamMirror activation using MsgStreamMirrorer operator.

Unnamed Group

inline long flags() const

IOS emulation

inline long flags(std::ios_base::fmtflags v)
inline long setf(std::ios_base::fmtflags v)
inline int width() const
inline int width(int v)
inline char fill() const
inline char fill(char v)
inline int precision() const
inline int precision(int v)
inline int rdstate() const
inline int good() const
inline int eof() const
inline int bad() const
inline long setf(std::ios_base::fmtflags _f, std::ios_base::fmtflags _m)
inline void unsetf(std::ios_base::fmtflags _l)
inline void clear(std::ios_base::iostate _i = std::ios_base::failbit)

Public Functions

inline MsgStreamMirror &report(MSG::Level lvl)

Initialize report of new message: activate if print level is sufficient.

inline void activate()

Activate MsgStreamMirror.

inline void deactivate()

Deactivate MsgStreamMirror.

inline bool isActive() const

Accessor: is MsgStreamMirror active.

inline bool msgLevel(const MSG::Level lvl) const

Check if logger is active at message level.

void print(const MSG::Level lvl)

Print information about the log.

MsgStreamMirror &doOutput()

Output method.

inline std::ostringstream &stream()

Access string MsgStreamMirror.

Private Members

std::string m_streamName

Stream name used for identifying the origin from the message display.

MSG::Level m_level

The message level where the stream should accept the input.

MSG::Level m_currentLevel

Message level for the current input string.

bool m_useColor

Whether stream uses color.

std::ostringstream m_stream

The auxiliary caching string:

bool m_active

Whether we are active.

class Message
#include <MsgStream.h>

Helper class for displaying MsgStreamMirror messages.

Public Functions

inline explicit Message(const std::string &logName, const MSG::Level level, const bool useColor, const std::string &message)

Ctor.

Public Static Attributes

static constexpr unsigned space_between_log_and_msg = 45

Number of charatecters before displaying message.

static constexpr const char *color[] = {GAUGI_WHITE, GAUGI_GRAY, GAUGI_CYAN, GAUGI_NORMAL, GAUGI_YELLOW, GAUGI_RED, GAUGI_BOLDRED,}

Private Members

std::string m_formatted_msg

The formated message.

Friends

friend std::ostream &operator<<(std::ostream &stream, Message &msg)

Overloads std::cout printing capabilities.

class IMsgService
#include <MsgStream.h>

Adds messaging capability to interface.

Subclassed by MsgService

Public Functions

inline IMsgService()

Builds default interface.

inline IMsgService(const std::string &defName, const MSG::Level defLevel = MSG::INFO, const bool defUseColor = true)

Defines default log name and default level for Messaging Service.

inline virtual ~IMsgService()
inline bool msgLevel(const MSG::Level lvl) const

Check if stream will display at message level.

inline void setMsgLevel(const MSG::Level lvl)

Change stream message level display.

inline void setMsgLevel(const int lvl)
inline MSG::Level getMsgLevel() const

Get Level of output from MsgStreamMirror Manager.

inline void setUseColor(const bool useColor)

Change whether stream use colored messages.

inline bool getUseColor() const

Get whether stream use colored messages.

inline void setLogName(const std::string &name)

Change stream display name.

inline const std::string &getLogName() const

Get stream name.

virtual MsgStreamMirror &msg() = 0

Get streamer.

virtual MsgStreamMirror &msg() const = 0

cv get streamer

Protected Attributes

std::string m_defName

Stores the default stream name for this interface.

MSG::Level m_defLevel

Default level for this interface.

bool m_defUseColor

Default useColor for this interface.

class MsgService : public virtual IMsgService
#include <MsgStream.h>

Consolidate message service capabilitiy.

Subclassed by ActionInitialization, DetectorConstruction_v1, EventAction, Gaugi::AlgTool, Gaugi::Algorithm, Gaugi::ComponentAccumulator, PrimaryGenerator, PrimaryGeneratorAction, RunAction, RunManager, RunSequence, SG::EventContext, SG::StoreGate, SteppingAction, generator::EventTape, generator::IAlgorithm, generator::IGenerator

Public Functions

inline MsgService()

Builds Message service using default configuration set by interface.

inline explicit MsgService(const int lvl)
inline explicit MsgService(const MSG::Level lvl)

Builds Message service changing level.

inline explicit MsgService(const int lvl, const bool useColor)
inline explicit MsgService(const MSG::Level lvl, const bool useColor)
inline virtual MsgStreamMirror &msg() final override

Retrieve log.

inline virtual MsgStreamMirror &msg() const final override

Const Retrieve log.

Private Members

mutable MsgStreamMirror m_log

Message Stream:

namespace MSG

Enums

enum Level

The multiple message levels available

Values:

enumerator NIL
enumerator VERBOSE
enumerator DEBUG
enumerator INFO
enumerator WARNING
enumerator ERROR
enumerator FATAL
namespace Gaugi

Gaugi namespace.

namespace

template<typename T>
class Property : public Gaugi::PropertyBase

Public Functions

inline Property(T &val)
~Property() = default
inline void setValue(T &val)
inline T getValue()

Private Members

T *m_ptr
class PropertyBase

Subclassed by Gaugi::Property< T >

Public Functions

inline virtual ~PropertyBase() = 0
class PropertyService

Subclassed by DetectorConstruction_v1, Gaugi::AlgTool, Gaugi::Algorithm, Gaugi::ComponentAccumulator, PrimaryGenerator, RunManager, generator::EventTape, generator::IAlgorithm, generator::IGenerator

Public Functions

inline PropertyService()
~PropertyService() = default
inline void declareProperty(std::string name, int &value)
inline void declareProperty(std::string name, float &value)
inline void declareProperty(std::string name, double &value)
inline void declareProperty(std::string name, bool &value)
inline void declareProperty(std::string name, std::string &value)
inline void declareProperty(std::string name, std::vector<int> &value)
inline void declareProperty(std::string name, std::vector<bool> &value)
inline void declareProperty(std::string name, std::vector<float> &value)
inline void declareProperty(std::string name, std::vector<std::string> &value)
inline void declareProperty(std::string name, std::vector<std::vector<int>> &value)
inline void setProperty(std::string name, int value)
inline void setProperty(std::string name, float value)
inline void setProperty(std::string name, double value)
inline void setProperty(std::string name, bool value)
inline void setProperty(std::string name, std::string value)
inline void setProperty(std::string name, std::vector<int> value)
inline void setProperty(std::string name, std::vector<bool> value)
inline void setProperty(std::string name, std::vector<float> value)
inline void setProperty(std::string name, std::vector<std::string> value)
inline void setProperty(std::string name, std::vector<std::vector<int>> value)
inline void getProperty(std::string name, int &value)
inline void getProperty(std::string name, float &value)
inline void getProperty(std::string name, double &value)
inline void getProperty(std::string name, bool &value)
inline void getProperty(std::string name, std::string &value)
inline void getProperty(std::string name, std::vector<int> &value)
inline void getProperty(std::string name, std::vector<bool> &value)
inline void getProperty(std::string name, std::vector<float> &value)
inline void getProperty(std::string name, std::vector<std::string> &value)
inline void getProperty(std::string name, std::vector<std::vector<int>> &value)
inline bool hasProperty(std::string name)

Private Functions

template<typename T>
inline void __declareProperty(std::string name, T &value)

Declare property

template<typename T>
inline void __setProperty(std::string name, T &value)

Setter

template<typename T>
inline void __getProperty(std::string name, T &value)

Getter

Private Members

std::map<std::string, std::unique_ptr<PropertyBase>> m_properties
class StatusCode

Public Types

Convenience StatusCode types.

Values:

enumerator FAILURE
enumerator SUCCESS

Public Functions

StatusCode(unsigned long rstat = SUCCESS)

Constructor from an integer status code.

StatusCode(const StatusCode &parent)

Copy constructor.

~StatusCode()

Destructor.

StatusCode &operator=(const StatusCode &rhs)

Assignment operator.

StatusCode &operator=(unsigned long code)

Assignment from an integer code.

bool isSuccess() const

Check if the operation was successful.

bool isFailure() const

Check if the operation was a failure.

operator unsigned long() const

Automatic conversion operator.

inline void setChecked() const

Mark the status code as checked, ignoring it thereby.

inline void ignore() const

Ignore the status code, marking it as checked.

Public Static Functions

static void enableFailure()

Enable failure (with a backtrace) on an unchecked status code.

static void disableFailure()

Disable failure (no backtrace) on an unchecked status code.

Private Members

unsigned long m_code

Code returned by some function.

mutable bool m_checked

Internal status flag of whether the code was checked by the user.

namespace SG
class StoreGate : public MsgService

Public Functions

StoreGate(std::string outputfile)

Constructor

~StoreGate() = default

Destructor

void save()
void mkdir(std::string)

Create directory

void cd(std::string = "")

Move between directories

bool add(TObject*, bool force = false)

Create 1D histogram

TH1F *hist1(std::string)

Get 1D pointer

TH2F *hist2(std::string)

Get 2D pointer

TH1I *histI(std::string)

Get ID pointer

TH2Poly *hist2P(std::string)

Get special TH2 histogram

TTree *tree(std::string)

Get 2D pointer

void setLabels(TH1 *histo, const std::vector<std::string> &labels)
bool decorate(std::string key, TObject*)
TObject *decorator(std::string)

Private Members

std::string m_currentPath
std::unique_ptr<TFile> m_file
std::map<std::string, TObject*> m_objs
std::map<std::string, TObject*> m_decorators
namespace Gaugi

Gaugi namespace.

namespace

class Timer

Public Functions

Timer()
~Timer() = default
time_t resume()

Get the diff time

void start()

Start clock

void stop()

Stop clock

void reset()

Reset the clock

void update()

Update the clock

Private Members

time_t m_start
time_t m_end

Defines

GAUGI_RESET

Do not change this macro

GAUGI_NORMAL
GAUGI_BLACK
GAUGI_RED
GAUGI_GREEN
GAUGI_YELLOW
GAUGI_BLUE
GAUGI_MAGENTA
GAUGI_CYAN
GAUGI_DARKCYAN
GAUGI_GRAY
GAUGI_WHITE
GAUGI_BOLDBLACK
GAUGI_BOLDRED
GAUGI_BOLDGREEN
GAUGI_BOLDYELLOW
GAUGI_BOLDBLUE
GAUGI_BOLDMAGENTA
GAUGI_BOLDCYAN
GAUGI_BOLDWHITE

Defines

PRIMITIVE_SETTER_AND_GETTER(TYPE, VAR, SETTER, GETTER)
Parameters:
  • TYPE – The (primitive) type name

  • VAR – The name of the auxiliary variable

  • SETTER – The name of the “setter function”

  • GETTER – The name of the “getter function”