58 TString fSiliconMCPoints_FileName =
"$VMCWORKDIR/macro/run/bmnsim";
59 fSiliconMCPoints_FileName += file_prefix;
60 fSiliconMCPoints_FileName +=
".root";
61 TFile* fSiliconMCPoints_File =
new TFile(fSiliconMCPoints_FileName,
"READ");
62 TTree* fSiliconMCPoints_Tree = (
TTree*)fSiliconMCPoints_File->
Get(
"bmndata");
64 fSiliconMCPoints_Tree->
SetBranchAddress(
"SiliconPoint", &fSiliconMCPoints_Array);
69 TString fSiliconHits_FileName =
"$VMCWORKDIR/macro/run/bmndst";
70 fSiliconHits_FileName += file_prefix;
71 fSiliconHits_FileName +=
".root";
72 TFile* fSiliconHits_File =
new TFile(fSiliconHits_FileName,
"READ");
73 TTree* fSiliconHits_Tree = (
TTree*)fSiliconHits_File->
Get(
"bmndata");
81 Double_t xmin_view = -40.0 * scale_coeff;
82 Double_t xmax_view = +40.0 * scale_coeff;
83 Double_t ymin_view = -40.0 * scale_coeff;
84 Double_t ymax_view = +40.0 * scale_coeff;
85 Double_t zmin_view = -10.0 * scale_coeff;
86 Double_t zmax_view = +100.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/silicon/XMLConfigs/";
133 gPathDetectorConfig +=
"SiliconRun9.xml";
149 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
150 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
177 cout <<
"Info about the visual status of modules:\n";
180 cout <<
"det[" << istation <<
"][" << imodule <<
"] = " <<
gConfig_visual[istation][imodule] <<
"\n";
199 for (
Int_t istation = 0; istation <
gStationSet->GetNStations(); ++istation) {
201 for (
Int_t imodule = 0; imodule <
gStationSet->GetStation(istation)->GetNModules(); ++imodule) {
205 if (visual_status ==
true) {
210 Double_t xmin_module =
module->GetXMinModule();
211 Double_t xmax_module =
module->GetXMaxModule();
212 Double_t ymin_module =
module->GetYMinModule();
213 Double_t ymax_module =
module->GetYMaxModule();
215 gStationSet->GetStation(istation)->GetModule(imodule)->GetZStartModulePosition();
216 Double_t z_reg_module =
gStationSet->GetStation(istation)->GetModule(imodule)->GetZPositionRegistered();
220 cout <<
" station[" << istation <<
"], module[" << imodule <<
"]:\n";
221 cout <<
" xloc_module(min:max) = ( " << xmin_module <<
" : " << xmax_module <<
")\n";
222 cout <<
" yloc_module(min:max) = ( " << ymin_module <<
" : " << ymax_module <<
")\n";
223 cout <<
" zloc_start_pos_module = " << z_start_pos_module <<
"\n";
224 cout <<
" zloc_reg_module = " << z_reg_module <<
"\n";
228 vector<Plane3D::Point> module_borders;
229 vector<Plane3D::Point> tmodule_borders;
230 vector<Plane3D::Point> rtmodule_borders;
244 module_borders.push_back(
Plane3D::Point(-x_p0, y_p0, z_reg_module));
245 module_borders.push_back(
Plane3D::Point(-x_p1, y_p1, z_reg_module));
246 module_borders.push_back(
Plane3D::Point(-x_p2, y_p2, z_reg_module));
247 module_borders.push_back(
Plane3D::Point(-x_p3, y_p3, z_reg_module));
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();
476 if (station_num < gStationSet->GetNStations()) {
477 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
478 loc_point =
gTransfClass->ApplyInverseTransforms(loc_point, station_num, module_num);
479 loc_direct =
gTransfClass->ApplyInverseTransforms(loc_direct, station_num, module_num);
486 Double_t pxloc = loc_direct.
X() - loc_point.
X();
487 Double_t pyloc = loc_direct.
Y() - loc_point.
Y();
488 Double_t pzloc = loc_direct.
Z() - loc_point.
Z();
491 cout <<
"ipoint = " << ipoint <<
"\n";
492 cout <<
" x = " << x <<
"\n";
493 cout <<
" y = " << y <<
"\n";
494 cout <<
" z = " << z <<
"\n";
495 cout <<
" px = " << px <<
"\n";
496 cout <<
" py = " << py <<
"\n";
497 cout <<
" pz = " << pz <<
"\n";
499 cout <<
" xloc = " << xloc <<
"\n";
500 cout <<
" yloc = " << yloc <<
"\n";
501 cout <<
" zloc = " << zloc <<
"\n";
502 cout <<
" pxloc = " << pxloc <<
"\n";
503 cout <<
" pyloc = " << pyloc <<
"\n";
504 cout <<
" pzloc = " << pzloc <<
"\n";
508 Int_t current_station_num = -1;
509 Int_t current_module_num = -1;
510 Bool_t visual_status =
false;
511 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
514 if (current_station_num >= 0)
516 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
517 if (current_station_num >= 0 && current_module_num >= 0)
518 visual_status =
gConfig_visual[current_station_num][current_module_num];
521 if (visual_status ==
true)
522 point_color =
"#cc0000";
524 point_color =
"#999999";
526 if (trackId != trackIdPrev) {
531 trackIdPrev = trackId;
541 vector<Plane3D::Point> direct_points;
543 direct_points.push_back(
Plane3D::Point(x + px * 10, y + py * 10, z + pz * 10));
546 direct_points.clear();
554 vector<Plane3D::Point> points;
556 for (
Int_t ievent = first_event; ievent < last_event; ++ievent) {
562 for (
Int_t ihit = 0; ihit < npoints; ++ihit) {
575 if (station_num < gStationSet->GetNStations()) {
576 if (module_num < gStationSet->GetStation(station_num)->GetNModules()) {
577 loc_hit =
gTransfClass->ApplyInverseTransforms(loc_hit, station_num, module_num);
584 Int_t current_station_num = -1;
585 Int_t current_module_num = -1;
586 Bool_t visual_status =
false;
587 current_station_num =
gStationSet->GetPointStationOwnership(-xloc, yloc, zloc);
590 if (current_station_num >= 0)
592 gStationSet->GetStation(current_station_num)->GetPointModuleOwnership(-xloc, yloc, zloc);
593 if (current_station_num >= 0 && current_module_num >= 0)
594 visual_status =
gConfig_visual[current_station_num][current_module_num];
597 if (visual_status ==
true)
598 point_color =
"#0000cc";
600 point_color =
"#ccccff";