ATLAS Offline Software
Classes | Public Types | Public Member Functions | List of all members
MuonValR4::IRootVisualizationService Class Referenceabstract

Definition of the IRootVisualizationService interface. More...

#include <IRootVisualizationService.h>

Inheritance diagram for MuonValR4::IRootVisualizationService:
Collaboration diagram for MuonValR4::IRootVisualizationService:

Classes

struct  ClientToken
 Token class to identify a particular visualization client. More...
 
struct  ICanvasObject
 Interface to the container class to temporarily cache the ROOT objects to be drawn on a TCanvas and then saved to disk. More...
 

Public Types

using PrimitivePtr_t = std::unique_ptr< TObject >
 Abrivation for a TObject to be drawn on a canvas. More...
 
using PrimitiveVec_t = std::vector< PrimitivePtr_t >
 List of all primitives. More...
 
using CanvasPtr_t = std::shared_ptr< ICanvasObject >
 

Public Member Functions

 DeclareInterfaceID (MuonValR4::IRootVisualizationService, 1, 0)
 
virtual ~IRootVisualizationService ()=default
 Default destructor. More...
 
virtual StatusCode registerClient (const ClientToken &token)=0
 Registers a new client to the Service. More...
 
virtual CanvasPtr_t prepareCanvas (const EventContext &ctx, const ClientToken &token, const std::string &canvasName)=0
 Prepares a new ICanvasObject to be filled with content by the client. More...
 

Detailed Description

Definition of the IRootVisualizationService interface.

The creation of plots using TCanvas is inheritly thread-hostile. The objects to be drawn mix on the various TCanvas throughout the job. This service enables the creation in MT jobs. It provides a container, the ICanvasObject, where the clients can add the objects to be put into a single plot. Either at the finalization stage or when the maximum number of created plots is reached, the service turns the provided ICanvasObject containers into plots.

To disentangle the multiple clients, the ClientToken needs to be registered in the initialization stage of the client and then presented everytime when a new empty canvas is queried. If the pool of plots is exhausted a nullptr is returned from then on.

Definition at line 25 of file IRootVisualizationService.h.

Member Typedef Documentation

◆ CanvasPtr_t

Definition at line 104 of file IRootVisualizationService.h.

◆ PrimitivePtr_t

using MuonValR4::IRootVisualizationService::PrimitivePtr_t = std::unique_ptr<TObject>

Abrivation for a TObject to be drawn on a canvas.

Definition at line 28 of file IRootVisualizationService.h.

◆ PrimitiveVec_t

List of all primitives.

Definition at line 30 of file IRootVisualizationService.h.

Constructor & Destructor Documentation

◆ ~IRootVisualizationService()

virtual MuonValR4::IRootVisualizationService::~IRootVisualizationService ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ DeclareInterfaceID()

MuonValR4::IRootVisualizationService::DeclareInterfaceID ( MuonValR4::IRootVisualizationService  ,
,
 
)

◆ prepareCanvas()

virtual CanvasPtr_t MuonValR4::IRootVisualizationService::prepareCanvas ( const EventContext &  ctx,
const ClientToken token,
const std::string &  canvasName 
)
pure virtual

Prepares a new ICanvasObject to be filled with content by the client.

If the number of canvases returned exceeds the limit a nullptr is returned.

Parameters
ctxReference to the current EventContext to read the event meta data from
tokenID token to associate the Canvas to the client's output
canvasNameName that's appended to the plot's out file name

◆ registerClient()

virtual StatusCode MuonValR4::IRootVisualizationService::registerClient ( const ClientToken token)
pure virtual

Registers a new client to the Service.

It needs to be called during the initialization stage

Parameters
tokenToken to uniquely identify the client

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