32 constexpr
int max_rpc_bx = 2;
33 constexpr
int min_rpc_bx = -2;
44 rpc_hit(
int pbx,
int pstation,
int psector,
int pwheel,
RPCDetId pdet,
int pstrip,
int proll,
int player)
59 BxToHit() : m_hits{} {}
61 static bool outOfRange(
int iBX) {
return (iBX > max_rpc_bx
or iBX < min_rpc_bx); }
63 int&
operator[](
int iBX) {
return m_hits[iBX - min_rpc_bx]; }
65 size_t size()
const {
return m_hits.size(); }
73 std::vector<L1MuDTChambPhDigi> l1ttma_out;
74 std::vector<L1MuDTChambPhDigi> l1ttma_hits_out;
76 std::vector<rpc_hit> vrpc_hit_layer1, vrpc_hit_layer2, vrpc_hit_st3, vrpc_hit_st4;
81 for (
auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
84 if (BxToHit::outOfRange(digi->bx()))
86 if (detid.
layer() == 1)
87 vrpc_hit_layer1.emplace_back(digi->bx(),
96 vrpc_hit_st3.emplace_back(digi->bx(),
104 if (detid.
layer() == 2)
105 vrpc_hit_layer2.emplace_back(digi->bx(),
114 vrpc_hit_st4.emplace_back(digi->bx(),
125 vector<int> vcluster_size;
129 std::map<RPCHitCleaner::detId_Ext, int>
hits;
130 int cluster_size = 0;
133 int strip_n1 = -10000;
137 for (
auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
138 if (fabs(digi->bx()) > 3)
142 if (
abs(digi->strip() - strip_n1) != 1 || digi->bx() != bx_n1) {
144 vcluster_size.push_back(cluster_size);
155 strip_n1 = digi->strip();
159 vcluster_size.push_back(cluster_size);
161 for (
int wh = -2; wh <= 2; wh++) {
163 for (
int st = 1; st <= 4; st++) {
165 std::vector<int> delta_phib;
166 bool found_hits =
false;
167 std::vector<int> rpc2dt_phi, rpc2dt_phib;
170 for (
unsigned int l1 = 0; l1 < vrpc_hit_layer1.size(); l1++) {
173 int phi1 =
radialAngle(vrpc_hit_layer1[l1].detid, rpcGeometry, vrpc_hit_layer1[l1].
strip);
174 if (vcluster_size[
id] == 2 && itr1 == 0) {
178 if (vcluster_size[
id] == 2 && itr1 == 1) {
180 phi1 = phi1 + (
radialAngle(vrpc_hit_layer1[l1 - 1].detid, rpcGeometry, vrpc_hit_layer1[l1 - 1].
strip));
184 for (
unsigned int l2 = 0; l2 < vrpc_hit_layer2.size(); l2++) {
185 if (vrpc_hit_layer1[l1].
station != st || vrpc_hit_layer2[l2].
station != st)
189 if (vrpc_hit_layer1[l1].
wheel != wh || vrpc_hit_layer2[l2].
wheel != wh)
191 if (vrpc_hit_layer1[l1].
bx != vrpc_hit_layer2[l2].
bx)
196 if (vcluster_size[
id] == 2 && itr2 == 0) {
202 int phi2 =
radialAngle(vrpc_hit_layer2[l2].detid, rpcGeometry, vrpc_hit_layer2[l2].
strip);
203 if (vcluster_size[
id] == 2 && itr2 == 1) {
205 phi2 = phi2 + (
radialAngle(vrpc_hit_layer2[l2 - 1].detid, rpcGeometry, vrpc_hit_layer2[l2 - 1].
strip));
216 if (vcluster_size[
id] == 2 && itr2 == 1) {
217 int phi1_n1 =
radialAngle(vrpc_hit_layer1[l1 - 1].detid, rpcGeometry, vrpc_hit_layer1[l1 - 1].
strip);
218 int phi2_n1 =
radialAngle(vrpc_hit_layer2[l2 - 1].detid, rpcGeometry, vrpc_hit_layer2[l2 - 1].
strip);
227 rpc2dt_phib.push_back(phi_b);
229 delta_phib.push_back(
abs(phi_b));
231 rpcbx = vrpc_hit_layer1[l1].bx;
236 int min_index =
std::distance(delta_phib.begin(), std::min_element(delta_phib.begin(), delta_phib.end())) + 0;
238 l1ttma_out.emplace_back(rpcbx, wh,
sec - 1, st, rpc2dt_phi[min_index], rpc2dt_phib[min_index], 3, 0, 0, 2);
243 for (
unsigned int l1 = 0; l1 < vrpc_hit_layer1.size(); l1++) {
244 if (vrpc_hit_layer1[l1].
station != st || st > 2 || vrpc_hit_layer1[l1].
sector !=
sec ||
245 vrpc_hit_layer1[l1].
wheel != wh)
250 if (vcluster_size[
id] == 2 && itr1 == 0) {
254 int phi2 =
radialAngle(vrpc_hit_layer1[l1].detid, rpcGeometry, vrpc_hit_layer1[l1].
strip);
256 if (vcluster_size[
id] == 2 && itr1 == 1) {
260 radialAngle(vrpc_hit_layer1[l1 - 1].detid, rpcGeometry, vrpc_hit_layer1[l1 - 1].
strip), 2);
264 l1ttma_hits_out.emplace_back(
265 vrpc_hit_layer1[l1].
bx, wh,
sec - 1, st, phi2, 0, 3,
hit[vrpc_hit_layer1[l1].
bx], 0, 2);
266 hit[vrpc_hit_layer1[l1].bx]++;
269 for (
unsigned int l2 = 0; l2 < vrpc_hit_layer2.size(); l2++) {
270 if (vrpc_hit_layer2[l2].
station != st || st > 2 || vrpc_hit_layer2[l2].
sector !=
sec ||
271 vrpc_hit_layer2[l2].
wheel != wh)
276 if (vcluster_size[
id] == 2 && itr1 == 0) {
280 int phi2 =
radialAngle(vrpc_hit_layer2[l2].detid, rpcGeometry, vrpc_hit_layer2[l2].
strip);
282 if (vcluster_size[
id] == 2 && itr1 == 1) {
286 radialAngle(vrpc_hit_layer2[l2 - 1].detid, rpcGeometry, vrpc_hit_layer2[l2 - 1].
strip), 2);
289 l1ttma_hits_out.emplace_back(
290 vrpc_hit_layer2[l2].
bx, wh,
sec - 1, st, phi2, 0, 3,
hit[vrpc_hit_layer2[l2].
bx], 0, 2);
291 hit[vrpc_hit_layer2[l2].bx]++;
295 for (
unsigned int l1 = 0; l1 < vrpc_hit_st3.size(); l1++) {
296 if (st != 3 || vrpc_hit_st3[l1].
station != 3 || vrpc_hit_st3[l1].
wheel != wh ||
302 if (vcluster_size[
id] == 2 && itr1 == 0) {
306 int phi2 =
radialAngle(vrpc_hit_st3[l1].detid, rpcGeometry, vrpc_hit_st3[l1].
strip);
308 if (vcluster_size[
id] == 2 && itr1 == 1) {
314 l1ttma_hits_out.emplace_back(
315 vrpc_hit_st3[l1].
bx, wh,
sec - 1, st, phi2, 0, 3,
hit[vrpc_hit_st3[l1].
bx], 0, 2);
316 hit[vrpc_hit_st3[l1].bx]++;
320 for (
unsigned int l1 = 0; l1 < vrpc_hit_st4.size(); l1++) {
321 if (st != 4 || vrpc_hit_st4[l1].
station != 4 || vrpc_hit_st4[l1].
wheel != wh ||
327 if (vcluster_size[
id] == 2 && itr1 == 0) {
331 int phi2 =
radialAngle(vrpc_hit_st4[l1].detid, rpcGeometry, vrpc_hit_st4[l1].
strip);
333 if (vcluster_size[
id] == 2 && itr1 == 1) {
339 l1ttma_hits_out.emplace_back(
340 vrpc_hit_st4[l1].
bx, wh,
sec - 1, st, phi2, 0, 3,
hit[vrpc_hit_st4[l1].
bx], 0, 2);
341 hit[vrpc_hit_st4[l1].bx]++;
363 double globalphi = stripPosition.
phi();
383 float phip1cm = p1cmPRG.
phi();
384 float phim1cm = m1cmPRG.
phi();
385 int direction = (phip1cm - phim1cm) /
abs(phip1cm - phim1cm);
393 int atanv = (
int)(atan((xout - xin) / 34.6) * 512);
396 int rvalue = atanv -
phi / 8;
402 double R[2][2] = {{410.0, 444.8}, {492.7, 527.3}};
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Point3DBase< Scalar, LocalTag > LocalPoint
static int bendingAngle(int, int, int)
Geom::Phi< T > phi() const
RPCtoDTTranslator(const RPCDigiCollection &inrpcDigis)
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
static int localX(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
const RPCDigiCollection & m_rpcDigis
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
void setContainer(Phi_Container inputSegments)
L1MuDTChambPhContainer m_rpcdt_translated
Output PhContainer.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
void run(const RPCGeometry &)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
L1MuDTChambPhContainer m_rpchitsdt_translated
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
static int localXX(int, int, int)
T operator[](int i) const
static int radialAngle(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
int bitShift(int num, int bits)
LocalPoint centreOfStrip(int strip) const