7 #include "TPolyLine3D.h" 8 #include "TPolyMarker3D.h" 24 TView* view = TView::CreateView(1);
25 view->SetRange(0, -10, -10, 5, 10, 10);
33 for (
int ind=0; ind<3; ++ind) {
34 const Ray& pitch_ray = pitch_rays[ind];
35 cout << ind <<
": " << pitch_ray <<
endl;
38 const Vector wire_dir = pitch_dir.cross(xaxis).norm();
39 const Vector wire_point = pitch_ray.second + wire_dir;
41 TPolyLine3D* pl =
new TPolyLine3D(3);
42 pl->SetPoint(0, pitch_ray.first.x(), pitch_ray.first.y(), pitch_ray.first.z());
43 pl->SetPoint(1, pitch_ray.second.x(), pitch_ray.second.y(), pitch_ray.second.z());
44 pl->SetPoint(2, wire_point.x(), wire_point.y(), wire_point.z());
45 pl->SetLineColor(colors[ind]);
54 TH1F* frame = gPad->DrawFrame(0,-10, 20,10);
55 frame->SetTitle(
"Pitch (thick) and wire (thin) red=U, blue=V, +X (-drift) direction into page");
56 frame->SetXTitle(
"Transverse Z direction");
57 frame->SetYTitle(
"Transverse Y (W) direction");
59 frame->GetYaxis()->SetAxisColor(3);
60 frame->GetXaxis()->SetAxisColor(4);
67 for (
int ind=0; ind<3; ++ind) {
68 Ray r_pitch = pitch_rays[ind];
70 r_pitch.second.x(0.0);
75 const Ray r_wire(r_pitch.second - d_wire,
76 r_pitch.second + d_wire);
83 TArrow* a_pitch =
new TArrow(r_pitch.first.z(), r_pitch.first.y(),
84 r_pitch.second.z(), r_pitch.second.y(), 0.01,
"|>");
85 a_pitch->SetLineColor(colors[ind]);
86 a_pitch->SetLineWidth(2);
88 TArrow* a_wire =
new TArrow(r_wire.first.z(), r_wire.first.y(),
89 r_wire.second.z(), r_wire.second.y(), 0.01);
90 a_wire->SetLineColor(colors[ind]);
106 cout <<
"Bounds: " << bbox <<
endl;
124 put(
cfg,
"pitch_mm.u", pitch);
125 put(
cfg,
"pitch_mm.v", pitch);
126 put(
cfg,
"pitch_mm.w", pitch);
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
const Ray & bounds() const
void put(Configuration &cfg, const std::string &dotpath, const T &val)
Put value in configuration at the dotted path.
virtual void configure(const WireCell::Configuration &config)
const Ray & pitchW() const
D3Vector norm() const
Return a normalized vector in the direction of this vector.
const Ray & pitchV() const
int main(int argc, char **argv)
const Ray & pitchU() const
std::vector< float > Vector
void draw_wires_2d(WireParams &wp)
void draw_wires_3d(WireParams &wp)
D3Vector cross(const D3Vector &rhs) const
Return the cross product of this vector and the other.
Vector ray_vector(const Ray &ray)
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
QTextStream & endl(QTextStream &s)