10 std::vector<RecHitProcessor::CppfItem> &CppfVec1,
22 for (TrackingGeometry::DetContainer::const_iterator iDet = rpcGeom->
dets().begin(); iDet < rpcGeom->
dets().end();
28 if (dynamic_cast<const RPCChamber *>(*iDet) ==
nullptr)
31 auto chamb =
dynamic_cast<const RPCChamber *
>(*iDet);
33 std::vector<const RPCRoll *> rolls = (chamb->rolls());
36 for (
auto &iRoll : rolls) {
39 typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
40 rangeRecHits recHitCollection = recHits->get(rpcId);
46 int rawId = rpcId.
rawId();
48 int Bx = rechit_it->BunchX();
49 int isValid = rechit_it->isValid();
50 int firststrip = rechit_it->firstClusterStrip();
51 int clustersize = rechit_it->clusterSize();
60 int rechitstrip = firststrip;
62 if (clustersize > 2) {
64 if (clustersize % 2 == 0)
65 medium = 0.5 * (clustersize);
67 medium = 0.5 * (clustersize - 1);
68 rechitstrip += medium;
71 if (clustersize > MaxClusterSize)
82 if ((global_phi > 15.) && (global_phi <= 16.3)) {
85 }
else if ((global_phi > 16.3) && (global_phi <= 53.)) {
88 }
else if ((global_phi > 53.) && (global_phi <= 75.)) {
93 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
96 }
else if ((global_phi > 76.3) && (global_phi <= 113.)) {
99 }
else if ((global_phi > 113.) && (global_phi <= 135.)) {
105 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
108 }
else if ((global_phi > 136.3) && (global_phi <= 173.)) {
111 }
else if ((global_phi > 173.) && (global_phi <= 180.)) {
116 else if ((global_phi < -165.) && (global_phi >= -180.)) {
121 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
124 }
else if ((global_phi > -163.7) && (global_phi <= -127.)) {
127 }
else if ((global_phi > -127.) && (global_phi <= -105.)) {
132 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
135 }
else if ((global_phi > -103.7) && (global_phi <= -67.)) {
138 }
else if ((global_phi > -67.) && (global_phi <= -45.)) {
143 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
146 }
else if ((global_phi > -43.7) && (global_phi <= -7.)) {
149 }
else if ((global_phi > -7.) && (global_phi <= 15.)) {
160 double EMTFLink1 = 0.;
161 double EMTFLink2 = 0.;
163 std::vector<RecHitProcessor::CppfItem>::iterator cppf1;
164 std::vector<RecHitProcessor::CppfItem>::iterator cppf;
165 for (cppf1 = CppfVec1.begin(); cppf1 != CppfVec1.end(); cppf1++) {
167 if (((*cppf1).rawId == rawId) && ((*cppf1).strip == rechitstrip)) {
168 int old_strip = (*cppf1).strip;
172 if (cppf1 != CppfVec1.begin())
173 before = (*(cppf1 - 2)).
strip;
175 else if (cppf1 == CppfVec1.begin())
176 before = (*cppf1).strip;
178 if (cppf1 != CppfVec1.end())
179 after = (*(cppf1 + 2)).
strip;
181 else if (cppf1 == CppfVec1.end())
182 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)) {
299 for (TrackingGeometry::DetContainer::const_iterator iDet = rpcGeom->
dets().begin(); iDet < rpcGeom->
dets().end();
305 if (dynamic_cast<const RPCChamber *>(*iDet) ==
nullptr)
308 auto chamb =
dynamic_cast<const RPCChamber *
>(*iDet);
309 std::vector<const RPCRoll *> rolls = (chamb->rolls());
312 for (
auto &iRoll : rolls) {
315 typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
316 rangeRecHits recHitCollection = recHits->get(rpcId);
324 int Bx = rechit_it->BunchX();
325 int isValid = rechit_it->isValid();
326 int firststrip = rechit_it->firstClusterStrip();
327 int clustersize = rechit_it->clusterSize();
338 (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)
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);
451 double EMTFLink1 = 0.;
452 double EMTFLink2 = 0.;
454 double halfchannel = 0.;
460 assert(0 <= int_phi && int_phi < 1250);
461 assert(0 <= int_theta && int_theta < 32);
463 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId,
476 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId,
491 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)) {
492 cppfDigis.push_back(*MainVariables1.get());
494 if ((EMTFsector1 > 0) && (EMTFsector2 > 0)) {
495 cppfDigis.push_back(*MainVariables1.get());
496 cppfDigis.push_back(*MainVariables2.get());
498 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
T1 value() const
Explicit access to value in case implicit conversion not OK.
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.