52 {
53
54 if (m_sensor == 0) {
55 std::cerr << m_className << "::PlotSignal:\n";
56 std::cerr << " Sensor is not defined.\n";
57 return;
58 }
59
60
61 if (m_canvas == 0) {
62 m_canvas = new TCanvas();
63 m_canvas->SetTitle("Signal");
64 if (m_hasExternalCanvas) m_hasExternalCanvas = false;
65 }
66 m_canvas->cd();
67
68 int nBins;
69 double t0, dt;
71
72 if (m_hSignal != 0) {
73 delete m_hSignal;
74 m_hSignal = 0;
75 }
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]");
80
81 double sig = 0.;
82 for (int i = nBins; i--;) {
84 m_hSignal->SetBinContent(i + 1, sig);
85 }
86
87 if (m_gCrossings != 0) {
88 delete m_gCrossings;
89 m_gCrossings = 0;
90 }
91
92
94 if (nCrossings > 0) {
95 m_gCrossings = new TGraph(nCrossings);
96 m_gCrossings->SetMarkerStyle(20);
98 double time = 0., level = 0.;
99 bool rise = true;
100 for (int i = nCrossings; i--;) {
102 m_gCrossings->SetPoint(i, time, level);
103 }
104 }
105 }
106
107 m_hSignal->Draw("");
108 if (nCrossings > 0) m_gCrossings->Draw("psame");
109 m_canvas->Update();
110}
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)