37 void PlotSignal(
const std::string& label,
const bool total =
true,
38 const bool electron =
false,
const bool ion =
false,
39 const bool delayed =
false,
const bool same =
false);
51 void Plot(
const std::string& label,
const bool getsignal,
52 const bool total =
true,
const bool delayed =
true,
53 const bool same =
false);
62 return h ==
'e' ? m_hSignalElectrons.get()
63 : h ==
'i' ? m_hSignalIons.get() : m_hSignal.get();
67 void SetRangeX(
const double xmin,
const double xmax);
72 void SetRangeY(
const double ymin,
const double ymax);
77 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_hPromptSignal;
114 std::unique_ptr<TH1D> m_hCharge;
115 std::unique_ptr<TH1D> m_hPromptCharge;
116 std::unique_ptr<TH1D> m_hDelayedCharge;
118 std::unique_ptr<TH1D> m_hSignalElectrons;
119 std::unique_ptr<TH1D> m_hSignalIons;
120 std::unique_ptr<TH1D> m_hDelayedSignal;
121 std::unique_ptr<TH1D> m_hDelayedSignalElectrons;
122 std::unique_ptr<TH1D> m_hDelayedSignalIons;
125 short m_colTotal = kBlue + 3;
126 short m_colElectrons = kOrange - 3;
127 short m_colIons = kRed + 1;
128 std::array<short, 3> m_colDelayed{{kCyan + 2, kYellow - 7, kRed - 9}};
Base class for visualization classes.
Plot the signal computed by a sensor as a ROOT histogram.
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 SetColourIons(const short col)
Set the (ROOT) colour with hich 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 hich 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 PlotSignal(const std::string &label, const bool total=true, const bool electron=false, const bool ion=false, const bool delayed=false, const bool same=false)
void SetColourElectrons(const short col)
Set the (ROOT) colour with which to draw the electron component.
void Plot(const std::string &label, const bool getsignal, const bool total=true, const bool delayed=true, const bool same=false)