|
ATLAS Offline Software
|
Go to the documentation of this file.
16 constexpr
double resetVal = 1.e10;
21 using namespace SegmentFit;
24 ISvcLocator* pSvcLocator)
32 return StatusCode::SUCCESS;
35 template <
class ContainerType>
38 const ContainerType*& contToPush)
const {
42 <<
typeid(ContainerType).
name());
43 return StatusCode::SUCCESS;
47 contToPush = readHandle.cptr();
48 return StatusCode::SUCCESS;
58 peakFinderCfg.fractionCutoff = 0.4;
59 peakFinderCfg.threshold = 2;
60 peakFinderCfg.minSpacingBetweenPeaks = {0., 30.};
61 data.houghPlane = std::make_unique<HoughPlane>(
cfg);
62 data.peakFinder = std::make_unique<ActsPeakFinderForMuon>(peakFinderCfg);
67 std::unordered_map<const xAOD::UncalibratedMeasurement*, bool> foundEtas;
70 if (hit->measuresEta() && hit->measuresPhi()) {
71 auto [iter, added] = foundEtas.emplace(hit->primaryMeasurement(),
false);
75 iter->second |= phiMaximum.hitIdentifiers.count(hit);
79 return std::count_if(foundEtas.begin(), foundEtas.end(),
80 [](
const std::pair<const xAOD::UncalibratedMeasurement*, bool>&
p) {
84 std::unique_ptr<SegmentSeed>
86 const ActsPeakFinderForMuon::Maximum & phiMax)
const {
88 std::vector<HoughHitType> hitsOnMax;
91 return (hit->measuresEta() && !hit->measuresPhi());
94 hitsOnMax.insert(hitsOnMax.end(), phiMax.hitIdentifiers.begin(), phiMax.hitIdentifiers.end());
97 return std::make_unique<SegmentSeed>(
etaMax.tanTheta(),
etaMax.interceptY(), phiMax.x, phiMax.y, hitsOnMax.size(), std::move(hitsOnMax),
etaMax.parentBucket());
110 if (!hit->measuresPhi()) {
114 const Amg::Vector3D extrapDir = (hit->positionInChamber() - hit->msSector()->globalToLocalTrans(gctx).translation()).
unit();
117 std::optional<double> dummyIntercept = Amg::intersect<3>(hit->positionInChamber(), extrapDir, Amg::Vector3D::UnitZ(),0);
118 double x0 = (hit->positionInChamber() + dummyIntercept.value_or(0) * extrapDir).
x();
144 Acts::HoughTransformUtils::HoughAxisRanges{searchStartTanPhi, searchEndTanPhi, searchStart, searchEnd};
145 ATH_MSG_VERBOSE(
"Accumulator search window: tanPhi: ["<<searchStartTanPhi<<
";"<<searchEndTanPhi<<
"], x0: ["
146 <<searchStart<<
";"<<searchEnd<<
"]");
149 std::vector<ActsPeakFinderForMuon::Maximum>
152 std::unordered_map<int, std::vector<ActsPeakFinderForMuon::Maximum>> rankedSeeds;
153 using namespace std::placeholders;
158 if (!hit->measuresPhi()) {
159 ATH_MSG_VERBOSE(
"Hit "<<hit->msSector()->idHelperSvc()->toString(hit->identify())<<
" does not have a phi measurement");
179 for (
const auto& solution : foundMaxPhi) {
185 auto best = rankedSeeds.begin();
192 std::unique_ptr<SegmentSeed>
199 data.searchSpaceTanAngle.first,
200 data.searchSpaceIntercept.first,
224 ATH_CHECK(writeMaxima.record(std::make_unique<SegmentSeedContainer>()));
229 ATH_MSG_VERBOSE(
"Search extra phi hits on maximum "<<
max->msSector()->identString()<<
", tanTheta: "<<
max->tanTheta()
230 <<
", y0: "<<
max->interceptY());
232 for (
const auto& truth :
m_visionTool->getLabeledSegments(
max->getHitsInMax())) {
239 bool foundSolution=
false;
241 if (eventData.phiHitsOnMax > 1){
243 for (
auto & phiSolution : rankedSeeds){
244 foundSolution =
true;
247 m_visionTool->visualizeSeed(ctx, *seed,
"#phi pattern seed");
261 m_visionTool->visualizeSeed(ctx, *singleMax,
"Single #phi hit recovery");
266 writeMaxima->push_back(std::make_unique<SegmentSeed>(*
max));
272 return StatusCode::SUCCESS;
char data[hepevt_bytes_allocation_ATLAS]
double tanTheta() const
getter
std::unique_ptr< peakFinder_t > peakFinder
AmgVector(toInt(ParamDefs::nPars)) Parameters
std::pair< double, double > searchSpaceTanAngle
bool msgLvl(const MSG::Level lvl) const
double houghParamStrip(double tanPhi, const MuonR4::HoughHitType &dc)
straight line parametrisation for strip detector measurements, in the x-direction
Acts::HoughTransformUtils::PeakFinders::IslandsAroundMaxConfig ActsPeakFinderForMuonCfg
#define ATH_MSG_VERBOSE(x)
const std::vector< HitType > & getHitsInMax() const
getter
std::string toString(const CalibratedSpacePoint::Covariance_t &mat)
Returns the matrix in string.
void sortByLayer(std::vector< const SpacePoint * > &spacePoints)
Sorts the space points in a vector by z.
An algorithm that can be simultaneously executed in multiple threads.
double houghTanPhi(const Amg::Vector3D &v)
: Returns the hough tanPhi [x] / [z]
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double houghWidthStrip(double tanPhi, const MuonR4::HoughHitType &dc, double targetReso)
Uncertainty parametrisation for strip measurements.
std::pair< double, double > searchSpaceIntercept
::StatusCode StatusCode
StatusCode definition for legacy code.
const SpacePointBucket * parentBucket() const
getter
def best(iterable, priorities=[3, 2, 1, -1, 0])
Out copy_if(In first, const In &last, Out res, const Pred &p)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Acts::HoughTransformUtils::HoughAxisRanges currAxisRanges
Include the GeoPrimitives which need to be put first.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
constexpr int toInt(const ParamDefs p)
double getCounts() const
getter
Eigen::Matrix< double, 3, 1 > Vector3D
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the azimuthal & polar angles.
This header ties the generic definitions in this package.
Data class to represent an eta maximum in hough space.
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
double interceptY() const
getter
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
std::unique_ptr< HoughPlane > houghPlane
static void updateSearchWindow(std::pair< double, double > &searchWindow, double value)
Updates a search space window to account for a value.
Templated event data class for the phase-2 muon hough transform.