ATLAS Offline Software
MuonTrackSelectorTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUON_MUONTRACKSELECTOR_H
6 #define MUON_MUONTRACKSELECTOR_H
7 
8 #include <atomic>
9 #include <set>
10 #include <string>
11 #include <vector>
12 
14 #include "GaudiKernel/ServiceHandle.h"
15 #include "GaudiKernel/ToolHandle.h"
21 #include "TrkTrack/Track.h"
22 
23 namespace Trk {
24  class Track;
25 }
26 
27 namespace Muon {
28 
34  public:
36  MuonTrackSelectorTool(const std::string&, const std::string&, const IInterface*);
37 
39  virtual ~MuonTrackSelectorTool() = default;
40 
43 
46 
53  std::vector<Identifier> holesInChamber(const Trk::TrackParameters& pars, const Identifier& chId,
54  const std::set<Identifier>& tubeIds) const;
55 
57  bool decision(Trk::Track& track) const;
58 
59  private:
60  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
62  this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
63  "Handle to the service providing the IMuonEDMHelperSvc interface"};
64  PublicToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
65  "helper to nicely print out tracks"};
66  ToolHandle<Trk::ITrackSummaryHelperTool> m_trackSummaryTool{this, "TrackSummaryHelperTool",
67  "Muon::MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool"};
68 
69  Gaudi::Property<double> m_holeHitRatioCutPerStation{this, "HolesToHitsRatioCutPerStation", 1.1};
70  Gaudi::Property<double> m_chi2NDofCut{this, "Chi2NDofCut", 20};
71  Gaudi::Property<unsigned int> m_minMdtHitsPerStation{this, "MinimumNumberOfMdtHitsPerStation", 3};
72  Gaudi::Property<unsigned int> m_maxMdtHolesPerTwoStationTrack{this, "MaxMdtHolesOnTwoStationTrack", 5};
73  Gaudi::Property<unsigned int> m_maxMdtHolesPerTrack{this, "MaxMdtHolesOnTrack", 5};
74  Gaudi::Property<unsigned int> m_minCscHitsPerStation{this, "MinimumNumberOfCscHitsPerStation", 3 };
75 
76  Gaudi::Property<bool> m_useRPCHoles{this, "UseRPCHoles", true};
77  Gaudi::Property<bool> m_useTGCHoles{this, "UseTGCHoles", true};
78  Gaudi::Property<bool> m_useCSCHoles{this, "UseCSCHoles", true};
79  Gaudi::Property<bool> m_useMDTHoles{this, "UseMDTHoles", true};
80  Gaudi::Property<bool> m_ignoreTriggerHolesInLayersWithHits{this, "IgnoreTriggerHolesInChamberWithHits", true};
81  Gaudi::Property<bool> m_useRPCTimeWindow{this, "ApplyRPCTimeWindow", false};
82  Gaudi::Property<bool> m_removeTwoStationTrackWithoutTriggerHits{this, "RemoveTwoStationTrackWithoutTriggerHits", false};
83  Gaudi::Property<bool> m_countMdtOutliersAsHoles{this, "CountMDTOutlierAsHoles", false};
84  Gaudi::Property<bool> m_removeSingleStationTracks{this, "RemoveSingleStationTracks", false};
85  Gaudi::Property<bool> m_tightSingleStationCuts{this, "TightSingleStationCuts", false};
86 
87  Gaudi::Property<bool> m_requireSanePerigee{this,"RequireSanePerigee", true,
88  "Ensures that the covariance of the perigee parameters has a positive trace"};
89 
91  struct StationData {
92  StationData() = default;
93  bool isMdt{false};
94  bool isCsc{false};
95  bool isNSW{false};
96  bool isTrigger{false};
98  bool mdtHasHitsinMl1{false};
99  bool mdtHasHitsinMl2{false};
100  unsigned int netaHits{0};
101  unsigned int nphiHits{0};
102  unsigned int netaHoles{0};
103  unsigned int nphiHoles{0};
104 
105  unsigned int netaTrigHits{0};
106  unsigned int nphiTrigHits{0};
107  unsigned int netaTrigHoles{0};
108  unsigned int nphiTrigHoles{0};
109  };
110 
112  mutable std::atomic_uint m_ntotalTracks{0};
113  mutable std::atomic_uint m_failedChi2NDofCut{0};
114  mutable std::atomic_uint m_failedSingleStationCut{0};
115  mutable std::atomic_uint m_failedRPCAveMinTimeCut{0};
116  mutable std::atomic_uint m_failedRPCAveMaxTimeCut{0};
117  mutable std::atomic_uint m_failedRPCSpreadTimeCut{0};
118  mutable std::atomic_uint m_failedTwoStationsCut{0};
119  mutable std::atomic_uint m_failedTwoStationsMaxMDTHoleCut{0};
120  mutable std::atomic_uint m_failedTwoStationsMaxHoleCut{0};
121  mutable std::atomic_uint m_failedTwoStationsGoodStationCut{0};
122  mutable std::atomic_uint m_failedTriggerStationCut{0};
123  mutable std::atomic_uint m_failedMaxMDTHoleCut{0};
124  mutable std::atomic_uint m_failedMaxHoleCut{0};
125  };
126 
127 } // namespace Muon
128 
129 #endif
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Muon::MuonTrackSelectorTool::m_removeTwoStationTrackWithoutTriggerHits
Gaudi::Property< bool > m_removeTwoStationTrackWithoutTriggerHits
Definition: MuonTrackSelectorTool.h:82
Muon::MuonTrackSelectorTool::m_failedTwoStationsMaxMDTHoleCut
std::atomic_uint m_failedTwoStationsMaxMDTHoleCut
Definition: MuonTrackSelectorTool.h:119
TrackParameters.h
Muon::MuonTrackSelectorTool::m_maxMdtHolesPerTwoStationTrack
Gaudi::Property< unsigned int > m_maxMdtHolesPerTwoStationTrack
Definition: MuonTrackSelectorTool.h:72
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
MuonEDMPrinterTool.h
Muon::MuonTrackSelectorTool::m_useRPCTimeWindow
Gaudi::Property< bool > m_useRPCTimeWindow
Definition: MuonTrackSelectorTool.h:81
Muon::MuonTrackSelectorTool::holesInChamber
std::vector< Identifier > holesInChamber(const Trk::TrackParameters &pars, const Identifier &chId, const std::set< Identifier > &tubeIds) const
calculate holes in a given chamber using local straight line extrapolation
Muon::MuonTrackSelectorTool::finalize
StatusCode finalize()
AlgTool finalize.
Definition: MuonTrackSelectorTool.cxx:31
Muon::MuonTrackSelectorTool::StationData
internal data structure
Definition: MuonTrackSelectorTool.h:91
Muon::MuonTrackSelectorTool::m_failedTwoStationsCut
std::atomic_uint m_failedTwoStationsCut
Definition: MuonTrackSelectorTool.h:118
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MuonTrackSelectorTool::m_failedSingleStationCut
std::atomic_uint m_failedSingleStationCut
Definition: MuonTrackSelectorTool.h:114
Muon::MuonTrackSelectorTool::m_failedChi2NDofCut
std::atomic_uint m_failedChi2NDofCut
Definition: MuonTrackSelectorTool.h:113
Muon::MuonTrackSelectorTool::m_useMDTHoles
Gaudi::Property< bool > m_useMDTHoles
Definition: MuonTrackSelectorTool.h:79
Track.h
Muon::MuonTrackSelectorTool::StationData::netaTrigHoles
unsigned int netaTrigHoles
Definition: MuonTrackSelectorTool.h:107
Muon::MuonTrackSelectorTool::m_failedTriggerStationCut
std::atomic_uint m_failedTriggerStationCut
Definition: MuonTrackSelectorTool.h:122
Muon::MuonTrackSelectorTool::StationData::nphiTrigHoles
unsigned int nphiTrigHoles
Definition: MuonTrackSelectorTool.h:108
Muon::MuonTrackSelectorTool
tool to select tracks
Definition: MuonTrackSelectorTool.h:33
Muon::MuonTrackSelectorTool::m_requireSanePerigee
Gaudi::Property< bool > m_requireSanePerigee
Definition: MuonTrackSelectorTool.h:87
Muon::MuonTrackSelectorTool::StationData::isTrigger
bool isTrigger
Definition: MuonTrackSelectorTool.h:96
Muon::MuonTrackSelectorTool::m_trackSummaryTool
ToolHandle< Trk::ITrackSummaryHelperTool > m_trackSummaryTool
Definition: MuonTrackSelectorTool.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::MuonTrackSelectorTool::StationData::isNSW
bool isNSW
Definition: MuonTrackSelectorTool.h:95
Muon::MuonTrackSelectorTool::m_minCscHitsPerStation
Gaudi::Property< unsigned int > m_minCscHitsPerStation
Definition: MuonTrackSelectorTool.h:74
Muon::MuonTrackSelectorTool::StationData::netaHoles
unsigned int netaHoles
Definition: MuonTrackSelectorTool.h:102
AthAlgTool.h
Muon::MuonTrackSelectorTool::StationData::mdtHasHitsinMl1
bool mdtHasHitsinMl1
Definition: MuonTrackSelectorTool.h:98
Muon::MuonTrackSelectorTool::m_failedMaxMDTHoleCut
std::atomic_uint m_failedMaxMDTHoleCut
Definition: MuonTrackSelectorTool.h:123
Muon::MuonTrackSelectorTool::StationData::mdtHasHitsinMl2
bool mdtHasHitsinMl2
Definition: MuonTrackSelectorTool.h:99
Muon::MuonTrackSelectorTool::MuonTrackSelectorTool
MuonTrackSelectorTool(const std::string &, const std::string &, const IInterface *)
constructor
Definition: MuonTrackSelectorTool.cxx:20
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuonTrackSelectorTool::initialize
StatusCode initialize()
AlgTool initilize.
Definition: MuonTrackSelectorTool.cxx:23
Muon::MuonTrackSelectorTool::StationData::nphiHoles
unsigned int nphiHoles
Definition: MuonTrackSelectorTool.h:103
Muon::MuonTrackSelectorTool::StationData::mdtHasHitsinBothMl
bool mdtHasHitsinBothMl() const
Definition: MuonTrackSelectorTool.h:97
Muon::MuonTrackSelectorTool::StationData::isMdt
bool isMdt
Definition: MuonTrackSelectorTool.h:93
Muon::MuonTrackSelectorTool::m_chi2NDofCut
Gaudi::Property< double > m_chi2NDofCut
Definition: MuonTrackSelectorTool.h:70
Muon::MuonTrackSelectorTool::m_holeHitRatioCutPerStation
Gaudi::Property< double > m_holeHitRatioCutPerStation
Definition: MuonTrackSelectorTool.h:69
Muon::MuonTrackSelectorTool::StationData::nphiTrigHits
unsigned int nphiTrigHits
Definition: MuonTrackSelectorTool.h:106
Muon::MuonTrackSelectorTool::m_failedMaxHoleCut
std::atomic_uint m_failedMaxHoleCut
Definition: MuonTrackSelectorTool.h:124
Muon::MuonTrackSelectorTool::StationData::isCsc
bool isCsc
Definition: MuonTrackSelectorTool.h:94
Muon::MuonTrackSelectorTool::m_useTGCHoles
Gaudi::Property< bool > m_useTGCHoles
Definition: MuonTrackSelectorTool.h:77
IMuonEDMHelperSvc.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Muon::MuonTrackSelectorTool::m_ntotalTracks
std::atomic_uint m_ntotalTracks
counter for statistics
Definition: MuonTrackSelectorTool.h:112
Muon::MuonTrackSelectorTool::m_useRPCHoles
Gaudi::Property< bool > m_useRPCHoles
Definition: MuonTrackSelectorTool.h:76
Muon::MuonTrackSelectorTool::StationData::netaHits
unsigned int netaHits
Definition: MuonTrackSelectorTool.h:100
Muon::MuonTrackSelectorTool::m_failedTwoStationsGoodStationCut
std::atomic_uint m_failedTwoStationsGoodStationCut
Definition: MuonTrackSelectorTool.h:121
Muon::MuonTrackSelectorTool::decision
bool decision(Trk::Track &track) const
returns true if the track satisfies the selection criteria else false
Definition: MuonTrackSelectorTool.cxx:65
Muon::MuonTrackSelectorTool::m_failedRPCAveMinTimeCut
std::atomic_uint m_failedRPCAveMinTimeCut
Definition: MuonTrackSelectorTool.h:115
ITrackSummaryHelperTool.h
Muon::MuonTrackSelectorTool::m_minMdtHitsPerStation
Gaudi::Property< unsigned int > m_minMdtHitsPerStation
Definition: MuonTrackSelectorTool.h:71
Muon::MuonTrackSelectorTool::m_removeSingleStationTracks
Gaudi::Property< bool > m_removeSingleStationTracks
Definition: MuonTrackSelectorTool.h:84
Muon::MuonTrackSelectorTool::m_failedRPCAveMaxTimeCut
std::atomic_uint m_failedRPCAveMaxTimeCut
Definition: MuonTrackSelectorTool.h:116
Muon::MuonTrackSelectorTool::m_failedRPCSpreadTimeCut
std::atomic_uint m_failedRPCSpreadTimeCut
Definition: MuonTrackSelectorTool.h:117
Muon::MuonTrackSelectorTool::~MuonTrackSelectorTool
virtual ~MuonTrackSelectorTool()=default
destructor
Muon::MuonTrackSelectorTool::m_tightSingleStationCuts
Gaudi::Property< bool > m_tightSingleStationCuts
Definition: MuonTrackSelectorTool.h:85
Muon::MuonTrackSelectorTool::StationData::nphiHits
unsigned int nphiHits
Definition: MuonTrackSelectorTool.h:101
Muon::MuonTrackSelectorTool::StationData::StationData
StationData()=default
Muon::MuonTrackSelectorTool::m_failedTwoStationsMaxHoleCut
std::atomic_uint m_failedTwoStationsMaxHoleCut
Definition: MuonTrackSelectorTool.h:120
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Muon::MuonTrackSelectorTool::m_countMdtOutliersAsHoles
Gaudi::Property< bool > m_countMdtOutliersAsHoles
Definition: MuonTrackSelectorTool.h:83
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MuonTrackSelectorTool::m_ignoreTriggerHolesInLayersWithHits
Gaudi::Property< bool > m_ignoreTriggerHolesInLayersWithHits
Definition: MuonTrackSelectorTool.h:80
Muon::MuonTrackSelectorTool::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
EDM Helper tool.
Definition: MuonTrackSelectorTool.h:61
Muon::MuonTrackSelectorTool::m_printer
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonTrackSelectorTool.h:64
Muon::MuonTrackSelectorTool::StationData::netaTrigHits
unsigned int netaTrigHits
Definition: MuonTrackSelectorTool.h:105
Muon::MuonTrackSelectorTool::m_maxMdtHolesPerTrack
Gaudi::Property< unsigned int > m_maxMdtHolesPerTrack
Definition: MuonTrackSelectorTool.h:73
IMuonIdHelperSvc.h
Muon::MuonTrackSelectorTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTrackSelectorTool.h:60
Muon::MuonTrackSelectorTool::m_useCSCHoles
Gaudi::Property< bool > m_useCSCHoles
Definition: MuonTrackSelectorTool.h:78
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14