98 description_text +=
"FRONT: station ";
100 description_text +=
", xpos = ";
102 description_text +=
", ypos = ";
104 description_text +=
", zpos = ";
106 TCanvas* station_front_canv =
new TCanvas(
"station_front_canv", description_text, 10, 10, 1000, 1000);
130 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
135 if (
fabs(XShiftsOfModules[iModule]) > maxXShift)
136 maxXShift =
fabs(XShiftsOfModules[iModule]);
137 if (
fabs(YShiftsOfModules[iModule]) > maxYShift)
138 maxYShift =
fabs(YShiftsOfModules[iModule]);
139 if (
fabs(ZShiftsOfModules[iModule]) > maxZShift)
140 maxZShift =
fabs(ZShiftsOfModules[iModule]);
145 cout <<
" XSize = " <<
XSize <<
"\n";
146 cout <<
" YSize = " <<
YSize <<
"\n";
147 cout <<
" ZSize = " <<
ZSize <<
"\n";
156 cout <<
" XPosition = " <<
XPosition <<
"\n";
157 cout <<
" YPosition = " <<
YPosition <<
"\n";
158 cout <<
" ZPosition = " <<
ZPosition <<
"\n";
160 cout <<
" NModules = " << NModules <<
"\n";
161 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
162 cout <<
" XShiftsOfModules[" << iModule <<
"] = " << XShiftsOfModules[iModule] <<
"\n";
163 cout <<
" YShiftsOfModules[" << iModule <<
"] = " << YShiftsOfModules[iModule] <<
"\n";
164 cout <<
" ZShiftsOfModules[" << iModule <<
"] = " << ZShiftsOfModules[iModule] <<
"\n";
168 Double_t XModuleSize =
module->GetXSize();
169 Double_t YModuleSize =
module->GetYSize();
170 Double_t XMinModule =
module->GetXMinModule();
171 Double_t XMaxModule =
module->GetXMaxModule();
172 Double_t YMinModule =
module->GetYMinModule();
173 Double_t YMaxModule =
module->GetYMaxModule();
175 cout <<
" XModuleSize = " << XModuleSize <<
"\n";
176 cout <<
" YModuleSize = " << YModuleSize <<
"\n";
177 cout <<
" XMinModule = " << XMinModule <<
"\n";
178 cout <<
" XMaxModule = " << XMaxModule <<
"\n";
179 cout <<
" YMinModule = " << YMinModule <<
"\n";
180 cout <<
" YMaxModule = " << YMaxModule <<
"\n";
183 Int_t NLayers =
module->GetNStripLayers();
184 for (
Int_t iLayer = 0; iLayer < NLayers; ++iLayer) {
202 cout <<
" Layer[" << iLayer <<
"]:\n";
203 cout <<
" stripAngleDeg = " << stripAngleDeg <<
"\n";
204 cout <<
" pitch = " << pitch <<
"\n";
206 cout <<
" XLayerSize = " << XLayerSize <<
"\n";
207 cout <<
" YLayerSize = " << YLayerSize <<
"\n";
209 cout <<
" XMinLayer = " << XMinLayer <<
"\n";
210 cout <<
" XMaxLayer = " << XMaxLayer <<
"\n";
211 cout <<
" YMinLayer = " << YMinLayer <<
"\n";
212 cout <<
" YMaxLayer = " << YMaxLayer <<
"\n";
215 cout <<
" layerType = " <<
"lower" <<
"\n";
218 cout <<
" layerType = " <<
"upper" <<
"\n";
221 cout <<
" xLeftBorderLayer = " << xLeftBorderLayer <<
"\n";
222 cout <<
" xRightBorderLayer = " << xRightBorderLayer <<
"\n";
223 cout <<
" yLeftBorderLayer = " << yLeftBorderLayer <<
"\n";
224 cout <<
" yRightBorderLayer = " << yRightBorderLayer <<
"\n";
226 cout <<
" stripDirection = " <<
"LeftToRight" <<
"\n";
229 cout <<
" stripDirection = " <<
"RightToLeft" <<
"\n";
233 vector<DeadZoneOfStripLayer> deadZones = layer.
GetDeadZones();
235 for (
Int_t idead = 0; idead < deadZones.size(); ++idead) {
236 cout <<
" DeadZone[" << idead <<
"]:\n";
238 Int_t NDeadPoints = deadZones[idead].GetNPoints();
240 for (
Int_t ip = 0; ip < NDeadPoints; ++ip) {
241 cout <<
" (x,y) = ( " << deadZones[idead].GetXPoint(ip) <<
", "
242 << deadZones[idead].GetYPoint(ip) <<
" )\n";
248 cout <<
"-----------------------------------------------------------\n";
252 for (
Int_t imod = 0; imod < NModules; imod++) {
263 TH2F* station_front_2dhist =
new TH2F(
"station_front_2dhist", description_text, 100, xmin, xmax, 100, ymin, ymax);
267 station_front_canv->
cd();
268 station_front_2dhist->
Draw();
272 for (
Int_t im = 0; im < NModules; im++) {
280 Double_t x_module_border_points[5] = {x_min_module, x_min_module, x_max_module, x_max_module, x_min_module};
281 Double_t y_module_border_points[5] = {y_min_module, y_max_module, y_max_module, y_min_module, y_min_module};
284 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
285 Double_t x_p0 =
Modules[im]->ConvertLocalToRotatedX(x_min_module, y_min_module);
286 Double_t y_p0 =
Modules[im]->ConvertLocalToRotatedY(x_min_module, y_min_module);
288 Double_t x_p1 =
Modules[im]->ConvertLocalToRotatedX(x_min_module, y_max_module);
289 Double_t y_p1 =
Modules[im]->ConvertLocalToRotatedY(x_min_module, y_max_module);
291 Double_t x_p2 =
Modules[im]->ConvertLocalToRotatedX(x_max_module, y_max_module);
292 Double_t y_p2 =
Modules[im]->ConvertLocalToRotatedY(x_max_module, y_max_module);
294 Double_t x_p3 =
Modules[im]->ConvertLocalToRotatedX(x_max_module, y_min_module);
295 Double_t y_p3 =
Modules[im]->ConvertLocalToRotatedY(x_max_module, y_min_module);
297 x_module_border_points[0] = x_p0;
298 x_module_border_points[1] = x_p1;
299 x_module_border_points[2] = x_p2;
300 x_module_border_points[3] = x_p3;
301 x_module_border_points[4] = x_p0;
303 y_module_border_points[0] = y_p0;
304 y_module_border_points[1] = y_p1;
305 y_module_border_points[2] = y_p2;
306 y_module_border_points[3] = y_p3;
307 y_module_border_points[4] = y_p0;
310 bordersOfModules[im] =
new TPolyLine(5, x_module_border_points, y_module_border_points);
317 station_front_canv->
cd();
324 for (
Int_t ilayer = 0; ilayer < NLayers; ++ilayer) {
327 description_text =
"";
328 description_text +=
"FRONT: station ";
330 description_text +=
", module = ";
331 description_text += im;
332 description_text +=
", layer = ";
333 description_text += ilayer;
341 xmin, xmax, 100, ymin, ymax);
346 layer_2dhist->
Draw();
358 Double_t x_layer_border_points[5] = {x_min_layer, x_min_layer, x_max_layer, x_max_layer, x_min_layer};
359 Double_t y_layer_border_points[5] = {y_min_layer, y_max_layer, y_max_layer, y_min_layer, y_min_layer};
362 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
363 Double_t x_p0 =
Modules[im]->ConvertLocalToRotatedX(x_min_layer, y_min_layer);
364 Double_t y_p0 =
Modules[im]->ConvertLocalToRotatedY(x_min_layer, y_min_layer);
366 Double_t x_p1 =
Modules[im]->ConvertLocalToRotatedX(x_min_layer, y_max_layer);
367 Double_t y_p1 =
Modules[im]->ConvertLocalToRotatedY(x_min_layer, y_max_layer);
369 Double_t x_p2 =
Modules[im]->ConvertLocalToRotatedX(x_max_layer, y_max_layer);
370 Double_t y_p2 =
Modules[im]->ConvertLocalToRotatedY(x_max_layer, y_max_layer);
372 Double_t x_p3 =
Modules[im]->ConvertLocalToRotatedX(x_max_layer, y_min_layer);
373 Double_t y_p3 =
Modules[im]->ConvertLocalToRotatedY(x_max_layer, y_min_layer);
375 x_layer_border_points[0] = x_p0;
376 x_layer_border_points[1] = x_p1;
377 x_layer_border_points[2] = x_p2;
378 x_layer_border_points[3] = x_p3;
379 x_layer_border_points[4] = x_p0;
381 y_layer_border_points[0] = y_p0;
382 y_layer_border_points[1] = y_p1;
383 y_layer_border_points[2] = y_p2;
384 y_layer_border_points[3] = y_p3;
385 y_layer_border_points[4] = y_p0;
388 bordersOfLayer =
new TPolyLine(5, x_layer_border_points, y_layer_border_points);
396 station_front_canv->
cd();
397 bordersOfLayer->
Draw(
"f");
398 bordersOfLayer->
Draw(
"l");
401 bordersOfLayer->
Draw(
"f");
404 vector<DeadZoneOfStripLayer> DeadZones = layer.
GetDeadZones();
405 Int_t NDeadZones = DeadZones.size();
409 for (
Int_t izone = 0; izone < NDeadZones; ++izone) {
417 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
427 dead_zones_polylines->
GetY()[0]);
436 station_front_canv->
cd();
437 dead_zones_polylines[izone].
Draw(
"f");
438 dead_zones_polylines[izone].
Draw(
"");
441 dead_zones_polylines[izone].
Draw(
"f");
442 dead_zones_polylines[izone].
Draw(
"");
455 Double_t x_shift_up_left =
Tan(strip_angle_deg *
DegToRad()) * (y_max_layer - y_left_border);
456 Double_t x_shift_down_left =
Tan(strip_angle_deg *
DegToRad()) * (y_left_border - y_min_layer);
457 Double_t x_shift_up_right =
Tan(strip_angle_deg *
DegToRad()) * (y_max_layer - y_right_border);
458 Double_t x_shift_down_right =
Tan(strip_angle_deg *
DegToRad()) * (y_right_border - y_min_layer);
461 Double_t x1_left_strip_line = x_left_border - x_shift_down_left;
462 Double_t y1_left_strip_line = y_min_layer;
463 Double_t x2_left_strip_line = x_left_border + x_shift_up_left;
464 Double_t y2_left_strip_line = y_max_layer;
465 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
466 Double_t x1_p =
Modules[im]->ConvertLocalToRotatedX(x1_left_strip_line, y1_left_strip_line);
467 Double_t y1_p =
Modules[im]->ConvertLocalToRotatedY(x1_left_strip_line, y1_left_strip_line);
468 Double_t x2_p =
Modules[im]->ConvertLocalToRotatedX(x2_left_strip_line, y2_left_strip_line);
469 Double_t y2_p =
Modules[im]->ConvertLocalToRotatedY(x2_left_strip_line, y2_left_strip_line);
470 x1_left_strip_line = x1_p;
471 y1_left_strip_line = y1_p;
472 x2_left_strip_line = x2_p;
473 y2_left_strip_line = y2_p;
476 left_strip_line->
SetX1(x1_left_strip_line);
477 left_strip_line->
SetY1(y1_left_strip_line);
478 left_strip_line->
SetX2(x2_left_strip_line);
479 left_strip_line->
SetY2(y2_left_strip_line);
481 left_strip_line->
Draw();
484 Double_t x1_right_strip_line = x_right_border - x_shift_down_right;
485 Double_t y1_right_strip_line = y_min_layer;
486 Double_t x2_right_strip_line = x_right_border + x_shift_up_right;
487 Double_t y2_right_strip_line = y_max_layer;
488 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
489 Double_t x1_p =
Modules[im]->ConvertLocalToRotatedX(x1_right_strip_line, y1_right_strip_line);
490 Double_t y1_p =
Modules[im]->ConvertLocalToRotatedY(x1_right_strip_line, y1_right_strip_line);
491 Double_t x2_p =
Modules[im]->ConvertLocalToRotatedX(x2_right_strip_line, y2_right_strip_line);
492 Double_t y2_p =
Modules[im]->ConvertLocalToRotatedY(x2_right_strip_line, y2_right_strip_line);
493 x1_right_strip_line = x1_p;
494 y1_right_strip_line = y1_p;
495 x2_right_strip_line = x2_p;
496 y2_right_strip_line = y2_p;
499 right_strip_line->
SetX1(x1_right_strip_line);
500 right_strip_line->
SetY1(y1_right_strip_line);
501 right_strip_line->
SetX2(x2_right_strip_line);
502 right_strip_line->
SetY2(y2_right_strip_line);
504 right_strip_line->
Draw();
507 Double_t x_left_border_marker = x_left_border;
508 Double_t y_left_border_marker = y_left_border;
509 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
510 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_left_border, y_left_border);
511 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_left_border, y_left_border);
512 x_left_border_marker = x_p;
513 y_left_border_marker = y_p;
515 TMarker* left_border_marker =
new TMarker(x_left_border_marker, y_left_border_marker, 20);
518 left_border_marker->
Draw();
521 Double_t x_right_border_marker = x_right_border;
522 Double_t y_right_border_marker = y_right_border;
523 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
524 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_right_border, y_right_border);
525 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_right_border, y_right_border);
526 x_right_border_marker = x_p;
527 y_right_border_marker = y_p;
529 TMarker* right_border_marker =
new TMarker(x_right_border_marker, y_right_border_marker, 20);
532 right_border_marker->
Draw();
537 strip_direction_arrow->
SetX1(x_left_border_marker);
538 strip_direction_arrow->
SetY1(y_left_border_marker);
543 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
544 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_arrend, y_arrend);
545 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_arrend, y_arrend);
549 strip_direction_arrow->
SetX2(x_arrend);
550 strip_direction_arrow->
SetY2(y_arrend);
552 strip_direction_arrow->
SetX1(x_right_border_marker);
553 strip_direction_arrow->
SetY1(y_right_border_marker);
558 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
559 Double_t x_p =
Modules[im]->ConvertLocalToRotatedX(x_arrend, y_arrend);
560 Double_t y_p =
Modules[im]->ConvertLocalToRotatedY(x_arrend, y_arrend);
564 strip_direction_arrow->
SetX2(x_arrend);
565 strip_direction_arrow->
SetY2(y_arrend);
571 strip_direction_arrow->
Draw(
"|>");
575 Double_t x_center_layer = (x_min_layer + x_max_layer) * 0.5;
576 Double_t y_center_layer = (y_min_layer + y_max_layer) * 0.5;
578 Double_t x1_center_vline = x_center_layer;
579 Double_t y1_center_vline = y_max_layer;
580 Double_t x2_center_vline = x_center_layer;
581 Double_t y2_center_vline = y_min_layer;
583 Double_t x1_center_hline = x_min_layer;
584 Double_t y1_center_hline = y_center_layer;
585 Double_t x2_center_hline = x_max_layer;
586 Double_t y2_center_hline = y_center_layer;
588 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
589 Double_t x1_vline_p =
Modules[im]->ConvertLocalToRotatedX(x_center_layer, y_max_layer);
590 Double_t y1_vline_p =
Modules[im]->ConvertLocalToRotatedY(x_center_layer, y_max_layer);
591 Double_t x2_vline_p =
Modules[im]->ConvertLocalToRotatedX(x_center_layer, y_min_layer);
592 Double_t y2_vline_p =
Modules[im]->ConvertLocalToRotatedY(x_center_layer, y_min_layer);
593 Double_t x1_hline_p =
Modules[im]->ConvertLocalToRotatedX(x1_center_hline, y1_center_hline);
594 Double_t y1_hline_p =
Modules[im]->ConvertLocalToRotatedY(x1_center_hline, y1_center_hline);
595 Double_t x2_hline_p =
Modules[im]->ConvertLocalToRotatedX(x2_center_hline, y2_center_hline);
596 Double_t y2_hline_p =
Modules[im]->ConvertLocalToRotatedY(x2_center_hline, y2_center_hline);
597 x1_center_vline = x1_vline_p;
598 y1_center_vline = y1_vline_p;
599 x2_center_vline = x2_vline_p;
600 y2_center_vline = y2_vline_p;
601 x1_center_hline = x1_hline_p;
602 y1_center_hline = y1_hline_p;
603 x2_center_hline = x2_hline_p;
604 y2_center_hline = y2_hline_p;
607 TLine* vert_center_layer_line =
608 new TLine(x1_center_vline, y1_center_vline, x2_center_vline, y2_center_vline);
609 TLine* horiz_center_layer_line =
610 new TLine(x1_center_hline, y1_center_hline, x2_center_hline, y2_center_hline);
615 vert_center_layer_line->
Draw();
616 horiz_center_layer_line->
Draw();
623 Double_t hor_leg = vert_leg *
Tan(strip_angle_rad);
624 Double_t x_edge_layer = x_center_layer + hor_leg;
625 Double_t y_edge_layer = y_max_layer;
627 Double_t x1_slope_line = x_center_layer;
628 Double_t y1_slope_line = y_center_layer;
629 Double_t x2_slope_line = x_edge_layer;
630 Double_t y2_slope_line = y_edge_layer;
632 if (std::fabs(
Modules[im]->GetModuleRotationAngleDeg()) >= std::numeric_limits<double>::epsilon()) {
633 Double_t x1_line_p =
Modules[im]->ConvertLocalToRotatedX(x1_slope_line, y1_slope_line);
634 Double_t y1_line_p =
Modules[im]->ConvertLocalToRotatedY(x1_slope_line, y1_slope_line);
635 Double_t x2_line_p =
Modules[im]->ConvertLocalToRotatedX(x2_slope_line, y2_slope_line);
636 Double_t y2_line_p =
Modules[im]->ConvertLocalToRotatedY(x2_slope_line, y2_slope_line);
638 x1_slope_line = x1_line_p;
639 y1_slope_line = y1_line_p;
640 x2_slope_line = x2_line_p;
641 y2_slope_line = y2_line_p;
644 TLine* strip_slope_layer_line =
new TLine(x1_slope_line, y1_slope_line, x2_slope_line, y2_slope_line);
648 strip_slope_layer_line->
Draw();
654 for (
int ip = 0; ip < points.size(); ip++) {
655 mark_point_front[ip].
SetX(points.at(ip).X());
656 mark_point_front[ip].
SetY(points.at(ip).Y());
662 mark_point_front[ip].
Draw();
672 for (
int ip = 0; ip < points.size(); ip++) {
673 mark_point_front[ip].
SetX(points.at(ip).X());
674 mark_point_front[ip].
SetY(points.at(ip).Y());
679 station_front_canv->
cd();
680 mark_point_front[ip].
Draw();
684 station_front_canv->
cd();
686 notice_pt->
AddText(
"Press <SHIFT+LeftMouseClick>: to add a new point; <C>: to clear the area");
693 station_front_canv->
AddExec(
"ex",
"RecognizeModuleNumFromPointAndDrawIt(station_front_canv)");