ATLAS Offline Software
Loading...
Searching...
No Matches
MuonValR4::DynamicLegend Class Reference

#include <PatternVisualizationTool.h>

Collaboration diagram for MuonValR4::DynamicLegend:

Public Member Functions

 DynamicLegend ()
 DynamicLegend (double xmin, double ymin, double xmax, double ymax, int textfont=43, double textSize=10)
TLegendEntry * addOnce (const LegendItem item, TObject *object, const char *label, const char *option)
bool empty () const
std::unique_ptr< TLegend > release ()

Private Attributes

LegendMask m_entries {}
std::unique_ptr< TLegend > m_legend

Detailed Description

Definition at line 69 of file PatternVisualizationTool.h.

Constructor & Destructor Documentation

◆ DynamicLegend() [1/2]

MuonValR4::DynamicLegend::DynamicLegend ( )
inline

Definition at line 71 of file PatternVisualizationTool.h.

72 : m_legend{
73 std::make_unique<TLegend>(
74 0.68, 0.56, 0.94, 0.90)} {
75
76 m_legend->SetBorderSize(0);
77 m_legend->SetFillStyle(0);
78 m_legend->SetTextFont(43);
79 m_legend->SetTextSize(10);
80 }
std::unique_ptr< TLegend > m_legend

◆ DynamicLegend() [2/2]

MuonValR4::DynamicLegend::DynamicLegend ( double xmin,
double ymin,
double xmax,
double ymax,
int textfont = 43,
double textSize = 10 )
inline

Definition at line 82 of file PatternVisualizationTool.h.

84 : m_legend{
85 std::make_unique<TLegend>(
86 xmin, ymin, xmax, ymax)} {
87
88 m_legend->SetBorderSize(0);
89 m_legend->SetFillStyle(0);
90 m_legend->SetTextFont(textfont);
91 m_legend->SetTextSize(textSize);
92 }
double xmax
Definition listroot.cxx:61
double ymin
Definition listroot.cxx:63
double xmin
Definition listroot.cxx:60
double ymax
Definition listroot.cxx:64

Member Function Documentation

◆ addOnce()

TLegendEntry * MuonValR4::DynamicLegend::addOnce ( const LegendItem item,
TObject * object,
const char * label,
const char * option )
inline

Definition at line 94 of file PatternVisualizationTool.h.

98 {
99
100 const std::size_t index =
101 static_cast<std::size_t>(item);
102
103 if (m_entries.test(index)) {
104 return nullptr;
105 }
106
107 TLegendEntry* entry =
108 m_legend->AddEntry(
109 object, label, option);
110
111 if (entry) {
112 m_entries.set(index);
113 }
114
115 return entry;
116 }
std::string label(const std::string &format, int i)
Definition label.h:19
str index
Definition DeMoScan.py:362

◆ empty()

bool MuonValR4::DynamicLegend::empty ( ) const
inline

Definition at line 118 of file PatternVisualizationTool.h.

118 {
119 return m_legend->GetNRows() == 0;
120 }

◆ release()

std::unique_ptr< TLegend > MuonValR4::DynamicLegend::release ( )
inline

Definition at line 122 of file PatternVisualizationTool.h.

122 {
123 return std::move(m_legend);
124 }

Member Data Documentation

◆ m_entries

LegendMask MuonValR4::DynamicLegend::m_entries {}
private

Definition at line 127 of file PatternVisualizationTool.h.

127{};

◆ m_legend

std::unique_ptr<TLegend> MuonValR4::DynamicLegend::m_legend
private

Definition at line 128 of file PatternVisualizationTool.h.


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