19 std::vector<RecHitProcessor::CppfItem> &CppfVec1,
26 iEvent.getByToken(rpcDigiToken, rpcDigis);
29 iEvent.getByToken(rpcDigiSimLinkToken, theSimlinkDigis);
34 for (
const auto &&rpcdgIt : (*rpcDigis)) {
35 const RPCDetId &rpcId = rpcdgIt.first;
46 for (
const auto &
cl : cls) {
48 int rawId = rpcId.
rawId();
50 const int firststrip =
cl.firstStrip();
51 const int clustersize =
cl.clusterSize();
52 const int laststrip =
cl.lastStrip();
57 const float centreOfCluster = (fstrip + lstrip) / 2;
58 const double y =
cl.hasY() ?
cl.y() : 0;
61 const auto &topo = dynamic_cast<const TrapezoidalStripTopology &>(roll->
topology());
62 const double angle = topo.stripAngle((firststrip + laststrip) / 2.);
72 int rechitstrip = firststrip;
74 if (clustersize > 2) {
76 if (clustersize % 2 == 0)
77 medium = 0.5 * (clustersize);
79 medium = 0.5 * (clustersize - 1);
80 rechitstrip += medium;
93 if ((global_phi > 15.) && (global_phi <= 16.3)) {
96 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
99 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
104 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
107 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
110 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
116 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
119 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
122 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
127 else if ((global_phi < -165.) && (global_phi >= -180.)) {
132 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
135 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
138 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
143 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
146 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
149 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
154 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
157 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
160 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
165 double EMTFLink1 = 0.;
166 double EMTFLink2 = 0.;
167 std::vector<RecHitProcessor::CppfItem>::iterator cppf1;
168 std::vector<RecHitProcessor::CppfItem>::iterator cppf;
169 for (cppf1 = CppfVec1.begin(); cppf1 != CppfVec1.end(); cppf1++) {
171 if (((*cppf1).rawId == rawId) && ((*cppf1).strip == rechitstrip)) {
172 int old_strip = (*cppf1).strip;
176 if (cppf1 != CppfVec1.begin())
177 before = (*(cppf1 - 2)).
strip;
178 else if (cppf1 == CppfVec1.begin())
179 before = (*cppf1).strip;
180 if (cppf1 != CppfVec1.end())
181 after = (*(cppf1 + 2)).
strip;
182 else if (cppf1 == CppfVec1.end())
183 after = (*cppf1).strip;
186 if (clustersize == 2) {
187 if (firststrip == 1) {
190 else if (before > after)
192 }
else if (firststrip > 1) {
195 else if (before > after)
201 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
214 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
228 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
229 cppfDigis.push_back(*MainVariables1.get());
230 }
else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
231 cppfDigis.push_back(*MainVariables1.get());
232 cppfDigis.push_back(*MainVariables2.get());
233 }
else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
240 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
253 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
266 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
267 cppfDigis.push_back(*MainVariables1.get());
268 }
else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
269 cppfDigis.push_back(*MainVariables1.get());
270 cppfDigis.push_back(*MainVariables2.get());
271 }
else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
292 iEvent.getByToken(rpcDigiToken, rpcDigis);
298 for (
const auto &&rpcdgIt : (*rpcDigis)) {
299 const RPCDetId &rpcId = rpcdgIt.first;
310 for (
const auto &
cl : cls) {
315 const int firststrip =
cl.firstStrip();
316 const int clustersize =
cl.clusterSize();
317 const int laststrip =
cl.lastStrip();
322 const float centreOfCluster = (fstrip + lstrip) / 2;
323 const double y =
cl.hasY() ?
cl.y() : 0;
326 const auto &topo = dynamic_cast<const TrapezoidalStripTopology &>(roll->
topology());
327 const double angle = topo.stripAngle((firststrip + laststrip) / 2.);
339 (
region == -1 ? 180. * 32. / 36.5 : 0.) + (
float)
region * global_theta * 32. / 36.5 - 8.5 * 32 / 36.5;
341 if (global_theta < 8.5)
343 if (global_theta > 45.)
345 }
else if (
region == -1) {
346 if (global_theta < 135.)
348 if (global_theta > 171.5)
352 double local_phi = 0.;
357 if ((global_phi > 15.) && (global_phi <= 16.3)) {
358 local_phi = global_phi - 15.;
361 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
362 local_phi = global_phi - 15.;
365 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
366 local_phi = global_phi - 15.;
371 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
372 local_phi = global_phi - 15.;
375 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
376 local_phi = global_phi - 75.;
379 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
380 local_phi = global_phi - 75.;
386 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
387 local_phi = global_phi - 75.;
390 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
391 local_phi = global_phi - 135.;
394 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
395 local_phi = global_phi - 135.;
400 else if ((global_phi < -165.) && (global_phi >= -180.)) {
401 local_phi = global_phi + 225.;
406 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
407 local_phi = global_phi + 225.;
410 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
411 local_phi = global_phi + 165.;
414 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
415 local_phi = global_phi + 165.;
420 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
421 local_phi = global_phi + 165.;
424 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
425 local_phi = global_phi + 105.;
428 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
429 local_phi = global_phi + 105.;
434 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
435 local_phi = global_phi + 105.;
438 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
439 local_phi = global_phi + 45.;
442 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
443 local_phi = global_phi + 45.;
448 int int_phi =
int((local_phi + 22.0) * 15. + .5);
449 double EMTFLink1 = 0.;
450 double EMTFLink2 = 0.;
452 double halfchannel = 0.;
458 assert(0 <= int_phi && int_phi < 1250);
459 assert(0 <= int_theta && int_theta < 32);
461 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
474 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
489 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
490 cppfDigis.push_back(*MainVariables1.get());
492 if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
493 cppfDigis.push_back(*MainVariables1.get());
494 cppfDigis.push_back(*MainVariables2.get());
496 if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {