75 std::cerr <<
"This test requires an Wire Cell Field Response input file." <<
std::endl;
79 const char* uvw=
"UVW";
84 Binning bins(nticks, 0, nticks*tick);
90 TCanvas canvas(
"h",
"h",900,1200);
91 canvas.Print(Form(
"%s.pdf[",
argv[0]),
"pdf");
93 const int nplanes = 3;
94 for (
int iplane=0; iplane<nplanes; ++iplane) {
96 auto plane_response = fr.planes[iplane];
98 const int npaths = plane_response.paths.size();
100 for (
int ipath=0; ipath<npaths; ++ipath) {
101 auto& path_response = plane_response.paths[ipath];
105 const int rawresp_size = raw_response.size();
107 const double rawresp_min = fr.tstart;
108 const double rawresp_tick = fr.period;
109 const double rawresp_max = rawresp_min + rawresp_size*rawresp_tick;
110 Binning rawresp_bins(rawresp_size, rawresp_min, rawresp_max);
114 for (
int ind=0; ind<rawresp_size; ++ind) {
115 const double time = rawresp_bins.center(ind);
116 const int bin = bins.
bin(time);
121 const double charge_const = 1000.0;
126 for (
int ind=0; ind<
nticks; ++ind) {
127 const double t = bins.center(ind);
128 const double rel = (t-charge_time)/charge_sigma;
129 const double val = charge_const * exp(-0.5*rel*rel);
130 electrons[ind] =
val;
140 for (
int ind=0; ind <
nticks; ++ind) {
141 conv_spectrum[ind] = response_spectrum[ind]*charge_spectrum[ind];
144 for (
int ind=0; ind <
nticks; ++ind) {
151 std::string extra = Form(
" %c-%.1f", uvw[iplane], path_response.pitchpos);
153 plot_wave(canvas, 1,
"Response"+extra, std::make_pair(0,.1),
154 rawresp_bins, raw_response, raw_response_spectrum);
155 plot_wave(canvas, 4,
"Response"+extra, std::make_pair(0,.1),
157 plot_wave(canvas, 7,
"Electrons"+extra, std::make_pair(.9,1.1),
158 bins, electrons, charge_spectrum);
159 plot_wave(canvas, 10,
"Signal"+extra, std::make_pair(.9,1.1),
160 bins, conv, conv_spectrum);
162 canvas.Print(Form(
"%s.pdf",
argv[0]),
"pdf");
167 canvas.Print(Form(
"%s.pdf]",
argv[0]),
"pdf");
std::vector< TH1F * > plot_wave(TCanvas &canvas, int padnum, std::string name, std::pair< double, double > bounds, const Binning &bins, const Waveform::realseq_t &tdomain, const Waveform::compseq_t &fdomain)
QTextStream & bin(QTextStream &s)
array_xxf idft(const array_xxc &arr)
array_xxc dft(const array_xxf &arr)
QTextStream & endl(QTextStream &s)
def load(filename, jpath="depos")