ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonTrackSelectorTool Class Reference

tool to select tracks More...

#include <MuonTrackSelectorTool.h>

Inheritance diagram for Muon::MuonTrackSelectorTool:
Collaboration diagram for Muon::MuonTrackSelectorTool:

Classes

struct  StationData
 internal data structure More...

Public Member Functions

 MuonTrackSelectorTool (const std::string &, const std::string &, const IInterface *)
 constructor
virtual ~MuonTrackSelectorTool ()=default
 destructor
StatusCode initialize ()
 AlgTool initilize.
StatusCode finalize ()
 AlgTool finalize.
std::vector< IdentifierholesInChamber (const Trk::TrackParameters &pars, const Identifier &chId, const std::set< Identifier > &tubeIds) const
 calculate holes in a given chamber using local straight line extrapolation
bool decision (Trk::Track &track) const
 returns true if the track satisfies the selection criteria else false
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
ServiceHandle< Muon::IMuonEDMHelperSvcm_edmHelperSvc
 EDM Helper tool.
PublicToolHandle< Muon::MuonEDMPrinterToolm_printer
ToolHandle< Trk::ITrackSummaryHelperToolm_trackSummaryTool
Gaudi::Property< double > m_holeHitRatioCutPerStation {this, "HolesToHitsRatioCutPerStation", 1.1}
Gaudi::Property< double > m_chi2NDofCut {this, "Chi2NDofCut", 20}
Gaudi::Property< unsigned int > m_minMdtHitsPerStation {this, "MinimumNumberOfMdtHitsPerStation", 3}
Gaudi::Property< unsigned int > m_maxMdtHolesPerTwoStationTrack {this, "MaxMdtHolesOnTwoStationTrack", 5}
Gaudi::Property< unsigned int > m_maxMdtHolesPerTrack {this, "MaxMdtHolesOnTrack", 5}
Gaudi::Property< unsigned int > m_minCscHitsPerStation {this, "MinimumNumberOfCscHitsPerStation", 3 }
Gaudi::Property< bool > m_useRPCHoles {this, "UseRPCHoles", true}
Gaudi::Property< bool > m_useTGCHoles {this, "UseTGCHoles", true}
Gaudi::Property< bool > m_useCSCHoles {this, "UseCSCHoles", true}
Gaudi::Property< bool > m_useMDTHoles {this, "UseMDTHoles", true}
Gaudi::Property< bool > m_ignoreTriggerHolesInLayersWithHits {this, "IgnoreTriggerHolesInChamberWithHits", true}
Gaudi::Property< bool > m_useRPCTimeWindow {this, "ApplyRPCTimeWindow", false}
Gaudi::Property< bool > m_removeTwoStationTrackWithoutTriggerHits {this, "RemoveTwoStationTrackWithoutTriggerHits", false}
Gaudi::Property< bool > m_countMdtOutliersAsHoles {this, "CountMDTOutlierAsHoles", false}
Gaudi::Property< bool > m_removeSingleStationTracks {this, "RemoveSingleStationTracks", false}
Gaudi::Property< bool > m_tightSingleStationCuts {this, "TightSingleStationCuts", false}
Gaudi::Property< bool > m_requireSanePerigee
std::atomic_uint m_ntotalTracks {0}
 counter for statistics
std::atomic_uint m_failedChi2NDofCut {0}
std::atomic_uint m_failedSingleStationCut {0}
std::atomic_uint m_failedRPCAveMinTimeCut {0}
std::atomic_uint m_failedRPCAveMaxTimeCut {0}
std::atomic_uint m_failedRPCSpreadTimeCut {0}
std::atomic_uint m_failedTwoStationsCut {0}
std::atomic_uint m_failedTwoStationsMaxMDTHoleCut {0}
std::atomic_uint m_failedTwoStationsMaxHoleCut {0}
std::atomic_uint m_failedTwoStationsGoodStationCut {0}
std::atomic_uint m_failedTriggerStationCut {0}
std::atomic_uint m_failedMaxMDTHoleCut {0}
std::atomic_uint m_failedMaxHoleCut {0}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

tool to select tracks

Definition at line 33 of file MuonTrackSelectorTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonTrackSelectorTool()

Muon::MuonTrackSelectorTool::MuonTrackSelectorTool ( const std::string & ty,
const std::string & na,
const IInterface * pa )

constructor

Definition at line 20 of file MuonTrackSelectorTool.cxx.

20 :
21 AthAlgTool(ty, na, pa) {}
AthAlgTool()
Default constructor:

◆ ~MuonTrackSelectorTool()

virtual Muon::MuonTrackSelectorTool::~MuonTrackSelectorTool ( )
virtualdefault

destructor

Member Function Documentation

◆ decision()

bool Muon::MuonTrackSelectorTool::decision ( Trk::Track & track) const

returns true if the track satisfies the selection criteria else false

Definition at line 65 of file MuonTrackSelectorTool.cxx.

65 {
66 // loop over track and calculate residuals
67 const Trk::TrackStates* states = track.trackStateOnSurfaces();
68 if (!states) {
69 ATH_MSG_DEBUG(" track without states, discarding track ");
70 return false;
71 }
73 if (!track.perigeeParameters() || !Amg::hasPositiveDiagElems(*track.perigeeParameters()->covariance())) return false;
74 }
75
77
78 ATH_MSG_VERBOSE(" new track " << m_printer->print(track) << std::endl << m_printer->printStations(track));
79
80 // get reduced chi2
81 const Trk::FitQuality* fq = track.fitQuality();
82 if (!fq) return false;
83 double reducedChi2 = fq->numberDoF() != 0. ? fq->chiSquared() / fq->numberDoF() : 1.;
84 if (reducedChi2 > m_chi2NDofCut) {
86 ATH_MSG_DEBUG(" Track discarded: too large chi2 " << reducedChi2);
87 return false;
88 }
89
91 int nrpcs = 0;
92 double aveRpcTime = 0.;
93 double minTime = 1e9;
94 double maxTime = -1e9;
95
96 // loop over TSOSs
99 for (; tsit != tsit_end; ++tsit) {
100 if (!(*tsit)->type(Trk::TrackStateOnSurface::Measurement)) continue;
101
102 // check wther state is a measurement
103 const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack();
104 if (!meas) continue;
105
106 const RpcClusterOnTrack* rpc = dynamic_cast<const RpcClusterOnTrack*>(meas);
107 if (!rpc) {
108 const CompetingMuonClustersOnTrack* crot = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas);
109 if (crot) { rpc = dynamic_cast<const RpcClusterOnTrack*>(crot->containedROTs().front()); }
110 }
111 if (rpc) {
112 double time = rpc->prepRawData()->time() - rpc->globalPosition().mag() / 300.;
113 ++nrpcs;
114 aveRpcTime += time;
115 if (time < minTime) minTime = time;
116 if (time > maxTime) maxTime = time;
117 }
118 }
119
120 if (nrpcs != 0) {
121 aveRpcTime /= nrpcs;
122 double timeMinCut = -2.;
123 double timeMaxCut = 20.;
124 ATH_MSG_VERBOSE(" ave RPC time " << aveRpcTime << " min " << minTime << " max " << maxTime);
125 if (aveRpcTime < timeMinCut) {
126 ATH_MSG_VERBOSE(" rejecting due too small average RPC time ");
128 return false;
129 }
130 if (aveRpcTime > timeMaxCut) {
131 ATH_MSG_VERBOSE(" rejecting due too large average RPC time ");
133 return false;
134 }
135 if (maxTime > timeMaxCut && minTime < timeMinCut) {
136 ATH_MSG_VERBOSE(" rejecting due too larger RPC time spread ");
138 return false;
139 }
140 }
141 }
142
143 unsigned int mdtHoles = 0;
144 unsigned int mdtOutliers = 0;
145 unsigned int nholes = 0;
146 std::map<MuonStationIndex::StIndex, StationData> stations;
147
148 Trk::TrackSummary* summary = track.trackSummary();
149 Trk::MuonTrackSummary muonSummary;
150 if (summary) {
151 if (summary->muonTrackSummary())
152 muonSummary = *summary->muonTrackSummary();
153 else {
154 m_trackSummaryTool->addDetailedTrackSummary(track, *summary);
155 if (summary->muonTrackSummary()) muonSummary = *summary->muonTrackSummary();
156 }
157 } else {
158 Trk::TrackSummary tmpSummary;
159 m_trackSummaryTool->addDetailedTrackSummary(track, tmpSummary);
160 if (tmpSummary.muonTrackSummary()) muonSummary = *tmpSummary.muonTrackSummary();
161 }
162
163 std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit = muonSummary.chamberHitSummary().begin();
164 std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit_end = muonSummary.chamberHitSummary().end();
165 for (; chit != chit_end; ++chit) {
166 const Identifier& chId = chit->chamberId();
167
168 bool isMdt = m_idHelperSvc->isMdt(chId);
169 bool isCsc = m_idHelperSvc->isCsc(chId);
170 bool isRpc = m_idHelperSvc->isRpc(chId);
171 bool isTgc = m_idHelperSvc->isTgc(chId);
172 bool issTgc = m_idHelperSvc->issTgc(chId);
173 bool isMM = m_idHelperSvc->isMM(chId);
174
175 // check whether we should use holes in this chamber
176 bool useHoles = false;
177 if ((isMdt && m_useMDTHoles) || (isTgc && m_useTGCHoles) || (isRpc && m_useRPCHoles) || (isCsc && m_useCSCHoles))
178 useHoles = true;
179
180 if (isMdt) {
181 MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(chId);
182 StationData& stData = stations[stIndex];
183 stData.netaHits += chit->nhits();
184 if (useHoles) stData.netaHoles += chit->nholes();
185 if (!stData.mdtHasHitsinMl1 && chit->mdtMl1().nhits > 0) stData.mdtHasHitsinMl1 = true;
186 if (!stData.mdtHasHitsinMl2 && chit->mdtMl2().nhits > 0) stData.mdtHasHitsinMl2 = true;
187
188 if (useHoles) {
189 mdtHoles += chit->nholes();
190 nholes += chit->nholes();
191 mdtOutliers += chit->noutliers();
192 }
193
194 stData.isMdt = true;
195
196 } else if (isCsc || issTgc || isMM) {
197 MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(chId);
198 StationData& stData = stations[stIndex];
199 stData.netaHits += chit->etaProjection().nhits;
200 if (useHoles) {
201 stData.netaHoles += chit->etaProjection().nholes;
202 stData.nphiHoles += chit->phiProjection().nholes;
203 nholes += chit->nholes();
204 }
205 stData.nphiHits += chit->phiProjection().nhits;
206 stData.isCsc = isCsc;
207 stData.isNSW = issTgc || isMM;
208
209 } else if (isRpc || isTgc) {
210 MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(chId);
211 StationData& stData = stations[stIndex];
212 stData.netaTrigHits += chit->etaProjection().nhits > 0 ? 1 : 0;
213 stData.nphiTrigHits += chit->phiProjection().nhits > 0 ? 1 : 0;
214 if (useHoles) {
215 // add trigger holes
216 if (!m_ignoreTriggerHolesInLayersWithHits || chit->etaProjection().nhits == 0) {
217 stData.netaTrigHoles += chit->etaProjection().nholes;
218 nholes += chit->etaProjection().nholes;
219 }
220 if (!m_ignoreTriggerHolesInLayersWithHits || chit->phiProjection().nhits == 0) {
221 stData.nphiTrigHoles += chit->phiProjection().nholes;
222 nholes += chit->phiProjection().nholes;
223 }
224 }
225
226 // make sure this station is not already present as MDT or CSC station
227 if (!stData.isMdt && !stData.isCsc) stData.isTrigger = true;
228 }
229 }
230
231 unsigned int nGoodStations = 0;
232 unsigned int nstations = 0;
233 unsigned int nTwoMlStations = 0;
234 unsigned int nGoodCscStations = 0;
235 unsigned int nGoodTriggerStations = 0;
236
237 std::map<MuonStationIndex::StIndex, StationData>::iterator sit = stations.begin();
238 std::map<MuonStationIndex::StIndex, StationData>::iterator sit_end = stations.end();
239 for (; sit != sit_end; ++sit) {
240 StationData& stData = sit->second;
241
242 if (stData.nphiTrigHits != 0 && stData.netaTrigHits != 0) { ++nGoodTriggerStations; }
243
244 if (stData.isMdt) {
245 if (stData.netaHits < m_minMdtHitsPerStation) {
246 ATH_MSG_VERBOSE(" Not counting MDT station too few MDT hits: nhits " << stData.netaHits << " cut "
248 continue;
249 }
250 ++nstations;
251 double holeHitRatio = (double)stData.netaHoles / stData.netaHits;
252 if (holeHitRatio > m_holeHitRatioCutPerStation) {
253 ATH_MSG_VERBOSE(" Not counting MDT station too many holes: nhits " << stData.netaHits << " nholes " << stData.netaHoles
254 << " ratio " << holeHitRatio << " cut "
256 continue;
257 }
258 if (stData.mdtHasHitsinBothMl()) ++nTwoMlStations;
259 } else if (stData.isCsc || stData.isNSW) {
260 if (stData.isCsc && stData.nphiHits == 0) {
261 ATH_MSG_VERBOSE(" Not counting CSC station no phi hits: netaHits " << stData.netaHits << " nphiHits "
262 << stData.nphiHits);
263 continue;
264 }
265
266 if (stData.netaHits < m_minCscHitsPerStation) {
267 ATH_MSG_VERBOSE(" Not counting CSC station too few hits: netaHits "
268 << stData.netaHits << " nphiHits " << stData.nphiHits << " cut " << m_minCscHitsPerStation);
269 continue;
270 }
271 ++nstations;
272 ++nGoodCscStations;
273 }
274
275 ++nGoodStations;
276 }
277
278 ATH_MSG_DEBUG(" good stations " << nGoodStations << " MDT stations with two ml " << nTwoMlStations << " MDT holes " << mdtHoles
279 << " outliers " << mdtOutliers << " good CSC stations " << nGoodCscStations << " trigger stations "
280 << nGoodTriggerStations);
281
282 if (m_removeSingleStationTracks && stations.size() < 2) {
283 ATH_MSG_DEBUG(" Track discarded: too few stations " << stations.size());
285 return false;
286 }
287
288 // special treatment of single station tracks
289 if (stations.size() == 1) {
290 using namespace MuonStationIndex;
291 if (!stations.count(StIndex::EM)) return false;
292
293 StationData& stData = stations[StIndex::EM];
294
295 unsigned int nExpectedTriggerStations = m_tightSingleStationCuts ? 3 : 2;
296 unsigned int maxHolesSingle = m_tightSingleStationCuts ? 0 : 1;
297
298 ATH_MSG_DEBUG(" Single station track: trigger phi " << stData.nphiTrigHits << " eta " << stData.netaTrigHits << " cut "
299 << nExpectedTriggerStations << " holes " << stData.netaHoles << " cut "
300 << maxHolesSingle);
301
302 bool ok = true;
303 // require two multi layers in MDT
304 if (nTwoMlStations == 0) ok = false;
305
306 // require all three trigger layers
307 if (stData.nphiTrigHits < nExpectedTriggerStations || stData.netaTrigHits < nExpectedTriggerStations) ok = false;
308
309 // no holes
310 if (stData.netaHoles > maxHolesSingle) ok = false;
311
312 if (!ok) {
313 ATH_MSG_DEBUG(" Track discarded: failed single track cuts ");
315 }
316 return ok;
317 }
318
319 if (nGoodStations < 2) {
320 ATH_MSG_DEBUG(" Track discarded: too few good stations " << nGoodStations);
322 return false;
323 }
324
325 if (m_countMdtOutliersAsHoles) mdtHoles += mdtOutliers;
326
327 if (nstations < 3) {
328 if (mdtHoles > m_maxMdtHolesPerTwoStationTrack) {
329 ATH_MSG_DEBUG(" Track discarded: good stations " << nGoodStations << " and " << mdtHoles << " mdt holes ");
331 return false;
332 }
333 if (nholes > m_maxMdtHolesPerTwoStationTrack) {
334 ATH_MSG_DEBUG(" Track discarded: good stations " << nGoodStations << " and " << nholes << " holes ");
336 return false;
337 }
338 if (nTwoMlStations == 0 && nGoodCscStations == 0) {
339 ATH_MSG_DEBUG(" Track discarded: good stations "
340 << nGoodStations << " but no MDT station with hits in two multilayers nor good CSC station ");
342 return false;
343 }
344 if (m_removeTwoStationTrackWithoutTriggerHits && nGoodTriggerStations == 0) {
345 ATH_MSG_DEBUG(" Track discarded: stations " << nstations << " but no trigger hits nor good CSC station ");
347 return false;
348 }
349 } else {
350 if (mdtHoles > m_maxMdtHolesPerTrack) {
351 ATH_MSG_DEBUG(" Track discarded: good stations " << nGoodStations << " and " << mdtHoles << " mdt holes ");
353 return false;
354 }
355 if (nholes > m_maxMdtHolesPerTrack) {
356 ATH_MSG_DEBUG(" Track discarded: good stations " << nGoodStations << " and " << nholes << " holes ");
358 return false;
359 }
360 }
361
362 ATH_MSG_DEBUG(" Track passed selection ");
363
364 return true;
365 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
Gaudi::Property< unsigned int > m_minMdtHitsPerStation
Gaudi::Property< bool > m_removeTwoStationTrackWithoutTriggerHits
Gaudi::Property< bool > m_removeSingleStationTracks
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::atomic_uint m_ntotalTracks
counter for statistics
Gaudi::Property< unsigned int > m_maxMdtHolesPerTrack
Gaudi::Property< bool > m_useRPCHoles
std::atomic_uint m_failedTwoStationsMaxMDTHoleCut
Gaudi::Property< double > m_chi2NDofCut
ToolHandle< Trk::ITrackSummaryHelperTool > m_trackSummaryTool
Gaudi::Property< double > m_holeHitRatioCutPerStation
Gaudi::Property< bool > m_useCSCHoles
std::atomic_uint m_failedTwoStationsMaxHoleCut
Gaudi::Property< bool > m_tightSingleStationCuts
Gaudi::Property< bool > m_ignoreTriggerHolesInLayersWithHits
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
std::atomic_uint m_failedTwoStationsGoodStationCut
Gaudi::Property< bool > m_useRPCTimeWindow
Gaudi::Property< unsigned int > m_minCscHitsPerStation
Gaudi::Property< bool > m_requireSanePerigee
Gaudi::Property< unsigned int > m_maxMdtHolesPerTwoStationTrack
Gaudi::Property< bool > m_useTGCHoles
Gaudi::Property< bool > m_useMDTHoles
Gaudi::Property< bool > m_countMdtOutliersAsHoles
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition FitQuality.h:60
double chiSquared() const
returns the of the overall track fit
Definition FitQuality.h:56
const std::vector< ChamberHitSummary > & chamberHitSummary() const
access to the vector of chamber hit summaries on the track
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
const MuonTrackSummary * muonTrackSummary() const
returns a pointer to the MuonTrackSummary if available
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
time(flags, cells_name, *args, **kw)
StIndex
enum to classify the different station layers in the muon spectrometer
DataVector< const Trk::TrackStateOnSurface > TrackStates

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode Muon::MuonTrackSelectorTool::finalize ( )

AlgTool finalize.

Definition at line 31 of file MuonTrackSelectorTool.cxx.

31 {
32 // print counters
33 ATH_MSG_INFO(" Number of tracks handled by selector " << m_ntotalTracks);
34 if (m_ntotalTracks != 0) {
35 double failedChi2NDofCutFraction = (double)m_failedChi2NDofCut / (double)m_ntotalTracks;
36 double failedRPCAveMinTimeCutFraction = (double)m_failedRPCAveMinTimeCut / (double)m_ntotalTracks;
37 double failedRPCAveMaxTimeCutFraction = (double)m_failedRPCAveMaxTimeCut / (double)m_ntotalTracks;
38 double failedRPCSpreadTimeCutFraction = (double)m_failedRPCSpreadTimeCut / (double)m_ntotalTracks;
39 double failedSingleStationsCutFraction = (double)m_failedSingleStationCut / (double)m_ntotalTracks;
40 double failedTwoStationsCutFraction = (double)m_failedTwoStationsCut / (double)m_ntotalTracks;
41 double failedTwoStationsMaxMDTHoleCutFraction = (double)m_failedTwoStationsMaxMDTHoleCut / (double)m_ntotalTracks;
42 double failedTwoStationsMaxHoleCutFraction = (double)m_failedTwoStationsMaxHoleCut / (double)m_ntotalTracks;
43 double failedTwoStationsGoodStationCutFraction = (double)m_failedTwoStationsGoodStationCut / (double)m_ntotalTracks;
44 double failedTriggerStationCutFraction = (double)m_failedTriggerStationCut / (double)m_ntotalTracks;
45 double failedMaxMDTHoleCutFraction = (double)m_failedMaxMDTHoleCut / (double)m_ntotalTracks;
46 double failedMaxHoleCutFraction = (double)m_failedMaxHoleCut / (double)m_ntotalTracks;
47 ATH_MSG_INFO(" Fractions failing selection cuts: "
48 << endmsg << std::setw(30) << " Chi2/Ndof Cut " << failedChi2NDofCutFraction << endmsg
49 << std::setw(30) << " RPC AveMin Time Cut " << failedRPCAveMinTimeCutFraction << endmsg << std::setw(30)
50 << " RPC AveMax Time Cut " << failedRPCAveMaxTimeCutFraction << endmsg << std::setw(30)
51 << " RPC Spread Time Cut " << failedRPCSpreadTimeCutFraction << endmsg << std::setw(30)
52 << " Single station Cut " << failedSingleStationsCutFraction << endmsg << std::setw(30)
53 << " Two station Cut " << failedTwoStationsCutFraction << endmsg << std::setw(30)
54 << " Two station Max MDT hole Cut " << failedTwoStationsMaxMDTHoleCutFraction << endmsg << std::setw(30)
55 << " Two station Max hole Cut " << failedTwoStationsMaxHoleCutFraction << endmsg << std::setw(30)
56 << " Two station good station Cut " << failedTwoStationsGoodStationCutFraction << endmsg << std::setw(30)
57 << " Trigger station cut " << failedTriggerStationCutFraction << endmsg << std::setw(30)
58 << " MDT hole Cut " << failedMaxMDTHoleCutFraction << endmsg << std::setw(30)
59 << " Max hole Cut " << failedMaxHoleCutFraction);
60 }
61
62 return StatusCode::SUCCESS;
63 }
#define endmsg
#define ATH_MSG_INFO(x)

◆ holesInChamber()

std::vector< Identifier > Muon::MuonTrackSelectorTool::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

Parameters
parsTrackParameters in the chamber
chIdIdentifier of the chamber
tubeIdsset containing the Identifier of the hits that should not be counted as holes
Returns
a vector of hole Identifiers

◆ initialize()

StatusCode Muon::MuonTrackSelectorTool::initialize ( )

AlgTool initilize.

Definition at line 23 of file MuonTrackSelectorTool.cxx.

23 {
24 ATH_CHECK(m_edmHelperSvc.retrieve());
25 ATH_CHECK(m_printer.retrieve());
26 ATH_CHECK(m_idHelperSvc.retrieve());
27 ATH_CHECK(m_trackSummaryTool.retrieve());
28
29 return StatusCode::SUCCESS;
30 }
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
EDM Helper tool.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_chi2NDofCut

Gaudi::Property<double> Muon::MuonTrackSelectorTool::m_chi2NDofCut {this, "Chi2NDofCut", 20}
private

Definition at line 70 of file MuonTrackSelectorTool.h.

70{this, "Chi2NDofCut", 20};

◆ m_countMdtOutliersAsHoles

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_countMdtOutliersAsHoles {this, "CountMDTOutlierAsHoles", false}
private

Definition at line 83 of file MuonTrackSelectorTool.h.

83{this, "CountMDTOutlierAsHoles", false};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_edmHelperSvc

ServiceHandle<Muon::IMuonEDMHelperSvc> Muon::MuonTrackSelectorTool::m_edmHelperSvc
private
Initial value:
{
this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface"}

EDM Helper tool.

Definition at line 61 of file MuonTrackSelectorTool.h.

61 {
62 this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
63 "Handle to the service providing the IMuonEDMHelperSvc interface"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_failedChi2NDofCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedChi2NDofCut {0}
mutableprivate

Definition at line 113 of file MuonTrackSelectorTool.h.

113{0};

◆ m_failedMaxHoleCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedMaxHoleCut {0}
mutableprivate

Definition at line 124 of file MuonTrackSelectorTool.h.

124{0};

◆ m_failedMaxMDTHoleCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedMaxMDTHoleCut {0}
mutableprivate

Definition at line 123 of file MuonTrackSelectorTool.h.

123{0};

◆ m_failedRPCAveMaxTimeCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedRPCAveMaxTimeCut {0}
mutableprivate

Definition at line 116 of file MuonTrackSelectorTool.h.

116{0};

◆ m_failedRPCAveMinTimeCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedRPCAveMinTimeCut {0}
mutableprivate

Definition at line 115 of file MuonTrackSelectorTool.h.

115{0};

◆ m_failedRPCSpreadTimeCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedRPCSpreadTimeCut {0}
mutableprivate

Definition at line 117 of file MuonTrackSelectorTool.h.

117{0};

◆ m_failedSingleStationCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedSingleStationCut {0}
mutableprivate

Definition at line 114 of file MuonTrackSelectorTool.h.

114{0};

◆ m_failedTriggerStationCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedTriggerStationCut {0}
mutableprivate

Definition at line 122 of file MuonTrackSelectorTool.h.

122{0};

◆ m_failedTwoStationsCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedTwoStationsCut {0}
mutableprivate

Definition at line 118 of file MuonTrackSelectorTool.h.

118{0};

◆ m_failedTwoStationsGoodStationCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedTwoStationsGoodStationCut {0}
mutableprivate

Definition at line 121 of file MuonTrackSelectorTool.h.

121{0};

◆ m_failedTwoStationsMaxHoleCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedTwoStationsMaxHoleCut {0}
mutableprivate

Definition at line 120 of file MuonTrackSelectorTool.h.

120{0};

◆ m_failedTwoStationsMaxMDTHoleCut

std::atomic_uint Muon::MuonTrackSelectorTool::m_failedTwoStationsMaxMDTHoleCut {0}
mutableprivate

Definition at line 119 of file MuonTrackSelectorTool.h.

119{0};

◆ m_holeHitRatioCutPerStation

Gaudi::Property<double> Muon::MuonTrackSelectorTool::m_holeHitRatioCutPerStation {this, "HolesToHitsRatioCutPerStation", 1.1}
private

Definition at line 69 of file MuonTrackSelectorTool.h.

69{this, "HolesToHitsRatioCutPerStation", 1.1};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonTrackSelectorTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 60 of file MuonTrackSelectorTool.h.

60{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_ignoreTriggerHolesInLayersWithHits

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_ignoreTriggerHolesInLayersWithHits {this, "IgnoreTriggerHolesInChamberWithHits", true}
private

Definition at line 80 of file MuonTrackSelectorTool.h.

80{this, "IgnoreTriggerHolesInChamberWithHits", true};

◆ m_maxMdtHolesPerTrack

Gaudi::Property<unsigned int> Muon::MuonTrackSelectorTool::m_maxMdtHolesPerTrack {this, "MaxMdtHolesOnTrack", 5}
private

Definition at line 73 of file MuonTrackSelectorTool.h.

73{this, "MaxMdtHolesOnTrack", 5};

◆ m_maxMdtHolesPerTwoStationTrack

Gaudi::Property<unsigned int> Muon::MuonTrackSelectorTool::m_maxMdtHolesPerTwoStationTrack {this, "MaxMdtHolesOnTwoStationTrack", 5}
private

Definition at line 72 of file MuonTrackSelectorTool.h.

72{this, "MaxMdtHolesOnTwoStationTrack", 5};

◆ m_minCscHitsPerStation

Gaudi::Property<unsigned int> Muon::MuonTrackSelectorTool::m_minCscHitsPerStation {this, "MinimumNumberOfCscHitsPerStation", 3 }
private

Definition at line 74 of file MuonTrackSelectorTool.h.

74{this, "MinimumNumberOfCscHitsPerStation", 3 };

◆ m_minMdtHitsPerStation

Gaudi::Property<unsigned int> Muon::MuonTrackSelectorTool::m_minMdtHitsPerStation {this, "MinimumNumberOfMdtHitsPerStation", 3}
private

Definition at line 71 of file MuonTrackSelectorTool.h.

71{this, "MinimumNumberOfMdtHitsPerStation", 3};

◆ m_ntotalTracks

std::atomic_uint Muon::MuonTrackSelectorTool::m_ntotalTracks {0}
mutableprivate

counter for statistics

Definition at line 112 of file MuonTrackSelectorTool.h.

112{0};

◆ m_printer

PublicToolHandle<Muon::MuonEDMPrinterTool> Muon::MuonTrackSelectorTool::m_printer
private
Initial value:
{this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
"helper to nicely print out tracks"}

Definition at line 64 of file MuonTrackSelectorTool.h.

64 {this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
65 "helper to nicely print out tracks"};

◆ m_removeSingleStationTracks

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_removeSingleStationTracks {this, "RemoveSingleStationTracks", false}
private

Definition at line 84 of file MuonTrackSelectorTool.h.

84{this, "RemoveSingleStationTracks", false};

◆ m_removeTwoStationTrackWithoutTriggerHits

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_removeTwoStationTrackWithoutTriggerHits {this, "RemoveTwoStationTrackWithoutTriggerHits", false}
private

Definition at line 82 of file MuonTrackSelectorTool.h.

82{this, "RemoveTwoStationTrackWithoutTriggerHits", false};

◆ m_requireSanePerigee

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_requireSanePerigee
private
Initial value:
{this,"RequireSanePerigee", true,
"Ensures that the covariance of the perigee parameters has a positive trace"}

Definition at line 87 of file MuonTrackSelectorTool.h.

87 {this,"RequireSanePerigee", true,
88 "Ensures that the covariance of the perigee parameters has a positive trace"};

◆ m_tightSingleStationCuts

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_tightSingleStationCuts {this, "TightSingleStationCuts", false}
private

Definition at line 85 of file MuonTrackSelectorTool.h.

85{this, "TightSingleStationCuts", false};

◆ m_trackSummaryTool

ToolHandle<Trk::ITrackSummaryHelperTool> Muon::MuonTrackSelectorTool::m_trackSummaryTool
private
Initial value:
{this, "TrackSummaryHelperTool",
"Muon::MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool"}

Definition at line 66 of file MuonTrackSelectorTool.h.

66 {this, "TrackSummaryHelperTool",
67 "Muon::MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool"};

◆ m_useCSCHoles

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_useCSCHoles {this, "UseCSCHoles", true}
private

Definition at line 78 of file MuonTrackSelectorTool.h.

78{this, "UseCSCHoles", true};

◆ m_useMDTHoles

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_useMDTHoles {this, "UseMDTHoles", true}
private

Definition at line 79 of file MuonTrackSelectorTool.h.

79{this, "UseMDTHoles", true};

◆ m_useRPCHoles

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_useRPCHoles {this, "UseRPCHoles", true}
private

Definition at line 76 of file MuonTrackSelectorTool.h.

76{this, "UseRPCHoles", true};

◆ m_useRPCTimeWindow

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_useRPCTimeWindow {this, "ApplyRPCTimeWindow", false}
private

Definition at line 81 of file MuonTrackSelectorTool.h.

81{this, "ApplyRPCTimeWindow", false};

◆ m_useTGCHoles

Gaudi::Property<bool> Muon::MuonTrackSelectorTool::m_useTGCHoles {this, "UseTGCHoles", true}
private

Definition at line 77 of file MuonTrackSelectorTool.h.

77{this, "UseTGCHoles", true};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: