ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
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. More...
 
TrackVec select (const TrackVec &tracks, const Selection *selection=nullptr) const
 select tracks satisfying selection. More...
 
bool select (const MuonCalibExtendedSegment &segment, const Selection *selection=nullptr) const
 check whether segment passes selection. More...
 
bool select (const MuonCalibExtendedTrack &track, const Selection *selection=nullptr) const
 check whether track passes selection. More...
 
bool select (const MuonCalibTrackSummary &summary, const Selection *selection=nullptr) const
 check whether summary passes selection. More...
 

Private Attributes

Selection m_selection {}
 

Detailed Description

Definition at line 20 of file MuonCalibSelector.h.

Member Typedef Documentation

◆ SegVec

Definition at line 22 of file MuonCalibSelector.h.

◆ TrackVec

Definition at line 23 of file MuonCalibSelector.h.

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
28  const Selection& sel = selection ? *selection : m_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  }

◆ 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
92  const Selection& sel = selection ? *selection : m_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
58  const Selection& sel = selection ? *selection : m_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  }

◆ 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  }

Member Data Documentation

◆ m_selection

Selection MuonCalib::MuonCalibSelector::m_selection {}
private

Definition at line 80 of file MuonCalibSelector.h.


The documentation for this class was generated from the following files:
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:142
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MuonCalib::EventHandler::ExtendedTrackPtr
MuonCalibExtendedRawHits::ExtendedTrkPtr ExtendedTrackPtr
Definition: EventHandler.h:32
MuonCalib::MuonCalibSelector::SegVec
EventHandler::SegmentVec SegVec
Definition: MuonCalibSelector.h:22
sel
sel
Definition: SUSYToolsTester.cxx:92
MuonCalib::MuonCalibSelector::select
SegVec select(const SegVec &segments, const Selection *selection=nullptr) const
select segments satisfying selection.
Definition: MuonCalibSelector.cxx:15
selection
std::string selection
Definition: fbtTestBasics.cxx:73
MuonCalib::MuonCalibSelector::m_selection
Selection m_selection
Definition: MuonCalibSelector.h:80
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
MuonCalib::MuonCalibSelector::TrackVec
EventHandler::TrackVec TrackVec
Definition: MuonCalibSelector.h:23
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
MuonCalib::EventHandler::ExtendedSegmentPtr
MuonCalibExtendedRawHits::ExtendedSegPtr ExtendedSegmentPtr
Definition: EventHandler.h:33
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65