#include "WireCellUtil/Waveform.h"
#include "WireCellUtil/Units.h"
#include "WireCellUtil/Binning.h"
#include "WireCellUtil/Response.h"
#include "TCanvas.h"
#include "TH1F.h"
#include <algorithm>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 104 of file test_response.cxx.
110 plot_ratio(plt, units.first, anons.first,
"Ratio for 1us, 7.8mV/fC");
111 plot_ratio(plt, units.second, anons.second,
"Ratio for 2us, 14.0V/fC");
void plot_ratio(Plotter &plt, TH1F *one, TH1F *two, const std::string &title)
std::pair< TH1F *, TH1F * > plot_response(Plotter &plt, double gain_unit=units::mV/units::fC)
Definition at line 82 of file test_response.cxx.
84 TH1F* rat = (TH1F*)two->Clone(
"rat");
92 const double eps = 0.01;
93 TH1F* frame = pad->DrawFrame(0,1-eps,10,1+eps,
title.c_str());
94 frame->SetXTitle(
"Time (microsecond)");
95 frame->SetYTitle(
"gain ratio");
99 rat->Draw(
"hist,same");
std::pair< TH1F *, TH1F * > plot_response |
( |
Plotter & |
plt, |
|
|
double |
gain_unit = units::mV/units::fC |
|
) |
| |
Definition at line 32 of file test_response.cxx.
34 const double gain1 = 7.8*gain_unit;
35 const double gain2 = 14.0*gain_unit;
41 const Binning bins(tmax/tick, 0, tmax);
50 TH1F* resp1 =
new TH1F(
"resp1",
"Cold Electronics Response at 1us shaping",
52 TH1F* resp2 =
new TH1F(
"resp2",
"Cold Electronics Response at 2us shaping",
54 resp1->SetLineColor(2);
55 resp2->SetLineColor(4);
56 for (
size_t ind=0; ind<res1.size(); ++ind) {
57 const double t_us = bins.center(ind) /
units::us;
58 resp1->Fill(t_us, res1[ind] / gain_unit);
59 resp2->Fill(t_us, res2[ind] / gain_unit);
66 TH1F* frame = pad->DrawFrame(0,0,10,15,
"Cold Electronics Response Functions (1us,7.8mV/fC and 2us,14.0mV/fC)");
67 frame->SetXTitle(
"Time (microsecond)");
69 frame->SetYTitle(
"Gain (mV/fC)");
72 frame->SetYTitle(
"Gain");
74 resp1->Draw(
"hist,same");
75 resp2->Draw(
"hist,same");
79 return std::make_pair(resp1, resp2);
A functional object caching gain and shape.