103 description_text +=
"FRONT: station ";
105 description_text +=
", xpos = ";
107 description_text +=
", ypos = ";
109 description_text +=
", zpos = ";
111 TCanvas* station_front_canv =
new TCanvas(
"station_front_canv", description_text, 10, 10, 1000, 1000);
135 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
140 if (
fabs(XShiftsOfModules[iModule]) > maxXShift)
141 maxXShift =
fabs(XShiftsOfModules[iModule]);
142 if (
fabs(YShiftsOfModules[iModule]) > maxYShift)
143 maxYShift =
fabs(YShiftsOfModules[iModule]);
144 if (
fabs(ZShiftsOfModules[iModule]) > maxZShift)
145 maxZShift =
fabs(ZShiftsOfModules[iModule]);
150 cout <<
" XSize = " <<
XSize <<
"\n";
151 cout <<
" YSize = " <<
YSize <<
"\n";
152 cout <<
" ZSize = " <<
ZSize <<
"\n";
161 cout <<
" XPosition = " <<
XPosition <<
"\n";
162 cout <<
" YPosition = " <<
YPosition <<
"\n";
163 cout <<
" ZPosition = " <<
ZPosition <<
"\n";
165 cout <<
" NModules = " << NModules <<
"\n";
166 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
167 cout <<
" XShiftsOfModules[" << iModule <<
"] = " << XShiftsOfModules[iModule] <<
"\n";
168 cout <<
" YShiftsOfModules[" << iModule <<
"] = " << YShiftsOfModules[iModule] <<
"\n";
169 cout <<
" ZShiftsOfModules[" << iModule <<
"] = " << ZShiftsOfModules[iModule] <<
"\n";
173 Double_t XModuleSize =
module->GetXSize();
174 Double_t YModuleSize =
module->GetYSize();
175 Double_t XMinModule =
module->GetXMinModule();
176 Double_t XMaxModule =
module->GetXMaxModule();
177 Double_t YMinModule =
module->GetYMinModule();
178 Double_t YMaxModule =
module->GetYMaxModule();
180 cout <<
" XModuleSize = " << XModuleSize <<
"\n";
181 cout <<
" YModuleSize = " << YModuleSize <<
"\n";
182 cout <<
" XMinModule = " << XMinModule <<
"\n";
183 cout <<
" XMaxModule = " << XMaxModule <<
"\n";
184 cout <<
" YMinModule = " << YMinModule <<
"\n";
185 cout <<
" YMaxModule = " << YMaxModule <<
"\n";
188 Int_t NLayers =
module->GetNStripLayers();
189 for (
Int_t iLayer = 0; iLayer < NLayers; ++iLayer) {
207 cout <<
" Layer[" << iLayer <<
"]:\n";
208 cout <<
" stripAngleDeg = " << stripAngleDeg <<
"\n";
209 cout <<
" pitch = " << pitch <<
"\n";
211 cout <<
" XLayerSize = " << XLayerSize <<
"\n";
212 cout <<
" YLayerSize = " << YLayerSize <<
"\n";
214 cout <<
" XMinLayer = " << XMinLayer <<
"\n";
215 cout <<
" XMaxLayer = " << XMaxLayer <<
"\n";
216 cout <<
" YMinLayer = " << YMinLayer <<
"\n";
217 cout <<
" YMaxLayer = " << YMaxLayer <<
"\n";
220 cout <<
" layerType = " <<
"lower" <<
"\n";
223 cout <<
" layerType = " <<
"upper" <<
"\n";
226 cout <<
" xLeftBorderLayer = " << xLeftBorderLayer <<
"\n";
227 cout <<
" xRightBorderLayer = " << xRightBorderLayer <<
"\n";
228 cout <<
" yLeftBorderLayer = " << yLeftBorderLayer <<
"\n";
229 cout <<
" yRightBorderLayer = " << yRightBorderLayer <<
"\n";
231 cout <<
" stripDirection = " <<
"LeftToRight" <<
"\n";
234 cout <<
" stripDirection = " <<
"RightToLeft" <<
"\n";
238 vector<DeadZoneOfStripLayer> deadZones = layer.
GetDeadZones();
240 for (
Int_t idead = 0; idead < deadZones.size(); ++idead) {
241 cout <<
" DeadZone[" << idead <<
"]:\n";
243 Int_t NDeadPoints = deadZones[idead].GetNPoints();
245 for (
Int_t ip = 0; ip < NDeadPoints; ++ip) {
246 cout <<
" (x,y) = ( " << deadZones[idead].GetXPoint(ip) <<
", "
247 << deadZones[idead].GetYPoint(ip) <<
" )\n";
253 cout <<
"-----------------------------------------------------------\n";
257 for (
Int_t imod = 0; imod < NModules; imod++) {
268 TH2F* station_front_2dhist =
new TH2F(
"station_front_2dhist", description_text, 100, xmin, xmax, 100, ymin, ymax);
272 station_front_canv->
cd();
273 station_front_2dhist->
Draw();
277 for (
Int_t im = 0; im < NModules; im++) {
285 Double_t x_module_border_points[5] = {x_min_module, x_min_module, x_max_module, x_max_module, x_min_module};
286 Double_t y_module_border_points[5] = {y_min_module, y_max_module, y_max_module, y_min_module, y_min_module};
289 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
290 Double_t x_p0 =
Modules[im]->ConvertLocalToRotatedX(x_min_module, y_min_module);
291 Double_t y_p0 =
Modules[im]->ConvertLocalToRotatedY(x_min_module, y_min_module);
293 Double_t x_p1 =
Modules[im]->ConvertLocalToRotatedX(x_min_module, y_max_module);
294 Double_t y_p1 =
Modules[im]->ConvertLocalToRotatedY(x_min_module, y_max_module);
296 Double_t x_p2 =
Modules[im]->ConvertLocalToRotatedX(x_max_module, y_max_module);
297 Double_t y_p2 =
Modules[im]->ConvertLocalToRotatedY(x_max_module, y_max_module);
299 Double_t x_p3 =
Modules[im]->ConvertLocalToRotatedX(x_max_module, y_min_module);
300 Double_t y_p3 =
Modules[im]->ConvertLocalToRotatedY(x_max_module, y_min_module);
302 x_module_border_points[0] = x_p0;
303 x_module_border_points[1] = x_p1;
304 x_module_border_points[2] = x_p2;
305 x_module_border_points[3] = x_p3;
306 x_module_border_points[4] = x_p0;
308 y_module_border_points[0] = y_p0;
309 y_module_border_points[1] = y_p1;
310 y_module_border_points[2] = y_p2;
311 y_module_border_points[3] = y_p3;
312 y_module_border_points[4] = y_p0;
315 bordersOfModules[im] =
new TPolyLine(5, x_module_border_points, y_module_border_points);
322 station_front_canv->
cd();
329 for (
Int_t ilayer = 0; ilayer < NLayers; ++ilayer) {
332 description_text =
"";
333 description_text +=
"FRONT: station ";
335 description_text +=
", module = ";
336 description_text += im;
337 description_text +=
", layer = ";
338 description_text += ilayer;
346 xmin, xmax, 100, ymin, ymax);
351 layer_2dhist->
Draw();
363 Double_t x_layer_border_points[5] = {x_min_layer, x_min_layer, x_max_layer, x_max_layer, x_min_layer};
364 Double_t y_layer_border_points[5] = {y_min_layer, y_max_layer, y_max_layer, y_min_layer, y_min_layer};
367 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
368 Double_t x_p0 =
Modules[im]->ConvertLocalToRotatedX(x_min_layer, y_min_layer);
369 Double_t y_p0 =
Modules[im]->ConvertLocalToRotatedY(x_min_layer, y_min_layer);
371 Double_t x_p1 =
Modules[im]->ConvertLocalToRotatedX(x_min_layer, y_max_layer);
372 Double_t y_p1 =
Modules[im]->ConvertLocalToRotatedY(x_min_layer, y_max_layer);
374 Double_t x_p2 =
Modules[im]->ConvertLocalToRotatedX(x_max_layer, y_max_layer);
375 Double_t y_p2 =
Modules[im]->ConvertLocalToRotatedY(x_max_layer, y_max_layer);
377 Double_t x_p3 =
Modules[im]->ConvertLocalToRotatedX(x_max_layer, y_min_layer);
378 Double_t y_p3 =
Modules[im]->ConvertLocalToRotatedY(x_max_layer, y_min_layer);
380 x_layer_border_points[0] = x_p0;
381 x_layer_border_points[1] = x_p1;
382 x_layer_border_points[2] = x_p2;
383 x_layer_border_points[3] = x_p3;
384 x_layer_border_points[4] = x_p0;
386 y_layer_border_points[0] = y_p0;
387 y_layer_border_points[1] = y_p1;
388 y_layer_border_points[2] = y_p2;
389 y_layer_border_points[3] = y_p3;
390 y_layer_border_points[4] = y_p0;
393 bordersOfLayer =
new TPolyLine(5, x_layer_border_points, y_layer_border_points);
401 station_front_canv->
cd();
402 bordersOfLayer->
Draw(
"f");
403 bordersOfLayer->
Draw(
"l");
406 bordersOfLayer->
Draw(
"f");
409 vector<DeadZoneOfStripLayer> DeadZones = layer.
GetDeadZones();
410 Int_t NDeadZones = DeadZones.size();
414 for (
Int_t izone = 0; izone < NDeadZones; ++izone) {
422 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
432 dead_zones_polylines->
GetY()[0]);
441 station_front_canv->
cd();
442 dead_zones_polylines[izone].
Draw(
"f");
443 dead_zones_polylines[izone].
Draw(
"");
446 dead_zones_polylines[izone].
Draw(
"f");
447 dead_zones_polylines[izone].
Draw(
"");
460 Double_t x_shift_up_left =
Tan(strip_angle_deg *
DegToRad()) * (y_max_layer - y_left_border);
461 Double_t x_shift_down_left =
Tan(strip_angle_deg *
DegToRad()) * (y_left_border - y_min_layer);
462 Double_t x_shift_up_right =
Tan(strip_angle_deg *
DegToRad()) * (y_max_layer - y_right_border);
463 Double_t x_shift_down_right =
Tan(strip_angle_deg *
DegToRad()) * (y_right_border - y_min_layer);
466 Double_t x1_left_strip_line = x_left_border - x_shift_down_left;
467 Double_t y1_left_strip_line = y_min_layer;
468 Double_t x2_left_strip_line = x_left_border + x_shift_up_left;
469 Double_t y2_left_strip_line = y_max_layer;
470 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
471 Double_t x1_p =
Modules[im]->ConvertLocalToRotatedX(x1_left_strip_line, y1_left_strip_line);
472 Double_t y1_p =
Modules[im]->ConvertLocalToRotatedY(x1_left_strip_line, y1_left_strip_line);
473 Double_t x2_p =
Modules[im]->ConvertLocalToRotatedX(x2_left_strip_line, y2_left_strip_line);
474 Double_t y2_p =
Modules[im]->ConvertLocalToRotatedY(x2_left_strip_line, y2_left_strip_line);
475 x1_left_strip_line = x1_p;
476 y1_left_strip_line = y1_p;
477 x2_left_strip_line = x2_p;
478 y2_left_strip_line = y2_p;
481 left_strip_line->
SetX1(x1_left_strip_line);
482 left_strip_line->
SetY1(y1_left_strip_line);
483 left_strip_line->
SetX2(x2_left_strip_line);
484 left_strip_line->
SetY2(y2_left_strip_line);
486 left_strip_line->
Draw();
489 Double_t x1_right_strip_line = x_right_border - x_shift_down_right;
490 Double_t y1_right_strip_line = y_min_layer;
491 Double_t x2_right_strip_line = x_right_border + x_shift_up_right;
492 Double_t y2_right_strip_line = y_max_layer;
493 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
494 Double_t x1_p =
Modules[im]->ConvertLocalToRotatedX(x1_right_strip_line, y1_right_strip_line);
495 Double_t y1_p =
Modules[im]->ConvertLocalToRotatedY(x1_right_strip_line, y1_right_strip_line);
496 Double_t x2_p =
Modules[im]->ConvertLocalToRotatedX(x2_right_strip_line, y2_right_strip_line);
497 Double_t y2_p =
Modules[im]->ConvertLocalToRotatedY(x2_right_strip_line, y2_right_strip_line);
498 x1_right_strip_line = x1_p;
499 y1_right_strip_line = y1_p;
500 x2_right_strip_line = x2_p;
501 y2_right_strip_line = y2_p;
504 right_strip_line->
SetX1(x1_right_strip_line);
505 right_strip_line->
SetY1(y1_right_strip_line);
506 right_strip_line->
SetX2(x2_right_strip_line);
507 right_strip_line->
SetY2(y2_right_strip_line);
509 right_strip_line->
Draw();
512 Double_t x_left_border_marker = x_left_border;
513 Double_t y_left_border_marker = y_left_border;
514 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
515 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_left_border, y_left_border);
516 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_left_border, y_left_border);
517 x_left_border_marker = x_p;
518 y_left_border_marker = y_p;
520 TMarker* left_border_marker =
new TMarker(x_left_border_marker, y_left_border_marker, 20);
523 left_border_marker->
Draw();
526 Double_t x_right_border_marker = x_right_border;
527 Double_t y_right_border_marker = y_right_border;
528 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
529 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_right_border, y_right_border);
530 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_right_border, y_right_border);
531 x_right_border_marker = x_p;
532 y_right_border_marker = y_p;
534 TMarker* right_border_marker =
new TMarker(x_right_border_marker, y_right_border_marker, 20);
537 right_border_marker->
Draw();
542 strip_direction_arrow->
SetX1(x_left_border_marker);
543 strip_direction_arrow->
SetY1(y_left_border_marker);
548 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
549 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_arrend, y_arrend);
550 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_arrend, y_arrend);
554 strip_direction_arrow->
SetX2(x_arrend);
555 strip_direction_arrow->
SetY2(y_arrend);
557 strip_direction_arrow->
SetX1(x_right_border_marker);
558 strip_direction_arrow->
SetY1(y_right_border_marker);
563 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
564 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_arrend, y_arrend);
565 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_arrend, y_arrend);
569 strip_direction_arrow->
SetX2(x_arrend);
570 strip_direction_arrow->
SetY2(y_arrend);
576 strip_direction_arrow->
Draw(
"|>");
580 Double_t x_center_layer = (x_min_layer + x_max_layer) * 0.5;
581 Double_t y_center_layer = (y_min_layer + y_max_layer) * 0.5;
583 Double_t x1_center_vline = x_center_layer;
584 Double_t y1_center_vline = y_max_layer;
585 Double_t x2_center_vline = x_center_layer;
586 Double_t y2_center_vline = y_min_layer;
588 Double_t x1_center_hline = x_min_layer;
589 Double_t y1_center_hline = y_center_layer;
590 Double_t x2_center_hline = x_max_layer;
591 Double_t y2_center_hline = y_center_layer;
593 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
594 Double_t x1_vline_p =
Modules[im]->ConvertLocalToRotatedX(x_center_layer, y_max_layer);
595 Double_t y1_vline_p =
Modules[im]->ConvertLocalToRotatedY(x_center_layer, y_max_layer);
596 Double_t x2_vline_p =
Modules[im]->ConvertLocalToRotatedX(x_center_layer, y_min_layer);
597 Double_t y2_vline_p =
Modules[im]->ConvertLocalToRotatedY(x_center_layer, y_min_layer);
598 Double_t x1_hline_p =
Modules[im]->ConvertLocalToRotatedX(x1_center_hline, y1_center_hline);
599 Double_t y1_hline_p =
Modules[im]->ConvertLocalToRotatedY(x1_center_hline, y1_center_hline);
600 Double_t x2_hline_p =
Modules[im]->ConvertLocalToRotatedX(x2_center_hline, y2_center_hline);
601 Double_t y2_hline_p =
Modules[im]->ConvertLocalToRotatedY(x2_center_hline, y2_center_hline);
602 x1_center_vline = x1_vline_p;
603 y1_center_vline = y1_vline_p;
604 x2_center_vline = x2_vline_p;
605 y2_center_vline = y2_vline_p;
606 x1_center_hline = x1_hline_p;
607 y1_center_hline = y1_hline_p;
608 x2_center_hline = x2_hline_p;
609 y2_center_hline = y2_hline_p;
612 TLine* vert_center_layer_line =
613 new TLine(x1_center_vline, y1_center_vline, x2_center_vline, y2_center_vline);
614 TLine* horiz_center_layer_line =
615 new TLine(x1_center_hline, y1_center_hline, x2_center_hline, y2_center_hline);
620 vert_center_layer_line->
Draw();
621 horiz_center_layer_line->
Draw();
628 Double_t hor_leg = vert_leg *
Tan(strip_angle_rad);
629 Double_t x_edge_layer = x_center_layer + hor_leg;
630 Double_t y_edge_layer = y_max_layer;
632 Double_t x1_slope_line = x_center_layer;
633 Double_t y1_slope_line = y_center_layer;
634 Double_t x2_slope_line = x_edge_layer;
635 Double_t y2_slope_line = y_edge_layer;
637 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
638 Double_t x1_line_p =
Modules[im]->ConvertLocalToRotatedX(x1_slope_line, y1_slope_line);
639 Double_t y1_line_p =
Modules[im]->ConvertLocalToRotatedY(x1_slope_line, y1_slope_line);
640 Double_t x2_line_p =
Modules[im]->ConvertLocalToRotatedX(x2_slope_line, y2_slope_line);
641 Double_t y2_line_p =
Modules[im]->ConvertLocalToRotatedY(x2_slope_line, y2_slope_line);
643 x1_slope_line = x1_line_p;
644 y1_slope_line = y1_line_p;
645 x2_slope_line = x2_line_p;
646 y2_slope_line = y2_line_p;
649 TLine* strip_slope_layer_line =
new TLine(x1_slope_line, y1_slope_line, x2_slope_line, y2_slope_line);
653 strip_slope_layer_line->
Draw();
659 for (
int ip = 0; ip < points.size(); ip++) {
660 mark_point_front[ip].
SetX(points.at(ip).X());
661 mark_point_front[ip].
SetY(points.at(ip).Y());
667 mark_point_front[ip].
Draw();
677 for (
int ip = 0; ip < points.size(); ip++) {
678 mark_point_front[ip].
SetX(points.at(ip).X());
679 mark_point_front[ip].
SetY(points.at(ip).Y());
684 station_front_canv->
cd();
685 mark_point_front[ip].
Draw();
689 station_front_canv->
cd();
691 notice_pt->
AddText(
"Press <SHIFT+LeftMouseClick>: to add a new point; <C>: to clear the area");
698 station_front_canv->
AddExec(
"ex",
"RecognizeModuleNumFromPointAndDrawIt(station_front_canv)");