ATLAS Offline Software
Loading...
Searching...
No Matches
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

namespace  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.
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.
void ensureDirectory (const std::string &path)
 Ensures that the subdirectory in the path is created.
void drawPropagation (const std::vector< Acts::detail::Step > &steps, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine)
 Draws the recorded propagation steps as a polygon line.
void 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.
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.
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.
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.
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.
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.
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.
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.
std::unique_ptr< TLine > drawLine (const Amg::Vector3D &lowEnd, const Amg::Vector3D &highEnd, const int color=kRed+1, const int lineStyle=kSolid, const int view=objViewEta)
 Draw a line between two endpoints in the y-z or the x-z plane.
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)
 Draw an arror between two endpoints in the y-z or the x-z plane.
std::unique_ptr< TLatex > drawLabel (const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
 Create a TLatex label,.
std::unique_ptr< TLatex > drawAtlasLabel (const double xPos, const double yPos, const std::string &status="Internal")
 Create a ATLAS label.
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.

Variables

constexpr int hollowFilling = 0
 Filling codes for hollow / fullFilling / hatched filling.
constexpr int fullFilling = 1001
constexpr int hatchedFilling = 3344
constexpr int objViewEta = Acts::toUnderlying(MuonR4::SegmentFit::AxisDefs::etaCov)
 ObjectView.
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

◆ ICanvasObject

using MuonValR4::ICanvasObject = RootVisualizationService::ICanvasObject

Definition at line 33 of file RootVisualizationService.cxx.

◆ LabeledSegmentSet

◆ ObjectMatching

◆ simHitSet

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

Definition at line 29 of file MuonHoughTransformTester.cxx.

◆ Status

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 }
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
Definition MuonSimHit.h:12

◆ 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 }
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
unsigned int countMatched(const simHitSet &truthHits, const simHitSet &recoHits)

◆ 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 )

Draw an arror between two endpoints in the y-z or the x-z plane.

Parameters
startLower start point of the arrow
dirDirection of the arrow
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 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 }
Eigen::Matrix< double, 3, 1 > Vector3D

◆ 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 92 of file VisualizationHelpers.cxx.

93 {
94 return drawLabel( "#font[72]{ATLAS} "+status, xPos, yPos);
95 }
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.

◆ 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 }
Acts::GeometryContext context() const

◆ 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 }
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.

◆ 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() [1/2]

std::unique_ptr< TLine > MuonValR4::drawLine ( const Amg::Vector3D & lowEnd,
const Amg::Vector3D & highEnd,
const int color = kRed + 1,
const int lineStyle = kSolid,
const int view = objViewEta )

Draw a line between two endpoints in the y-z or the x-z plane.

Parameters
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 76 of file VisualizationHelpers.cxx.

79 {
80 const double x1 = lowEnd[view];
81 const double y1 = lowEnd[Amg::z];
82 const double x2 = highEnd[view];
83 const double y2 = highEnd[Amg::z];
84
85 auto seedLine = std::make_unique<TLine>(x1, y1, x2, y2);
86 seedLine->SetLineColor(color);
87 seedLine->SetLineWidth(2);
88 seedLine->SetLineStyle(lineStyle);
89 return seedLine;
90
91 }

◆ drawLine() [2/2]

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 return drawLine(pos + Amg::intersect<3>(pos,dir,Amg::Vector3D::UnitZ(), lowEnd).value_or(0.)* dir,
73 pos + Amg::intersect<3>(pos,dir,Amg::Vector3D::UnitZ(), highEnd).value_or(0.)* dir,
74 color, lineStyle, view);
75 }
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
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.

◆ 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 96 of file VisualizationHelpers.cxx.

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

◆ 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

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.};
114 Amg::Vector3D locPos{Amg::Vector3D::Zero()};
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:{
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 }
const boost::regex re(r_e)
const StripLayerPtr & sensorLayout(const IdentifierHash &hash) const
Returns the pointer to the strip layer associated with the gas gap.
const xAOD::UncalibratedMeasurement * primaryStrip() const
Returns the primary associated measurement.
Amg::Vector3D localMeasurementPos() const
Returns the local measurement position as 3-vector.
Amg::Vector3D localMeasurementPos() const
Returns the local position of the measurement.
const MuonGMR4::TgcReadoutElement * readoutElement() const
Retrieve the associated TgcReadoutElement.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
virtual unsigned int numDimensions() const =0
Returns the number of dimensions of the measurement.
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
Amg::Vector3D localMeasurementPos() const
Returns the local measurement position as 3-vector.
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
MdtDriftCircle_v1 MdtDriftCircle
TgcStrip_v1 TgcStrip
Definition TgcStripFwd.h:9
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
RpcMeasurement_v1 RpcMeasurement
MMCluster_v1 MMCluster
sTgcMeasurement_v1 sTgcMeasurement
CombinedMuonStrip_v1 CombinedMuonStrip

◆ 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 }
Scalar mag() const
mag method

◆ 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

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 }
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Placeholder for what will later be the muon segment EDM representation.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
std::vector< const xAOD::UncalibratedMeasurement * > collectMeasurements(const xAOD::MuonSegment &segment, bool skipOutlier=true)
Helper function to extract the measurements from the segment.
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.

◆ 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 }
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.

◆ 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){
20 ensureDirectory(dir);
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 }
void ensureDirectory(const std::string &path)
Ensures that the subdirectory in the path is created.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ 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 {
51 (sp.type() == xAOD::UncalibMeasType::sTgcStripType && sp.measuresEta());
52 }
static Double_t sp

◆ 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 }
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
static std::string toString(const HitCategory c)
Converts the hit category to a string.

◆ 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 }
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.

Variable Documentation

◆ fullFilling

int MuonValR4::fullFilling = 1001
constexpr

Definition at line 24 of file VisualizationHelpers.h.

◆ hatchedFilling

int MuonValR4::hatchedFilling = 3344
constexpr

Definition at line 25 of file VisualizationHelpers.h.

◆ hollowFilling

int MuonValR4::hollowFilling = 0
constexpr

Filling codes for hollow / fullFilling / hatched filling.

Definition at line 23 of file VisualizationHelpers.h.

◆ objViewEta

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

ObjectView.

Definition at line 28 of file VisualizationHelpers.h.

◆ objViewPhi

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

Definition at line 29 of file VisualizationHelpers.h.