30 {
32
33 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
34 ATH_MSG_DEBUG(
" index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track <<
" stationLayer "
35 << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
36 int nsegments = 1;
37 if (mtos[ns1].selected == 2) continue;
38 for (unsigned int ns2 = ns1 + 1; ns2 < mtos.size(); ns2++) {
39 if (mtos[ns1].track != mtos[ns2].track) break;
40 nsegments++;
41 }
43
44 for (unsigned int ns2 = ns1; ns2 < mtos.size(); ns2++) {
45 if (mtos[ns1].track != mtos[ns2].track) break;
46 mtos[ns2].nsegments = nsegments;
47 mtos[ns2].selected = 2;
48 }
49 ATH_MSG_DEBUG(
" Updated index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track
50 << " stationLayer " << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
51 }
52
53
54 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
55 if (mtos[ns1].selected == 2) mtos[ns1].selected = 1;
56 if (mtos[ns1].nsegments == 1 && mtos[ns1].stationLayer == 21) {
57 mtos[ns1].selected = 0;
58 mtos[ns1].nsegments = 0;
59 }
60 }
61
62
63 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
64 ATH_MSG_DEBUG(
" First pass index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track
65 << " stationLayer " << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
66
67 for (unsigned int ns2 = ns1 + 1; ns2 < mtos.size(); ns2++) {
68 if (mtos[ns1].segment == mtos[ns2].segment ||
ambiguousSegment(ctx, *mtos[ns1].segment, *mtos[ns2].segment)) {
69 double R1 = std::abs(mtos[ns1].pullCY *
Rseg(mtos[ns1].nsegments));
70 double R2 = std::abs(mtos[ns2].pullCY *
Rseg(mtos[ns2].nsegments));
71 ATH_MSG_DEBUG(
" Ambiguous segment at index " << ns1 <<
" and " << ns2);
72 if (R1 > R2) {
73 mtos[ns1].selected = 0;
74 mtos[ns1].nsegments = 0;
75 } else {
76 mtos[ns2].selected = 0;
77 mtos[ns2].nsegments = 0;
78 }
79 }
80 }
81 }
82
83
84 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
85 int nsegments = 1;
86 if (mtos[ns1].selected == 0) nsegments = 0;
87 if (mtos[ns1].selected == 2) continue;
88 for (unsigned int ns2 = ns1 + 1; ns2 < mtos.size(); ns2++) {
89 if (mtos[ns1].track != mtos[ns2].track) break;
90 if (mtos[ns2].selected != 0) nsegments++;
91 }
92 for (unsigned int ns2 = ns1; ns2 < mtos.size(); ns2++) {
93 if (mtos[ns1].track != mtos[ns2].track) break;
94 mtos[ns2].nsegments = nsegments;
95 mtos[ns2].selected = 2;
96 }
97 ATH_MSG_DEBUG(
" Second pass index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track
98 << " stationLayer " << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
100 }
101
102
103 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
104 if (mtos[ns1].selected == 2) mtos[ns1].selected = 1;
105 if (mtos[ns1].nsegments == 1 && mtos[ns1].stationLayer == 21) {
106 mtos[ns1].selected = 0;
107 mtos[ns1].nsegments = 0;
108 ATH_MSG_DEBUG(
" DROP CSC index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track
109 << " stationLayer" << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
110 }
111 }
112
113
114 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
115 if (mtos[ns1].nsegments == 1 && mtos[ns1].nholes > 2) {
116 mtos[ns1].selected = 0;
117 mtos[ns1].nsegments = 0;
118 ATH_MSG_DEBUG(
" DROP HOLES index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track
119 << " stationLayer" << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
120 }
121 }
122
123
125 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
126 if (mtos[ns1].nsegments == 1 && mtos[ns1].minimumPullPhi > 3 && mtos[ns1].hasPhi > 0) {
127 mtos[ns1].selected = 0;
128 mtos[ns1].nsegments = 0;
129 ATH_MSG_DEBUG(
" DROP MatchPhi index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer " << mtos[ns1].track
130 << " stationLayer" << mtos[ns1].stationLayer << " selected " << mtos[ns1].selected);
131 }
132 }
133 }
134
135 int multiplicity = mtos.size();
136
137
138 if (multiplicity > 50) {
139 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
140 if (mtos[ns1].nholes > 1) {
141 mtos[ns1].selected = 0;
142 mtos[ns1].nsegments = 0;
143 ATH_MSG_DEBUG(
" DROP multiplicity 50 index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer "
144 << mtos[ns1].track << " stationLayer" << mtos[ns1].stationLayer << " selected "
145 << mtos[ns1].selected);
146 }
147 }
148 } else if (multiplicity > 30) {
149 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
150 if (mtos[ns1].nholes > 2) {
151 mtos[ns1].selected = 0;
152 mtos[ns1].nsegments = 0;
153 ATH_MSG_DEBUG(
" DROP multiplicity 30 index " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer "
154 << mtos[ns1].track << " stationLayer" << mtos[ns1].stationLayer << " selected "
155 << mtos[ns1].selected);
156 }
157 }
158 }
159
160
161 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
162 if (mtos[ns1].nsegments == 1 && mtos[ns1].nholes > 0 && mtos[ns1].singleML == 1) {
163 mtos[ns1].selected = 0;
164 mtos[ns1].nsegments = 0;
165 ATH_MSG_DEBUG(
" DROP single multilayers single tag " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer "
166 << mtos[ns1].track << " stationLayer" << mtos[ns1].stationLayer
167 << " selected " << mtos[ns1].selected);
168 }
169 }
170
171
173 double pTmax(10000.);
174 double pTcut =
pTmin;
175 if (multiplicity > 100)
176 pTcut = pTmax;
177 else if (multiplicity < 10)
179 else
180 pTcut = 2 * ((pTmax -
pTmin) / 90.) * multiplicity;
181
182 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
184 double sintheta = std::sin(perigee->parameters()[
Trk::theta]);
185 double OneOverP = std::abs(perigee->parameters()[
Trk::qOverP]);
187 if (OneOverP > 0.0) {
188 pT = sintheta / OneOverP;
189 } else {
191 }
192 if (pT < pTcut) {
193 if (mtos[ns1].nsegments == 1 && mtos[ns1].singleML == 1) {
194 mtos[ns1].selected = 0;
195 mtos[ns1].nsegments = 0;
196 ATH_MSG_DEBUG(
" DROP single multilayers low pT " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer "
197 << mtos[ns1].track << " stationLayer" << mtos[ns1].stationLayer
198 << " selected " << mtos[ns1].selected);
199 }
200 }
201 }
202
203
205 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
206 if (mtos[ns1].nsegments == 1 && mtos[ns1].stationLayer == 13) {
207 mtos[ns1].selected = 0;
208 mtos[ns1].nsegments = 0;
209 ATH_MSG_DEBUG(
" DROP single tag OuterEndcap " << ns1 <<
" nsegments " << mtos[ns1].nsegments <<
" track pointer "
210 << mtos[ns1].track << " stationLayer" << mtos[ns1].stationLayer
211 << " selected " << mtos[ns1].selected);
212 }
213 }
214 }
215
216 std::vector<MuonCombined::MuonSegmentInfo> mtosOutput;
217 mtosOutput.reserve(mtos.size());
218
219 for (unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
220 if (mtos[ns1].nsegments > 0) { mtosOutput.push_back(std::move(mtos[ns1])); }
221 }
222
224
225 return mtosOutput;
226}
const Amg::Vector3D & momentum() const
Access method for the momentum.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee