16 const int nsamples = round(readout/tick);
19 const int signal_frame_ident = 100;
20 const double signal_start_time = 6*
units::ms;
21 vector<float> signal{0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,0.0};
24 make_shared<SimpleTrace>(1, 10, signal),
25 make_shared<SimpleTrace>(1, 20, signal),
26 make_shared<SimpleTrace>(2, 30, signal),
27 make_shared<SimpleTrace>(2, 33, signal)};
28 auto f1 = make_shared<SimpleFrame>(signal_frame_ident, signal_start_time, signal_traces,
tick);
31 const int noise_frame_ident = 0;
32 const double noise_start_time = 5*
units::ms;
33 vector<float> noise(nsamples, -0.5);
35 make_shared<SimpleTrace>(0, 0, noise),
36 make_shared<SimpleTrace>(1, 0, noise),
37 make_shared<SimpleTrace>(2, 0, noise),
38 make_shared<SimpleTrace>(3, 0, noise)};
39 auto f2 = make_shared<SimpleFrame>(noise_frame_ident, noise_start_time, noise_traces,
tick);
41 const int summed_ident = 1;
45 Assert(
f3->time() == noise_start_time);
47 auto traces =
f3->traces();
48 Assert(traces->size() == 4);
49 cerr <<
"Frame #"<<
f3->ident()<<
" time=" <<
f3->time()/
units::ms <<
"ms\n";
50 for (
auto trace : *traces) {
51 const auto& charge =
trace->charge();
52 cerr <<
"ch=" <<
trace->channel()
53 <<
" tbin=" <<
trace->tbin()
54 <<
" nsamples=" << charge.size()
56 for (
size_t ind=0; ind<charge.size(); ++ind) {
57 const float q = charge[ind];
61 cerr <<
"\tq=" << q <<
" tbin=" << ind <<
" t=" << (ind*
tick)/
units::ms <<
"ms\n";
IFrame::pointer sum(std::vector< IFrame::pointer > frames, int ident)
QTextStream & endl(QTextStream &s)