 |
ATLAS Offline Software
|
#include <DCMathSegmentMaker.h>
|
virtual | ~DCMathSegmentMaker ()=default |
|
virtual StatusCode | initialize () |
|
void | find (const std::vector< const Trk::RIO_OnTrack * > &rios, Trk::SegmentCollection *segColl=nullptr) const |
| find segments starting from a list of RIO_OnTrack objects, implementation of IMuonSegmentMaker interface routine. More...
|
|
void | find (const std::vector< const Trk::RIO_OnTrack * > &rios1, const std::vector< const Trk::RIO_OnTrack * > &rios2) const |
| find segments starting from a list of RIO_OnTrack objects in multiple chambers, implementation of IMuonSegmentMaker interface routine Will call: More...
|
|
void | find (const std::vector< const MdtDriftCircleOnTrack * > &mdts, const std::vector< const MuonClusterOnTrack * > &clusters, Trk::SegmentCollection *segColl=nullptr) const |
| find segments starting from: More...
|
|
void | find (const Amg::Vector3D &gpos, const Amg::Vector3D &gdir, const std::vector< const MdtDriftCircleOnTrack * > &mdts, const std::vector< const MuonClusterOnTrack * > &clusters, bool hasPhiMeasurements=false, Trk::SegmentCollection *segColl=nullptr, double momentum=1e9, double sinAngleCut=0, double beta=1.) const |
| find segments starting from: More...
|
|
void | find (const Trk::TrackRoad &road, const std::vector< std::vector< const MdtDriftCircleOnTrack * > > &mdts, const std::vector< std::vector< const MuonClusterOnTrack * > > &clusters, Trk::SegmentCollection *segColl, bool hasPhiMeasurements=false, double momentum=1e9) const |
| find segments starting from: More...
|
|
|
bool | errorScalingRegion (const Identifier &id) const |
| apply error scaling for low mometum tracks More...
|
|
double | errorScaleFactor (const Identifier &id, double curvature, bool hasPhiMeasurements) const |
| calculate error scaling factor More...
|
|
std::vector< Identifier > | calculateHoles (const EventContext &ctx, Identifier chid, const Amg::Vector3D &gpos, const Amg::Vector3D &gdir, bool hasMeasuredCoordinate, std::set< Identifier > &deltaVec, std::set< Identifier > &outoftimeVec, const std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec) const |
|
TrkDriftCircleMath::DCVec | createDCVec (const std::vector< const MdtDriftCircleOnTrack * > &mdts, double errorScale, std::set< Identifier > &chamberSet, double &phimin, double &phimax, TrkDriftCircleMath::DCStatistics &dcStatistics, const Amg::Transform3D &gToStation, const Amg::Transform3D &amdbToGlobal) const |
|
ClusterVecPair | create1DClusters (const std::vector< const MuonClusterOnTrack * > &clusters) const |
|
ClusterVecPair | create2DClusters (const std::vector< const MuonClusterOnTrack * > &clusters) const |
|
ClusterVecPair | createSpacePoints (const ChIdHitMap &chIdHitMap) const |
|
ClusterVecPair | createSpacePoints (const IdHitMap &gasGapHitMap) const |
|
Cluster2D | createSpacePoint (const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const |
|
Cluster2D | createRpcSpacePoint (const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const std::vector< const MuonClusterOnTrack * > &phiHits) const |
|
Cluster2D | createTgcSpacePoint (const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const |
|
TrkDriftCircleMath::CLVec | createClusterVec (const Identifier &chid, ClusterVec &spVec, const Amg::Transform3D &gToStation) const |
|
void | associateMDTsToSegment (const Amg::Vector3D &gdir, TrkDriftCircleMath::Segment &segment, const TrkDriftCircleMath::ChamberGeometry *multiGeo, const Amg::Transform3D &gToStation, const Amg::Transform3D &amdbToGlobal, std::set< Identifier > &deltaVec, std::set< Identifier > &outoftimeVec, std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec, double beta=1.) const |
|
std::pair< std::pair< int, int >, bool > | associateClustersToSegment (const TrkDriftCircleMath::Segment &segment, const Identifier &chid, const Amg::Transform3D &gToStation, ClusterVecPair &spVecs, double phimin, double phimax, std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec) const |
|
TrkDriftCircleMath::MdtChamberGeometry | createChamberGeometry (const Identifier &chid, const Amg::Transform3D &gToStation) const |
|
const MdtDriftCircleOnTrack * | findFirstRotInChamberWithMostHits (const std::vector< const MdtDriftCircleOnTrack * > &mdts) const |
|
bool | updateSegmentPhi (const Amg::Vector3D &gpos, const Amg::Vector3D &gdir, Amg::Vector2D &segLocPos, Trk::LocalDirection &segLocDir, Trk::PlaneSurface &surf, const std::vector< const Trk::MeasurementBase * > &rots, double phimin, double phimax) const |
|
bool | checkBoundsInXZ (double xline, double zline, double dXdZ, const std::vector< HitInXZ > &hits) const |
| check whether all hits are in bounds in the XZ plane More...
|
|
TubeEnds | localTubeEnds (const MdtDriftCircleOnTrack &mdt, const Amg::Transform3D &gToSegment, const Amg::Transform3D &segmentToG) const |
| calculate positions of tube ends More...
|
|
bool | checkPhiConsistency (double phi, double phimin, double phimax) const |
| check whether phi is consistent with segment phi More...
|
|
Amg::Vector3D | updateDirection (double linephi, const Trk::PlaneSurface &surf, const Amg::Vector3D &roaddir, bool isCurvedSegment) const |
| update the global direction, keeping the phi of the input road direction but using the local angle YZ More...
|
|
std::unique_ptr< MuonSegment > | createSegment (const EventContext &ctx, TrkDriftCircleMath::Segment &segment, const Identifier &chid, const Amg::Vector3D &roadpos, const Amg::Vector3D &roaddir2, const std::vector< const MdtDriftCircleOnTrack * > &mdts, bool hasPhiMeasurements, segmentCreationInfo &sInfo, double beta=1.) const |
|
const MdtPrepData * | findMdt (const EventContext &ctx, const Identifier &id) const |
|
|
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > | m_DetectorManagerKey |
| pointers to IdHelpers More...
|
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc |
|
ServiceHandle< IMuonEDMHelperSvc > | m_edmHelperSvc |
|
ToolHandle< IMdtDriftCircleOnTrackCreator > | m_mdtCreator |
|
ToolHandle< IMdtDriftCircleOnTrackCreator > | m_mdtCreatorT0 |
|
ToolHandle< IMuonClusterOnTrackCreator > | m_clusterCreator |
|
ToolHandle< IMuonCompetingClustersOnTrackCreator > | m_compClusterCreator |
|
PublicToolHandle< MuonEDMPrinterTool > | m_printer |
|
ToolHandle< IMdtSegmentFinder > | m_segmentFinder |
|
ToolHandle< IMuonSegmentFittingTool > | m_segmentFitter |
|
ToolHandle< IMuonSegmentSelectionTool > | m_segmentSelectionTool |
|
ToolHandle< IDCSLFitProvider > | m_dcslFitProvider |
|
Gaudi::Property< double > | m_sinAngleCut {this, "SinAngleCut", 0.2} |
|
Gaudi::Property< bool > | m_doGeometry {this, "DoGeometry", true} |
|
Gaudi::Property< bool > | m_curvedErrorScaling {this, "CurvedErrorScaling", true} |
|
Gaudi::Property< bool > | m_doSpacePoints {this, "UseTriggerSpacePoints", true} |
|
Gaudi::Property< bool > | m_createCompetingROTsEta {this, "CreateCompetingROTsEta", true} |
|
Gaudi::Property< bool > | m_createCompetingROTsPhi {this, "CreateCompetingROTsPhi", true} |
|
Gaudi::Property< bool > | m_refitParameters {this, "RefitSegment", false} |
|
Gaudi::Property< bool > | m_addUnassociatedPhiHits {this, "AddUnassociatedPhiHits", false} |
|
Gaudi::Property< bool > | m_strictRoadDirectionConsistencyCheck {this, "StrictRoadDirectionConsistencyCheck", true} |
|
Gaudi::Property< double > | m_maxAssociateClusterDistance {this, "MaxAssociateClusterDistance", 3000.} |
|
Gaudi::Property< bool > | m_allMdtHoles {this, "AllMdtHoles", false} |
|
Gaudi::Property< bool > | m_removeDeltas {this, "RemoveDeltasFromSegmentQuality", true} |
|
Gaudi::Property< bool > | m_reject1DTgcSpacePoints {this,"Reject1DTgcSpacePoints", true } |
|
Gaudi::Property< bool > | m_usePreciseError {this, "UsePreciseError", false} |
|
Gaudi::Property< bool > | m_outputFittedT0 {this, "OutputFittedT0", false} |
|
Gaudi::Property< double > | m_preciseErrorScale {this, "PreciseErrorScale", 2.} |
|
Gaudi::Property< bool > | m_doTimeOutChecks {this, "UseTimeOutGard", false} |
|
Gaudi::Property< bool > | m_recoverBadRpcCabling {this, "RecoverBadRpcCabling", false} |
|
Gaudi::Property< bool > | m_updatePhiUsingPhiHits {this, "UpdatePhiUsingPhiHits", false} |
|
Gaudi::Property< bool > | m_assumePointingPhi {this, "AssumePointingPhi", false } |
|
Gaudi::Property< bool > | m_redo2DFit {this, "Redo2DFit", true} |
|
SG::ReadHandleKey< Muon::MdtPrepDataContainer > | m_mdtKey {this, "MdtPrepDataContainer", "MDT_DriftCircles"} |
|
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > | m_chamberGeoKey {this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"} |
|
Implementation of a IMuonSegmentMaker.
For more details look at the mainpage of this package.
Definition at line 96 of file DCMathSegmentMaker.h.
◆ ChIdHitMap
◆ ClusterVec
◆ ClusterVecPair
◆ EtaPhiHitsPair
◆ IdHitMap
◆ ~DCMathSegmentMaker()
virtual Muon::DCMathSegmentMaker::~DCMathSegmentMaker |
( |
| ) |
|
|
virtualdefault |
◆ associateClustersToSegment()
calculate distance to segment
Definition at line 1284 of file DCMathSegmentMaker.cxx.
1287 typedef IdDataVec<std::pair<double, Cluster2D> >
GasGapData;
1288 typedef IdDataVec<GasGapData> ChamberData;
1289 typedef std::vector<ChamberData> ChamberDataVec;
1290 ChamberDataVec chamberDataVec;
1295 std::pair<std::pair<int, int>,
bool> netaPhiHits(std::make_pair(0, 0),
false);
1296 if (
segment.clusters().empty())
return netaPhiHits;
1298 std::vector<const Trk::MeasurementBase*> phiHits;
1304 std::set<Identifier> detElOnSegments;
1305 std::set<MuonStationIndex::PhiIndex> phiIndices;
1307 ATH_MSG_DEBUG(
" Associating clusters: " <<
segment.clusters().size() <<
" number of space points " << spVecs.first.size());
1312 const Cluster2D& spacePoint = spVecs.first[clust.index()];
1315 if (spacePoint.corrupt()) {
1316 ATH_MSG_DEBUG(
" Found corrupt space point: index " << clust.index());
1325 ATH_MSG_DEBUG(
" Inconsistent phi angle, dropping space point: phi " << spacePoint.globalPos.phi() <<
" range " << phimin
1333 if (chamberDataVec.empty() || chamberDataVec.back().id != spacePoint.detElId) {
1334 detElOnSegments.insert(spacePoint.detElId);
1335 chamberDataVec.emplace_back(spacePoint.detElId);
1341 ChamberData&
chamber = chamberDataVec.back();
1344 if (spacePoint.detElId ==
chamber.id) {
1346 if (
chamber.data.empty() ||
chamber.data.back().id != spacePoint.gasGapId) {
1347 chamber.data.emplace_back(spacePoint.gasGapId);
1353 gasGap.data.emplace_back(resPull.second, spacePoint);
1357 double posFirstPhiStation{FLT_MAX}, posLastPhiStation{0.};
1360 for (ChamberData& chamb : chamberDataVec) {
1362 std::list<const Trk::PrepRawData*> etaClusterVec{}, phiClusterVec{};
1363 std::set<Identifier> etaIds;
1370 double bestPull = std::abs(
gasGap.data.front().first);
1373 unsigned int nassociatedSp = 0;
1374 GasGapData::EntryVec::const_iterator cl_it =
gasGap.data.begin();
1375 while (cl_it !=
gasGap.data.end() && std::abs(cl_it->first) - bestPull < 1.) {
1376 const Cluster2D& sp = cl_it->second;
1380 << std::abs(cl_it->first) <<
" distance to segment " << dist <<
" phi "
1381 << sp.globalPos.phi());
1385 if (!etaIds.count(sp.etaHit->identify())) {
1386 etaIds.insert(sp.etaHit->identify());
1389 etaClusterVec.push_back(sp.etaHit->prepRawData());
1391 rioDistVec.emplace_back(dist, sp.etaHit->uniqueClone());
1392 ++netaPhiHits.first.first;
1396 if (!sp.phiHits.empty()) {
1399 std::transform(sp.phiHits.begin(), sp.phiHits.end(), std::back_inserter(phiClusterVec),
1401 return clus->prepRawData();
1405 for (
const MuonClusterOnTrack* phi_hit : sp.phiHits) {
1406 rioDistVec.emplace_back(dist, phi_hit->uniqueClone());
1407 ++netaPhiHits.first.second;
1408 phiHits.push_back(phi_hit);
1411 double phiPos = isEndcap ? std::abs(phi_hit->globalPosition().z()) : phi_hit->globalPosition().
perp();
1412 posFirstPhiStation =
std::min(phiPos, posFirstPhiStation);
1413 posLastPhiStation =
std::max(phiPos, posLastPhiStation);
1415 if (sp.phiHits.size() > 1) refit =
false;
1427 if (!etaClusterVec.empty()) {
1428 std::unique_ptr<const CompetingMuonClustersOnTrack> etaCompCluster =
m_compClusterCreator->createBroadCluster(etaClusterVec, 0.);
1429 if (!etaCompCluster) {
1430 ATH_MSG_DEBUG(
" failed to create competing ETA ROT " << etaClusterVec.size());
1433 ++netaPhiHits.first.first;
1436 for (
unsigned int i = 0;
i < etaCompCluster->containedROTs().
size(); ++
i) {
1438 " content: " <<
m_idHelperSvc->toString(etaCompCluster->containedROTs()[
i]->identify()));
1441 rioDistVec.emplace_back(dist, std::move(etaCompCluster));
1448 if (!phiClusterVec.empty()) {
1449 std::unique_ptr<const CompetingMuonClustersOnTrack> phiCompCluster =
m_compClusterCreator->createBroadCluster(phiClusterVec, 0.);
1450 if (!phiCompCluster) {
1451 ATH_MSG_DEBUG(
" failed to create competing PHI ROT " << phiClusterVec.size());
1454 phiHits.push_back(phiCompCluster.get());
1456 ++netaPhiHits.first.second;
1460 for (
unsigned int i = 0;
i < phiCompCluster->containedROTs().
size(); ++
i) {
1462 " content: " <<
m_idHelperSvc->toString(phiCompCluster->containedROTs()[
i]->identify()));
1468 double phiPos = isEndcap ? std::abs(phiCompCluster->globalPosition().z()) :
1469 phiCompCluster->globalPosition().
perp();
1470 posFirstPhiStation =
std::min(phiPos,posFirstPhiStation);
1471 posLastPhiStation =
std::max(phiPos,posLastPhiStation);
1472 rioDistVec.emplace_back(dist, std::move(phiCompCluster));
1483 std::map<Identifier, std::list<const Trk::PrepRawData*> > phiClusterMap;
1485 std::set<const MuonClusterOnTrack*> selectedClusters;
1486 std::vector<const Cluster2D*> phiClusters;
1487 phiClusters.reserve(spVecs.second.size());
1490 for (
const Cluster2D& phi_clus :spVecs.second) {
1491 if (!phi_clus.phiHit || phi_clus.corrupt()) {
1495 phiClusters.push_back(&phi_clus);
1496 selectedClusters.insert(phi_clus.phiHit);
1499 unsigned int recoveredUnassociatedPhiHits(0);
1503 for (
const Cluster2D& rpc_clust : spVecs.first) {
1505 if (!rpc_clust.phiHit || rpc_clust.corrupt())
continue;
1508 if (detElOnSegments.count(rpc_clust.detElId))
continue;
1512 if (phiIndices.count(
phiIndex))
continue;
1514 bool wasFound =
false;
1515 for (
const MuonClusterOnTrack* phi_hit : rpc_clust.phiHits) {
1517 if (!selectedClusters.insert(phi_hit).second) {
1523 for (
const MuonClusterOnTrack* erase_me : rpc_clust.phiHits) {
1524 if (erase_me == phi_hit)
break;
1525 selectedClusters.erase(erase_me);
1530 if (wasFound)
continue;
1533 phiClusters.push_back(&rpc_clust);
1534 ++recoveredUnassociatedPhiHits;
1538 unsigned int addedPhiHits(0);
1539 for (
const Cluster2D* phi_clus : phiClusters) {
1540 const Identifier& detElId = phi_clus->detElId;
1543 if (detElOnSegments.count(detElId))
continue;
1547 if (phiIndices.count(
phiIndex))
continue;
1554 double residual = resWithSegment.residual(
cl);
1555 double segError = std::sqrt(resWithSegment.trackError2(
cl));
1564 bool inBounds = std::abs(
residual) < 0.5 * stripLength + 2. + segError;
1567 <<
" pos y " <<
cl.position().y() <<
" : residual " <<
residual <<
" strip half length "
1568 << 0.5 * stripLength <<
" segment error " << segError);
1576 std::list<const Trk::PrepRawData*>& cham_hits{phiClusterMap[detElId]};
1577 std::transform(phi_clus->phiHits.begin(), phi_clus->phiHits.end(), std::back_inserter(cham_hits),
1578 [](
const MuonClusterOnTrack* clus){
1579 return clus->prepRawData();
1585 for (
const auto& [phi_id, prds] : phiClusterMap) {
1591 std::unique_ptr<const CompetingMuonClustersOnTrack> phiCompCluster =
m_compClusterCreator->createBroadCluster(prds, 0.);
1592 if (!phiCompCluster) {
1593 ATH_MSG_DEBUG(
" failed to create competing PHI ROT " << prds.size());
1600 <<
" distance to segment " << dist);
1603 phiHits.push_back(phiCompCluster.get());
1604 ++netaPhiHits.first.second;
1608 <<
" distance to segment " << dist);
1609 for (
unsigned int i = 0;
i < phiCompCluster->containedROTs().
size(); ++
i) {
1611 " content: " <<
m_idHelperSvc->toString(phiCompCluster->containedROTs()[
i]->identify()));
1614 rioDistVec.emplace_back(dist, std::move(phiCompCluster));
1617 ATH_MSG_VERBOSE(
"Added " << addedPhiHits <<
" unass phi hits out of " << spVecs.second.size()
1618 <<
" phi hits without eta hit and " << recoveredUnassociatedPhiHits <<
" with unassociated eta hit ");
1622 double phiDistanceMax = posLastPhiStation - posFirstPhiStation;
1623 if (isEndcap && phiDistanceMax < 1000.)
1625 else if (phiDistanceMax < 400.)
1628 netaPhiHits.second = refit;
◆ associateMDTsToSegment()
Definition at line 1149 of file DCMathSegmentMaker.cxx.
1160 if (
segment.hasCurvatureParameters()) {
1162 double ml2phi =
line.phi() -
segment.deltaAlpha();
1167 double chamberMidPtY = (ml1LocPos.
y() + ml2LocPos.
y()) / 2.0;
1173 toLineml2 = tmptoLine;
1183 const MdtDriftCircleOnTrack* riodc{dcit.rot()};
1187 if (
m_idHelperSvc->mdtIdHelper().multilayer(riodc->identify()) == 2) toLine = toLineml2;
1198 Amg::Vector3D posAlong = gToStation * riodc->globalPosition();
1201 posAlong[1] = pointOnLineAMDB.
x();
1202 posAlong[2] = pointOnLineAMDB.
y();
1209 ATH_MSG_WARNING(
" dynamic cast to StraightLineSurface failed for mdt!!! ");
1220 std::unique_ptr<MdtDriftCircleOnTrack> nonconstDC;
1221 bool hasT0 =
segment.hasT0Shift();
1224 nonconstDC.reset(
m_mdtCreator->createRIO_OnTrack(*riodc->prepRawData(), mdtGP, &gdir, 0.,
nullptr,
beta, 0.));
1225 if (hasT0)
ATH_MSG_WARNING(
"Attempted to change t0 without a properly configured MDT creator tool. ");
1228 nonconstDC.reset(
m_mdtCreatorT0->createRIO_OnTrack(*riodc->prepRawData(), mdtGP, &gdir,
segment.t0Shift()));
1239 dcit.driftState(), dcit.id(),
1242 dcit = std::move(new_dc_on_track);
1246 double shift = riodc->driftTime() - nonconstDC->driftTime();
1247 ATH_MSG_VERBOSE(
" t0 shift " <<
segment.t0Shift() <<
" from hit " << shift <<
" recal " << nonconstDC->driftRadius()
1248 <<
" t " << nonconstDC->driftTime() <<
" from fit " << dcit.r() <<
" old "
1249 << riodc->driftRadius() <<
" t " << riodc->driftTime());
1250 if (std::abs(std::abs(nonconstDC->driftRadius()) - std::abs(dcit.r())) > 0.1 && nonconstDC->driftRadius() < 19. &&
1251 nonconstDC->driftRadius() > 1.) {
1257 double dist = pointOnHit.
x();
1258 rioDistVec.emplace_back(dist, std::move(nonconstDC));
◆ calculateHoles()
Definition at line 1689 of file DCMathSegmentMaker.cxx.
1694 if (!InterSectSvc.isValid()) {
1695 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
1701 const MuonStationIntersect
intersect = InterSectSvc->tubesCrossedByTrack(MuonDetMgr, chid, gpos, gdir);
1704 std::set<Identifier> hitsOnSegment, chambersOnSegment;
1705 int firstLayer{-1}, lastLayer{-1};
1706 for (
const std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>>& rdit : rioDistVec) {
1707 const MdtDriftCircleOnTrack* mdt =
dynamic_cast<const MdtDriftCircleOnTrack*
>(rdit.second.get());
1711 if (firstLayer == -1)
1716 hitsOnSegment.insert(
id);
1721 if (firstLayer > lastLayer) {
std::swap(firstLayer, lastLayer); }
1722 ATH_MSG_VERBOSE(
" Tube layer ranges: " << firstLayer <<
" -- " << lastLayer <<
" crossed tubes "
1725 std::vector<Identifier> holeVec;
1726 for (
const MuonTubeIntersect& tint :
intersect.tubeIntersects()) {
1727 if (!chambersOnSegment.count(
m_idHelperSvc->chamberId(tint.tubeId))) {
1728 ATH_MSG_VERBOSE(
" chamber not on segment, not counting tube " << tint.rIntersect <<
" l " << tint.xIntersect <<
" "
1736 bool notBetweenHits = layer < firstLayer || layer > lastLayer;
1737 double distanceCut = hasMeasuredCoordinate ? -20 : -200.;
1739 if (notBetweenHits && (std::abs(tint.rIntersect) > innerRadius || (!
m_allMdtHoles && tint.xIntersect > distanceCut))) {
1740 ATH_MSG_VERBOSE(
" not counting tube: distance to wire " << tint.rIntersect <<
" dist to tube end " << tint.xIntersect
1745 if (hitsOnSegment.count(tint.tubeId)) {
1746 ATH_MSG_VERBOSE(
" tube on segment: distance to wire " << tint.rIntersect <<
" dist to tube end " << tint.xIntersect
1752 if (deltaVec.count(tint.tubeId)) {
1753 ATH_MSG_VERBOSE(
" removing delta, distance to wire " << tint.rIntersect <<
" dist to tube end " << tint.xIntersect
1759 if (prd && std::abs(prd->localPosition()[
Trk::locR]) < std::abs(tint.rIntersect)) {
1760 ATH_MSG_VERBOSE(
" found and removed delta, distance to wire " << tint.rIntersect <<
" dist to tube end "
1761 << tint.xIntersect <<
" "
1766 ATH_MSG_VERBOSE((outoftimeVec.count(tint.tubeId) ?
"Out-of-time" :
"hole") <<
" distance to wire "
1767 << tint.rIntersect <<
" dist to tube end " << tint.xIntersect <<
" "
1768 <<
m_idHelperSvc->toString(tint.tubeId)<<(notBetweenHits ?
"outside hits" :
"between hits"));
1770 holeVec.push_back(tint.tubeId);
◆ checkBoundsInXZ()
bool Muon::DCMathSegmentMaker::checkBoundsInXZ |
( |
double |
xline, |
|
|
double |
zline, |
|
|
double |
dXdZ, |
|
|
const std::vector< HitInXZ > & |
hits |
|
) |
| const |
|
private |
check whether all hits are in bounds in the XZ plane
Definition at line 1824 of file DCMathSegmentMaker.cxx.
1829 for (
const HitInXZ& hit :
hits) {
1830 bool outBounds =
false;
1831 double locExX = xline + dXdZ * (hit.z - zline);
1832 if (hit.isMdt && (locExX < hit.xmin - 1. || locExX > hit.xmax + 1.)) {
1840 << std::setw(6) << (
int)hit.z <<
") ex pos " << std::setw(6) << (
int)locExX <<
" min " << std::setw(6)
1841 << (
int)hit.xmin <<
" max " << std::setw(6) << (
int)hit.xmax <<
" phimin " << std::setw(6)
1842 << hit.phimin <<
" phimax " << std::setw(6) << hit.phimax <<
" outBounds, cross-check");
◆ checkPhiConsistency()
bool Muon::DCMathSegmentMaker::checkPhiConsistency |
( |
double |
phi, |
|
|
double |
phimin, |
|
|
double |
phimax |
|
) |
| const |
|
private |
check whether phi is consistent with segment phi
Definition at line 2100 of file DCMathSegmentMaker.cxx.
2106 if (phimin * phimax < 0.) {
2109 if (phi < phimin -
offset) phiOk =
false;
2111 if (phi > phimin +
offset) phiOk =
false;
2115 if (phi < phimax -
offset) phiOk =
false;
2117 if (phi > phimax +
offset) phiOk =
false;
2121 if (phi < phimin - offset || phi > phimax +
offset) phiOk =
false;
◆ create1DClusters()
Definition at line 694 of file DCMathSegmentMaker.cxx.
704 for (
const MuonClusterOnTrack* clust :
clusters) {
710 if (phiVec.back().corrupt()) phiVec.pop_back();
713 if (clVec.back().corrupt()) clVec.pop_back();
◆ create2DClusters()
Definition at line 720 of file DCMathSegmentMaker.cxx.
725 for (
const MuonClusterOnTrack* clus:
clusters) {
733 gasGapHitMap[chId][gasGapId].first.push_back(clus);
735 gasGapHitMap[chId][gasGapId].second.push_back(clus);
◆ createChamberGeometry()
Definition at line 1073 of file DCMathSegmentMaker.cxx.
1098 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
1104 MuonDetMgr->getMdtReadoutElement(
m_idHelperSvc->mdtIdHelper().channelID(
name, eta, phi, 1, 1, 1));
1113 detEl2 = MuonDetMgr->getMdtReadoutElement(firstIdml1);
1114 firstTubeMl1 = gToStation * (detEl2->
surface(firstIdml1).
center());
1124 firstTubeMl0 = gToStation * (detEl1->
surface(firstIdml0).
center());
1137 double tubeDist = (secondTubeMl0 - firstTubeMl0).
y();
1138 double tubeStage = (firstTubeMl0lay1 - firstTubeMl0).
y();
1139 double layDist = (firstTubeMl0lay1 - firstTubeMl0).
z();
1141 TrkDriftCircleMath::MdtChamberGeometry mdtgeo(chid,
m_idHelperSvc.get(), nml, nlay, ntube1, ntube2, firstTube0, firstTube1, tubeDist, tubeStage,
◆ createClusterVec()
Definition at line 978 of file DCMathSegmentMaker.cxx.
982 const int chPhi =
m_idHelperSvc->mdtIdHelper().stationPhi(chid);
986 cls.reserve(spVec.size());
987 for (
const Cluster2D& clust : spVec) {
989 const MuonClusterOnTrack* meas = clust.etaHit ? clust.etaHit : clust.phiHit;
1014 << meas->detectorElement()->center().phi() <<
" index " <<
index);
1015 cls.emplace_back(lp, clust.error, clid, meas,
index);
◆ createDCVec()
Definition at line 1020 of file DCMathSegmentMaker.cxx.
1025 dcs.reserve(mdts.size());
1027 bool firstMdt =
true;
1029 for (
const MdtDriftCircleOnTrack* rot : mdts) {
1035 Amg::Vector3D locPos = gToStation * rot->prepRawData()->globalPosition();
1038 double r = rot->localParameters()[
Trk::locR];
1046 double preciseError =
dr;
1051 TubeEnds tubeEnds =
localTubeEnds(*rot, gToStation, amdbToGlobal);
1053 phimin = tubeEnds.phimin;
1054 phimax = tubeEnds.phimax;
1061 << rot->driftTime() <<
" r " <<
r <<
" dr " <<
dr <<
" phi range " << tubeEnds.phimin <<
" "
1062 << tubeEnds.phimax<<
" precise error "<<preciseError);
1063 dcs.push_back(std::move(dc));
1065 chamberSet.insert(elId);
1067 ++dcStatistics[rot->prepRawData()->detectorElement()];
◆ createROTVec()
Definition at line 1655 of file DCMathSegmentMaker.cxx.
1658 std::sort(rioDistVec.begin(), rioDistVec.end(), SortByDistanceToSegment());
1661 rioVec.reserve(rioDistVec.size());
1662 for (std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>>& rdit : rioDistVec) { rioVec.push_back(std::move(rdit.second)); }
◆ createRpcSpacePoint()
Definition at line 917 of file DCMathSegmentMaker.cxx.
920 std::vector<const MuonClusterOnTrack*> cleanPhihits;
921 cleanPhihits.reserve(phiHits.size());
923 double error{1.}, lpx{0.}, lpy{0.};
926 lpx = phiHits.front()->localParameters()[
Trk::locX];
930 for (
const MuonClusterOnTrack* clus : phiHits) {
932 if (clus->identify() == prevId)
continue;
933 prevId = clus->identify();
934 cleanPhihits.push_back(clus);
936 }
else if (phiHits.empty()) {
937 lpx = etaHit->localParameters()[
Trk::locX];
939 }
else if (etaHit && !phiHits.empty()) {
940 lpx = etaHit->localParameters()[
Trk::locX];
946 double minPos{1e9}, maxPos{-1e9};
950 for (
const MuonClusterOnTrack* phiHit : phiHits) {
952 if (phiHit->identify() == prevId)
continue;
953 prevId = phiHit->identify();
957 if (etaHit->associatedSurface().globalToLocal(phiHit->globalPosition(), phiHit->globalPosition(), phiLocPos)) {
962 cleanPhihits.push_back(phiHit);
965 if (cleanPhihits.size() > 1)
966 ATH_MSG_DEBUG(
" multiple phi hits: nhits " << cleanPhihits.size() <<
" cl width " << maxPos - minPos);
971 if (std::abs(
error) < 0.001) {
975 return Cluster2D(detElId, gasGapId,
Amg::Vector2D(lpx, lpy),
error, etaHit, !cleanPhihits.empty() ? cleanPhihits : phiHits);
◆ createSegment()
Use linearity of the sin at leading order to check that the angular differences are either 0 or PI
Copy hits into vector
recalculate global direction and position
Definition at line 227 of file DCMathSegmentMaker.cxx.
236 const bool isCurvedSegment =
segment.hasCurvatureParameters() &&
240 if (
segment.hitsOnTrack() < 3)
return nullptr;
246 <<
line.position().y() <<
" phi " <<
line.phi() <<
" associated clusters "
251 Amg::Vector3D lroaddir = sInfo.globalTrans.linear() * roaddir2;
256 if (hasPhiMeasurements) {
260 double cphi = lroaddir.x();
270 double shortestTubeLen = 1e9;
275 const MdtDriftCircleOnTrack* riodc{
driftCircle.rot()};
276 int lay =
m_idHelperSvc->mdtIdHelper().tubeLayer(riodc->identify());
278 double tubelen = 0.5 * riodc->prepRawData()->detectorElement()->getActiveTubeLength(lay,
tube);
279 if (tubelen < shortestTubeLen) shortestTubeLen = tubelen;
282 if (std::abs(lxroad) > shortestTubeLen) {
283 ATH_MSG_DEBUG(
"coordinates far outside chamber! using global position of first hit ");
284 if (lxroad < 0.) shortestTubeLen *= -1.;
285 lxroad = shortestTubeLen;
288 lxroad = (sInfo.globalTrans * mdts[0]->prepRawData()->detectorElement()->surface(mdts[0]->
identify()).center()).
x();
299 surfaceTransform.pretranslate(gpos);
300 double surfDim = 500.;
301 std::unique_ptr<Trk::PlaneSurface> surf = std::make_unique<Trk::PlaneSurface>(surfaceTransform, surfDim, surfDim);
305 double linephi =
line.phi();
312 std::vector<std::pair<double, std::unique_ptr<const Trk::MeasurementBase>> > rioDistVec;
315 std::set<Identifier> deltaVec;
316 std::set<Identifier> outoftimeVec;
319 std::vector<std::pair<double, std::unique_ptr<const Trk::MeasurementBase>>> garbage_collector;
333 linephi =
result.line().phi();
334 lpos[1] =
result.line().position().x();
335 lpos[2] =
result.line().position().y();
336 gpos = sInfo.amdbTrans * lpos;
340 surfaceTransform.pretranslate(gpos);
341 surf = std::make_unique<Trk::PlaneSurface>(surfaceTransform, surfDim, surfDim);
361 if (
std::min(std::abs(diff_phi), std::abs( std::abs(diff_phi) -
M_PI)) > 1.
e-3 ||
362 std::min(std::abs(diff_prec), std::abs(std::abs(diff_prec) -
M_PI)) > 1.
e-3) {
363 ATH_MSG_WARNING(
" ALARM updated angles wrong: diff phi " << diff_phi <<
" prec " << diff_prec <<
" phi rdir " << roaddir2.phi()
364 <<
" gdir " << gdir.phi() <<
" lphi " << linephi <<
" seg "
369 std::pair<std::pair<int, int>,
bool> netaPhiHits =
372 if (rioDistVec.empty()){
378 auto meas_for_fit = [&rioDistVec] () {
379 std::vector<const Trk::MeasurementBase*>
out{};
380 out.reserve(rioDistVec.size());
381 std::sort(rioDistVec.begin(), rioDistVec.end(), SortByDistanceToSegment());
382 for (
const std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>>& ele : rioDistVec)
out.push_back(ele.second.get());
387 double dlocx{1000.}, dangleXZ{1000.}, qoverp{-99999.}, dqoverp{-99999.};
388 bool hasMeasuredCoordinate =
false;
390 ATH_MSG_DEBUG(
" distance between first and last phi hit sufficient to perform 4D fit: phi " << gdir.phi() <<
" theta "
396 if (isCurvedSegment &&
track->perigeeParameters() &&
track->perigeeParameters()->covariance()) {
400 hasMeasuredCoordinate =
true;
403 updatedCov.setZero();
416 if (
track->measurementsOnTrack() && rioDistVec.size() !=
track->measurementsOnTrack()->size()) {
417 if (
track->measurementsOnTrack()->empty()) {
421 ATH_MSG_DEBUG(
" ROT vector size changed after fit, updating ");
422 garbage_collector = std::move(rioDistVec);
423 rioDistVec.reserve(
track->measurementsOnTrack()->size());
428 if (!firstPars) firstPars =
pars;
435 rioDistVec.emplace_back(dist, meas->
uniqueClone());
440 netaPhiHits.second =
false;
447 if (
updateSegmentPhi(gpos, gdir, segLocPos, segLocDir, *surf, meas_for_fit(), sInfo.phimin, sInfo.phimax)) {
450 hasMeasuredCoordinate =
true;
457 std::vector<const Trk::MeasurementBase*> debug_meas = meas_for_fit();
458 ATH_MSG_DEBUG(
" number of hits " << debug_meas.size() <<
" of which trigger " << netaPhiHits.first.first <<
" eta and "
459 << netaPhiHits.first.second <<
" phi ");
464 const MdtDriftCircleOnTrack* mdt =
dynamic_cast<const MdtDriftCircleOnTrack*
>(rot);
467 <<
" radius " << std::setw(6) << mdt->driftRadius() <<
" time " << std::setw(6) << mdt->driftTime());
470 const CompetingMuonClustersOnTrack* crot =
dynamic_cast<const CompetingMuonClustersOnTrack*
>(mit);
473 <<
" comp rot with hits " << crot->containedROTs().size());
480 std::vector<Identifier> holeVec =
calculateHoles(ctx, chid, gpos, gdir, hasMeasuredCoordinate, deltaVec, outoftimeVec, rioDistVec);
483 if (!outoftimeVec.empty()) holeVec.insert(holeVec.end(), std::make_move_iterator(outoftimeVec.begin()),
484 std::make_move_iterator(outoftimeVec.end()));
496 bool hasFittedT0 =
false;
497 double fittedT0{0}, errorFittedT0{1.};
502 errorFittedT0 =
segment.t0Error();
503 }
else if (dcslFitter &&
result.hasT0Shift()) {
504 fittedT0 =
result.t0Shift();
505 errorFittedT0 =
result.t0Error();
512 std::unique_ptr<MuonSegment> msegment;
513 if (isCurvedSegment) {
514 if (qoverp == -99999.) {
518 constexpr
double BILALPHA(28.4366), BMLALPHA(62.8267), BMSALPHA(53.1259), BOLALPHA(29.7554);
521 dqoverp = M_SQRT2 *
segment.dtheta() / BILALPHA;
524 dqoverp = M_SQRT2 *
segment.dtheta() / BMLALPHA;
527 dqoverp = M_SQRT2 *
segment.dtheta() / BMSALPHA;
530 dqoverp = M_SQRT2 *
segment.dtheta() / BOLALPHA;
541 std::vector<Trk::DefinedParameter> defPars;
544 defPars.emplace_back(gdir.phi(),
Trk::phi);
545 defPars.emplace_back(gdir.theta(),
Trk::theta);
548 msegment = std::make_unique<MuonSegment>(
549 std::move(segLocPar),
564 std::make_unique<MuonSegment>(segLocPos,
573 if (hasFittedT0) msegment->setT0Error(fittedT0, errorFittedT0);
584 if (segmentQuality < 0) {
return nullptr; }
◆ createSpacePoint()
Definition at line 844 of file DCMathSegmentMaker.cxx.
847 double error{1.}, lpx{0.}, lpy{0.};
854 lpx = phiHit->localParameters()[
Trk::locX];
857 }
else if (!phiHit) {
858 lpx = etaHit->localParameters()[
Trk::locX];
860 }
else if (etaHit && phiHit) {
864 std::vector<const MuonClusterOnTrack*> phiVec{phiHit};
869 if (std::abs(
error) < 0.001) {
◆ createSpacePoints() [1/2]
Definition at line 741 of file DCMathSegmentMaker.cxx.
747 for (
const auto& [
id, gasGapHits] : chIdHitMap) {
751 std::make_move_iterator(
cls.first.end()), std::back_inserter(
spacePoints));
753 std::make_move_iterator(
cls.second.end()), std::back_inserter(phiVec));
756 return std::make_pair(std::move(
spacePoints), std::move(phiVec));
◆ createSpacePoints() [2/2]
Definition at line 759 of file DCMathSegmentMaker.cxx.
761 bool isEndcap =
m_idHelperSvc->isEndcap((*(gasGapHitMap.begin())).first);
763 ATH_MSG_VERBOSE(
" creating Space points for " << gasGapHitMap.size() <<
" gas gaps ");
765 for (
const auto& [gasGapId, etaPhiHits] : gasGapHitMap) {
767 std::vector<bool> flagPhihit(etaPhiHits.second.size(), 0);
773 << etaPhiHits.second.size());
775 for (
const MuonClusterOnTrack* etaHit : etaPhiHits.first) {
777 if (etaHit->identify() == prevEtaId)
continue;
778 prevEtaId = etaHit->identify();
784 bool foundSP =
false;
787 for (
const MuonClusterOnTrack* phiHit : etaPhiHits.second) {
790 if (phiHit->identify() == prevPhiId)
continue;
791 prevPhiId = phiHit->identify();
796 if (sp.corrupt())
continue;
800 flagPhihit[phi_idx] =
true;
806 if (sp.corrupt())
continue;
811 if (sp.corrupt())
continue;
813 flagPhihit = std::vector<bool>(etaPhiHits.second.size(), 1);
820 for (
unsigned int i = 0;
i < flagPhihit.size(); ++
i) {
821 if (flagPhihit[
i])
continue;
824 if (etaPhiHits.second[
i]->identify() == prevPhiId)
continue;
825 prevPhiId = etaPhiHits.second[
i]->identify();
828 if (sp.corrupt())
continue;
829 phiVec.push_back(std::move(sp));
831 }
else if (etaPhiHits.first.empty() && !etaPhiHits.second.empty()) {
834 if (sp.corrupt())
continue;
835 phiVec.push_back(std::move(sp));
839 ATH_MSG_VERBOSE(
" Creating space points, number of gas-gaps " << gasGapHitMap.size() <<
" space points " <<
spacePoints.size());
841 return std::make_pair(std::move(
spacePoints), std::move(phiVec));
◆ createTgcSpacePoint()
Definition at line 876 of file DCMathSegmentMaker.cxx.
879 double error{1.}, lpx{0.}, lpy{0.};
883 lpx = phiHit->localParameters()[
Trk::locX];
885 }
else if (!phiHit) {
886 lpx = etaHit->localParameters()[
Trk::locX];
888 }
else if (etaHit && phiHit) {
893 etaHit->globalPosition(),
894 phiHit->globalPosition());
897 lpx = lSpacePoint.x();
898 lpy = lSpacePoint.y();
900 if (
error <= std::numeric_limits<double>::epsilon()) {
902 if (etaHit->prepRawData())
906 <<
" " <<
m_idHelperSvc->toString(etaHit->identify()) << std::endl
909 if (std::abs(
error) < 0.001) {
◆ distanceToSegment()
Definition at line 1632 of file DCMathSegmentMaker.cxx.
1636 double cos_sinLine = cot(
line.phi());
1644 double delta_y = lpos.y() -
line.position().y();
1652 return pointOnHit.
x();
◆ errorScaleFactor()
double Muon::DCMathSegmentMaker::errorScaleFactor |
( |
const Identifier & |
id, |
|
|
double |
curvature, |
|
|
bool |
hasPhiMeasurements |
|
) |
| const |
|
private |
calculate error scaling factor
Definition at line 643 of file DCMathSegmentMaker.cxx.
649 double scaleMax = 5.;
657 if (!hasPhiMeasurements) {
658 double phiScale = 1.;
660 int stRegion =
m_idHelperSvc->mdtIdHelper().stationRegion(
id);
663 else if (stRegion == 1)
665 else if (stRegion == 2)
◆ errorScalingRegion()
bool Muon::DCMathSegmentMaker::errorScalingRegion |
( |
const Identifier & |
id | ) |
const |
|
private |
◆ find() [1/5]
find segments starting from:
- an estimate of the global position and direction of the particle in the chamber
- a list of MdtDriftCircleOnTrack
- a list of MuonClusterOnTrack
- a boolean to indicate whether the external prediction should be used to set the \( \phi \)-direction of the segment
- an estimate of the momentum of the particle
The global direction is used to perform a seeded search for segments.
Definition at line 84 of file DCMathSegmentMaker.cxx.
88 const EventContext& ctx = Gaudi::Hive::currentContext();
96 if (mdts.size() < 3)
return;
100 if (!firstRot) {
return; }
124 double chamber_angleYZ = std::atan2(dirCh.z(), dirCh.y());
127 double dotprod = globalDirCh.perp() *
std::sin(roaddir2.theta()) + globalDirCh.z() *
std::cos(roaddir2.theta());
128 if (dotprod < 0) roaddir2 = -roaddir2;
133 double road_angleXZ = std::atan2(
d.z(),
d.x());
134 double road_angleYZ = std::atan2(
d.z(),
d.y());
136 if (!hasPhiMeasurements) road_angleXZ =
M_PI;
138 << isEndcap <<
" central phi " << detEl->
center().phi() <<
" r " << detEl->
center().perp()
139 <<
" z " << detEl->
center().z());
155 std::stringstream sstr{};
156 for (
const MdtDriftCircleOnTrack* mdt : mdts)
158 ATH_MSG_VERBOSE(
" adding mdts " << mdts.size()<<std::endl<<sstr.str());
162 std::set<Identifier> chamberSet;
163 double phimin{-9999}, phimax{9999};
168 std::shared_ptr<const TrkDriftCircleMath::ChamberGeometry> multiGeo;
170 ATH_MSG_VERBOSE(
" using chamber geometry with #chambers " << chamberSet.size());
172 std::vector<TrkDriftCircleMath::MdtChamberGeometry> geos{};
175 geos.reserve(chamberSet.size());
181 multiGeo = std::make_unique<TrkDriftCircleMath::MdtMultiChamberGeometry>(geos);
187 if (sinAngleCut > 0)
angle = sinAngleCut;
194 std::stringstream sstr{};
195 unsigned int seg_n{0};
198 sstr<<
"Segment number "<<seg_n<<
" is at ("<<seg.line().x0()<<
","<<seg.line().y0()<<
") pointing to "<<seg.line().phi()*toDeg<<
" chi2: "<<
199 (seg.chi2()/seg.ndof())<<
"("<<seg.ndof()<<
")"<<std::endl;
200 sstr<<
"Mdt measurements: "<<seg.dcs().size()<<std::endl;
202 sstr<<
" **** "<<
m_printer->print(*mdt_meas.rot());
203 sstr<<
" ("<<mdt_meas.state()<<
")"<<std::endl;
205 sstr<<
"Cluster measurements "<<seg.clusters().size()<<std::endl;
207 sstr<<
" ---- "<<
m_printer->print(*clus.rot())<<std::endl;
212 ATH_MSG_VERBOSE(
"Found " << segs.size() <<
" segments "<<std::endl<<sstr.str());
216 if (segs.empty()) {
return; }
219 segmentCreationInfo sInfo(spVecs, multiGeo.get(), gToStation, amdbToGlobal, phimin, phimax);
221 std::unique_ptr<MuonSegment>
segment =
createSegment(ctx, seg, chid, roadpos, roaddir2, mdts, hasPhiMeasurements, sInfo,
beta);
◆ find() [2/5]
find segments starting from:
Implementation of IMuonSegmentMaker interface routine
Will call:
std::vector<const MuonSegment*>* find( const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, const std::vector<const MdtDriftCircleOnTrack*>& mdts, const std::vector<const MuonClusterOnTrack*>& clusters, bool hasPhiMeasurements, double momentum );
Definition at line 607 of file DCMathSegmentMaker.cxx.
609 if (mdts.empty())
return;
611 const MdtDriftCircleOnTrack* mdt = mdts.front();
614 bool hasPhiMeasurements =
false;
617 find(gpos, gdir, mdts,
clusters, hasPhiMeasurements, segColl);
◆ find() [3/5]
find segments starting from a list of RIO_OnTrack objects, implementation of IMuonSegmentMaker interface routine.
Will call:
std::vector<const MuonSegment*>* find( const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, const std::vector<const MdtDriftCircleOnTrack*>& mdts, const std::vector<const MuonClusterOnTrack*>& clusters, bool hasPhiMeasurements);
Definition at line 588 of file DCMathSegmentMaker.cxx.
589 std::vector<const MdtDriftCircleOnTrack*> mdts;
590 std::vector<const MuonClusterOnTrack*>
clusters;
595 const MdtDriftCircleOnTrack* mdt =
dynamic_cast<const MdtDriftCircleOnTrack*
>(
it);
596 if (!mdt) {
ATH_MSG_WARNING(
"failed dynamic_cast, not a MDT but hit has MDT id!!!"); }
599 const MuonClusterOnTrack* clus =
dynamic_cast<const MuonClusterOnTrack*
>(
it);
600 if (!clus) {
ATH_MSG_WARNING(
"failed dynamic_cast, not a cluster but hit has RPC/TGC id!!!"); }
◆ find() [4/5]
find segments starting from a list of RIO_OnTrack objects in multiple chambers, implementation of IMuonSegmentMaker interface routine Will call:
std::vector<const MuonSegment*>* find( const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, const std::vector<const MdtDriftCircleOnTrack*>& mdts, const std::vector<const MuonClusterOnTrack*>& clusters, bool hasPhiMeasurements);
Definition at line 620 of file DCMathSegmentMaker.cxx.
622 std::vector<const Trk::RIO_OnTrack*> rios = rios1;
623 rios.insert(rios.end(), rios2.begin(), rios2.end());
◆ find() [5/5]
find segments starting from:
Implementation of IMuonSegmentMaker interface routine
Will call:
std::vector<const MuonSegment*>* find( const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, const std::vector<const MdtDriftCircleOnTrack*>& mdts, const std::vector<const MuonClusterOnTrack*>& clusters, bool hasPhiMeasurements, double momentum );
Definition at line 627 of file DCMathSegmentMaker.cxx.
631 std::vector<const MdtDriftCircleOnTrack*> all_mdts;
632 for (
const std::vector<const MdtDriftCircleOnTrack*>& circle_vec : mdts) {
std::copy(circle_vec.begin(), circle_vec.end(), std::back_inserter(all_mdts)); }
635 std::vector<const MuonClusterOnTrack*> all_clus;
636 for (
const std::vector<const MuonClusterOnTrack*>& clus_vec :
clusters) {
std::copy(clus_vec.begin(), clus_vec.end(), std::back_inserter(all_clus)); }
◆ findFirstRotInChamberWithMostHits()
Definition at line 1794 of file DCMathSegmentMaker.cxx.
1796 int hitsInChamberWithMostHits = 0;
1797 std::map<Identifier, int> hitsPerChamber;
1798 int currentSector = -1;
1799 const MdtDriftCircleOnTrack* rotInChamberWithMostHits =
nullptr;
1802 for (
const MdtDriftCircleOnTrack* rot : mdts) {
1809 if (currentSector == -1) {
1810 currentSector = sector;
1811 }
else if (sector != currentSector) {
1814 int& hitsInCh = hitsPerChamber[chId];
1816 if (hitsInCh > hitsInChamberWithMostHits) {
1817 hitsInChamberWithMostHits = hitsInCh;
1818 rotInChamberWithMostHits = rot;
1821 return rotInChamberWithMostHits;
◆ findMdt()
Definition at line 1775 of file DCMathSegmentMaker.cxx.
1782 if (!MdtCont.isValid()) {
1787 if (!collptr)
return nullptr;
1788 for (
const MdtPrepData* prd : *collptr) {
1789 if (prd->identify() ==
id)
return prd;
◆ initialize()
StatusCode Muon::DCMathSegmentMaker::initialize |
( |
| ) |
|
|
virtual |
◆ localTubeEnds()
calculate positions of tube ends
Definition at line 2048 of file DCMathSegmentMaker.cxx.
2052 Amg::Vector3D lpos = gToSegment * mdt.prepRawData()->globalPosition();
2055 Amg::Vector3D lropos = gToSegment * mdt.prepRawData()->detectorElement()->ROPos(
id);
2059 double tubeLen = (lropos - lhvpos).
mag();
2060 double activeTubeLen =
2061 mdt.detectorElement()->getActiveTubeLength(
m_idHelperSvc->mdtIdHelper().tubeLayer(
id),
m_idHelperSvc->mdtIdHelper().tube(
id));
2062 double scaleFactor = activeTubeLen / tubeLen;
2063 lropos[0] = scaleFactor * lropos.x();
2064 lhvpos[0] = scaleFactor * lhvpos.x();
2066 tubeEnds.lxmin =
std::min(lropos.x(), lhvpos.x());
2067 tubeEnds.lxmax =
std::max(lropos.x(), lhvpos.x());
2071 const double phiRO = ropos.phi();
2072 const double phiHV = hvpos.phi();
2073 tubeEnds.phimin =
std::min(phiRO, phiHV);
2074 tubeEnds.phimax =
std::max(phiRO, phiHV);
◆ residualAndPullWithSegment()
Definition at line 1667 of file DCMathSegmentMaker.cxx.
1671 double cos_sinLine = cot(
line.phi());
1678 double delta_y = lpos.y() -
line.position().y();
1684 double residual = lpos.x() - lineSurfaceIntersect.x();
◆ updateDirection()
update the global direction, keeping the phi of the input road direction but using the local angle YZ
Definition at line 2126 of file DCMathSegmentMaker.cxx.
2141 double dz =
std::cos(gdirs.theta());
2147 double dzo =
std::cos(gdiro.theta());
2157 if (b0 < 1e-8 && b0 > 0) b0 = 1
e-8;
2158 if (b0 > -1
e-8 && b0 < 0) b0 = -1
e-8;
2159 double dxn =
dx -
a0 * dxo / b0;
2160 double dyn =
dy -
a0 * dyo / b0;
2161 double dzn = dz -
a0 * dzo / b0;
2162 double norm = std::sqrt(dxn * dxn + dyn * dyn + dzn * dzn);
2166 if (dxn * roaddir.x() + dyn * roaddir.y() + dzn * roaddir.z() < 0.) {
norm = -
norm; }
2168 if (dxn * roaddir.x() + dyn * roaddir.y() < 0.) {
norm = -
norm; }
2171 if (isCurvedSegment)
norm =
norm / 2.;
◆ updatePhiRanges()
void Muon::DCMathSegmentMaker::updatePhiRanges |
( |
double |
phiminNew, |
|
|
double |
phimaxNew, |
|
|
double & |
phiminRef, |
|
|
double & |
phimaxRef |
|
) |
| |
|
staticprivate |
update phi ranges
Definition at line 2078 of file DCMathSegmentMaker.cxx.
2080 if (phiminRef * phimaxRef < 0.) {
2081 if (phiminRef < -1.1) {
2082 if (phiminRef > phiminNew) phiminRef = phiminNew;
2083 if (phimaxRef < phimaxNew) phimaxRef = phimaxNew;
2085 if (phiminRef < phiminNew) phiminRef = phiminNew;
2086 if (phimaxRef > phimaxNew) phimaxRef = phimaxNew;
2090 if (phiminRef < 0.) {
2091 if (phiminRef < phiminNew) phiminRef = phiminNew;
2092 if (phimaxRef > phimaxNew) phimaxRef = phimaxNew;
2094 if (phiminRef > phiminNew) phiminRef = phiminNew;
2095 if (phimaxRef < phimaxNew) phimaxRef = phimaxNew;
◆ updateSegmentPhi()
Definition at line 1848 of file DCMathSegmentMaker.cxx.
1852 bool hasUpdated =
false;
1859 if (ldir.z() < 0.0001)
return false;
1861 double dXdZ = ldir.x() / ldir.z();
1863 double xline = lsegPos.x();
1864 double zline = lsegPos.z();
1865 ATH_MSG_VERBOSE(
" Associated hits " << rots.size() <<
" angleXZ " << 90. * segLocDir.
angleXZ() / (M_PI_2) <<
" dXdZ " << dXdZ
1866 <<
" seg Pos (" << xline <<
" " << zline <<
") " << segLocPos);
1868 std::vector<HitInXZ>
hits;
1869 hits.reserve(rots.size());
1871 unsigned int nphiHits(0);
1872 const HitInXZ* firstPhiHit{
nullptr}, *lastPhiHit{
nullptr};
1876 if (!
id.is_valid())
continue;
1878 double lxmin{0}, lxmax{0}, phimin{0}, phimax{0};
1883 const MdtDriftCircleOnTrack* mdt =
static_cast<const MdtDriftCircleOnTrack*
>(meas);
1884 TubeEnds tubeEnds =
localTubeEnds(*mdt, gToSegment, segmentToGlobal);
1886 lxmin = tubeEnds.lxmin;
1887 lxmax = tubeEnds.lxmax;
1888 phimin = tubeEnds.phimin;
1889 phimax = tubeEnds.phimax;
1891 lpos = gToSegment * meas->globalPosition();
1895 const CompetingMuonClustersOnTrack* crot =
dynamic_cast<const CompetingMuonClustersOnTrack*
>(meas);
1903 lxmin = lpos.x() - 0.5 * stripLength;
1904 lxmax = lpos.x() + 0.5 * stripLength;
1908 locPosition[0] = lxmin;
1910 double phi1 = globalPos.phi();
1912 locPosition[0] = lxmax;
1913 globalPos = segmentToGlobal * locPosition;
1914 double phi2 = globalPos.phi();
1928 ATH_MSG_WARNING(
"dynamic cast failed for CompetingMuonClustersOnTrack");
1931 auto detEl =
dynamic_cast<const MuonGM::TgcReadoutElement*
>(crot->containedROTs().front()->prepRawData()->detectorElement());
1934 const Amg::Vector3D segFrame_StripDir = gToSegment.linear()* detEl->stripDir(
gasGap, stripNo);
1935 const Amg::Vector3D segFrame_stripPos = gToSegment * detEl->channelPos(
id);
1937 lpos = segFrame_stripPos +
1938 Amg::intersect<3>(lsegPos, ldir, segFrame_stripPos, segFrame_StripDir).value_or(0) * segFrame_StripDir;
1945 phimin = globalPos.phi();
1951 ATH_MSG_DEBUG(
" Inconsistent phi " << phimin <<
" range " << seg_phimin <<
" " << seg_phimax);
1956 hits.emplace_back(
id, isMdt, measuresPhi, lpos.x(), lpos.z(), lxmin, lxmax, phimin, phimax);
1960 firstPhiHit = &
hits.back();
1962 double distPhiHits = std::abs(firstPhiHit->z -
hits.back().z);
1963 if (distPhiHits > 500.) {
1964 lastPhiHit = &
hits.back();
1973 double locExX = xline + dXdZ * (lpos.z() - zline);
1975 << std::setw(6) << (
int)lpos.z() <<
") ex pos " << std::setw(6) << (
int)locExX <<
" min "
1976 << std::setw(6) << (
int)lxmin <<
" max " << std::setw(6) << (
int)lxmax <<
" phimin " << std::setw(6)
1977 << phimin <<
" phimax " << std::setw(6) << phimax);
1978 if (lpos.x() < lxmin || lpos.x() > lxmax)
ATH_MSG_VERBOSE(
" outBounds");
1982 if (nphiHits == 1) {
1984 ATH_MSG_WARNING(
" Pointer to first phi hit not set, this should not happen! ");
1986 if (xline != firstPhiHit->x) {
1990 xline = firstPhiHit->x;
1991 zline = firstPhiHit->z;
1997 double dz = ipLocPos.z() - zline;
1998 if (std::abs(dz) > 0.001) {
1999 ATH_MSG_VERBOSE(
" hit (" << xline <<
"," << zline <<
") IP (" << ipLocPos.x() <<
"," << ipLocPos.z()
2000 <<
") dXdZ " << (ipLocPos.x() - xline) / dz <<
" old " << dXdZ);
2001 dXdZ = (ipLocPos.x() - xline) / dz;
2006 }
else if (nphiHits == 2) {
2007 if (!firstPhiHit || !lastPhiHit) {
2008 ATH_MSG_WARNING(
" Pointer to one of the two phi hit not set, this should not happen! ");
2010 double dz = lastPhiHit->z - firstPhiHit->z;
2012 xline = firstPhiHit->x;
2013 zline = firstPhiHit->z;
2014 if (std::abs(dz) > 300.) {
2015 double dx = lastPhiHit->x - firstPhiHit->x;
2028 double segX = xline - dXdZ * zline;
2034 ATH_MSG_DEBUG(
"still several out of bounds hits after rotation: posx(" << segX <<
") dXdZ " << dXdZ
2035 <<
" keeping old result ");
2039 double alphaYZ = segLocDir.
angleYZ();
2040 double alphaXZ = std::atan2(1, dXdZ);
◆ m_addUnassociatedPhiHits
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_addUnassociatedPhiHits {this, "AddUnassociatedPhiHits", false} |
|
private |
◆ m_allMdtHoles
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_allMdtHoles {this, "AllMdtHoles", false} |
|
private |
◆ m_assumePointingPhi
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_assumePointingPhi {this, "AssumePointingPhi", false } |
|
private |
◆ m_chamberGeoKey
◆ m_clusterCreator
Initial value:{
this,
"MuonClusterCreator",
"Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator",
}
Definition at line 366 of file DCMathSegmentMaker.h.
◆ m_compClusterCreator
Initial value:{
this,
"MuonCompetingClustersCreator",
"Muon::TriggerChamberClusterOnTrackCreator/TriggerChamberClusterOnTrackCreator",
}
Definition at line 371 of file DCMathSegmentMaker.h.
◆ m_createCompetingROTsEta
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_createCompetingROTsEta {this, "CreateCompetingROTsEta", true} |
|
private |
◆ m_createCompetingROTsPhi
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_createCompetingROTsPhi {this, "CreateCompetingROTsPhi", true} |
|
private |
◆ m_curvedErrorScaling
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_curvedErrorScaling {this, "CurvedErrorScaling", true} |
|
private |
◆ m_dcslFitProvider
◆ m_DetectorManagerKey
Initial value:{
this,
"DetectorManagerKey",
"MuonDetectorManager",
"Key of input MuonDetectorManager condition data",
}
pointers to IdHelpers
Definition at line 337 of file DCMathSegmentMaker.h.
◆ m_doGeometry
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_doGeometry {this, "DoGeometry", true} |
|
private |
◆ m_doSpacePoints
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_doSpacePoints {this, "UseTriggerSpacePoints", true} |
|
private |
◆ m_doTimeOutChecks
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_doTimeOutChecks {this, "UseTimeOutGard", false} |
|
private |
◆ m_edmHelperSvc
Initial value:{
this,
"edmHelper",
"Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface",
}
Definition at line 349 of file DCMathSegmentMaker.h.
◆ m_idHelperSvc
Initial value:{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}
Definition at line 344 of file DCMathSegmentMaker.h.
◆ m_maxAssociateClusterDistance
Gaudi::Property<double> Muon::DCMathSegmentMaker::m_maxAssociateClusterDistance {this, "MaxAssociateClusterDistance", 3000.} |
|
private |
◆ m_mdtCreator
Initial value:{
this,
"MdtCreator",
"Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
}
Definition at line 356 of file DCMathSegmentMaker.h.
◆ m_mdtCreatorT0
Initial value:{
this,
"MdtCreatorT0",
"Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
}
Definition at line 361 of file DCMathSegmentMaker.h.
◆ m_mdtKey
◆ m_outputFittedT0
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_outputFittedT0 {this, "OutputFittedT0", false} |
|
private |
◆ m_preciseErrorScale
Gaudi::Property<double> Muon::DCMathSegmentMaker::m_preciseErrorScale {this, "PreciseErrorScale", 2.} |
|
private |
◆ m_printer
Initial value:{
this,
"EDMPrinter",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}
Definition at line 376 of file DCMathSegmentMaker.h.
◆ m_recoverBadRpcCabling
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_recoverBadRpcCabling {this, "RecoverBadRpcCabling", false} |
|
private |
◆ m_redo2DFit
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_redo2DFit {this, "Redo2DFit", true} |
|
private |
◆ m_refitParameters
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_refitParameters {this, "RefitSegment", false} |
|
private |
◆ m_reject1DTgcSpacePoints
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_reject1DTgcSpacePoints {this,"Reject1DTgcSpacePoints", true } |
|
private |
◆ m_removeDeltas
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_removeDeltas {this, "RemoveDeltasFromSegmentQuality", true} |
|
private |
◆ m_segmentFinder
Initial value:{
this,
"MdtSegmentFinder",
"Muon::MdtMathSegmentFinder/MdtMathSegmentFinder",
}
Definition at line 381 of file DCMathSegmentMaker.h.
◆ m_segmentFitter
Initial value:{
this,
"SegmentFitter",
"Muon::MuonSegmentFittingTool/MuonSegmentFittingTool",
}
Definition at line 386 of file DCMathSegmentMaker.h.
◆ m_segmentSelectionTool
Initial value:{
this,
"SegmentSelector",
"Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool",
}
Definition at line 391 of file DCMathSegmentMaker.h.
◆ m_sinAngleCut
Gaudi::Property<double> Muon::DCMathSegmentMaker::m_sinAngleCut {this, "SinAngleCut", 0.2} |
|
private |
◆ m_strictRoadDirectionConsistencyCheck
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_strictRoadDirectionConsistencyCheck {this, "StrictRoadDirectionConsistencyCheck", true} |
|
private |
◆ m_updatePhiUsingPhiHits
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_updatePhiUsingPhiHits {this, "UpdatePhiUsingPhiHits", false} |
|
private |
◆ m_usePreciseError
Gaudi::Property<bool> Muon::DCMathSegmentMaker::m_usePreciseError {this, "UsePreciseError", false} |
|
private |
The documentation for this class was generated from the following files:
Gaudi::Property< bool > m_reject1DTgcSpacePoints
static std::pair< double, double > residualAndPullWithSegment(const TrkDriftCircleMath::Segment &segment, const Cluster2D &spacePoint, const Amg::Transform3D &gToStation)
double errorScaleFactor(const Identifier &id, double curvature, bool hasPhiMeasurements) const
calculate error scaling factor
Gaudi::Property< bool > m_addUnassociatedPhiHits
void localToGlobalDirection(const Trk::LocalDirection &locdir, Amg::Vector3D &globdir) const
This method transforms a local direction wrt the plane to a global direction.
Gaudi::Property< bool > m_createCompetingROTsEta
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
std::vector< Cluster2D > ClusterVec
std::pair< std::pair< int, int >, bool > associateClustersToSegment(const TrkDriftCircleMath::Segment &segment, const Identifier &chid, const Amg::Transform3D &gToStation, ClusterVecPair &spVecs, double phimin, double phimax, std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec) const
int getNLayers() const
Returns the number of tube layers inside the multilayer.
virtual Amg::Transform3D AmdbLRSToGlobalTransform() const
std::pair< ClusterVec, ClusterVec > ClusterVecPair
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
std::vector< DCOnTrack > DCOnTrackVec
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
std::string find(const std::string &s)
return a remapped string
virtual const Amg::Vector3D & center(const Identifier &) const override final
Return the center of the surface associated with this identifier In the case of silicon it returns th...
ToolHandle< IMuonSegmentSelectionTool > m_segmentSelectionTool
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
Scalar perp() const
perp method - perpenticular length
ClusterVecPair create1DClusters(const std::vector< const MuonClusterOnTrack * > &clusters) const
virtual bool fit(Segment &result, const Line &line, const DCOnTrackVec &dcs, double t0Seed=-99999.) const
const Amg::Vector3D & position() const
Access method for the position.
Eigen::Matrix< double, 2, 1 > Vector2D
void find(const std::vector< const Trk::RIO_OnTrack * > &rios, Trk::SegmentCollection *segColl=nullptr) const
find segments starting from a list of RIO_OnTrack objects, implementation of IMuonSegmentMaker interf...
std::vector< Cluster > CLVec
Gaudi::Property< bool > m_removeDeltas
const std::string & stName(StIndex index)
convert StIndex into a string
virtual Amg::Transform3D GlobalToAmdbLRSTransform() const
TrkDriftCircleMath::DCVec createDCVec(const std::vector< const MdtDriftCircleOnTrack * > &mdts, double errorScale, std::set< Identifier > &chamberSet, double &phimin, double &phimax, TrkDriftCircleMath::DCStatistics &dcStatistics, const Amg::Transform3D &gToStation, const Amg::Transform3D &amdbToGlobal) const
PublicToolHandle< MuonEDMPrinterTool > m_printer
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
ToolHandle< IMdtSegmentFinder > m_segmentFinder
std::map< Identifier, IdHitMap > ChIdHitMap
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
@ loc2
generic first and second local coordinate
double x() const
Returns the x coordinate of the vector.
@ OutOfTime
delta electron
bool updateSegmentPhi(const Amg::Vector3D &gpos, const Amg::Vector3D &gdir, Amg::Vector2D &segLocPos, Trk::LocalDirection &segLocDir, Trk::PlaneSurface &surf, const std::vector< const Trk::MeasurementBase * > &rots, double phimin, double phimax) const
This class represents a drift time measurement.
#define ATH_MSG_VERBOSE(x)
std::unique_ptr< MuonSegment > createSegment(const EventContext &ctx, TrkDriftCircleMath::Segment &segment, const Identifier &chid, const Amg::Vector3D &roadpos, const Amg::Vector3D &roaddir2, const std::vector< const MdtDriftCircleOnTrack * > &mdts, bool hasPhiMeasurements, segmentCreationInfo &sInfo, double beta=1.) const
const Amg::Vector3D & center() const
Returns the center position of the Surface.
static void updatePhiRanges(double phiminNew, double phimaxNew, double &phiminRef, double &phimaxRef)
update phi ranges
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
pointers to IdHelpers
ClusterVecPair createSpacePoints(const ChIdHitMap &chIdHitMap) const
bool checkBoundsInXZ(double xline, double zline, double dXdZ, const std::vector< HitInXZ > &hits) const
check whether all hits are in bounds in the XZ plane
Implementation of 2 dimensional vector class.
std::vector< DriftCircle > DCVec
Gaudi::Property< bool > m_curvedErrorScaling
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
double angleYZ() const
access method for angle of local YZ projection
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreator
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for StraightLineSurface: GlobalToLocal method without dynamic memory allocation This method...
TrkDriftCircleMath::Road - encodes the road given to the segment finder in station coordinates.
const Amg::Vector3D & globalDirection() const
Get the global direction of the road.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compClusterCreator
static DataVector< const Trk::MeasurementBase > createROTVec(std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
TrkDriftCircleMath::CLVec createClusterVec(const Identifier &chid, ClusterVec &spVec, const Amg::Transform3D &gToStation) const
Gaudi::Property< bool > m_usePreciseError
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
@ OWN_ELEMENTS
this data object owns its elements
bool errorScalingRegion(const Identifier &id) const
apply error scaling for low mometum tracks
const Amg::Vector3D & globalPosition() const
Get the global position of the road.
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
ToolHandle< IMuonSegmentFittingTool > m_segmentFitter
std::unique_ptr< MeasurementBase > uniqueClone() const
NVI Clone giving up unique pointer.
virtual unsigned int nlay() const =0
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Eigen::Affine3d Transform3D
@ RIGHT
the drift radius is positive (see Trk::AtaStraightLine)
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
double y() const
Returns the y coordinate of the vector.
Cluster2D createSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const
Amg::Vector3D localSpacePoint(const Identifier &stripId, const Amg::Vector3D &etaHitPos, const Amg::Vector3D &phiHitPos) const
unsigned int nMDTinStation() const
How many MDT chambers are in the station.
Gaudi::Property< bool > m_refitParameters
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
Gaudi::Property< bool > m_allMdtHoles
Gaudi::Property< bool > m_createCompetingROTsPhi
Gaudi::Property< bool > m_recoverBadRpcCabling
static Timeout & instance()
Get reference to Timeout singleton.
represents the three-dimensional global direction with respect to a planar surface frame.
def dot(G, fn, nodesToHighlight=[])
@ DCMathSegmentMakerCurved
TubeEnds localTubeEnds(const MdtDriftCircleOnTrack &mdt, const Amg::Transform3D &gToSegment, const Amg::Transform3D &segmentToG) const
calculate positions of tube ends
represents the track state (measurement, material, fit parameters and quality) at a surface.
std::vector< Identifier > calculateHoles(const EventContext &ctx, Identifier chid, const Amg::Vector3D &gpos, const Amg::Vector3D &gdir, bool hasMeasuredCoordinate, std::set< Identifier > &deltaVec, std::set< Identifier > &outoftimeVec, const std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec) const
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtKey
class representing a cluster meaurement
ClusterVecPair create2DClusters(const std::vector< const MuonClusterOnTrack * > &clusters) const
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
double charge(const T &p)
const MdtDriftCircleOnTrack * findFirstRotInChamberWithMostHits(const std::vector< const MdtDriftCircleOnTrack * > &mdts) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
class to calculate residual of a hit with a segment and calculate the local track errors
Eigen::Matrix< double, 3, 1 > Vector3D
PhiIndex
enum to classify the different phi layers in the muon spectrometer
virtual LocVec2D tubePosition(unsigned int ml, unsigned int lay, unsigned int tube) const =0
ToolHandle< IDCSLFitProvider > m_dcslFitProvider
Gaudi::Property< bool > m_doSpacePoints
DriftCircleSide
Enumerates the 'side' of the wire on which the tracks passed (i.e.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Cluster2D createTgcSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const
const Amg::Vector3D & momentum() const
Access method for the momentum.
Gaudi::Property< bool > m_doTimeOutChecks
Gaudi::Property< double > m_maxAssociateClusterDistance
Gaudi::Property< double > m_sinAngleCut
Gaudi::Property< bool > m_redo2DFit
Gaudi::Property< bool > m_doGeometry
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.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
const HitSelection selectHitsOnTrack(const DCOnTrackVec &dcs) const
const MdtPrepData * findMdt(const EventContext &ctx, const Identifier &id) const
Gaudi::Property< bool > m_assumePointingPhi
Identifier identify() const
return the identifier -extends MeasurementBase
void associateMDTsToSegment(const Amg::Vector3D &gdir, TrkDriftCircleMath::Segment &segment, const TrkDriftCircleMath::ChamberGeometry *multiGeo, const Amg::Transform3D &gToStation, const Amg::Transform3D &amdbToGlobal, std::set< Identifier > &deltaVec, std::set< Identifier > &outoftimeVec, std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec, double beta=1.) const
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Gaudi::Property< bool > m_updatePhiUsingPhiHits
class representing a drift circle meaurement on segment
std::vector< Segment > SegVec
ToolHandle< IMuonClusterOnTrackCreator > m_clusterCreator
static double distanceToSegment(const TrkDriftCircleMath::Segment &segment, const Amg::Vector3D &hitPos, const Amg::Transform3D &gToStation)
Cluster2D createRpcSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const std::vector< const MuonClusterOnTrack * > &phiHits) const
Amg::Vector3D updateDirection(double linephi, const Trk::PlaneSurface &surf, const Amg::Vector3D &roaddir, bool isCurvedSegment) const
update the global direction, keeping the phi of the input road direction but using the local angle YZ
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Gaudi::Property< bool > m_outputFittedT0
double angleXZ() const
access method for angle of local XZ projection
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreatorT0
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Scalar mag() const
mag method
TrkDriftCircleMath::MdtChamberGeometry createChamberGeometry(const Identifier &chid, const Amg::Transform3D &gToStation) const
bool checkPhiConsistency(double phi, double phimin, double phimax) const
check whether phi is consistent with segment phi
Gaudi::Property< double > m_preciseErrorScale
Base class for Muon cluster RIO_OnTracks.
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
@ InTime
drift time too small to be compatible with drift spectrum
double deltaEta() const
Get the width of the road in the eta direction.
This class offers no functionality, but to define a standard device for the maker to transfer to the ...