10 std::vector<RecHitProcessor::CppfItem> &CppfVec1,
22 for (TrackingGeometry::DetContainer::const_iterator iDet =
23 rpcGeom->
dets().begin();
24 iDet < rpcGeom->
dets().end(); iDet++) {
30 if (dynamic_cast<const RPCChamber *>(*iDet) ==
nullptr)
33 auto chamb =
dynamic_cast<const RPCChamber *
>(*iDet);
35 std::vector<const RPCRoll *> rolls = (chamb->rolls());
38 for (
auto &iRoll : rolls) {
43 RPCRecHitCollection::const_iterator>
45 rangeRecHits recHitCollection = recHits->get(rpcId);
48 for (RPCRecHitCollection::const_iterator rechit_it =
49 recHitCollection.first;
50 rechit_it != recHitCollection.second; rechit_it++) {
53 int rawId = rpcId.
rawId();
55 int Bx = rechit_it->BunchX();
56 int isValid = rechit_it->isValid();
57 int firststrip = rechit_it->firstClusterStrip();
58 int clustersize = rechit_it->clusterSize();
67 int rechitstrip = firststrip;
69 if (clustersize > 2) {
71 if (clustersize % 2 == 0)
72 medium = 0.5 * (clustersize);
74 medium = 0.5 * (clustersize - 1);
75 rechitstrip += medium;
78 if (clustersize > MaxClusterSize)
89 if ((global_phi > 15.) && (global_phi <= 16.3)) {
92 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
95 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
100 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
103 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
106 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
112 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
115 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
118 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
123 else if ((global_phi < -165.) && (global_phi >= -180.)) {
128 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
131 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
134 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
139 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
142 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
145 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
150 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
153 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
156 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
167 double EMTFLink1 = 0.;
168 double EMTFLink2 = 0.;
170 std::vector<RecHitProcessor::CppfItem>::iterator cppf1;
171 std::vector<RecHitProcessor::CppfItem>::iterator cppf;
172 for (cppf1 = CppfVec1.begin(); cppf1 != CppfVec1.end(); cppf1++) {
175 if (((*cppf1).rawId == rawId) && ((*cppf1).strip == rechitstrip)) {
177 int old_strip = (*cppf1).strip;
181 if (cppf1 != CppfVec1.begin())
182 before = (*(cppf1 - 2)).
strip;
184 else if (cppf1 == CppfVec1.begin())
185 before = (*cppf1).strip;
187 if (cppf1 != CppfVec1.end())
188 after = (*(cppf1 + 2)).
strip;
190 else if (cppf1 == CppfVec1.end())
191 after = (*cppf1).strip;
195 if (clustersize == 2) {
197 if (firststrip == 1) {
200 else if (before > after)
202 }
else if (firststrip > 1) {
205 else if (before > after)
211 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(
212 rpcId, Bx, (*cppf).int_phi, (*cppf).int_theta, isValid,
213 (*cppf).lb, (*cppf).halfchannel, EMTFsector1, EMTFLink1,
214 old_strip, clustersize, global_phi, global_theta));
215 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(
216 rpcId, Bx, (*cppf).int_phi, (*cppf).int_theta, isValid,
217 (*cppf).lb, (*cppf).halfchannel, EMTFsector2, EMTFLink2,
218 old_strip, clustersize, global_phi, global_theta));
220 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
221 cppfDigis.push_back(*MainVariables1.get());
222 }
else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
223 cppfDigis.push_back(*MainVariables1.get());
224 cppfDigis.push_back(*MainVariables2.get());
225 }
else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
232 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(
233 rpcId, Bx, (*cppf).int_phi, (*cppf).int_theta, isValid,
234 (*cppf).lb, (*cppf).halfchannel, EMTFsector1, EMTFLink1,
235 old_strip, clustersize, global_phi, global_theta));
236 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(
237 rpcId, Bx, (*cppf).int_phi, (*cppf).int_theta, isValid,
238 (*cppf).lb, (*cppf).halfchannel, EMTFsector2, EMTFLink2,
239 old_strip, clustersize, global_phi, global_theta));
240 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
241 cppfDigis.push_back(*MainVariables1.get());
242 }
else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
243 cppfDigis.push_back(*MainVariables1.get());
244 cppfDigis.push_back(*MainVariables2.get());
245 }
else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
274 for (TrackingGeometry::DetContainer::const_iterator iDet =
275 rpcGeom->
dets().begin();
276 iDet < rpcGeom->
dets().end(); iDet++) {
282 if (dynamic_cast<const RPCChamber *>(*iDet) ==
nullptr)
285 auto chamb =
dynamic_cast<const RPCChamber *
>(*iDet);
286 std::vector<const RPCRoll *> rolls = (chamb->rolls());
289 for (
auto &iRoll : rolls) {
294 RPCRecHitCollection::const_iterator>
296 rangeRecHits recHitCollection = recHits->get(rpcId);
298 for (RPCRecHitCollection::const_iterator rechit_it =
299 recHitCollection.first;
300 rechit_it != recHitCollection.second; rechit_it++) {
304 int region = rpcId.
region();
306 int Bx = rechit_it->BunchX();
307 int isValid = rechit_it->isValid();
308 int firststrip = rechit_it->firstClusterStrip();
309 int clustersize = rechit_it->clusterSize();
320 int int_theta = (region == -1 ? 180. * 32. / 36.5 : 0.) +
321 (
float)region * global_theta * 32. / 36.5 -
325 if (global_theta < 8.5)
327 if (global_theta > 45.)
329 }
else if (region == -1) {
330 if (global_theta < 135.)
332 if (global_theta > 171.5)
337 double local_phi = 0.;
342 if ((global_phi > 15.) && (global_phi <= 16.3)) {
343 local_phi = global_phi - 15.;
346 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
347 local_phi = global_phi - 15.;
350 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
351 local_phi = global_phi - 15.;
356 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
357 local_phi = global_phi - 15.;
360 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
361 local_phi = global_phi - 75.;
364 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
365 local_phi = global_phi - 75.;
371 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
372 local_phi = global_phi - 75.;
375 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
376 local_phi = global_phi - 135.;
379 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
380 local_phi = global_phi - 135.;
385 else if ((global_phi < -165.) && (global_phi >= -180.)) {
386 local_phi = global_phi + 225.;
391 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
392 local_phi = global_phi + 225.;
395 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
396 local_phi = global_phi + 165.;
399 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
400 local_phi = global_phi + 165.;
405 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
406 local_phi = global_phi + 165.;
409 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
410 local_phi = global_phi + 105.;
413 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
414 local_phi = global_phi + 105.;
419 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
420 local_phi = global_phi + 105.;
423 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
424 local_phi = global_phi + 45.;
427 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
428 local_phi = global_phi + 45.;
433 int int_phi =
int((local_phi + 22.0) * 15. + .5);
435 double EMTFLink1 = 0.;
436 double EMTFLink2 = 0.;
438 double halfchannel = 0.;
444 assert(0 <= int_phi && int_phi < 1250);
445 assert(0 <= int_theta && int_theta < 32);
447 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
448 new l1t::CPPFDigi(rpcId, Bx, int_phi, int_theta, isValid, lb,
449 halfchannel, EMTFsector1, EMTFLink1, firststrip,
450 clustersize, global_phi, global_theta));
451 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
452 new l1t::CPPFDigi(rpcId, Bx, int_phi, int_theta, isValid, lb,
453 halfchannel, EMTFsector2, EMTFLink2, firststrip,
454 clustersize, global_phi, global_theta));
457 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
458 cppfDigis.push_back(*MainVariables1.get());
460 if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
461 cppfDigis.push_back(*MainVariables1.get());
462 cppfDigis.push_back(*MainVariables2.get());
464 if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
const Plane & surface() const
The nominal surface of the GeomDet.
Geom::Theta< T > theta() const
C::const_iterator const_iterator
constant access iterator type
void processLook(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::EDGetToken &recHitToken, std::vector< RecHitProcessor::CppfItem > &CppfVec1, l1t::CPPFDigiCollection &cppfDigis, const int MaxClusterSize) const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
void process(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::EDGetToken &recHitToken, l1t::CPPFDigiCollection &cppfDigis) const
double rad_to_deg(double rad)
std::vector< CPPFDigi > CPPFDigiCollection
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.