21 std::vector<RecHitProcessor::CppfItem> &CppfVec1,
28 iEvent.getByToken(rpcDigiToken, rpcDigis);
31 iEvent.getByToken(rpcDigiSimLinkToken, theSimlinkDigis);
33 const auto &rpcGeom = iSetup.
getData(rpcGeomToken);
35 for (
const auto &&rpcdgIt : (*rpcDigis)) {
36 const RPCDetId &rpcId = rpcdgIt.first;
47 for (
const auto &
cl : cls) {
51 const int firststrip =
cl.firstStrip();
52 const int clustersize =
cl.clusterSize();
53 const int laststrip =
cl.lastStrip();
56 const float fstrip = (
roll->centreOfStrip(firststrip)).
x();
57 const float lstrip = (
roll->centreOfStrip(laststrip)).
x();
58 const float centreOfCluster = (fstrip + lstrip) / 2;
59 const double y =
cl.hasY() ?
cl.y() : 0;
61 if (
roll->id().region() != 0) {
63 const double angle = topo.stripAngle((firststrip + laststrip) / 2.);
73 int rechitstrip = firststrip;
75 if (clustersize > 2) {
77 if (clustersize % 2 == 0)
78 medium = 0.5 * (clustersize);
80 medium = 0.5 * (clustersize - 1);
81 rechitstrip += medium;
94 if ((global_phi > 15.) && (global_phi <= 16.3)) {
97 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
100 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
105 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
108 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
111 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
117 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
120 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
123 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
128 else if ((global_phi < -165.) && (global_phi >= -180.)) {
133 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
136 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
139 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
144 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
147 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
150 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
155 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
158 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
161 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
166 double EMTFLink1 = 0.;
167 double EMTFLink2 = 0.;
168 std::vector<RecHitProcessor::CppfItem>::iterator cppf1;
169 std::vector<RecHitProcessor::CppfItem>::iterator cppf;
170 for (cppf1 = CppfVec1.begin(); cppf1 != CppfVec1.end(); cppf1++) {
172 if (((*cppf1).rawId ==
rawId) && ((*cppf1).strip == rechitstrip)) {
173 int old_strip = (*cppf1).strip;
177 if (cppf1 != CppfVec1.begin())
178 before = (*(cppf1 - 2)).
strip;
179 else if (cppf1 == CppfVec1.begin())
180 before = (*cppf1).strip;
181 if (cppf1 != CppfVec1.end())
182 after = (*(cppf1 + 2)).
strip;
183 else if (cppf1 == CppfVec1.end())
184 after = (*cppf1).strip;
187 if (clustersize == 2) {
188 if (firststrip == 1) {
191 else if (before > after)
193 }
else if (firststrip > 1) {
196 else if (before > after)
202 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
215 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
229 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
230 cppfDigis.push_back(*MainVariables1.get());
231 }
else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
232 cppfDigis.push_back(*MainVariables1.get());
233 cppfDigis.push_back(*MainVariables2.get());
234 }
else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
241 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
254 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
267 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
268 cppfDigis.push_back(*MainVariables1.get());
269 }
else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
270 cppfDigis.push_back(*MainVariables1.get());
271 cppfDigis.push_back(*MainVariables2.get());
272 }
else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
290 const auto &rpcGeom = iSetup.
getData(rpcGeomToken);
293 iEvent.getByToken(rpcDigiToken, rpcDigis);
299 for (
const auto &&rpcdgIt : (*rpcDigis)) {
300 const RPCDetId &rpcId = rpcdgIt.first;
311 for (
const auto &
cl : cls) {
316 const int firststrip =
cl.firstStrip();
317 const int clustersize =
cl.clusterSize();
318 const int laststrip =
cl.lastStrip();
321 const float fstrip = (
roll->centreOfStrip(firststrip)).
x();
322 const float lstrip = (
roll->centreOfStrip(laststrip)).
x();
323 const float centreOfCluster = (fstrip + lstrip) / 2;
324 const double y =
cl.hasY() ?
cl.y() : 0;
326 if (
roll->id().region() != 0) {
328 const double angle = topo.stripAngle((firststrip + laststrip) / 2.);
340 (
region == -1 ? 180. * 32. / 36.5 : 0.) + (
float)
region * global_theta * 32. / 36.5 - 8.5 * 32 / 36.5;
342 if (global_theta < 8.5)
344 if (global_theta > 45.)
346 }
else if (
region == -1) {
347 if (global_theta < 135.)
349 if (global_theta > 171.5)
353 double local_phi = 0.;
358 if ((global_phi > 15.) && (global_phi <= 16.3)) {
359 local_phi = global_phi - 15.;
362 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
363 local_phi = global_phi - 15.;
366 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
367 local_phi = global_phi - 15.;
372 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
373 local_phi = global_phi - 15.;
376 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
377 local_phi = global_phi - 75.;
380 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
381 local_phi = global_phi - 75.;
387 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
388 local_phi = global_phi - 75.;
391 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
392 local_phi = global_phi - 135.;
395 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
396 local_phi = global_phi - 135.;
401 else if ((global_phi < -165.) && (global_phi >= -180.)) {
402 local_phi = global_phi + 225.;
407 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
408 local_phi = global_phi + 225.;
411 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
412 local_phi = global_phi + 165.;
415 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
416 local_phi = global_phi + 165.;
421 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
422 local_phi = global_phi + 165.;
425 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
426 local_phi = global_phi + 105.;
429 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
430 local_phi = global_phi + 105.;
435 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
436 local_phi = global_phi + 105.;
439 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
440 local_phi = global_phi + 45.;
443 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
444 local_phi = global_phi + 45.;
449 int int_phi =
int((local_phi + 22.0) * 15. + .5);
450 double EMTFLink1 = 0.;
451 double EMTFLink2 = 0.;
453 double halfchannel = 0.;
459 assert(0 <= int_phi && int_phi < 1250);
460 assert(0 <= int_theta && int_theta < 32);
462 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
475 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
490 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
491 cppfDigis.push_back(*MainVariables1.get());
493 if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
494 cppfDigis.push_back(*MainVariables1.get());
495 cppfDigis.push_back(*MainVariables2.get());
497 if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
Point3DBase< Scalar, LocalTag > LocalPoint
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Geom::Phi< T > phi() const
CPPFClusterContainer doAction(const RPCDigiCollection::Range &digiRange)
std::set< CPPFCluster > CPPFClusterContainer
Tan< T >::type tan(const T &t)
void process(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::EDGetToken &recHitToken, const edm::EDGetToken &rpcDigiToken, const edm::EDGetToken &rpcDigiSimLinkToken, const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > &rpcGeomToken, l1t::CPPFDigiCollection &cppfDigis) const
CPPFClusterContainer doAction(const RPCDetId &id, CPPFClusterContainer &initClusters, const CPPFRollMask &mask) const
constexpr uint32_t rawId() const
get the raw id
std::pair< const_iterator, const_iterator > Range
std::bitset< maskCPPFSIZE > CPPFRollMask
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
double rad_to_deg(double rad)
T1 value() const
Explicit access to value in case implicit conversion not OK.
void processLook(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::EDGetToken &recHitToken, const edm::EDGetToken &rpcDigiToken, const edm::EDGetToken &rpcDigiSimLinkToken, const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > &rpcGeomToken, std::vector< RecHitProcessor::CppfItem > &CppfVec1, l1t::CPPFDigiCollection &cppfDigis, const int MaxClusterSize) const
std::vector< CPPFDigi > CPPFDigiCollection
Geom::Theta< T > theta() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)