ATLAS Offline Software
Loading...
Searching...
No Matches
IRootVisualizationService.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
10class TObject;
11class EventContext;
12
13namespace MuonValR4{
25 class IRootVisualizationService: virtual public IService {
26 public:
28 using PrimitivePtr_t = std::unique_ptr<TObject>;
30 using PrimitiveVec_t = std::vector<PrimitivePtr_t>;
31
34 virtual ~IRootVisualizationService() = default;
38 std::set<std::string> fileFormats{"pdf"};
41 std::string preFixName{};
43 std::string subDirectory{};
45 std::size_t canvasLimit{5000};
47 bool saveSinglePlots{true};
49 bool saveSummaryPlot{true};
51 bool operator<(const ClientToken& other) const {
52 return preFixName < other.preFixName;
53 }
54
55 bool drawAtlas{true};
57 std::string atlasLabel{"Internal"};
59 bool drawSqrtS{true};
61 std::string sqrtSLabel{"14"};
63 std::string lumiLabel{""};
65 std::array<double, 2> atlasLabelPos{0.65, 0.26};
66 };
67
70 virtual StatusCode registerClient(const ClientToken& token) = 0;
74 public:
76 ~ICanvasObject() = default;
78 enum class AxisRanges: std::uint8_t{
80 };
81
83 virtual double corner(const AxisRanges r) const = 0;
88 virtual void expandPad(const double x, const double y) = 0;
94 virtual void setRangeScale(const double s, bool quadCan = true) = 0;
100 virtual void add(PrimitivePtr_t&& drawMe,
101 const std::string& drawOpt="") = 0;
105 virtual void add(PrimitiveVec_t&& drawMe) = 0;
110 virtual void setAxisTitles(const std::string& xTitle="",
111 const std::string& yTitle="",
112 const std::string& zTitle="") = 0;
114 virtual void trash() = 0;
115 };
116 using CanvasPtr_t = std::shared_ptr<ICanvasObject>;
122 virtual CanvasPtr_t prepareCanvas(const EventContext& ctx,
123 const ClientToken& token,
124 const std::string& canvasName) = 0;
125 };
126}
127#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(PrimitivePtr_t &&drawMe, const std::string &drawOpt="")=0
Add a TObject to the ICanvasObject for later drawing onto a TCanvas.
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...