ATLAS Offline Software
DCMathSegmentMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DCMATHSEGMENTMAKER_H
6 #define DCMATHSEGMENTMAKER_H
7 
8 #include <list>
9 #include <set>
10 
33 #include "TrkSurfaces/Surface.h"
35 namespace Trk {
36  class RIO_OnTrack;
37  class PlaneSurface;
38 } // namespace Trk
39 
40 namespace TrkDriftCircleMath {
41  class MdtMultiChamberGeometry;
42  class Segment;
43 } // namespace TrkDriftCircleMath
44 
45 namespace MuonGM {
46  class MuonDetectorManager;
47 }
48 
49 namespace Muon {
50  class MdtPrepData;
51 }
52 
53 namespace Muon {
54 
55  class MdtDriftCircleOnTrack;
56 
68  bool operator()(const MuonClusterOnTrack* cl1, const MuonClusterOnTrack* cl2) { return cl1->identify() < cl2->identify(); }
69  };
70 
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;
86  }
87  };
88 
96  class DCMathSegmentMaker : public extends<AthAlgTool, IMuonSegmentMaker> {
97  public:
98  // pair of eta-phi hits in the same gasgap
99  using EtaPhiHitsPair = std::pair<std::vector<const MuonClusterOnTrack*>, std::vector<const MuonClusterOnTrack*> >;
100  // map to sort hit per gasgap
101  using IdHitMap = std::map<Identifier, EtaPhiHitsPair>;
102  using ChIdHitMap = std::map<Identifier, IdHitMap>;
103 
104 
105  struct HitInXZ {
106  HitInXZ(Identifier i, bool isM, bool measP, double lx, double lz, double lxmin, double lxmax, double phmin, double phmax) :
107  id(i), isMdt(isM), measPhi(measP), x(lx), z(lz), xmin(lxmin), xmax(lxmax), phimin(phmin), phimax(phmax) {}
109  bool isMdt{false};
110  bool measPhi{false};
111  double x{0.};
112  double z{0.};
113  double xmin{0.};
114  double xmax{0.};
115  double phimin{0.};
116  double phimax{0.};
117  };
118 
119  struct Cluster2D {
121  Cluster2D(const Identifier elId, const Identifier ggId, const Amg::Vector2D& lp, double err, const MuonClusterOnTrack* ecl,
122  const MuonClusterOnTrack* pcl) :
123  detElId(elId), gasGapId(ggId), locPos(lp), error(err), etaHit(ecl), phiHit(pcl) {
124  if (ecl || pcl) { surface().localToGlobal(locPos, Amg::Vector3D::UnitZ(), globalPos); }
125  if (pcl) phiHits.push_back(pcl);
126  }
128  Cluster2D(const Identifier elId, const Identifier ggId, const Amg::Vector2D& lp, double err, const MuonClusterOnTrack* ecl,
129  const std::vector<const MuonClusterOnTrack*>& phs) :
130  detElId(elId), gasGapId(ggId), locPos(lp), error(err), etaHit(ecl), phiHits(phs) {
131  // if phiHits to empty point phiHit to first hit in PhiHits
132  phiHit = phiHits.empty() ? 0 : phiHits.front();
133  if (ecl || phiHit) { surface().localToGlobal(locPos, Amg::Vector3D::UnitZ(), globalPos); }
134  }
138  double error; // assume same error for eta and phi
139  const MuonClusterOnTrack* etaHit{nullptr};
140  const MuonClusterOnTrack* phiHit{nullptr};
141  std::vector<const MuonClusterOnTrack*> phiHits;
142  const Trk::Surface& surface() const {
143  if (etaHit)
144  return etaHit->associatedSurface();
145  else
146  return phiHit->associatedSurface();
147  }
149  if (etaHit)
150  return etaHit->identify();
151  else
152  return phiHit->identify();
153  }
155  bool is2D() const { return etaHit && phiHit; }
156  bool corrupt() const { return (!etaHit && !phiHit) || error < 0.01; }
157  };
158  using ClusterVec = std::vector<Cluster2D>;
159  using ClusterVecPair = std::pair<ClusterVec, ClusterVec>;
160 
161  struct TubeEnds {
162  TubeEnds() = default;
163  double lxmin{0};
164  double lxmax{0};
165  double phimin{0};
166  double phimax{0};
167  };
168 
169  struct segmentCreationInfo { // miscellaneous objects needed for segment creation
171  Amg::Transform3D amdbToGlobal, double pmin, double pmax) :
172  clusters(spVecs.first, spVecs.second),
173  geom(multiGeo),
174  globalTrans(gToStation),
175  amdbTrans(amdbToGlobal),
176  phimin(pmin),
177  phimax(pmax) {}
180  Amg::Transform3D globalTrans{Amg::Transform3D::Identity()};
181  Amg::Transform3D amdbTrans{Amg::Transform3D::Identity()};
182  double phimin{0.};
183  double phimax{0.};
184  };
185 
186  public:
187  using base_class::base_class;
188  virtual ~DCMathSegmentMaker() = default;
189 
190  virtual StatusCode initialize();
191 
202  void find(const std::vector<const Trk::RIO_OnTrack*>& rios, Trk::SegmentCollection* segColl = nullptr) const;
203 
212  void find(const std::vector<const Trk::RIO_OnTrack*>& rios1, const std::vector<const Trk::RIO_OnTrack*>& rios2) const;
213 
227  void find(const std::vector<const MdtDriftCircleOnTrack*>& mdts, const std::vector<const MuonClusterOnTrack*>& clusters,
228  Trk::SegmentCollection* segColl = nullptr) const;
229 
240  void find(const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, const std::vector<const MdtDriftCircleOnTrack*>& mdts,
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;
243 
258  void find(const Trk::TrackRoad& road, const std::vector<std::vector<const MdtDriftCircleOnTrack*> >& mdts,
259  const std::vector<std::vector<const MuonClusterOnTrack*> >& clusters, Trk::SegmentCollection* segColl,
260  bool hasPhiMeasurements = false, double momentum = 1e9) const;
261 
262  private:
264  bool errorScalingRegion(const Identifier& id) const;
265 
267  double errorScaleFactor(const Identifier& id, double curvature, bool hasPhiMeasurements) const;
268 
269  std::vector<Identifier> calculateHoles(const EventContext& ctx, Identifier chid, const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, bool hasMeasuredCoordinate,
270  std::set<Identifier>& deltaVec, std::set<Identifier>& outoftimeVec,
271  const std::vector<std::pair<double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec) const;
272 
273  TrkDriftCircleMath::DCVec createDCVec(const std::vector<const MdtDriftCircleOnTrack*>& mdts, double errorScale,
274  std::set<Identifier>& chamberSet, double& phimin, double& phimax,
275  TrkDriftCircleMath::DCStatistics& dcStatistics, const Amg::Transform3D& gToStation,
276  const Amg::Transform3D& amdbToGlobal) const;
277  ClusterVecPair create1DClusters(const std::vector<const MuonClusterOnTrack*>& clusters) const;
278  ClusterVecPair create2DClusters(const std::vector<const MuonClusterOnTrack*>& clusters) const;
279 
280  ClusterVecPair createSpacePoints(const ChIdHitMap& chIdHitMap) const;
281  ClusterVecPair createSpacePoints(const IdHitMap& gasGapHitMap) const;
282  Cluster2D createSpacePoint(const Identifier& gasGapId, const MuonClusterOnTrack* etaHit, const MuonClusterOnTrack* phiHit) const;
283  Cluster2D createRpcSpacePoint(const Identifier& gasGapId, const MuonClusterOnTrack* etaHit,
284  const std::vector<const MuonClusterOnTrack*>& phiHits) const;
285  Cluster2D createTgcSpacePoint(const Identifier& gasGapId, const MuonClusterOnTrack* etaHit, const MuonClusterOnTrack* phiHit) const;
286  TrkDriftCircleMath::CLVec createClusterVec(const Identifier& chid, ClusterVec& spVec, const Amg::Transform3D& gToStation) const;
287 
290  const TrkDriftCircleMath::ChamberGeometry* multiGeo, const Amg::Transform3D& gToStation, const Amg::Transform3D& amdbToGlobal,
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;
293  std::pair<std::pair<int, int>, bool> associateClustersToSegment(
294  const TrkDriftCircleMath::Segment& segment, const Identifier& chid, const Amg::Transform3D& gToStation, ClusterVecPair& spVecs,
295  double phimin, double phimax, std::vector<std::pair<double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec) const;
296 
298  std::vector<std::pair<double, std::unique_ptr<const Trk::MeasurementBase>> >& rioDistVec) ;
299 
300  static double distanceToSegment(const TrkDriftCircleMath::Segment& segment, const Amg::Vector3D& hitPos,
301  const Amg::Transform3D& gToStation) ;
302  static std::pair<double, double> residualAndPullWithSegment(const TrkDriftCircleMath::Segment& segment, const Cluster2D& spacePoint,
303  const Amg::Transform3D& gToStation) ;
304 
306 
307  const MdtDriftCircleOnTrack* findFirstRotInChamberWithMostHits(const std::vector<const MdtDriftCircleOnTrack*>& mdts) const;
308 
309  bool updateSegmentPhi(const Amg::Vector3D& gpos, const Amg::Vector3D& gdir, Amg::Vector2D& segLocPos,
310  Trk::LocalDirection& segLocDir, Trk::PlaneSurface& surf, const std::vector<const Trk::MeasurementBase*>& rots,
311  double phimin, double phimax) const;
312 
314  bool checkBoundsInXZ(double xline, double zline, double dXdZ, const std::vector<HitInXZ>& hits) const;
315 
317  TubeEnds localTubeEnds(const MdtDriftCircleOnTrack& mdt, const Amg::Transform3D& gToSegment,
318  const Amg::Transform3D& segmentToG) const;
319 
321  static void updatePhiRanges(double phiminNew, double phimaxNew, double& phiminRef, double& phimaxRef) ;
322 
324  bool checkPhiConsistency(double phi, double phimin, double phimax) const;
325 
327  Amg::Vector3D updateDirection(double linephi, const Trk::PlaneSurface& surf, const Amg::Vector3D& roaddir,
328  bool isCurvedSegment) const;
329 
330  std::unique_ptr<MuonSegment> createSegment(const EventContext& ctx, TrkDriftCircleMath::Segment& segment, const Identifier& chid, const Amg::Vector3D& roadpos,
331  const Amg::Vector3D& roaddir2, const std::vector<const MdtDriftCircleOnTrack*>& mdts,
332  bool hasPhiMeasurements, segmentCreationInfo& sInfo, double beta = 1. ) const;
333 
334  const MdtPrepData* findMdt(const EventContext& ctx, const Identifier& id) const;
335 
338  this,
339  "DetectorManagerKey",
340  "MuonDetectorManager",
341  "Key of input MuonDetectorManager condition data",
342  };
343 
345  this,
346  "MuonIdHelperSvc",
347  "Muon::MuonIdHelperSvc/MuonIdHelperSvc",
348  };
350  this,
351  "edmHelper",
352  "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
353  "Handle to the service providing the IMuonEDMHelperSvc interface",
354  }; //<! edm helper tool
355 
356  ToolHandle<IMdtDriftCircleOnTrackCreator> m_mdtCreator{
357  this,
358  "MdtCreator",
359  "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
360  }; //<! mdt rio ontrack creator
361  ToolHandle<IMdtDriftCircleOnTrackCreator> m_mdtCreatorT0{
362  this,
363  "MdtCreatorT0",
364  "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
365  }; //<! mdt rio ontrack creator
366  ToolHandle<IMuonClusterOnTrackCreator> m_clusterCreator{
367  this,
368  "MuonClusterCreator",
369  "Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator",
370  }; //<! cluster rio ontrack creator
371  ToolHandle<IMuonCompetingClustersOnTrackCreator> m_compClusterCreator{
372  this,
373  "MuonCompetingClustersCreator",
374  "Muon::TriggerChamberClusterOnTrackCreator/TriggerChamberClusterOnTrackCreator",
375  }; //<! competing clusters rio ontrack creator
376  PublicToolHandle<MuonEDMPrinterTool> m_printer{
377  this,
378  "EDMPrinter",
379  "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
380  }; //<! printer helper tool
381  ToolHandle<IMdtSegmentFinder> m_segmentFinder{
382  this,
383  "MdtSegmentFinder",
384  "Muon::MdtMathSegmentFinder/MdtMathSegmentFinder",
385  }; //<! segment finder tool
386  ToolHandle<IMuonSegmentFittingTool> m_segmentFitter{
387  this,
388  "SegmentFitter",
389  "Muon::MuonSegmentFittingTool/MuonSegmentFittingTool",
390  }; //<! segment fitting tool
391  ToolHandle<IMuonSegmentSelectionTool> m_segmentSelectionTool{
392  this,
393  "SegmentSelector",
394  "Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool",
395  }; //<! segment selection tool
396  ToolHandle<IDCSLFitProvider> m_dcslFitProvider{
397  this,
398  "DCFitProvider",
399  "",
400  };
401 
402  Gaudi::Property<double> m_sinAngleCut{this, "SinAngleCut", 0.2}; //<! cut on the angle between the segment and the prediction
403  Gaudi::Property<bool> m_doGeometry{this, "DoGeometry", true}; //<! use chamber geometry in segment finding
404  Gaudi::Property<bool> m_curvedErrorScaling{this, "CurvedErrorScaling", true}; //<! rescale errors for low momenta
405  Gaudi::Property<bool> m_doSpacePoints{this, "UseTriggerSpacePoints", true}; //<! use cluster space points for association
406  Gaudi::Property<bool> m_createCompetingROTsEta{this, "CreateCompetingROTsEta", true}; //<! create competing ROTs for the clusters
407  Gaudi::Property<bool> m_createCompetingROTsPhi{this, "CreateCompetingROTsPhi", true}; //<! create competing ROTs for the clusters
408  Gaudi::Property<bool> m_refitParameters{this, "RefitSegment", false}; //<! refit segment if there are sufficient phi hits and update the segment parameters
409  Gaudi::Property<bool> m_addUnassociatedPhiHits{this, "AddUnassociatedPhiHits", false}; //<! if there are phi hits without associated eta hit add them to segment
410  Gaudi::Property<bool> m_strictRoadDirectionConsistencyCheck{this, "StrictRoadDirectionConsistencyCheck", true}; //<! check if direction of road is consistent with IP (default: true),
411  // should be off for cosmics
412  Gaudi::Property<double> m_maxAssociateClusterDistance{this, "MaxAssociateClusterDistance", 3000.}; //<! maximum distance for clusters to be associated to segment (default: 3000
413  //(mm))
414  Gaudi::Property<bool> m_allMdtHoles{this, "AllMdtHoles", false}; //<! add all mdt holes without bound checks / flag to decide whether to apply bound checks during the hole search
415  Gaudi::Property<bool> m_removeDeltas{this, "RemoveDeltasFromSegmentQuality", true}; //<! do not add delta electrons to MuonSegmentQuality::holes
416  Gaudi::Property<bool> m_reject1DTgcSpacePoints{this,"Reject1DTgcSpacePoints", true }; //<! remove 1D tgc space points / reject TGC eta hits that are not associated with a phi hit in the same gas gap
417  Gaudi::Property<bool> m_usePreciseError{this, "UsePreciseError", false};
418  Gaudi::Property<bool> m_outputFittedT0{this, "OutputFittedT0", false};
419  Gaudi::Property<double> m_preciseErrorScale{this, "PreciseErrorScale", 2.};
420  Gaudi::Property<bool> m_doTimeOutChecks{this, "UseTimeOutGard", false};
421 
422  Gaudi::Property<bool> m_recoverBadRpcCabling{this, "RecoverBadRpcCabling", false};
423  Gaudi::Property<bool> m_updatePhiUsingPhiHits{this, "UpdatePhiUsingPhiHits", false};
424  Gaudi::Property<bool> m_assumePointingPhi{this, "AssumePointingPhi", false };
425  Gaudi::Property<bool> m_redo2DFit{this, "Redo2DFit", true};
426 
427 
428  SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_mdtKey{this, "MdtPrepDataContainer", "MDT_DriftCircles"};
429 
430  SG::ReadCondHandleKey<Muon::MuonIntersectGeoData> m_chamberGeoKey{this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"};
431 
432 
433  };
434 
435 } // namespace Muon
436 #endif
Trk::TrackRoad
Encapsulates the information required by the find() method of the muon segment makers.
Definition: TrackRoad.h:21
Muon::DCMathSegmentMaker::m_reject1DTgcSpacePoints
Gaudi::Property< bool > m_reject1DTgcSpacePoints
Definition: DCMathSegmentMaker.h:416
Muon::DCMathSegmentMaker::Cluster2D::surface
const Trk::Surface & surface() const
Definition: DCMathSegmentMaker.h:142
Muon::DCMathSegmentMaker::residualAndPullWithSegment
static std::pair< double, double > residualAndPullWithSegment(const TrkDriftCircleMath::Segment &segment, const Cluster2D &spacePoint, const Amg::Transform3D &gToStation)
Definition: DCMathSegmentMaker.cxx:1667
Muon::DCMathSegmentMaker::errorScaleFactor
double errorScaleFactor(const Identifier &id, double curvature, bool hasPhiMeasurements) const
calculate error scaling factor
Definition: DCMathSegmentMaker.cxx:643
Muon::DCMathSegmentMaker::m_addUnassociatedPhiHits
Gaudi::Property< bool > m_addUnassociatedPhiHits
Definition: DCMathSegmentMaker.h:409
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
Muon::DCMathSegmentMaker::m_createCompetingROTsEta
Gaudi::Property< bool > m_createCompetingROTsEta
Definition: DCMathSegmentMaker.h:406
Muon::DCMathSegmentMaker::HitInXZ::z
double z
Definition: DCMathSegmentMaker.h:112
Muon::DCMathSegmentMaker::ClusterVec
std::vector< Cluster2D > ClusterVec
Definition: DCMathSegmentMaker.h:158
Muon::DCMathSegmentMaker::associateClustersToSegment
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
Definition: DCMathSegmentMaker.cxx:1284
Muon::DCMathSegmentMaker::ClusterVecPair
std::pair< ClusterVec, ClusterVec > ClusterVecPair
Definition: DCMathSegmentMaker.h:159
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
Muon::DCMathSegmentMaker::Cluster2D::phiHit
const MuonClusterOnTrack * phiHit
Definition: DCMathSegmentMaker.h:140
Muon::DCMathSegmentMaker::HitInXZ::x
double x
Definition: DCMathSegmentMaker.h:111
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
IMdtSegmentFinder.h
Muon::DCMathSegmentMaker::segmentCreationInfo::phimax
double phimax
Definition: DCMathSegmentMaker.h:183
Surface.h
Muon::DCMathSegmentMaker::Cluster2D::Cluster2D
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
Definition: DCMathSegmentMaker.h:121
MuonEDMPrinterTool.h
Muon::DCMathSegmentMaker::Cluster2D::gasGapId
Identifier gasGapId
Definition: DCMathSegmentMaker.h:136
Muon::DCMathSegmentMaker::m_segmentSelectionTool
ToolHandle< IMuonSegmentSelectionTool > m_segmentSelectionTool
Definition: DCMathSegmentMaker.h:391
Trk::TrackState::Segment
@ Segment
Definition: TrackStateDefs.h:37
Muon::DCMathSegmentMaker::create1DClusters
ClusterVecPair create1DClusters(const std::vector< const MuonClusterOnTrack * > &clusters) const
Definition: DCMathSegmentMaker.cxx:694
Muon::DCMathSegmentMaker::Cluster2D::locPos
Amg::Vector2D locPos
Definition: DCMathSegmentMaker.h:137
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
TrkDriftCircleMath::ChamberGeometry
Definition: ChamberGeometry.h:17
Muon::DCMathSegmentMaker::find
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...
Definition: DCMathSegmentMaker.cxx:588
Muon::SortByDistanceToSegment
Function object to sort pairs containing a double and a pointer to a MuonClusterOnTrack.
Definition: DCMathSegmentMaker.h:82
TrkDriftCircleMath::CLVec
std::vector< Cluster > CLVec
Definition: Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/Cluster.h:70
Muon::DCMathSegmentMaker::m_removeDeltas
Gaudi::Property< bool > m_removeDeltas
Definition: DCMathSegmentMaker.h:415
Muon::DCMathSegmentMaker::createDCVec
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
Definition: DCMathSegmentMaker.cxx:1020
Muon::DCMathSegmentMaker::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: DCMathSegmentMaker.h:376
python.SystemOfUnits.second
float second
Definition: SystemOfUnits.py:135
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition: IMdtSegmentFinder.h:13
Muon::DCMathSegmentMaker::m_segmentFinder
ToolHandle< IMdtSegmentFinder > m_segmentFinder
Definition: DCMathSegmentMaker.h:381
Muon::DCMathSegmentMaker::Cluster2D::error
double error
Definition: DCMathSegmentMaker.h:138
Muon::DCMathSegmentMaker::ChIdHitMap
std::map< Identifier, IdHitMap > ChIdHitMap
Definition: DCMathSegmentMaker.h:102
IMuonCompetingClustersOnTrackCreator.h
DriftCircle.h
Muon::DCMathSegmentMaker::Cluster2D::identify
Identifier identify() const
Definition: DCMathSegmentMaker.h:148
DCSLFitter.h
Muon::DCMathSegmentMaker::updateSegmentPhi
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
Definition: DCMathSegmentMaker.cxx:1848
Muon::DCMathSegmentMaker::Cluster2D::phiHits
std::vector< const MuonClusterOnTrack * > phiHits
Definition: DCMathSegmentMaker.h:141
Muon::DCMathSegmentMaker::createSegment
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
Definition: DCMathSegmentMaker.cxx:227
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Muon::DCMathSegmentMaker::TubeEnds::lxmax
double lxmax
Definition: DCMathSegmentMaker.h:164
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::DCMathSegmentMaker::updatePhiRanges
static void updatePhiRanges(double phiminNew, double phimaxNew, double &phiminRef, double &phimaxRef)
update phi ranges
Definition: DCMathSegmentMaker.cxx:2078
Muon::DCMathSegmentMaker::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
pointers to IdHelpers
Definition: DCMathSegmentMaker.h:337
Muon::DCMathSegmentMaker::createSpacePoints
ClusterVecPair createSpacePoints(const ChIdHitMap &chIdHitMap) const
Definition: DCMathSegmentMaker.cxx:741
Muon::DCMathSegmentMaker::checkBoundsInXZ
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
Definition: DCMathSegmentMaker.cxx:1824
TrkDriftCircleMath::Segment
Definition: Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/Segment.h:18
TrkDriftCircleMath::DCVec
std::vector< DriftCircle > DCVec
Definition: DriftCircle.h:117
Muon::DCMathSegmentMaker::m_curvedErrorScaling
Gaudi::Property< bool > m_curvedErrorScaling
Definition: DCMathSegmentMaker.h:404
Muon::DCMathSegmentMaker::HitInXZ::xmax
double xmax
Definition: DCMathSegmentMaker.h:114
Muon::DCMathSegmentMaker::m_mdtCreator
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreator
Definition: DCMathSegmentMaker.h:356
Muon::DCMathSegmentMaker::segmentCreationInfo::globalTrans
Amg::Transform3D globalTrans
Definition: DCMathSegmentMaker.h:180
Muon::DCMathSegmentMaker::HitInXZ::phimax
double phimax
Definition: DCMathSegmentMaker.h:116
Muon::DCMathSegmentMaker::Cluster2D::detElId
Identifier detElId
Definition: DCMathSegmentMaker.h:135
IMuonSegmentFittingTool.h
MuonIntersectGeoData.h
GeoPrimitives.h
Muon::DCMathSegmentMaker::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: DCMathSegmentMaker.h:344
Muon::DCMathSegmentMaker::m_compClusterCreator
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compClusterCreator
Definition: DCMathSegmentMaker.h:371
Muon::DCMathSegmentMaker::createROTVec
static DataVector< const Trk::MeasurementBase > createROTVec(std::vector< std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> > &rioDistVec)
Definition: DCMathSegmentMaker.cxx:1655
Muon::DCMathSegmentMaker::Cluster2D::etaHit
const MuonClusterOnTrack * etaHit
Definition: DCMathSegmentMaker.h:139
Muon::DCMathSegmentMaker::createClusterVec
TrkDriftCircleMath::CLVec createClusterVec(const Identifier &chid, ClusterVec &spVec, const Amg::Transform3D &gToStation) const
Definition: DCMathSegmentMaker.cxx:978
Muon::DCMathSegmentMaker::m_usePreciseError
Gaudi::Property< bool > m_usePreciseError
Definition: DCMathSegmentMaker.h:417
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Muon::DCMathSegmentMaker::TubeEnds::phimin
double phimin
Definition: DCMathSegmentMaker.h:165
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:183
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::DCMathSegmentMaker::errorScalingRegion
bool errorScalingRegion(const Identifier &id) const
apply error scaling for low mometum tracks
Definition: DCMathSegmentMaker.cxx:676
Muon::DCMathSegmentMaker::m_segmentFitter
ToolHandle< IMuonSegmentFittingTool > m_segmentFitter
Definition: DCMathSegmentMaker.h:386
IMuonSegmentSelectionTool.h
Muon::DCMathSegmentMaker::Cluster2D::Cluster2D
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
Definition: DCMathSegmentMaker.h:128
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::DCMathSegmentMaker::Cluster2D
Definition: DCMathSegmentMaker.h:119
Muon::DCMathSegmentMaker::segmentCreationInfo::phimin
double phimin
Definition: DCMathSegmentMaker.h:182
TrkDriftCircleMath::MdtChamberGeometry
Definition: MdtChamberGeometry.h:18
Muon::DCMathSegmentMaker::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: DCMathSegmentMaker.h:349
Muon::SortClustersById
Function object to sort MuonClusterOnTrack pointers by Identier.
Definition: DCMathSegmentMaker.h:67
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
IMuonClusterOnTrackCreator.h
AthAlgTool.h
Muon::DCMathSegmentMaker::m_chamberGeoKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
Definition: DCMathSegmentMaker.h:430
Muon::DCMathSegmentMaker::HitInXZ::HitInXZ
HitInXZ(Identifier i, bool isM, bool measP, double lx, double lz, double lxmin, double lxmax, double phmin, double phmax)
Definition: DCMathSegmentMaker.h:106
Muon::DCMathSegmentMaker::Cluster2D::corrupt
bool corrupt() const
Definition: DCMathSegmentMaker.h:156
Muon::DCMathSegmentMaker::TubeEnds::phimax
double phimax
Definition: DCMathSegmentMaker.h:166
Muon::DCMathSegmentMaker::TubeEnds::lxmin
double lxmin
Definition: DCMathSegmentMaker.h:163
DCSLHitSelector.h
Muon::DCMathSegmentMaker::createSpacePoint
Cluster2D createSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const
Definition: DCMathSegmentMaker.cxx:844
Muon::DCMathSegmentMaker::Cluster2D::is2D
bool is2D() const
Definition: DCMathSegmentMaker.h:155
Muon::DCMathSegmentMaker::~DCMathSegmentMaker
virtual ~DCMathSegmentMaker()=default
Muon::DCMathSegmentMaker::segmentCreationInfo::clusters
ClusterVecPair clusters
Definition: DCMathSegmentMaker.h:178
Muon::DCMathSegmentMaker::m_refitParameters
Gaudi::Property< bool > m_refitParameters
Definition: DCMathSegmentMaker.h:408
Muon::DCMathSegmentMaker::m_allMdtHoles
Gaudi::Property< bool > m_allMdtHoles
Definition: DCMathSegmentMaker.h:414
Muon::DCMathSegmentMaker::initialize
virtual StatusCode initialize()
Definition: DCMathSegmentMaker.cxx:63
Muon::DCMathSegmentMaker::m_createCompetingROTsPhi
Gaudi::Property< bool > m_createCompetingROTsPhi
Definition: DCMathSegmentMaker.h:407
Muon::DCMathSegmentMaker::m_recoverBadRpcCabling
Gaudi::Property< bool > m_recoverBadRpcCabling
Definition: DCMathSegmentMaker.h:422
MdtChamberGeometry.h
Muon::DCMathSegmentMaker::TubeEnds::TubeEnds
TubeEnds()=default
DataVector< Trk::Segment >
Trk::LocalDirection
represents the three-dimensional global direction with respect to a planar surface frame.
Definition: LocalDirection.h:81
Muon::DCMathSegmentMaker::IdHitMap
std::map< Identifier, EtaPhiHitsPair > IdHitMap
Definition: DCMathSegmentMaker.h:101
Muon::DCMathSegmentMaker::localTubeEnds
TubeEnds localTubeEnds(const MdtDriftCircleOnTrack &mdt, const Amg::Transform3D &gToSegment, const Amg::Transform3D &segmentToG) const
calculate positions of tube ends
Definition: DCMathSegmentMaker.cxx:2048
IMuonEDMHelperSvc.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Muon::DCMathSegmentMaker::HitInXZ::xmin
double xmin
Definition: DCMathSegmentMaker.h:113
Muon::DCMathSegmentMaker::HitInXZ::isMdt
bool isMdt
Definition: DCMathSegmentMaker.h:109
Muon::DCMathSegmentMaker::calculateHoles
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
Definition: DCMathSegmentMaker.cxx:1689
Muon::DCMathSegmentMaker::m_mdtKey
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtKey
Definition: DCMathSegmentMaker.h:428
Muon::DCMathSegmentMaker::create2DClusters
ClusterVecPair create2DClusters(const std::vector< const MuonClusterOnTrack * > &clusters) const
Definition: DCMathSegmentMaker.cxx:720
IMdtDriftCircleOnTrackCreator.h
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
Muon::DCMathSegmentMaker::findFirstRotInChamberWithMostHits
const MdtDriftCircleOnTrack * findFirstRotInChamberWithMostHits(const std::vector< const MdtDriftCircleOnTrack * > &mdts) const
Definition: DCMathSegmentMaker.cxx:1794
Muon::DCMathSegmentMaker::HitInXZ::phimin
double phimin
Definition: DCMathSegmentMaker.h:115
Muon::DCMathSegmentMaker::HitInXZ::measPhi
bool measPhi
Definition: DCMathSegmentMaker.h:110
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::DCMathSegmentMaker::m_strictRoadDirectionConsistencyCheck
Gaudi::Property< bool > m_strictRoadDirectionConsistencyCheck
Definition: DCMathSegmentMaker.h:410
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Muon::DCMathSegmentMaker::m_dcslFitProvider
ToolHandle< IDCSLFitProvider > m_dcslFitProvider
Definition: DCMathSegmentMaker.h:396
Muon::DCMathSegmentMaker::m_doSpacePoints
Gaudi::Property< bool > m_doSpacePoints
Definition: DCMathSegmentMaker.h:405
Muon::SortByDistanceToSegment::operator()
bool operator()(const std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> &hit1, const std::pair< double, std::unique_ptr< const Trk::MeasurementBase >> &hit2)
Definition: DCMathSegmentMaker.h:83
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
Muon::DCMathSegmentMaker::createTgcSpacePoint
Cluster2D createTgcSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const MuonClusterOnTrack *phiHit) const
Definition: DCMathSegmentMaker.cxx:876
Muon::SortClustersById::operator()
bool operator()(const MuonClusterOnTrack *cl1, const MuonClusterOnTrack *cl2)
Definition: DCMathSegmentMaker.h:68
Muon::DCMathSegmentMaker::m_doTimeOutChecks
Gaudi::Property< bool > m_doTimeOutChecks
Definition: DCMathSegmentMaker.h:420
Muon::DCMathSegmentMaker::m_maxAssociateClusterDistance
Gaudi::Property< double > m_maxAssociateClusterDistance
Definition: DCMathSegmentMaker.h:412
DCStatistics.h
Muon::DCMathSegmentMaker::m_sinAngleCut
Gaudi::Property< double > m_sinAngleCut
Definition: DCMathSegmentMaker.h:402
Muon::DCMathSegmentMaker::m_redo2DFit
Gaudi::Property< bool > m_redo2DFit
Definition: DCMathSegmentMaker.h:425
Muon::DCMathSegmentMaker::m_doGeometry
Gaudi::Property< bool > m_doGeometry
Definition: DCMathSegmentMaker.h:403
Trk::PlaneSurface
Definition: PlaneSurface.h:64
Muon::DCMathSegmentMaker::segmentCreationInfo::geom
const TrkDriftCircleMath::ChamberGeometry * geom
Definition: DCMathSegmentMaker.h:179
Muon::DCMathSegmentMaker::findMdt
const MdtPrepData * findMdt(const EventContext &ctx, const Identifier &id) const
Definition: DCMathSegmentMaker.cxx:1775
Muon::DCMathSegmentMaker::m_assumePointingPhi
Gaudi::Property< bool > m_assumePointingPhi
Definition: DCMathSegmentMaker.h:424
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Muon::DCMathSegmentMaker::associateMDTsToSegment
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
Definition: DCMathSegmentMaker.cxx:1149
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
Muon::DCMathSegmentMaker::m_updatePhiUsingPhiHits
Gaudi::Property< bool > m_updatePhiUsingPhiHits
Definition: DCMathSegmentMaker.h:423
Muon::DCMathSegmentMaker::m_clusterCreator
ToolHandle< IMuonClusterOnTrackCreator > m_clusterCreator
Definition: DCMathSegmentMaker.h:366
MuonSegment.h
Muon::DCMathSegmentMaker::EtaPhiHitsPair
std::pair< std::vector< const MuonClusterOnTrack * >, std::vector< const MuonClusterOnTrack * > > EtaPhiHitsPair
Definition: DCMathSegmentMaker.h:99
Muon::DCMathSegmentMaker::distanceToSegment
static double distanceToSegment(const TrkDriftCircleMath::Segment &segment, const Amg::Vector3D &hitPos, const Amg::Transform3D &gToStation)
Definition: DCMathSegmentMaker.cxx:1632
Muon::DCMathSegmentMaker::createRpcSpacePoint
Cluster2D createRpcSpacePoint(const Identifier &gasGapId, const MuonClusterOnTrack *etaHit, const std::vector< const MuonClusterOnTrack * > &phiHits) const
Definition: DCMathSegmentMaker.cxx:917
Muon::DCMathSegmentMaker
Definition: DCMathSegmentMaker.h:96
Muon::DCMathSegmentMaker::updateDirection
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
Definition: DCMathSegmentMaker.cxx:2126
Muon::DCMathSegmentMaker::segmentCreationInfo::amdbTrans
Amg::Transform3D amdbTrans
Definition: DCMathSegmentMaker.h:181
MuonClusterOnTrack.h
Trk::RIO_OnTrack::associatedSurface
virtual const Surface & associatedSurface() const override=0
returns the surface for the local to global transformation
Muon::DCMathSegmentMaker::Cluster2D::globalPos
Amg::Vector3D globalPos
Definition: DCMathSegmentMaker.h:154
Muon::DCMathSegmentMaker::m_outputFittedT0
Gaudi::Property< bool > m_outputFittedT0
Definition: DCMathSegmentMaker.h:418
IDCSLFitProvider.h
Muon::DCMathSegmentMaker::HitInXZ::id
Identifier id
Definition: DCMathSegmentMaker.h:108
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
Muon::DCMathSegmentMaker::HitInXZ
Definition: DCMathSegmentMaker.h:105
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
Muon::DCMathSegmentMaker::m_mdtCreatorT0
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtCreatorT0
Definition: DCMathSegmentMaker.h:361
Cluster.h
error
Definition: IImpactPoint3dEstimator.h:70
Muon::DCMathSegmentMaker::TubeEnds
Definition: DCMathSegmentMaker.h:161
ITrackFitter.h
Trk::Surface::localToGlobal
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.
IMuonIdHelperSvc.h
Muon::DCMathSegmentMaker::createChamberGeometry
TrkDriftCircleMath::MdtChamberGeometry createChamberGeometry(const Identifier &chid, const Amg::Transform3D &gToStation) const
Definition: DCMathSegmentMaker.cxx:1073
Muon::DCMathSegmentMaker::checkPhiConsistency
bool checkPhiConsistency(double phi, double phimin, double phimax) const
check whether phi is consistent with segment phi
Definition: DCMathSegmentMaker.cxx:2100
IMuonSegmentMaker.h
Muon::DCMathSegmentMaker::m_preciseErrorScale
Gaudi::Property< double > m_preciseErrorScale
Definition: DCMathSegmentMaker.h:419
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
Muon::DCMathSegmentMaker::segmentCreationInfo
Definition: DCMathSegmentMaker.h:169
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Muon::DCMathSegmentMaker::segmentCreationInfo::segmentCreationInfo
segmentCreationInfo(ClusterVecPair &spVecs, const TrkDriftCircleMath::ChamberGeometry *multiGeo, Amg::Transform3D gToStation, Amg::Transform3D amdbToGlobal, double pmin, double pmax)
Definition: DCMathSegmentMaker.h:170
ServiceHandle< Muon::IMuonIdHelperSvc >
TrkDriftCircleMath::DCStatistics
This class offers no functionality, but to define a standard device for the maker to transfer to the ...
Definition: DCStatistics.h:19
Identifier
Definition: IdentifierFieldParser.cxx:14