11 using namespace cmsdt;
14 : m_debug_(
pset.getUntrackedParameter<
bool>(
"debug")),
15 m_max_quality_to_overwrite_t0_(
pset.getParameter<
int>(
"max_quality_to_overwrite_t0")),
16 m_bx_window_(
pset.getParameter<
int>(
"bx_window")),
17 m_phi_window_(
pset.getParameter<double>(
"phi_window")),
18 m_storeAllRPCHits_(
pset.getParameter<
bool>(
"storeAllRPCHits")) {
20 LogDebug(
"RPCIntegrator") <<
"RPCIntegrator constructor";
28 LogDebug(
"RPCIntegrator") <<
"RPCIntegrator destructor";
33 LogDebug(
"RPCIntegrator") <<
"RPCIntegrator initialisation";
36 LogDebug(
"RPCIntegrator") <<
"Getting RPC geometry";
57 int rpc_region = rpcDetId.
region();
68 for (
auto dt_metaprimitive = dt_metaprimitives.begin(); dt_metaprimitive != dt_metaprimitives.end();
71 if (bestMatch_rpcRecHit) {
75 (*dt_metaprimitive).rpcFlag =
RPC_TIME;
82 std::vector<L1Phase2MuDTPhDigi> rpc_only_segments;
84 RPCDetId rpc_id_l1 = rpc_mp_it_layer1.rpc_id;
85 const RPCRecHit* rpc_cluster_l1 = rpc_mp_it_layer1.rpc_cluster;
86 GlobalPoint rpc_gp_l1 = rpc_mp_it_layer1.global_position;
96 RPCDetId rpc_id_l2 = rpc_mp_it_layer2.rpc_id;
97 const RPCRecHit* rpc_cluster_l2 = rpc_mp_it_layer2.rpc_cluster;
98 GlobalPoint rpc_gp_l2 = rpc_mp_it_layer2.global_position;
105 float tmp_dPhi = rpc_gp_l1.
phi() - rpc_gp_l2.
phi();
108 bestMatch_rpc_mp_layer2 = &rpc_mp_it_layer2;
112 if (bestMatch_rpc_mp_layer2) {
116 bestMatch_rpc_mp_layer2->
rpcFlag = 6;
117 double phiB =
phiBending(&rpc_mp_it_layer1, &*bestMatch_rpc_mp_layer2);
119 double global_phi = rpc_mp_it_layer1.global_position.phi();
120 double t0 = (rpc_mp_it_layer1.rpc_t0 + bestMatch_rpc_mp_layer2->
rpc_t0) / 2;
124 rpc_only_segments.push_back(rpc_only_segment);
132 RPCDetId rpcDetId = rpc_mp_it->rpc_id;
133 if (rpc_mp_it->rpcFlag == 6)
136 rpcDetId, rpc_mp_it->rpc_bx, rpc_mp_it->rpc_t0, rpc_mp_it->global_position.phi(), -10000, rpc_mp_it->rpcFlag);
143 LogDebug(
"RPCIntegrator") <<
"RPCIntegrator removeRPCHitsUsed method";
149 if (rpcRecHit_translated_->rpcFlag() ==
RPC_ASSOCIATE || rpcRecHit_translated_->rpcFlag() == 6) {
152 ++rpcRecHit_translated_;
164 int dt_sector = dt_chId.
sector();
172 RPCDetId rpc_det_id = rpc_mp_it->rpc_id;
184 bestMatch_rpcRecHit = &*rpc_mp_it;
188 if (bestMatch_rpcRecHit) {
191 return bestMatch_rpcRecHit;
195 RPCDetId rpcDetId,
int rpc_bx,
double rpc_time,
double rpc_global_phi,
double phiB,
int rpc_flag) {
197 LogDebug(
"RPCIntegrator") <<
"Creating DT TP out of RPC recHits";
198 int rpc_wheel = rpcDetId.
ring();
199 int trigger_sector = rpcDetId.
sector() - 1;
200 int rpc_station = rpcDetId.
station();
201 int rpc_layer = rpcDetId.
layer();
204 int rpc_quality = -1;
225 double average_x = (lp_rpc_hit_1_dtconv.x() + lp_rpc_hit_2_dtconv.
x()) / 2;
235 double rpc_localDT_phi;
237 return (
int)round(rpc_localDT_phi);
244 return rpc_global_phi;
247 if (rpc_global_phi >= 0)
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
int station() const
Return the station number.
void storeRPCSingleHits()
Point3DBase< Scalar, LocalTag > LocalPoint
constexpr float PHIBRES_CONV
LocalPoint localPosition() const override
Return the 3-dimensional local position.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
int m_max_quality_to_overwrite_t0_
Geom::Phi< T > phi() const
static const double slope[3]
void matchWithDTAndUseRPCTime(std::vector< cmsdt::metaPrimitive > &dt_metaprimitives)
L1Phase2MuDTPhDigi createL1Phase2MuDTPhDigi(RPCDetId rpcDetId, int rpc_bx, double rpc_time, double rpc_global_phi, double phiB, int rpc_flag)
double phi_DT_MP_conv(double rpc_global_phi, int rpcSector)
std::vector< RPCMetaprimitive > RPCMetaprimitives_
std::map< std::string, int, std::less< std::string > > psi
RPCGeometry const * rpcGeo_
GlobalPoint RPCGlobalPosition(RPCDetId rpcId, const RPCRecHit &rpcIt) const
Abs< T >::type abs(const T &t)
void makeRPCOnlySegments()
RPCIntegrator(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
void conversion(EventAux const &from, EventAuxiliary &to)
const Plane & surface() const
The nominal surface of the GeomDet.
static constexpr double distance_between_two_rpc_layers_
std::vector< L1Phase2MuDTPhDigi > rpcRecHits_translated_
constexpr int LHC_CLK_FREQ
bool hasPosRF_rpc(int wh, int sec) const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
void prepareMetaPrimitives(edm::Handle< RPCRecHitCollection > rpcRecHits)
double phiBending(RPCMetaprimitive *rpc_hit_1, RPCMetaprimitive *rpc_hit_2)
int wheel() const
Return the wheel number.
int phiInDTTPFormat(double rpc_global_phi, int rpcSector)
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH_
void initialise(const edm::EventSetup &iEventSetup, double shift_back_fromDT)
const GeomDet * idToDet(DetId) const override
RPCMetaprimitive * matchDTwithRPC(cmsdt::metaPrimitive *dt_metaprimitive)
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomH_
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
DTGeometry const * dtGeo_