29 m_rpcDigis{inrpcDigis}
47 rpc_hit(
int pbx,
int pstation,
int psector,
int pwheel,
RPCDetId pdet,
int pstrip,
int proll,
int player) : bx(pbx),
station(pstation),sector(psector),
wheel(pwheel), detid(pdet),
strip(pstrip),roll(proll),layer(player) {}
54 BxToHit(): m_hits{} {}
56 static bool outOfRange(
int iBX) {
57 return (iBX > max_rpc_bx
or iBX < min_rpc_bx);
61 return m_hits[iBX-min_rpc_bx];
64 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 ) {
82 if(detid.
region()!=0 )
continue;
83 if(BxToHit::outOfRange(digi->bx()))
continue;
84 if(detid.
layer()==1) vrpc_hit_layer1.emplace_back(digi->bx(), detid.
station(), detid.
sector(), detid.
ring(), detid, digi->strip(), detid.
roll(), detid.
layer());
86 if(detid.
layer()==2) vrpc_hit_layer2.emplace_back(digi->bx(), detid.
station(), detid.
sector(), detid.
ring(), detid, digi->strip(), detid.
roll(), detid.
layer());
91 vector<int> vcluster_size ;
95 std::map<RPCHitCleaner::detId_Ext, int>
hits;
99 int strip_n1 = -10000;
101 if(detid.
region()!=0 )
continue;
102 for(
auto digi = (*chamber).second.first ; digi != (*chamber).second.second; ++digi ){
103 if(fabs(digi->bx())>3 )
continue;
106 if(
abs(digi->strip()-strip_n1)!=1 || digi->bx()!=bx_n1){
107 if(itr!=0)vcluster_size.push_back(cluster_size);
116 hits[
tmp] = cluster_id;
118 strip_n1 = digi->strip();
122 vcluster_size.push_back(cluster_size);
126 for(
int wh=-2; wh<=2; wh++){
127 for(
int sec=1; sec<=12; sec++){
128 for(
int st=1; st<=4; st++){
130 std::vector<int> delta_phib;
131 bool found_hits =
false;
132 std::vector<int> rpc2dt_phi, rpc2dt_phib;
135 for(
unsigned int l1=0; l1<vrpc_hit_layer1.size(); l1++){
138 int phi1 =
radialAngle(vrpc_hit_layer1[l1].detid, c, vrpc_hit_layer1[l1].
strip) ;
139 if(vcluster_size[
id]==2 && itr1==0) {
143 if(vcluster_size[
id]==2 && itr1==1 ) {
145 phi1 = phi1 + (
radialAngle(vrpc_hit_layer1[l1-1].detid, c, vrpc_hit_layer1[l1-1].strip));
149 for(
unsigned int l2=0; l2<vrpc_hit_layer2.size(); l2++){
150 if(vrpc_hit_layer1[l1].
station!=st || vrpc_hit_layer2[l2].
station!=st )
continue;
151 if(vrpc_hit_layer1[l1].sector!=sec || vrpc_hit_layer2[l2].sector!=sec )
continue;
152 if(vrpc_hit_layer1[l1].
wheel!=wh || vrpc_hit_layer2[l2].
wheel!=wh )
continue;
153 if(vrpc_hit_layer1[l1].bx!=vrpc_hit_layer2[l2].bx )
continue;
157 if(vcluster_size[
id]==2 && itr2==0) {
163 int phi2 =
radialAngle(vrpc_hit_layer2[l2].detid, c, vrpc_hit_layer2[l2].strip) ;
164 if(vcluster_size[
id]==2 && itr2==1) {
166 phi2 = phi2 + (
radialAngle(vrpc_hit_layer2[l2-1].detid, c, vrpc_hit_layer2[l2-1].strip));
169 int average = ( (phi1 + phi2)/2 )<<2;
170 rpc2dt_phi.push_back(average);
176 int xout =
localXX((phi2<<2), 2, vrpc_hit_layer2[l2].station);
177 if(vcluster_size[
id]==2 && itr2==1) {
178 int phi1_n1 =
radialAngle(vrpc_hit_layer1[l1-1].detid, c, vrpc_hit_layer1[l1-1].strip);
179 int phi2_n1 =
radialAngle(vrpc_hit_layer2[l2-1].detid, c, vrpc_hit_layer2[l2-1].strip);
180 xin +=
localXX((phi1_n1<<2), 1, vrpc_hit_layer1[l1].station );
181 xout +=
localXX((phi2_n1<<2), 2, vrpc_hit_layer2[l2].station );
188 rpc2dt_phib.push_back(phi_b);
190 delta_phib.push_back(
abs(phi_b));
192 rpcbx = vrpc_hit_layer1[l1].bx;
197 int min_index =
std::distance(delta_phib.begin(), std::min_element(delta_phib.begin(), delta_phib.end())) + 0;
199 l1ttma_out.emplace_back( rpcbx, wh, sec-1, st, rpc2dt_phi[min_index], rpc2dt_phib[min_index], 3, 0, 0, 2);
205 for(
unsigned int l1=0; l1<vrpc_hit_layer1.size(); l1++){
206 if(vrpc_hit_layer1[l1].
station!=st || st>2 || vrpc_hit_layer1[l1].sector!=sec || vrpc_hit_layer1[l1].
wheel!=wh)
continue;
210 if(vcluster_size[
id]==2 && itr1==0) {
214 int phi2 =
radialAngle(vrpc_hit_layer1[l1].detid, c, vrpc_hit_layer1[l1].
strip);
216 if(vcluster_size[
id]==2 && itr1==1 ) {
218 phi2 = phi2 + (
radialAngle(vrpc_hit_layer1[l1-1].detid, c, vrpc_hit_layer1[l1-1].strip)<<2);
222 l1ttma_hits_out.emplace_back(vrpc_hit_layer1[l1].bx, wh, sec-1, st, phi2, 0, 3, hit[vrpc_hit_layer1[l1].bx], 0, 2);
223 hit[vrpc_hit_layer1[l1].bx]++;
226 for(
unsigned int l2=0; l2<vrpc_hit_layer2.size(); l2++){
227 if(vrpc_hit_layer2[l2].
station!=st || st>2 || vrpc_hit_layer2[l2].sector!=sec || vrpc_hit_layer2[l2].
wheel!=wh)
continue;
231 if(vcluster_size[
id]==2 && itr1==0) {
235 int phi2 =
radialAngle(vrpc_hit_layer2[l2].detid, c, vrpc_hit_layer2[l2].
strip);
237 if(vcluster_size[
id]==2 && itr1==1) {
239 phi2 = phi2 + (
radialAngle(vrpc_hit_layer2[l2-1].detid, c, vrpc_hit_layer2[l2-1].strip)<<2);
242 l1ttma_hits_out.emplace_back( vrpc_hit_layer2[l2].bx, wh, sec-1, st, phi2, 0, 3, hit[vrpc_hit_layer2[l2].bx] , 0, 2);
243 hit[vrpc_hit_layer2[l2].bx]++;
248 for(
unsigned int l1=0; l1<vrpc_hit_st3.size(); l1++){
249 if(st!=3 || vrpc_hit_st3[l1].
station!=3 || vrpc_hit_st3[l1].
wheel!=wh || vrpc_hit_st3[l1].sector!=sec)
continue;
253 if(vcluster_size[
id]==2 && itr1==0) {
259 if(vcluster_size[
id]==2 && itr1==1) {
261 phi2 = phi2 + (
radialAngle(vrpc_hit_st3[l1-1].detid, c, vrpc_hit_st3[l1-1].strip)<<2);
264 l1ttma_hits_out.emplace_back( vrpc_hit_st3[l1].bx, wh, sec-1, st, phi2, 0, 3, hit[vrpc_hit_st3[l1].bx], 0, 2);
265 hit[vrpc_hit_st3[l1].bx]++;
270 for(
unsigned int l1=0; l1<vrpc_hit_st4.size(); l1++){
271 if(st!=4 || vrpc_hit_st4[l1].
station!=4 || vrpc_hit_st4[l1].
wheel!=wh || vrpc_hit_st4[l1].sector!=sec)
continue;
275 if(vcluster_size[
id]==2 && itr1==0) {
281 if(vcluster_size[
id]==2 && itr1==1) {
283 phi2 = phi2 + (
radialAngle(vrpc_hit_st4[l1-1].detid, c, vrpc_hit_st4[l1-1].strip)<<2);
286 l1ttma_hits_out.emplace_back(vrpc_hit_st4[l1].bx, wh, sec-1, st, phi2, 0, 3, hit[vrpc_hit_st4[l1].bx] , 0, 2);
287 hit[vrpc_hit_st4[l1].bx]++;
314 double globalphi = stripPosition.
phi();
315 int sector = (roll->
id()).sector();
316 if ( sector == 1) radialAngle =
int( globalphi*1024 );
318 if ( globalphi >= 0) radialAngle =
int( (globalphi-(sector-1)*
Geom::pi()/6.)*1024 );
319 else radialAngle =
int( (globalphi+(13-sector)*
Geom::pi()/6.)*1024 );
334 float phip1cm = p1cmPRG.
phi();
335 float phim1cm = m1cmPRG.
phi();
336 int direction = (phip1cm-phim1cm)/
abs(phip1cm-phim1cm);
344 int atanv = (
int)(atan((xout-xin)/34.6) * 512);
345 if(atanv>512)
return 512;
346 int rvalue = atanv - phi/8;
352 double R[2][2] = {{410.0,444.8},{492.7,527.3}};
353 double rvalue = R[station-1][layer-1]*
tan(phi/4096.);
LocalPoint centreOfStrip(int strip) const
Point3DBase< Scalar, LocalTag > LocalPoint
static int bendingAngle(int, int, int)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
RPCtoDTTranslator(const RPCDigiCollection &inrpcDigis)
const RPCDigiCollection & m_rpcDigis
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)
T operator[](int i) const
L1MuDTChambPhContainer m_rpchitsdt_translated
void run(const edm::EventSetup &c)
static int radialAngle(RPCDetId, const edm::EventSetup &, int)
function - will be replaced by LUTs(?)
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
std::vector< std::vector< double > > tmp
static int localXX(int, int, int)
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
static int localX(RPCDetId, const edm::EventSetup &, int)
function - will be replaced by LUTs(?)