12 : m_className(
"ViewSignal"),
16 m_hasExternalCanvas(false),
25 if (!m_hasExternalCanvas && m_canvas != 0)
delete m_canvas;
26 if (m_hSignal != 0)
delete m_hSignal;
27 if (m_gCrossings != 0)
delete m_gCrossings;
33 std::cerr << m_className <<
"::SetSensor:\n";
34 std::cerr <<
" Sensor pointer is null.\n";
44 if (!m_hasExternalCanvas && m_canvas != 0) {
49 m_hasExternalCanvas =
true;
55 std::cerr << m_className <<
"::PlotSignal:\n";
56 std::cerr <<
" Sensor is not defined.\n";
62 m_canvas =
new TCanvas();
63 m_canvas->SetTitle(
"Signal");
64 if (m_hasExternalCanvas) m_hasExternalCanvas =
false;
76 m_hSignal =
new TH1D(
"hSignal", label.c_str(), nBins, t0, t0 + nBins * dt);
78 m_hSignal->GetXaxis()->SetTitle(
"time [ns]");
79 m_hSignal->GetYaxis()->SetTitle(
"signal [fC / ns]");
82 for (
int i = nBins; i--;) {
84 m_hSignal->SetBinContent(i + 1, sig);
87 if (m_gCrossings != 0) {
95 m_gCrossings =
new TGraph(nCrossings);
96 m_gCrossings->SetMarkerStyle(20);
98 double time = 0., level = 0.;
100 for (
int i = nCrossings; i--;) {
102 m_gCrossings->SetPoint(i, time, level);
108 if (nCrossings > 0) m_gCrossings->Draw(
"psame");
bool GetThresholdCrossing(const int i, double &time, double &level, bool &rise)
int GetNumberOfThresholdCrossings()
void GetTimeWindow(double &tstart, double &tstep, int &nsteps)
double GetSignal(const std::string label, const int bin)
void PlotSignal(const std::string label)
void SetSensor(Sensor *s)
void SetCanvas(TCanvas *c)
PlottingEngineRoot plottingEngine