18 : canvas(
"test_response",
"Response functions", 500,500)
21 canvas.Print((filename+
"[").c_str(),
"pdf");
24 canvas.Print((filename+
"]").c_str(),
"pdf");
27 canvas.Print(filename.c_str(),
"pdf");
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) {
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);
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");
107 Plotter plt(Form(
"%s.pdf", argv[0]));
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");
double center(int ind) const
A functional object caching gain and shape.
Plotter(const std::string &fname)
WireCell::Waveform::realseq_t generate(const WireCell::Waveform::Domain &domain, int nsamples)
FIXME: eradicate Domain in favor of Binning.
void plot_ratio(Plotter &plt, TH1F *one, TH1F *two, const std::string &title)
int main(int argc, char *argv[])
std::pair< TH1F *, TH1F * > plot_response(Plotter &plt, double gain_unit=units::mV/units::fC)