@@ -60,7 +60,7 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
6060
6161 bool PhiMP = 0 ;
6262 if (slId.superLayer () != 2 )
63- PhiMP = 1 ;
63+ PhiMP = 1 ;
6464
6565 int sector = chId.sector ();
6666 int wheel = chId.wheel ();
@@ -70,8 +70,8 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
7070 if (sector == 14 )
7171 sector = 10 ;
7272
73- if (( abs (wheel) == 2 && station == 1 ) || mp.quality > 5 || co_option == - 1 )
74- outMPs.push_back (mp); // DM
73+ if (co_option == - 1 || mp.quality > 5 )
74+ outMPs.push_back (mp);
7575 else {
7676 int sector_p1 = sector + 1 ;
7777 int sector_m1 = sector - 1 ;
@@ -101,15 +101,14 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
101101
102102 bool PhiMP2 = 0 ;
103103 if (slId2.superLayer () != 2 )
104- PhiMP2 = 1 ;
104+ PhiMP2 = 1 ;
105105
106- if (co_option == 1 && PhiMP2 == 0 )
107- continue ; // Phi Only
108- else if (co_option == 2 && PhiMP2 == 1 )
109- continue ; // Theta Only
110-
111- if (!(mp2.quality > co_quality))
112- continue ; // MP Quality with Q 0, 1, 5
106+ int qcut = co_quality; // Tested for 0,1,5
107+ if (mp.quality > qcut) qcut = 0 ; // Filter High Quality WRT any Quality
108+ if (PhiMP2==0 && qcut > 2 ) qcut = 2 ; // For Th TP max quality is 3 (4-hit)
109+
110+ if (!(mp2.quality > qcut))
111+ continue ;
113112
114113 int sector2 = chId2.sector ();
115114 int wheel2 = chId2.wheel ();
@@ -119,9 +118,6 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
119118 if (sector2 == 14 )
120119 sector2 = 10 ;
121120
122- if (station2 == station)
123- continue ;
124-
125121 bool SectorSearch = 0 ;
126122 if (sector2 == sector || sector2 == sector_p1 || sector2 == sector_m1)
127123 SectorSearch = 1 ;
@@ -147,7 +143,39 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
147143 float t02 = (mp2.t0 - shift_back * LHC_CLK_FREQ) * ((float )TIME_TO_TDC_COUNTS / (float )LHC_CLK_FREQ);
148144 t02 = t02 - t0_mean2;
149145
150- float thres = t0_width + t0_width2;
146+ float thres = t0_width + t0_width2;
147+
148+ bool SameCh = 0 ;
149+ if (station2 == station && sector2 == sector && wheel2 == wheel)
150+ SameCh = 1 ;
151+
152+ bool Wh2Exc = 0 ;
153+ if (abs (wheel)==2 && station<3 && SameCh==1 )
154+ Wh2Exc = 1 ; // exception for WH2 MB1/2
155+
156+ if (Wh2Exc==1 && PhiMP!=PhiMP2){// pass if Phi-Th(large k) pair in same chamber
157+ float k = 0 ;
158+ if (PhiMP==0 )
159+ k = mp.phiB ;
160+ else
161+ k = mp2.phiB ;
162+
163+ if (wheel==2 && k>0.9 ){
164+ co_found = 1 ;
165+ break ;
166+ }else if (wheel==-2 && k<-0.9 ){
167+ co_found = 1 ;
168+ break ;
169+ }
170+ }
171+
172+ if (co_option == 1 && PhiMP2 == 0 )
173+ continue ; // Phi Only
174+ else if (co_option == 2 && PhiMP2 == 1 )
175+ continue ; // Theta Only
176+
177+ if (station2 == station)continue ; // Different chambers + not adjacent chambers (standard)
178+
151179 if (abs (t02 - t0) < thres) {
152180 co_found = 1 ;
153181 break ;
0 commit comments