18 canvas.SetFixedAspectRatio(
true);
23 const double fsize_mm = 1.5*wire_extent/
units::mm;
25 const Point worigin = pimposes[2]->origin();
27 TH1F* frame = canvas.DrawFrame(worigin[2]-fsize_mm, worigin[1]-fsize_mm,
28 worigin[2]+fsize_mm, worigin[1]+fsize_mm);
29 frame->SetTitle(Form(
"%s: Pitch (thick) and wire (thin) red=U, blue=V, xorigin=%.3fcm",
31 frame->SetXTitle(
"Transverse Z [mm]");
32 frame->SetYTitle(
"Transverse Y [mm]");
35 for (
int iplane=0; iplane<3; ++iplane) {
42 const double middle = binning.
min() + 0.5*binning.
span();
45 for (
int ipitch = 0; ipitch <= binning.
nbins(); ++ipitch) {
46 const double pitch1 = binning.
edge(ipitch);
49 if (
std::abs(middle-pitch1) > wire_extent) {
52 if (
std::abs(middle-pitch2) > wire_extent) {
56 const Vector vpitch1 = origin + pitchdir * pitch1;
58 const Ray r_pitch(vpitch1, vpitch2);
59 const Vector vwire = 1.2*wiredir * wire_extent;
60 const Ray r_wire(vpitch1 - vwire,
63 if (ipitch < binning.
nbins()) {
67 a_pitch->SetLineColor(colors[iplane]);
68 a_pitch->SetLineWidth(2);
73 a_wire->SetLineColor(colors[iplane]);
93 pdffile +=
"-" + detector +
".pdf";
94 cerr <<
"Drawing to " << pdffile <<
endl;
96 TCanvas canvas(
"c",
"c",500,500);
98 canvas.Print((pdffile+
"[").c_str(),
"pdf");
100 for (
const auto& anode_tn : anode_tns) {
101 cerr <<
"Getting: " << anode_tn <<
"\n";
102 auto iap = Factory::find_tn<IAnodePlane>(anode_tn);
104 for (
auto face : iap->faces()) {
105 std::vector<const Pimpos*> pimposes;
106 for (
auto plane : face->planes()) {
107 pimposes.push_back(plane->pimpos());
110 canvas.Print(pdffile.c_str(),
"pdf");
114 canvas.Print((pdffile+
"]").c_str(),
"pdf");
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
D3Vector< double > Point
A 3D Cartesian point in double precision.
double span() const
Return the max-min.
const Point & origin() const
Return given 3-point origin for plane pitch.
const Binning & region_binning() const
static Ray pitch2(const IWire::vector &wires)
std::vector< std::string > anode_loader(std::string detector)
void draw_pimpos(TCanvas &canvas, const std::string &detector, std::vector< const Pimpos * > &pimposes)
int main(int argc, char *argv[])
std::vector< float > Vector
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)
double edge(int ind) const
constexpr Point origin()
Returns a origin position with a point of the specified type.
const Vector & axis(int i) const
QTextStream & endl(QTextStream &s)