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)) {
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
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
double rad_to_deg(double rad)
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.