ATLAS Offline Software
Namespaces | Classes | Typedefs | Functions | Variables
MuonValR4 Namespace Reference

Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a validation NTuple with identifier and drift circle info. More...

Namespaces

 detail
 

Classes

class  IPatternVisualizationTool
 Helper tool to visualize a pattern recogntion incident or a certain stage of the segment fit. More...
 
class  IRootVisualizationService
 Definition of the IRootVisualizationService interface. More...
 
class  ITrackVisualizationTool
 Helper tool to visualize a pattern recogntion incident or a certain stage of the segment fit. More...
 
class  MdtCalibDbAlgTest
 
class  MdtDriftCircleVariables
 
class  MdtTwinDriftCircleVariables
 
class  MmClusterVariables
 
class  MsTrackTester
 
class  MuonHitTesterAlg
 
class  MuonHoughTransformTester
 
class  MuonRecoChainTester
 
class  MuonSPCalibrationTest
 
class  PatternVisualizationTool
 
class  RootVisualizationService
 Implementation of the IRootVisualization service. More...
 
class  RpcMeasurementVariables
 
class  SegmentExtpTest
 
class  SegmentRefitTest
 Simple tester class to refit the Mdt segments with the Acts global chi2 fitter In the ideal case, the Acts fit should return the same parameters as the Muon segment fitter with the same measurements to be included on the fit. More...
 
class  SimHitTester
 
class  SpacePointTesterModule
 
class  TesterModuleBase
 
class  TgcStripVariables
 
class  TrackContainerModule
 
class  TrackSummaryModule
 
class  TrackSummaryValueBranch
 Helper branch class to dump a pick a single hit summary value from the overall summary & to dump it in the tree. More...
 
class  TrackVisualizationTool
 
class  xMuonHitAnalysis
 

Typedefs

using ObjectMatching = MuonHoughTransformTester::ObjectMatching
 
using simHitSet = std::unordered_set< const xAOD::MuonSimHit * >
 
using LabeledSegmentSet = PatternVisualizationTool::LabeledSegmentSet
 
using Category = MuonR4::HitSummary::HitCategory
 
using Status = MuonR4::HitSummary::Status
 
using ICanvasObject = RootVisualizationService::ICanvasObject
 

Functions

unsigned int countMatched (const simHitSet &truthHits, const simHitSet &recoHits)
 
unsigned int countMatched (const xAOD::MuonSegment *truthSeg, const MuonR4::SegmentSeed *seed)
 
unsigned int countMatched (const xAOD::MuonSegment *truthSeg, const MuonR4::Segment *segment)
 
template<class SpType >
bool isPrecHit (const SpType &sp)
 Define a spacepoint as precision hit if it's a Mdt or NSW eta hit. More...
 
std::string nameBr (Category cat, Status status, LayerIndex layer, bool isSmall)
 
std::string removeNonAlphaNum (std::string str)
 Removes all non-alpha numerical characters from a string. More...
 
void ensureDirectory (const std::string &path)
 Ensures that the subdirectory in the path is created. More...
 
void drawPropagation (const std::vector< Acts::detail::Step > &steps, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine)
 Draws the recorded propagation steps as a polygon line. More...
 
void drawBoundParameters (const ActsTrk::GeometryContext &gctx, const Acts::BoundTrackParameters &pars, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=3.*Gaudi::Units::cm)
 Draw a line representing the bound track parameters. More...
 
void drawSegmentLine (const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=1.*Gaudi::Units::m)
 Draw a segment line inside the obj file. More...
 
void drawSegmentMeasurements (const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewSensitive)
 Draw all uncalibrated measurements associated to the segment. More...
 
void drawMeasurement (const ActsTrk::GeometryContext &gctx, const xAOD::UncalibratedMeasurement *meas, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewSensitive)
 Draw an uncalibrated measurement inside the obj file. More...
 
std::vector< std::unique_ptr< TObject > > clone (const std::vector< std::unique_ptr< TObject >> &cloneMe)
 
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. More...
 
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. More...
 
std::unique_ptr< TBox > drawBox (const double x1, const double y1, const double x2, const double y2, const int color=kGreen+2, const int fillStyle=hollowFilling)
 Creates a box for drawing, e.g strip measurements. More...
 
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. More...
 
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)
 
std::unique_ptr< TLatex > drawLabel (const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
 Create a TLatex label,. More...
 
std::unique_ptr< TLatex > drawAtlasLabel (const double xPos, const double yPos, const std::string &status="Internal")
 Create a ATLAS label. More...
 
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. More...
 

Variables

constexpr int hollowFilling = 0
 Filling codes for hollow / fullFilling / hatched filling. More...
 
constexpr int fullFilling = 1001
 
constexpr int hatchedFilling = 3344
 
constexpr int objViewEta = Acts::toUnderlying(MuonR4::SegmentFit::AxisDefs::etaCov)
 ObjectView. More...
 
constexpr int objViewPhi = Acts::toUnderlying(MuonR4::SegmentFit::AxisDefs::phiCov)
 

Detailed Description

Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a validation NTuple with identifier and drift circle info.

Module to dump the basic properties of the TgcStrip collection.

Module to dump the basic properties of the RpcMeasurement collection.

Module to dump the basic properties of the MmCluster collection.

Module to dump the basic properties of the MdtTwinDriftCircle collection.

Module to dump the basic properties of the MdtDriftCircle collection.

Typedef Documentation

◆ Category

Definition at line 14 of file TrackSummaryModule.cxx.

◆ ICanvasObject

using MuonValR4::ICanvasObject = typedef RootVisualizationService::ICanvasObject

Definition at line 33 of file RootVisualizationService.cxx.

◆ LabeledSegmentSet

Definition at line 40 of file PatternVisualizationTool.cxx.

◆ ObjectMatching

Definition at line 28 of file MuonHoughTransformTester.cxx.

◆ simHitSet

using MuonValR4::simHitSet = typedef std::unordered_set<const xAOD::MuonSimHit*>

Definition at line 29 of file MuonHoughTransformTester.cxx.

◆ Status

Definition at line 15 of file TrackSummaryModule.cxx.

Function Documentation

◆ clone()

std::vector< std::unique_ptr< TObject > > MuonValR4::clone ( const std::vector< std::unique_ptr< TObject >> &  cloneMe)

Definition at line 13 of file VisualizationHelpers.cxx.

13  {
14  std::vector<std::unique_ptr<TObject>> cloned{};
15  for (auto& obj : cloneMe) {
16  cloned.emplace_back(obj->Clone());
17  }
18  return cloned;
19  }

◆ countMatched() [1/3]

unsigned int MuonValR4::countMatched ( const simHitSet truthHits,
const simHitSet recoHits 
)

Definition at line 30 of file MuonHoughTransformTester.cxx.

31  {
32  unsigned int matched{0};
33  for (const xAOD::MuonSimHit* reco : recoHits) {
34  matched += truthHits.count(reco);
35  }
36  return matched;
37  }

◆ countMatched() [2/3]

unsigned int MuonValR4::countMatched ( const xAOD::MuonSegment truthSeg,
const MuonR4::Segment segment 
)

Definition at line 42 of file MuonHoughTransformTester.cxx.

43  {
44  return truthSeg ? countMatched(getMatchingSimHits(*truthSeg), getMatchingSimHits(*segment)) : 0;
45  }

◆ countMatched() [3/3]

unsigned int MuonValR4::countMatched ( const xAOD::MuonSegment truthSeg,
const MuonR4::SegmentSeed seed 
)

Definition at line 38 of file MuonHoughTransformTester.cxx.

39  {
40  return truthSeg ? countMatched(getMatchingSimHits(*truthSeg), getMatchingSimHits(*seed)) : 0;
41  }

◆ drawArrow()

std::unique_ptr< TArrow > MuonValR4::drawArrow ( const Amg::Vector3D start,
const Amg::Vector3D dir,
const int  color = kRed +1,
const int  lineStyle = kDashed,
const int  view = objViewEta 
)

Definition at line 30 of file VisualizationHelpers.cxx.

31  {
32  constexpr double arrowLength = 2.*Gaudi::Units::cm;
33  const Amg::Vector3D end = start + (arrowLength / std::hypot(dir[view], dir.z()) ) * dir;
34  auto arrow = std::make_unique<TArrow>(start[view], start.z(), end[view], end.z(),0.01);
35  arrow->SetLineColor(color);
36  arrow->SetLineWidth(2);
37  arrow->SetLineStyle(lineStyle);
38  return arrow;
39  }

◆ drawAtlasLabel()

std::unique_ptr< TLatex > MuonValR4::drawAtlasLabel ( const double  xPos,
const double  yPos,
const std::string &  status = "Internal" 
)

Create a ATLAS label.

Parameters
xPosx-position of the label on the Canvas
yPosy-position of the label on the Canvas
statusATLAS label status to be drawn

Definition at line 80 of file VisualizationHelpers.cxx.

81  {
82  return drawLabel( "#font[72]{ATLAS} "+status, xPos, yPos);
83  }

◆ drawBoundParameters()

void MuonValR4::drawBoundParameters ( const ActsTrk::GeometryContext gctx,
const Acts::BoundTrackParameters &  pars,
Acts::ObjVisualization3D &  visualHelper,
const Acts::ViewConfig &  viewConfig = Acts::s_viewLine,
const double  standardLength = 3.*Gaudi::Units::cm 
)

Draw a line representing the bound track parameters.

Parameters
gctxGeometry context to align the parameters globally
parsBound track parameters to draw
vsualHelperObj helper to which the drawn line is appended
viewConfigConfiguration style of the drawn line
standardLengthLength of the segment as a fallback solution

Definition at line 175 of file ObjVisualizationHelpers.cxx.

179  {
180  const Amg::Vector3D globPos = pars.position(gctx.context());
181  const Amg::Vector3D start = globPos - 0.5 * standardLength * pars.direction();
182  const Amg::Vector3D end = globPos + 0.5 * standardLength * pars.direction();
183  Acts::GeometryView3D::drawSegment(visualHelper, start, end, viewConfig);
184  }

◆ drawBox() [1/2]

std::unique_ptr< TBox > MuonValR4::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.

Parameters
boxCenterCenter of the box to be placed expressed in chamber frame coordinates
boxWidthWidth of the drawn box
boxHeightHeight of the drawn box
colorColor of the surrounding line & filling
fillStyleBox fill style
viewIs the box placed in the y-z or in the x-z plane

Definition at line 49 of file VisualizationHelpers.cxx.

52  {
53  return drawBox(boxCenter[view] - 0.5*boxWidth, boxCenter.z() - 0.5*boxHeight,
54  boxCenter[view] + 0.5*boxWidth, boxCenter.z() + 0.5*boxHeight,
55  color, fillStyle);
56  }

◆ drawBox() [2/2]

std::unique_ptr< TBox > MuonValR4::drawBox ( const double  x1,
const double  y1,
const double  x2,
const double  y2,
const int  color = kGreen +2,
const int  fillStyle = hollowFilling 
)

Creates a box for drawing, e.g strip measurements.

Parameters
x1Left edge location
y1Bottom edge location
x2Right edge location
y2TopEdgeLocation
colorColor of the surrounding line & filling
fillStyleBox fill style
viewIs the box placed in the y-z or in the x-z plane

Definition at line 57 of file VisualizationHelpers.cxx.

59  {
60  auto box = std::make_unique<TBox>(x1,y1,x2,y2);
61  box->SetFillColor(color);
62  box->SetLineColor(color);
63  box->SetFillStyle(fillStyle);
64  box->SetFillColorAlpha(color, 0.8);
65  return box;
66  }

◆ drawDriftCircle()

std::unique_ptr< TEllipse > MuonValR4::drawDriftCircle ( const Amg::Vector3D center,
const double  radius,
const int  color = kViolet,
const int  fillStyle = hollowFilling 
)

Create a TEllipse for drawing a drift circle.

Parameters
centerPosition of the drift cirle expressed in the chambers frame y-coordinate corresponds to the tube layer z-coordinate corresponds to the tube in the layer
radiusRadius of the drift circle to draw
colorColor of the circle to draw
fillStyleStyle to pick the filling of the circle

Definition at line 20 of file VisualizationHelpers.cxx.

22  {
23  auto ellipse = std::make_unique<TEllipse>(center.y(), center.z(), radius);
24  ellipse->SetLineColor(color);
25  ellipse->SetFillStyle(fillStyle);
26  ellipse->SetLineWidth(1);
27  ellipse->SetFillColorAlpha(color, 0.2);
28  return ellipse;
29  }

◆ drawLabel()

std::unique_ptr< TLatex > MuonValR4::drawLabel ( const std::string &  text,
const double  xPos,
const double  yPos,
const unsigned int  fontSize = 18 
)

Create a TLatex label,.

Parameters
textLabel text
xPosx-position of the label on the Canvas
yPosy-position of the label on the Canvas
fontSizeSize of the label font

Definition at line 40 of file VisualizationHelpers.cxx.

42  {
43  auto tl = std::make_unique<TLatex>(xPos, yPos, text.c_str());
44  tl->SetNDC();
45  tl->SetTextFont(43);
46  tl->SetTextSize(fontSize);
47  return tl;
48  }

◆ drawLine()

std::unique_ptr<TLine> MuonValR4::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.

Parameters
parsSegment fit parameters to extract position & direction from
lowEndLower boundary in Canvas-y of the line
highEndUpper boundaty in Canbas-y of the line
colorColor of the line (Cf. TColor documentation)
lineStyleStyle of the drawn line (cf. TAttLine documentation)
viewIs the line placed in the y-z or in the x-z plane

Definition at line 67 of file VisualizationHelpers.cxx.

70  {
71  const auto [pos, dir] = makeLine(pars);
72  const double x1 = (pos + Amg::intersect<3>(pos,dir,Amg::Vector3D::UnitZ(), lowEnd).value_or(0.)* dir)[view];
73  const double x2 = (pos + Amg::intersect<3>(pos,dir,Amg::Vector3D::UnitZ(), highEnd).value_or(0.)* dir)[view];
74  auto seedLine = std::make_unique<TLine>(x1, lowEnd, x2, highEnd);
75  seedLine->SetLineColor(color);
76  seedLine->SetLineWidth(2);
77  seedLine->SetLineStyle(lineStyle);
78  return seedLine;
79  }

◆ drawLumiSqrtS()

std::unique_ptr< TLatex > MuonValR4::drawLumiSqrtS ( const double  xPos,
const double  yPos,
const std::string_view  sqrtS = "14",
const std::string_view  lumi = "" 
)

Create a luminosity sqrtS label.

Parameters
xPosx-position of the label on the Canvas
yPosy-position of the label on the Canvas
sqrtSCentre of mass energy [TeV]
lumiLuminosity [fb^{-1}]. If less <0 not drawn

Definition at line 84 of file VisualizationHelpers.cxx.

87  {
88  return drawLabel(std::format("#sqrt{{s}}={0} TeV {1}{2}", sqrtS, lumi, lumi.empty() ? "" : "fb^{-1}"), xPos, yPos);
89  }

◆ drawMeasurement()

void MuonValR4::drawMeasurement ( const ActsTrk::GeometryContext gctx,
const xAOD::UncalibratedMeasurement meas,
Acts::ObjVisualization3D &  visualHelper,
const Acts::ViewConfig &  viewConfig = Acts::s_viewSensitive 
)

Draw an uncalibrated measurement inside the obj file.

The measurement is translated to a temporary surface with adapted position & boundaries (e.g. drift radius or measurement uncertainty)

Parameters
gctxGeometry context needed to fetch the positions of the surface
measPointer to the muon measurement to visualize
vsualHelperObj helper to which the measurement is appended.
viewConfigConfiguration style of the drawn measurement

Combined pseudo measurement

Check whether the measurement is a phi measurement or not

2D RPC or sTGC pad

Combined pseudo measurement

Check whether the measurement is a phi measurement or not

2D RPC or sTGC pad

Definition at line 90 of file ObjVisualizationHelpers.cxx.

93  {
94 
95  const Acts::Surface& surf = xAOD::muonSurface(meas);
96  const Acts::GeometryContext tgContext = gctx.context();
97  const auto& bounds = surf.bounds();
99  const auto& lBounds = static_cast<const Acts::LineBounds&>(bounds);
100  const auto* driftCirc = static_cast<const xAOD::MdtDriftCircle*>(meas);
101  const double dR = driftCirc->driftRadius();
102  const double hZ = driftCirc->numDimensions() == 1 ?
103  lBounds.get(Acts::LineBounds::eHalfLengthZ) :
104  std::sqrt(meas->localCovariance<2>()(1,1));
105  auto newBounds = std::make_unique<Acts::LineBounds>(dR, hZ);
106  auto dummySurface = Acts::Surface::makeShared<Acts::StrawSurface>(surf.transform(tgContext)*
107  Amg::getTranslate3D(driftCirc->localMeasurementPos()),
108  std::move(newBounds));
109  Acts::GeometryView3D::drawSurface(visualHelper, *dummySurface, tgContext,
110  Amg::Transform3D::Identity(), viewConfig);
111  return;
112  }
113  double dX{0.}, dY{0.};
115  switch (meas->numDimensions()) {
117  case 0:{
118  const auto* cmbMeas = static_cast<const xAOD::CombinedMuonStrip*>(meas);
119  locPos[Amg::x] = cmbMeas->primaryStrip()->localPosition<1>()[0];
120  locPos[Amg::y] = cmbMeas->secondaryStrip()->localPosition<1>()[0];
121  dX = std::sqrt(cmbMeas->primaryStrip()->localCovariance<1>()(0,0));
122  dY = std::sqrt(cmbMeas->secondaryStrip()->localCovariance<1>()(0,0));
123  break;
124  } case 1:{
126  if (meas->type() == xAOD::UncalibMeasType::RpcStripType) {
127  const auto* rpcClus = static_cast<const xAOD::RpcMeasurement*>(meas);
128  locPos = rpcClus->localMeasurementPos();
129  dX = rpcClus->measuresPhi() ? 0.5* rpcClus->readoutElement()->stripPhiLength()
130  : std::sqrt(rpcClus->localCovariance<1>()(0,0));
131  dY = rpcClus->measuresPhi() ? std::sqrt(rpcClus->localCovariance<1>()(0,0))
132  : 0.5* rpcClus->readoutElement()->stripEtaLength();
133  } else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
134  const auto* tgcClus = static_cast<const xAOD::TgcStrip*>(meas);
135  const MuonGMR4::TgcReadoutElement* re = tgcClus->readoutElement();
136  const auto& stripLay = re->sensorLayout(tgcClus->measurementHash());
137  locPos = tgcClus->localMeasurementPos();
138  dX = tgcClus->measuresPhi() ? 0.5* stripLay->design(true).stripLength(tgcClus->channelNumber())
139  : std::sqrt(tgcClus->localCovariance<1>()(0,0));
140  dY = tgcClus->measuresPhi() ? std::sqrt(tgcClus->localCovariance<1>()(0,0))
141  : 0.5* stripLay->design(false).stripLength(tgcClus->channelNumber());
142  } else if (meas->type() == xAOD::UncalibMeasType::MMClusterType) {
143  const auto* mmClust = static_cast<const xAOD::MMCluster*>(meas);
144  locPos = mmClust->localMeasurementPos();
145  dX = std::sqrt(mmClust->localCovariance<1>()(0,0));
146  dY = 0.5* mmClust->readoutElement()->stripLength(mmClust->measurementHash());
147  } else if(meas->type() == xAOD::UncalibMeasType::sTgcStripType) {
148  const auto* sTgcClus = static_cast<const xAOD::sTgcMeasurement*>(meas);
149  locPos = sTgcClus->localMeasurementPos();
150  if (sTgcClus->channelType() == sTgcIdHelper::sTgcChannelTypes::Strip){
151  dX = std::sqrt(sTgcClus->localCovariance<1>()(0,0));
152  dY = 0.5* sTgcClus->readoutElement()->stripDesign(sTgcClus->measurementHash()).stripLength(sTgcClus->channelNumber());
153  } else if (sTgcClus->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire) {
154  dY = std::sqrt(sTgcClus->localCovariance<1>()(0,0));
155  dY = 0.5*sTgcClus->readoutElement()->wireDesign(sTgcClus->measurementHash()).stripLength(sTgcClus->channelNumber());
156  }
157  }
158  break;
159  }
161  case 2:{
162  locPos.block<2,1>(0, 0) = xAOD::toEigen(meas->localPosition<2>());
163  dX = std::sqrt(meas->localCovariance<2>()(0,0));
164  dY = std::sqrt(meas->localCovariance<2>()(1,1));
165  break;
166  }
167  }
168  auto newBounds = std::make_unique<Acts::RectangleBounds>(dX, dY);
169  auto dummySurf = Acts::Surface::makeShared<Acts::PlaneSurface>(surf.transform(tgContext)*
170  Amg::getTranslate3D(locPos),
171  std::move(newBounds));
172  Acts::GeometryView3D::drawSurface(visualHelper, *dummySurf, tgContext,
173  Amg::Transform3D::Identity(), viewConfig);
174  }

◆ drawPropagation()

void MuonValR4::drawPropagation ( const std::vector< Acts::detail::Step > &  steps,
Acts::ObjVisualization3D &  visualHelper,
const Acts::ViewConfig &  viewConfig = Acts::s_viewLine 
)

Draws the recorded propagation steps as a polygon line.

Parameters
stepList of steps to draw
vsualHelperObj helper to which the drawn trajectory is appended
viewConfigConfiguration style of the drawn polygon.

Definition at line 29 of file ObjVisualizationHelpers.cxx.

31  {
32 
33  if (steps.empty()) {
34  return;
35  }
36  Amg::Vector3D start = steps.front().position;
37  for (std::size_t s = 1; s < steps.size(); ++s) {
38  Amg::Vector3D end = steps[s].position;
39  if ( (end - start).mag() > Acts::s_epsilon){
40  Acts::GeometryView3D::drawSegment(visualHelper, start, end, viewConfig);
41  start = std::move(end);
42  }
43 
44  }
45  }

◆ drawSegmentLine()

void MuonValR4::drawSegmentLine ( const ActsTrk::GeometryContext gctx,
const xAOD::MuonSegment segment,
Acts::ObjVisualization3D &  visualHelper,
const Acts::ViewConfig &  viewConfig = Acts::s_viewLine,
const double  standardLength = 1.*Gaudi::Units::m 
)

Draw a segment line inside the obj file.

If the segment is a reconstructed segment and has associated measurements, then the first and last surface position is used to determine the length of the segment, otherwise the standard lenth is used.

Parameters
gctxGeometry context needed to fetch the positions of the first & last measurement
segmentThe segment which is meant to draw
vsualHelperObj helper to which the segment is appended.
viewConfigConfiguration style of the drawn line
standardLengthLength of the segment as a fallback solution

Take the local z component of the local to global transform as plane normal

Create the intersections

Take the local z component of the local to global transform as plane normal

Create the intersections

Definition at line 46 of file ObjVisualizationHelpers.cxx.

50  {
51 
52  std::vector<const xAOD::UncalibratedMeasurement*> assocMeas = collectMeasurements(segment, false);
53  if (assocMeas.empty()){
54  Acts::GeometryView3D::drawSegment(visualHelper,
55  segment.position() - 0.5 * standardLength * segment.direction(),
56  segment.position() + 0.5 * standardLength * segment.direction(),
57  viewConfig);
58  return;
59  }
60  const xAOD::UncalibratedMeasurement* firstMeas = assocMeas.front()->type() != xAOD::UncalibMeasType::Other ?
61  assocMeas.front() : assocMeas[1];
62  const xAOD::UncalibratedMeasurement* lastMeas = assocMeas.back();
63 
64  const Amg::Vector3D firstSurfPos = xAOD::muonSurface(firstMeas).center(gctx.context());
65  const Amg::Vector3D lastSurfPos = xAOD::muonSurface(lastMeas).center(gctx.context());
66 
67  const Segment* detSeg = detailedSegment(segment);
69  const Amg::Vector3D planeNorm = detSeg->msSector()->localToGlobalTrans(gctx).linear().col(2);
71  const auto firstPlaneIsect = intersectPlane(segment.position(), segment.direction(),
72  planeNorm, firstSurfPos);
73  const auto lastPlaneIsect = intersectPlane(segment.position(), segment.direction(),
74  planeNorm, lastSurfPos);
75 
76  Acts::GeometryView3D::drawSegment(visualHelper,
77  segment.position() + firstPlaneIsect.pathLength() * segment.direction(),
78  segment.position() + lastPlaneIsect.pathLength() * segment.direction(),
79  viewConfig);
80  }

◆ drawSegmentMeasurements()

void MuonValR4::drawSegmentMeasurements ( const ActsTrk::GeometryContext gctx,
const xAOD::MuonSegment segment,
Acts::ObjVisualization3D &  visualHelper,
const Acts::ViewConfig &  viewConfig = Acts::s_viewSensitive 
)

Draw all uncalibrated measurements associated to the segment.


Parameters
gctxGeometry context needed to fetch the positions of the first & last measurement
segmentThe segment which from which the measurements are taken
vsualHelperObj helper to which the measurements are appended.
viewConfigConfiguration style of the drawn measurements

Definition at line 81 of file ObjVisualizationHelpers.cxx.

84  {
85  std::vector<const xAOD::UncalibratedMeasurement*> assocMeas = collectMeasurements(segment, false);
86  for (const xAOD::UncalibratedMeasurement* meas : assocMeas){
87  drawMeasurement(gctx, meas, visualHelper, viewConfig);
88  }
89  }

◆ ensureDirectory()

void MuonValR4::ensureDirectory ( const std::string &  path)

Ensures that the subdirectory in the path is created.

Parameters
pathReference to the path from which the directory is to be craeted

Definition at line 17 of file FileHelpers.cxx.

17  {
18  const std::string dir = path.substr(0, path.rfind("/"));
19  if (dir.rfind("/") != std::string::npos){
21  } else if (dir.empty()) {
22  return;
23  }
24  if (!std::filesystem::is_directory(dir) && !std::filesystem::create_directory(dir)) {
25  THROW_EXCEPTION("Failed to create "<<dir);
26  }
27  }

◆ isPrecHit()

template<class SpType >
bool MuonValR4::isPrecHit ( const SpType &  sp)

Define a spacepoint as precision hit if it's a Mdt or NSW eta hit.

Definition at line 48 of file MuonHoughTransformTester.cxx.

48  {
49  return sp.type() == xAOD::UncalibMeasType::MdtDriftCircleType ||
51  (sp.type() == xAOD::UncalibMeasType::sTgcStripType && sp.measuresEta());
52  }

◆ nameBr()

std::string MuonValR4::nameBr ( Category  cat,
Status  status,
LayerIndex  layer,
bool  isSmall 
)
inline

Definition at line 16 of file TrackSummaryModule.cxx.

17  {
18  std::string lName = layerName(layer);
19  lName[0] = std::tolower(lName[0]);
20  return std::format("{:}{:}{:}{:}",
21  lName, (isSmall ? "Small" :"Large"),
23  (status == Status::OnTrack ? std::string{"Hits"}
24  : HitSummary::toString(status) +"s"));
25  }

◆ removeNonAlphaNum()

std::string MuonValR4::removeNonAlphaNum ( std::string  str)

Removes all non-alpha numerical characters from a string.

Definition at line 10 of file FileHelpers.cxx.

10  {
11  str.erase(std::remove_if(str.begin(),str.end(),
12  [](const unsigned char c){
13  return !std::isalnum(c);
14  }), str.end());
15  return str;
16  }

Variable Documentation

◆ fullFilling

constexpr int MuonValR4::fullFilling = 1001
constexpr

Definition at line 24 of file VisualizationHelpers.h.

◆ hatchedFilling

constexpr int MuonValR4::hatchedFilling = 3344
constexpr

Definition at line 25 of file VisualizationHelpers.h.

◆ hollowFilling

constexpr int MuonValR4::hollowFilling = 0
constexpr

Filling codes for hollow / fullFilling / hatched filling.

Definition at line 23 of file VisualizationHelpers.h.

◆ objViewEta

constexpr int MuonValR4::objViewEta = Acts::toUnderlying(MuonR4::SegmentFit::AxisDefs::etaCov)
constexpr

ObjectView.

Definition at line 28 of file VisualizationHelpers.h.

◆ objViewPhi

constexpr int MuonValR4::objViewPhi = Acts::toUnderlying(MuonR4::SegmentFit::AxisDefs::phiCov)
constexpr

Definition at line 29 of file VisualizationHelpers.h.

make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:215
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
xAOD::RpcMeasurement_v1
RpcMeasurement_v1: Class storing the geneic.
Definition: RpcMeasurement_v1.h:21
color
Definition: jFexInputByteStreamTool.cxx:25
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
xAOD::CombinedMuonStrip_v1::primaryStrip
const xAOD::UncalibratedMeasurement * primaryStrip() const
Returns the primary associated measurement.
Definition: CombinedMuonStrip_v1.cxx:27
xAOD::MuonSegment_v1::direction
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
Definition: MuonSegment_v1.cxx:18
vtune_athena.format
format
Definition: vtune_athena.py:14
xAOD::MMCluster_v1::localMeasurementPos
Amg::Vector3D localMeasurementPos() const
Returns the local measurement position as 3-vector.
Definition: MMCluster_v1.cxx:62
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonGMR4::SpectrometerSector::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Definition: SpectrometerSector.cxx:75
xAOD::TgcStrip_v1
Definition: TgcStrip_v1.h:19
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:13
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:217
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
Amg::y
@ y
Definition: GeoPrimitives.h:35
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
MuonR4::collectMeasurements
std::vector< const xAOD::UncalibratedMeasurement * > collectMeasurements(const xAOD::MuonSegment &segment, bool skipOutlier=true)
Helper function to extract the measurements from the segment.
Definition: TrackingHelpers.cxx:56
MuonValR4::drawBox
std::unique_ptr< TBox > drawBox(const Amg::Vector3D &boxCenter, const double boxWidth, const double boxHeight, const int color=kGreen+2, const int fillStyle=hollowFilling, const int view=objViewEta)
Creates a box for drawing, e.g strip measurements.
Definition: VisualizationHelpers.cxx:49
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
MuonR4::SegmentFit::makeLine
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
Definition: SegmentFitterEventData.cxx:35
MuonValR4::drawLabel
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
Definition: VisualizationHelpers.cxx:40
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonR4::detailedSegment
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Definition: TrackingHelpers.cxx:24
xAOD::RpcMeasurement_v1::localMeasurementPos
Amg::Vector3D localMeasurementPos() const
Returns the local position of the measurement.
Definition: RpcMeasurement_v1.cxx:46
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
xAOD::MdtDriftCircle_v1::driftRadius
float driftRadius() const
Returns the drift radius.
Definition: MdtDriftCircle_v1.cxx:45
beamspotman.steps
int steps
Definition: beamspotman.py:501
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonValR4::countMatched
unsigned int countMatched(const xAOD::MuonSegment *truthSeg, const MuonR4::Segment *segment)
Definition: MuonHoughTransformTester.cxx:42
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
Amg::x
@ x
Definition: GeoPrimitives.h:34
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
tolower
void tolower(std::string &s)
Definition: AthenaSummarySvc.cxx:108
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
xAOD::Other
@ Other
xAOD::UncalibratedMeasurement_v1::localCovariance
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
MuonR4::Segment::msSector
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:39
xAOD::UncalibratedMeasurement_v1::localPosition
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
xAOD::UncalibratedMeasurement_v1::numDimensions
virtual unsigned int numDimensions() const =0
Returns the number of dimensions of the measurement.
beamspotman.dir
string dir
Definition: beamspotman.py:619
xAOD::MuonSegment_v1::position
Amg::Vector3D position() const
Returns the position as Amg::Vector.
Definition: MuonSegment_v1.cxx:15
Muon::MuonStationIndex::layerName
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
Definition: MuonStationIndex.cxx:153
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
xAOD::muonSurface
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:68
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
xAOD::CombinedMuonStrip_v1
The Acts fitters running on the Uncalibrated measurements are uncapable of producing two track states...
Definition: CombinedMuonStrip_v1.h:19
xAOD::sTgcMeasurement_v1::localMeasurementPos
Amg::Vector3D localMeasurementPos() const
Returns the local measurement position as 3-vector.
Definition: sTgcMeasurement_v1.cxx:41
re
const boost::regex re(r_e)
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
str
Definition: BTagTrackIpAccessor.cxx:11
merge.status
status
Definition: merge.py:16
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
python.PyAthena.obj
obj
Definition: PyAthena.py:132
MuonValR4::drawMeasurement
void drawMeasurement(const ActsTrk::GeometryContext &gctx, const xAOD::UncalibratedMeasurement *meas, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewSensitive)
Draw an uncalibrated measurement inside the obj file.
Definition: ObjVisualizationHelpers.cxx:90
python.compressB64.c
def c
Definition: compressB64.py:93
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:19
MuonValR4::ensureDirectory
void ensureDirectory(const std::string &path)
Ensures that the subdirectory in the path is created.
Definition: FileHelpers.cxx:17
MuonR4::getMatchingSimHits
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
Definition: MuonSimHitHelpers.cxx:38
MuonSegmentReaderConfig.reco
reco
Definition: MuonSegmentReaderConfig.py:133
xAOD::sTgcMeasurement_v1
Definition: sTgcMeasurement_v1.h:21
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Muon::MuonStationIndex::isSmall
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
Amg::getTranslate3D
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Definition: GeoPrimitivesHelpers.h:289
drawFromPickle.view
view
Definition: drawFromPickle.py:294
ActsTrk::GeometryContext::context
Acts::GeometryContext context() const
Definition: GeometryContext.h:46