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);
37 if (mtos[ns1].selected == 2)
continue;
38 for (
unsigned int ns2 = ns1 + 1; ns2 < mtos.size(); ns2++) {
44 for (
unsigned int ns2 = ns1; ns2 < mtos.size(); ns2++) {
46 mtos[ns2].nsegments = nsegments;
47 mtos[ns2].selected = 2;
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);
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;
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);
67 for (
unsigned int ns2 = ns1 + 1; ns2 < mtos.size(); ns2++) {
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);
73 mtos[ns1].selected = 0;
74 mtos[ns1].nsegments = 0;
76 mtos[ns2].selected = 0;
77 mtos[ns2].nsegments = 0;
84 for (
unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
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++) {
90 if (mtos[ns2].selected != 0) nsegments++;
92 for (
unsigned int ns2 = ns1; ns2 < mtos.size(); ns2++) {
94 mtos[ns2].nsegments = nsegments;
95 mtos[ns2].selected = 2;
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);
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);
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);
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);
135 int multiplicity = mtos.size();
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);
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);
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);
173 double pTmax(10000.);
174 double pTcut =
pTmin;
175 if (multiplicity > 100)
177 else if (multiplicity < 10)
180 pTcut = 2 * ((pTmax -
pTmin) / 90.) * multiplicity;
182 for (
unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
185 double OneOverP = std::abs(perigee->parameters()[
Trk::qOverP]);
187 if (OneOverP > 0.0) {
188 pT = sintheta / OneOverP;
190 pT = std::hypot(perigee->momentum()[
Amg::px], perigee->momentum()[
Amg::py]);
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);
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);
216 std::vector<MuonCombined::MuonSegmentInfo> mtosOutput;
217 mtosOutput.reserve(mtos.size());
219 for (
unsigned int ns1 = 0; ns1 < mtos.size(); ns1++) {
220 if (mtos[ns1].nsegments > 0) { mtosOutput.push_back(std::move(mtos[ns1])); }