@@ -14,6 +14,7 @@ MPCoincidenceFilter::MPCoincidenceFilter(const ParameterSet &pset)
1414 debug_(pset.getUntrackedParameter<bool >(" debug" )),
1515 co_option_(pset.getParameter<int >(" co_option" )),
1616 co_quality_(pset.getParameter<int >(" co_quality" )),
17+ co_wh2option_(pset.getParameter<int >(" co_wh2option" )),
1718 scenario_(pset.getParameter<int >(" scenario" )) {}
1819
1920// ============================================================================
@@ -37,7 +38,7 @@ void MPCoincidenceFilter::run(edm::Event &iEvent,
3738 else if (scenario_ == SLICE_TEST)
3839 shift_back = 400 ;
3940
40- auto filteredMPs = filter (inMPaths, allMPaths, co_option_, co_quality_, shift_back);
41+ auto filteredMPs = filter (inMPaths, allMPaths, co_option_, co_quality_, co_wh2option_, shift_back);
4142 for (auto &mp : filteredMPs)
4243 outMPaths.push_back (mp);
4344}
@@ -51,16 +52,17 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
5152 std::vector<metaPrimitive> allMPs,
5253 int co_option,
5354 int co_quality,
55+ int co_wh2option,
5456 double shift_back) {
5557 std::vector<metaPrimitive> outMPs;
5658
5759 for (auto &mp : inMPs) {
5860 DTChamberId chId (mp.rawId );
5961 DTSuperLayerId slId (mp.rawId );
6062
61- bool PhiMP = false ;
63+ bool PhiMP = 0 ;
6264 if (slId.superLayer () != 2 )
63- PhiMP = true ;
65+ PhiMP = 1 ;
6466
6567 int sector = chId.sector ();
6668 int wheel = chId.wheel ();
@@ -70,7 +72,11 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
7072 if (sector == 14 )
7173 sector = 10 ;
7274
73- if (co_option == -1 || mp.quality > 5 )
75+ bool wh2pass = 0 ;
76+ if (abs (wheel)==2 && station==1 && co_wh2option==1 )wh2pass=1 ;
77+ if (abs (wheel)==2 && station<3 && co_wh2option==2 )wh2pass=1 ;
78+
79+ if (co_option == -1 || mp.quality > 5 || wh2pass==1 )
7480 outMPs.push_back (mp);
7581 else {
7682 int sector_p1 = sector + 1 ;
@@ -93,15 +99,15 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
9399 float t0 = (mp.t0 - shift_back * LHC_CLK_FREQ) * ((float )TIME_TO_TDC_COUNTS / (float )LHC_CLK_FREQ);
94100 t0 = t0 - t0_mean;
95101
96- bool co_found = false ;
102+ bool co_found = 0 ;
97103
98104 for (auto &mp2 : allMPs) {
99105 DTChamberId chId2 (mp2.rawId );
100106 DTSuperLayerId slId2 (mp2.rawId );
101107
102- bool PhiMP2 = false ;
108+ bool PhiMP2 = 0 ;
103109 if (slId2.superLayer () != 2 )
104- PhiMP2 = true ;
110+ PhiMP2 = 1 ;
105111
106112 int qcut = co_quality; // Tested for 0,1,5
107113 if (mp.quality > qcut)
@@ -120,15 +126,15 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
120126 if (sector2 == 14 )
121127 sector2 = 10 ;
122128
123- bool SectorSearch = false ;
129+ bool SectorSearch = 0 ;
124130 if (sector2 == sector || sector2 == sector_p1 || sector2 == sector_m1)
125- SectorSearch = true ;
131+ SectorSearch = 1 ;
126132 if (SectorSearch != 1 )
127133 continue ;
128134
129- bool WheelSearch = false ;
135+ bool WheelSearch = 0 ;
130136 if (wheel2 == wheel || wheel2 == wheel - 1 || wheel2 == wheel + 1 )
131- WheelSearch = true ;
137+ WheelSearch = 1 ;
132138 if (WheelSearch != 1 )
133139 continue ;
134140
@@ -147,13 +153,13 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
147153
148154 float thres = t0_width + t0_width2;
149155
150- bool SameCh = false ;
156+ bool SameCh = 0 ;
151157 if (station2 == station && sector2 == sector && wheel2 == wheel)
152- SameCh = true ;
158+ SameCh = 1 ;
153159
154- bool Wh2Exc = false ;
160+ bool Wh2Exc = 0 ;
155161 if (abs (wheel) == 2 && station < 3 && SameCh == 1 )
156- Wh2Exc = true ; // exception for WH2 MB1/2
162+ Wh2Exc = 1 ; // exception for WH2 MB1/2
157163
158164 if (Wh2Exc == 1 && PhiMP != PhiMP2) { // pass if Phi-Th(large k) pair in same chamber
159165 float k = 0 ;
@@ -163,10 +169,10 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
163169 k = mp2.phiB ;
164170
165171 if (wheel == 2 && k > 0.9 ) {
166- co_found = true ;
172+ co_found = 1 ;
167173 break ;
168174 } else if (wheel == -2 && k < -0.9 ) {
169- co_found = true ;
175+ co_found = 1 ;
170176 break ;
171177 }
172178 }
@@ -180,7 +186,7 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
180186 continue ; // Different chambers + not adjacent chambers (standard)
181187
182188 if (abs (t02 - t0) < thres) {
183- co_found = true ;
189+ co_found = 1 ;
184190 break ;
185191 }
186192 } // loop over all MPs and look for co
0 commit comments