ATLAS Offline Software
Loading...
Searching...
No Matches
TrackVisualizationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
5
11
12
13#include <filesystem>
14#include <format>
15
16#include "TMarker.h"
17#include "TROOT.h"
18#include "TStyle.h"
19#include "TLegend.h"
20#include "TH1F.h"
21
22namespace {
23 using namespace MuonR4;
24 using PrimitivesVec_t = MuonValR4::TrackVisualizationTool::PrimitivesVec_t;
25 constexpr int truthColor = kOrange +2;
26
27 constexpr int ColorBarrel = kRed;
28 constexpr int ColorEndcapA = kBlue;
29 constexpr int ColorEndcapC = kGreen +2;
30 constexpr double inM = 1./ Gaudi::Units::m;
31
32 constexpr double extraMargin = 50.*Gaudi::Units::cm * inM;
33
34 static const Muon::MuonSectorMapping sectorMap{};
35
36
37 std::unique_ptr<TMarker> drawMarker(const Amg::Vector2D& pos, const int mStyle, const int mColor, const int mSize = 2) {
38 auto marker = std::make_unique<TMarker>(pos.x(), pos.y(), mStyle);
39 marker->SetMarkerColor(mColor);
40 marker->SetMarkerSize(mSize);
41 return marker;
42 }
43
44 std::unique_ptr<TArrow> drawArrow2D(const Amg::Vector2D& start, const Amg::Vector2D& dir, const int color, const int lineStyle=1) {
45 constexpr double arrowLength = 2.*Gaudi::Units::m;
46 const Amg::Vector2D end = start + (arrowLength / std::hypot(dir.x(), dir.y()) ) * dir;
47 auto arrow = std::make_unique<TArrow>(start.x(), start.y(), end.x(), end.y(),0.01);
48 arrow->SetLineColor(color);
49 arrow->SetLineWidth(2);
50 arrow->SetLineStyle(lineStyle);
51 return arrow;
52 }
53
54
55 inline int stationMarkerSyle(const Muon::MuonStationIndex::ChIndex ch,
56 const bool openMarker, const bool onSeed) {
59 case Inner:
60 case BarrelExtended:
61 case Extended:
62 return onSeed ? (openMarker ? kOpenTriangleUp : kFullTriangleUp)
63 : (openMarker ? kOpenTriangleDown : kFullTriangleDown);
64 case Middle:
65 return onSeed ? (openMarker ? kOpenCrossX : kFullCrossX)
66 : (openMarker ? kOpenCross : kFullCross);
67 case Outer:
68 return onSeed ? (openMarker ? kOpenFourTrianglesX: kFullFourTrianglesX)
69 : (openMarker ? kOpenThreeTriangles : kFullThreeTriangles);
70 default:
71 return 0;
72 }
73 }
74}
75
76namespace MuonValR4{
77
78 //** @brief Visualizing seeds and corresponding segments with different colors */
79 int seedColorIdx(std::size_t iSeed){
80 // Golden ratio hue stepping -> good spread even for many seeds
81 constexpr double phi = 0.6180339887498949;
82 const double h = 360 * std::fmod(0.13 + phi * double(iSeed), 1.0); // [0,1)
83 constexpr double s = 0.75;
84 constexpr double v = 0.95;
85
86 float r=0.f, g=0.f, b=0.f;
87 TColor::HLS2RGB(h, s, v, r, g, b);
88 return TColor::GetColor(r, g, b);
89 }
90
91 void TrackVisualizationTool::PlotLegend::addColor(const int color, const std::string& label){
92 if (colors.find(color) != colors.end()) {
93 return;
94 }
95 auto box = MuonValR4::drawBox(-1.5,-1.5,-1.,-1., color, MuonValR4::fullFilling);
96 legend->AddEntry(box.get(), label.c_str(), "F");
97 colors.insert(std::make_pair(color, std::move(box)));
98 }
99 void TrackVisualizationTool::PlotLegend::addMarker(const int marker, const std::string& label, const int color){
100 if (markers.find(marker)!= markers.end()) {
101 return;
102 }
103 auto tMarker = drawMarker(Amg::Vector2D{2.*Gaudi::Units::km, 0.}, marker, color);
104 legend->AddEntry(tMarker.get(), label.c_str(), "P");
105 markers.insert(std::make_pair(marker, std::move(tMarker)));
106 }
108 legend->SetBorderSize(0);
109 legend->SetNColumns(4);
110 canvas.add(std::move(legend));
111 for (auto&[i, obj] : colors){
112 canvas.add(std::move(obj));
113 }
114 for (auto&[i, obj]: markers) {
115 canvas.add(std::move(obj));
116 }
117 }
119 const Amg::Vector2D& posOnCylinder,
120 const DisplayView view) {
121 using enum DisplayView;
122 if (view == RZ) {
123 return Amg::Vector2D{ posOnCylinder[1]*inM, posOnCylinder[0]*inM};
124 }
125 const CxxUtils::sincos phi{phiV};
126 return posOnCylinder[0] * inM * Amg::Vector2D{phi.cs, phi.sn};
127 }
129 if (m_canvasLimit > 0) {
130 m_clientToken.canvasLimit = m_canvasLimit;
131 m_clientToken.preFixName = m_canvasPrefix;
132 m_clientToken.saveSinglePlots = m_saveSinglePDFs;
133 m_clientToken.saveSummaryPlot = m_saveSummaryPDF;
134 m_clientToken.subDirectory = m_subDir;
135 ATH_CHECK(m_visualSvc.retrieve());
136 ATH_CHECK(m_visualSvc->registerClient(m_clientToken));
137 } else {
138 m_plotsDone = true;
139 }
141 ATH_CHECK(m_segmentKey.initialize());
142 ATH_CHECK(m_geoCtxKey.initialize());
143 ATH_CHECK(m_seedingTool.retrieve());
144 ATH_CHECK(m_extrapolationTool.retrieve(EnableTool{!m_extrapolationTool.empty()}));
145 return StatusCode::SUCCESS;
146 }
147 void TrackVisualizationTool::displaySeeds(const EventContext& ctx,
148 const MsTrackSeedContainer& seeds) const {
149 displaySeeds(ctx, seeds, PrimitivesVec_t{});
150 }
151 void TrackVisualizationTool::displaySeeds(const EventContext& ctx,
152 const MsTrackSeedContainer& seeds,
153 PrimitivesVec_t && extPrimitives) const {
154
155
156 const xAOD::MuonSegmentContainer* segments{nullptr};
157 if (m_plotsDone || !SG::get(segments, m_segmentKey, ctx) || segments->empty()) {
158 return;
159 }
160
161 displaySeeds(ctx, DisplayView::RZ, *segments, seeds, clone(extPrimitives));
162 displaySeeds(ctx, DisplayView::XY, *segments, seeds, std::move(extPrimitives));
163
164 //For each seed plot respective segment parameters
165
168
169 }
170
172 const EventContext& ctx,
173 const DisplayView view,
174 const MsTrackSeedContainer& seeds) const {
175
176 auto canvas = m_visualSvc->prepareCanvas(
177 ctx, m_clientToken,
178 std::format("SeedSegsGlobalTruth{:}", view == DisplayView::XY ? "XY" : "RZ"));
179
180 if (!canvas) { m_plotsDone = true; return; }
181
182 canvas->setAxisTitles(view == DisplayView::XY ? "x [m]" : "z [m]",
183 view == DisplayView::XY ? "y [m]" : "R [m]");
184
185 PlotLegend legend{0.005, 0.005, 0.6, 0.1};
186
187 PrimitivesVec_t primitives{};
188 bool drewAny{false};
189
190 // -----------------------
191 // (A) Draw TRUTH segments
192 // -----------------------
193 const xAOD::MuonSegmentContainer* truthSegs{nullptr};
194 if (!SG::get(truthSegs, m_truthSegKey, ctx).isSuccess()) {
195 THROW_EXCEPTION("Failed to fetch the truth segment container");
196 }
197 if (truthSegs) {
198 for (const xAOD::MuonSegment* seg : *truthSegs) {
199 if (!seg) continue;
200
201 // Same station-based marker, but OPEN marker to visually separate truth vs reco
202 const auto chIdx = seg->chamberIndex();
203 const int mStyleTruth = stationMarkerSyle(chIdx, /*openMarker=*/true, /*onSeed=*/true);
204
205 const Amg::Vector3D p = seg->position();
206 const double x = p.x() * inM;
207 const double y = p.y() * inM;
208 const double z = p.z() * inM;
209 const double r = std::hypot(x, y);
210 const Amg::Vector2D plotPos =
211 (view == DisplayView::XY) ? Amg::Vector2D{x, y}
212 : Amg::Vector2D{z, r};
213 primitives.emplace_back(drawMarker(plotPos, mStyleTruth, truthColor, /*mSize=*/3));
214
215 //Plot direction of the segment as well
216 const double dir_x = seg->direction().x() * inM;
217 const double dir_y = seg->direction().y() * inM;
218 const double dir_z = seg->direction().z() * inM;
219 const Amg::Vector2D plotDir =
220 (view == DisplayView::XY) ? Amg::Vector2D{dir_x, dir_y}
221 : Amg::Vector2D{dir_z, std::hypot(dir_x, dir_y)};
222 primitives.emplace_back(drawArrow2D(plotPos, plotDir, truthColor));
223
224
225 legend.addMarker(
226 mStyleTruth,
227 std::string(Muon::MuonStationIndex::layerName(Muon::MuonStationIndex::toLayerIndex(chIdx))) + " (truth)", truthColor);
228
229 canvas->expandPad(plotPos.x() - extraMargin, plotPos.y() - extraMargin);
230 canvas->expandPad(plotPos.x() + extraMargin, plotPos.y() + extraMargin);
231 drewAny = true;
232 }
233 }
234
235 // ---------------------------------
236 // (B) Draw RECO seed-associated segs
237 // ---------------------------------
238 for (std::size_t iSeed = 0; iSeed < seeds.size(); ++iSeed) {
239 const MsTrackSeed& seed = seeds[iSeed];
240 const int color = seedColorIdx(iSeed);
241
242 std::string seedLabel = std::format("s{:d}: ", static_cast<int>(iSeed));
243
244 for (const xAOD::MuonSegment* seg : seed.segments()) {
245 if (!seg) continue;
246
247 const auto chIdx = seg->chamberIndex();
248 const int mStyle = stationMarkerSyle(chIdx, /*openMarker=*/false, /*onSeed=*/true);
249
250 const Amg::Vector3D p = seg->position();
251 const double x = p.x() * inM;
252 const double y = p.y() * inM;
253 const double z = p.z() * inM;
254 const double r = std::hypot(x, y);
255 const Amg::Vector2D plotPos =
256 (view == DisplayView::XY) ? Amg::Vector2D{x, y}
257 : Amg::Vector2D{z, r};
258
259 primitives.emplace_back(drawMarker(plotPos, mStyle, color));
260
261 //Plot direction of the segment as well
262 const double dir_x = seg->direction().x() * inM;
263 const double dir_y = seg->direction().y() * inM;
264 const double dir_z = seg->direction().z() * inM;
265 const Amg::Vector2D plotDir =
266 (view == DisplayView::XY) ? Amg::Vector2D{dir_x, dir_y}
267 : Amg::Vector2D{dir_z, std::hypot(dir_x, dir_y)};
268 primitives.emplace_back(drawArrow2D(plotPos, plotDir, color));
269
270 std::string label = printID(*seg);
271 seedLabel += label + "_";
272
273 primitives.emplace_back(MuonValR4::drawLabel(label, plotPos.x() + 0.01, plotPos.y() + 0.01, 10, false, color));
274
275 // Marker legend: only one entry per station style (PlotLegend dedups)
276 legend.addMarker(
277 mStyle,
279
280 canvas->expandPad(plotPos.x() - extraMargin, plotPos.y() - extraMargin);
281 canvas->expandPad(plotPos.x() + extraMargin, plotPos.y() + extraMargin);
282 drewAny = true;
283 }
284 //Add text which shows segment names associated to the respective seeed
285 primitives.emplace_back(MuonValR4::drawLabel(seedLabel, 0.15, 0.9 - (0.03*iSeed), 10, true, color));
286 }
287
288 if (!drewAny) { canvas->trash(); return; }
289
290 for (auto& p : primitives) canvas->add(std::move(p));
291 legend.fillPrimitives(*canvas);
292}
293
294
295
296
297 void TrackVisualizationTool::displaySeeds(const EventContext& ctx,
298 const DisplayView view,
299 const xAOD::MuonSegmentContainer& segments,
300 const MsTrackSeedContainer& seeds,
301 PrimitivesVec_t&& extPrimitives) const{
302
303 auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, std::format("SeedDisplay{:}",
304 view == DisplayView::XY ? "XY" : "RZ" ));
305
306 if (!canvas) {
307 m_plotsDone = true;
308 return;
309 }
310 canvas->setAxisTitles(view == DisplayView::XY ? "x [m]" : "z [m]",
311 view == DisplayView::XY ? "y [m]" : "R [m]");
312
313 PlotLegend legend{0.005,0.005, 0.6,0.1};
315 fillTruthSeedPoints(ctx, view, legend, *canvas);
316
317 auto onSeed = [&seeds](const xAOD::MuonSegment* segment,
318 const Location loc) {
319 return std::ranges::any_of(seeds,[segment, loc](const MsTrackSeed& seed){
320 return seed.location() == loc && std::ranges::find(seed.segments(), segment) != seed.segments().end();
321 });
322 };
323
324 const ActsTrk::GeometryContext* gctx{nullptr};
325 if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
326 THROW_EXCEPTION("Failed to fetch the geometry context "<<m_geoCtxKey.fullKey());
327 }
328 const Acts::GeometryContext tgContext = gctx->context();
329 bool drawnPoint{false};
330
331 for (const xAOD::MuonSegment* segment: segments) {
332 using enum Location;
334 using namespace Muon;
335 const MuonGMR4::SpectrometerSector* msSector = detailedSegment(*segment)->msSector();
336 const auto chIdx = segment->chamberIndex();
337 const int mColor = msSector->barrel() ? ColorBarrel : (msSector->side() > 0 ? ColorEndcapA : ColorEndcapC);
338
339 for (const auto secProj : {leftOverlap, center, rightOverlap}) {
340 const ExpandedSector sector{static_cast<unsigned>(segment->sector()), secProj};
341 if (ExpandedSector{segment->position().phi()} != sector){
342 continue;
343 }
344
345 for (const Location loc : {Barrel, Endcap}) {
346 const Amg::Vector2D projPos{m_seedingTool->expressOnCylinder(tgContext, *segment, loc, sector)};
347 if (!m_seedingTool->withinBounds(projPos, loc)) {
348 continue;
349 }
350 drawnPoint = true;
351 const bool isGood = onSeed(segment, loc);
352 const int mStyle = stationMarkerSyle(chIdx, true, isGood);
353 const Amg::Vector2D markerPos{viewVector(sector.phi(), projPos, view)};
354 extPrimitives.emplace_back( drawMarker(markerPos, mStyle, mColor)); //Is this necessary?
355 canvas->add( drawMarker(markerPos, mStyle, mColor));
356
357 if (view == DisplayView::XY) {
358 const double r = markerPos.mag() + extraMargin;
359 canvas->expandPad(r, r);
360 canvas->expandPad(-r, -r);
361 } else {
362 canvas->expandPad(markerPos[0] - extraMargin, markerPos[1] - extraMargin);
363 canvas->expandPad(markerPos[0] + extraMargin, markerPos[1] + extraMargin);
364 }
365 legend.addMarker(mStyle, std::format("{:}{:}", MuonStationIndex::layerName(MuonStationIndex::toLayerIndex(chIdx)),
366 isGood ? "" : " (discarded)"), mColor);
367 legend.addColor(mColor, msSector->barrel() ? "Barrel" : msSector->side() > 0 ? "Endcap A" : "Endcap C");
368 }
369 }
370 }
371 if (!drawnPoint) {
372 canvas->trash();
373 return;
374 }
375 for (const MsTrackSeed& seed : seeds) {
376 const Amg::Vector3D& pos{seed.position()};
377 canvas->add(drawMarker(viewVector(pos.phi(), Amg::Vector2D{pos.perp(), pos.z()}, view),
378 kFullDiamond, kBlack));
379 legend.addMarker(kFullDiamond, "track seed");
380 }
382 for (unsigned int s = 1; s<=16 ; ++s) {
383 if (view != DisplayView::XY) {
384 break;
385 }
386 const double phi = sectorMap.sectorPhi(s);
387 const double dPhi = sectorMap.sectorWidth(s);
388
389 const int lStyle = s%2 ? kDashed : kDotted;
390 const double r = canvas->corner(Edges::xHigh);
391 const CxxUtils::sincos phiM{phi-dPhi}, phiP{phi+dPhi};
392 const Amg::Vector2D e1{r * phiM.cs, r * phiM.sn};
393 const Amg::Vector2D e2{r * phiP.cs, r * phiP.sn};
394
395 auto theLine = std::make_unique<TLine>(0.,0., e1.x(), e1.y());
396 theLine->SetLineStyle(lStyle);
397 extPrimitives.insert(extPrimitives.begin(), std::move(theLine));
398 theLine = std::make_unique<TLine>(0.,0., e2.x(), e2.y());
399 theLine->SetLineStyle(lStyle);
400 extPrimitives.insert(extPrimitives.begin(), std::move(theLine));
401 theLine = std::make_unique<TLine>(e1.x(), e1.y(), e2.x(), e2.y());
402 theLine->SetLineStyle(lStyle);
403 extPrimitives.insert(extPrimitives.begin(), std::move(theLine));
404 }
405 legend.fillPrimitives(*canvas);
406 }
408 const DisplayView view,
409 PlotLegend& legend,
410 Canvas_t& canvas) const {
411 const xAOD::MuonSegmentContainer* truthSegs{nullptr};
412 if (!SG::get(truthSegs,m_truthSegKey, ctx).isSuccess()) {
413 THROW_EXCEPTION("Failed to fetch the truth segment container");
414 }
415 if (!truthSegs) {
416 return;
417 }
418 const ActsTrk::GeometryContext* gctx{nullptr};
419 if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
420 THROW_EXCEPTION("Failed to fetch the geometry context "<<m_geoCtxKey.fullKey());
421 }
422 const Acts::GeometryContext tgContext = gctx->context();
423 bool addedEntry{false};
424 for (const xAOD::MuonSegment* segment: *truthSegs) {
425 const auto chIdx = segment->chamberIndex();
426 const int mStyle = stationMarkerSyle(chIdx, true, true);
427
428 using enum Location;
430 ExpandedSector sector{segment->position().phi()};
431 for (const Location loc : {Barrel, Endcap}) {
432 const Amg::Vector2D projected{m_seedingTool->expressOnCylinder(tgContext, *segment, loc, sector)};
433 if (!m_seedingTool->withinBounds(projected, loc)) {
434 continue;
435 }
436 canvas.add(drawMarker(viewVector(sector.phi(), projected, view), mStyle, truthColor, 3));
437 legend.addMarker(mStyle, Muon::MuonStationIndex::layerName(Muon::MuonStationIndex::toLayerIndex(chIdx)), truthColor);
438 addedEntry = true;
439 }
440 }
441 if (addedEntry) {
442 legend.addColor(truthColor, "truth");
443 }
444 }
446 const MuonR4::MsTrackSeed& seed,
447 const OptBoundPars_t& parsToExt,
448 const std::string& objName) const {
450 return;
451 }
452 const ActsTrk::GeometryContext* gctx{nullptr};
453 SG::get(gctx, m_geoCtxKey, ctx).ignore();
454
455 Acts::ObjVisualization3D visualHelper{};
456 const std::string subDir = std::format("./ObjDisplays/{:}/", m_subDir.value());
457 ensureDirectory(subDir);
458 if (parsToExt.ok() && m_extrapolationTool.isEnabled()) {
459 auto stepsResult = m_extrapolationTool->propagationSteps(ctx, *parsToExt);
460 if (stepsResult.ok()) {
461 MuonValR4::drawPropagation(stepsResult->first, visualHelper);
462 } else {
463 ATH_MSG_WARNING("Failed to extrapolate the seed for visualization: " << stepsResult.error().message());
464 }
465 }
466 std::string segStr{removeNonAlphaNum(objName)};
467 for (const xAOD::MuonSegment* seg : seed.segments()) {
468 MuonValR4::drawSegmentMeasurements(gctx->context(),* seg, visualHelper);
469 MuonValR4::drawSegmentLine(gctx->context(), *seg, visualHelper);
470 segStr += std::format("_{:}", MuonR4::printID(*seg));
471 }
472
473 unsigned fileVersion{0};
474 std::string finalStr{};
475 while (finalStr.empty() || std::filesystem::exists(finalStr)) {
476 finalStr = std::format("{:}/{:}_{:}_{:}_{:}.obj", subDir,
477 m_clientToken.preFixName, ctx.eventID().event_number(), ++fileVersion, segStr);
478 }
479 visualHelper.write(finalStr);
480 ++m_objCounter;
481 }
482}
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define y
#define x
#define z
Acts::GeometryContext context() const
bool empty() const noexcept
Returns true if the collection is empty.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
bool barrel() const
Returns whether the sector is placed in the barrel.
double phi() const
Returns the phi angle of the expanded sector.
SectorProjector
Enumeration to select the sector projection of the regular MS sector.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Gaudi::Property< unsigned > m_canvasLimit
Maximum canvases to draw.
void fillTruthSeedPoints(const EventContext &ctx, const DisplayView view, PlotLegend &legend, Canvas_t &canvas) const
Add the truth segments to the canvas.
Gaudi::Property< std::string > m_canvasPrefix
Prefix of the individual canvas file names <MANDATORY>.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
virtual StatusCode initialize() override final
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Declare the data dependency on the standard Mdt+Rpc+Tgc segment container & on the NSW segment contai...
std::atomic< unsigned > m_objCounter
How many obj have been produced.
ServiceHandle< IRootVisualizationService > m_visualSvc
Service handle of the visualization service.
std::atomic< bool > m_plotsDone
Flag toggling whether all Canvases have been exhausted.
virtual void displayTrackSeedObj(const EventContext &ctx, const MuonR4::MsTrackSeed &seed, const OptBoundPars_t &parsToExt, const std::string &objName="") const override final
Visualizes the measurements of the segments on the track seed together with their predicted local lin...
IRootVisualizationService::ClientToken m_clientToken
Token to present to the visualization service such that the display froms this tool are grouped toget...
IRootVisualizationService::ICanvasObject Canvas_t
static Amg::Vector2D viewVector(const double phi, const Amg::Vector2D &posOnCylinder, const DisplayView view)
Transforms the projected vector into the actual view, if it's xy then an external phi is needed to pl...
Gaudi::Property< bool > m_saveSinglePDFs
If set to true each canvas is saved into a dedicated pdf file.
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Dependency on the geometry alignment.
Gaudi::Property< std::string > m_subDir
Define the subdirectory in which the plots shall be saved.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_truthSegKey
Key to the truth segment selection to draw the segment parameters.
ToolHandle< MuonR4::ITrackSeedingDiagnosticsTool > m_seedingTool
The track seeding tool to construct the seed candidates and to estimate the initial parameters.
DisplayView
Enumeration to toggle whether the seeds shall be painted in x-y or R-z view.
void displaySeedSegmentsGlobalWithTruth(const EventContext &ctx, const DisplayView view, const MuonR4::MsTrackSeedContainer &seeds) const
Gaudi::Property< bool > m_saveSummaryPDF
If set to true a summary Canvas is created.
MuonR4::MsTrackSeed::Location Location
Enumeration to toggle whether the segment shall displayed on the barrel/endcap.
virtual void displaySeeds(const EventContext &ctx, const MuonR4::MsTrackSeedContainer &seeds) const override final
Displays all segments on the representative cylinder in the R-Z & X-Y plane and draws the markers of ...
double sectorPhi(int sector) const
returns the centeral phi position of a sector in radians
double sectorWidth(int sector) const
sector width (with overlap) in radians
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
int r
Definition globals.cxx:22
std::string label(const std::string &format, int i)
Definition label.h:19
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
std::vector< MsTrackSeed > MsTrackSeedContainer
Definition MsTrackSeed.h:69
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
void ensureDirectory(const std::string &path)
Ensures that the subdirectory in the path is created.
void drawSegmentMeasurements(const Acts::GeometryContext &tgContext, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewSensitive)
Draw all uncalibrated measurements associated to the segment.
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const double textSize=18, const bool useNDC=true, const int color=kBlack)
Create a TLatex label,.
std::vector< std::unique_ptr< TObject > > clone(const std::vector< std::unique_ptr< TObject > > &cloneMe)
int seedColorIdx(std::size_t iSeed)
void drawPropagation(const std::vector< Acts::detail::Step > &steps, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine)
Draws the recorded propagation steps as a polygon line.
void drawSegmentLine(const Acts::GeometryContext &tgContext, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=1.*Gaudi::Units::m)
Draw a segment line inside the obj file.
constexpr int fullFilling
std::string removeNonAlphaNum(std::string str)
Removes all non-alpha numerical characters from a string.
std::unique_ptr< TBox > drawBox(const Amg::Vector3D &boxCenter, const double boxWidth, const double boxHeight, const int color=kGreen+2, const int fillStyle=hollowFilling, const int view=objViewEta)
Creates a box for drawing, e.g strip measurements.
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
LayerIndex
enum to classify the different layers in the muon spectrometer
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Helper to simultaneously calculate sin and cos of the same angle.
Definition sincos.h:39
Helper struct to administer the markers & colors that are added to the legend.
void fillPrimitives(Canvas_t &canvas)
Add the primitives of the legend to the Canvas.
void addColor(const int color, const std::string &label)
Add new color legend entry.
void addMarker(const int marker, const std::string &label, const int color=kBlack)
Add new Marker style to the legend entry.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10