 |
ATLAS Offline Software
|
Helper class to generate valid seeds for the segment fit.
More...
#include <MdtSegmentSeedGenerator.h>
|
using | SignComboType = std::array< int, 2 > |
| Sign combinations to draw the 4 lines tangent to 2 drift circles The first two are indicating whether the tangent is left/right to the first/second circle. More...
|
|
Helper class to generate valid seeds for the segment fit.
The generator first returns a seed directly made from the patten recogntion. Afterwards it builds seeds by lying tangent lines to a pair of drift circles. The pairing starts from the innermost & outermost layers with tubes. A valid seed must have at least 4 associated hits which are within a chi2 of 5. If two seeds within the parameter resolution are generated, then the latter one is skipped.
Definition at line 24 of file MdtSegmentSeedGenerator.h.
◆ HitVec
◆ SignComboType
Sign combinations to draw the 4 lines tangent to 2 drift circles The first two are indicating whether the tangent is left/right to the first/second circle.
The last sign is picking the sign of the solution arising from the final quadratic equation.
Definition at line 101 of file MdtSegmentSeedGenerator.h.
◆ MdtSegmentSeedGenerator()
Standard constructor taking the segmentSeed to start with and then few configuration tunes.
- Parameters
-
name | Name of the Seed generator's logger |
segmentSeed | Seed from which the seeds for the fit are built |
configuration | Passed configuration settings of the generator |
Check whether the first layer is too busy
Check whether the lower layer is too busy
Definition at line 48 of file MdtSegmentSeedGenerator.cxx.
58 return vec.size() > m_cfg.busyLayerLimit;
75 std::stringstream sstr{};
77 sstr<<
"Mdt-hits in layer "<<layCount<<
": "<<
layer.size()<<std::endl;
79 sstr<<
" **** "<<hit->msSector()->idHelperSvc()->toString(hit->identify())<<
" "
80 <<
Amg::toString(hit->positionInChamber())<<
", driftRadius: "<<hit->driftRadius()<<std::endl;
84 sstr<<
"Hits in layer "<<layCount<<
": "<<
layer.size()<<std::endl;
86 sstr<<
" **** "<<hit->msSector()->idHelperSvc()->toString(hit->identify())<<
" "
87 <<
Amg::toString(hit->positionInChamber())<<
", driftRadius: "<<hit->driftRadius()<<std::endl;
91 <<
", strip layers: "<<
m_hitLayers.
stripHits().size()<<std::endl<<sstr.str()<<std::endl<<std::endl);
◆ ~MdtSegmentSeedGenerator()
MuonR4::MdtSegmentSeedGenerator::~MdtSegmentSeedGenerator |
( |
| ) |
|
|
default |
◆ buildSeed()
Tries to build the seed from the two hits.
Fails if the solution is invalid or if the seed has already been built before
- Parameters
-
topHit | Hit candidate from the upper layer |
bottomHit | Hit candidate from the lower layer |
sign | Object encoding whether the tangent is left / right
|
All other sign combinations will also get stuck -> force the measurement selector to get another combo
Create a new line position & direction which also takes the potential phi estimates into account
Recalculate the seed with the calibrated parameters
Check that the is within the predefined window
d/dx asin(x) = 1 / sqrt(1- x*x)
Collect all hits close to the seed line
what ever comes after is not matching onto the segment
Reject seeds with too litle Mdt hit association
Last check wheather another seed with the same left-right combination hasn't already been found
All seed hits are of the same size
Including the places where no seed hit was assigned. Both solutions match in terms of left-right solutions. It's very likely that they're converging to the same segment.
Seed candidate is
Add the solution to the list. That we don't iterate twice over it
If we found a long Mdt seed, then ensure that all subsequent seeds have at least the same amount of Mdt hits.
Associate strip hits
Add all hits with a pull better than the threshold
Definition at line 179 of file MdtSegmentSeedGenerator.cxx.
184 const auto* bottomPrd =
static_cast<const xAOD::MdtDriftCircle*
>(bottomHit->primaryMeasurement());
194 const auto&[signTop, signBot] = signs;
195 double R = signBot *bottomHit->driftRadius() - signTop * topHit->driftRadius();
196 const Amg::Vector3D& bottomPos{bottomHit->positionInChamber()};
200 const double thetaTubes = std::atan2(D.y(), D.z());
201 const double distTubes = std::hypot(D.y(), D.z());
202 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Bottom tube "<<idHelperSvc->toString(bottomHit->identify())<<
" "<<
Amg::toString(bottomPos)
203 <<
", driftRadius: "<<bottomHit->driftRadius()<<
" - top tube "<<idHelperSvc->toString(topHit->identify())
204 <<
" "<<
Amg::toString(topPos)<<
", driftRadius: "<<topHit->driftRadius()
207 DriftCircleSeed candidateSeed{};
210 double theta{thetaTubes - std::asin(std::clamp(R / distTubes, -1., 1.))};
212 double Y0 = bottomPos.y()*seedDir.z() - bottomPos.z()*seedDir.y() + signBot*bottomHit->driftRadius();
213 double combDriftUncert{std::sqrt(bottomPrd->driftRadiusCov() + topPrd->driftRadiusCov())};
214 std::unique_ptr<CalibratedSpacePoint> calibBottom{}, calibTop{};
220 const auto [linePos, lineDir] =
makeLine(candidateSeed.parameters);
225 R = signBot * calibBottom->driftRadius() - signTop * calibTop->driftRadius();
227 theta = thetaTubes - std::asin(std::clamp(R / distTubes, -1., 1.));
229 Y0 = bottomPos.y()*seedDir.z() - bottomPos.z()*seedDir.y() + signBot*bottomHit->driftRadius();
241 const Amg::Vector3D seedPos = Y0 / seedDir.z() * Amg::Vector3D::UnitY();
243 assert(std::abs(topPos.y()*seedDir.z() - topPos.z() * seedDir.y() + signTop*topHit->driftRadius() - Y0) < std::numeric_limits<float>::epsilon() );
244 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Candidate seed theta: "<<theta<<
", tanTheta: "<<(seedDir.y() / seedDir.z())<<
", y0: "<<Y0/seedDir.z());
246 SeedSolution solCandidate{};
248 solCandidate.theta =
theta;
250 const double denomSquare = 1. -
std::pow(R / distTubes, 2);
251 if (denomSquare < std::numeric_limits<double>::epsilon()){
255 solCandidate.dTheta = combDriftUncert / std::sqrt(denomSquare) / distTubes;
256 solCandidate.dY0 = std::hypot(-bottomPos.y()*seedDir.y() + bottomPos.z()*seedDir.z(), 1.) * solCandidate.dTheta;
261 [&solCandidate,
this] (
const SeedSolution& seen) {
262 const double deltaY = std::abs(seen.Y0 - solCandidate.Y0);
263 const double limitY = std::hypot(seen.dY0, solCandidate.dY0);
264 const double dTheta = std::abs(seen.theta - solCandidate.theta);
265 const double limitTh = std::hypot(seen.dTheta, solCandidate.dTheta);
268 <<
std::format(
" delta theta: {:.2f} {:} {:.2f}", dTheta, dTheta < limitTh ?
'<' :
'>', limitTh) );
271 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Reject due to similarity");
276 ATH_MSG_VERBOSE( __func__<<
"() "<<__LINE__<<
": "<<hitsInLayer.size()<<
" hits in layer "<<(layerNr +1));
277 bool hadGoodHit{
false};
280 testMe->directionInChamber()));
281 const auto*
re =
static_cast<const xAOD::MdtDriftCircle*
>(testMe->primaryMeasurement())->readoutElement();
284 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Test hit "<<idHelperSvc->toString(testMe->identify())
288 solCandidate.seedHits.emplace_back(testMe);
291 else if (hadGoodHit) {
299 if (1.*candidateSeed.nMdt < hitCut) {
300 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Too few hits associated "<<candidateSeed.nMdt<<
", expect: "<<hitCut<<
" hits.");
305 solCandidate.solutionSigns =
driftSigns(seedPos, seedDir, solCandidate.seedHits,
msg());
306 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Circle solutions for seed "
307 <<idHelperSvc->toStringChamber(bottomHit->identify())<<
" - "<<solCandidate);
311 unsigned int nOverlap{0};
312 std::vector<int> corridor =
driftSigns(seedPos, seedDir, accepted.seedHits,
msg());
313 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Test seed against accepted "<<accepted<<
", updated signs: "<<corridor);
315 for (
unsigned int l = 0;
l < accepted.seedHits.size(); ++
l){
316 nOverlap += corridor[
l] == accepted.solutionSigns[
l];
320 if (nOverlap == corridor.size() && accepted.seedHits.size() >= solCandidate.seedHits.size()) {
321 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Same set of hits collected within the same corridor");
330 if (hit == bottomHit && calibBottom) {
331 candidateSeed.measurements.emplace_back(std::move(calibBottom));
335 else if (hit == topHit && calibTop) {
336 candidateSeed.measurements.emplace_back(std::move(calibTop));
349 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": In event "<<ctx.eventID().event_number()<<
" found new seed solution "<<
toString(candidateSeed.parameters));
367 const auto [seedPos, seedDir] =
makeLine(candidateSeed.parameters);
373 / testMe->dimension();
374 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
": Test hit "<<idHelperSvc->toString(testMe->identify())
377 if (
pull <= bestPull) {
388 return candidateSeed;
◆ config()
◆ estimateAuxillaries() [1/2]
Helper function to estimate the auxillary variables that remain constant during the fit.
- Parameters
-
seed | Reference to the seed to calculate the variables from |
Seed direction vector
y0Prime = y0 * cos(theta)
Calculate the centre of gravity
Calculate the fit constants
Definition at line 391 of file MdtSegmentSeedGenerator.cxx.
393 SeedFitAuxilliaries aux{};
400 aux.invCovs.reserve(
seed.measurements.size());
401 aux.driftSigns.reserve(
seed.measurements.size());
404 for (
const std::unique_ptr<CalibratedSpacePoint>& hit :
seed.measurements) {
405 const double invCov = 1./
driftCov(*hit);
407 const int sign =
y0 -
pos.y() * seedDir.z() +
pos.z()* seedDir.y() > 0 ? 1 : -1;
409 aux.centerOfGrav+= invCov *
pos;
410 aux.invCovs.push_back(invCov);
411 aux.driftSigns.push_back(
sign);
416 aux.covNorm = 1./
norm;
417 aux.centerOfGrav *= aux.covNorm;
419 for (
const auto [covIdx, hit] : Acts::enumerate(
seed.measurements)) {
420 const double& invCov = aux.invCovs[covIdx];
421 const int&
sign = aux.driftSigns[covIdx];
423 const double signedCov = invCov *
sign;
425 aux.T_yz += invCov *
pos.y()*
pos.z();
426 aux.T_rz += signedCov *
pos.z() * hit->driftRadius();
427 aux.T_ry += signedCov *
pos.y() * hit->driftRadius();
428 aux.fitY0 += signedCov * aux.covNorm * hit->driftRadius();
430 ATH_MSG_VERBOSE(
"Estimated T_zzyy: "<<aux.T_zzyy<<
", T_yz: "<<aux.T_yz<<
", T_rz: "<<aux.T_rz
431 <<
", T_ry: "<<aux.T_ry<<
", centre "<<
Amg::toString(aux.centerOfGrav)<<
", y0: "<<aux.fitY0
432 <<
", norm: "<<aux.covNorm<<
"/"<<
norm);
◆ estimateAuxillaries() [2/2]
Helper function to estimate the auxillary variables that remain constants during the fit with t0.
- Parameters
-
ctx | EventContext to recalibrate the hits |
seed | Reference to the seed to calculate the variables from |
Definition at line 484 of file MdtSegmentSeedGenerator.cxx.
487 for (
const auto [
idx, hit] : Acts::enumerate(
seed.measurements)){
489 const double weight = aux.covNorm * signedCov;
493 aux.fitY0Prime+=
weight * velocity;
494 aux.fitY0TwoPrime+=
weight * acceleration;
496 aux.T_vz += signedCov *
pos.z()*velocity;
497 aux.T_vy += signedCov *
pos.y()*velocity;
498 aux.T_az += signedCov *
pos.z()*acceleration;
499 aux.T_ay += signedCov *
pos.y()*acceleration;
501 aux.R_vr += signedCov * hit->driftRadius() * velocity;
502 aux.R_va += signedCov * hit->driftRadius() * acceleration;
503 aux.R_vv += signedCov * velocity * velocity;
506 <<
", T_az: "<<aux.T_az<<
", T_ay: "<<aux.T_ay<<
" --- R_vr: "<<aux.R_vr
507 <<
", R_va: "<<aux.R_va<<
", R_vv: "<<aux.R_vv<<
" -- Y0^{'}: "<<aux.fitY0Prime
508 <<
", Y0^{''}: "<<aux.fitY0TwoPrime);
◆ fitDriftCircles()
void MuonR4::MdtSegmentSeedGenerator::fitDriftCircles |
( |
DriftCircleSeed & |
seed | ) |
const |
|
private |
Refine the seed by performing a fast Mdt segment fit.
- Parameters
-
seed | Seed built from the tangent adjacent to the two seed circles |
Now it's time to use the guestimate
Definition at line 435 of file MdtSegmentSeedGenerator.cxx.
441 const double thetaGuess = std::atan2( 2.*(auxVars.T_yz - auxVars.T_rz), auxVars.T_zzyy) / 2.;
443 ATH_MSG_VERBOSE(
"Start fast fit seed: "<<theta<<
", guess: "<<thetaGuess
445 <<
", fitY0: "<<auxVars.fitY0<<
", centre: "<<
Amg::toString(auxVars.centerOfGrav));
449 bool converged{
false};
452 const double thetaPrime = 0.5*auxVars.T_zzyy *twoTheta.sn - auxVars.T_yz * twoTheta.cs
453 - auxVars.T_rz * thetaCS.cs - auxVars.T_ry * thetaCS.sn;
459 const double thetaTwoPrime = auxVars.T_zzyy * twoTheta.cs + 2.* auxVars.T_yz * twoTheta.sn
460 + auxVars.T_rz * thetaCS.sn - auxVars.T_ry * thetaCS.cs;
461 const double update = thetaPrime / thetaTwoPrime;
462 ATH_MSG_VERBOSE(
"Fit iteration #"<<inSeed.nIter<<
" -- theta: "<<theta<<
", thetaPrime: "<<thetaPrime
463 <<
", thetaTwoPrime: "<<thetaTwoPrime<<
" -- "<<
std::format(
"{:.8f}", update)
464 <<
" --> next theta "<<(theta - thetaPrime / thetaTwoPrime));
476 double fitY0 = (auxVars.centerOfGrav.y() *thetaCS.cs - auxVars.centerOfGrav.z() * thetaCS.sn + auxVars.fitY0) / thetaCS.cs;
477 ATH_MSG_VERBOSE(
"Drift circle fit converged within "<<inSeed.nIter<<
" iterations giving "<<
toString(inSeed.parameters)<<
", chi2: "<<inSeed.chi2
◆ fitDriftCirclesWithT0()
void MuonR4::MdtSegmentSeedGenerator::fitDriftCirclesWithT0 |
( |
const EventContext & |
ctx, |
|
|
DriftCircleSeed & |
seed |
|
) |
| const |
|
private |
Refine the seed by performing a fast Mdt segment fit with t0 constraint.
- Parameters
-
ctx | EventContext to recalibrate the hits |
seed | Seed built from the tangent adjacent to the two seed circles |
d^{2}chi^{2} / d^{2}theta
Definition at line 512 of file MdtSegmentSeedGenerator.cxx.
517 bool converged{
false};
529 cov(0,0) = auxVars.T_zzyy * twoTheta.cs + 2.* auxVars.T_yz * twoTheta.sn
530 + auxVars.T_rz * thetaCS.sn - auxVars.T_ry * thetaCS.cs;
533 cov(1,1) = - auxVars.fitY0Prime *auxVars.fitY0Prime - auxVars.fitY0Prime * auxVars.fitY0TwoPrime
534 - auxVars.T_az * thetaCS.sn - auxVars.T_ay * thetaCS.cs + auxVars.R_vv + auxVars.R_va;
536 grad[0] =0.5*auxVars.T_zzyy *twoTheta.sn - auxVars.T_yz * twoTheta.cs
537 - auxVars.T_rz * thetaCS.cs - auxVars.T_ry * thetaCS.sn;
538 grad[1] = auxVars.fitY0 * auxVars.fitY0Prime - auxVars.R_vr + auxVars.T_vz * thetaCS.sn - auxVars.T_vy * thetaCS.cs;
543 pars[1]<<" gradient: ("<<(grad[0])<<", "<<grad[1]<<"), covariance:"
545 <<", "<<update[1]<<").");
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ moveToNextCandidate()
void MuonR4::MdtSegmentSeedGenerator::moveToNextCandidate |
( |
| ) |
|
|
inlineprivate |
Prepares the generator to generate the seed from the next pair of drift circles.
Vary the left-right solutions
Move to the next hit in the lower layer
Move to the next hit in the upper layer
All combinations of hits & lines in both layers are processed Switch to the next lowerLayer. But skip the busy ones according to the configuration
Abort the loop if we parsed the multi-layer boundary
Definition at line 98 of file MdtSegmentSeedGenerator.cxx.
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ nextSeed()
returns the next seed in the row
Increment for the next candidate
If a candidate is built return it. Otherwise continue the process
Definition at line 136 of file MdtSegmentSeedGenerator.cxx.
137 std::optional<DriftCircleSeed>
found = std::nullopt;
140 found = std::make_optional<DriftCircleSeed>();
149 return hit->type() == xAOD::UncalibMeasType::MdtDriftCircleType;
151 SeedSolution patternSeed{};
◆ numGenerated()
unsigned int MuonR4::MdtSegmentSeedGenerator::numGenerated |
( |
| ) |
const |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_cfg
Config MuonR4::MdtSegmentSeedGenerator::m_cfg {} |
|
private |
◆ m_hitLayers
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lowerHitIndex
std::size_t MuonR4::MdtSegmentSeedGenerator::m_lowerHitIndex {0} |
|
private |
◆ m_lowerLayer
std::size_t MuonR4::MdtSegmentSeedGenerator::m_lowerLayer {0} |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nGenSeeds
unsigned int MuonR4::MdtSegmentSeedGenerator::m_nGenSeeds {0} |
|
private |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_seenSolutions
std::vector<SeedSolution> MuonR4::MdtSegmentSeedGenerator::m_seenSolutions {} |
|
private |
◆ m_segmentSeed
◆ m_signComboIndex
std::size_t MuonR4::MdtSegmentSeedGenerator::m_signComboIndex {0} |
|
private |
◆ m_upperHitIndex
std::size_t MuonR4::MdtSegmentSeedGenerator::m_upperHitIndex {0} |
|
private |
◆ m_upperLayer
std::size_t MuonR4::MdtSegmentSeedGenerator::m_upperLayer {0} |
|
private |
◆ s_signCombos
constexpr static std::array<SignComboType,4> MuonR4::MdtSegmentSeedGenerator::s_signCombos |
|
staticconstexprprivate |
The documentation for this class was generated from the following files:
std::size_t m_upperHitIndex
Explicit hit to pick in the selected top layer.
std::vector< int > driftSigns(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const std::vector< const SpacePoint * > &uncalibHits, MsgStream &msg)
Calculates whether a segment line travereses the tube measurements on the left (-1) or right (1) side...
std::atomic< MSG::Level > m_lvl
Current logging level.
const SpacePointBucket * parentBucket() const
Returns the bucket out of which the seed was formed.
bool overlapCorridor
Check whether a new seed candidate shares the same left-right solution with already accepted ones Rej...
const HitLayVec & stripHits() const
Returns the sorted strip hits.
unsigned int numGenerated() const
Returns how many seeds have been generated.
unsigned int nMdtHitCut
How many drift circle hits needs the seed to contain in order to be valid.
unsigned int busyLayerLimit
How many drift circles may be on a layer to be used for seeding.
Muon::MdtDriftCircleStatus dcStatus(const SpacePoint &dc)
double tanPhi() const
Returns the angle from the phi extension.
double driftCov(const CalibratedSpacePoint &dcHit)
Amg::Vector3D positionInChamber() const
Returns the position of the seed in the sector frame.
SpacePointPerLayerSplitter::HitVec HitVec
SeedFitAuxilliaries estimateAuxillaries(const DriftCircleSeed &seed) const
Helper function to estimate the auxillary variables that remain constant during the fit.
bool fastSeedFit
Toggle whether the seed is rapidly refitted.
unsigned int m_nGenSeeds
Counter on how many seeds have been generated.
double nMdtLayHitCut
Hit cut based on the fraction of collected tube layers.
std::vector< size_t > vec
virtual CalibSpacePointPtr calibrate(const EventContext &ctx, const SpacePoint *spacePoint, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const =0
Calibrates a single space point.
#define ATH_MSG_VERBOSE(x)
virtual double driftVelocity(const EventContext &ctx, const CalibratedSpacePoint &spacePoint) const =0
Returns the drift velocity for a given drift-circle space point.
bool recalibSeedCircles
Recalibrate the seed drift circles from the initial estimate
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
HoughMaximum::HitType HoughHitType
std::string toString(const CalibratedSpacePoint::Covariance_t &mat)
Returns the matrix in string.
@ MdtStatusDriftTime
The tube produced a vaild measurement.
IMessageSvc * getMessageSvc(bool quiet=false)
bool startWithPattern
Try at the first time the pattern seed as candidate.
std::size_t m_lowerHitIndex
Explicit hit to pick in the selected bottom layer.
Amg::Vector3D dirFromTangents(const double tanPhi, const double tanTheta)
Constructs a direction vector from tanPhi & tanTheta.
constexpr static std::array< SignComboType, 4 > s_signCombos
bool fastSegFitWithT0
Toggle whether an initial t0 fit shall be executed.
double chiSqTermStrip(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 strip measurement.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
virtual double driftAcceleration(const EventContext &ctx, const CalibratedSpacePoint &spacePoint) const =0
Returns the drift acceleration for a given drift-circle space point.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
double tanTheta() const
Returns the angular coordinate of the eta transform.
unsigned int firstLayerFrom2ndMl() const
Returns the layer index with hits from the second multilayer
double chiSqTermMdt(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 Mdt measurement.
std::array< double, 2 > thetaRange
Cut on the theta angle.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
std::optional< DriftCircleSeed > buildSeed(const EventContext &ctx, const HoughHitType &topHit, const HoughHitType &bottomHit, const SignComboType &signs)
Tries to build the seed from the two hits.
std::size_t m_upperLayer
Considered layer to pick the top drift circle from.
double interceptY() const
Returns the intercept coordinate of the eta transform.
const std::vector< HitType > & getHitsInMax() const
Returns the list of assigned hits.
Class to provide easy MsgStream access and capabilities.
SpacePointPerLayerSplitter m_hitLayers
std::vector< int > driftSigns
Vector of drfit signs.
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
double hitPullCut
Upper cut on the hit chi2 w.r.t.
MsgStream & msg() const
The standard message stream.
void fitDriftCirclesWithT0(const EventContext &ctx, DriftCircleSeed &seed) const
Refine the seed by performing a fast Mdt segment fit with t0 constraint.
constexpr double sign(const double x)
Returns the sign of a number.
Definition of ATLAS Math & Geometry primitives (Amg)
constexpr bool passRangeCut(const std::array< double, 2 > &cutRange, const double value)
constexpr int toInt(const ParamDefs p)
const HitLayVec & mdtHits() const
Returns the sorted Mdt hits.
void moveToNextCandidate()
Prepares the generator to generate the seed from the next pair of drift circles.
Eigen::Matrix< double, 3, 1 > Vector3D
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the azimuthal & polar angles.
unsigned int nMaxIter
Maximum number of iterations in the fast segment fit.
const SegmentSeed * m_segmentSeed
bool tightenHitCut
Once a seed with even more than initially required hits is found, reject all following seeds with les...
std::string m_nm
Message source name.
const boost::regex re(r_e)
std::vector< SeedSolution > m_seenSolutions
Vector caching equivalent solutions to avoid double seeding.
std::array< double, 2 > interceptRange
Cut on the intercept range.
const Parameters & parameters() const
Returns the parameter array.
Helper to simultaneously calculate sin and cos of the same angle.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
void fitDriftCircles(DriftCircleSeed &seed) const
Refine the seed by performing a fast Mdt segment fit.
=============================================================================
std::size_t m_signComboIndex
Index of the left-right ambiguity between the circles.
double signedDistance(const Amg::Vector3D &posA, const Amg::Vector3D &dirA, const Amg::Vector3D &posB, const Amg::Vector3D &dirB)
Calculates the signed distance between two lines in 3D space.
double precCutOff
Precision cut off in the fast segment fit.
void initMessaging() const
Initialize our message level and MessageSvc.
Amg::Vector3D directionInChamber() const
Returns the direction of the seed in the sector frame.
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
const ISpacePointCalibrator * calibrator
Pointer to the space point calibrator.
const AmgSymMatrix(2) &SpacePoint
constexpr int pow(int base, int exp) noexcept
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
std::size_t m_lowerLayer
Considered layer to pick the bottom drift circle from.