ATLAS Offline Software
Loading...
Searching...
No Matches
IRootVisualizationService.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONRECTOOLINTERFACESR4_IROOTVISUALIZATIONSERVICE_H
5#define MUONRECTOOLINTERFACESR4_IROOTVISUALIZATIONSERVICE_H
6
7#include <GaudiKernel/IService.h>
8#include <cstdint>
9#include <string>
10#include <string_view>
11#include <array>
12#include <memory>
13class TObject;
14class EventContext;
15
16namespace MuonValR4{
28 class IRootVisualizationService: virtual public IService {
29 public:
31 using PrimitivePtr_t = std::unique_ptr<TObject>;
33 using PrimitiveVec_t = std::vector<PrimitivePtr_t>;
34
37 virtual ~IRootVisualizationService() = default;
41 std::set<std::string> fileFormats{"pdf"};
44 std::string preFixName{};
46 std::string subDirectory{};
48 std::size_t canvasLimit{5000};
50 bool saveSinglePlots{true};
52 bool saveSummaryPlot{true};
54 bool operator<(const ClientToken& other) const {
55 return preFixName < other.preFixName;
56 }
57
58 bool drawAtlas{true};
60 std::string atlasLabel{"Internal"};
62 bool drawSqrtS{true};
64 std::string sqrtSLabel{"14"};
66 std::string lumiLabel{""};
68 std::array<double, 2> atlasLabelPos{0.65, 0.26};
69 };
70
73 virtual StatusCode registerClient(const ClientToken& token) = 0;
77 public:
79 ~ICanvasObject() = default;
81 enum class AxisRanges: std::uint8_t{
83 };
84
86 virtual double corner(const AxisRanges r) const = 0;
91 virtual void expandPad(const double x, const double y) = 0;
97 virtual void setRangeScale(const double s, bool quadCan = true) = 0;
103 virtual void add(PrimitivePtr_t&& drawMe,
104 std::string_view drawOpt="") = 0;
108 virtual void add(PrimitiveVec_t&& drawMe) = 0;
113 virtual void setAxisTitles(const std::string& xTitle="",
114 const std::string& yTitle="",
115 const std::string& zTitle="") = 0;
117 virtual void trash() = 0;
118 };
119 using CanvasPtr_t = std::shared_ptr<ICanvasObject>;
125 virtual CanvasPtr_t prepareCanvas(const EventContext& ctx,
126 const ClientToken& token,
127 const std::string& canvasName) = 0;
128 };
129}
130#endif
#define y
#define x
Definition of the IRootVisualizationService interface.
DeclareInterfaceID(MuonValR4::IRootVisualizationService, 1, 0)
std::shared_ptr< ICanvasObject > CanvasPtr_t
virtual StatusCode registerClient(const ClientToken &token)=0
Registers a new client to the Service.
virtual ~IRootVisualizationService()=default
Default destructor.
std::unique_ptr< TObject > PrimitivePtr_t
Abrivation for a TObject to be drawn on a canvas.
std::vector< PrimitivePtr_t > PrimitiveVec_t
List of all primitives.
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.
int r
Definition globals.cxx:22
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Token class to identify a particular visualization client.
std::string lumiLabel
Lumi label to be drawn on the plot.
std::string sqrtSLabel
Sqrt s Label to be drawn on the plot.
std::set< std::string > fileFormats
In which formats are the Canvases saved (pdf, png, C, ROOT, etc.).
bool drawSqrtS
flag toggling whether the sqrts Label
std::array< double, 2 > atlasLabelPos
Position of the ATLAS / sqrtS label in relative coordinates.
std::string subDirectory
Subdirectory in which the plots are written.
bool operator<(const ClientToken &other) const
Comparison operator.
bool drawAtlas
Flag toggling whether the ATLAS label shall be drawn.
std::size_t canvasLimit
How many canvases are drawn at maximum in a job.
std::string preFixName
Prefix name of the saved Canvas.
Interface to the container class to temporarily cache the ROOT objects to be drawn on a TCanvas and t...
virtual double corner(const AxisRanges r) const =0
Retrieves a corner coordinate of the drawn canvas.
AxisRanges
Enum to select the corner coordinates shown by the plot.
virtual void setAxisTitles(const std::string &xTitle="", const std::string &yTitle="", const std::string &zTitle="")=0
Define the titles of the Canvas axes.
virtual void add(PrimitiveVec_t &&drawMe)=0
Add a vector of TObjects to the ICanvasObject for later drawing onto a TCanvas.
virtual void expandPad(const double x, const double y)=0
Expands the axes of the pad such that the coordinates are guaranteed to appear at least at the Canvas...
virtual void trash()=0
If no object has been drawn mark the plot as junk.
virtual void setRangeScale(const double s, bool quadCan=true)=0
To ensure that the drawn objects are not cut by the axis limits, a flat scale-factor on the drawn axi...
virtual void add(PrimitivePtr_t &&drawMe, std::string_view drawOpt="")=0
Add a TObject to the ICanvasObject for later drawing onto a TCanvas.