 |
ATLAS Offline Software
|
Go to the documentation of this file.
26 using PrimitivesVec_t = MuonValR4::TrackVisualizationTool::PrimitivesVec_t;
27 constexpr
int truthColor = kOrange +2;
29 constexpr
int ColorBarrel = kRed;
30 constexpr
int ColorEndcapA = kBlue;
31 constexpr
int ColorEndcapC = kGreen +2;
39 std::unique_ptr<TMarker> drawMarker(
const Amg::Vector2D&
pos,
const int mStyle,
const int mColor,
const int mSize = 2) {
40 auto marker = std::make_unique<TMarker>(
pos.x(),
pos.y(), mStyle);
41 marker->SetMarkerColor(mColor);
42 marker->SetMarkerSize(mSize);
47 const bool openMarker,
const bool onSeed) {
53 return onSeed ? (openMarker ? kOpenTriangleUp : kFullTriangleUp)
54 : (openMarker ? kOpenTriangleDown : kFullTriangleDown);
56 return onSeed ? (openMarker ? kOpenCrossX : kFullCrossX)
57 : (openMarker ? kOpenCross : kFullCross);
59 return onSeed ? (openMarker ? kOpenFourTrianglesX: kFullFourTrianglesX)
60 : (openMarker ? kOpenThreeTriangles : kFullThreeTriangles);
75 colors.insert(std::make_pair(
color, std::move(box)));
82 legend->AddEntry(tMarker.get(),
label.c_str(),
"P");
101 return Amg::Vector2D{ posOnCylinder[1]*inM, posOnCylinder[0]*inM};
121 return StatusCode::SUCCESS;
127 displaySeeds(ctx, seederObj, segments, seeds, PrimitivesVec_t{});
133 PrimitivesVec_t && extPrimitives)
const {
146 PrimitivesVec_t&& extPrimitives)
const{
164 return std::ranges::any_of(seeds,[segment, loc](
const MsTrackSeed& seed){
165 return seed.location() == loc &&
std::ranges::find(seed.segments(), segment) != seed.segments().end();
173 bool drawnPoint{
false};
178 using namespace Muon;
181 const int mColor = msSector->
barrel() ? ColorBarrel : (msSector->
side() > 0 ? ColorEndcapA : ColorEndcapC);
183 for (
const auto secProj : {leftOverlap, center, rightOverlap}) {
184 if (!sectorMap.insideSector(segment->
sector() + Acts::toUnderlying(secProj),
189 for (
const Location loc : {Barrel, Endcap}) {
195 const bool isGood = onSeed(segment, loc);
196 const int mStyle = stationMarkerSyle(chIdx,
false, isGood);
199 extPrimitives.emplace_back(drawMarker(markerPos, mStyle, mColor));
202 const double r = markerPos.mag() + extraMargin;
206 canvas->expandPad(markerPos[0] - extraMargin, markerPos[1] - extraMargin);
207 canvas->expandPad(markerPos[0] + extraMargin, markerPos[1] + extraMargin);
210 isGood ?
"" :
" (discarded)"));
211 legend.addColor(mColor, msSector->
barrel() ?
"Barrel" : msSector->
side() > 0 ?
"Endcap A" :
"Endcap C");
222 kFullDiamond, kBlack));
223 legend.addMarker(kFullDiamond,
"track seed");
226 for (
unsigned int s = 1;
s<=16 ; ++
s) {
230 const double phi = sectorMap.sectorPhi(
s);
231 const double dPhi = sectorMap.sectorWidth(
s);
233 const int lStyle =
s%2 ? kDashed : kDotted;
239 auto theLine = std::make_unique<TLine>(0.,0.,
e1.x(),
e1.y());
240 theLine->SetLineStyle(lStyle);
241 extPrimitives.insert(extPrimitives.begin(), std::move(theLine));
242 theLine = std::make_unique<TLine>(0.,0.,
e2.x(),
e2.y());
243 theLine->SetLineStyle(lStyle);
244 extPrimitives.insert(extPrimitives.begin(), std::move(theLine));
245 theLine = std::make_unique<TLine>(
e1.x(),
e1.y(),
e2.x(),
e2.y());
246 theLine->SetLineStyle(lStyle);
247 extPrimitives.insert(extPrimitives.begin(), std::move(theLine));
268 bool addedEntry{
false};
270 const auto chIdx = segment->chamberIndex();
271 const int mStyle = stationMarkerSyle(chIdx,
false,
true);
275 for (
const auto secProj : {leftOverlap, center, rightOverlap}) {
276 if (!sectorMap.insideSector(segment->sector() + Acts::toUnderlying(secProj),
277 segment->position().phi())){
280 for (
const Location loc : {Barrel, Endcap}) {
293 legend.addColor(truthColor,
"truth");
298 const OptBoundPars_t& parsToExt,
299 const std::string& objName)
const {
306 Acts::ObjVisualization3D visualHelper{};
321 std::string finalStr{};
323 finalStr =
std::format(
"{:}/{:}_{:}_{:}_{:}.obj", subDir,
326 visualHelper.write(finalStr);
constexpr int fullFilling
std::string preFixName
Prefix name of the saved Canvas.
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.
std::string subDirectory
Subdirectory in which the plots are written.
LayerIndex
enum to classify the different layers in the muon spectrometer
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Scalar phi() const
phi method
std::string find(const std::string &s)
return a remapped string
bool withinBounds(const Amg::Vector2D &projPos, const Location loc) const
Returns whether the expression on the cylinder is within the surface bounds.
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
bool saveSinglePlots
Save single plots.
Eigen::Matrix< double, 2, 1 > Vector2D
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.
Class describing a MuonSegment.
std::string removeNonAlphaNum(std::string str)
Removes all non-alpha numerical characters from a string.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
std::vector< std::unique_ptr< TObject > > clone(const std::vector< std::unique_ptr< TObject >> &cloneMe)
Location
Enum defining whether the seed is made in the endcap / barrel.
std::size_t canvasLimit
How many canvases are drawn at maximum in a job.
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.
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Amg::Vector2D expressOnCylinder(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const Location loc, const SectorProjector proj) const
Expresses the segment on the cylinder surface.
static double projectedPhi(const int sector, const SectorProjector proj)
Returns the projected phi for a given sector and projector.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool barrel() const
Returns whether the sector is placed in the barrel.
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.
Interface to the container class to temporarily cache the ROOT objects to be drawn on a TCanvas and t...
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Amg::Vector3D position() const
Returns the position as Amg::Vector.
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
Helper class to group muon sgements that may belong to a muon trajectory.
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.
Eigen::Matrix< double, 3, 1 > Vector3D
bool saveSummaryPlot
Save a summary pdf.
#define THROW_EXCEPTION(MESSAGE)
This header ties the generic definitions in this package.
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
std::vector< MsTrackSeed > MsTrackSeedContainer
SectorProjector
Enumeration to select the sector projection.
Helper to simultaneously calculate sin and cos of the same angle.
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
void ensureDirectory(const std::string &path)
Ensures that the subdirectory in the path is created.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
bool empty() const noexcept
Returns true if the collection is empty.