ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | List of all members
MuonValR4::TrackVisualizationTool::PlotLegend Struct Reference

Helper struct to administer the markers & colors that are added to the legend. More...

Collaboration diagram for MuonValR4::TrackVisualizationTool::PlotLegend:

Public Types

using LegendEntry_t = std::unordered_map< int, PrimitivePtr_t >
 

Public Member Functions

 PlotLegend (const double xLow, const double yLow, const double xHigh, const double yHigh)
 Constructor defining the Legned placement. More...
 
void addColor (const int color, const std::string &label)
 Add new color legend entry. More...
 
void addMarker (const int marker, const std::string &label)
 Add new Marker style to the legend entry. More...
 

Public Attributes

std::unique_ptr< TLegend > legend {}
 
LegendEntry_t markers {}
 
LegendEntry_t colors {}
 

Detailed Description

Helper struct to administer the markers & colors that are added to the legend.

Definition at line 60 of file TrackVisualizationTool.h.

Member Typedef Documentation

◆ LegendEntry_t

using MuonValR4::TrackVisualizationTool::PlotLegend::LegendEntry_t = std::unordered_map<int, PrimitivePtr_t>

Definition at line 78 of file TrackVisualizationTool.h.

Constructor & Destructor Documentation

◆ PlotLegend()

MuonValR4::TrackVisualizationTool::PlotLegend::PlotLegend ( const double  xLow,
const double  yLow,
const double  xHigh,
const double  yHigh 
)
inline

Constructor defining the Legned placement.

Parameters
xLowLow x-end of the Legend (relative coords.)
yLowLow y-end of the Legend (relative coords.)
xHighHigh x-end of the Legend (relative coords.)
yHighHigh y-end of the Legend (relative coords.)

Definition at line 66 of file TrackVisualizationTool.h.

67  :
68  legend{std::make_unique<TLegend>(xLow, yLow, xHigh, yHigh)}{}

Member Function Documentation

◆ addColor()

void MuonValR4::TrackVisualizationTool::PlotLegend::addColor ( const int  color,
const std::string &  label 
)

Add new color legend entry.

Parameters
colorTColor code of the color to add
labelText to be dispayed

Definition at line 70 of file TrackVisualizationTool.cxx.

70  {
71  if (colors.find(color)!= colors.end()) {
72  return;
73  }
74  auto box = MuonValR4::drawBox(0.,0,1,1, color, MuonValR4::fullFilling);
75  legend->AddEntry(box.get(), label.c_str(), "F");
76  colors.insert(std::make_pair(color, std::move(box)));
77  }

◆ addMarker()

void MuonValR4::TrackVisualizationTool::PlotLegend::addMarker ( const int  marker,
const std::string &  label 
)

Add new Marker style to the legend entry.

Parameters
markerTMarkerStyle code to add
labelText to be dispayed

Definition at line 78 of file TrackVisualizationTool.cxx.

78  {
79  if (markers.find(marker)!= markers.end()) {
80  return;
81  }
82  auto tMarker = drawMarker(Amg::Vector2D::Zero(), marker, kBlack);
83  legend->AddEntry(tMarker.get(), label.c_str(), "P");
84  markers.insert(std::make_pair(marker, std::move(tMarker)));
85  }

Member Data Documentation

◆ colors

LegendEntry_t MuonValR4::TrackVisualizationTool::PlotLegend::colors {}

Definition at line 80 of file TrackVisualizationTool.h.

◆ legend

std::unique_ptr<TLegend> MuonValR4::TrackVisualizationTool::PlotLegend::legend {}

Definition at line 77 of file TrackVisualizationTool.h.

◆ markers

LegendEntry_t MuonValR4::TrackVisualizationTool::PlotLegend::markers {}

Definition at line 79 of file TrackVisualizationTool.h.


The documentation for this struct was generated from the following files:
MuonValR4::fullFilling
constexpr int fullFilling
Definition: VisualizationHelpers.h:21
color
Definition: jFexInputByteStreamTool.cxx:25
MuonValR4::drawBox
std::unique_ptr< TBox > drawBox(const Amg::Vector3D &boxCenter, const double boxWidth, const double boxHeight, const int color=kGreen+2, const int fillStyle=hollowFilling, const int view=objViewEta)
Creates a box for drawing, e.g strip measurements.
Definition: VisualizationHelpers.cxx:41
MuonValR4::TrackVisualizationTool::PlotLegend::markers
LegendEntry_t markers
Definition: TrackVisualizationTool.h:79
python.Include.marker
string marker
Definition: Include.py:21
MuonValR4::TrackVisualizationTool::PlotLegend::colors
LegendEntry_t colors
Definition: TrackVisualizationTool.h:80
add-xsec-uncert-quadrature-N.label
label
Definition: add-xsec-uncert-quadrature-N.py:104
MuonValR4::TrackVisualizationTool::PlotLegend::legend
std::unique_ptr< TLegend > legend
Definition: TrackVisualizationTool.h:77
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32