74 TString fGemMCPoints_FileName =
"$VMCWORKDIR/macro/run/bmnsim";
75 fGemMCPoints_FileName += file_prefix;
76 fGemMCPoints_FileName +=
".root";
77 TFile* fGemMCPoints_File =
new TFile(fGemMCPoints_FileName,
"READ");
78 TTree* fGemMCPoints_Tree = (
TTree*)fGemMCPoints_File->
Get(
"bmndata");
85 TString fGemHits_FileName =
"$VMCWORKDIR/macro/run/bmndst";
86 fGemHits_FileName += file_prefix;
87 fGemHits_FileName +=
".root";
88 TFile* fGemHits_File =
new TFile(fGemHits_FileName,
"READ");
97 Double_t xmin_view = -100.0 * scale_coeff;
98 Double_t xmax_view = +100.0 * scale_coeff;
99 Double_t ymin_view = -100.0 * scale_coeff;
100 Double_t ymax_view = +100.0 * scale_coeff;
108 new TH2D(
"planeXY_h2",
"planeXY_h2 (to the target(back))", 10, xmin_view, xmax_view, 10, ymin_view, ymax_view);
115 TH2D* planeZX_h2 =
new TH2D(
"planeZX_h2",
"planeZX_h2(top)", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view);
122 TH2D* planeZY_h2 =
new TH2D(
"planeZY_h2",
"planeZY_h2(side)", 10, zmin_view, zmax_view, 10, ymin_view, ymax_view);
129 TH3D* XYZview_h3 =
new TH3D(
"XYZview_h3",
"XYZview_h3", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view, 10,
130 ymin_view, ymax_view);
138 gPathDetectorConfig +=
"/parameters/gem/XMLConfigs/";
140 gPathDetectorConfig +=
"GemRun8.xml";
156 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
157 for (
Int_t imodule = 0; imodule <
gStationSet->GetGemStation(istation)->GetNModules(); ++imodule) {
184 cout <<
"Info about the visual status of modules:\n";
187 cout <<
"det[" << istation <<
"][" << imodule <<
"] = " <<
gConfig_visual[istation][imodule] <<
"\n";
206 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
208 for (
Int_t imodule = 0; imodule <
gStationSet->GetGemStation(istation)->GetNModules(); ++imodule) {
212 if (visual_status ==
true) {
217 Double_t xmin_module =
module->GetXMinModule();
218 Double_t xmax_module =
module->GetXMaxModule();
219 Double_t ymin_module =
module->GetYMinModule();
220 Double_t ymax_module =
module->GetYMaxModule();
222 gStationSet->GetGemStation(istation)->GetModule(imodule)->GetZStartModulePosition();
224 gStationSet->GetGemStation(istation)->GetModule(imodule)->GetZPositionRegistered();
228 cout <<
" station[" << istation <<
"], module[" << imodule <<
"]:\n";
229 cout <<
" xloc_module(min:max) = ( " << xmin_module <<
" : " << xmax_module <<
")\n";
230 cout <<
" yloc_module(min:max) = ( " << ymin_module <<
" : " << ymax_module <<
")\n";
231 cout <<
" zloc_start_pos_module = " << z_start_pos_module <<
"\n";
232 cout <<
" zloc_reg_module = " << z_reg_module <<
"\n";
236 vector<Plane3D::Point> module_borders;
237 vector<Plane3D::Point> tmodule_borders;
238 vector<Plane3D::Point> rtmodule_borders;
240 module_borders.push_back(
242 module_borders.push_back(
244 module_borders.push_back(
246 module_borders.push_back(
249 for (
Int_t ipoint = 0; ipoint < module_borders.size(); ++ipoint) {
250 tmodule_borders.push_back(
gTransfClass->ApplyTransforms(module_borders[ipoint], istation, imodule));
273 cout <<
"It's the end" <<
"\n";
288 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
293 TMarker* marker =
new TMarker(points[ipoint].X(), points[ipoint].Y(), marker_style);
302 if (ipoint != points.size() - 1) {
303 x1 = points[ipoint].X();
304 y1 = points[ipoint].Y();
305 x2 = points[ipoint + 1].X();
306 y2 = points[ipoint + 1].Y();
309 x1 = points[ipoint].X();
310 y1 = points[ipoint].Y();
327 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].X(), marker_style);
336 if (ipoint != points.size() - 1) {
337 z1 = points[ipoint].Z();
338 x1 = points[ipoint].X();
339 z2 = points[ipoint + 1].Z();
340 x2 = points[ipoint + 1].X();
343 z1 = points[ipoint].Z();
344 x1 = points[ipoint].X();
361 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].Y(), marker_style);
370 if (ipoint != points.size() - 1) {
371 z1 = points[ipoint].Z();
372 y1 = points[ipoint].Y();
373 z2 = points[ipoint + 1].Z();
374 y2 = points[ipoint + 1].Y();
377 z1 = points[ipoint].Z();
378 y1 = points[ipoint].Y();
417 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
419 markers->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
421 if (ipoint != points.size() - 1) {
422 lines->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
424 lines->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
426 lines->
SetPoint(ipoint + 1, points[0].Z(), points[0].X(), points[0].Y());
441 vector<Plane3D::Point> tracks;
442 vector<Plane3D::Point> points;
444 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
450 Int_t trackIdPrev = -1;
453 for (
Int_t ipoint = 0; ipoint < npoints; ++ipoint) {
465 Int_t trackId = mc_point->GetTrackID();
473 if (station_num < gStationSet->GetNStations()) {
474 if (module_num < gStationSet->GetGemStation(station_num)->GetNModules()) {
475 loc_point =
gTransfClass->ApplyInverseTransforms(loc_point, station_num, module_num);
476 loc_direct =
gTransfClass->ApplyInverseTransforms(loc_direct, station_num, module_num);
483 Double_t pxloc = loc_direct.
X() - loc_point.
X();
484 Double_t pyloc = loc_direct.
Y() - loc_point.
Y();
485 Double_t pzloc = loc_direct.
Z() - loc_point.
Z();
487 cout <<
"ipoint = " << ipoint <<
"\n";
488 cout <<
" x = " << x <<
"\n";
489 cout <<
" y = " << y <<
"\n";
490 cout <<
" z = " << z <<
"\n";
491 cout <<
" px = " << px <<
"\n";
492 cout <<
" py = " << py <<
"\n";
493 cout <<
" pz = " << pz <<
"\n";
495 cout <<
" xloc = " << xloc <<
"\n";
496 cout <<
" yloc = " << yloc <<
"\n";
497 cout <<
" zloc = " << zloc <<
"\n";
498 cout <<
" pxloc = " << pxloc <<
"\n";
499 cout <<
" pyloc = " << pyloc <<
"\n";
500 cout <<
" pzloc = " << pzloc <<
"\n";
503 Int_t current_station_num = -1;
504 Int_t current_module_num = -1;
505 Bool_t visual_status =
false;
506 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
508 if (current_station_num >= 0)
510 gStationSet->GetGemStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
511 if (current_station_num >= 0 && current_module_num >= 0)
512 visual_status =
gConfig_visual[current_station_num][current_module_num];
515 if (visual_status ==
true)
516 point_color =
"#cc0000";
518 point_color =
"#999999";
520 if (trackId != trackIdPrev) {
525 trackIdPrev = trackId;
535 vector<Plane3D::Point> direct_points;
537 direct_points.push_back(
Plane3D::Point(x + px * 10, y + py * 10, z + pz * 10));
540 direct_points.clear();
548 vector<Plane3D::Point> points;
550 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
556 for (
Int_t ihit = 0; ihit < npoints; ++ihit) {
569 if (station_num < gStationSet->GetNStations()) {
570 if (module_num < gStationSet->GetGemStation(station_num)->GetNModules()) {
571 loc_hit =
gTransfClass->ApplyInverseTransforms(loc_hit, station_num, module_num);
578 Int_t current_station_num = -1;
579 Int_t current_module_num = -1;
580 Bool_t visual_status =
false;
581 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
583 if (current_station_num >= 0)
585 gStationSet->GetGemStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
586 if (current_station_num >= 0 && current_module_num >= 0)
587 visual_status =
gConfig_visual[current_station_num][current_module_num];
590 if (visual_status ==
true)
591 point_color =
"#0000cc";
593 point_color =
"#ccccff";