ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static 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 StatusCode finalize () 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, PrimitiveVec &primitives, std::array< double, 4 > &canvasDim, const unsigned int view, unsigned int fillStyle) const
 

Private Types

using SegLink_t = ElementLink< xAOD::MuonSegmentContainer >
 
using SegLinkVec_t = std::vector< SegLink_t >
 
using SegLinkDecor_t = SG::AuxElement::ConstAccessor< SegLinkVec_t >
 

Private Member Functions

void closeSummaryCanvas () const
 Closes the summary canvas & closes the associated ROOT file. More...
 
std::unique_ptr< TCanvas > makeCanvas (const EventContext &ctx, const std::array< double, 4 > &canvasDim, const int view) const
 Create a new Canvas & draw the underlying frame. More...
 
void saveCanvas (const EventContext &ctx, const Identifier &chambId, TCanvas &canvas, const std::string &extraLabel) const
 Saves the Canvas as pdf & also into the ROOT file. More...
 
template<class SpacePointType >
bool drawHits (const MuonR4::SpacePointBucket &bucket, const std::vector< SpacePointType > &hitsToDraw, PrimitiveVec &primitivesToPush, std::array< double, 4 > &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, PrimitiveVec &primitives, std::array< double, 4 > &canvasDim, 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, PrimitiveVec &primitivesToPush, 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 drawPrimitives (const TCanvas &can, PrimitiveVec &primitives) const
 Draw the various primitives onto the Canvas. More...
 
void paintSimHits (const EventContext &ctx, const xAOD::MuonSegment &truthSeg, PrimitiveVec &primitives, const int view) const
 Paints the truth sim hits associated with the segment. More...
 

Private Attributes

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_allCanName {this, "AllCanvasName", "AllPatternPlots"}
 Name of the summary canvas & the ROOT file to save the monitoring plots. More...
 
Gaudi::Property< std::string > m_canvasPrefix {this, "CanvasPreFix", ""}
 Prefix of the individual canvas file names <MANDATORY>
More...
 
Gaudi::Property< bool > m_displayBucket {this, "displayBucket", true}
 Display the surrounding hits from the bucket not part of the seed. More...
 
Gaudi::Property< double > m_canvasExtraScale {this, "CanvasExtraScale" , 1.5}
 Extra safety margin to zoom out from the Canvas. 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", true}
 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...
 
Gaudi::Property< std::string > m_AtlasLabel {this, "AtlasLabel", "Internal"}
 ATLAS label (Internal / Prelimnary / Simulation) More...
 
Gaudi::Property< std::string > m_sqrtSLabel {this, "SqrtSLabel", "14"}
 Centre of mass energy label. More...
 
Gaudi::Property< std::string > m_lumiLabel {this, "LumiLabel", ""}
 Luminosity label. 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< unsigned > m_canvasWidth {this, "CanvasWidth", 800}
 
Gaudi::Property< unsigned > m_canvasHeight {this, "CanvasHeight", 600}
 
Gaudi::Property< bool > m_displayOnlyTruth {this, "displayTruthOnly", false}
 
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 pointer to the Detector manager More...
 
SG::ReadHandleKey< ActsGeometryContextm_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::unique_ptr< TCanvas > m_allCan ATLAS_THREAD_SAFE {}
 
std::unique_ptr< TFile > m_outFile ATLAS_THREAD_SAFE {}
 
std::atomic< unsigned int > m_canvCounter ATLAS_THREAD_SAFE {0}
 how many canvases have been visualized More...
 

Static Private Attributes

static std::mutex s_mutex {}
 

Detailed Description

Definition at line 29 of file PatternVisualizationTool.h.

Member Typedef Documentation

◆ LabeledSegmentSet

Definition at line 79 of file PatternVisualizationTool.h.

◆ SegLink_t

Definition at line 213 of file PatternVisualizationTool.h.

◆ SegLinkDecor_t

Definition at line 215 of file PatternVisualizationTool.h.

◆ SegLinkVec_t

Definition at line 214 of file PatternVisualizationTool.h.

Member Function Documentation

◆ closeSummaryCanvas()

void MuonValR4::PatternVisualizationTool::closeSummaryCanvas ( ) const
private

Closes the summary canvas & closes the associated ROOT file.

Definition at line 718 of file PatternVisualizationTool.cxx.

718  {
719  if (!m_outFile) return;
720  ATH_MSG_INFO("Close summary pdf & root file "<<m_allCanName);
721  if (m_allCan) {
722  m_allCan->cd();
723  m_allCan->SaveAs((m_allCanName +".pdf]").c_str());
724  m_allCan.reset();
725  }
726  m_outFile.reset();
727  }

◆ drawHit() [1/2]

template<class SpacePointType >
const MuonR4::SpacePoint* MuonValR4::PatternVisualizationTool::drawHit ( const SpacePointType &  hit,
PrimitiveVec primitives,
std::array< double, 4 > &  canvasDim,
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
primitivesVector into which the generated object is pushed
canvasDimArray encoding the canvas dimensions [0] -> low x; [1] -> high x, [2] -> low y, [3] -> high y
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,
PrimitiveVec primitives,
std::array< double, 4 > &  canvasDim,
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 518 of file PatternVisualizationTool.cxx.

520  {
521 
522  static_assert(std::is_same_v<SpacePointType, SpacePoint> ||
523  std::is_same_v<SpacePointType, CalibratedSpacePoint>, "Only usual & calibrated space points are supported");
525  if ((view == objViewEta && !hit.measuresEta()) || (view == objViewPhi && !hit.measuresPhi())) {
526  return nullptr;
527  }
528 
529  if (hit.type() != xAOD::UncalibMeasType::Other) {
530  canvasDim[Edges::yLow] = std::min(canvasDim[Edges::yLow], hit.positionInChamber()[view] - hit.driftRadius());
531  canvasDim[Edges::yHigh] = std::max(canvasDim[Edges::yHigh], hit.positionInChamber()[view] + hit.driftRadius());
532  canvasDim[Edges::zLow] = std::min(canvasDim[Edges::zLow], hit.positionInChamber().z() - hit.driftRadius());
533  canvasDim[Edges::zHigh] = std::max(canvasDim[Edges::zHigh], hit.positionInChamber().z() + hit.driftRadius());
534  }
535 
536  const SpacePoint* underlyingSp{nullptr};
538  constexpr int invalidCalibFill = 3305;
539  if constexpr (std::is_same_v<SpacePointType, SpacePoint>) {
540  underlyingSp = &hit;
541  if (hit.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
542  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(hit.primaryMeasurement());
544  fillStyle = invalidCalibFill;
545  }
546  }
547  } else if constexpr(std::is_same_v<SpacePointType, CalibratedSpacePoint>) {
548  underlyingSp = hit.spacePoint();
549  if (hit.fitState() == CalibratedSpacePoint::State::Valid) {
550  fillStyle = fullFilling;
551  } else if (hit.fitState() == CalibratedSpacePoint::State::FailedCalib) {
552  fillStyle = invalidCalibFill;
553  } else {
554  fillStyle = hatchedFilling;
555  }
556  }
557  switch(hit.type()) {
559  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(underlyingSp->primaryMeasurement());
560  primitives.push_back(drawDriftCircle(hit.positionInChamber(), dc->readoutElement()->innerTubeRadius(),
561  kBlack, hollowFilling));
562 
563  const int circColor = isLabeled(*dc) ? truthColor : kBlue;
564  primitives.push_back(drawDriftCircle(hit.positionInChamber(), hit.driftRadius(), circColor, fillStyle));
565  break;
567  const auto* meas{static_cast<const xAOD::RpcMeasurement*>(underlyingSp->primaryMeasurement())};
568  const int boxColor = isLabeled(*meas) ? truthColor : kGreen +2;
569  const double boxWidth = 0.5*std::sqrt(12)*underlyingSp->uncertainty()[view];
570  primitives.push_back(drawBox(hit.positionInChamber(), boxWidth, 0.5*meas->readoutElement()->gasGapPitch(),
571  boxColor, fillStyle));
572  break;
574  const auto* meas{static_cast<const xAOD::TgcStrip*>(underlyingSp->primaryMeasurement())};
575  const int boxColor = isLabeled(*meas) ? truthColor : kCyan + 2;
576  const double boxWidth = 0.5*std::sqrt(12)*underlyingSp->uncertainty()[view];
577  primitives.push_back(drawBox(hit.positionInChamber(), boxWidth, 0.5*meas->readoutElement()->gasGapPitch(),
578  boxColor, fillStyle));
579  break;
581  const auto* meas{static_cast<const xAOD::MMCluster*>(underlyingSp->primaryMeasurement())};
582  const int boxColor = isLabeled(*meas) ? truthColor : kAquamarine;
583  const double boxWidth = 0.5*Gaudi::Units::mm;
584  primitives.push_back(drawBox(hit.positionInChamber(), boxWidth, 10.*Gaudi::Units::mm,
585  boxColor, fillStyle));
586  break;
588  break;
589  } default:
590  ATH_MSG_WARNING("Please implement proper drawings of the new small wheel.. "<<__FILE__<<":"<<__LINE__);
591  break;
592  }
593  return underlyingSp;
594  }

◆ drawHits()

template<class SpacePointType >
bool MuonValR4::PatternVisualizationTool::drawHits ( const MuonR4::SpacePointBucket bucket,
const std::vector< SpacePointType > &  hitsToDraw,
PrimitiveVec primitivesToPush,
std::array< double, 4 > &  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
primitivesToPushOutput vector into which the painting objects are pushed_back
canvasDimArray encoding the canvas dimensions [0] -> low x; [1] -> high x, [2] -> low y, [3] -> high y
viewEither the eta or the phi view?

Definition at line 597 of file PatternVisualizationTool.cxx.

601  {
602 
603  canvasDim[Edges::yLow] = canvasDim[Edges::zLow] = 100. *Gaudi::Units::m;
604  canvasDim[Edges::yHigh] = canvasDim[Edges::zHigh] = -100. *Gaudi::Units::m;
605 
606  SpacePointSet drawnPoints{};
607  for (const SpacePointType& hit : hitsToDraw) {
608  drawnPoints.insert(drawHit(*hit, primitives, canvasDim, view, fullFilling));
609  }
610  if (m_displayBucket) {
611  for (const SpacePointBucket::value_type& hit : bucket) {
612  // Don't redraw the other points
613  if (drawnPoints.count(hit.get())) {
614  continue;
615  }
616  drawHit(*hit, primitives, canvasDim, view, hollowFilling);
617  }
618  }
619 
620  // adapt the draw range to make sure any detector elements we wish to display
621  // are included
622  for (auto & prim : primitives){
623  TBox* theBox = dynamic_cast<TBox*>(prim.get());
624  if (theBox){
625  canvasDim[Edges::zLow] = std::min(canvasDim[Edges::zLow], theBox->GetY1());
626  canvasDim[Edges::zHigh] = std::max(canvasDim[Edges::zHigh], theBox->GetY2());
627  }
628  }
629 
630  double width = (canvasDim[Edges::yHigh] - canvasDim[Edges::yLow])*m_canvasExtraScale;
631  double height = (canvasDim[Edges::zHigh] - canvasDim[Edges::zLow])*m_canvasExtraScale;
632  if (height > width) width = height;
633  else height = width;
634 
635  const double midPointX = 0.5 * (canvasDim[Edges::yHigh] + canvasDim[Edges::yLow]);
636  const double midPointY = 0.5 * (canvasDim[Edges::zHigh] + canvasDim[Edges::zLow]);
637  canvasDim[Edges::yLow] = midPointX - 0.5 * width;
638  canvasDim[Edges::zLow] = midPointY - 0.5 * height;
639  canvasDim[Edges::yHigh] = midPointX + 0.5 * width;
640  canvasDim[Edges::zHigh] = midPointY + 0.5 * height;
641  return drawnPoints.size() - drawnPoints.count(nullptr) > 1;
642  }

◆ drawPrimitives()

void MuonValR4::PatternVisualizationTool::drawPrimitives ( const TCanvas &  can,
PrimitiveVec primitives 
) const
private

Draw the various primitives onto the Canvas.

If a TLine is amongst them it's automatically adjusted to fit the canvas ranges

Parameters
canvasReference to the canvas to draw the primitives on
prmitivesPrimitives to draw onto the Canvas

Definition at line 135 of file PatternVisualizationTool.cxx.

135  {
136  const double yLow = can.GetPad(0)->GetUymin();
137  const double yHigh = can.GetPad(0)->GetUymax();
138  for (auto& prim : primitives) {
139  const TObject &primRef = *prim;
140  if (typeid(primRef) == typeid(TLine)){
141  TLine* line = static_cast<TLine*>(prim.get());
142  const Amg::Vector3D linePoint{line->GetX1(), line->GetY1(), 0.};
143  const Amg::Vector3D lineDir = Amg::Vector3D{(line->GetX2() - line->GetX1()) / (line->GetY2() - line->GetY1()), 1.,0.}.unit();
144 
145  const Amg::Vector3D newHigh = linePoint + Amg::intersect<3>(linePoint, lineDir, Amg::Vector3D::UnitY(), yHigh).value_or(0.) * lineDir;
146  const Amg::Vector3D newLow = linePoint + Amg::intersect<3>(linePoint, lineDir, Amg::Vector3D::UnitY(), yLow).value_or(0.) * lineDir;
147  line->SetX1(newLow.x());
148  line->SetY1(newLow.y());
149  line->SetX2(newHigh.x());
150  line->SetY2(newHigh.y());
151  }
152  prim->Draw();
153  }
154 
155  }

◆ finalize()

StatusCode MuonValR4::PatternVisualizationTool::finalize ( )
finaloverridevirtual

Definition at line 98 of file PatternVisualizationTool.cxx.

98  {
100  return StatusCode::SUCCESS;
101  }

◆ 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 113 of file PatternVisualizationTool.cxx.

113  {
114  std::vector<const xAOD::UncalibratedMeasurement*> measurements{};
115  measurements.reserve(2* hits.size());
116  for (const SpacePoint* hit: hits) {
117  measurements.push_back(hit->primaryMeasurement());
118  if(hit->secondaryMeasurement()) {
119  measurements.push_back(hit->secondaryMeasurement());
120  }
121  }
122  return getLabeledSegments(measurements);
123  }

◆ getLabeledSegments() [2/2]

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

Definition at line 124 of file PatternVisualizationTool.cxx.

124  {
125  LabeledSegmentSet truthSegs{};
126  for (const xAOD::UncalibratedMeasurement* hit : hits) {
127  for (const SegLinkDecor_t& decor: m_truthLinkDecors) {
128  for (const SegLink_t& link : decor(*hit)) {
129  truthSegs.insert(*link);
130  }
131  }
132  }
133  return truthSegs;
134  }

◆ initialize()

StatusCode MuonValR4::PatternVisualizationTool::initialize ( )
finaloverridevirtual

Definition at line 56 of file PatternVisualizationTool.cxx.

56  {
57  if (m_canvasLimit > 0) {
58  if (m_canvasPrefix.value().empty() || m_allCanName.value().empty()) {
59  ATH_MSG_FATAL("Please define "<<m_canvasPrefix<<" && "<<m_allCanName);
60  return StatusCode::FAILURE;
61  }
62  if (m_saveSummaryPDF) {
63  m_allCan = std::make_unique<TCanvas>("all", "all", m_canvasWidth, m_canvasHeight);
64  m_allCan->SaveAs((m_allCanName +".pdf[").c_str());
65  }
66  m_outFile = std::make_unique<TFile>( (m_allCanName +".root").c_str(), "RECREATE");
67  if (m_saveSinglePDFs) {
68  std::filesystem::create_directories("Plots/" + m_canvasPrefix);
69  }
70  gROOT->SetStyle("ATLAS");
71  TStyle* plotStyle = gROOT->GetStyle("ATLAS");
72  plotStyle->SetOptTitle(0);
73  plotStyle->SetHistLineWidth(1.);
74  plotStyle->SetPalette(kViridis);
75  }
76  ATH_CHECK(m_prepContainerKeys.initialize(!m_truthSegLinks.empty()));
77  m_truthLinkDecorKeys.clear();
78  ATH_MSG_INFO("Hits linked to the following segment decorations are considered as truth");
79  for (const std::string& decorName : m_truthSegLinks) {
80  ATH_MSG_INFO(" **** "<<decorName);
81  if (decorName.empty()) {
82  ATH_MSG_FATAL("Decoration must not be empty");
83  return StatusCode::FAILURE;
84  }
86  m_truthLinkDecorKeys.emplace_back(key, decorName);
87  m_truthLinkDecors.push_back(SegLinkDecor_t{decorName});
88  }
89  }
90  ATH_CHECK(m_truthLinkDecorKeys.initialize());
91  m_displayOnlyTruth.value() &= !m_truthLinkDecorKeys.empty();
92 
93  ATH_CHECK(m_idHelperSvc.retrieve());
96  return StatusCode::SUCCESS;
97  }

◆ 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 102 of file PatternVisualizationTool.cxx.

102  {
103  return isLabeled(*hit.primaryMeasurement()) ||
105  }

◆ isLabeled() [2/2]

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

Definition at line 106 of file PatternVisualizationTool.cxx.

106  {
107  return std::find_if(m_truthLinkDecors.begin(), m_truthLinkDecors.end(),
108  [&hit](const SegLinkDecor_t& decor){
109  return !decor(hit).empty();
110  }) != m_truthLinkDecors.end();
111  }

◆ makeCanvas()

std::unique_ptr< TCanvas > MuonValR4::PatternVisualizationTool::makeCanvas ( const EventContext &  ctx,
const std::array< double, 4 > &  canvasDim,
const int  view 
) const
private

Create a new Canvas & draw the underlying frame.

Parameters
ctxEventContext to generate a unique canvas name
canvasDimArray encoding the canvas dimensions [0] -> low x; [1] -> high x, [2] -> low y, [3] -> high y
viewIs the canvas created in the context of an eta or phi visualization view The x-axis of the frame is adapted accordingly

Definition at line 728 of file PatternVisualizationTool.cxx.

730  {
731  std::stringstream canvasName{};
732  canvasName<<name()<<"_"<<ctx.eventID().event_number()<<"_"<<m_canvCounter;
733  ATH_MSG_VERBOSE("Create new canvas "<<canvasName.str()<<" "<<canvasDim);
734  auto canvas = std::make_unique<TCanvas>(canvasName.str().c_str(), "all", m_canvasWidth, m_canvasHeight);
735  canvas->cd();
736  TH1F* frame = canvas->DrawFrame(canvasDim[Edges::yLow],canvasDim[Edges::zLow], canvasDim[Edges::yHigh], canvasDim[Edges::zHigh]);
737  frame->GetXaxis()->SetTitle(std::format("{:} [mm]", view == objViewEta ? 'y' : 'x').c_str());
738  frame->GetYaxis()->SetTitle("z [mm]");
739  return canvas;
740  }

◆ paintSimHits()

void MuonValR4::PatternVisualizationTool::paintSimHits ( const EventContext &  ctx,
const xAOD::MuonSegment truthSeg,
PrimitiveVec primitives,
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
primitivesDrawing primitives to append the painted hits
viewDraw the hit either in the eta or phi view

Definition at line 249 of file PatternVisualizationTool.cxx.

252  {
253  if (!m_paintTruthHits) {
254  return;
255  }
256  auto truthHits = getMatchingSimHits(truthSeg);
257  const ActsGeometryContext* geoCtx{nullptr};
258  if (!SG::get(geoCtx, m_geoCtxKey, ctx).isSuccess()) {
259  return;
260  }
261  for (const xAOD::MuonSimHit* simHit : truthHits) {
262  const MuonGMR4::MuonReadoutElement* re = m_detMgr->getReadoutElement(simHit->identify());
263  const IdentifierHash hash = re->detectorType() == ActsTrk::DetectorType::Mdt ?
264  re->measurementHash(simHit->identify()) :
265  re->layerHash(simHit->identify());
266  const Amg::Transform3D trf = re->msSector()->globalToLocalTrans(*geoCtx) *
267  re->localToGlobalTrans(*geoCtx, hash);
268  const Amg::Vector3D locPos = trf * xAOD::toEigen(simHit->localPosition());
269  const Amg::Vector3D locDir = trf.linear() * xAOD::toEigen(simHit->localDirection());
270  primitives.push_back(drawArrow(locPos, locDir, truthColor, kDashed, view));
271  }
272  }

◆ saveCanvas()

void MuonValR4::PatternVisualizationTool::saveCanvas ( const EventContext &  ctx,
const Identifier chambId,
TCanvas &  canvas,
const std::string &  extraLabel 
) const
private

Saves the Canvas as pdf & also into the ROOT file.

If the canvase limit is reached, then the summary files are closed as well.

Parameters
ctxEventContext to fetch the event number
chambIdIdentifier of the chamber from which the hits are stemming from
primtivesList of objects to draw onto the canvas
extraLabelExternally passed extra label

Definition at line 741 of file PatternVisualizationTool.cxx.

744  {
745  // If an eta view closes the summary canvas & a phi view is processed
746  std::stringstream canvasName{};
747  canvasName<<m_canvasPrefix.value()<<"_"<<ctx.eventID().event_number()<<"_"<<(m_canvCounter++)<<"_"
748  <<m_idHelperSvc->stationNameString(chambId)
749  <<std::abs(m_idHelperSvc->stationEta(chambId))
750  <<(m_idHelperSvc->stationEta(chambId) >0 ? "A" : "C")
751  <<m_idHelperSvc->stationPhi(chambId);
752  if (!extraLabel.empty()) canvasName<<"_"<<removeNonAlphaNum(extraLabel);
753  ATH_MSG_VERBOSE("Save new plot "<<canvasName.str());
754  if (m_saveSinglePDFs) {
755  canvas.SaveAs(("Plots/" + m_canvasPrefix+"/" + canvasName.str()+".pdf").c_str());
756  }
757  if (m_saveSummaryPDF) {
758  canvas.SaveAs((m_allCanName+".pdf").c_str());
759  }
760  m_outFile->WriteObject(&canvas, canvasName.str().c_str());
761  }

◆ 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 156 of file PatternVisualizationTool.cxx.

160  {
161  PrimitiveVec primitives{};
162  visualizeAccumulator(ctx, accumulator, axisRanges, maxima, extraLabel, std::move(primitives));
163  }

◆ 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

Enter the lock phase

Check again in case multiple threads are simultaneously in the lock phase

TODO: After next ACTS update, the following three lines can become const SpacePointSet& hitsInBin{accumulator.uniqueHitIds(xBin, yBin)};

Definition at line 164 of file PatternVisualizationTool.cxx.

169  {
170 
172  if (m_canvCounter >= m_canvasLimit) {
173  return;
174  }
176  std::lock_guard guard{s_mutex};
178  //cppcheck-suppress identicalConditionAfterEarlyExit
179  if (m_canvCounter >= m_canvasLimit) {
180  return;
181  }
182  if (accumulator.getNonEmptyBins().empty()) {
183  ATH_MSG_WARNING("Hough accumulator is empty");
184  return;
185  }
186 
187  auto accHisto = std::make_unique<TH2F>("AccumulatorHisto", "histo",
188  accumulator.nBinsX(), axisRanges.xMin, axisRanges.xMax,
189  accumulator.nBinsY(), axisRanges.yMin, axisRanges.yMax);
190 
191  accHisto->SetDirectory(nullptr);
192  accHisto->GetXaxis()->SetTitle(std::format("tan#{}", m_accumlIsEta ? "theta" : "phi" ).c_str());
193  accHisto->GetYaxis()->SetTitle( std::string{m_accumlIsEta ? "y_{0}" : "x_{0}"}.c_str());
194 
195  std::vector<const SpacePoint*> spacePointsInAcc{};
196  for (const std::size_t bin : accumulator.getNonEmptyBins()) {
197  const auto [xBin, yBin] = accumulator.axisBins(bin);
200  SpacePointSet hitsInBin;
201  auto hitIds = accumulator.hitIds(xBin, yBin);
202  hitsInBin.insert(std::make_move_iterator(hitIds.begin()),std::make_move_iterator(hitIds.end()));
203 
204  spacePointsInAcc.insert(spacePointsInAcc.end(),hitsInBin.begin(), hitsInBin.end());
205  accHisto->SetBinContent(xBin+1, yBin+1, accumulator.nHits(bin));
206  }
207 
208  const LabeledSegmentSet truthSegs{getLabeledSegments(spacePointsInAcc)};
209  if (truthSegs.empty() && m_displayOnlyTruth) {
210  return;
211  }
212  for (const xAOD::MuonSegment* segment : truthSegs) {
213  const auto [pos, dir] = makeLine(localSegmentPars(*segment));
214  const double tan = m_accumlIsEta ? houghTanTheta(dir) : houghTanPhi(dir);
215  const double icept = pos[m_accumlIsEta ? objViewEta : objViewPhi];
216  auto truthMarker = std::make_unique<TMarker>(tan, icept, kFullCrossX);
217  truthMarker->SetMarkerColor(truthColor);
218  truthMarker->SetMarkerSize(8);
219  primitives.push_back(std::move(truthMarker));
220  primitives.push_back(drawLabel(std::format("true parameters: {:}",makeLabel(localSegmentPars(*segment))),0.2, 0.9));
221  }
222  for (const auto& maximum : maxima) {
223  auto maxMarker = std::make_unique<TMarker>(maximum.x, maximum.y, kFullTriangleUp);
224  maxMarker->SetMarkerColor(parLineColor);
225  maxMarker->SetMarkerSize(8);
226  primitives.push_back(std::move(maxMarker));
227  }
228  primitives.push_back(drawAtlasLabel(0.65, 0.26, m_AtlasLabel));
229  primitives.push_back(drawLumiSqrtS(0.65,0.21, m_sqrtSLabel, m_lumiLabel));
230 
231  std::stringstream canvasName{};
232  canvasName<<name()<<"_"<<ctx.eventID().event_number()<<"_"<<m_canvCounter;
233  auto canvas = std::make_unique<TCanvas>(canvasName.str().c_str(),
234  "can", m_canvasWidth, m_canvasHeight);
235  canvas->GetPad(0)->SetRightMargin(0.12);
236  canvas->GetPad(0)->SetTopMargin(0.12);
237  canvas->cd();
238  accHisto->Draw("COLZ");
239  drawPrimitives(*canvas, primitives);
240  primitives.push_back(std::move(accHisto));
241  saveCanvas(ctx, spacePointsInAcc.front()->identify(), *canvas, extraLabel);
242  primitives.push_back(std::move(canvas));
243 
244  primitives.clear();
245  if (m_canvasLimit <= m_canvCounter) {
247  }
248  }

◆ visualizeBucket() [1/2]

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

Definition at line 351 of file PatternVisualizationTool.cxx.

353  {
354  PrimitiveVec primitives{};
355  visualizeBucket(ctx, bucket, extraLabel, std::move(primitives));
356  }

◆ 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

Enter the lock phase

Check again in case multiple threads are simultaneously in the lock phase

reset the primitives

Definition at line 357 of file PatternVisualizationTool.cxx.

360  {
362  if (m_canvCounter >= m_canvasLimit) {
363  return;
364  }
366  std::lock_guard guard{s_mutex};
368  //cppcheck-suppress identicalConditionAfterEarlyExit
369  if (m_canvCounter >= m_canvasLimit) {
370  return;
371  }
372  std::array<double, 4> canvasDim{};
373  LabeledSegmentSet truthSegs{getLabeledSegments(Acts::unpackConstSmartPointers(bucket))};
374  if (truthSegs.empty() && m_displayOnlyTruth) {
375  return;
376  }
377  const std::size_t parsedPrimSize{primitives.size()};
378  for (const int view : {objViewEta, objViewPhi}) {
379  if ((view == objViewEta && !m_doEtaBucketViews) ||
381  continue;
382  }
384  primitives.resize(parsedPrimSize);
385  if (!drawHits(bucket, bucket, primitives, canvasDim, view)) {
386  continue;
387  }
388  bool drawnTrueLabel{false};
389  for (const xAOD::MuonSegment* segment : truthSegs) {
390  primitives.push_back(drawLine(localSegmentPars(*segment), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
391  truthColor, kDotted, view));
392  if (!drawnTrueLabel) {
393  primitives.push_back(drawLabel(std::format("true parameters: {:}",makeLabel(localSegmentPars(*segment))),0.2, 0.89));
394  drawnTrueLabel = true;
395  }
396  paintSimHits(ctx,*segment, primitives, view);
397  }
398 
399  std::stringstream legendLabel{};
400  legendLabel<<"Event: "<<ctx.eventID().event_number()
401  <<", chamber : "<<m_idHelperSvc->toStringChamber(bucket.front()->identify())
402  <<",#"<<(view ==objViewEta ? "eta" : "phi")<<"-view";
403  if (!extraLabel.empty()) {
404  legendLabel<<" ("<<extraLabel<<")";
405  }
406  primitives.push_back(drawLabel(legendLabel.str(), 0.2, 0.96));
407 
408  primitives.push_back(drawAtlasLabel(0.75, 0.26, m_AtlasLabel));
409  primitives.push_back(drawLumiSqrtS(0.75,0.21, m_sqrtSLabel, m_lumiLabel));
410 
411  auto can = makeCanvas(ctx , canvasDim, view);
412  drawPrimitives(*can, primitives);
413 
414  saveCanvas(ctx, bucket.front()->identify(), *can, extraLabel);
415  }
416  if (m_canvasLimit <= m_canvCounter) {
417  primitives.clear();
419  }
420 
421  }

◆ visualizeSeed() [1/2]

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

Definition at line 273 of file PatternVisualizationTool.cxx.

275  {
276  PrimitiveVec primitives{};
277  visualizeSeed(ctx, seed, extraLabel, std::move(primitives));
278  }

◆ 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

Enter the lock phase

Check again in case multiple threads are simultaneously in the lock phase

reset the primitives

Definition at line 279 of file PatternVisualizationTool.cxx.

282  {
283 
285  if (m_canvCounter >= m_canvasLimit) {
286  return;
287  }
289  std::lock_guard guard{s_mutex};
291  //cppcheck-suppress identicalConditionAfterEarlyExit
292  if (m_canvCounter >= m_canvasLimit) {
293  return;
294  }
295 
296  const LabeledSegmentSet truthSegs{getLabeledSegments(seed.getHitsInMax())};
297  if (truthSegs.empty() && m_displayOnlyTruth) {
298  return;
299  }
300 
301  std::array<double, 4> canvasDim{};
302  const std::size_t parsedPrimSize{primitives.size()};
303  for (const int view : {objViewEta, objViewPhi}) {
304  if ((view == objViewEta && !m_doEtaBucketViews) ||
306  continue;
307  }
309  primitives.resize(parsedPrimSize);
310 
311  if (!drawHits(*seed.parentBucket(), seed.getHitsInMax(), primitives, canvasDim, view)) {
312  continue;
313  }
314  for (const xAOD::MuonSegment* segment : truthSegs) {
315  primitives.push_back(drawLine(localSegmentPars(*segment), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
316  truthColor, kDotted, view));
317  paintSimHits(ctx,*segment, primitives, view);
318  }
319  primitives.push_back(drawLine(seed.parameters(), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
320  parLineColor, kDashed, view));
321 
322  writeChi2(seed.parameters(), seed.getHitsInMax(), primitives);
323 
324  std::stringstream legendLabel{};
325  double chi2{0.};
326  unsigned nDoF{0};
327  legendLabel<<"Event: "<<ctx.eventID().event_number()<<", chamber : "<<m_idHelperSvc->toStringChamber(seed.getHitsInMax().front()->identify())
328  <<std::format(", #chi^{{2}} /nDoF: {:.2f} ({:})", chi2/std::max(1u, nDoF), std::max(1u,nDoF))
329  <<", #"<<(view ==objViewEta ? "eta" : "phi")<<"-view";
330 
331  if (!extraLabel.empty()) {
332  legendLabel<<" ("<<extraLabel<<")";
333  }
334  primitives.push_back(drawLabel(legendLabel.str(), 0.1, 0.96));
335  primitives.push_back(drawLabel(makeLabel(seed.parameters()),0.25, 0.89));
336 
337  auto canvas = makeCanvas(ctx, canvasDim, view);
338  primitives.push_back(drawAtlasLabel(0.75, 0.26, m_AtlasLabel));
339  primitives.push_back(drawLumiSqrtS(0.75,0.21, m_sqrtSLabel, m_lumiLabel));
340 
341  drawPrimitives(*canvas, primitives);
342 
343  saveCanvas(ctx, seed.getHitsInMax().front()->identify(), *canvas, extraLabel);
344  }
345  if (m_canvasLimit <= m_canvCounter) {
346  primitives.clear();
348  }
349  }

◆ visualizeSegment() [1/2]

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

Definition at line 423 of file PatternVisualizationTool.cxx.

425  {
426  PrimitiveVec primitives{};
427  visualizeSegment(ctx, segment,extraLabel, std::move(primitives));
428  }

◆ 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

Enter the lock phase

Check again in case multiple threads are simultaneously in the lock phase

reset the primitives

Definition at line 430 of file PatternVisualizationTool.cxx.

433  {
435  if (m_canvCounter >= m_canvasLimit) {
436  return;
437  }
439  std::lock_guard guard{s_mutex};
441  //cppcheck-suppress identicalConditionAfterEarlyExit
442  if (m_canvCounter >= m_canvasLimit) {
443  return;
444  }
445  const LabeledSegmentSet truthSegs{getLabeledSegments(segment.parent()->getHitsInMax())};
446  if (truthSegs.empty() && m_displayOnlyTruth) {
447  return;
448  }
449  Parameters segPars{};
450  {
451  const ActsGeometryContext* geoCtx{nullptr};
452  if (!SG::get(geoCtx, m_geoCtxKey, ctx).isSuccess()) {
453  return;
454  }
455  const Amg::Transform3D trf{segment.msSector()->globalToLocalTrans(*geoCtx)};
456  const Amg::Vector3D locPos = trf * segment.position();
457  const Amg::Vector3D locDir = trf.linear() * segment.direction();
458  segPars[toInt(ParamDefs::x0)] = locPos.x();
459  segPars[toInt(ParamDefs::y0)] = locPos.y();
460  segPars[toInt(ParamDefs::theta)] = locDir.theta();
461  segPars[toInt(ParamDefs::phi)] = locDir.phi();
462  segPars[toInt(ParamDefs::time)] = segment.segementT0();
463  }
464 
465  std::array<double, 4> canvasDim{};
466  const std::size_t parsedPrimSize{primitives.size()};
467  for (const int view : {objViewEta, objViewPhi}) {
468  if ((view == objViewEta && !m_doEtaBucketViews) ||
470  continue;
471  }
473  primitives.resize(parsedPrimSize);
474 
475  if (!drawHits(*segment.parent()->parentBucket(), segment.measurements(),
476  primitives, canvasDim, view)) {
477  continue;
478  }
479  for (const xAOD::MuonSegment* segment : truthSegs) {
480  primitives.push_back(drawLine(localSegmentPars(*segment), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
481  truthColor, kDotted, view));
482  paintSimHits(ctx,*segment, primitives, view);
483  }
484  writeChi2(segPars, segment.measurements(), primitives);
485 
486  primitives.push_back(drawAtlasLabel(0.75, 0.26, m_AtlasLabel));
487  primitives.push_back(drawLumiSqrtS(0.75,0.21, m_sqrtSLabel, m_lumiLabel));
488 
489  primitives.push_back(drawLine(segPars, canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
490  parLineColor, kDashed, view));
491 
492 
493  std::stringstream legendLabel{};
494  const Identifier canvasId{segment.parent()->getHitsInMax().front()->identify()};
495  legendLabel<<"Event: "<<ctx.eventID().event_number() <<", chamber : "<<m_idHelperSvc->toStringChamber(canvasId)
496  <<std::format(", #chi^{{2}} /nDoF: {:.2f} ({:d})", segment.chi2() /std::max(1u, segment.nDoF()), segment.nDoF())
497  <<", #"<<(view ==objViewEta ? "eta" : "phi")<<"-view";
498 
499  if (!extraLabel.empty()) {
500  legendLabel<<" ("<<extraLabel<<")";
501  }
502  primitives.push_back(drawLabel(legendLabel.str(), 0.2, 0.96));
503  primitives.push_back(drawLabel(makeLabel(segPars),0.25, 0.91));
504 
505  auto canvas = makeCanvas(ctx, canvasDim, view);
506  drawPrimitives(*canvas, primitives);
507 
508  saveCanvas(ctx, canvasId, *canvas, extraLabel);
509  }
510  if (m_canvasLimit <= m_canvCounter) {
511  primitives.clear();
513  }
514  }

◆ writeChi2()

template<class SpacePointType >
void MuonValR4::PatternVisualizationTool::writeChi2 ( const MuonR4::SegmentFit::Parameters pars,
const std::vector< SpacePointType > &  hits,
PrimitiveVec primitivesToPush,
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
primitivesToPushOutput vector into which the TLabels are pushed for later drawing
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 644 of file PatternVisualizationTool.cxx.

648  {
649 
650  const auto [locPos, locDir] = makeLine(pars);
651  for (const SpacePointType& hit : hits) {
652  const SpacePoint* underlyingSp{nullptr};
653  double chi2{0.};
654  bool displayChi2{true};
655  if constexpr(std::is_same_v<SpacePointType, Segment::MeasType>) {
656  underlyingSp = hit->spacePoint();
657  displayChi2 = (hit->fitState() == CalibratedSpacePoint::State::Valid );
659  std::nullopt, *hit, msgStream());
660  } else {
661  underlyingSp = hit;
662  chi2 = SegmentFitHelpers::chiSqTerm(locPos, locDir, *hit, msgStream());
663  }
664 
665  const Identifier hitId = underlyingSp ? underlyingSp->identify(): Identifier{};
666  std::string legendstream{};
667  switch(hit->type()) {
669  const int driftSign{SegmentFitHelpers::driftSign(locPos, locDir, *hit, msgStream())};
670  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
671  legendstream = std::format("ML: {:1d}, TL: {:1d}, T: {:3d}, {:}",
672  idHelper.multilayer(hitId), idHelper.tubeLayer(hitId),
673  idHelper.tube(hitId), driftSign == -1 ? "L" : "R");
674  break;
676  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
677  legendstream= std::format("DR: {:1d}, DZ: {:1d}, GAP: {:1d}, #eta/#phi: {:}/{:}",
678  idHelper.doubletR(hitId), idHelper.doubletZ(hitId), idHelper.gasGap(hitId),
679  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
680  break;
682  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
683  legendstream = std::format("ST: {:}, GAP: {:1d}, #eta/#phi: {:}/{:}",
684  m_idHelperSvc->stationNameString(hitId), idHelper.gasGap(hitId),
685  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
686  break;
688  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
689  const auto* clus = static_cast<const xAOD::MMCluster*>(underlyingSp->primaryMeasurement());
690  const MuonGMR4::StripDesign& design = clus->readoutElement()->stripLayer(clus->layerHash()).design();
691  legendstream = std::format("ML: {:1d}, GAP: {:1d}, {:}", idHelper.multilayer(hitId), idHelper.gasGap(hitId),
692  !design.hasStereoAngle() ? "X" : design.stereoAngle() > 0 ? "U" :"V");
693  break;
695  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
696  legendstream = std::format("ML: {:1d}, GAP: {:1d}, #eta/#phi: {:}/{:}",
697  idHelper.multilayer(hitId), idHelper.gasGap(hitId),
698  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
699  break;
701  legendstream = "Ext. constaint";
702  }
703  default:
704  break;
705  }
706  if (displayChi2) {
707  legendstream+=std::format(", #chi^{{2}}: {:.2f}", chi2);
708  } else {
709  legendstream+=", #chi^{2}: ---";
710  }
711  primitives.push_back(drawLabel(legendstream, legX, startLegY, 14));
712  startLegY -= 0.05;
713  if (startLegY<= endLegY) {
714  break;
715  }
716  }
717  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/3]

std::unique_ptr<TCanvas> m_allCan MuonValR4::PatternVisualizationTool::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 232 of file PatternVisualizationTool.h.

◆ ATLAS_THREAD_SAFE [2/3]

std::unique_ptr<TFile> m_outFile MuonValR4::PatternVisualizationTool::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 233 of file PatternVisualizationTool.h.

◆ ATLAS_THREAD_SAFE [3/3]

std::atomic<unsigned int> m_canvCounter MuonValR4::PatternVisualizationTool::ATLAS_THREAD_SAFE {0}
mutableprivate

how many canvases have been visualized

Definition at line 235 of file PatternVisualizationTool.h.

◆ 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 194 of file PatternVisualizationTool.h.

◆ m_allCanName

Gaudi::Property<std::string> MuonValR4::PatternVisualizationTool::m_allCanName {this, "AllCanvasName", "AllPatternPlots"}
private

Name of the summary canvas & the ROOT file to save the monitoring plots.

Definition at line 185 of file PatternVisualizationTool.h.

◆ m_AtlasLabel

Gaudi::Property<std::string> MuonValR4::PatternVisualizationTool::m_AtlasLabel {this, "AtlasLabel", "Internal"}
private

ATLAS label (Internal / Prelimnary / Simulation)

Definition at line 202 of file PatternVisualizationTool.h.

◆ m_canvasExtraScale

Gaudi::Property<double> MuonValR4::PatternVisualizationTool::m_canvasExtraScale {this, "CanvasExtraScale" , 1.5}
private

Extra safety margin to zoom out from the Canvas.

Definition at line 191 of file PatternVisualizationTool.h.

◆ m_canvasHeight

Gaudi::Property<unsigned> MuonValR4::PatternVisualizationTool::m_canvasHeight {this, "CanvasHeight", 600}
private

Definition at line 219 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 178 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 187 of file PatternVisualizationTool.h.

◆ m_canvasWidth

Gaudi::Property<unsigned> MuonValR4::PatternVisualizationTool::m_canvasWidth {this, "CanvasWidth", 800}
private

Definition at line 218 of file PatternVisualizationTool.h.

◆ m_detMgr

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

pointer to the Detector manager

Definition at line 225 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 189 of file PatternVisualizationTool.h.

◆ m_displayOnlyTruth

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

Definition at line 221 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 196 of file PatternVisualizationTool.h.

◆ m_doPhiBucketViews

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

Switch to visualize the phi view of the bucket event.

Definition at line 198 of file PatternVisualizationTool.h.

◆ m_geoCtxKey

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

Geometry context key to retrieve the alignment.

Definition at line 227 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 229 of file PatternVisualizationTool.h.

◆ m_lumiLabel

Gaudi::Property<std::string> MuonValR4::PatternVisualizationTool::m_lumiLabel {this, "LumiLabel", ""}
private

Luminosity label.

Definition at line 206 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 200 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 208 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 180 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.

ATTENTION: There can be only one summary PDF in an athena job

Definition at line 183 of file PatternVisualizationTool.h.

◆ m_sqrtSLabel

Gaudi::Property<std::string> MuonValR4::PatternVisualizationTool::m_sqrtSLabel {this, "SqrtSLabel", "14"}
private

Centre of mass energy label.

Definition at line 204 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 212 of file PatternVisualizationTool.h.

◆ m_truthLinkDecors

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

Definition at line 216 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 210 of file PatternVisualizationTool.h.

◆ s_mutex

std::mutex MuonValR4::PatternVisualizationTool::s_mutex {}
staticprivate

Definition at line 231 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:225
MuonValR4::fullFilling
constexpr int fullFilling
Definition: VisualizationHelpers.h:21
MuonR4::PrimitiveVec
MuonValR4::IPatternVisualizationTool::PrimitiveVec PrimitiveVec
Definition: SegmentFittingAlg.cxx:59
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:59
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::PatternVisualizationTool::m_canvasWidth
Gaudi::Property< unsigned > m_canvasWidth
Definition: PatternVisualizationTool.h:218
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
MuonR4::SegmentFit::Parameters
AmgVector(toInt(ParamDefs::nPars)) Parameters
Definition: MuonHoughDefs.h:48
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:215
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonValR4::PatternVisualizationTool::s_mutex
static std::mutex s_mutex
Definition: PatternVisualizationTool.h:231
MuonValR4::PatternVisualizationTool::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Geometry context key to retrieve the alignment.
Definition: PatternVisualizationTool.h:227
TgcIdHelper
Definition: TgcIdHelper.h:50
MuonValR4::PatternVisualizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Service Handle to the IMuonIdHelperSvc.
Definition: PatternVisualizationTool.h:229
MuonValR4::PatternVisualizationTool::m_canvasPrefix
Gaudi::Property< std::string > m_canvasPrefix
Prefix of the individual canvas file names <MANDATORY>
Definition: PatternVisualizationTool.h:187
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
xAOD::TgcStrip_v1
Definition: TgcStrip_v1.h:19
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
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:41
MuonValR4::PatternVisualizationTool::visualizeSegment
virtual void visualizeSegment(const EventContext &ctx, const MuonR4::Segment &segment, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:423
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonValR4::PatternVisualizationTool::saveCanvas
void saveCanvas(const EventContext &ctx, const Identifier &chambId, TCanvas &canvas, const std::string &extraLabel) const
Saves the Canvas as pdf & also into the ROOT file.
Definition: PatternVisualizationTool.cxx:741
MuonR4::SpacePoint::secondaryMeasurement
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:50
MuonValR4::PatternVisualizationTool::makeCanvas
std::unique_ptr< TCanvas > makeCanvas(const EventContext &ctx, const std::array< double, 4 > &canvasDim, const int view) const
Create a new Canvas & draw the underlying frame.
Definition: PatternVisualizationTool.cxx:728
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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:212
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
MuonR4::SegmentFitHelpers::chiSqTerm
double chiSqTerm(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &measurement, MsgStream &msg)
Calculates the chi2 contribuation to a linear segment line from an uncalibrated measurement.
Definition: SegmentFitHelperFunctions.cxx:28
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:26
MuonValR4::PatternVisualizationTool::paintSimHits
void paintSimHits(const EventContext &ctx, const xAOD::MuonSegment &truthSeg, PrimitiveVec &primitives, const int view) const
Paints the truth sim hits associated with the segment.
Definition: PatternVisualizationTool.cxx:249
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:32
MuonValR4::PatternVisualizationTool::m_prepContainerKeys
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_prepContainerKeys
Declare dependency on the prep data containers.
Definition: PatternVisualizationTool.h:208
dq_defect_bulk_create_defects.line
line
Definition: dq_defect_bulk_create_defects.py:27
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:113
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
MuonValR4::PatternVisualizationTool::m_displayOnlyTruth
Gaudi::Property< bool > m_displayOnlyTruth
Definition: PatternVisualizationTool.h:221
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
MuonValR4::PatternVisualizationTool::m_canvasExtraScale
Gaudi::Property< double > m_canvasExtraScale
Extra safety margin to zoom out from the Canvas.
Definition: PatternVisualizationTool.h:191
MuonR4::SegmentFit::ParamDefs::phi
@ phi
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonR4::SpacePoint::primaryMeasurement
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:47
MuonR4::houghTanPhi
double houghTanPhi(const Amg::Vector3D &v)
: Returns the hough tanPhi [x] / [z]
Definition: SegmentFitterEventData.cxx:18
MuonR4::SegmentFitHelpers::driftSign
int driftSign(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &uncalibHit, MsgStream &msg)
Calculates whether a segement line travereses the tube measurement on the left (-1) or right (1) side...
Definition: SegmentFitHelperFunctions.cxx:239
MuonR4::SegmentFit::AxisDefs::t0
@ t0
MuonValR4::PatternVisualizationTool::visualizeSeed
virtual void visualizeSeed(const EventContext &ctx, const MuonR4::SegmentSeed &seed, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:273
PlotPulseshapeFromCool.can
can
Definition: PlotPulseshapeFromCool.py:91
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:156
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
MuonValR4::PatternVisualizationTool::m_sqrtSLabel
Gaudi::Property< std::string > m_sqrtSLabel
Centre of mass energy label.
Definition: PatternVisualizationTool.h:204
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
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:200
MuonValR4::PatternVisualizationTool::isLabeled
virtual bool isLabeled(const MuonR4::SpacePoint &hit) const override final
Fetches all labeled (e.g.
Definition: PatternVisualizationTool.cxx:102
MuonValR4::PatternVisualizationTool::drawHit
const MuonR4::SpacePoint * drawHit(const SpacePointType &hit, PrimitiveVec &primitives, std::array< double, 4 > &canvasDim, const unsigned int view, unsigned int fillStyle) const
Converts a Hit into a particular TBox/ TEllipse for drawing.
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
MdtIdHelper
Definition: MdtIdHelper.h:61
xAOD::Other
@ Other
MuonValR4::objViewPhi
constexpr int objViewPhi
Definition: VisualizationHelpers.h:26
MuonValR4::PatternVisualizationTool::writeChi2
void writeChi2(const MuonR4::SegmentFit::Parameters &pars, const std::vector< SpacePointType > &hits, PrimitiveVec &primitivesToPush, 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:644
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:196
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
MuonR4::SegmentFit::ParamDefs::x0
@ x0
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
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:180
MuonValR4::PatternVisualizationTool::drawHits
bool drawHits(const MuonR4::SpacePointBucket &bucket, const std::vector< SpacePointType > &hitsToDraw, PrimitiveVec &primitivesToPush, std::array< double, 4 > &canvasDim, unsigned int view) const
Translates the Spacepoint information into TObjects that are dawn on the canvas & evaluates the size ...
Definition: PatternVisualizationTool.cxx:597
MuonValR4::PatternVisualizationTool::m_canvasLimit
Gaudi::Property< unsigned int > m_canvasLimit
Maximum canvases to draw.
Definition: PatternVisualizationTool.h:178
MuonR4::SegmentFit::ParamDefs::time
@ time
beamspotman.dir
string dir
Definition: beamspotman.py:621
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:19
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MuonR4::SegmentFit::ParamDefs::y0
@ y0
ActsTrk::DetectorType::Mdt
@ Mdt
MuonSpectrometer.
MuonValR4::objViewEta
constexpr int objViewEta
ObjectView.
Definition: VisualizationHelpers.h:25
MuonValR4::PatternVisualizationTool::LabeledSegmentSet
std::unordered_set< const xAOD::MuonSegment * > LabeledSegmentSet
Definition: PatternVisualizationTool.h:79
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
sTgcIdHelper
Definition: sTgcIdHelper.h:55
MuonValR4::PatternVisualizationTool::m_AtlasLabel
Gaudi::Property< std::string > m_AtlasLabel
ATLAS label (Internal / Prelimnary / Simulation)
Definition: PatternVisualizationTool.h:202
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonValR4::PatternVisualizationTool::m_saveSummaryPDF
Gaudi::Property< bool > m_saveSummaryPDF
If set to true a summary Canvas is created.
Definition: PatternVisualizationTool.h:183
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:112
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
MuonValR4::PatternVisualizationTool::m_lumiLabel
Gaudi::Property< std::string > m_lumiLabel
Luminosity label.
Definition: PatternVisualizationTool.h:206
MuonValR4::PatternVisualizationTool::m_doPhiBucketViews
Gaudi::Property< bool > m_doPhiBucketViews
Switch to visualize the phi view of the bucket event.
Definition: PatternVisualizationTool.h:198
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:22
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
MuonValR4::PatternVisualizationTool::drawPrimitives
void drawPrimitives(const TCanvas &can, PrimitiveVec &primitives) const
Draw the various primitives onto the Canvas.
Definition: PatternVisualizationTool.cxx:135
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
MuonValR4::PatternVisualizationTool::closeSummaryCanvas
void closeSummaryCanvas() const
Closes the summary canvas & closes the associated ROOT file.
Definition: PatternVisualizationTool.cxx:718
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:189
MuonValR4::PatternVisualizationTool::m_canvasHeight
Gaudi::Property< unsigned > m_canvasHeight
Definition: PatternVisualizationTool.h:219
MuonValR4::hollowFilling
constexpr int hollowFilling
Filling codes for hollow / fullFilling / hatched filling.
Definition: VisualizationHelpers.h:20
MuonValR4::PatternVisualizationTool::m_truthLinkDecors
std::vector< SegLinkDecor_t > m_truthLinkDecors
Definition: PatternVisualizationTool.h:216
MuonR4::SegmentFit::makeLabel
std::string makeLabel(const Parameters &pars)
Definition: SegmentFitterEventData.cxx:50
MuonR4::SegmentFit::localSegmentPars
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Definition: SegmentFitterEventData.cxx:32
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:12
MuonValR4::drawAtlasLabel
std::unique_ptr< TLatex > drawAtlasLabel(const double xPos, const double yPos, const std::string &status="Internal")
Create a ATLAS label.
Definition: VisualizationHelpers.cxx:72
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:194
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
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:351
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MuonR4::houghTanTheta
double houghTanTheta(const Amg::Vector3D &v)
Returns the hough tanTheta [y] / [z].
Definition: SegmentFitterEventData.cxx:14
MuonValR4::PatternVisualizationTool::m_truthSegLinks
Gaudi::Property< std::set< std::string > > m_truthSegLinks
List of truth segment links to fetch.
Definition: PatternVisualizationTool.h:210
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:27
MuonValR4::drawLumiSqrtS
std::unique_ptr< TLatex > drawLumiSqrtS(const double xPos, const double yPos, const std::string_view sqrtS="14", const std::string_view lumi="")
Create a luminosity sqrtS label.
Definition: VisualizationHelpers.cxx:76
MuonR4::SegmentFit::ParamDefs::theta
@ theta
MuonValR4::hatchedFilling
constexpr int hatchedFilling
Definition: VisualizationHelpers.h:22
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
MuonValR4::PatternVisualizationTool::m_allCanName
Gaudi::Property< std::string > m_allCanName
Name of the summary canvas & the ROOT file to save the monitoring plots.
Definition: PatternVisualizationTool.h:185
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