5#ifndef DCMATHSEGMENTMAKER_H
6#define DCMATHSEGMENTMAKER_H
83 bool operator()(
const std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>>& hit1,
84 const std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>>& hit2) {
85 return hit1.first < hit2.first;
99 using EtaPhiHitsPair = std::pair<std::vector<const MuonClusterOnTrack*>, std::vector<const MuonClusterOnTrack*> >;
101 using IdHitMap = std::map<Identifier, EtaPhiHitsPair>;
106 HitInXZ(
Identifier i,
bool isM,
bool measP,
double lx,
double lz,
double lxmin,
double lxmax,
double phmin,
double phmax) :
125 if (pcl)
phiHits.push_back(pcl);
129 const std::vector<const MuonClusterOnTrack*>& phs) :
141 std::vector<const MuonClusterOnTrack*>
phiHits;
144 return etaHit->associatedSurface();
146 return phiHit->associatedSurface();
150 return etaHit->identify();
152 return phiHit->identify();
172 clusters(spVecs.first, spVecs.second),
187 using base_class::base_class;
212 void find(
const std::vector<const Trk::RIO_OnTrack*>& rios1,
const std::vector<const Trk::RIO_OnTrack*>& rios2)
const;
227 void find(
const std::vector<const MdtDriftCircleOnTrack*>& mdts,
const std::vector<const MuonClusterOnTrack*>& clusters,
241 const std::vector<const MuonClusterOnTrack*>& clusters,
bool hasPhiMeasurements =
false,
242 Trk::SegmentCollection* segColl =
nullptr,
double momentum = 1e9,
double sinAngleCut = 0,
double beta = 1. )
const;
258 void find(
const Trk::TrackRoad& road,
const std::vector<std::vector<const MdtDriftCircleOnTrack*> >& mdts,
260 bool hasPhiMeasurements =
false,
double momentum = 1e9)
const;
270 std::set<Identifier>& deltaVec, std::set<Identifier>& outoftimeVec,
271 const std::vector<std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec)
const;
274 std::set<Identifier>& chamberSet,
double& phimin,
double& phimax,
284 const std::vector<const MuonClusterOnTrack*>& phiHits)
const;
291 std::set<Identifier>& deltaVec, std::set<Identifier>& outoftimeVec,
292 std::vector<std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec,
double beta = 1. )
const;
295 double phimin,
double phimax, std::vector<std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec)
const;
298 std::vector<std::pair<
double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec) ;
311 double phimin,
double phimax)
const;
314 bool checkBoundsInXZ(
double xline,
double zline,
double dXdZ,
const std::vector<HitInXZ>& hits)
const;
321 static void updatePhiRanges(
double phiminNew,
double phimaxNew,
double& phiminRef,
double& phimaxRef) ;
328 bool isCurvedSegment)
const;
331 const Amg::Vector3D& roaddir2,
const std::vector<const MdtDriftCircleOnTrack*>& mdts,
339 "DetectorManagerKey",
340 "MuonDetectorManager",
341 "Key of input MuonDetectorManager condition data",
347 "Muon::MuonIdHelperSvc/MuonIdHelperSvc",
352 "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
353 "Handle to the service providing the IMuonEDMHelperSvc interface",
359 "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
364 "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
368 "MuonClusterCreator",
369 "Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator",
373 "MuonCompetingClustersCreator",
374 "Muon::TriggerChamberClusterOnTrackCreator/TriggerChamberClusterOnTrackCreator",
379 "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
384 "Muon::MdtMathSegmentFinder/MdtMathSegmentFinder",
389 "Muon::MuonSegmentFittingTool/MuonSegmentFittingTool",
394 "Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool",
415 Gaudi::Property<bool>
m_removeDeltas{
this,
"RemoveDeltasFromSegmentQuality",
true};
Scalar phi() const
phi method
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Implementation of a IMuonSegmentMaker.
Gaudi::Property< bool > m_doSpacePoints
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::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
bool errorScalingRegion(const Identifier &id) const
apply error scaling for low mometum tracks
ClusterVecPair create1DClusters(const std::vector< const MuonClusterOnTrack * > &clusters) const
std::map< Identifier, EtaPhiHitsPair > IdHitMap
Gaudi::Property< bool > m_addUnassociatedPhiHits
Gaudi::Property< bool > m_updatePhiUsingPhiHits
Gaudi::Property< bool > m_recoverBadRpcCabling
Gaudi::Property< bool > m_strictRoadDirectionConsistencyCheck
ToolHandle< IDCSLFitProvider > m_dcslFitProvider
Gaudi::Property< bool > m_doGeometry
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
virtual ~DCMathSegmentMaker()=default
Gaudi::Property< double > m_sinAngleCut
Gaudi::Property< bool > m_removeDeltas
ToolHandle< IMuonClusterOnTrackCreator > m_clusterCreator
Gaudi::Property< bool > m_createCompetingROTsEta
ToolHandle< IMuonSegmentSelectionTool > m_segmentSelectionTool
std::map< Identifier, IdHitMap > ChIdHitMap
TrkDriftCircleMath::MdtChamberGeometry createChamberGeometry(const Identifier &chid, const Amg::Transform3D &gToStation) const
Gaudi::Property< bool > m_doTimeOutChecks
static double distanceToSegment(const TrkDriftCircleMath::Segment &segment, const Amg::Vector3D &hitPos, const Amg::Transform3D &gToStation)
Gaudi::Property< bool > m_outputFittedT0
const MdtDriftCircleOnTrack * findFirstRotInChamberWithMostHits(const std::vector< const MdtDriftCircleOnTrack * > &mdts) const
Gaudi::Property< double > m_preciseErrorScale
Gaudi::Property< bool > m_reject1DTgcSpacePoints
ToolHandle< IMuonSegmentFittingTool > m_segmentFitter
PublicToolHandle< MuonEDMPrinterTool > m_printer
std::pair< std::vector< const MuonClusterOnTrack * >, std::vector< const MuonClusterOnTrack * > > EtaPhiHitsPair
virtual StatusCode initialize()
TrkDriftCircleMath::CLVec createClusterVec(const Identifier &chid, ClusterVec &spVec, const Amg::Transform3D &gToStation) const
Cluster2D createTgcSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const
Gaudi::Property< bool > m_curvedErrorScaling
Gaudi::Property< bool > m_redo2DFit
Gaudi::Property< bool > m_allMdtHoles
Gaudi::Property< bool > m_refitParameters
std::vector< Cluster2D > ClusterVec
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
TubeEnds localTubeEnds(const MdtDriftCircleOnTrack &mdt, const Amg::Transform3D &gToSegment, const Amg::Transform3D &segmentToG) const
calculate positions of tube ends
static void updatePhiRanges(double phiminNew, double phimaxNew, double &phiminRef, double &phimaxRef)
update phi ranges
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtKey
ClusterVecPair create2DClusters(const std::vector< const MuonClusterOnTrack * > &clusters) const
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
pointers to IdHelpers
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
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compClusterCreator
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
double errorScaleFactor(const Identifier &id, double curvature, bool hasPhiMeasurements) const
calculate error scaling factor
Cluster2D createRpcSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const std::vector< const MuonClusterOnTrack * > &phiHits) const
Gaudi::Property< bool > m_createCompetingROTsPhi
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreator
Cluster2D createSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const
Gaudi::Property< double > m_maxAssociateClusterDistance
std::pair< ClusterVec, ClusterVec > ClusterVecPair
ClusterVecPair createSpacePoints(const ChIdHitMap &chIdHitMap) const
const MdtPrepData * findMdt(const EventContext &ctx, const Identifier &id) const
Gaudi::Property< bool > m_usePreciseError
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
ToolHandle< IMdtSegmentFinder > m_segmentFinder
static DataVector< const Trk::MeasurementBase > createROTVec(std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase > > > &rioDistVec)
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreatorT0
Gaudi::Property< bool > m_assumePointingPhi
static std::pair< double, double > residualAndPullWithSegment(const TrkDriftCircleMath::Segment &segment, const Cluster2D &spacePoint, const Amg::Transform3D &gToStation)
bool checkPhiConsistency(double phi, double phimin, double phimax) const
check whether phi is consistent with segment phi
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
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Class to represent measurements from the Monitored Drift Tubes.
Base class for Muon cluster RIO_OnTracks.
Property holding a SG store/key/clid from which a ReadHandle is made.
This class offers no functionality, but to define a standard device for the maker to transfer to the ...
represents the three-dimensional global direction with respect to a planar surface frame.
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Identifier identify() const
return the identifier -extends MeasurementBase
Abstract Base Class for tracking surfaces.
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
Encapsulates the information required by the find() method of the muon segment makers.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the Athena extensions are properly loaded.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Function object to check whether two Segments are sub/super sets or different.
std::vector< Cluster > CLVec
std::vector< DriftCircle > DCVec
Ensure that the ATLAS eigen extensions are properly loaded.
DataVector< Trk::Segment > SegmentCollection
Identifier identify() const
const Trk::Surface & surface() const
const MuonClusterOnTrack * etaHit
Cluster2D(const Identifier elId, const Identifier ggId, const Amg::Vector2D &lp, double err, const MuonClusterOnTrack *ecl, const MuonClusterOnTrack *pcl)
constructor taking a single phi hit
const MuonClusterOnTrack * phiHit
std::vector< const MuonClusterOnTrack * > phiHits
Cluster2D(const Identifier elId, const Identifier ggId, const Amg::Vector2D &lp, double err, const MuonClusterOnTrack *ecl, const std::vector< const MuonClusterOnTrack * > &phs)
constructor taking a vector of phi hits
HitInXZ(Identifier i, bool isM, bool measP, double lx, double lz, double lxmin, double lxmax, double phmin, double phmax)
segmentCreationInfo(ClusterVecPair &spVecs, const TrkDriftCircleMath::ChamberGeometry *multiGeo, Amg::Transform3D gToStation, Amg::Transform3D amdbToGlobal, double pmin, double pmax)
Amg::Transform3D globalTrans
const TrkDriftCircleMath::ChamberGeometry * geom
Amg::Transform3D amdbTrans
Function object to sort pairs containing a double and a pointer to a MuonClusterOnTrack.
bool operator()(const std::pair< double, std::unique_ptr< const Trk::MeasurementBase > > &hit1, const std::pair< double, std::unique_ptr< const Trk::MeasurementBase > > &hit2)
Function object to sort MuonClusterOnTrack pointers by Identier.
bool operator()(const MuonClusterOnTrack *cl1, const MuonClusterOnTrack *cl2)