58 TString fVSPMCPoints_FileName =
"$VMCWORKDIR/macro/run/bmnsim";
59 fVSPMCPoints_FileName += file_prefix;
60 fVSPMCPoints_FileName +=
".root";
61 TFile* fVSPMCPoints_File =
new TFile(fVSPMCPoints_FileName,
"READ");
62 TTree* fVSPMCPoints_Tree = (
TTree*)fVSPMCPoints_File->
Get(
"bmndata");
69 TString fVSPHits_FileName =
"$VMCWORKDIR/macro/run/bmndst";
70 fVSPHits_FileName += file_prefix;
71 fVSPHits_FileName +=
".root";
72 TFile* fVSPHits_File =
new TFile(fVSPHits_FileName,
"READ");
81 Double_t xmin_view = -10.0 * scale_coeff;
82 Double_t xmax_view = +10.0 * scale_coeff;
83 Double_t ymin_view = -10.0 * scale_coeff;
84 Double_t ymax_view = +10.0 * scale_coeff;
85 Double_t zmin_view = +5.0 * scale_coeff;
86 Double_t zmax_view = +10.0 * scale_coeff;
92 new TH2D(
"planeXY_h2",
"planeXY_h2 (to the target(back))", 10, xmin_view, xmax_view, 10, ymin_view, ymax_view);
100 TH2D* planeZX_h2 =
new TH2D(
"planeZX_h2",
"planeZX_h2(top)", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view);
108 TH2D* planeZY_h2 =
new TH2D(
"planeZY_h2",
"planeZY_h2(side)", 10, zmin_view, zmax_view, 10, ymin_view, ymax_view);
116 TH3D* XYZview_h3 =
new TH3D(
"XYZview_h3",
"XYZview_h3", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view, 10,
117 ymin_view, ymax_view);
126 gPathDetectorConfig +=
"/parameters/vsp/XMLConfigs/";
128 gPathDetectorConfig +=
"VSP_Run9.xml";
143 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
144 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
171 cout <<
"Info about the visual status of modules:\n";
174 cout <<
"det[" << istation <<
"][" << imodule <<
"] = " <<
gConfig_visual[istation][imodule] <<
"\n";
193 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
195 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
199 if (visual_status ==
true) {
204 Double_t xmin_module =
module->GetXMinModule();
205 Double_t xmax_module =
module->GetXMaxModule();
206 Double_t ymin_module =
module->GetYMinModule();
207 Double_t ymax_module =
module->GetYMaxModule();
209 gStationSet->GetStation(istation)->GetModule(imodule)->GetZStartModulePosition();
210 Double_t z_reg_module =
gStationSet->GetStation(istation)->GetModule(imodule)->GetZPositionRegistered();
214 cout <<
" station[" << istation <<
"], module[" << imodule <<
"]:\n";
215 cout <<
" xloc_module(min:max) = ( " << xmin_module <<
" : " << xmax_module <<
")\n";
216 cout <<
" yloc_module(min:max) = ( " << ymin_module <<
" : " << ymax_module <<
")\n";
217 cout <<
" zloc_start_pos_module = " << z_start_pos_module <<
"\n";
218 cout <<
" zloc_reg_module = " << z_reg_module <<
"\n";
222 vector<Plane3D::Point> module_borders;
223 vector<Plane3D::Point> tmodule_borders;
224 vector<Plane3D::Point> rtmodule_borders;
238 module_borders.push_back(
Plane3D::Point(-x_p0, y_p0, z_reg_module));
239 module_borders.push_back(
Plane3D::Point(-x_p1, y_p1, z_reg_module));
240 module_borders.push_back(
Plane3D::Point(-x_p2, y_p2, z_reg_module));
241 module_borders.push_back(
Plane3D::Point(-x_p3, y_p3, z_reg_module));
243 for (
Int_t ipoint = 0; ipoint < module_borders.size(); ++ipoint) {
244 tmodule_borders.push_back(
gTransfClass->ApplyTransforms(module_borders[ipoint], istation, imodule));
267 cout <<
"It's the end" <<
"\n";
282 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
287 TMarker* marker =
new TMarker(points[ipoint].X(), points[ipoint].Y(), marker_style);
296 if (ipoint != points.size() - 1) {
297 x1 = points[ipoint].X();
298 y1 = points[ipoint].Y();
299 x2 = points[ipoint + 1].X();
300 y2 = points[ipoint + 1].Y();
303 x1 = points[ipoint].X();
304 y1 = points[ipoint].Y();
321 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].X(), marker_style);
330 if (ipoint != points.size() - 1) {
331 z1 = points[ipoint].Z();
332 x1 = points[ipoint].X();
333 z2 = points[ipoint + 1].Z();
334 x2 = points[ipoint + 1].X();
337 z1 = points[ipoint].Z();
338 x1 = points[ipoint].X();
355 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].Y(), marker_style);
364 if (ipoint != points.size() - 1) {
365 z1 = points[ipoint].Z();
366 y1 = points[ipoint].Y();
367 z2 = points[ipoint + 1].Z();
368 y2 = points[ipoint + 1].Y();
371 z1 = points[ipoint].Z();
372 y1 = points[ipoint].Y();
411 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
413 markers->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
415 if (ipoint != points.size() - 1) {
416 lines->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
418 lines->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
420 lines->
SetPoint(ipoint + 1, points[0].Z(), points[0].X(), points[0].Y());
435 vector<Plane3D::Point> tracks;
436 vector<Plane3D::Point> points;
438 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
444 Int_t trackIdPrev = -1;
447 for (
Int_t ipoint = 0; ipoint < npoints; ++ipoint) {
459 Int_t trackId = mc_point->GetTrackID();
470 if (station_num < gStationSet->GetNStations()) {
471 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
472 loc_point =
gTransfClass->ApplyInverseTransforms(loc_point, station_num, module_num);
473 loc_direct =
gTransfClass->ApplyInverseTransforms(loc_direct, station_num, module_num);
480 Double_t pxloc = loc_direct.
X() - loc_point.
X();
481 Double_t pyloc = loc_direct.
Y() - loc_point.
Y();
482 Double_t pzloc = loc_direct.
Z() - loc_point.
Z();
485 cout <<
"ipoint = " << ipoint <<
"\n";
486 cout <<
" x = " << x <<
"\n";
487 cout <<
" y = " << y <<
"\n";
488 cout <<
" z = " << z <<
"\n";
489 cout <<
" px = " << px <<
"\n";
490 cout <<
" py = " << py <<
"\n";
491 cout <<
" pz = " << pz <<
"\n";
493 cout <<
" xloc = " << xloc <<
"\n";
494 cout <<
" yloc = " << yloc <<
"\n";
495 cout <<
" zloc = " << zloc <<
"\n";
496 cout <<
" pxloc = " << pxloc <<
"\n";
497 cout <<
" pyloc = " << pyloc <<
"\n";
498 cout <<
" pzloc = " << pzloc <<
"\n";
502 Int_t current_station_num = -1;
503 Int_t current_module_num = -1;
504 Bool_t visual_status =
false;
505 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
508 if (current_station_num >= 0)
510 gStationSet->GetStation(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->GetStation(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);
584 if (current_station_num >= 0)
586 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
587 if (current_station_num >= 0 && current_module_num >= 0)
588 visual_status =
gConfig_visual[current_station_num][current_module_num];
591 if (visual_status ==
true)
592 point_color =
"#0000cc";
594 point_color =
"#ccccff";