ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MuonCalibExtraTree
MuonCalibExtraTreeEvent
src
MuonCalibSelector.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonCalibExtraTreeEvent/MuonCalibSelector.h
"
6
7
#include "
MuonCalibExtraTreeEvent/MuonCalibExtendedSegment.h
"
8
#include "
MuonCalibExtraTreeEvent/MuonCalibExtendedTrack.h
"
9
#include "
MuonCalibExtraTreeEvent/MuonCalibTrackSummary.h
"
10
11
namespace
MuonCalib
{
12
13
MuonCalibSelector::MuonCalibSelector
() =
default
;
14
15
MuonCalibSelector::SegVec
MuonCalibSelector::select
(
const
MuonCalibSelector::SegVec
& segments,
16
const
MuonCalibSelector::Selection
*
selection
)
const
{
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
}
25
26
bool
MuonCalibSelector::select
(
const
MuonCalibExtendedSegment
& segment,
const
Selection
*
selection
)
const
{
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
}
55
56
bool
MuonCalibSelector::select
(
const
MuonCalibTrackSummary
& summary,
const
MuonCalibSelector::Selection
*
selection
)
const
{
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
}
78
79
MuonCalibSelector::TrackVec
MuonCalibSelector::select
(
const
MuonCalibSelector::TrackVec
& tracks,
80
const
MuonCalibSelector::Selection
*
selection
)
const
{
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
}
89
90
bool
MuonCalibSelector::select
(
const
MuonCalibExtendedTrack
& track,
const
Selection
*
selection
)
const
{
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
}
138
139
}
// namespace MuonCalib
MuonCalibExtendedSegment.h
MuonCalibExtendedTrack.h
MuonCalibSelector.h
MuonCalibTrackSummary.h
sel
sel
Definition
SUSYToolsTester.cxx:92
MuonCalib::EventHandler::ExtendedSegmentPtr
MuonCalibExtendedRawHits::ExtendedSegPtr ExtendedSegmentPtr
Definition
EventHandler.h:33
MuonCalib::EventHandler::ExtendedTrackPtr
MuonCalibExtendedRawHits::ExtendedTrkPtr ExtendedTrackPtr
Definition
EventHandler.h:32
MuonCalib::MuonCalibExtendedSegment
A segment plus everything one can dream of knowing about it.
Definition
MuonCalibExtendedSegment.h:27
MuonCalib::MuonCalibExtendedSegment::summary
const MuonCalibTrackSummary & summary() const
access to hit counts
Definition
MuonCalibExtendedSegment.h:33
MuonCalib::MuonCalibExtendedTrack
A track plus everything one can dream of knowing about a track.
Definition
MuonCalibExtendedTrack.h:32
MuonCalib::MuonCalibSegment::hasFittedT0
bool hasFittedT0() const
check whether t0 was fitted
Definition
MuonCalibSegment.cxx:111
MuonCalib::MuonCalibSegment::cscHOT
const CscHitVec & cscHOT() const
retrieve the full set of CscCalibHitBase s assigned to this segment
Definition
MuonCalibSegment.cxx:156
MuonCalib::MuonCalibSegment::chi2
double chi2() const
retrieve chi2
Definition
MuonCalibSegment.cxx:182
MuonCalib::MuonCalibSegment::mdtHOT
const MdtHitVec & mdtHOT() const
retrieve the full set of MdtCalibHitBase s assigned to this segment
Definition
MuonCalibSegment.cxx:147
MuonCalib::MuonCalibSegment::fittedT0
double fittedT0() const
retrieve fitted T0, return -99999 if no fit was performed
Definition
MuonCalibSegment.cxx:112
MuonCalib::MuonCalibSelector::m_selection
Selection m_selection
Definition
MuonCalibSelector.h:80
MuonCalib::MuonCalibSelector::select
SegVec select(const SegVec &segments, const Selection *selection=nullptr) const
select segments satisfying selection.
Definition
MuonCalibSelector.cxx:15
MuonCalib::MuonCalibSelector::SegVec
EventHandler::SegmentVec SegVec
Definition
MuonCalibSelector.h:22
MuonCalib::MuonCalibSelector::TrackVec
EventHandler::TrackVec TrackVec
Definition
MuonCalibSelector.h:23
MuonCalib::MuonCalibSelector::MuonCalibSelector
MuonCalibSelector()
MuonCalib::MuonCalibTrackSummary
Definition
MuonCalibTrackSummary.h:17
selection
const std::string selection
Definition
fbtTestBasics.cxx:75
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
MuonCalib::MuonCalibSelector::SegmentSelection
Definition
MuonCalibSelector.h:41
MuonCalib::MuonCalibSelector::SegmentSelection::hasFittedT0
bool hasFittedT0
Definition
MuonCalibSelector.h:44
MuonCalib::MuonCalibSelector::SegmentSelection::singleML
bool singleML
Definition
MuonCalibSelector.h:46
MuonCalib::MuonCalibSelector::SegmentSelection::twoML
bool twoML
Definition
MuonCalibSelector.h:47
MuonCalib::MuonCalibSelector::Selection
Definition
MuonCalibSelector.h:25
MuonCalib::MuonCalibSelector::TrackSelection
Definition
MuonCalibSelector.h:51
MuonCalib::MuonCalibSelector::TrackSelection::barrelTrack
bool barrelTrack
Definition
MuonCalibSelector.h:53
MuonCalib::MuonCalibSelector::TrackSelection::endcapTrackC
bool endcapTrackC
Definition
MuonCalibSelector.h:55
MuonCalib::MuonCalibSelector::TrackSelection::maxr0
double maxr0
maximum transverse impact parameter wrt I.P.
Definition
MuonCalibSelector.h:56
MuonCalib::MuonCalibSelector::TrackSelection::endcapTrackA
bool endcapTrackA
Definition
MuonCalibSelector.h:54
MuonCalib::MuonCalibSelector::TrackSelection::maxz0
double maxz0
maximum longitudinal impact parameter at I.P.
Definition
MuonCalibSelector.h:57
Generated on
for ATLAS Offline Software by
1.17.0