70#if ROOT_VERSION_CODE < ROOT_VERSION(5, 99, 99)
71 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C");
82 TString fCSCMCPoints_FileName =
"$VMCWORKDIR/macro/run/bmnsim";
83 fCSCMCPoints_FileName += file_prefix;
84 fCSCMCPoints_FileName +=
".root";
85 TFile* fCSCMCPoints_File =
new TFile(fCSCMCPoints_FileName,
"READ");
86 TTree* fCSCMCPoints_Tree = (
TTree*)fCSCMCPoints_File->
Get(
"bmndata");
93 TString fCSCHits_FileName =
"$VMCWORKDIR/macro/run/bmndst";
94 fCSCHits_FileName += file_prefix;
95 fCSCHits_FileName +=
".root";
96 TFile* fCSCHits_File =
new TFile(fCSCHits_FileName,
"READ");
105 Double_t xmin_view = -100.0 * scale_coeff;
106 Double_t xmax_view = +100.0 * scale_coeff;
107 Double_t ymin_view = -100.0 * scale_coeff;
108 Double_t ymax_view = +100.0 * scale_coeff;
118 new TH2D(
"planeXY_h2",
"planeXY_h2 (to the target(back))", 10, xmin_view, xmax_view, 10, ymin_view, ymax_view);
125 TH2D* planeZX_h2 =
new TH2D(
"planeZX_h2",
"planeZX_h2(top)", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view);
132 TH2D* planeZY_h2 =
new TH2D(
"planeZY_h2",
"planeZY_h2(side)", 10, zmin_view, zmax_view, 10, ymin_view, ymax_view);
139 TH3D* XYZview_h3 =
new TH3D(
"XYZview_h3",
"XYZview_h3", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view, 10,
140 ymin_view, ymax_view);
149 gPathDetectorConfig +=
"/parameters/csc/XMLConfigs/";
153 gPathDetectorConfig +=
"FullCSCRun8.xml";
192 cout <<
"Info about the visual status of modules:\n";
195 cout <<
"det[" << istation <<
"][" << imodule <<
"] = " <<
gConfig_visual[istation][imodule] <<
"\n";
214 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
216 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
220 if (visual_status ==
true) {
225 Double_t xmin_module =
module->GetXMinModule();
226 Double_t xmax_module =
module->GetXMaxModule();
227 Double_t ymin_module =
module->GetYMinModule();
228 Double_t ymax_module =
module->GetYMaxModule();
230 gStationSet->GetStation(istation)->GetModule(imodule)->GetZStartModulePosition();
231 Double_t z_reg_module =
gStationSet->GetStation(istation)->GetModule(imodule)->GetZPositionRegistered();
235 cout <<
" station[" << istation <<
"], module[" << imodule <<
"]:\n";
236 cout <<
" xloc_module(min:max) = ( " << xmin_module <<
" : " << xmax_module <<
")\n";
237 cout <<
" yloc_module(min:max) = ( " << ymin_module <<
" : " << ymax_module <<
")\n";
238 cout <<
" zloc_start_pos_module = " << z_start_pos_module <<
"\n";
239 cout <<
" zloc_reg_module = " << z_reg_module <<
"\n";
243 vector<Plane3D::Point> module_borders;
244 vector<Plane3D::Point> tmodule_borders;
245 vector<Plane3D::Point> rtmodule_borders;
247 module_borders.push_back(
249 module_borders.push_back(
251 module_borders.push_back(
253 module_borders.push_back(
256 for (
Int_t ipoint = 0; ipoint < module_borders.size(); ++ipoint) {
257 tmodule_borders.push_back(
gTransfClass->ApplyTransforms(module_borders[ipoint], istation, imodule));
286 cout <<
" station[" << istation <<
"], module[" << imodule <<
"]:\n";
287 cout <<
" xloc_layer(min:max) = ( " << xmin_layer <<
" : " << xmax_layer <<
")\n";
288 cout <<
" yloc_layer(min:max) = ( " << ymin_layer <<
" : " << ymax_layer <<
")\n";
289 cout <<
" zloc_reg_layer = " << z_reg_module <<
"\n";
293 vector<Plane3D::Point> layer_borders;
294 vector<Plane3D::Point> tlayer_borders;
295 vector<Plane3D::Point> rtlayer_borders;
297 vector<Plane3D::Point> layer_left_border_point;
298 vector<Plane3D::Point> tlayer_left_border_point;
299 vector<Plane3D::Point> rtlayer_left_border_point;
300 vector<Plane3D::Point> layer_right_border_point;
301 vector<Plane3D::Point> tlayer_right_border_point;
302 vector<Plane3D::Point> rtlayer_right_border_point;
304 layer_borders.push_back(
306 layer_borders.push_back(
308 layer_borders.push_back(
310 layer_borders.push_back(
313 layer_left_border_point.push_back(
Plane3D::Point(-xleft_sborder_layer, yleft_sborder_layer,
315 layer_right_border_point.push_back(
Plane3D::Point(-xright_sborder_layer, yright_sborder_layer,
318 for (
Int_t ipoint = 0; ipoint < layer_borders.size(); ++ipoint) {
319 tlayer_borders.push_back(
320 gTransfClass->ApplyTransforms(layer_borders[ipoint], istation, imodule));
323 tlayer_left_border_point.push_back(
324 gTransfClass->ApplyTransforms(layer_left_border_point[0], istation, imodule));
325 tlayer_right_border_point.push_back(
326 gTransfClass->ApplyTransforms(layer_right_border_point[0], istation, imodule));
357 cout <<
"It's the end" <<
"\n";
372 for (
Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
377 TMarker* marker =
new TMarker(points[ipoint].X(), points[ipoint].Y(), marker_style);
386 if (ipoint != points.size() - 1) {
387 x1 = points[ipoint].X();
388 y1 = points[ipoint].Y();
389 x2 = points[ipoint + 1].X();
390 y2 = points[ipoint + 1].Y();
393 x1 = points[ipoint].X();
394 y1 = points[ipoint].Y();
411 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].X(), marker_style);
420 if (ipoint != points.size() - 1) {
421 z1 = points[ipoint].Z();
422 x1 = points[ipoint].X();
423 z2 = points[ipoint + 1].Z();
424 x2 = points[ipoint + 1].X();
427 z1 = points[ipoint].Z();
428 x1 = points[ipoint].X();
445 TMarker* marker =
new TMarker(points[ipoint].Z(), points[ipoint].Y(), marker_style);
454 if (ipoint != points.size() - 1) {
455 z1 = points[ipoint].Z();
456 y1 = points[ipoint].Y();
457 z2 = points[ipoint + 1].Z();
458 y2 = points[ipoint + 1].Y();
461 z1 = points[ipoint].Z();
462 y1 = points[ipoint].Y();
525 vector<Plane3D::Point> tracks;
526 vector<Plane3D::Point> points;
528 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
534 Int_t trackIdPrev = -1;
537 for (
Int_t ipoint = 0; ipoint < npoints; ++ipoint) {
549 Int_t trackId = mc_point->GetTrackID();
557 if (station_num < gStationSet->GetNStations()) {
558 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
559 loc_point =
gTransfClass->ApplyInverseTransforms(loc_point, station_num, module_num);
560 loc_direct =
gTransfClass->ApplyInverseTransforms(loc_direct, station_num, module_num);
567 Double_t pxloc = loc_direct.
X() - loc_point.
X();
568 Double_t pyloc = loc_direct.
Y() - loc_point.
Y();
569 Double_t pzloc = loc_direct.
Z() - loc_point.
Z();
571 cout <<
"ipoint = " << ipoint <<
"\n";
572 cout <<
" x = " << x <<
"\n";
573 cout <<
" y = " << y <<
"\n";
574 cout <<
" z = " << z <<
"\n";
575 cout <<
" px = " << px <<
"\n";
576 cout <<
" py = " << py <<
"\n";
577 cout <<
" pz = " << pz <<
"\n";
579 cout <<
" xloc = " << xloc <<
"\n";
580 cout <<
" yloc = " << yloc <<
"\n";
581 cout <<
" zloc = " << zloc <<
"\n";
582 cout <<
" pxloc = " << pxloc <<
"\n";
583 cout <<
" pyloc = " << pyloc <<
"\n";
584 cout <<
" pzloc = " << pzloc <<
"\n";
587 Int_t current_station_num = -1;
588 Int_t current_module_num = -1;
589 Bool_t visual_status =
false;
590 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
592 if (current_station_num >= 0)
594 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
595 if (current_station_num >= 0 && current_module_num >= 0)
596 visual_status =
gConfig_visual[current_station_num][current_module_num];
598 cout <<
" current_station_num(point) = " << current_station_num <<
"\n";
599 cout <<
" current_module_num(point) = " << current_module_num <<
"\n";
602 if (visual_status ==
true)
603 point_color =
"#cc0000";
605 point_color =
"#999999";
607 if (trackId != trackIdPrev) {
612 trackIdPrev = trackId;
622 vector<Plane3D::Point> direct_points;
624 direct_points.push_back(
Plane3D::Point(x + px * 10, y + py * 10, z + pz * 10));
627 direct_points.clear();
635 vector<Plane3D::Point> points;
637 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
643 for (
Int_t ihit = 0; ihit < npoints; ++ihit) {
656 if (station_num < gStationSet->GetNStations()) {
657 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
658 loc_hit =
gTransfClass->ApplyInverseTransforms(loc_hit, station_num, module_num);
665 Int_t current_station_num = -1;
666 Int_t current_module_num = -1;
667 Bool_t visual_status =
false;
668 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
670 if (current_station_num >= 0)
672 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
673 if (current_station_num >= 0 && current_module_num >= 0)
674 visual_status =
gConfig_visual[current_station_num][current_module_num];
677 if (visual_status ==
true)
678 point_color =
"#0000cc";
680 point_color =
"#ccccff";