BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
TestGEMClassTransform.C
Go to the documentation of this file.
1/*
2 * This macro for testing configurations of the GEM detector
3 * which have some module transformations in an XML-parameter file.
4 * It allows you to analyze MC-points and Hits and find their ownership to
5 * modules in various visual projections.
6 *
7 * Author: Baranov D.
8 * Created: 12.01.2023
9 *
10 */
11
12#include "Rtypes.h"
13
14R__ADD_INCLUDE_PATH($VMCWORKDIR)
15
16#include "Math/Transform3D.h"
17#include "TBox.h"
18#include "TCanvas.h"
19#include "TClonesArray.h"
20#include "TFile.h"
21#include "TFrame.h"
22#include "TH1F.h"
23#include "TH2F.h"
24#include "TPad.h"
25#include "TRandom.h"
26#include "TTree.h"
27
28#include <fstream>
29#include <iostream>
30#include <vector>
31
32using namespace ROOT::Math;
33using namespace std;
34
35// Global variables
40
43vector<vector<Bool_t>> gConfig_visual; // [station][module] = bool (active/inactive)
44
45// function declaration
46void DrawPointsAndLines(vector<Plane3D::Point> points,
47 TString hexcolor,
48 Int_t marker_style,
49 Double_t marker_size,
50 Double_t line_size,
51 Bool_t isPointDraw,
52 Bool_t isLinesDraw,
53 Bool_t isCloseLine);
54void DrawPointsAndLines3D(vector<Plane3D::Point> points,
55 TString hexcolor,
56 Int_t marker_style,
57 Double_t marker_size,
58 Double_t line_size,
59 Bool_t isPointDraw,
60 Bool_t isLinesDraw,
61 Bool_t isCloseLine);
62void DrawBranchPoints(TTree* points_tree, TClonesArray* points_array, Int_t first_event, Int_t last_event);
63void DrawBranchHits(TTree* points_tree, TClonesArray* points_array, Int_t first_event, Int_t last_event);
64
66{
67
68 //------------------------------------------------------------------------------
69 TString file_prefix = "";
70 // file_prefix = "_CC_4gev_b0_16fm";
71
72 // Input MC-points for GEM (called StsPoint)
73 TClonesArray* fGemMCPoints_Array = new TClonesArray("");
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");
79 fGemMCPoints_Tree->GetBranch("StsPoint")->SetAutoDelete(kTRUE);
80 fGemMCPoints_Tree->SetBranchAddress("StsPoint", &fGemMCPoints_Array);
81 Int_t NEvents_fGemMCPoints = fGemMCPoints_Tree->GetEntries();
82
83 // Input hits for GEM
84 TClonesArray* fGemHits_Array = new TClonesArray("");
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");
89 TTree* fGemHits_Tree = (TTree*)fGemHits_File->Get("bmndata");
90 fGemHits_Tree->GetBranch("BmnGemStripHit")->SetAutoDelete(kTRUE);
91 fGemHits_Tree->SetBranchAddress("BmnGemStripHit", &fGemHits_Array);
92 Int_t NEvents_fGemHits = fGemHits_Tree->GetEntries();
93
94 //------------------------------------------------------------------------------
95
96 Double_t scale_coeff = 1;
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;
101 Double_t zmin_view = 0.0; // was -100
102 Double_t zmax_view = 850.0;
103
104 // XY plane
105 planeXY_canv = new TCanvas("planeXY_canv", "planeXY_canv", 10, 10, 900, 900);
106 planeXY_canv->SetGrid();
107 TH2D* planeXY_h2 =
108 new TH2D("planeXY_h2", "planeXY_h2 (to the target(back))", 10, xmin_view, xmax_view, 10, ymin_view, ymax_view);
109 planeXY_h2->GetXaxis()->SetTitle("X(global)");
110 planeXY_h2->GetYaxis()->SetTitle("Y(global)");
111
112 // ZX plane
113 planeZX_canv = new TCanvas("planeZX_canv", "planeZX_canv", 1000, 10, 900, 900);
114 planeZX_canv->SetGrid();
115 TH2D* planeZX_h2 = new TH2D("planeZX_h2", "planeZX_h2(top)", 10, zmin_view, zmax_view, 10, xmin_view, xmax_view);
116 planeZX_h2->GetXaxis()->SetTitle("Z(global)");
117 planeZX_h2->GetYaxis()->SetTitle("X(global)");
118
119 // ZY plane
120 planeZY_canv = new TCanvas("planeZY_canv", "planeZY_canv", 1800, 10, 900, 900);
121 planeZY_canv->SetGrid();
122 TH2D* planeZY_h2 = new TH2D("planeZY_h2", "planeZY_h2(side)", 10, zmin_view, zmax_view, 10, ymin_view, ymax_view);
123 planeZY_h2->GetXaxis()->SetTitle("Z(global)");
124 planeZY_h2->GetYaxis()->SetTitle("Y(global)");
125
126 // 3D view (y and z - swapped)
127 XYZview_canv = new TCanvas("XYZview_canv", "XYZview_canv", 2900, 10, 900, 900);
128 // XYZview_canv->SetGrid();
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);
131 XYZview_h3->GetXaxis()->SetTitle("Z");
132 XYZview_h3->GetYaxis()->SetTitle("X");
133 XYZview_h3->GetZaxis()->SetTitle("Y");
134
135 //------------------------------------------------------------------------------
136
137 TString gPathDetectorConfig = gSystem->Getenv("VMCWORKDIR");
138 gPathDetectorConfig += "/parameters/gem/XMLConfigs/";
139 // gPathDetectorConfig += "GemRunSRCSpring2018.xml";
140 gPathDetectorConfig += "GemRun8.xml";
141
142 // Current configuration
143 gStationSet = new BmnGemStripStationSet(gPathDetectorConfig);
144
145 // Current transform configuration
147 gTransfClass->LoadFromXMLFile(gPathDetectorConfig);
148
149 // Selecting modules to visualize -------------------------------------------
150 gConfig_visual.resize(gStationSet->GetNStations()); // quantity of stations
151 for (Int_t istation = 0; istation < gConfig_visual.size(); ++istation) {
152 gConfig_visual[istation].resize(gStationSet->GetGemStation(istation)->GetNModules(),
153 false); // default: inactive
154 }
155
156 for (Int_t istation = 0; istation < gStationSet->GetNStations(); ++istation) {
157 for (Int_t imodule = 0; imodule < gStationSet->GetGemStation(istation)->GetNModules(); ++imodule) {
158 gConfig_visual[istation][imodule] = true;
159 }
160 }
161
162 // gConfig_visual[0][0] = true;
163 // gConfig_visual[0][1] = true;
164 // gConfig_visual[0][2] = true;
165 // gConfig_visual[0][3] = true;
166 // gConfig_visual[1][0] = true;
167 // gConfig_visual[2][0] = true;
168 // gConfig_visual[3][0] = true;
169 // gConfig_visual[4][0] = true;
170 // gConfig_visual[4][1] = true;
171 // gConfig_visual[5][0] = true;
172 // gConfig_visual[5][1] = true;
173 // gConfig_visual[6][0] = true;
174 // gConfig_visual[6][1] = true;
175 // gConfig_visual[7][0] = true;
176 // gConfig_visual[7][1] = true;
177 // gConfig_visual[8][0] = true;
178 // gConfig_visual[8][1] = true;
179 // gConfig_visual[9][0] = true;
180 // gConfig_visual[9][1] = true;
181
182 // Printing the info about the visual status of modules
183 if (1) {
184 cout << "Info about the visual status of modules:\n";
185 for (Int_t istation = 0; istation < gConfig_visual.size(); ++istation) {
186 for (Int_t imodule = 0; imodule < gConfig_visual[istation].size(); ++imodule) {
187 cout << "det[" << istation << "][" << imodule << "] = " << gConfig_visual[istation][imodule] << "\n";
188 }
189 }
190 cout << "\n";
191 }
192 //--------------------------------------------------------------------------
193
194 planeXY_canv->cd();
195 planeXY_h2->Draw();
196
197 planeZX_canv->cd();
198 planeZX_h2->Draw();
199
200 planeZY_canv->cd();
201 planeZY_h2->Draw();
202
203 XYZview_canv->cd();
204 XYZview_h3->Draw();
205
206 for (Int_t istation = 0; istation < gStationSet->GetNStations(); ++istation) {
207
208 for (Int_t imodule = 0; imodule < gStationSet->GetGemStation(istation)->GetNModules(); ++imodule) {
209
210 Bool_t visual_status = gConfig_visual[istation][imodule];
211
212 if (visual_status == true) {
213
214 BmnGemStripModule* module = gStationSet->GetGemStation(istation)->GetModule(imodule);
215
216 // parameters of the current module in local coordinates
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();
221 Double_t z_start_pos_module =
222 gStationSet->GetGemStation(istation)->GetModule(imodule)->GetZStartModulePosition();
223 Double_t z_reg_module =
224 gStationSet->GetGemStation(istation)->GetModule(imodule)->GetZPositionRegistered();
225
226 // print parameters of the module
227 if (1) {
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";
233 cout << "\n";
234 }
235
236 vector<Plane3D::Point> module_borders;
237 vector<Plane3D::Point> tmodule_borders; // transformed
238 vector<Plane3D::Point> rtmodule_borders; // inverse transformed
239
240 module_borders.push_back(
241 Plane3D::Point(-xmin_module, ymin_module, z_reg_module)); // x converted to global
242 module_borders.push_back(
243 Plane3D::Point(-xmin_module, ymax_module, z_reg_module)); // x converted to global
244 module_borders.push_back(
245 Plane3D::Point(-xmax_module, ymax_module, z_reg_module)); // x converted to global
246 module_borders.push_back(
247 Plane3D::Point(-xmax_module, ymin_module, z_reg_module)); // x converted to global
248
249 for (Int_t ipoint = 0; ipoint < module_borders.size(); ++ipoint) {
250 tmodule_borders.push_back(gTransfClass->ApplyTransforms(module_borders[ipoint], istation, imodule));
251 }
252
253 // DrawPointsAndLines(module_borders, "#cc0000", 20, 1.0, 1.0, false, true, true);
254 DrawPointsAndLines(tmodule_borders, "#00cc00", 20, 1.0, 1.0, false, true, true);
255 // DrawPointsAndLines(rtmodule_borders, "#0000cc", 20, 1.0, 1.0, true, true, true);
256
257 // DrawPointsAndLines3D(module_borders, "#cc0000", 20, 0.5, 1.0, false, true, true);
258 DrawPointsAndLines3D(tmodule_borders, "#00cc00", 20, 0.5, 1.0, false, true, true);
259 // DrawPointsAndLines3D(rtmodule_borders, "#0000cc", 20, 0.5, 1.0, true, true, true);
260 }
261 }
262 }
263
264 // DrawBranchPoints(fGemMCPoints_Tree, fGemMCPoints_Array, 0, NEvents_fGemMCPoints);
265 // DrawBranchHits(fGemHits_Tree, fGemHits_Array, 0, NEvents_fGemMCPoints);
266
267 DrawBranchPoints(fGemMCPoints_Tree, fGemMCPoints_Array, 0, 1);
268 DrawBranchHits(fGemHits_Tree, fGemHits_Array, 0, 1);
269
270 delete gTransfClass;
271 delete gStationSet;
272
273 cout << "It's the end" << "\n";
274 // gApplication->Terminate();
275}
276//------------------------------------------------------------------------------
277
278void DrawPointsAndLines(vector<Plane3D::Point> points,
279 TString hexcolor,
280 Int_t marker_style,
281 Double_t marker_size,
282 Double_t line_size,
283 Bool_t isPointDraw,
284 Bool_t isLinesDraw,
285 Bool_t isCloseLine)
286{
287 // Drawing the points as the markers ----------------------------------------
288 for (Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
289
290 // XY-plane -------------------------------------------------------------
291 // Markers on the XY plane
292 {
293 TMarker* marker = new TMarker(points[ipoint].X(), points[ipoint].Y(), marker_style);
294 marker->SetMarkerSize(marker_size);
295 marker->SetMarkerColor(TColor::GetColor(hexcolor));
296 planeXY_canv->cd();
297 if (isPointDraw)
298 marker->Draw();
299
300 // Lines between points on XY plane
301 Double_t x1, y1, x2, y2;
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();
307 } else {
308 if (isCloseLine) {
309 x1 = points[ipoint].X();
310 y1 = points[ipoint].Y();
311 x2 = points[0].X();
312 y2 = points[0].Y();
313 }
314 }
315 TLine* line = new TLine(x1, y1, x2, y2);
316 line->SetLineColor(TColor::GetColor(hexcolor));
317 line->SetLineWidth(line_size);
318 planeXY_canv->cd();
319 if (isLinesDraw)
320 line->Draw();
321 }
322 //----------------------------------------------------------------------
323
324 // ZX-plane -------------------------------------------------------------
325 // Markers on the ZX plane
326 {
327 TMarker* marker = new TMarker(points[ipoint].Z(), points[ipoint].X(), marker_style);
328 marker->SetMarkerSize(marker_size);
329 marker->SetMarkerColor(TColor::GetColor(hexcolor));
330 planeZX_canv->cd();
331 if (isPointDraw)
332 marker->Draw();
333
334 // Lines between points on ZX plane
335 Double_t z1, x1, z2, x2;
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();
341 } else {
342 if (isCloseLine) {
343 z1 = points[ipoint].Z();
344 x1 = points[ipoint].X();
345 z2 = points[0].Z();
346 x2 = points[0].X();
347 }
348 }
349 TLine* line = new TLine(z1, x1, z2, x2);
350 line->SetLineColor(TColor::GetColor(hexcolor));
351 line->SetLineWidth(line_size);
352 planeZX_canv->cd();
353 if (isLinesDraw)
354 line->Draw();
355 }
356 //----------------------------------------------------------------------
357
358 // ZY-plane -------------------------------------------------------------
359 // Markers on the XY plane
360 {
361 TMarker* marker = new TMarker(points[ipoint].Z(), points[ipoint].Y(), marker_style);
362 marker->SetMarkerSize(marker_size);
363 marker->SetMarkerColor(TColor::GetColor(hexcolor));
364 planeZY_canv->cd();
365 if (isPointDraw)
366 marker->Draw();
367
368 // Lines between points on XY plane
369 Double_t z1, y1, z2, y2;
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();
375 } else {
376 if (isCloseLine) {
377 z1 = points[ipoint].Z();
378 y1 = points[ipoint].Y();
379 z2 = points[0].Z();
380 y2 = points[0].Y();
381 }
382 }
383 TLine* line = new TLine(z1, y1, z2, y2);
384 line->SetLineColor(TColor::GetColor(hexcolor));
385 line->SetLineWidth(line_size);
386 planeZY_canv->cd();
387 if (isLinesDraw)
388 line->Draw();
389 }
390 //----------------------------------------------------------------------
391 }
392}
393
394void DrawPointsAndLines3D(vector<Plane3D::Point> points,
395 TString hexcolor,
396 Int_t marker_style,
397 Double_t marker_size,
398 Double_t line_size,
399 Bool_t isPointDraw,
400 Bool_t isLinesDraw,
401 Bool_t isCloseLine)
402{
403
404 // system coord XYZ---->ZXY
405
406 // points as the markers ----------------------------------------
407 TPolyMarker3D* markers = new TPolyMarker3D(points.size());
408 markers->SetMarkerColor(TColor::GetColor(hexcolor));
409 markers->SetMarkerStyle(marker_style);
410 markers->SetMarkerSize(marker_size);
411
412 // lines between points
413 TPolyLine3D* lines = new TPolyLine3D(points.size());
414 lines->SetLineColor(TColor::GetColor(hexcolor));
415 lines->SetLineWidth(line_size);
416
417 for (Int_t ipoint = 0; ipoint < points.size(); ++ipoint) {
418
419 markers->SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
420
421 if (ipoint != points.size() - 1) {
422 lines->SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
423 } else {
424 lines->SetPoint(ipoint, points[ipoint].Z(), points[ipoint].X(), points[ipoint].Y());
425 if (isCloseLine) {
426 lines->SetPoint(ipoint + 1, points[0].Z(), points[0].X(), points[0].Y());
427 }
428 }
429 }
430
431 XYZview_canv->cd();
432 if (isPointDraw)
433 markers->Draw();
434 if (isLinesDraw)
435 lines->Draw();
436}
437
438void DrawBranchPoints(TTree* points_tree, TClonesArray* points_array, Int_t first_event, Int_t last_event)
439{
440
441 vector<Plane3D::Point> tracks;
442 vector<Plane3D::Point> points;
443
444 for (Int_t ievent = first_event; ievent < last_event; ++ievent) {
445
446 points_tree->GetEntry(ievent);
447
448 Int_t npoints = points_array->GetEntries();
449
450 Int_t trackIdPrev = -1;
451 tracks.clear();
452
453 for (Int_t ipoint = 0; ipoint < npoints; ++ipoint) {
454
455 CbmStsPoint* mc_point = (CbmStsPoint*)points_array->At(ipoint);
456
457 Double_t x = ((FairMCPoint*)mc_point)->GetX();
458 Double_t y = ((FairMCPoint*)mc_point)->GetY();
459 Double_t z = ((FairMCPoint*)mc_point)->GetZ();
460
461 Double_t px = ((FairMCPoint*)mc_point)->GetPx();
462 Double_t py = ((FairMCPoint*)mc_point)->GetPy();
463 Double_t pz = ((FairMCPoint*)mc_point)->GetPz();
464
465 Int_t trackId = mc_point->GetTrackID();
466
467 Int_t station_num = mc_point->GetStation();
468 Int_t module_num = mc_point->GetModule();
469
470 // needs to determine point ownership using local positions
471 Plane3D::Point loc_point(x, y, z);
472 Plane3D::Point loc_direct(px + x, py + y, pz + z);
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);
477 }
478 }
479 Double_t xloc = loc_point.X();
480 Double_t yloc = loc_point.Y();
481 Double_t zloc = loc_point.Z();
482
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();
486
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";
494 cout << "\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";
501 cout << "\n";
502
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);
507
508 if (current_station_num >= 0)
509 current_module_num =
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];
513
514 TString point_color;
515 if (visual_status == true)
516 point_color = "#cc0000";
517 else
518 point_color = "#999999";
519
520 if (trackId != trackIdPrev) {
521 DrawPointsAndLines(tracks, "#ffbcad", 6, 1.0, 1.0, false, true, false);
522 DrawPointsAndLines3D(tracks, "#ffbcad", 6, 1.0, 1.0, false, true, false);
523 tracks.clear();
524 }
525 trackIdPrev = trackId;
526
527 tracks.push_back(Plane3D::Point(x, y, z));
528 points.push_back(Plane3D::Point(x, y, z));
529
530 DrawPointsAndLines(points, point_color, 20, 0.4, 1.0, true, false, false);
531 DrawPointsAndLines3D(points, point_color, 20, 0.4, 1.0, true, false, false);
532 points.clear();
533
534 // drawing directions of mc-points
535 vector<Plane3D::Point> direct_points;
536 direct_points.push_back(Plane3D::Point(x, y, z));
537 direct_points.push_back(Plane3D::Point(x + px * 10, y + py * 10, z + pz * 10)); // 10x scaling
538 DrawPointsAndLines(direct_points, point_color, 20, 0.4, 0.5, false, true, false);
539 DrawPointsAndLines3D(direct_points, point_color, 20, 0.4, 0.5, false, true, false);
540 direct_points.clear();
541 }
542 }
543}
544
545void DrawBranchHits(TTree* points_tree, TClonesArray* points_array, Int_t first_event, Int_t last_event)
546{
547
548 vector<Plane3D::Point> points;
549
550 for (Int_t ievent = first_event; ievent < last_event; ++ievent) {
551
552 points_tree->GetEntry(ievent);
553
554 Int_t npoints = points_array->GetEntries();
555
556 for (Int_t ihit = 0; ihit < npoints; ++ihit) {
557
558 BmnGemStripHit* hit = (BmnGemStripHit*)points_array->At(ihit);
559
560 Double_t x = hit->GetX();
561 Double_t y = hit->GetY();
562 Double_t z = hit->GetZ();
563
564 Int_t station_num = hit->GetStation();
565 Int_t module_num = hit->GetModule();
566
567 // needs to determine hit ownership using local positions
568 Plane3D::Point loc_hit(x, y, z);
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);
572 }
573 }
574 Double_t xloc = loc_hit.X();
575 Double_t yloc = loc_hit.Y();
576 Double_t zloc = loc_hit.Z();
577
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);
582
583 if (current_station_num >= 0)
584 current_module_num =
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];
588
589 TString point_color;
590 if (visual_status == true)
591 point_color = "#0000cc";
592 else
593 point_color = "#ccccff";
594
595 points.push_back(Plane3D::Point(x, y, z));
596
597 DrawPointsAndLines(points, point_color, 6, 1.0, 1.0, true, false, false);
598 DrawPointsAndLines3D(points, point_color, 6, 1.0, 1.0, true, false, false);
599 points.clear();
600 }
601 }
602}
bool Bool_t
int Int_t
double Double_t
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
R__EXTERN TSystem * gSystem
Int_t GetModule()
Definition BmnHit.h:36
Short_t GetStation() const
Definition BmnHit.h:35
Int_t GetModule() const
Definition CbmStsPoint.h:77
Int_t GetStation() const
Definition CbmStsPoint.h:76
PositionVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > Point
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetMarkerSize(Size_t msize=1)
virtual void SetAutoDelete(bool autodel=true)
static Int_t GetColor(const char *hexcolor)
T * Get(const char *namecycle)
TAxis * GetZaxis()
TAxis * GetXaxis()
TAxis * GetYaxis()
void Draw(Option_t *option="") override
void Draw(Option_t *option="") override
virtual void SetTitle(const char *title="")
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
virtual void Draw(Option_t *option="")
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
void Draw(Option_t *option="") override
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
void Draw(Option_t *option="") override
virtual TBranch * GetBranch(const char *name)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual Long64_t GetEntries() const
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
TCanvas * planeXY_canv
vector< vector< Bool_t > > gConfig_visual
TCanvas * XYZview_canv
TCanvas * planeZX_canv
TCanvas * planeZY_canv
void DrawBranchHits(TTree *points_tree, TClonesArray *points_array, Int_t first_event, Int_t last_event)
void DrawPointsAndLines(vector< Plane3D::Point > points, TString hexcolor, Int_t marker_style, Double_t marker_size, Double_t line_size, Bool_t isPointDraw, Bool_t isLinesDraw, Bool_t isCloseLine)
void TestGEMClassTransform()
void DrawPointsAndLines3D(vector< Plane3D::Point > points, TString hexcolor, Int_t marker_style, Double_t marker_size, Double_t line_size, Bool_t isPointDraw, Bool_t isLinesDraw, Bool_t isCloseLine)
void DrawBranchPoints(TTree *points_tree, TClonesArray *points_array, Int_t first_event, Int_t last_event)
Definition json.hpp:4446