QualityControl  1.5.1
O2 Data Quality Control Framework
o2::quality_control::core::ObjectsManager Class Reference

Keeps the list of encapsulated objects to publish and does the actual publication. More...

#include <ObjectsManager.h>

Collaboration diagram for o2::quality_control::core::ObjectsManager:

Public Member Functions

 ObjectsManager (std::string taskName, std::string detectorName, std::string consulUrl, int parallelTaskID=0, bool noDiscovery=false)
 
void startPublishing (TObject *obj)
 
void stopPublishing (TObject *obj)
 
void stopPublishing (const std::string &objectName)
 
bool isBeingPublished (const std::string &name)
 
MonitorObjectgetMonitorObject (std::string objectName)
 
MonitorObjectCollectiongetNonOwningArray () const
 
void addMetadata (const std::string &objectName, const std::string &key, const std::string &value)
 Add metadata to a MonitorObject. Add a metadata pair to a MonitorObject. This is propagated to the database. More...
 
void setDefaultDrawOptions (const std::string &objectName, const std::string &options)
 Set default draw options for this object. If possible, the object will be drawn with these options (in the ROOT sense). See for example https://root.cern/doc/master/classTHistPainter.html#HP01 E.g. manager->setDefaultDRawOptions("histo1", "colz");. More...
 
void setDefaultDrawOptions (TObject *obj, const std::string &options)
 
void setDisplayHint (const std::string &objectName, const std::string &hints)
 Indicate how to display this object. A number of options can be set on a canvas to influence the way the object is displayed. For drawOptions, use setDefaultDrawOptions, for others such as logarithmic scale or grid, use this method. Currently supported by QCG: logx, logy, logz, gridx, gridy, gridz. More...
 
void setDisplayHint (TObject *obj, const std::string &hints)
 
size_t getNumberPublishedObjects ()
 
MonitorObjectgetMonitorObject (size_t index)
 
void updateServiceDiscovery ()
 Update the list of objects stored in the Service Discovery. Update the list of objects stored in the Service Discovery.
 
void removeAllFromServiceDiscovery ()
 Remove all objects from the ServiceDiscovery. Remove all objects from the ServiceDiscovery even though they still might be published by the task. This is typically used at End of Activity.
 

Static Public Attributes

static const std::string gDrawOptionsKey = "drawOptions"
 
static const std::string gDisplayHintsKey = "displayHints"
 

Detailed Description

Keeps the list of encapsulated objects to publish and does the actual publication.

Keeps a list of the objects to publish, encapsulates them and does the actual publication. Tasks set/get properties of the MonitorObjects via this class.

Author
Barthelemy von Haller

Constructor & Destructor Documentation

o2::quality_control::core::ObjectsManager::ObjectsManager ( std::string  taskName,
std::string  detectorName,
std::string  consulUrl,
int  parallelTaskID = 0,
bool  noDiscovery = false 
)

Constructor

Parameters
taskNameTask name
detectorNameDetector 3-letter code
consulUrlConsul URL, for the service discovery
parallelTaskIDID of a parallel Task, use 0 if there is only one.
noDiscoveryIf true disables the use of ServiceDiscovery

Member Function Documentation

void o2::quality_control::core::ObjectsManager::addMetadata ( const std::string &  objectName,
const std::string &  key,
const std::string &  value 
)

Add metadata to a MonitorObject. Add a metadata pair to a MonitorObject. This is propagated to the database.

Parameters
objectNameName of the MonitorObject.
keyKey of the metadata.
valueValue of the metadata.
Exceptions
ObjectNotFoundErrorif object is not found.
MonitorObject * o2::quality_control::core::ObjectsManager::getMonitorObject ( std::string  objectName)

Returns the published MonitorObject specified by its name

Parameters
objectNameThe name of the object to find.
Returns
A pointer to the MonitorObject.
Exceptions
ObjectNotFoundErrorif the object is not found.
MonitorObject * o2::quality_control::core::ObjectsManager::getMonitorObject ( size_t  index)

Returns the published MonitorObject specified by its name

Parameters
index
Returns
A pointer to the MonitorObject.
Exceptions
ObjectNotFoundErrorif the object is not found.
size_t o2::quality_control::core::ObjectsManager::getNumberPublishedObjects ( )

Get the number of objects that have been published.

Returns
an int with the number of objects.
bool o2::quality_control::core::ObjectsManager::isBeingPublished ( const std::string &  name)

Check whether an object is already being published

Parameters
objectName
Returns
true if the object is already being published
void o2::quality_control::core::ObjectsManager::setDefaultDrawOptions ( const std::string &  objectName,
const std::string &  options 
)

Set default draw options for this object. If possible, the object will be drawn with these options (in the ROOT sense). See for example https://root.cern/doc/master/classTHistPainter.html#HP01 E.g. manager->setDefaultDRawOptions("histo1", "colz");.

Parameters
objectNameName of the object affected by these drawOptions.
optionsThe list of options, space separated.
Exceptions
ObjectNotFoundErrorif object is not found.
void o2::quality_control::core::ObjectsManager::setDefaultDrawOptions ( TObject obj,
const std::string &  options 
)
void o2::quality_control::core::ObjectsManager::setDisplayHint ( const std::string &  objectName,
const std::string &  hints 
)

Indicate how to display this object. A number of options can be set on a canvas to influence the way the object is displayed. For drawOptions, use setDefaultDrawOptions, for others such as logarithmic scale or grid, use this method. Currently supported by QCG: logx, logy, logz, gridx, gridy, gridz.

Parameters
objectNameName of the object affected by these drawOptions.
optionsThe list of hints, space separated.
Exceptions
ObjectNotFoundErrorif object is not found.
void o2::quality_control::core::ObjectsManager::setDisplayHint ( TObject obj,
const std::string &  hints 
)
void o2::quality_control::core::ObjectsManager::startPublishing ( TObject obj)

Start publishing the object obj, i.e. it will be pushed forward in the workflow at regular intervals. The ownership remains to the caller.

Parameters
objThe object to publish.
Exceptions
DuplicateObjectError
void o2::quality_control::core::ObjectsManager::stopPublishing ( TObject obj)

Stop publishing this object

Parameters
obj
Exceptions
ObjectNotFoundErrorif object is not found.
void o2::quality_control::core::ObjectsManager::stopPublishing ( const std::string &  objectName)

Stop publishing this object

Parameters
obj
Exceptions
ObjectNotFoundErrorif object is not found.

The documentation for this class was generated from the following files: