ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalib::MuonCalibSelector Class Reference

#include <MuonCalibSelector.h>

Collaboration diagram for MuonCalib::MuonCalibSelector:

Classes

struct  SegmentSelection
struct  Selection
struct  TrackSelection

Public Types

using SegVec = EventHandler::SegmentVec
using TrackVec = EventHandler::TrackVec

Public Member Functions

 MuonCalibSelector ()
SegVec select (const SegVec &segments, const Selection *selection=nullptr) const
 select segments satisfying selection.
TrackVec select (const TrackVec &tracks, const Selection *selection=nullptr) const
 select tracks satisfying selection.
bool select (const MuonCalibExtendedSegment &segment, const Selection *selection=nullptr) const
 check whether segment passes selection.
bool select (const MuonCalibExtendedTrack &track, const Selection *selection=nullptr) const
 check whether track passes selection.
bool select (const MuonCalibTrackSummary &summary, const Selection *selection=nullptr) const
 check whether summary passes selection.

Private Attributes

Selection m_selection {}

Detailed Description

Definition at line 20 of file MuonCalibSelector.h.

Member Typedef Documentation

◆ SegVec

◆ TrackVec

Constructor & Destructor Documentation

◆ MuonCalibSelector()

MuonCalib::MuonCalibSelector::MuonCalibSelector ( )
default

Member Function Documentation

◆ select() [1/5]

bool MuonCalib::MuonCalibSelector::select ( const MuonCalibExtendedSegment & segment,
const Selection * selection = nullptr ) const

check whether segment passes selection.

If a selection is passed it will be used, else default

Definition at line 26 of file MuonCalibSelector.cxx.

26 {
27 // select selection
29
30 // perform tests
31 const MuonCalibTrackSummary& summary = segment.summary();
32 if (!select(summary, &sel)) { return false; }
33 double chi2Ndof = segment.chi2();
34 int ndof = 1;
35 // hack! could go wrong if: fit included trigger hits or 4D CSC segments
36 if (!segment.mdtHOT().empty()) ndof = segment.mdtHOT().size() - 2;
37 if (!segment.cscHOT().empty()) ndof = segment.cscHOT().size() - 2;
38 if (ndof != 0.) chi2Ndof /= ndof;
39 if (chi2Ndof > sel.maxChi2Ndof) { return false; }
40 const SegmentSelection* segmentSelection = dynamic_cast<const SegmentSelection*>(&sel);
41 if (segmentSelection) {
42 if (segmentSelection->hasFittedT0 && (!segment.hasFittedT0() || segment.fittedT0() == 0.)) { return false; }
43 // if (segmentSelection->hasAssociatedTrack && segment.associatedTracks().empty()) { return false; }
44
45 if (segmentSelection->singleML && summary.nmdtHitsPerMl(1) > 0 && summary.nmdtHitsPerMl(2) > 0) return false;
46
47 if (segmentSelection->twoML && (summary.nmdtHitsPerMl(1) == 0 || summary.nmdtHitsPerMl(2) == 0)) return false;
48
49 float adcGoodHitFraction = (summary.nmdtHits - summary.nmdtHitsBelowADCCut) / summary.nmdtHits;
50 if (adcGoodHitFraction < segmentSelection->minAdcGoodFraction) return false;
51 }
52
53 return true;
54 }
SegVec select(const SegVec &segments, const Selection *selection=nullptr) const
select segments satisfying selection.
const std::string selection
float ndof(const U &p)

◆ select() [2/5]

bool MuonCalib::MuonCalibSelector::select ( const MuonCalibExtendedTrack & track,
const Selection * selection = nullptr ) const

check whether track passes selection.

If a selection is passed it will be used, else default

Definition at line 90 of file MuonCalibSelector.cxx.

90 {
91 // select selection
93
94 // perform tests
95 const MuonCalibTrackSummary& summary = track.summary();
96 if (!select(summary, &sel)) return false;
97
98 double chi2Ndof = track.chi2();
99 int ndof = track.ndof();
100 if (ndof != 0.) chi2Ndof /= ndof;
101 if (chi2Ndof > sel.maxChi2Ndof) return false;
102
103 const TrackSelection* trackSelection = dynamic_cast<const TrackSelection*>(&sel);
104 if (trackSelection) {
105 // select track with barrel hits
106 if (trackSelection->barrelTrack) {
107 if (!summary.hasBarrel) return false;
108
109 // if not requiring endcap hits but track has endcap hits, reject
110 if (!trackSelection->endcapTrackA && summary.hasEndcapA) return false;
111 if (!trackSelection->endcapTrackC && summary.hasEndcapC) return false;
112 }
113
114 // select track with endcap hits
115 if (trackSelection->endcapTrackA) {
116 if (!summary.hasEndcapA) return false;
117
118 // if not requiring barrel hits but track has barrel hits, reject
119 if (!trackSelection->barrelTrack && summary.hasBarrel) return false;
120 if (!trackSelection->endcapTrackC && summary.hasEndcapC) return false;
121 }
122
123 // select track with endcap hits
124 if (trackSelection->endcapTrackC) {
125 if (!summary.hasEndcapC) return false;
126
127 // if not requiring barrel hits but track has barrel hits, reject
128 if (!trackSelection->barrelTrack && summary.hasBarrel) return false;
129 if (!trackSelection->endcapTrackA && summary.hasEndcapA) return false;
130 }
131
132 if (std::abs(track.d0()) > trackSelection->maxr0) return false;
133 if (std::abs(track.z0ip()) > trackSelection->maxz0) return false;
134 }
135
136 return true;
137 }

◆ select() [3/5]

bool MuonCalib::MuonCalibSelector::select ( const MuonCalibTrackSummary & summary,
const Selection * selection = nullptr ) const

check whether summary passes selection.

If a selection is passed it will be used, else default

Definition at line 56 of file MuonCalibSelector.cxx.

56 {
57 // select selection
59
60 if (summary.nmdtHits < sel.nminMdtHits) return false;
61
62 if (summary.nphiTrigHits() < sel.nminPhiTrigHits) return false;
63
64 if (summary.netaTrigHits() < sel.nminEtaTrigHits) return false;
65
66 if (summary.noutliers > sel.nmaxOutliers) return false;
67
68 if (summary.npseudo > sel.nmaxPseudo) return false;
69
70 if (summary.nmdtHitsPerMl(1) < sel.nminMdtMl1) return false;
71 if (summary.nmdtHitsPerMl(2) < sel.nminMdtMl2) return false;
72 unsigned int nmdtCh = summary.nmdtCh();
73 if (nmdtCh < sel.nminMdtCh) return false;
74 if (nmdtCh > sel.nmaxMdtCh) return false;
75
76 return true;
77 }

◆ select() [4/5]

MuonCalibSelector::SegVec MuonCalib::MuonCalibSelector::select ( const SegVec & segments,
const Selection * selection = nullptr ) const

select segments satisfying selection.

If a selection is passed it will be used, else default

Definition at line 15 of file MuonCalibSelector.cxx.

16 {
17 SegVec selectedSegments;
18
19 // loop over segments and check whether they pass selection, if they do add to output vector
20 for (const EventHandler::ExtendedSegmentPtr& it : segments) {
21 if (select(*it, selection)) selectedSegments.emplace_back(it);
22 }
23 return selectedSegments;
24 }
MuonCalibExtendedRawHits::ExtendedSegPtr ExtendedSegmentPtr
EventHandler::SegmentVec SegVec

◆ select() [5/5]

MuonCalibSelector::TrackVec MuonCalib::MuonCalibSelector::select ( const TrackVec & tracks,
const Selection * selection = nullptr ) const

select tracks satisfying selection.

If a selection is passed it will be used, else default

Definition at line 79 of file MuonCalibSelector.cxx.

80 {
81 TrackVec selectedTracks;
82
83 // loop over segments and check whether they pass selection, if they do add to output vector
84 for (const EventHandler::ExtendedTrackPtr& it : tracks) {
85 if (select(*it, selection)) selectedTracks.emplace_back(it);
86 }
87 return selectedTracks;
88 }
MuonCalibExtendedRawHits::ExtendedTrkPtr ExtendedTrackPtr
EventHandler::TrackVec TrackVec

Member Data Documentation

◆ m_selection

Selection MuonCalib::MuonCalibSelector::m_selection {}
private

Definition at line 80 of file MuonCalibSelector.h.

80{};

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