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
Protected Attributes
-
int m_outputLevel
Output level message
-
int m_outputLevel
-
class AlgTool : public Gaugi::IAlgTool, public MsgService, public Gaugi::PropertyService
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
-
Algorithm()
-
class Algorithm : public Gaugi::IAlgorithm, public MsgService, public Gaugi::PropertyService
-
namespace SG
-
template<class T>
class Collection : public SG::DataHandle
-
template<class T>
-
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
-
ComponentAccumulator(std::string name)
-
class ComponentAccumulator : public MsgService, public Gaugi::PropertyService
-
namespace Experimental
-
namespace SG
-
class DataHandle
Subclassed by SG::Collection< T >, SG::DataVector< T >
-
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>
-
void clear()
Clear all data handlers map
-
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
-
EventContext(std::string name)
-
template<class T>
class ReadHandle Public Functions
-
ReadHandle(std::string sgkey, EventContext&)
-
~ReadHandle()
-
std::string key()
-
bool isValid()
-
ReadHandle(std::string sgkey, EventContext&)
-
template<class T>
class WriteHandle Public Functions
-
WriteHandle(std::string sgkey, EventContext&)
-
WriteHandle()
-
~WriteHandle()
-
std::string key()
Private Members
-
std::string m_sgkey
Storage key
-
EventContext *m_ctx
Hold the event context. The destructor will pass the pointer to the event context
-
WriteHandle(std::string sgkey, EventContext&)
-
class DataHandle
-
namespace SG
-
template<class T>
class DataVector : public SG::DataHandle
-
template<class T>
-
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
-
class EDM
-
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
-
inline virtual ~IAlgTool()
-
class IAlgTool
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 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
-
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 const std::string &logName() const
Retrieve a reference to current logname.
-
inline bool useColor()
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.
-
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.
-
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
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.
-
static constexpr unsigned space_between_log_and_msg = 45
-
inline MsgStreamMirror()
-
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 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
-
inline IMsgService()
-
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 int 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:
-
inline MsgService()
-
namespace MSG
-
namespace Gaugi
Gaugi namespace.
namespace
-
template<typename T>
class Property : public Gaugi::PropertyBase Public Functions
-
~Property() = default
-
~Property() = default
-
class PropertyBase
Subclassed by Gaugi::Property< T >
Public Functions
-
inline virtual ~PropertyBase() = 0
-
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
Private Members
-
std::map<std::string, std::unique_ptr<PropertyBase>> m_properties
-
inline PropertyService()
-
template<typename T>
-
class StatusCode
Public Types
Convenience StatusCode types.
Values:
-
enumerator FAILURE
-
enumerator SUCCESS
-
enumerator FAILURE
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.
-
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)
-
StoreGate(std::string outputfile)
-
class StoreGate : public MsgService
-
namespace Gaugi
Gaugi namespace.
namespace
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”