Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Plot the signal computed by a sensor as a ROOT histogram. More...
#include <ViewSignal.hh>
Public Member Functions | |
ViewSignal () | |
Constructor. | |
~ViewSignal ()=default | |
Destructor. | |
void | SetSensor (Sensor *s) |
Set the sensor from which to retrieve the signal. | |
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 | Plot (const std::string &label, const bool getsignal, const bool total=true, const bool delayed=true, const bool same=false) |
TH1D * | GetHistogram (const char h='t') |
void | SetRangeX (const double xmin, const double xmax) |
Set the x-axis limits explicitly. | |
void | UnsetRangeX () |
Remove the user-defined x-axis limits. | |
void | SetRangeY (const double ymin, const double ymax) |
Set the y-axis limits explicitly. | |
void | UnsetRangeY () |
Remove the user-defined y-axis limits. | |
void | SetLabelY (const std::string &label) |
Override the default y-axis label. | |
void | SetColourTotal (const short col) |
Set the (ROOT) colour with which to draw the total signal. | |
void | SetColourElectrons (const short col) |
Set the (ROOT) colour with which to draw the electron component. | |
void | SetColourIons (const short col) |
Set the (ROOT) colour with hich to draw the hole/ion component. | |
void | SetColourHoles (const short col) |
Set the (ROOT) colour with hich to draw the hole/ion component. | |
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). | |
Public Member Functions inherited from Garfield::ViewBase | |
ViewBase ()=delete | |
Default constructor. | |
ViewBase (const std::string &name) | |
Constructor. | |
virtual | ~ViewBase ()=default |
Destructor. | |
void | SetCanvas (TPad *pad) |
Set the canvas to be painted on. | |
void | SetCanvas () |
Unset an external canvas. | |
TPad * | GetCanvas () |
Retrieve the canvas. | |
void | SetArea (const double xmin, const double ymin, const double xmax, const double ymax) |
virtual void | SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax) |
Set a bounding box (if applicable). | |
void | SetArea () |
virtual void | SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0) |
virtual void | SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0, const double hx, const double hy, const double hz) |
Set the projection plane specifying a hint for the in-plane x axis. | |
void | Rotate (const double angle) |
Rotate the viewing plane (angle in radian). | |
void | SetPlaneXY () |
Set the viewing plane to x-y. | |
void | SetPlaneXZ () |
Set the viewing plane to x-z. | |
void | SetPlaneYZ () |
Set the viewing plane to y-z. | |
void | EnableDebugging (const bool on=true) |
Switch on/off debugging output. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Garfield::ViewBase | |
static std::string | FindUnusedFunctionName (const std::string &s) |
Find an unused function name. | |
static std::string | FindUnusedHistogramName (const std::string &s) |
Find an unused histogram name. | |
static std::string | FindUnusedCanvasName (const std::string &s) |
Find an unused canvas name. | |
Protected Member Functions inherited from Garfield::ViewBase | |
void | UpdateProjectionMatrix () |
template<typename T > | |
void | ToPlane (const T x, const T y, const T z, T &xp, T &yp) const |
template<typename T > | |
bool | InBox (const std::array< T, 3 > &x) const |
void | Clip (const std::array< float, 3 > &x0, const std::array< float, 3 > &x1, std::array< float, 3 > &xc) const |
void | DrawLine (const std::vector< std::array< float, 3 > > &xl, const short col, const short lw) |
std::string | LabelX () |
std::string | LabelY () |
std::string | PlaneDescription () |
bool | PlotLimits (Sensor *sensor, double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | PlotLimits (Component *cmp, double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | PlotLimitsFromUserBox (double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | PlotLimits (std::array< double, 3 > &bbmin, std::array< double, 3 > &bbmax, double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | RangeSet (TPad *) |
void | SetRange (TPad *pad, const double x0, const double y0, const double x1, const double y1) |
Protected Attributes inherited from Garfield::ViewBase | |
std::string | m_className = "ViewBase" |
bool | m_debug = false |
bool | m_userPlotLimits = false |
double | m_xMinPlot = -1. |
double | m_xMaxPlot = 1. |
double | m_yMinPlot = -1. |
double | m_yMaxPlot = 1. |
bool | m_userBox = false |
double | m_xMinBox = -1. |
double | m_xMaxBox = 1. |
double | m_yMinBox = -1. |
double | m_yMaxBox = 1. |
double | m_zMinBox = -1. |
double | m_zMaxBox = 1. |
std::array< std::array< double, 3 >, 3 > | m_proj |
std::array< double, 4 > | m_plane {{0, 0, 1, 0}} |
std::array< std::array< double, 3 >, 3 > | m_prmat |
Plot the signal computed by a sensor as a ROOT histogram.
Definition at line 19 of file ViewSignal.hh.
Garfield::ViewSignal::ViewSignal | ( | ) |
|
default |
Destructor.
|
inline |
Retrieve the histogram for the total, prompt and delayed induced charge or signal.
h | histogram to be returned ('t': total, 'e': electron-induced, 'i': ion/hole-induced). |
Definition at line 61 of file ViewSignal.hh.
void Garfield::ViewSignal::Plot | ( | const std::string & | label, |
const bool | getsignal, | ||
const bool | total = true , |
||
const bool | delayed = true , |
||
const bool | same = false |
||
) |
Retrieve the histogram for the total, prompt and delayed induced charge or signal..
label | Identifier (weighting field) of the signal to be plotted. |
h | histogram to be returned |
electron | Flag whether to plot the electron-induced signal. |
ion | Flag whether to plot the ion/hole-induced signal. |
delayed | Flag whether to plot the delayed signal component. |
same | Flag to keep existing plots on the canvas or not. |
getsignal | is true for plotting the induced signal and false for plotting the induced charge. |
Definition at line 187 of file ViewSignal.cc.
void Garfield::ViewSignal::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 |
||
) |
Plot the signal.
label | Identifier (weighting field) of the signal to be plotted. |
total | Flag whether to plot the total induced signal. |
electron | Flag whether to plot the electron-induced signal. |
ion | Flag whether to plot the ion/hole-induced signal. |
delayed | Flag whether to plot the delayed signal component. |
same | Flag to keep existing plots on the canvas or not. |
Definition at line 45 of file ViewSignal.cc.
Referenced by main().
|
inline |
Set the (ROOT) colours with which to draw the delayed signal(s).
Definition at line 89 of file ViewSignal.hh.
|
inline |
Set the (ROOT) colour with which to draw the electron component.
Definition at line 82 of file ViewSignal.hh.
|
inline |
Set the (ROOT) colour with hich to draw the hole/ion component.
Definition at line 86 of file ViewSignal.hh.
|
inline |
Set the (ROOT) colour with hich to draw the hole/ion component.
Definition at line 84 of file ViewSignal.hh.
|
inline |
Set the (ROOT) colour with which to draw the total signal.
Definition at line 80 of file ViewSignal.hh.
|
inline |
Override the default y-axis label.
Definition at line 77 of file ViewSignal.hh.
void Garfield::ViewSignal::SetRangeX | ( | const double | xmin, |
const double | xmax | ||
) |
Set the x-axis limits explicitly.
Definition at line 25 of file ViewSignal.cc.
void Garfield::ViewSignal::SetRangeY | ( | const double | ymin, |
const double | ymax | ||
) |
Set the y-axis limits explicitly.
Definition at line 35 of file ViewSignal.cc.
void Garfield::ViewSignal::SetSensor | ( | Sensor * | s | ) |
Set the sensor from which to retrieve the signal.
Definition at line 17 of file ViewSignal.cc.
Referenced by main().
|
inline |
Remove the user-defined x-axis limits.
Definition at line 69 of file ViewSignal.hh.
|
inline |
Remove the user-defined y-axis limits.
Definition at line 74 of file ViewSignal.hh.