70#if ROOT_VERSION_CODE < ROOT_VERSION(5, 99, 99)
71 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C");
82 TString fSiBTMCPoints_FileName =
"$VMCWORKDIR/macro/run/bmnsim";
83 fSiBTMCPoints_FileName += file_prefix;
84 fSiBTMCPoints_FileName +=
".root";
85 TFile* fSiBTMCPoints_File =
new TFile(fSiBTMCPoints_FileName,
"READ");
86 TTree* fSiBTMCPoints_Tree = (
TTree*)fSiBTMCPoints_File->
Get(
"bmndata");
93 TString fSiBTHits_FileName =
"$VMCWORKDIR/macro/run/bmndst";
94 fSiBTHits_FileName += file_prefix;
95 fSiBTHits_FileName +=
".root";
96 TFile* fSiBTHits_File =
new TFile(fSiBTHits_FileName,
"READ");
97 TTree* fSiBTHits_Tree = (
TTree*)fSiBTHits_File->
Get(
"bmndata");
106 Double_t xmin_view = -10.0 * scale_coeff;
107 Double_t xmax_view = +10.0 * scale_coeff;
108 Double_t ymin_view = -10.0 * scale_coeff;
109 Double_t ymax_view = +10.0 * scale_coeff;
110 Double_t zmin_view = -450.0 * scale_coeff;
111 Double_t zmax_view = +0.0 * scale_coeff;
119 new TH2D(
"planeXY_h2",
"planeXY_h2 (to the target(back))", 10, xmin_view, xmax_view, 10, ymin_view, ymax_view);
126 TH2D* planeZX_h2 =
new TH2D(
"planeZX_h2",
"planeZX_h2(top)", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view);
133 TH2D* planeZY_h2 =
new TH2D(
"planeZY_h2",
"planeZY_h2(side)", 10, zmin_view, zmax_view, 10, ymin_view, ymax_view);
140 TH3D* XYZview_h3 =
new TH3D(
"XYZview_h3",
"XYZview_h3", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view, 10,
141 ymin_view, ymax_view);
150 gPathDetectorConfig +=
"/parameters/SiBT/XMLConfigs/";
152 gPathDetectorConfig +=
"SiBTRun8.xml";
167 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
168 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
182 cout <<
"Info about the visual status of modules:\n";
185 cout <<
"det[" << istation <<
"][" << imodule <<
"] = " <<
gConfig_visual[istation][imodule] <<
"\n";
204 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
206 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
210 if (visual_status ==
true) {
215 Double_t xmin_module =
module->GetXMinModule();
216 Double_t xmax_module =
module->GetXMaxModule();
217 Double_t ymin_module =
module->GetYMinModule();
218 Double_t ymax_module =
module->GetYMaxModule();
220 gStationSet->GetStation(istation)->GetModule(imodule)->GetZStartModulePosition();
221 Double_t z_reg_module =
gStationSet->GetStation(istation)->GetModule(imodule)->GetZPositionRegistered();
225 cout <<
" station[" << istation <<
"], module[" << imodule <<
"]:\n";
226 cout <<
" xloc_module(min:max) = ( " << xmin_module <<
" : " << xmax_module <<
")\n";
227 cout <<
" yloc_module(min:max) = ( " << ymin_module <<
" : " << ymax_module <<
")\n";
228 cout <<
" zloc_start_pos_module = " << z_start_pos_module <<
"\n";
229 cout <<
" zloc_reg_module = " << z_reg_module <<
"\n";
233 vector<Plane3D::Point> module_borders;
234 vector<Plane3D::Point> tmodule_borders;
235 vector<Plane3D::Point> rtmodule_borders;
237 module_borders.push_back(
239 module_borders.push_back(
241 module_borders.push_back(
243 module_borders.push_back(
246 for (
Int_t ipoint = 0; ipoint < module_borders.size(); ++ipoint) {
247 tmodule_borders.push_back(
gTransfClass->ApplyTransforms(module_borders[ipoint], istation, imodule));
272 cout <<
"It's the end" <<
"\n";
287 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
292 TMarker* marker =
new TMarker(points[ipoint].X(), points[ipoint].Y(), marker_style);
301 if (ipoint != points.size() - 1) {
302 x1 = points[ipoint].X();
303 y1 = points[ipoint].Y();
304 x2 = points[ipoint + 1].X();
305 y2 = points[ipoint + 1].Y();
308 x1 = points[ipoint].X();
309 y1 = points[ipoint].Y();
326 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].X(), marker_style);
335 if (ipoint != points.size() - 1) {
336 z1 = points[ipoint].Z();
337 x1 = points[ipoint].X();
338 z2 = points[ipoint + 1].Z();
339 x2 = points[ipoint + 1].X();
342 z1 = points[ipoint].Z();
343 x1 = points[ipoint].X();
360 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].Y(), marker_style);
369 if (ipoint != points.size() - 1) {
370 z1 = points[ipoint].Z();
371 y1 = points[ipoint].Y();
372 z2 = points[ipoint + 1].Z();
373 y2 = points[ipoint + 1].Y();
376 z1 = points[ipoint].Z();
377 y1 = points[ipoint].Y();
416 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
418 markers->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
420 if (ipoint != points.size() - 1) {
421 lines->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
423 lines->
SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
425 lines->
SetPoint(ipoint + 1, points[0].Z(), points[0].X(), points[0].Y());
440 vector<Plane3D::Point> tracks;
441 vector<Plane3D::Point> points;
443 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
449 Int_t trackIdPrev = -1;
452 for (
Int_t ipoint = 0; ipoint < npoints; ++ipoint) {
464 Int_t trackId = mc_point->GetTrackID();
472 if (station_num < gStationSet->GetNStations()) {
473 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
474 loc_point =
gTransfClass->ApplyInverseTransforms(loc_point, station_num, module_num);
475 loc_direct =
gTransfClass->ApplyInverseTransforms(loc_direct, station_num, module_num);
482 Double_t pxloc = loc_direct.
X() - loc_point.
X();
483 Double_t pyloc = loc_direct.
Y() - loc_point.
Y();
484 Double_t pzloc = loc_direct.
Z() - loc_point.
Z();
486 cout <<
"ipoint = " << ipoint <<
"\n";
487 cout <<
" x = " << x <<
"\n";
488 cout <<
" y = " << y <<
"\n";
489 cout <<
" z = " << z <<
"\n";
490 cout <<
" px = " << px <<
"\n";
491 cout <<
" py = " << py <<
"\n";
492 cout <<
" pz = " << pz <<
"\n";
494 cout <<
" xloc = " << xloc <<
"\n";
495 cout <<
" yloc = " << yloc <<
"\n";
496 cout <<
" zloc = " << zloc <<
"\n";
497 cout <<
" pxloc = " << pxloc <<
"\n";
498 cout <<
" pyloc = " << pyloc <<
"\n";
499 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);
507 if (current_station_num >= 0)
509 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
510 if (current_station_num >= 0 && current_module_num >= 0)
511 visual_status =
gConfig_visual[current_station_num][current_module_num];
513 cout <<
" current_station_num(point) = " << current_station_num <<
"\n";
514 cout <<
" current_module_num(point) = " << current_module_num <<
"\n";
517 if (visual_status ==
true)
518 point_color =
"#cc0000";
520 point_color =
"#999999";
522 if (trackId != trackIdPrev) {
527 trackIdPrev = trackId;
537 vector<Plane3D::Point> direct_points;
539 direct_points.push_back(
Plane3D::Point(x + px * 10, y + py * 10, z + pz * 10));
542 direct_points.clear();
550 vector<Plane3D::Point> points;
552 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
558 for (
Int_t ihit = 0; ihit < npoints; ++ihit) {
571 if (station_num < gStationSet->GetNStations()) {
572 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
573 loc_hit =
gTransfClass->ApplyInverseTransforms(loc_hit, station_num, module_num);
580 Int_t current_station_num = -1;
581 Int_t current_module_num = -1;
582 Bool_t visual_status =
false;
583 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
585 if (current_station_num >= 0)
587 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
588 if (current_station_num >= 0 && current_module_num >= 0)
589 visual_status =
gConfig_visual[current_station_num][current_module_num];
592 if (visual_status ==
true)
593 point_color =
"#0000cc";
595 point_color =
"#ccccff";