131 description_text +=
"FRONT: station ";
133 description_text +=
", xpos = ";
135 description_text +=
", ypos = ";
137 description_text +=
", zpos = ";
139 TCanvas* station_front_canv =
new TCanvas(
"station_front_canv", description_text, 10, 10, 1000, 1000);
163 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
168 if (
fabs(XShiftsOfModules[iModule]) > maxXShift)
169 maxXShift =
fabs(XShiftsOfModules[iModule]);
170 if (
fabs(YShiftsOfModules[iModule]) > maxYShift)
171 maxYShift =
fabs(YShiftsOfModules[iModule]);
172 if (
fabs(ZShiftsOfModules[iModule]) > maxZShift)
173 maxZShift =
fabs(ZShiftsOfModules[iModule]);
177 cout <<
"StationNumber = " << StationNumber <<
"\n";
178 cout <<
" XSize = " << XSize <<
"\n";
179 cout <<
" YSize = " << YSize <<
"\n";
180 cout <<
" ZSize = " << ZSize <<
"\n";
182 cout <<
" XMinStation = " << XMinStation <<
"\n";
183 cout <<
" XMaxStation = " << XMaxStation <<
"\n";
184 cout <<
" YMinStation = " << YMinStation <<
"\n";
185 cout <<
" YMaxStation = " << YMaxStation <<
"\n";
186 cout <<
" ZMinStation = " << ZMinStation <<
"\n";
187 cout <<
" ZMaxStation = " << ZMaxStation <<
"\n";
189 cout <<
" XPosition = " << XPosition <<
"\n";
190 cout <<
" YPosition = " << YPosition <<
"\n";
191 cout <<
" ZPosition = " << ZPosition <<
"\n";
193 cout <<
" NModules = " << NModules <<
"\n";
194 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
195 cout <<
" XShiftsOfModules[" << iModule <<
"] = " << XShiftsOfModules[iModule] <<
"\n";
196 cout <<
" YShiftsOfModules[" << iModule <<
"] = " << YShiftsOfModules[iModule] <<
"\n";
197 cout <<
" ZShiftsOfModules[" << iModule <<
"] = " << ZShiftsOfModules[iModule] <<
"\n";
201 Double_t XModuleSize =
module->GetXSize();
202 Double_t YModuleSize =
module->GetYSize();
203 Double_t XMinModule =
module->GetXMinModule();
204 Double_t XMaxModule =
module->GetXMaxModule();
205 Double_t YMinModule =
module->GetYMinModule();
206 Double_t YMaxModule =
module->GetYMaxModule();
208 cout <<
" XModuleSize = " << XModuleSize <<
"\n";
209 cout <<
" YModuleSize = " << YModuleSize <<
"\n";
210 cout <<
" XMinModule = " << XMinModule <<
"\n";
211 cout <<
" XMaxModule = " << XMaxModule <<
"\n";
212 cout <<
" YMinModule = " << YMinModule <<
"\n";
213 cout <<
" YMaxModule = " << YMaxModule <<
"\n";
216 Int_t NLayers =
module->GetNStripLayers();
217 for (
Int_t iLayer = 0; iLayer < NLayers; ++iLayer) {
235 cout <<
" Layer[" << iLayer <<
"]:\n";
236 cout <<
" stripAngleDeg = " << stripAngleDeg <<
"\n";
237 cout <<
" pitch = " << pitch <<
"\n";
239 cout <<
" XLayerSize = " << XLayerSize <<
"\n";
240 cout <<
" YLayerSize = " << YLayerSize <<
"\n";
242 cout <<
" XMinLayer = " << XMinLayer <<
"\n";
243 cout <<
" XMaxLayer = " << XMaxLayer <<
"\n";
244 cout <<
" YMinLayer = " << YMinLayer <<
"\n";
245 cout <<
" YMaxLayer = " << YMaxLayer <<
"\n";
248 cout <<
" layerType = " <<
"lower" <<
"\n";
251 cout <<
" layerType = " <<
"upper" <<
"\n";
254 cout <<
" xLeftBorderLayer = " << xLeftBorderLayer <<
"\n";
255 cout <<
" xRightBorderLayer = " << xRightBorderLayer <<
"\n";
256 cout <<
" yLeftBorderLayer = " << yLeftBorderLayer <<
"\n";
257 cout <<
" yRightBorderLayer = " << yRightBorderLayer <<
"\n";
259 cout <<
" stripDirection = " <<
"LeftToRight" <<
"\n";
262 cout <<
" stripDirection = " <<
"RightToLeft" <<
"\n";
266 vector<DeadZoneOfStripLayer> deadZones = layer.
GetDeadZones();
268 for (
Int_t idead = 0; idead < deadZones.size(); ++idead) {
269 cout <<
" DeadZone[" << idead <<
"]:\n";
271 Int_t NDeadPoints = deadZones[idead].GetNPoints();
273 for (
Int_t ip = 0; ip < NDeadPoints; ++ip) {
274 cout <<
" (x,y) = ( " << deadZones[idead].GetXPoint(ip) <<
", "
275 << deadZones[idead].GetYPoint(ip) <<
" )\n";
281 cout <<
"-----------------------------------------------------------\n";
285 for (
Int_t imod = 0; imod < NModules; imod++) {
286 Modules[imod] = station->
GetModule(imod);
298 Double_t xmin = XMinStation - XSize * 0.3;
299 Double_t xmax = XMaxStation + XSize * 0.3;
300 Double_t ymin = YMinStation - YSize * 0.3;
301 Double_t ymax = YMaxStation + YSize * 0.3;
305 TH2F* station_front_2dhist =
new TH2F(
"station_front_2dhist", description_text, 100, xmin, xmax, 100, ymin, ymax);
308 station_front_canv->
cd();
309 station_front_2dhist->
Draw();
311 TBox** modules_box =
new TBox*[NModules];
313 for (
Int_t im = 0; im < NModules; im++) {
321 modules_box[im] =
new TBox(x_min_module, y_min_module, x_max_module, y_max_module);
329 station_front_canv->
cd();
331 modules_box[im]->
Draw(
"l");
337 for (
Int_t ilayer = 0; ilayer < NLayers; ++ilayer) {
340 description_text =
"";
341 description_text +=
"FRONT: station ";
343 description_text +=
", module = ";
344 description_text += im;
345 description_text +=
", layer = ";
346 description_text += ilayer;
354 xmin, xmax, 100, ymin, ymax);
358 layer_2dhist->
Draw();
368 TBox* layer_box =
new TBox(x_min_layer, y_min_layer, x_max_layer, y_max_layer);
377 station_front_canv->
cd();
379 layer_box->
Draw(
"fl");
382 layer_box->
Draw(
"fl");
385 vector<DeadZoneOfStripLayer> DeadZones = layer.
GetDeadZones();
386 Int_t NDeadZones = DeadZones.size();
390 for (
Int_t izone = 0; izone < NDeadZones; ++izone) {
407 station_front_canv->
cd();
408 dead_zones_polylines[izone].
Draw(
"f");
409 dead_zones_polylines[izone].
Draw(
"");
412 dead_zones_polylines[izone].
Draw(
"f");
413 dead_zones_polylines[izone].
Draw(
"");
426 Double_t x_shift_up_left =
Tan(strip_angle_deg *
DegToRad()) * (y_max_layer - y_left_border);
427 Double_t x_shift_down_left =
Tan(strip_angle_deg *
DegToRad()) * (y_left_border - y_min_layer);
428 Double_t x_shift_up_right =
Tan(strip_angle_deg *
DegToRad()) * (y_max_layer - y_right_border);
429 Double_t x_shift_down_right =
Tan(strip_angle_deg *
DegToRad()) * (y_right_border - y_min_layer);
432 left_strip_line->
SetX1(x_left_border - x_shift_down_left);
433 left_strip_line->
SetX2(x_left_border + x_shift_up_left);
434 left_strip_line->
SetY1(y_min_layer);
435 left_strip_line->
SetY2(y_max_layer);
437 left_strip_line->
Draw();
440 right_strip_line->
SetX1(x_right_border - x_shift_down_right);
441 right_strip_line->
SetX2(x_right_border + x_shift_up_right);
442 right_strip_line->
SetY1(y_min_layer);
443 right_strip_line->
SetY2(y_max_layer);
445 right_strip_line->
Draw();
447 TMarker* left_border_marker =
new TMarker(x_left_border, y_left_border, 20);
450 left_border_marker->
Draw();
452 TMarker* right_border_marker =
new TMarker(x_right_border, y_right_border, 20);
455 right_border_marker->
Draw();
459 strip_direction_arrow->
SetX1(x_left_border);
460 strip_direction_arrow->
SetX2(x_right_border);
462 strip_direction_arrow->
SetX1(x_right_border);
463 strip_direction_arrow->
SetX2(x_left_border);
465 strip_direction_arrow->
SetY1(y_max_layer);
466 strip_direction_arrow->
SetY2(y_max_layer);
471 strip_direction_arrow->
Draw(
"|>");
477 TLine* x_center_layer_line =
478 new TLine(x_center_layer, layer_box->
GetY1(), x_center_layer, layer_box->
GetY2());
479 TLine* y_center_layer_line =
480 new TLine(layer_box->
GetX1(), y_center_layer, layer_box->
GetX2(), y_center_layer);
485 x_center_layer_line->
Draw();
486 y_center_layer_line->
Draw();
493 Double_t hor_leg = vert_leg *
Tan(strip_angle_rad);
494 Double_t x_edge_layer = x_center_layer + hor_leg;
496 TLine* strip_slope_layer_line =
new TLine(x_center_layer, y_center_layer, x_edge_layer, y_edge_layer);
500 strip_slope_layer_line->
Draw();
506 for (
int ip = 0; ip < points.size(); ip++) {
507 mark_point_front[ip].
SetX(points.at(ip).X());
508 mark_point_front[ip].
SetY(points.at(ip).Y());
514 cout <<
"mark_point_front[ip].GetX() = " << mark_point_front[ip].
GetX() <<
"\n";
515 mark_point_front[ip].
Draw();
525 for (
int ip = 0; ip < points.size(); ip++) {
526 mark_point_front[ip].
SetX(points.at(ip).X());
527 mark_point_front[ip].
SetY(points.at(ip).Y());
532 station_front_canv->
cd();
533 mark_point_front[ip].
Draw();
540 station_front_canv->
AddExec(
"ex",
"RecognizeModuleNumFromPointAndDrawIt(station_front_canv)");
563 cout <<
"\n-------------------------------------------------------------\n";
565 if (module_num != -1) {
567 cout <<
" point ( " << x <<
" : " << y <<
" ) is in:\n";
568 cout <<
" module = " << module_num <<
"\n";
571 Int_t NLayers =
module->GetNStripLayers();
573 for (
Int_t ilayer = 0; ilayer < NLayers; ++ilayer) {
578 cout <<
" layer[" << ilayer <<
"] : ";
580 cout <<
"LowerStripLayer";
582 cout <<
"UpperStripLayer";
584 cout <<
", pitch = " << layer.
GetPitch();
586 cout <<
", sizes = (" << layer.
GetXSize() <<
" x " << layer.
GetYSize() <<
")";
593 cout <<
" point ( " << x <<
" : " << y <<
" ) is out any modules!!!\n";
602 station_front_canv->
cd();
609 for (
Int_t ie = 0; ie < nentries; ++ie) {
613 point_marker->
Draw();
619 if (module_num != -1) {
634 cout <<
"\n Number of intersection points:\n";
636 for (
Int_t im = 0; im < NModules; ++im) {
638 Int_t NHits =
module->GetNIntersectionPoints();
642 cout <<
" in module[" << im <<
"] : " << NHits <<
"\n";
652 Int_t hit_marker_cnt = 0;
655 cout <<
" Intersection points:\n";
657 for (
Int_t im = 0; im < NModules; ++im) {
660 cout <<
" module[" << im <<
"]:\n";
664 Int_t NHits =
module->GetNIntersectionPoints();
666 for (
Int_t ihit = 0; ihit < NHits; ++ihit) {
668 Double_t x_hit =
module->GetIntersectionPointX(ihit);
669 Double_t y_hit =
module->GetIntersectionPointY(ihit);
670 Double_t z_hit =
module->GetZPositionRegistered();
673 cout <<
" hit[" << ihit <<
"] = ( " << x_hit <<
" : " << y_hit <<
" : " << z_hit <<
" ) "
677 Int_t NLayers =
module->GetNStripLayers();
678 for (
Int_t ilayer = 0; ilayer < NLayers; ++ilayer) {
682 cout <<
" layer[" << ilayer <<
"] : ";
684 cout <<
"LowerStripLayer";
686 cout <<
"UpperStripLayer";
688 cout <<
", pitch = " << layer.
GetPitch();
690 cout <<
", sizes = (" << layer.
GetXSize() <<
" x " << layer.
GetYSize() <<
")";
705 station_front_canv->
cd();
712 for (
Int_t ie = 0; ie < nentries; ++ie) {
716 Int_t NLayers =
module->GetNStripLayers();
718 for (
Int_t ilayer = 0; ilayer < NLayers; ++ilayer) {
743 cout <<
"-------------------------------------------------------------\n";
747 cout <<
"key button was pressed\n";
748 cout <<
"px = " << eventX <<
"\n";
749 cout <<
"py = " << (char)eventY <<
"\n";
751 if (eventX == (
int)
'c') {
766 station_front_canv->
Update();
772 for (
Int_t ie = 0; ie < nentries; ++ie) {
794 description_text +=
"TOP: station ";
796 description_text +=
", xpos = ";
798 description_text +=
", ypos = ";
800 description_text +=
", zpos = ";
802 TCanvas* station_top_canv =
new TCanvas(
"station_top_canv", description_text, 10, 10, 1000, 1200);
826 for (
Int_t iModule = 0; iModule < NModules; ++iModule) {
831 if (
fabs(XShiftsOfModules[iModule]) > maxXShift)
832 maxXShift =
fabs(XShiftsOfModules[iModule]);
833 if (
fabs(YShiftsOfModules[iModule]) > maxYShift)
834 maxYShift =
fabs(YShiftsOfModules[iModule]);
835 if (
fabs(ZShiftsOfModules[iModule]) > maxZShift)
836 maxZShift =
fabs(ZShiftsOfModules[iModule]);
840 for (
Int_t imod = 0; imod < NModules; imod++) {
841 Modules[imod] = station->
GetModule(imod);
847 Double_t xmin = XMinStation - XSize * 0.3;
848 Double_t xmax = XMaxStation + XSize * 0.3;
849 Double_t zmin = ZMinStation - ZSize * 5.0;
850 Double_t zmax = ZMaxStation + ZSize * 5.0;
854 TH2F* station_top_2dhist =
new TH2F(
"station_top_2dhist", description_text, 100, xmin, xmax, 100, zmin, zmax);
857 station_top_2dhist->
Draw();
859 TBox** modules_box =
new TBox*[NModules];
861 for (
Int_t im = 0; im < NModules; im++) {
869 modules_box[im] =
new TBox(x_min_module, z_min_module, x_max_module, z_max_module);
877 station_top_canv->
cd();
879 modules_box[im]->
Draw(
"l");
882 Double_t x_center_module = (modules_box[im]->
GetX1() + modules_box[im]->GetX2()) * 0.5;
883 TLine* x_center_module_line =
884 new TLine(x_center_module, modules_box[im]->GetY1(), x_center_module, modules_box[im]->GetY2());
886 x_center_module_line->
Draw();
890 for (
int ip = 0; ip < points.size(); ip++) {
891 mark_point_top[ip].
SetX(points.at(ip).X());
892 mark_point_top[ip].
SetY(points.at(ip).Z());
896 mark_point_top[ip].
Draw();