47 const std::string& optTotal =
"t",
48 const std::string& optPrompt =
"",
49 const std::string& optDelayed =
"",
50 const bool same =
false);
59 return h ==
'e' ? m_hSignalElectrons.get()
60 : h ==
'i' ? m_hSignalIons.get() : m_hSignal.get();
64 void SetRangeX(
const double xmin,
const double xmax);
69 void SetRangeY(
const double ymin,
const double ymax);
74 void SetLabelY(
const std::string& label) { m_labelY = label; }
90 const short colElectrons = kYellow - 7,
91 const short colIons = kRed - 9) {
92 m_colDelayed = {colTotal, colElectrons, colIons};
97 Sensor* m_sensor =
nullptr;
102 bool m_userRangeX =
false;
105 bool m_userRangeY =
false;
108 std::string m_labelY =
"";
111 std::unique_ptr<TH1D> m_hSignal;
112 std::unique_ptr<TH1D> m_hSignalElectrons;
113 std::unique_ptr<TH1D> m_hSignalIons;
114 std::unique_ptr<TH1D> m_hPromptSignal;
115 std::unique_ptr<TH1D> m_hPromptElectrons;
116 std::unique_ptr<TH1D> m_hPromptIons;
117 std::unique_ptr<TH1D> m_hDelayedSignal;
118 std::unique_ptr<TH1D> m_hDelayedElectrons;
119 std::unique_ptr<TH1D> m_hDelayedIons;
121 bool m_legend =
false;
124 short m_colTotal = kBlue + 3;
125 short m_colElectrons = kOrange - 3;
126 short m_colIons = kRed + 1;
127 std::array<short, 6> m_colDelayed{
128 {kCyan + 2, kYellow - 7, kRed - 9, kGreen + 1, kYellow - 4, kRed - 9}};
130 std::array<short, 3> m_colPrompt{{kAzure + 10, kRed - 4, kMagenta + 2}};
132 void DrawHistogram(TH1D* h,
const std::string& opt,
const std::string& xlabel,
133 const std::string& ylabel);
ViewBase()=delete
Default constructor.
void UnsetRangeY()
Remove the user-defined y-axis limits.
TH1D * GetHistogram(const char h='t')
void SetColourTotal(const short col)
Set the (ROOT) colour with which to draw the total signal.
~ViewSignal()=default
Destructor.
void SetColourDelayed(const short colTotal, const short colElectrons=kYellow - 7, const short colIons=kRed - 9)
Set the (ROOT) colours with which to draw the delayed signal(s).
void EnableLegend(const bool on=true)
Draw a legend on the plot or not.
void SetColourIons(const short col)
Set the (ROOT) colour with which to draw the hole/ion component.
void SetLabelY(const std::string &label)
Override the default y-axis label.
void SetSensor(Sensor *s)
Set the sensor from which to retrieve the signal.
void SetColourHoles(const short col)
Set the (ROOT) colour with which to draw the hole/ion component.
void UnsetRangeX()
Remove the user-defined x-axis limits.
void SetRangeY(const double ymin, const double ymax)
Set the y-axis limits explicitly.
void SetRangeX(const double xmin, const double xmax)
Set the x-axis limits explicitly.
void SetColourElectrons(const short col)
Set the (ROOT) colour with which to draw the electron component.
void PlotSignal(const std::string &label, const std::string &optTotal="t", const std::string &optPrompt="", const std::string &optDelayed="", const bool same=false)