ATLAS Offline Software
PatternVisualizationTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 
10 
12 
15 
20 
21 #include <format>
22 #include <sstream>
23 #include <filesystem>
24 
25 
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TMarker.h"
29 #include "TROOT.h"
30 #include "TStyle.h"
31 namespace {
32  std::string removeNonAlphaNum(std::string str) {
33  str.erase(std::remove_if(str.begin(),str.end(),
34  [](const unsigned char c){
35  return !std::isalnum(c);
36  }), str.end());
37  return str;
38  }
39  std::vector<const MuonR4::SpacePoint*> stripSmartPtr(const MuonR4::SpacePointBucket& bucket) {
40  std::vector<const MuonR4::SpacePoint*> ret{};
41  std::transform(bucket.begin(), bucket.end(), std::back_inserter(ret),
42  [](const MuonR4::SpacePointBucket::value_type& sp){ return sp.get();});
43  return ret;
44  }
45  constexpr int truthColor = kOrange +2;
46  constexpr int parLineColor = kRed;
47  using SpacePointSet = std::unordered_set<const MuonR4::SpacePoint*>;
48  enum Edges {
49  yLow = 0, yHigh, zLow, zHigh
50  };
51 }
52 
53 
54 namespace MuonValR4 {
55  using namespace MuonR4;
56  using namespace SegmentFit;
59  PatternVisualizationTool::PatternVisualizationTool(const std::string& type, const std::string& name, const IInterface* parent):
60  base_class{type,name,parent} {}
61 
63  if (m_canvasLimit > 0) {
64  if (m_canvasPrefix.value().empty() || m_allCanName.value().empty()) {
65  ATH_MSG_FATAL("Please define "<<m_canvasPrefix<<" && "<<m_allCanName);
66  return StatusCode::FAILURE;
67  }
68  if (m_saveSummaryPDF) {
69  m_allCan = std::make_unique<TCanvas>("all", "all", m_canvasWidth, m_canvasHeight);
70  m_allCan->SaveAs((m_allCanName +".pdf[").c_str());
71  }
72  m_outFile = std::make_unique<TFile>( (m_allCanName +".root").c_str(), "RECREATE");
73  if (m_saveSinglePDFs) {
74  std::filesystem::create_directories("Plots/" + m_canvasPrefix);
75  }
76  gROOT->SetStyle("ATLAS");
77  TStyle* plotStyle = gROOT->GetStyle("ATLAS");
78  plotStyle->SetOptTitle(0);
79  plotStyle->SetHistLineWidth(1.);
80  plotStyle->SetPalette(kViridis);
81  }
82  ATH_CHECK(m_prepContainerKeys.initialize(!m_truthSegLinks.empty()));
83  m_truthLinkDecorKeys.clear();
84  ATH_MSG_INFO("Hits linked to the following segment decorations are considered as truth");
85  for (const std::string& decorName : m_truthSegLinks) {
86  ATH_MSG_INFO(" **** "<<decorName);
87  if (decorName.empty()) {
88  ATH_MSG_FATAL("Decoration must not be empty");
89  return StatusCode::FAILURE;
90  }
92  m_truthLinkDecorKeys.emplace_back(key, decorName);
93  m_truthLinkDecors.push_back(SegLinkDecor_t{decorName});
94  }
95  }
96  ATH_CHECK(m_truthLinkDecorKeys.initialize());
97  m_displayOnlyTruth.value() &= !m_truthLinkDecorKeys.empty();
98 
99  ATH_CHECK(m_idHelperSvc.retrieve());
102  return StatusCode::SUCCESS;
103  }
106  return StatusCode::SUCCESS;
107  }
109  return isLabeled(*hit.primaryMeasurement()) ||
111  }
113  return std::find_if(m_truthLinkDecors.begin(), m_truthLinkDecors.end(),
114  [&hit](const SegLinkDecor_t& decor){
115  return !decor(hit).empty();
116  }) != m_truthLinkDecors.end();
117  }
118 
119  LabeledSegmentSet PatternVisualizationTool::getLabeledSegments(const std::vector<const MuonR4::SpacePoint*>& hits) const {
120  std::vector<const xAOD::UncalibratedMeasurement*> measurements{};
121  measurements.reserve(2* hits.size());
122  for (const SpacePoint* hit: hits) {
123  measurements.push_back(hit->primaryMeasurement());
124  if(hit->secondaryMeasurement()) {
125  measurements.push_back(hit->secondaryMeasurement());
126  }
127  }
128  return getLabeledSegments(measurements);
129  }
130  LabeledSegmentSet PatternVisualizationTool::getLabeledSegments(const std::vector<const xAOD::UncalibratedMeasurement*>& hits) const {
131  LabeledSegmentSet truthSegs{};
132  for (const xAOD::UncalibratedMeasurement* hit : hits) {
133  for (const SegLinkDecor_t& decor: m_truthLinkDecors) {
134  for (const SegLink_t& link : decor(*hit)) {
135  truthSegs.insert(*link);
136  }
137  }
138  }
139  return truthSegs;
140  }
141  void PatternVisualizationTool::drawPrimitives(const TCanvas& can, PrimitiveVec& primitives) const {
142  const double yLow = can.GetPad(0)->GetUymin();
143  const double yHigh = can.GetPad(0)->GetUymax();
144  for (auto& prim : primitives) {
145  const TObject &primRef = *prim;
146  if (typeid(primRef) == typeid(TLine)){
147  TLine* line = static_cast<TLine*>(prim.get());
148  const Amg::Vector3D linePoint{line->GetX1(), line->GetY1(), 0.};
149  const Amg::Vector3D lineDir = Amg::Vector3D{(line->GetX2() - line->GetX1()) / (line->GetY2() - line->GetY1()), 1.,0.}.unit();
150 
151  const Amg::Vector3D newHigh = linePoint + Amg::intersect<3>(linePoint, lineDir, Amg::Vector3D::UnitY(), yHigh).value_or(0.) * lineDir;
152  const Amg::Vector3D newLow = linePoint + Amg::intersect<3>(linePoint, lineDir, Amg::Vector3D::UnitY(), yLow).value_or(0.) * lineDir;
153  line->SetX1(newLow.x());
154  line->SetY1(newLow.y());
155  line->SetX2(newHigh.x());
156  line->SetY2(newHigh.y());
157  }
158  prim->Draw();
159  }
160 
161  }
163  const MuonR4::HoughPlane& accumulator,
164  const Acts::HoughTransformUtils::HoughAxisRanges& axisRanges,
165  const MaximumVec& maxima,
166  const std::string& extraLabel) const {
167  PrimitiveVec primitives{};
168  visualizeAccumulator(ctx, accumulator, axisRanges, maxima, extraLabel, std::move(primitives));
169  }
171  const MuonR4::HoughPlane& accumulator,
172  const Acts::HoughTransformUtils::HoughAxisRanges& axisRanges,
173  const MaximumVec& maxima,
174  const std::string& extraLabel,
175  PrimitiveVec&& primitives) const {
176 
178  if (m_canvCounter >= m_canvasLimit) {
179  return;
180  }
182  std::lock_guard guard{s_mutex};
184  //cppcheck-suppress identicalConditionAfterEarlyExit
185  if (m_canvCounter >= m_canvasLimit) {
186  return;
187  }
188  if (accumulator.getNonEmptyBins().empty()) {
189  ATH_MSG_WARNING("Hough accumulator is empty");
190  return;
191  }
192 
193  auto accHisto = std::make_unique<TH2F>("AccumulatorHisto", "histo",
194  accumulator.nBinsX(), axisRanges.xMin, axisRanges.xMax,
195  accumulator.nBinsY(), axisRanges.yMin, axisRanges.yMax);
196 
197  accHisto->SetDirectory(nullptr);
198  accHisto->GetXaxis()->SetTitle(std::format("tan#{}", m_accumlIsEta ? "theta" : "phi" ).c_str());
199  accHisto->GetYaxis()->SetTitle( std::string{m_accumlIsEta ? "y_{0}" : "x_{0}"}.c_str());
200 
201  std::vector<const SpacePoint*> spacePointsInAcc{};
202  for (const std::size_t bin : accumulator.getNonEmptyBins()) {
203  const auto [xBin, yBin] = accumulator.axisBins(bin);
204  const SpacePointSet& hitsInBin{accumulator.hitIds(xBin, yBin)};
205  spacePointsInAcc.insert(spacePointsInAcc.end(),hitsInBin.begin(), hitsInBin.end());
206  accHisto->SetBinContent(xBin+1, yBin+1, accumulator.nHits(bin));
207  }
208 
209  const LabeledSegmentSet truthSegs{getLabeledSegments(spacePointsInAcc)};
210  if (truthSegs.empty() && m_displayOnlyTruth) {
211  return;
212  }
213  for (const xAOD::MuonSegment* segment : truthSegs) {
214  const auto [pos, dir] = makeLine(localSegmentPars(*segment));
215  const double tan = m_accumlIsEta ? houghTanTheta(dir) : houghTanPhi(dir);
216  const double icept = pos[m_accumlIsEta ? objViewEta : objViewPhi];
217  auto truthMarker = std::make_unique<TMarker>(tan, icept, kFullCrossX);
218  truthMarker->SetMarkerColor(truthColor);
219  truthMarker->SetMarkerSize(8);
220  primitives.push_back(std::move(truthMarker));
221  primitives.push_back(drawLabel(std::format("true parameters: {:}",makeLabel(localSegmentPars(*segment))),0.2, 0.9));
222  }
223  for (const auto& maximum : maxima) {
224  auto maxMarker = std::make_unique<TMarker>(maximum.x, maximum.y, kFullTriangleUp);
225  maxMarker->SetMarkerColor(parLineColor);
226  maxMarker->SetMarkerSize(8);
227  primitives.push_back(std::move(maxMarker));
228  }
229  primitives.push_back(drawAtlasLabel(0.65, 0.26, m_AtlasLabel));
230  primitives.push_back(drawLumiSqrtS(0.65,0.21, m_sqrtSLabel, m_lumiLabel));
231 
232  std::stringstream canvasName{};
233  canvasName<<name()<<"_"<<ctx.eventID().event_number()<<"_"<<m_canvCounter;
234  auto canvas = std::make_unique<TCanvas>(canvasName.str().c_str(),
235  "can", m_canvasWidth, m_canvasHeight);
236  canvas->GetPad(0)->SetRightMargin(0.12);
237  canvas->GetPad(0)->SetTopMargin(0.12);
238  canvas->cd();
239  accHisto->Draw("COLZ");
240  drawPrimitives(*canvas, primitives);
241  primitives.push_back(std::move(accHisto));
242  saveCanvas(ctx, spacePointsInAcc.front()->identify(), *canvas, extraLabel);
243  primitives.push_back(std::move(canvas));
244 
245  primitives.clear();
246  if (m_canvasLimit <= m_canvCounter) {
248  }
249  }
250 
251  void PatternVisualizationTool::visualizeSeed(const EventContext& ctx,
252  const MuonR4::SegmentSeed& seed,
253  const std::string& extraLabel) const {
254  PrimitiveVec primitives{};
255  visualizeSeed(ctx, seed, extraLabel, std::move(primitives));
256  }
257  void PatternVisualizationTool::visualizeSeed(const EventContext& ctx,
258  const MuonR4::SegmentSeed& seed,
259  const std::string& extraLabel,
260  PrimitiveVec&& primitives) const {
261 
263  if (m_canvCounter >= m_canvasLimit) {
264  return;
265  }
267  std::lock_guard guard{s_mutex};
269  //cppcheck-suppress identicalConditionAfterEarlyExit
270  if (m_canvCounter >= m_canvasLimit) {
271  return;
272  }
273 
274  const LabeledSegmentSet truthSegs{getLabeledSegments(seed.getHitsInMax())};
275  if (truthSegs.empty() && m_displayOnlyTruth) {
276  return;
277  }
278 
279  std::array<double, 4> canvasDim{};
280  const std::size_t parsedPrimSize{primitives.size()};
281  for (const int view : {objViewEta, objViewPhi}) {
282  if ((view == objViewEta && !m_doEtaBucketViews) ||
284  continue;
285  }
287  primitives.resize(parsedPrimSize);
288 
289  if (!drawHits(*seed.parentBucket(), seed.getHitsInMax(), primitives, canvasDim, view)) {
290  continue;
291  }
292 
293  for (const xAOD::MuonSegment* segment : truthSegs) {
294  primitives.push_back(drawLine(localSegmentPars(*segment), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
295  truthColor, kDotted, view));
296  }
297  primitives.push_back(drawLine(seed.parameters(), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
298  parLineColor, kDashed, view));
299 
300  writeChi2(seed.parameters(), seed.getHitsInMax(), primitives);
301 
302  std::stringstream legendLabel{};
303  double chi2{0.};
304  unsigned nDoF{0};
305  legendLabel<<"Event: "<<ctx.eventID().event_number()<<", chamber : "<<m_idHelperSvc->toStringChamber(seed.getHitsInMax().front()->identify())
306  <<std::format(", #chi^{{2}} /nDoF: {:.2f} ({:})", chi2/std::max(1u, nDoF), std::max(1u,nDoF))
307  <<", #"<<(view ==objViewEta ? "eta" : "phi")<<"-view";
308 
309  if (!extraLabel.empty()) {
310  legendLabel<<" ("<<extraLabel<<")";
311  }
312  primitives.push_back(drawLabel(legendLabel.str(), 0.1, 0.96));
313  primitives.push_back(drawLabel(makeLabel(seed.parameters()),0.25, 0.89));
314 
315  auto canvas = makeCanvas(ctx, canvasDim, view);
316  primitives.push_back(drawAtlasLabel(0.75, 0.26, m_AtlasLabel));
317  primitives.push_back(drawLumiSqrtS(0.75,0.21, m_sqrtSLabel, m_lumiLabel));
318 
319  drawPrimitives(*canvas, primitives);
320 
321  saveCanvas(ctx, seed.getHitsInMax().front()->identify(), *canvas, extraLabel);
322  }
323  if (m_canvasLimit <= m_canvCounter) {
324  primitives.clear();
326  }
327  }
328 
329  void PatternVisualizationTool::visualizeBucket(const EventContext& ctx,
330  const MuonR4::SpacePointBucket& bucket,
331  const std::string& extraLabel) const {
332  PrimitiveVec primitives{};
333  visualizeBucket(ctx, bucket, extraLabel, std::move(primitives));
334  }
335  void PatternVisualizationTool::visualizeBucket(const EventContext& ctx,
336  const MuonR4::SpacePointBucket& bucket,
337  const std::string& extraLabel,
338  PrimitiveVec&& primitives) const {
340  if (m_canvCounter >= m_canvasLimit) {
341  return;
342  }
344  std::lock_guard guard{s_mutex};
346  //cppcheck-suppress identicalConditionAfterEarlyExit
347  if (m_canvCounter >= m_canvasLimit) {
348  return;
349  }
350  std::array<double, 4> canvasDim{};
352  if (truthSegs.empty() && m_displayOnlyTruth) {
353  return;
354  }
355  const std::size_t parsedPrimSize{primitives.size()};
356  for (const int view : {objViewEta, objViewPhi}) {
357  if ((view == objViewEta && !m_doEtaBucketViews) ||
359  continue;
360  }
362  primitives.resize(parsedPrimSize);
363  if (!drawHits(bucket, bucket, primitives, canvasDim, view)) {
364  continue;
365  }
366  bool drawnTrueLabel{false};
367  for (const xAOD::MuonSegment* segment : truthSegs) {
368  primitives.push_back(drawLine(localSegmentPars(*segment), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
369  truthColor, kDotted, view));
370  if (!drawnTrueLabel) {
371  primitives.push_back(drawLabel(std::format("true parameters: {:}",makeLabel(localSegmentPars(*segment))),0.2, 0.89));
372  drawnTrueLabel = true;
373  }
374  }
375 
376  std::stringstream legendLabel{};
377  legendLabel<<"Event: "<<ctx.eventID().event_number()
378  <<", chamber : "<<m_idHelperSvc->toStringChamber(bucket.front()->identify())
379  <<",#"<<(view ==objViewEta ? "eta" : "phi")<<"-view";
380  if (!extraLabel.empty()) {
381  legendLabel<<" ("<<extraLabel<<")";
382  }
383  primitives.push_back(drawLabel(legendLabel.str(), 0.2, 0.96));
384 
385  primitives.push_back(drawAtlasLabel(0.75, 0.26, m_AtlasLabel));
386  primitives.push_back(drawLumiSqrtS(0.75,0.21, m_sqrtSLabel, m_lumiLabel));
387 
388  auto can = makeCanvas(ctx , canvasDim, view);
389  drawPrimitives(*can, primitives);
390 
391  saveCanvas(ctx, bucket.front()->identify(), *can, extraLabel);
392  }
393  if (m_canvasLimit <= m_canvCounter) {
394  primitives.clear();
396  }
397 
398  }
399 
400  void PatternVisualizationTool::visualizeSegment(const EventContext& ctx,
401  const MuonR4::Segment& segment,
402  const std::string& extraLabel) const {
403  PrimitiveVec primitives{};
404  visualizeSegment(ctx, segment,extraLabel, std::move(primitives));
405  }
406 
407  void PatternVisualizationTool::visualizeSegment(const EventContext& ctx,
408  const MuonR4::Segment& segment,
409  const std::string& extraLabel,
410  PrimitiveVec&& primitives) const {
412  if (m_canvCounter >= m_canvasLimit) {
413  return;
414  }
416  std::lock_guard guard{s_mutex};
418  //cppcheck-suppress identicalConditionAfterEarlyExit
419  if (m_canvCounter >= m_canvasLimit) {
420  return;
421  }
422  const LabeledSegmentSet truthSegs{getLabeledSegments(segment.parent()->getHitsInMax())};
423  if (truthSegs.empty() && m_displayOnlyTruth) {
424  return;
425  }
426  Parameters segPars{};
427  {
428  SG::ReadHandle geoCtx{m_geoCtxKey, ctx};
429  const Amg::Transform3D trf{segment.msSector()->globalToLocalTrans(*geoCtx)};
430  const Amg::Vector3D locPos = trf * segment.position();
431  const Amg::Vector3D locDir = trf.linear() * segment.direction();
432  segPars[toInt(ParamDefs::x0)] = locPos.x();
433  segPars[toInt(ParamDefs::y0)] = locPos.y();
434  segPars[toInt(ParamDefs::theta)] = locDir.theta();
435  segPars[toInt(ParamDefs::phi)] = locDir.phi();
436  segPars[toInt(ParamDefs::time)] = segment.segementT0();
437  }
438 
439  std::array<double, 4> canvasDim{};
440  const std::size_t parsedPrimSize{primitives.size()};
441  for (const int view : {objViewEta, objViewPhi}) {
442  if ((view == objViewEta && !m_doEtaBucketViews) ||
444  continue;
445  }
447  primitives.resize(parsedPrimSize);
448 
449  if (!drawHits(*segment.parent()->parentBucket(), segment.measurements(),
450  primitives, canvasDim, view)) {
451  continue;
452  }
453  for (const xAOD::MuonSegment* segment : truthSegs) {
454  primitives.push_back(drawLine(localSegmentPars(*segment), canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
455  truthColor, kDotted, view));
456  }
457  writeChi2(segPars, segment.measurements(), primitives);
458 
459  primitives.push_back(drawAtlasLabel(0.75, 0.26, m_AtlasLabel));
460  primitives.push_back(drawLumiSqrtS(0.75,0.21, m_sqrtSLabel, m_lumiLabel));
461 
462  primitives.push_back(drawLine(segPars, canvasDim[Edges::zLow], canvasDim[Edges::zHigh],
463  parLineColor, kDashed, view));
464 
465 
466  std::stringstream legendLabel{};
467  const Identifier canvasId{segment.parent()->getHitsInMax().front()->identify()};
468  legendLabel<<"Event: "<<ctx.eventID().event_number() <<", chamber : "<<m_idHelperSvc->toStringChamber(canvasId)
469  <<std::format(", #chi^{{2}} /nDoF: {:.2f} ({:d})", segment.chi2() /std::max(1u, segment.nDoF()), segment.nDoF())
470  <<", #"<<(view ==objViewEta ? "eta" : "phi")<<"-view";
471 
472  if (!extraLabel.empty()) {
473  legendLabel<<" ("<<extraLabel<<")";
474  }
475  primitives.push_back(drawLabel(legendLabel.str(), 0.2, 0.96));
476  primitives.push_back(drawLabel(makeLabel(segPars),0.25, 0.91));
477 
478  auto canvas = makeCanvas(ctx, canvasDim, view);
479  drawPrimitives(*canvas, primitives);
480 
481  saveCanvas(ctx, canvasId, *canvas, extraLabel);
482  }
483  if (m_canvasLimit <= m_canvCounter) {
484  primitives.clear();
486  }
487  }
488 
489  template<class SpacePointType>
490  const SpacePoint*
491  PatternVisualizationTool::drawHit(const SpacePointType& hit, PrimitiveVec& primitives,
492  std::array<double, 4>& canvasDim, const unsigned int view,
493  unsigned int fillStyle) const {
494 
495  static_assert(std::is_same_v<SpacePointType, SpacePoint> ||
496  std::is_same_v<SpacePointType, CalibratedSpacePoint>, "Only usual & calibrated space points are supported");
498  if ((view == objViewEta && !hit.measuresEta()) || (view == objViewPhi && !hit.measuresPhi())) {
499  return nullptr;
500  }
501 
502  if (hit.type() != xAOD::UncalibMeasType::Other) {
503  canvasDim[Edges::yLow] = std::min(canvasDim[Edges::yLow], hit.positionInChamber()[view] - hit.driftRadius());
504  canvasDim[Edges::yHigh] = std::max(canvasDim[Edges::yHigh], hit.positionInChamber()[view] + hit.driftRadius());
505  canvasDim[Edges::zLow] = std::min(canvasDim[Edges::zLow], hit.positionInChamber().z() - hit.driftRadius());
506  canvasDim[Edges::zHigh] = std::max(canvasDim[Edges::zHigh], hit.positionInChamber().z() + hit.driftRadius());
507  }
508 
509  const SpacePoint* underlyingSp{nullptr};
511  constexpr int invalidCalibFill = 3305;
512  if constexpr (std::is_same_v<SpacePointType, SpacePoint>) {
513  underlyingSp = &hit;
514  if (hit.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
515  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(hit.primaryMeasurement());
517  fillStyle = invalidCalibFill;
518  }
519  }
520  } else if constexpr(std::is_same_v<SpacePointType, CalibratedSpacePoint>) {
521  underlyingSp = hit.spacePoint();
522  if (hit.fitState() == CalibratedSpacePoint::State::Valid) {
523  fillStyle = fullFilling;
524  } else if (hit.fitState() == CalibratedSpacePoint::State::FailedCalib) {
525  fillStyle = invalidCalibFill;
526  } else {
527  fillStyle = hatchedFilling;
528  }
529  }
530  switch(hit.type()) {
532  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(underlyingSp->primaryMeasurement());
533  primitives.push_back(drawDriftCircle(hit.positionInChamber(), dc->readoutElement()->innerTubeRadius(),
534  kBlack, hollowFilling));
535 
536  const int circColor = isLabeled(*dc) ? truthColor : kBlue;
537  primitives.push_back(drawDriftCircle(hit.positionInChamber(), hit.driftRadius(), circColor, fillStyle));
538  break;
540  const auto* meas{static_cast<const xAOD::RpcMeasurement*>(underlyingSp->primaryMeasurement())};
541  const int boxColor = isLabeled(*meas) ? truthColor : kGreen +2;
542  const double boxWidth = 0.5*std::sqrt(12)*underlyingSp->uncertainty()[view];
543  primitives.push_back(drawBox(hit.positionInChamber(), boxWidth, 0.5*meas->readoutElement()->gasGapPitch(),
544  boxColor, fillStyle));
545  break;
547  const auto* meas{static_cast<const xAOD::TgcStrip*>(underlyingSp->primaryMeasurement())};
548  const int boxColor = isLabeled(*meas) ? truthColor : kCyan + 2;
549  const double boxWidth = 0.5*std::sqrt(12)*underlyingSp->uncertainty()[view];
550  primitives.push_back(drawBox(hit.positionInChamber(), boxWidth, 0.5*meas->readoutElement()->gasGapPitch(),
551  boxColor, fillStyle));
552  break;
554  const auto* meas{static_cast<const xAOD::MMCluster*>(underlyingSp->primaryMeasurement())};
555  const int boxColor = isLabeled(*meas) ? truthColor : kAquamarine;
556  const double boxWidth = 0.5*Gaudi::Units::mm;
557  primitives.push_back(drawBox(hit.positionInChamber(), boxWidth, 10.*Gaudi::Units::mm,
558  boxColor, fillStyle));
559  break;
561  break;
562  } default:
563  ATH_MSG_WARNING("Please implement proper drawings of the new small wheel.. "<<__FILE__<<":"<<__LINE__);
564  break;
565  }
566  return underlyingSp;
567  }
568 
569  template<class SpacePointType>
571  const std::vector<SpacePointType>& hitsToDraw,
572  std::vector<PrimitivePtr>& primitives,
573  std::array<double, 4>& canvasDim,
574  unsigned int view) const {
575 
576  canvasDim[Edges::yLow] = canvasDim[Edges::zLow] = 100. *Gaudi::Units::m;
577  canvasDim[Edges::yHigh] = canvasDim[Edges::zHigh] = -100. *Gaudi::Units::m;
578 
579  SpacePointSet drawnPoints{};
580  for (const SpacePointType& hit : hitsToDraw) {
581  drawnPoints.insert(drawHit(*hit, primitives, canvasDim, view, fullFilling));
582  }
583  if (m_displayBucket) {
584  for (const SpacePointBucket::value_type& hit : bucket) {
585  // Don't redraw the other points
586  if (drawnPoints.count(hit.get())) {
587  continue;
588  }
589  drawHit(*hit, primitives, canvasDim, view, hollowFilling);
590  }
591  }
592 
593  // adapt the draw range to make sure any detector elements we wish to display
594  // are included
595  for (auto & prim : primitives){
596  TBox* theBox = dynamic_cast<TBox*>(prim.get());
597  if (theBox){
598  canvasDim[Edges::zLow] = std::min(canvasDim[Edges::zLow], theBox->GetY1());
599  canvasDim[Edges::zHigh] = std::max(canvasDim[Edges::zHigh], theBox->GetY2());
600  }
601  }
602 
603  double width = (canvasDim[Edges::yHigh] - canvasDim[Edges::yLow])*m_canvasExtraScale;
604  double height = (canvasDim[Edges::zHigh] - canvasDim[Edges::zLow])*m_canvasExtraScale;
605  if (height > width) width = height;
606  else height = width;
607 
608  const double midPointX = 0.5 * (canvasDim[Edges::yHigh] + canvasDim[Edges::yLow]);
609  const double midPointY = 0.5 * (canvasDim[Edges::zHigh] + canvasDim[Edges::zLow]);
610  canvasDim[Edges::yLow] = midPointX - 0.5 * width;
611  canvasDim[Edges::zLow] = midPointY - 0.5 * height;
612  canvasDim[Edges::yHigh] = midPointX + 0.5 * width;
613  canvasDim[Edges::zHigh] = midPointY + 0.5 * height;
614  return drawnPoints.size() - drawnPoints.count(nullptr) > 1;
615  }
616  template<class SpacePointType>
618  const std::vector<SpacePointType>& hits,
619  PrimitiveVec& primitives,
620  const double legX, double startLegY,
621  const double endLegY) const {
622 
623  const auto [locPos, locDir] = makeLine(pars);
624  for (const SpacePointType& hit : hits) {
625  const SpacePoint* underlyingSp{nullptr};
626  double chi2{0.};
627  if constexpr( std::is_same_v<SpacePointType, Segment::MeasType>) {
628  underlyingSp = hit->spacePoint();
630  std::nullopt, *hit, msgStream());
631  } else {
632  underlyingSp = hit;
633  chi2 = SegmentFitHelpers::chiSqTerm(locPos, locDir, *hit, msgStream());
634  }
635 
636  const Identifier hitId = underlyingSp ? underlyingSp->identify(): Identifier{};
637  std::string legendstream{};
638  switch(hit->type()) {
640  const int driftSign{SegmentFitHelpers::driftSign(locPos, locDir, *hit, msgStream())};
641  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
642  legendstream = std::format("ML: {:1d}, TL: {:1d}, T: {:3d}, {:}",
643  idHelper.multilayer(hitId), idHelper.tubeLayer(hitId),
644  idHelper.tube(hitId), driftSign == -1 ? "L" : "R");
645  break;
647  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
648  legendstream= std::format("DR: {:1d}, DZ: {:1d}, GAP: {:1d}, #eta/#phi: {:}/{:}",
649  idHelper.doubletR(hitId), idHelper.doubletZ(hitId), idHelper.gasGap(hitId),
650  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
651  break;
653  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
654  legendstream = std::format("ST: {:}, GAP: {:1d}, #eta/#phi: {:}/{:}",
655  m_idHelperSvc->stationNameString(hitId), idHelper.gasGap(hitId),
656  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
657  break;
659  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
660  const auto* clus = static_cast<const xAOD::MMCluster*>(underlyingSp->primaryMeasurement());
661  const MuonGMR4::StripDesign& design = clus->readoutElement()->stripLayer(clus->layerHash()).design();
662  legendstream = std::format("ML: {:1d}, GAP: {:1d}, {:}", idHelper.multilayer(hitId), idHelper.gasGap(hitId),
663  !design.hasStereoAngle() ? "X" : design.stereoAngle() > 0 ? "U" :"V");
664  break;
666  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
667  legendstream = std::format("ML: {:1d}, GAP: {:1d}, #eta/#phi: {:}/{:}",
668  idHelper.multilayer(hitId), idHelper.gasGap(hitId),
669  hit->measuresEta() ? "si" : "nay", hit->measuresPhi() ? "si" : "nay");
670  break;
671  }
672  default:
673  break;
674  }
675  legendstream+=std::format(", #chi^{{2}}: {:.2f}", chi2);
676  primitives.push_back(drawLabel(legendstream, legX, startLegY, 14));
677  startLegY -= 0.05;
678  if (startLegY<= endLegY) {
679  break;
680  }
681  }
682  }
684  if (!m_outFile) return;
685  ATH_MSG_INFO("Close summary pdf & root file "<<m_allCanName);
686  if (m_allCan) {
687  m_allCan->cd();
688  m_allCan->SaveAs((m_allCanName +".pdf]").c_str());
689  m_allCan.reset();
690  }
691  m_outFile.reset();
692  }
693  std::unique_ptr<TCanvas> PatternVisualizationTool::makeCanvas(const EventContext& ctx,
694  const std::array<double, 4>& canvasDim,
695  const int view) const {
696  std::stringstream canvasName{};
697  canvasName<<name()<<"_"<<ctx.eventID().event_number()<<"_"<<m_canvCounter;
698  ATH_MSG_VERBOSE("Create new canvas "<<canvasName.str()<<" "<<canvasDim);
699  auto canvas = std::make_unique<TCanvas>(canvasName.str().c_str(), "all", m_canvasWidth, m_canvasHeight);
700  canvas->cd();
701  TH1F* frame = canvas->DrawFrame(canvasDim[Edges::yLow],canvasDim[Edges::zLow], canvasDim[Edges::yHigh], canvasDim[Edges::zHigh]);
702  frame->GetXaxis()->SetTitle(std::format("{:} [mm]", view == objViewEta ? 'y' : 'x').c_str());
703  frame->GetYaxis()->SetTitle("z [mm]");
704  return canvas;
705  }
706  void PatternVisualizationTool::saveCanvas(const EventContext& ctx,
707  const Identifier& chambId,
708  TCanvas& canvas,
709  const std::string& extraLabel) const {
710  // If an eta view closes the summary canvas & a phi view is processed
711  std::stringstream canvasName{};
712  canvasName<<m_canvasPrefix.value()<<"_"<<ctx.eventID().event_number()<<"_"<<(m_canvCounter++)<<"_"
713  <<m_idHelperSvc->stationNameString(chambId)
714  <<std::abs(m_idHelperSvc->stationEta(chambId))
715  <<(m_idHelperSvc->stationEta(chambId) >0 ? "A" : "C")
716  <<m_idHelperSvc->stationPhi(chambId);
717  if (!extraLabel.empty()) canvasName<<"_"<<removeNonAlphaNum(extraLabel);
718  ATH_MSG_VERBOSE("Save new plot "<<canvasName.str());
719  if (m_saveSinglePDFs) {
720  canvas.SaveAs(("Plots/" + m_canvasPrefix+"/" + canvasName.str()+".pdf").c_str());
721  }
722  if (m_saveSummaryPDF) {
723  canvas.SaveAs((m_allCanName+".pdf").c_str());
724  }
725  m_outFile->WriteObject(&canvas, canvasName.str().c_str());
726  }
727 }
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:213
MuonValR4::fullFilling
constexpr int fullFilling
Definition: VisualizationHelpers.h:20
MuonR4::PrimitiveVec
MuonValR4::IPatternVisualizationTool::PrimitiveVec PrimitiveVec
Definition: SegmentFittingAlg.cxx:57
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MuonValR4::LabeledSegmentSet
PatternVisualizationTool::LabeledSegmentSet LabeledSegmentSet
Definition: PatternVisualizationTool.cxx:57
MuonSimHitHelpers.h
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
checkFileSG.line
line
Definition: checkFileSG.py:75
MuonValR4::PatternVisualizationTool::m_canvasWidth
Gaudi::Property< unsigned > m_canvasWidth
Definition: PatternVisualizationTool.h:206
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
HoughMaximum.h
MuonR4::SegmentFit::Parameters
AmgVector(toInt(ParamDefs::nPars)) Parameters
Definition: MuonHoughDefs.h:48
MuonR4::SpacePointBucket
: The muon space point bucket represents a collection of points that will bre processed together in t...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:21
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonValR4::PatternVisualizationTool::s_mutex
static std::mutex s_mutex
Definition: PatternVisualizationTool.h:219
MuonValR4::PatternVisualizationTool::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Geometry context key to retrieve the alignment.
Definition: PatternVisualizationTool.h:215
TgcIdHelper
Definition: TgcIdHelper.h:50
VisualizationHelpers.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MuonValR4::PatternVisualizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Service Handle to the IMuonIdHelperSvc.
Definition: PatternVisualizationTool.h:217
MuonValR4::PatternVisualizationTool::m_canvasPrefix
Gaudi::Property< std::string > m_canvasPrefix
Prefix of the individual canvas file names <MANDATORY>
Definition: PatternVisualizationTool.h:177
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
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
SegmentSeed.h
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
MuonValR4::PatternVisualizationTool::finalize
virtual StatusCode finalize() override final
Definition: PatternVisualizationTool.cxx:104
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
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:32
MuonValR4::PatternVisualizationTool::visualizeSegment
virtual void visualizeSegment(const EventContext &ctx, const MuonR4::Segment &segment, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:400
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:706
MuonR4::HoughPlane
Acts::HoughTransformUtils::HoughPlane< HoughHitType > HoughPlane
Definition: MuonHoughDefs.h:20
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)
Definition: VisualizationHelpers.cxx:50
MuonR4::SpacePoint::secondaryMeasurement
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:110
MuonR4::stripSmartPtr
HitVec stripSmartPtr(const SpacePointBucket &bucket)
Definition: SpacePointPerLayerSorter.cxx:10
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
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:693
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey< xAOD::UncalibratedMeasurementContainer >
MuonValR4::PatternVisualizationTool::m_truthLinkDecorKeys
SG::ReadDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_truthLinkDecorKeys
Declaration of the dependency on the decorations.
Definition: PatternVisualizationTool.h:200
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::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:23
MuonValR4::PatternVisualizationTool::m_prepContainerKeys
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_prepContainerKeys
Declare dependency on the prep data containers.
Definition: PatternVisualizationTool.h:196
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:119
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
MuonValR4::PatternVisualizationTool::m_displayOnlyTruth
Gaudi::Property< bool > m_displayOnlyTruth
Definition: PatternVisualizationTool.h:209
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:181
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:107
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:232
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:251
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:162
MuonValR4::PatternVisualizationTool::m_sqrtSLabel
Gaudi::Property< std::string > m_sqrtSLabel
Centre of mass energy label.
Definition: PatternVisualizationTool.h:192
DeMoAtlasDataLoss.canvas
dictionary canvas
Definition: DeMoAtlasDataLoss.py:187
MuonValR4::PatternVisualizationTool::isLabeled
virtual bool isLabeled(const MuonR4::SpacePoint &hit) const override final
Fetches all labeled (e.g.
Definition: PatternVisualizationTool.cxx:108
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SegmentFitHelperFunctions.h
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
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
MdtIdHelper
Definition: MdtIdHelper.h:61
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::Other
@ Other
MuonValR4::objViewPhi
constexpr int objViewPhi
Definition: VisualizationHelpers.h:25
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:617
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:186
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
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:170
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:570
MdtDriftCircle.h
MuonValR4::PatternVisualizationTool::m_canvasLimit
Gaudi::Property< unsigned int > m_canvasLimit
Maximum canvases to draw.
Definition: PatternVisualizationTool.h:168
MuonR4::SegmentFit::ParamDefs::time
@ time
beamspotman.dir
string dir
Definition: beamspotman.py:623
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:18
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition: IPatternVisualizationTool.h:23
MuonValR4::PatternVisualizationTool::initialize
virtual StatusCode initialize() override final
Definition: PatternVisualizationTool.cxx:62
TgcStrip.h
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MuonR4::SegmentFit::ParamDefs::y0
@ y0
MuonValR4::objViewEta
constexpr int objViewEta
ObjectView.
Definition: VisualizationHelpers.h:24
MuonValR4::PatternVisualizationTool::LabeledSegmentSet
std::unordered_set< const xAOD::MuonSegment * > LabeledSegmentSet
Definition: PatternVisualizationTool.h:79
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
sTgcIdHelper
Definition: sTgcIdHelper.h:55
RpcMeasurement.h
MuonValR4::PatternVisualizationTool::m_AtlasLabel
Gaudi::Property< std::string > m_AtlasLabel
ATLAS label (Internal / Prelimnary / Simulation)
Definition: PatternVisualizationTool.h:190
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:173
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:113
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MuonValR4::PatternVisualizationTool::m_lumiLabel
Gaudi::Property< std::string > m_lumiLabel
Luminosity label.
Definition: PatternVisualizationTool.h:194
MuonValR4::PatternVisualizationTool::m_doPhiBucketViews
Gaudi::Property< bool > m_doPhiBucketViews
Switch to visualize the phi view of the bucket event.
Definition: PatternVisualizationTool.h:188
MmIdHelper
Definition: MmIdHelper.h:54
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
SegmentFitterEventData.h
MuonValR4::PatternVisualizationTool::drawPrimitives
void drawPrimitives(const TCanvas &can, PrimitiveVec &primitives) const
Draw the various primitives onto the Canvas.
Definition: PatternVisualizationTool.cxx:141
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:683
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonR4::SegmentSeed
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Definition: SegmentSeed.h:14
MuonValR4::PatternVisualizationTool::m_displayBucket
Gaudi::Property< bool > m_displayBucket
Display the surrounding hits from the bucket not part of the seed.
Definition: PatternVisualizationTool.h:179
MuonValR4::PatternVisualizationTool::m_canvasHeight
Gaudi::Property< unsigned > m_canvasHeight
Definition: PatternVisualizationTool.h:207
MuonValR4::hollowFilling
constexpr int hollowFilling
Filling codes for hollow / fullFilling / hatched filling.
Definition: VisualizationHelpers.h:19
MuonValR4::PatternVisualizationTool::m_truthLinkDecors
std::vector< SegLinkDecor_t > m_truthLinkDecors
Definition: PatternVisualizationTool.h:204
MuonValR4::PatternVisualizationTool::PatternVisualizationTool
PatternVisualizationTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PatternVisualizationTool.cxx:59
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
MMCluster.h
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
str
Definition: BTagTrackIpAccessor.cxx:11
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:63
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:184
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
Segment.h
MuonValR4::PatternVisualizationTool::visualizeBucket
virtual void visualizeBucket(const EventContext &ctx, const MuonR4::SpacePointBucket &bucket, const std::string &extraLabel) const override final
Definition: PatternVisualizationTool.cxx:329
python.compressB64.c
def c
Definition: compressB64.py:93
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:198
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:67
MuonR4::SegmentFit::ParamDefs::theta
@ theta
MuonValR4::hatchedFilling
constexpr int hatchedFilling
Definition: VisualizationHelpers.h:21
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:175
drawFromPickle.view
view
Definition: drawFromPickle.py:294
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14
PatternVisualizationTool.h