8 #include "TPolyLine3D.h" 9 #include "TPolyMarker3D.h" 12 #include <boost/range.hpp> 28 bool ok = wg(iwp, wires);
32 cerr <<
"Got " << wires->size() <<
" wires" <<
endl;
36 for (
auto wit = wires->begin(); wit != wires->end(); ++wit) {
38 int iplane = wire->planeid().index();
39 int ident = (1+iplane)*100000 + wire->index();
40 Assert(ident == wire->ident());
42 if (iplane == last_plane) {
49 Assert(last_index == wire->index());
56 double pitches[] = {10.0, 5.0, 3.0, -1};
57 int want[] = {371, 747, 1243, 0};
58 for (
int ind=0; pitches[ind] > 0.0; ++ind) {
61 put(cfg,
"pitch_mm.u", pitches[ind]);
62 put(cfg,
"pitch_mm.v", pitches[ind]);
63 put(cfg,
"pitch_mm.w", pitches[ind]);
68 bool ok = wg(iwp, wires);
72 int nwires = wires->size();
73 cout << ind <<
": pitch=" << pitches[ind] <<
" nwires=" << nwires <<
" (want=" << want[ind] <<
")" <<
endl;
74 AssertMsg(nwires == want[ind],
"Wrong number of wires");
85 bool ok = wg(iwp, wires);
92 TView* view = TView::CreateView(1);
93 view->SetRange(bbox.first.x(),bbox.first.y(),bbox.first.z(),
94 bbox.second.x(),bbox.second.y(),bbox.second.z());
100 copy_if(wires->begin(), wires->end(), back_inserter(u_wires),
select_u_wires);
101 copy_if(wires->begin(), wires->end(), back_inserter(v_wires),
select_v_wires);
102 copy_if(wires->begin(), wires->end(), back_inserter(w_wires),
select_w_wires);
103 size_t n_wires[3] = {
109 double max_width = 5;
110 for (
auto wit = wires->begin(); wit != wires->end(); ++wit) {
112 int iplane = wire->planeid().index();
113 int index = wire->index();
115 AssertMsg(n_wires[iplane],
"Empty plane");
116 double width = ((index+1)*max_width)/n_wires[iplane];
118 const Ray ray = wire->ray();
119 TPolyLine3D* pl =
new TPolyLine3D(2);
120 pl->SetPoint(0, ray.first.x(), ray.first.y(), ray.first.z());
121 pl->SetPoint(1, ray.second.x(), ray.second.y(), ray.second.z());
122 pl->SetLineColor(colors[iplane]);
123 pl->SetLineWidth(width);
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
std::shared_ptr< const IWire > pointer
void test3D(MultiPdf &pdf, bool interactive)
std::shared_ptr< IWireParameters > pointer
Access subclass facet by pointer.
std::string dumps(const Json::Value &top, bool pretty=false)
As above but dump to a JSON text string.
const Ray & bounds() const
void put(Configuration &cfg, const std::string &dotpath, const T &val)
Put value in configuration at the dotted path.
std::vector< pointer > vector
virtual void configure(const WireCell::Configuration &config)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
wire_selector select_u_wires
wire_selector select_w_wires
wire_selector select_v_wires
Json::Value Configuration
int main(int argc, char **argv)
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
std::shared_ptr< const vector > shared_vector
QTextStream & endl(QTextStream &s)