ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonValR4::PatternVisualizationTool Class Reference

#include <PatternVisualizationTool.h>

Inheritance diagram for MuonValR4::PatternVisualizationTool:
Collaboration diagram for MuonValR4::PatternVisualizationTool:

Public Types

using LabeledSegmentSet = std::unordered_set< const xAOD::MuonSegment * >
 

Public Member Functions

virtual StatusCode initialize () override final
 
virtual void visualizeBucket (const EventContext &ctx, const MuonR4::SpacePointBucket &bucket, const std::string &extraLabel) const override final
 
virtual void visualizeBucket (const EventContext &ctx, const MuonR4::SpacePointBucket &bucket, const std::string &extraLabel, PrimitiveVec &&extraPaints) const override final
 
virtual void visualizeSeed (const EventContext &ctx, const MuonR4::SegmentSeed &seed, const std::string &extraLabel) const override final
 
virtual void visualizeSeed (const EventContext &ctx, const MuonR4::SegmentSeed &seed, const std::string &extraLabel, PrimitiveVec &&extraPaints) const override final
 
virtual void visualizeAccumulator (const EventContext &ctx, const MuonR4::HoughPlane &accumulator, const Acts::HoughTransformUtils::HoughAxisRanges &axisRanges, const MaximumVec &maxima, const std::string &extraLabel) const override final
 
virtual void visualizeAccumulator (const EventContext &ctx, const MuonR4::HoughPlane &accumulator, const Acts::HoughTransformUtils::HoughAxisRanges &axisRanges, const MaximumVec &maxima, const std::string &extraLabel, PrimitiveVec &&extraPaints) const override final
 
virtual void visualizeSegment (const EventContext &ctx, const MuonR4::Segment &segment, const std::string &extraLabel) const override final
 
virtual void visualizeSegment (const EventContext &ctx, const MuonR4::Segment &segment, const std::string &extraLabel, PrimitiveVec &&extraPaints) const override final
 
virtual LabeledSegmentSet getLabeledSegments (const std::vector< const MuonR4::SpacePoint * > &hits) const override final
 Returns whether the hit has been used on the labeled segments we refer to (e.g. More...
 
virtual LabeledSegmentSet getLabeledSegments (const std::vector< const xAOD::UncalibratedMeasurement * > &hits) const override final
 
virtual bool isLabeled (const MuonR4::SpacePoint &hit) const override final
 Fetches all labeled (e.g. More...
 
virtual bool isLabeled (const xAOD::UncalibratedMeasurement &hit) const override final
 
template<class SpacePointType >
const SpacePointdrawHit (const SpacePointType &hit, Canvas_t &canvas, const unsigned int view, unsigned int fillStyle) const
 

Private Types

using Canvas_t = IRootVisualizationService::ICanvasObject
 
using Edges = Canvas_t::AxisRanges
 
using SegLink_t = ElementLink< xAOD::MuonSegmentContainer >
 
using SegLinkVec_t = std::vector< SegLink_t >
 
using SegLinkDecor_t = SG::AuxElement::ConstAccessor< SegLinkVec_t >
 

Private Member Functions

template<class SpacePointType >
bool drawHits (const MuonR4::SpacePointBucket &bucket, const std::vector< SpacePointType > &hitsToDraw, Canvas_t &canvasDim, unsigned int view) const
 Translates the Spacepoint information into TObjects that are dawn on the canvas & evaluates the size of the box surrounding the event. More...
 
template<class SpacePointType >
const MuonR4::SpacePointdrawHit (const SpacePointType &hit, Canvas_t &canvas, const unsigned int view, unsigned int fillStyle) const
 Converts a Hit into a particular TBox/ TEllipse for drawing. More...
 
template<class SpacePointType >
void writeChi2 (const MuonR4::SegmentFit::Parameters &pars, const std::vector< SpacePointType > &hits, Canvas_t &canvas, const double legX=0.2, double startLegY=0.8, const double endLegY=0.3) const
 Writes the chi2 of the hits onto the Canvas. More...
 
void paintSimHits (const EventContext &ctx, const xAOD::MuonSegment &truthSeg, Canvas_t &canvas, const int view) const
 Paints the truth sim hits associated with the segment. More...
 

Private Attributes

ServiceHandle< IRootVisualizationServicem_visualSvc {this, "VisualSvc", "MuonValR4::RootVisualizationService"}
 Service handle of the visualization service. More...
 
IRootVisualizationService::ClientToken m_clientToken {}
 Token to present to the visualization service such that the display froms this tool are grouped together. More...
 
Gaudi::Property< unsigned int > m_canvasLimit {this, "CanvasLimits", 5000}
 Maximum canvases to draw. More...
 
Gaudi::Property< bool > m_saveSinglePDFs {this, "saveSinglePDFs", false}
 If set to true each canvas is saved into a dedicated pdf file. More...
 
Gaudi::Property< bool > m_saveSummaryPDF {this, "saveSummaryPDF", false}
 If set to true a summary Canvas is created. More...
 
Gaudi::Property< std::string > m_canvasPrefix {this, "CanvasPreFix", ""}
 Prefix of the individual canvas file names <MANDATORY>
More...
 
Gaudi::Property< std::string > m_subDir {this, "outSubDir", ""}
 Define the subdirectory in which the plots shall be saved. More...
 
Gaudi::Property< bool > m_displayBucket {this, "displayBucket", true}
 Display the surrounding hits from the bucket not part of the seed. More...
 
Gaudi::Property< bool > m_accumlIsEta {this, "AccumulatorsInEtaPlane", true}
 Swtich toggling whether the accumulator view are in the eta or phi plane. More...
 
Gaudi::Property< bool > m_doEtaBucketViews {this,"doEtaBucketViews", true}
 Switch to visualize the eta view of the bucket event. More...
 
Gaudi::Property< bool > m_doPhiBucketViews {this,"doPhiBucketViews", false}
 Switch to visualize the phi view of the bucket event. More...
 
Gaudi::Property< bool > m_paintTruthHits {this, "paintTruthHits", false}
 Switch to visualize the truth hits
More...
 
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainerm_prepContainerKeys {this, "PrdContainer", {}}
 Declare dependency on the prep data containers. More...
 
Gaudi::Property< std::set< std::string > > m_truthSegLinks {this, "TruthSegDecors", {}}
 List of truth segment links to fetch. More...
 
SG::ReadDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainerm_truthLinkDecorKeys {this, "LinkDecorKeys", {}}
 Declaration of the dependency on the decorations. More...
 
std::vector< SegLinkDecor_tm_truthLinkDecors {}
 
Gaudi::Property< bool > m_displayOnlyTruth {this, "displayTruthOnly", false}
 
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 pointer to the Detector manager More...
 
SG::ReadHandleKey< ActsTrk::GeometryContextm_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
 Geometry context key to retrieve the alignment. More...
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 Service Handle to the IMuonIdHelperSvc. More...
 
std::atomic< bool > m_plotsDone {false}
 Flag toggling whether all Canvases have been exhausted. More...
 

Detailed Description

Definition at line 28 of file PatternVisualizationTool.h.

Member Typedef Documentation

◆ Canvas_t

Definition at line 89 of file PatternVisualizationTool.h.

◆ Edges

Definition at line 90 of file PatternVisualizationTool.h.

◆ LabeledSegmentSet

Definition at line 77 of file PatternVisualizationTool.h.

◆ SegLink_t

Definition at line 178 of file PatternVisualizationTool.h.

◆ SegLinkDecor_t

Definition at line 180 of file PatternVisualizationTool.h.

◆ SegLinkVec_t

Definition at line 179 of file PatternVisualizationTool.h.

Member Function Documentation

◆ drawHit() [1/2]

template<class SpacePointType >
const MuonR4::SpacePoint* MuonValR4::PatternVisualizationTool::drawHit ( const SpacePointType &  hit,
Canvas_t canvas,
const unsigned int  view,
unsigned int  fillStyle 
) const
private

Converts a Hit into a particular TBox/ TEllipse for drawing.

If the hit provides information that's requested for that view. The underlying space pointer is returned and the dimensions of the canvas are updated, if the drawing was succesful

Parameters
hitReference to the hit to draw
canvasReference to the Canvas object to which the drawn hits are appended. The drawn hits also expand the drawn range
viewDraw the hit either in the eta or phi view,
fillStyleStandard fill style for the box e.g. full.

◆ drawHit() [2/2]

template<class SpacePointType >
const SpacePoint* MuonValR4::PatternVisualizationTool::drawHit ( const SpacePointType &  hit,
Canvas_t canvas,
const unsigned int  view,
unsigned int  fillStyle 
) const

Don't draw any hit which is not participating in the view

Update the fill style accrodingly

Definition at line 407 of file PatternVisualizationTool.cxx.

409  {
410 
412  if ((view == objViewEta && !hit.measuresEta()) || (view == objViewPhi && !hit.measuresPhi())) {
413  return nullptr;
414  }
415 
416  if (hit.type() != xAOD::UncalibMeasType::Other) {
417  canvas.expandPad(hit.localPosition()[view] - hit.driftRadius(),
418  hit.localPosition().z() - hit.driftRadius());
419  canvas.expandPad(hit.localPosition()[view] + hit.driftRadius(),
420  hit.localPosition().z() + hit.driftRadius());
421  }
422 
423  const SpacePoint* underlyingSp{nullptr};
425  constexpr int invalidCalibFill = 3305;
426  if constexpr (std::is_same_v<SpacePointType, SpacePoint>) {
427  underlyingSp = &hit;
428  if (hit.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
429  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(hit.primaryMeasurement());
431  fillStyle = invalidCalibFill;
432  }
433  }
434  } else if constexpr(std::is_same_v<SpacePointType, CalibratedSpacePoint>) {
435  underlyingSp = hit.spacePoint();
436  if (hit.fitState() == CalibratedSpacePoint::State::Valid) {
437  fillStyle = fullFilling;
438  } else if (hit.fitState() == CalibratedSpacePoint::State::FailedCalib) {
439  fillStyle = invalidCalibFill;
440  } else {
441  fillStyle = hatchedFilling;
442  }
443  }
444  switch(hit.type()) {
446  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(underlyingSp->primaryMeasurement());
447  canvas.add(drawDriftCircle(hit.localPosition(), dc->readoutElement()->innerTubeRadius(),
448  kBlack, hollowFilling));
449 
450  const int circColor = isLabeled(*dc) ? truthColor : kBlue;
451  canvas.add(drawDriftCircle(hit.localPosition(), hit.driftRadius(), circColor, fillStyle));
452  break;
454  const auto* meas{static_cast<const xAOD::RpcMeasurement*>(underlyingSp->primaryMeasurement())};
455  const int boxColor = isLabeled(*meas) ? truthColor : kGreen +2;
456  const double boxWidth = 0.5*std::sqrt(12)*std::sqrt(underlyingSp->covariance()[view]);
457  canvas.add(drawBox(hit.localPosition(), boxWidth, 0.5*meas->readoutElement()->gasGapPitch(),
458  boxColor, fillStyle));
459  break;
461  const auto* meas{static_cast<const xAOD::TgcStrip*>(underlyingSp->primaryMeasurement())};
462  const int boxColor = isLabeled(*meas) ? truthColor : kCyan + 2;
463  const double boxWidth = 0.5*std::sqrt(12)*std::sqrt(underlyingSp->covariance()[view]);
464  canvas.add(drawBox(hit.localPosition(), boxWidth, 0.5*meas->readoutElement()->gasGapPitch(),
465  boxColor, fillStyle));
466  break;
468  const int boxColor = isLabeled(*underlyingSp->primaryMeasurement()) ? truthColor : kAquamarine;
469  const double boxWidth = 5*Gaudi::Units::mm;
470  canvas.add(drawBox(hit.localPosition(), boxWidth, 10.*Gaudi::Units::mm, boxColor, fillStyle));
471  break;
473  break;
475  const int boxColor = isLabeled(*underlyingSp->primaryMeasurement()) ? truthColor : kTeal;
476  const double boxWidth = 5*Gaudi::Units::mm;
477  canvas.add(drawBox(hit.localPosition(), boxWidth, 10.*Gaudi::Units::mm, boxColor, fillStyle));
478  break;
479  } default: {
480  ATH_MSG_WARNING("Please implement proper drawings of the new small wheel.. "<<__FILE__<<":"<<__LINE__);
481  break;
482  }
483  }
484  return underlyingSp;
485  }

◆ drawHits()

template<class SpacePointType >
bool MuonValR4::PatternVisualizationTool::drawHits ( const MuonR4::SpacePointBucket bucket,
const std::vector< SpacePointType > &  hitsToDraw,
Canvas_t canvasDim,
unsigned int  view 
) const
private

Translates the Spacepoint information into TObjects that are dawn on the canvas & evaluates the size of the box surrounding the event.

Returns true if at least 2 objects were created.

Parameters
bucketSpacePoint bucket from which the hits are taken. If the <DisplayBucket> is set true, the hits that were not in the subset are also painted with hollow filling
hitsToDrawPrimary hit collection to draw which are drawn with fullFillStyle
canvasReference to the Canvas object to which the drawn hits are appended. The drawn hits also expand the drawn range
viewEither the eta or the phi view?

Definition at line 488 of file PatternVisualizationTool.cxx.

491  {
492 
493  SpacePointSet drawnPoints{};
494  for (const SpacePointType& hit : hitsToDraw) {
495  drawnPoints.insert(drawHit(*hit, canvas, view, fullFilling));
496  }
497  if (m_displayBucket) {
498  for (const SpacePointBucket::value_type& hit : bucket) {
499  // Don't redraw the other points
500  if (drawnPoints.count(hit.get())) {
501  continue;
502  }
503  drawHit(*hit, canvas, view, hollowFilling);
504  }
505  }
506  return drawnPoints.size() - drawnPoints.count(nullptr) > 1;
507  }

◆ getLabeledSegments() [1/2]

LabeledSegmentSet MuonValR4::PatternVisualizationTool::getLabeledSegments ( const std::vector< const MuonR4::SpacePoint * > &  hits) const
finaloverridevirtual

Returns whether the hit has been used on the labeled segments we refer to (e.g.

truth or data Zµµ)

Parameters
hitsVector of hits to search

Definition at line 87 of file PatternVisualizationTool.cxx.

87  {
88  std::vector<const xAOD::UncalibratedMeasurement*> measurements{};
89  measurements.reserve(2* hits.size());
90  for (const SpacePoint* hit: hits) {
91  measurements.push_back(hit->primaryMeasurement());
92  if(hit->secondaryMeasurement()) {
93  measurements.push_back(hit->secondaryMeasurement());
94  }
95  }
96  return getLabeledSegments(measurements);
97  }

◆ getLabeledSegments() [2/2]

LabeledSegmentSet MuonValR4::PatternVisualizationTool::getLabeledSegments ( const std::vector< const xAOD::UncalibratedMeasurement * > &  hits) const
finaloverridevirtual

Definition at line 98 of file PatternVisualizationTool.cxx.

98  {
99  LabeledSegmentSet truthSegs{};
100  for (const xAOD::UncalibratedMeasurement* hit : hits) {
101  for (const SegLinkDecor_t& decor: m_truthLinkDecors) {
102  for (const SegLink_t& link : decor(*hit)) {
103  truthSegs.insert(*link);
104  }
105  }
106  }
107  return truthSegs;
108  }

◆ initialize()

StatusCode MuonValR4::PatternVisualizationTool::initialize ( )
finaloverridevirtual

Definition at line 42 of file PatternVisualizationTool.cxx.

42  {
43  if (m_canvasLimit > 0) {
49  ATH_CHECK(m_visualSvc.retrieve());
50  ATH_CHECK(m_visualSvc->registerClient(m_clientToken));
51  } else {
52  m_plotsDone = true;
53  }
54  ATH_CHECK(m_prepContainerKeys.initialize(!m_truthSegLinks.empty()));
55  m_truthLinkDecorKeys.clear();
56  ATH_MSG_INFO("Hits linked to the following segment decorations are considered as truth");
57  for (const std::string& decorName : m_truthSegLinks) {
58  ATH_MSG_INFO(" **** "<<decorName);
59  if (decorName.empty()) {
60  ATH_MSG_FATAL("Decoration must not be empty");
61  return StatusCode::FAILURE;
62  }
64  m_truthLinkDecorKeys.emplace_back(key, decorName);
65  m_truthLinkDecors.push_back(SegLinkDecor_t{decorName});
66  }
67  }
68  ATH_CHECK(m_truthLinkDecorKeys.initialize());
69  m_displayOnlyTruth.value() &= !m_truthLinkDecorKeys.empty();
70 
71  ATH_CHECK(m_idHelperSvc.retrieve());
74  return StatusCode::SUCCESS;
75  }

◆ isLabeled() [1/2]

bool MuonValR4::PatternVisualizationTool::isLabeled ( const MuonR4::SpacePoint hit) const
finaloverridevirtual

Fetches all labeled (e.g.

by truth or Zµµ reco) segments containing at least one measurement in the list passed as arg

Parameters
hitReference to the hit to check

Definition at line 76 of file PatternVisualizationTool.cxx.

76  {
77  return isLabeled(*hit.primaryMeasurement()) ||
79  }

◆ isLabeled() [2/2]

bool MuonValR4::PatternVisualizationTool::isLabeled ( const xAOD::UncalibratedMeasurement hit) const
finaloverridevirtual

Definition at line 80 of file PatternVisualizationTool.cxx.

80  {
81  return std::find_if(m_truthLinkDecors.begin(), m_truthLinkDecors.end(),
82  [&hit](const SegLinkDecor_t& decor){
83  return !decor(hit).empty();
84  }) != m_truthLinkDecors.end();
85  }

◆ paintSimHits()

void MuonValR4::PatternVisualizationTool::paintSimHits ( const EventContext &  ctx,
const xAOD::MuonSegment truthSeg,
Canvas_t canvas,
const int  view 
) const
private

Paints the truth sim hits associated with the segment.

Hits are drawn as orange arrows

Parameters
ctxEventContext to fetch the alignment constants
truthSegSegment made from truth sim hits
canvasReference to the Canvas object to which the drawn hits are appended
viewDraw the hit either in the eta or phi view

Definition at line 200 of file PatternVisualizationTool.cxx.

203  {
204  if (!m_paintTruthHits) {
205  return;
206  }
207  auto truthHits = getMatchingSimHits(truthSeg);
208  const ActsTrk::GeometryContext* geoCtx{nullptr};
209  if (!SG::get(geoCtx, m_geoCtxKey, ctx).isSuccess()) {
210  return;
211  }
212  for (const xAOD::MuonSimHit* simHit : truthHits) {
213  const MuonGMR4::MuonReadoutElement* re = m_detMgr->getReadoutElement(simHit->identify());
214  const IdentifierHash hash = re->detectorType() == ActsTrk::DetectorType::Mdt ?
215  re->measurementHash(simHit->identify()) :
216  re->layerHash(simHit->identify());
217  const Amg::Transform3D trf = re->msSector()->globalToLocalTrans(*geoCtx) *
218  re->localToGlobalTrans(*geoCtx, hash);
219  const Amg::Vector3D locPos = trf * xAOD::toEigen(simHit->localPosition());
220  const Amg::Vector3D locDir = trf.linear() * xAOD::toEigen(simHit->localDirection());
221  canvas.add(drawArrow(locPos, locDir, truthColor, kDashed, view));
222  }
223  }

◆ visualizeAccumulator() [1/2]

void MuonValR4::PatternVisualizationTool::visualizeAccumulator ( const EventContext &  ctx,
const MuonR4::HoughPlane accumulator,
const Acts::HoughTransformUtils::HoughAxisRanges &  axisRanges,
const MaximumVec &  maxima,
const std::string &  extraLabel 
) const
finaloverridevirtual

Definition at line 129 of file PatternVisualizationTool.cxx.

133  {
134  PrimitiveVec primitives{};
135  visualizeAccumulator(ctx, accumulator, axisRanges, maxima, extraLabel, std::move(primitives));
136  }

◆ visualizeAccumulator() [2/2]

void MuonValR4::PatternVisualizationTool::visualizeAccumulator ( const EventContext &  ctx,
const MuonR4::HoughPlane accumulator,
const Acts::HoughTransformUtils::HoughAxisRanges &  axisRanges,
const MaximumVec &  maxima,
const std::string &  extraLabel,
PrimitiveVec &&  extraPaints 
) const
finaloverridevirtual

Check whether the canvas limit has been reached

Definition at line 137 of file PatternVisualizationTool.cxx.

142  {
143 
145  if (m_plotsDone) {
146  return;
147  }
148  if (accumulator.getNonEmptyBins().empty()) {
149  ATH_MSG_WARNING("Hough accumulator is empty");
150  return;
151  }
152 
153  auto accHisto = std::make_unique<TH2F>("AccumulatorHisto", "histo",
154  accumulator.nBinsX(), axisRanges.xMin, axisRanges.xMax,
155  accumulator.nBinsY(), axisRanges.yMin, axisRanges.yMax);
156  accHisto->SetDirectory(nullptr);
157 
158  std::vector<const SpacePoint*> spacePointsInAcc{};
159  for (const std::size_t bin : accumulator.getNonEmptyBins()) {
160  const auto [xBin, yBin] = accumulator.axisBins(bin);
161  auto hitIds = accumulator.hitIds(xBin, yBin);
162  spacePointsInAcc.insert(spacePointsInAcc.end(),hitIds.begin(), hitIds.end());
163  accHisto->SetBinContent(xBin+1, yBin+1, accumulator.nHits(bin));
164  }
165 
166  const LabeledSegmentSet truthSegs{getLabeledSegments(spacePointsInAcc)};
167  if (truthSegs.empty() && m_displayOnlyTruth) {
168  return;
169  }
170  auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, extraLabel);
171  if (!canvas){
172  m_plotsDone = true;
173  return;
174  }
175  canvas->expandPad(axisRanges.xMin, axisRanges.yMin);
176  canvas->expandPad(axisRanges.xMax, axisRanges.yMax);
177  canvas->setAxisTitles(std::format("tan#{}", m_accumlIsEta ? "beta" : "#alpha"),
178  std::format("{:}_{{0}} [mm]", m_accumlIsEta ? "y" : "x"));
179  canvas->add(std::move(accHisto), "HIST SAME");
180 
181  for (const xAOD::MuonSegment* segment : truthSegs) {
182  const auto [pos, dir] = makeLine(localSegmentPars(*segment));
183  const double tan = m_accumlIsEta ? houghTanBeta(dir) : houghTanAlpha(dir);
184  const double icept = pos[m_accumlIsEta ? objViewEta : objViewPhi];
185  auto truthMarker = std::make_unique<TMarker>(tan, icept, kFullCrossX);
186  truthMarker->SetMarkerColor(truthColor);
187  truthMarker->SetMarkerSize(8);
188  canvas->add(std::move(truthMarker));
189  canvas->add(drawLabel(std::format("true parameters: {:}",
190  makeLabel(localSegmentPars(*segment))),0.2, 0.9));
191  }
192  for (const auto& maximum : maxima) {
193  auto maxMarker = std::make_unique<TMarker>(maximum.x, maximum.y, kFullTriangleUp);
194  maxMarker->SetMarkerColor(parLineColor);
195  maxMarker->SetMarkerSize(8);
196  canvas->add(std::move(maxMarker));
197  }
198  canvas->add(std::move(primitives));
199  }

◆ visualizeBucket() [1/2]

void MuonValR4::PatternVisualizationTool::visualizeBucket ( const EventContext &  ctx,
const MuonR4::SpacePointBucket bucket,
const std::string &  extraLabel 
) const
finaloverridevirtual

Definition at line 283 of file PatternVisualizationTool.cxx.

285  {
286  PrimitiveVec primitives{};
287  visualizeBucket(ctx, bucket, extraLabel, std::move(primitives));
288  }

◆ visualizeBucket() [2/2]

void MuonValR4::PatternVisualizationTool::visualizeBucket ( const EventContext &  ctx,
const MuonR4::SpacePointBucket bucket,
const std::string &  extraLabel,
PrimitiveVec &&  extraPaints 
) const
finaloverridevirtual

Check whether the canvas limit has been reached

reset the primitives

Definition at line 289 of file PatternVisualizationTool.cxx.

292  {
294  if (m_plotsDone) {
295  return;
296  }
297 
298  LabeledSegmentSet truthSegs{getLabeledSegments(Acts::unpackConstSmartPointers(bucket))};
299  if (truthSegs.empty() && m_displayOnlyTruth) {
300  return;
301  }
302  auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, extraLabel);
303  if (!canvas){
304  m_plotsDone = true;
305  return;
306  }
307  canvas->add(std::move(primitives));
308 
309  for (const int view : {objViewEta, objViewPhi}) {
310  if ((view == objViewEta && !m_doEtaBucketViews) ||
312  continue;
313  }
314  canvas->setAxisTitles(std::format("{:} [mm]", view == objViewEta ? 'y' : 'x'), "z [mm]");
316  if (!drawHits(bucket, bucket, *canvas, view)) {
317  continue;
318  }
319  bool drawnTrueLabel{false};
320  for (const xAOD::MuonSegment* segment : truthSegs) {
321  canvas->add(drawLine(localSegmentPars(*segment),
322  canvas->corner(Edges::yLow), canvas->corner(Edges::yHigh),
323  truthColor, kDotted, view));
324  if (!drawnTrueLabel) {
325  canvas->add(drawLabel(std::format("true parameters: {:}",makeLabel(localSegmentPars(*segment))),0.2, 0.89));
326  drawnTrueLabel = true;
327  }
328  paintSimHits(ctx,*segment, *canvas, view);
329  }
330 
331  std::string legendLabel = std::format("Event: {:}, chamber : {:}, #{:}-view ({:})",
332  ctx.eventID().event_number(),
333  bucket.msSector()->identString(),
334  view ==objViewEta ? "eta" : "phi",
335  extraLabel);
336  canvas->add(drawLabel(legendLabel, 0.15, 0.96));
337  }
338  }

◆ visualizeSeed() [1/2]

void MuonValR4::PatternVisualizationTool::visualizeSeed ( const EventContext &  ctx,
const MuonR4::SegmentSeed seed,
const std::string &  extraLabel 
) const
finaloverridevirtual

Definition at line 224 of file PatternVisualizationTool.cxx.

226  {
227  PrimitiveVec primitives{};
228  visualizeSeed(ctx, seed, extraLabel, std::move(primitives));
229  }

◆ visualizeSeed() [2/2]

void MuonValR4::PatternVisualizationTool::visualizeSeed ( const EventContext &  ctx,
const MuonR4::SegmentSeed seed,
const std::string &  extraLabel,
PrimitiveVec &&  extraPaints 
) const
finaloverridevirtual

Check whether the canvas limit has been reached

Definition at line 230 of file PatternVisualizationTool.cxx.

233  {
234 
236  if (m_plotsDone) {
237  return;
238  }
239  const LabeledSegmentSet truthSegs{getLabeledSegments(seed.getHitsInMax())};
240  if (truthSegs.empty() && m_displayOnlyTruth) {
241  return;
242  }
243 
244  auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, extraLabel);
245  if (!canvas) {
246  m_plotsDone = true;
247  return;
248  }
249  canvas->add(std::move(primitives));
250 
251 
252  for (const int view : {objViewEta, objViewPhi}) {
253  if ((view == objViewEta && !m_doEtaBucketViews) ||
255  continue;
256  }
257  canvas->setAxisTitles(std::format("{:} [mm]", view == objViewEta ? 'y' : 'x'), "z [mm]");
258 
259  if (!drawHits(*seed.parentBucket(), seed.getHitsInMax(), *canvas, view)) {
260  continue;
261  }
262  for (const xAOD::MuonSegment* segment : truthSegs) {
263  canvas->add(drawLine(localSegmentPars(*segment),
264  canvas->corner(Edges::yLow), canvas->corner(Edges::yHigh),
265  truthColor, kDotted, view));
266  paintSimHits(ctx,*segment, *canvas, view);
267  }
268  canvas->add(drawLine(seed.parameters(), canvas->corner(Edges::yLow),
269  canvas->corner(Edges::yHigh), parLineColor, kDashed, view));
270 
271  writeChi2(seed.parameters(), seed.getHitsInMax(), *canvas);
272 
273  std::string legendLabel = std::format("Event: {:}, chamber : {:}, #{:}-view ({:})",
274  ctx.eventID().event_number(),
275  m_idHelperSvc->toStringChamber(seed.getHitsInMax().front()->identify()),
276  view ==objViewEta ? "eta" : "phi",
277  extraLabel);
278  canvas->add(drawLabel(legendLabel, 0.1, 0.96));
279  canvas->add(drawLabel(makeLabel(seed.parameters()),0.25, 0.89));
280  }
281  }

◆ visualizeSegment() [1/2]

void MuonValR4::PatternVisualizationTool::visualizeSegment ( const EventContext &  ctx,
const MuonR4::Segment segment,
const std::string &  extraLabel 
) const
finaloverridevirtual

Definition at line 340 of file PatternVisualizationTool.cxx.

342  {
343  PrimitiveVec primitives{};
344  visualizeSegment(ctx, segment,extraLabel, std::move(primitives));
345  }

◆ visualizeSegment() [2/2]

void MuonValR4::PatternVisualizationTool::visualizeSegment ( const EventContext &  ctx,
const MuonR4::Segment segment,
const std::string &  extraLabel,
PrimitiveVec &&  extraPaints 
) const
finaloverridevirtual

Check whether the canvas limit has been reached

Definition at line 347 of file PatternVisualizationTool.cxx.

350  {
352  if (m_plotsDone) {
353  return;
354  }
355 
356  const LabeledSegmentSet truthSegs{getLabeledSegments(segment.parent()->getHitsInMax())};
357  if (truthSegs.empty() && m_displayOnlyTruth) {
358  return;
359  }
360  const ActsTrk::GeometryContext* geoCtx{nullptr};
361  if (!SG::get(geoCtx, m_geoCtxKey, ctx).isSuccess()) {
362  return;
363  }
364  auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, extraLabel);
365  if (!canvas) {
366  m_plotsDone = true;
367  return;
368  }
369  canvas->add(std::move(primitives));
370 
371 
372  const Parameters segPars = SegmentFit::localSegmentPars(*geoCtx, segment);
373 
374  for (const int view : {objViewEta, objViewPhi}) {
375  if ((view == objViewEta && !m_doEtaBucketViews) ||
377  continue;
378  }
379  canvas->setAxisTitles(std::format("{:} [mm]", view == objViewEta ? 'y' : 'x'), "z [mm]");
380  if (!drawHits(*segment.parent()->parentBucket(), segment.measurements(),
381  *canvas, view)) {
382  continue;
383  }
384  for (const xAOD::MuonSegment* segment : truthSegs) {
385  canvas->add(drawLine(localSegmentPars(*segment), canvas->corner(Edges::yLow), canvas->corner(Edges::yHigh),
386  truthColor, kDotted, view));
387  paintSimHits(ctx,*segment, *canvas, view);
388  }
389  writeChi2(segPars, segment.measurements(), *canvas);
390 
391  canvas->add(drawLine(segPars, canvas->corner(Edges::yLow), canvas->corner(Edges::yHigh),
392  parLineColor, kDashed, view));
393 
394  const Identifier canvasId{segment.parent()->getHitsInMax().front()->identify()};
395  std::string legendLabel=std::format("Event: {:}, chamber: {:}, #chi^{{2}} / nDoF: {:.2f} ({:d}), #{:}-view (:)",
396  ctx.eventID().event_number(), m_idHelperSvc->toStringChamber(canvasId),
397  segment.chi2() /std::max(1u, segment.nDoF()), segment.nDoF(),
398  view ==objViewEta ? "eta" : "phi", extraLabel);
399 
400  canvas->add(drawLabel(legendLabel, 0.2, 0.96));
401  canvas->add(drawLabel(makeLabel(segPars),0.25, 0.91));
402  }
403  }

◆ writeChi2()

template<class SpacePointType >
void MuonValR4::PatternVisualizationTool::writeChi2 ( const MuonR4::SegmentFit::Parameters pars,
const std::vector< SpacePointType > &  hits,
Canvas_t canvas,
const double  legX = 0.2,
double  startLegY = 0.8,
const double  endLegY = 0.3 
) const
private

Writes the chi2 of the hits onto the Canvas.

Parameters
parsParameter for which the chi2 is evaluated,
hitsVector of hits to consider
canvasReference to the Canvas object to which the drawn hits are appended
legXx-position of the list
statLegYy-position of the first entry. The next one is 0.05 apart
endLegy-position of the last shown entry. The routine aborts if there're more hits in the event.

Definition at line 509 of file PatternVisualizationTool.cxx.

513  {
514  const auto [pos, dir] = makeLine(pars);
515 
516  for (const SpacePointType& hit : hits) {
517  const SpacePoint* underlyingSp{nullptr};
518  bool displayChi2{true};
519  if constexpr(std::is_same_v<SpacePointType, Segment::MeasType>) {
520  underlyingSp = hit->spacePoint();
521  displayChi2 = (hit->fitState() == CalibratedSpacePoint::State::Valid);
522  } else {
523  underlyingSp = hit;
524  }
525  const Identifier hitId = underlyingSp ? underlyingSp->identify(): Identifier{};
526  std::string legendstream{};
527  switch(hit->type()) {
529  const int driftSign{SeedingAux::strawSign(pos, dir, *hit)};
530  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
531  legendstream = std::format("ML: {:1d}, TL: {:1d}, T: {:3d}, {:}",
532  idHelper.multilayer(hitId), idHelper.tubeLayer(hitId),
533  idHelper.tube(hitId), driftSign == -1 ? "L" : "R");
534  break;
536  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
537  legendstream= std::format("DR: {:1d}, DZ: {:1d}, GAP: {:1d}, #eta/#phi: {:}/{:}",
538  idHelper.doubletR(hitId), idHelper.doubletZ(hitId), idHelper.gasGap(hitId),
539  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
540  break;
542  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
543  legendstream = std::format("ST: {:}, GAP: {:1d}, #eta/#phi: {:}/{:}",
544  m_idHelperSvc->stationNameString(hitId), idHelper.gasGap(hitId),
545  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
546  break;
548  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
549  const auto* clus = static_cast<const xAOD::MMCluster*>(underlyingSp->primaryMeasurement());
550  const MuonGMR4::StripDesign& design = clus->readoutElement()->stripLayer(clus->layerHash()).design();
551  legendstream = std::format("ML: {:1d}, GAP: {:1d}, {:}", idHelper.multilayer(hitId), idHelper.gasGap(hitId),
552  !design.hasStereoAngle() ? "X" : design.stereoAngle() > 0 ? "U" :"V");
553  break;
555  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
556  legendstream = std::format("ML: {:1d}, GAP: {:1d}, #eta/#phi: {:}/{:}",
557  idHelper.multilayer(hitId), idHelper.gasGap(hitId),
558  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
559  break;
561  legendstream = "Ext. constaint";
562  }
563  default:
564  break;
565  }
566  if (displayChi2) {
567  const double chi2 = SeedingAux::chi2Term(pos, dir,*hit);
568  legendstream+=std::format(", #chi^{{2}}: {:.2f}", chi2);
569  } else {
570  legendstream+=", #chi^{2}: ---";
571  }
572  canvas.add(drawLabel(legendstream, legX, startLegY, 14));
573  startLegY -= 0.05;
574  if (startLegY<= endLegY) {
575  break;
576  }
577  }
578  }

Member Data Documentation

◆ m_accumlIsEta

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_accumlIsEta {this, "AccumulatorsInEtaPlane", true}
private

Swtich toggling whether the accumulator view are in the eta or phi plane.

Just affects the axis labels

Definition at line 165 of file PatternVisualizationTool.h.

◆ m_canvasLimit

Gaudi::Property<unsigned int> MuonValR4::PatternVisualizationTool::m_canvasLimit {this, "CanvasLimits", 5000}
private

Maximum canvases to draw.

Definition at line 152 of file PatternVisualizationTool.h.

◆ m_canvasPrefix

Gaudi::Property<std::string> MuonValR4::PatternVisualizationTool::m_canvasPrefix {this, "CanvasPreFix", ""}
private

Prefix of the individual canvas file names <MANDATORY>

Definition at line 158 of file PatternVisualizationTool.h.

◆ m_clientToken

IRootVisualizationService::ClientToken MuonValR4::PatternVisualizationTool::m_clientToken {}
private

Token to present to the visualization service such that the display froms this tool are grouped together.

Definition at line 150 of file PatternVisualizationTool.h.

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonValR4::PatternVisualizationTool::m_detMgr {nullptr}
private

pointer to the Detector manager

Definition at line 186 of file PatternVisualizationTool.h.

◆ m_displayBucket

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_displayBucket {this, "displayBucket", true}
private

Display the surrounding hits from the bucket not part of the seed.

Definition at line 162 of file PatternVisualizationTool.h.

◆ m_displayOnlyTruth

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_displayOnlyTruth {this, "displayTruthOnly", false}
private

Definition at line 183 of file PatternVisualizationTool.h.

◆ m_doEtaBucketViews

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_doEtaBucketViews {this,"doEtaBucketViews", true}
private

Switch to visualize the eta view of the bucket event.

Definition at line 167 of file PatternVisualizationTool.h.

◆ m_doPhiBucketViews

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_doPhiBucketViews {this,"doPhiBucketViews", false}
private

Switch to visualize the phi view of the bucket event.

Definition at line 169 of file PatternVisualizationTool.h.

◆ m_geoCtxKey

SG::ReadHandleKey<ActsTrk::GeometryContext> MuonValR4::PatternVisualizationTool::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

Geometry context key to retrieve the alignment.

Definition at line 188 of file PatternVisualizationTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonValR4::PatternVisualizationTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Service Handle to the IMuonIdHelperSvc.

Definition at line 190 of file PatternVisualizationTool.h.

◆ m_paintTruthHits

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_paintTruthHits {this, "paintTruthHits", false}
private

Switch to visualize the truth hits

Definition at line 171 of file PatternVisualizationTool.h.

◆ m_plotsDone

std::atomic<bool> MuonValR4::PatternVisualizationTool::m_plotsDone {false}
mutableprivate

Flag toggling whether all Canvases have been exhausted.

Definition at line 192 of file PatternVisualizationTool.h.

◆ m_prepContainerKeys

SG::ReadHandleKeyArray<xAOD::UncalibratedMeasurementContainer> MuonValR4::PatternVisualizationTool::m_prepContainerKeys {this, "PrdContainer", {}}
private

Declare dependency on the prep data containers.

Definition at line 173 of file PatternVisualizationTool.h.

◆ m_saveSinglePDFs

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_saveSinglePDFs {this, "saveSinglePDFs", false}
private

If set to true each canvas is saved into a dedicated pdf file.

Definition at line 154 of file PatternVisualizationTool.h.

◆ m_saveSummaryPDF

Gaudi::Property<bool> MuonValR4::PatternVisualizationTool::m_saveSummaryPDF {this, "saveSummaryPDF", false}
private

If set to true a summary Canvas is created.

Definition at line 156 of file PatternVisualizationTool.h.

◆ m_subDir

Gaudi::Property<std::string> MuonValR4::PatternVisualizationTool::m_subDir {this, "outSubDir", ""}
private

Define the subdirectory in which the plots shall be saved.

Definition at line 160 of file PatternVisualizationTool.h.

◆ m_truthLinkDecorKeys

SG::ReadDecorHandleKeyArray<xAOD::UncalibratedMeasurementContainer> MuonValR4::PatternVisualizationTool::m_truthLinkDecorKeys {this, "LinkDecorKeys", {}}
private

Declaration of the dependency on the decorations.

(Overwritten in initialize)

Definition at line 177 of file PatternVisualizationTool.h.

◆ m_truthLinkDecors

std::vector<SegLinkDecor_t> MuonValR4::PatternVisualizationTool::m_truthLinkDecors {}
private

Definition at line 181 of file PatternVisualizationTool.h.

◆ m_truthSegLinks

Gaudi::Property<std::set<std::string> > MuonValR4::PatternVisualizationTool::m_truthSegLinks {this, "TruthSegDecors", {}}
private

List of truth segment links to fetch.

Definition at line 175 of file PatternVisualizationTool.h.

◆ m_visualSvc

ServiceHandle<IRootVisualizationService> MuonValR4::PatternVisualizationTool::m_visualSvc {this, "VisualSvc", "MuonValR4::RootVisualizationService"}
private

Service handle of the visualization service.

Definition at line 147 of file PatternVisualizationTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonValR4::PatternVisualizationTool::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
pointer to the Detector manager
Definition: PatternVisualizationTool.h:186
MuonValR4::fullFilling
constexpr int fullFilling
Definition: VisualizationHelpers.h:24
MuonValR4::IRootVisualizationService::ClientToken::preFixName
std::string preFixName
Prefix name of the saved Canvas.
Definition: IRootVisualizationService.h:41
MuonR4::PrimitiveVec
MuonValR4::IPatternVisualizationTool::PrimitiveVec PrimitiveVec
Definition: SegmentFittingAlg.cxx:24
MuonValR4::IRootVisualizationService::ClientToken::subDirectory
std::string subDirectory
Subdirectory in which the plots are written.
Definition: IRootVisualizationService.h:43
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MuonValR4::drawLine
std::unique_ptr< TLine > drawLine(const MuonR4::SegmentFit::Parameters &pars, const double lowEnd, const double highEnd, const int color=kRed+1, const int lineStyle=kDashed, const int view=objViewEta)
Draws a line from the segment fit parameters.
Definition: VisualizationHelpers.cxx:67
MuonR4::SegmentSeed::parentBucket
const SpacePointBucket * parentBucket() const
Returns the bucket out of which the seed was formed.
Definition: SegmentSeed.cxx:49
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
MuonGMR4::StripDesign::stereoAngle
double stereoAngle() const
Returns the value of the stereo angle.
xAOD::RpcMeasurement_v1
RpcMeasurement_v1: Class storing the geneic.
Definition: RpcMeasurement_v1.h:21
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonGMR4::StripDesign
Definition: StripDesign.h:30
MuonValR4::IRootVisualizationService::ICanvasObject::AxisRanges::yHigh
@ yHigh
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
MuonValR4::PatternVisualizationTool::m_subDir
Gaudi::Property< std::string > m_subDir
Define the subdirectory in which the plots shall be saved.
Definition: PatternVisualizationTool.h:160
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonValR4::PatternVisualizationTool::SegLinkDecor_t
SG::AuxElement::ConstAccessor< SegLinkVec_t > SegLinkDecor_t
Definition: PatternVisualizationTool.h:180
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonR4::SpacePointBucket::msSector
const MuonGMR4::SpectrometerSector * msSector() const
returns th associated muonChamber
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:33
TgcIdHelper
Definition: TgcIdHelper.h:50
MuonValR4::IRootVisualizationService::ClientToken::saveSinglePlots
bool saveSinglePlots
Save single plots.
Definition: IRootVisualizationService.h:47
MuonValR4::PatternVisualizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Service Handle to the IMuonIdHelperSvc.
Definition: PatternVisualizationTool.h:190
MuonValR4::PatternVisualizationTool::m_canvasPrefix
Gaudi::Property< std::string > m_canvasPrefix
Prefix of the individual canvas file names <MANDATORY>
Definition: PatternVisualizationTool.h:158
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
xAOD::TgcStrip_v1
Definition: TgcStrip_v1.h:19
MuonValR4::PatternVisualizationTool::drawHits
bool drawHits(const MuonR4::SpacePointBucket &bucket, const std::vector< SpacePointType > &hitsToDraw, Canvas_t &canvasDim, unsigned int view) const
Translates the Spacepoint information into TObjects that are dawn on the canvas & evaluates the size ...
Definition: PatternVisualizationTool.cxx:488
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
MuonR4::Segment::measurements
const MeasVec & measurements() const
Returns the associated measurements.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:49
MuonValR4::PatternVisualizationTool::m_clientToken
IRootVisualizationService::ClientToken m_clientToken
Token to present to the visualization service such that the display froms this tool are grouped toget...
Definition: PatternVisualizationTool.h:150
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
bin
Definition: BinsDiffFromStripMedian.h:43
MuonValR4::drawBox
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.
Definition: VisualizationHelpers.cxx:49
MuonValR4::PatternVisualizationTool::visualizeSegment
virtual void visualizeSegment(const EventContext &ctx, const MuonR4::Segment &segment, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:340
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonR4::SpacePoint::secondaryMeasurement
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:78
MuonR4::Segment::chi2
double chi2() const
Returns the chi2 of the segment fit.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:45
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
MuonValR4::PatternVisualizationTool::m_truthLinkDecorKeys
SG::ReadDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_truthLinkDecorKeys
Declaration of the dependency on the decorations.
Definition: PatternVisualizationTool.h:177
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
MuonValR4::PatternVisualizationTool::drawHit
const MuonR4::SpacePoint * drawHit(const SpacePointType &hit, Canvas_t &canvas, const unsigned int view, unsigned int fillStyle) const
Converts a Hit into a particular TBox/ TEllipse for drawing.
MuonR4::SegmentFit::makeLine
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
Definition: SegmentFitterEventData.cxx:35
MuonGMR4::SpectrometerSector::identString
std::string identString() const
Returns a string encoding the chamber index & the sector of the MS sector.
Definition: SpectrometerSector.cxx:66
MuonValR4::IRootVisualizationService::ICanvasObject::AxisRanges::yLow
@ yLow
MuonValR4::drawLabel
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
Definition: VisualizationHelpers.cxx:40
MuonValR4::PatternVisualizationTool::m_prepContainerKeys
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_prepContainerKeys
Declare dependency on the prep data containers.
Definition: PatternVisualizationTool.h:173
MuonValR4::PatternVisualizationTool::m_visualSvc
ServiceHandle< IRootVisualizationService > m_visualSvc
Service handle of the visualization service.
Definition: PatternVisualizationTool.h:147
MuonR4::Segment::nDoF
unsigned int nDoF() const
Returns the number of degrees of freedom.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:47
RpcIdHelper
Definition: RpcIdHelper.h:51
MuonValR4::PatternVisualizationTool::getLabeledSegments
virtual LabeledSegmentSet getLabeledSegments(const std::vector< const MuonR4::SpacePoint * > &hits) const override final
Returns whether the hit has been used on the labeled segments we refer to (e.g.
Definition: PatternVisualizationTool.cxx:87
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
MuonValR4::PatternVisualizationTool::m_displayOnlyTruth
Gaudi::Property< bool > m_displayOnlyTruth
Definition: PatternVisualizationTool.h:183
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
MuonValR4::IRootVisualizationService::ClientToken::canvasLimit
std::size_t canvasLimit
How many canvases are drawn at maximum in a job.
Definition: IRootVisualizationService.h:45
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonR4::SpacePoint::primaryMeasurement
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:75
MuonR4::houghTanBeta
double houghTanBeta(const Amg::Vector3D &v)
Returns the hough tanBeta [y] / [z].
Definition: SegmentFitterEventData.cxx:26
MuonValR4::PatternVisualizationTool::visualizeSeed
virtual void visualizeSeed(const EventContext &ctx, const MuonR4::SegmentSeed &seed, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:224
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
MuonValR4::PatternVisualizationTool::visualizeAccumulator
virtual void visualizeAccumulator(const EventContext &ctx, const MuonR4::HoughPlane &accumulator, const Acts::HoughTransformUtils::HoughAxisRanges &axisRanges, const MaximumVec &maxima, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:129
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
MuonValR4::PatternVisualizationTool::m_plotsDone
std::atomic< bool > m_plotsDone
Flag toggling whether all Canvases have been exhausted.
Definition: PatternVisualizationTool.h:192
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:283
DeMoAtlasDataLoss.canvas
dictionary canvas
Definition: DeMoAtlasDataLoss.py:187
MuonValR4::PatternVisualizationTool::m_paintTruthHits
Gaudi::Property< bool > m_paintTruthHits
Switch to visualize the truth hits
Definition: PatternVisualizationTool.h:171
MuonR4::Segment::parent
const SegmentSeed * parent() const
Returns the seed out of which the segment was built.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:51
MuonValR4::PatternVisualizationTool::isLabeled
virtual bool isLabeled(const MuonR4::SpacePoint &hit) const override final
Fetches all labeled (e.g.
Definition: PatternVisualizationTool.cxx:76
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
MuonR4::SegmentSeed::getHitsInMax
const std::vector< HitType > & getHitsInMax() const
Returns the list of assigned hits.
Definition: SegmentSeed.cxx:48
MdtIdHelper
Definition: MdtIdHelper.h:61
MuonR4::SegmentFit::Parameters
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters
Definition: MuonHoughDefs.h:46
xAOD::Other
@ Other
MuonValR4::PatternVisualizationTool::writeChi2
void writeChi2(const MuonR4::SegmentFit::Parameters &pars, const std::vector< SpacePointType > &hits, Canvas_t &canvas, const double legX=0.2, double startLegY=0.8, const double endLegY=0.3) const
Writes the chi2 of the hits onto the Canvas.
Definition: PatternVisualizationTool.cxx:509
MuonValR4::objViewPhi
constexpr int objViewPhi
Definition: VisualizationHelpers.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonValR4::PatternVisualizationTool::m_doEtaBucketViews
Gaudi::Property< bool > m_doEtaBucketViews
Switch to visualize the eta view of the bucket event.
Definition: PatternVisualizationTool.h:167
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
ActsTrk::GeometryContext
Definition: GeometryContext.h:28
MuonValR4::PatternVisualizationTool::m_saveSinglePDFs
Gaudi::Property< bool > m_saveSinglePDFs
If set to true each canvas is saved into a dedicated pdf file.
Definition: PatternVisualizationTool.h:154
MuonValR4::PatternVisualizationTool::m_canvasLimit
Gaudi::Property< unsigned int > m_canvasLimit
Maximum canvases to draw.
Definition: PatternVisualizationTool.h:152
beamspotman.dir
string dir
Definition: beamspotman.py:619
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:24
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
ActsTrk::DetectorType::Mdt
@ Mdt
MuonSpectrometer.
MuonValR4::objViewEta
constexpr int objViewEta
ObjectView.
Definition: VisualizationHelpers.h:28
MuonValR4::PatternVisualizationTool::LabeledSegmentSet
std::unordered_set< const xAOD::MuonSegment * > LabeledSegmentSet
Definition: PatternVisualizationTool.h:77
sTgcIdHelper
Definition: sTgcIdHelper.h:55
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonValR4::IRootVisualizationService::ClientToken::saveSummaryPlot
bool saveSummaryPlot
Save a summary pdf.
Definition: IRootVisualizationService.h:49
MuonValR4::PatternVisualizationTool::m_saveSummaryPDF
Gaudi::Property< bool > m_saveSummaryPDF
If set to true a summary Canvas is created.
Definition: PatternVisualizationTool.h:156
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:110
MuonValR4::PatternVisualizationTool::paintSimHits
void paintSimHits(const EventContext &ctx, const xAOD::MuonSegment &truthSeg, Canvas_t &canvas, const int view) const
Paints the truth sim hits associated with the segment.
Definition: PatternVisualizationTool.cxx:200
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
MuonValR4::PatternVisualizationTool::m_doPhiBucketViews
Gaudi::Property< bool > m_doPhiBucketViews
Switch to visualize the phi view of the bucket event.
Definition: PatternVisualizationTool.h:169
MmIdHelper
Definition: MmIdHelper.h:54
MuonValR4::drawArrow
std::unique_ptr< TArrow > drawArrow(const Amg::Vector3D &start, const Amg::Vector3D &dir, const int color=kRed+1, const int lineStyle=kDashed, const int view=objViewEta)
Definition: VisualizationHelpers.cxx:30
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::SpacePointSet
std::vector< const SpacePoint * > SpacePointSet
vector of space points
Definition: FitterTypes.h:38
re
const boost::regex re(r_e)
MuonValR4::PatternVisualizationTool::m_displayBucket
Gaudi::Property< bool > m_displayBucket
Display the surrounding hits from the bucket not part of the seed.
Definition: PatternVisualizationTool.h:162
MuonValR4::hollowFilling
constexpr int hollowFilling
Filling codes for hollow / fullFilling / hatched filling.
Definition: VisualizationHelpers.h:23
MuonValR4::PatternVisualizationTool::m_truthLinkDecors
std::vector< SegLinkDecor_t > m_truthLinkDecors
Definition: PatternVisualizationTool.h:181
MuonR4::SegmentFit::makeLabel
std::string makeLabel(const Parameters &pars)
Dumps the parameters into a string in the form of TLatex.
Definition: SegmentFitterEventData.cxx:64
MuonR4::SegmentFit::localSegmentPars
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Definition: SegmentFitterEventData.cxx:42
MuonGMR4::StripDesign::hasStereoAngle
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
MuonValR4::drawDriftCircle
std::unique_ptr< TEllipse > drawDriftCircle(const Amg::Vector3D &center, const double radius, const int color=kViolet, const int fillStyle=hollowFilling)
Create a TEllipse for drawing a drift circle.
Definition: VisualizationHelpers.cxx:20
MuonValR4::PatternVisualizationTool::m_accumlIsEta
Gaudi::Property< bool > m_accumlIsEta
Swtich toggling whether the accumulator view are in the eta or phi plane.
Definition: PatternVisualizationTool.h:165
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
MuonValR4::PatternVisualizationTool::visualizeBucket
virtual void visualizeBucket(const EventContext &ctx, const MuonR4::SpacePointBucket &bucket, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:283
MuonR4::houghTanAlpha
double houghTanAlpha(const Amg::Vector3D &v)
: Returns the hough tanAlpha [x] / [z]
Definition: SegmentFitterEventData.cxx:30
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MuonValR4::PatternVisualizationTool::m_truthSegLinks
Gaudi::Property< std::set< std::string > > m_truthSegLinks
List of truth segment links to fetch.
Definition: PatternVisualizationTool.h:175
MuonR4::getMatchingSimHits
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
Definition: MuonSimHitHelpers.cxx:38
MuonValR4::hatchedFilling
constexpr int hatchedFilling
Definition: VisualizationHelpers.h:25
MuonValR4::PatternVisualizationTool::m_geoCtxKey
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Geometry context key to retrieve the alignment.
Definition: PatternVisualizationTool.h:188
MuonGMR4::MuonDetectorManager::getReadoutElement
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.
drawFromPickle.view
view
Definition: drawFromPickle.py:294
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14