CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes
RPCIntegrator Class Reference

#include <RPCIntegrator.h>

Public Member Functions

L1Phase2MuDTPhDigi createL1Phase2MuDTPhDigi (RPCDetId rpcDetId, int rpc_bx, double rpc_time, double rpc_global_phi, double phiB, int rpc_flag)
 
void finish ()
 
bool hasPosRF_rpc (int wh, int sec) const
 
void initialise (const edm::EventSetup &iEventSetup, double shift_back_fromDT)
 
void makeRPCOnlySegments ()
 
RPCMetaprimitivematchDTwithRPC (cmsdt::metaPrimitive *dt_metaprimitive)
 
void matchWithDTAndUseRPCTime (std::vector< cmsdt::metaPrimitive > &dt_metaprimitives)
 
double phi_DT_MP_conv (double rpc_global_phi, int rpcSector)
 
double phiBending (RPCMetaprimitive *rpc_hit_1, RPCMetaprimitive *rpc_hit_2)
 
int phiInDTTPFormat (double rpc_global_phi, int rpcSector)
 
void prepareMetaPrimitives (edm::Handle< RPCRecHitCollection > rpcRecHits)
 
void removeRPCHitsUsed ()
 
GlobalPoint RPCGlobalPosition (RPCDetId rpcId, const RPCRecHit &rpcIt) const
 
 RPCIntegrator (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 
void storeRPCSingleHits ()
 
 ~RPCIntegrator ()
 

Public Attributes

std::vector< RPCMetaprimitiveRPCMetaprimitives_
 
std::vector< L1Phase2MuDTPhDigirpcRecHits_translated_
 

Private Attributes

DTGeometry const * dtGeo_
 
edm::ESGetToken< DTGeometry, MuonGeometryRecorddtGeomH_
 
int m_bx_window_
 
const bool m_debug_
 
int m_max_quality_to_overwrite_t0_
 
double m_phi_window_
 
bool m_storeAllRPCHits_
 
RPCGeometry const * rpcGeo_
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordrpcGeomH_
 
double shift_back_
 

Static Private Attributes

static constexpr double distance_between_two_rpc_layers_ = 35
 
static constexpr double R_ [2][2] = {{410.0, 444.8}, {492.7, 527.3}}
 

Detailed Description

Definition at line 55 of file RPCIntegrator.h.

Constructor & Destructor Documentation

◆ RPCIntegrator()

RPCIntegrator::RPCIntegrator ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)

Definition at line 13 of file RPCIntegrator.cc.

References dtGeomH_, edm::ConsumesCollector::esConsumes(), LogDebug, m_debug_, and rpcGeomH_.

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")) {
19  if (m_debug_)
20  LogDebug("RPCIntegrator") << "RPCIntegrator constructor";
21 
24 }
double m_phi_window_
Definition: RPCIntegrator.h:86
int m_max_quality_to_overwrite_t0_
Definition: RPCIntegrator.h:84
const bool m_debug_
Definition: RPCIntegrator.h:83
bool m_storeAllRPCHits_
Definition: RPCIntegrator.h:87
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH_
Definition: RPCIntegrator.h:88
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomH_
Definition: RPCIntegrator.h:89
#define LogDebug(id)

◆ ~RPCIntegrator()

RPCIntegrator::~RPCIntegrator ( )

Definition at line 26 of file RPCIntegrator.cc.

References LogDebug, and m_debug_.

26  {
27  if (m_debug_)
28  LogDebug("RPCIntegrator") << "RPCIntegrator destructor";
29 }
const bool m_debug_
Definition: RPCIntegrator.h:83
#define LogDebug(id)

Member Function Documentation

◆ createL1Phase2MuDTPhDigi()

L1Phase2MuDTPhDigi RPCIntegrator::createL1Phase2MuDTPhDigi ( RPCDetId  rpcDetId,
int  rpc_bx,
double  rpc_time,
double  rpc_global_phi,
double  phiB,
int  rpc_flag 
)

Definition at line 194 of file RPCIntegrator.cc.

References RPCDetId::layer(), LogDebug, m_debug_, cmsdt::PHIBRES_CONV, phiInDTTPFormat(), RPCDetId::ring(), RPCDetId::sector(), and RPCDetId::station().

Referenced by makeRPCOnlySegments(), and storeRPCSingleHits().

195  {
196  if (m_debug_)
197  LogDebug("RPCIntegrator") << "Creating DT TP out of RPC recHits";
198  int rpc_wheel = rpcDetId.ring(); // In barrel, wheel is accessed via ring() method ([-2,+2])
199  int trigger_sector = rpcDetId.sector() - 1; // DT Trigger sector:[0,11] while RPC sector:[1,12]
200  int rpc_station = rpcDetId.station();
201  int rpc_layer = rpcDetId.layer();
202  int rpc_trigger_phi = phiInDTTPFormat(rpc_global_phi, rpcDetId.sector());
203  int rpc_trigger_phiB = (phiB == -10000) ? phiB : (int)round(phiB * cmsdt::PHIBRES_CONV);
204  int rpc_quality = -1; // dummy for rpc
205  int rpc_index = 0; // dummy for rpc
206  return L1Phase2MuDTPhDigi(rpc_bx,
207  rpc_wheel,
208  trigger_sector,
209  rpc_station,
210  rpc_layer, //this would be the layer in the new dataformat
211  rpc_trigger_phi,
212  rpc_trigger_phiB,
213  rpc_quality,
214  rpc_index,
215  rpc_time,
216  -1, // no chi2 for RPC
217  rpc_flag);
218 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
constexpr float PHIBRES_CONV
Definition: constants.h:225
int ring() const
Definition: RPCDetId.h:59
const bool m_debug_
Definition: RPCIntegrator.h:83
int station() const
Definition: RPCDetId.h:78
int phiInDTTPFormat(double rpc_global_phi, int rpcSector)
int layer() const
Definition: RPCDetId.h:85
#define LogDebug(id)

◆ finish()

void RPCIntegrator::finish ( )

Definition at line 49 of file RPCIntegrator.cc.

Referenced by progressbar.ProgressBar::__next__().

49 {}

◆ hasPosRF_rpc()

bool RPCIntegrator::hasPosRF_rpc ( int  wh,
int  sec 
) const

Definition at line 262 of file RPCIntegrator.cc.

References fileinputsource_cfi::sec.

Referenced by phiBending().

262 { return (wh > 0 || (wh == 0 && sec % 4 > 1)); }

◆ initialise()

void RPCIntegrator::initialise ( const edm::EventSetup iEventSetup,
double  shift_back_fromDT 
)

Definition at line 31 of file RPCIntegrator.cc.

References dtGeo_, dtGeomH_, edm::EventSetup::getHandle(), patZpeak::handle, LogDebug, m_debug_, rpcGeo_, rpcGeomH_, and shift_back_.

31  {
32  if (m_debug_)
33  LogDebug("RPCIntegrator") << "RPCIntegrator initialisation";
34 
35  if (m_debug_)
36  LogDebug("RPCIntegrator") << "Getting RPC geometry";
37 
38  if (auto handle = iEventSetup.getHandle(dtGeomH_)) {
39  dtGeo_ = handle.product();
40  }
41 
42  if (auto handle = iEventSetup.getHandle(rpcGeomH_)) {
43  rpcGeo_ = handle.product();
44  }
45 
46  shift_back_ = shift_back_fromDT;
47 }
RPCGeometry const * rpcGeo_
Definition: RPCIntegrator.h:92
double shift_back_
Definition: RPCIntegrator.h:99
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
const bool m_debug_
Definition: RPCIntegrator.h:83
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH_
Definition: RPCIntegrator.h:88
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomH_
Definition: RPCIntegrator.h:89
#define LogDebug(id)
DTGeometry const * dtGeo_
Definition: RPCIntegrator.h:91

◆ makeRPCOnlySegments()

void RPCIntegrator::makeRPCOnlySegments ( )

Definition at line 81 of file RPCIntegrator.cc.

References funct::abs(), RPCRecHit::BunchX(), createL1Phase2MuDTPhDigi(), RPCDetId::layer(), m_storeAllRPCHits_, SiStripPI::max, PV3DBase< T, PVType, FrameType >::phi(), phiBending(), RPCDetId::ring(), cmsdt::RPC_ASSOCIATE, RPCMetaprimitive::rpc_t0, RPCMetaprimitive::rpcFlag, RPCMetaprimitives_, rpcRecHits_translated_, RPCDetId::sector(), RPCDetId::station(), and FrontierCondition_GT_autoExpress_cfi::t0.

81  {
82  std::vector<L1Phase2MuDTPhDigi> rpc_only_segments;
83  for (auto& rpc_mp_it_layer1 : RPCMetaprimitives_) {
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;
87  if (rpc_id_l1.station() > 2 || rpc_id_l1.layer() != 1 ||
88  (rpc_mp_it_layer1.rpcFlag == RPC_ASSOCIATE && !m_storeAllRPCHits_))
89  continue;
90  // only one RPC layer in station three and four &&
91  // avoid duplicating pairs &&
92  // avoid building RPC only segment if DT segment was already there
93  int min_dPhi = std::numeric_limits<int>::max();
94  RPCMetaprimitive* bestMatch_rpc_mp_layer2 = nullptr;
95  for (auto& rpc_mp_it_layer2 : RPCMetaprimitives_) {
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;
99  if (rpc_id_l2.station() == rpc_id_l1.station() && rpc_id_l2.ring() == rpc_id_l1.ring() &&
100  rpc_id_l2.layer() != rpc_id_l1.layer() // ensure to have layer 1 --> layer 2
101  && rpc_id_l2.sector() == rpc_id_l1.sector() && rpc_cluster_l2->BunchX() == rpc_cluster_l1->BunchX() &&
102  (rpc_mp_it_layer2.rpcFlag != RPC_ASSOCIATE || m_storeAllRPCHits_)) {
103  // avoid building RPC only segment with a hit already matched to DT,
104  // except if one aske to store all RPC info
105  float tmp_dPhi = rpc_gp_l1.phi() - rpc_gp_l2.phi();
106  if (std::abs(tmp_dPhi) < std::abs(min_dPhi)) {
107  min_dPhi = tmp_dPhi;
108  bestMatch_rpc_mp_layer2 = &rpc_mp_it_layer2;
109  }
110  }
111  }
112  if (bestMatch_rpc_mp_layer2) {
113  rpc_mp_it_layer1.rpcFlag = 6;
114  // need a new flag (will be removed later) to differentiate
115  // between "has been matched to DT" and "Has been used in an RPC only segment"
116  bestMatch_rpc_mp_layer2->rpcFlag = 6;
117  double phiB = phiBending(&rpc_mp_it_layer1, &*bestMatch_rpc_mp_layer2);
118  // Arbitrarily choose the phi from layer 1
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;
121  // RPC only segment have rpcFlag==2
122  L1Phase2MuDTPhDigi rpc_only_segment =
123  createL1Phase2MuDTPhDigi(rpc_id_l1, rpc_mp_it_layer1.rpc_bx, t0, global_phi, phiB, 2);
124  rpc_only_segments.push_back(rpc_only_segment);
125  }
126  }
127  rpcRecHits_translated_.insert(rpcRecHits_translated_.end(), rpc_only_segments.begin(), rpc_only_segments.end());
128 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
L1Phase2MuDTPhDigi createL1Phase2MuDTPhDigi(RPCDetId rpcDetId, int rpc_bx, double rpc_time, double rpc_global_phi, double phiB, int rpc_flag)
int ring() const
Definition: RPCDetId.h:59
std::vector< RPCMetaprimitive > RPCMetaprimitives_
Definition: RPCIntegrator.h:80
int BunchX() const
Definition: RPCRecHit.h:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< L1Phase2MuDTPhDigi > rpcRecHits_translated_
Definition: RPCIntegrator.h:79
int station() const
Definition: RPCDetId.h:78
double phiBending(RPCMetaprimitive *rpc_hit_1, RPCMetaprimitive *rpc_hit_2)
bool m_storeAllRPCHits_
Definition: RPCIntegrator.h:87
int layer() const
Definition: RPCDetId.h:85

◆ matchDTwithRPC()

RPCMetaprimitive * RPCIntegrator::matchDTwithRPC ( cmsdt::metaPrimitive dt_metaprimitive)

Definition at line 158 of file RPCIntegrator.cc.

References funct::abs(), HLT_2022v15_cff::delta_phi, createfilelist::int, m_bx_window_, m_phi_window_, SiStripPI::max, cmsdt::metaPrimitive::phi, phi_DT_MP_conv(), cmsdt::PHIBRES_CONV, cmsdt::metaPrimitive::rawId, RPCDetId::ring(), cmsdt::RPC_ASSOCIATE, RPCMetaprimitive::rpcFlag, RPCMetaprimitives_, DTChamberId::sector(), RPCDetId::sector(), shift_back_, DTChamberId::station(), RPCDetId::station(), cmsdt::metaPrimitive::t0, and DTChamberId::wheel().

Referenced by matchWithDTAndUseRPCTime().

158  {
159  // metaprimitive dtChId is still in convention with [1 - 12]
160  // because at this stage the BX of metaprimitive is not yet computed...
161  // will also have to subtract 20*25 ns because of the recent change
162  int dt_bx = (int)round(dt_metaprimitive->t0 / 25.) - shift_back_;
163  DTChamberId dt_chId = DTChamberId(dt_metaprimitive->rawId);
164  int dt_sector = dt_chId.sector();
165  if (dt_sector == 13)
166  dt_sector = 4;
167  if (dt_sector == 14)
168  dt_sector = 10;
169  RPCMetaprimitive* bestMatch_rpcRecHit = nullptr;
170  float min_dPhi = std::numeric_limits<float>::max();
171  for (auto rpc_mp_it = RPCMetaprimitives_.begin(); rpc_mp_it != RPCMetaprimitives_.end(); rpc_mp_it++) {
172  RPCDetId rpc_det_id = rpc_mp_it->rpc_id;
173  if (rpc_det_id.ring() == dt_chId.wheel() // ring() in barrel RPC corresponds to the wheel
174  && rpc_det_id.station() == dt_chId.station() && rpc_det_id.sector() == dt_sector &&
175  std::abs(rpc_mp_it->rpc_bx - dt_bx) <= m_bx_window_) {
176  // Select the RPC hit closest in phi to the DT meta primitive
177 
178  // just a trick to apply the phi window cut on what could be accessed to fine tune it
179  int delta_phi =
180  (int)round((phi_DT_MP_conv(rpc_mp_it->global_position.phi(), rpc_det_id.sector()) - dt_metaprimitive->phi) *
182  if (std::abs(delta_phi) < min_dPhi && std::abs(delta_phi) < m_phi_window_) {
183  min_dPhi = std::abs(delta_phi);
184  bestMatch_rpcRecHit = &*rpc_mp_it;
185  }
186  }
187  }
188  if (bestMatch_rpcRecHit) {
189  bestMatch_rpcRecHit->rpcFlag = RPC_ASSOCIATE;
190  }
191  return bestMatch_rpcRecHit;
192 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
double m_phi_window_
Definition: RPCIntegrator.h:86
int station() const
Return the station number.
Definition: DTChamberId.h:42
constexpr float PHIBRES_CONV
Definition: constants.h:225
double phi_DT_MP_conv(double rpc_global_phi, int rpcSector)
int ring() const
Definition: RPCDetId.h:59
std::vector< RPCMetaprimitive > RPCMetaprimitives_
Definition: RPCIntegrator.h:80
double shift_back_
Definition: RPCIntegrator.h:99
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int station() const
Definition: RPCDetId.h:78
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49

◆ matchWithDTAndUseRPCTime()

void RPCIntegrator::matchWithDTAndUseRPCTime ( std::vector< cmsdt::metaPrimitive > &  dt_metaprimitives)

Definition at line 67 of file RPCIntegrator.cc.

References m_max_quality_to_overwrite_t0_, matchDTwithRPC(), cmsdt::RPC_CONFIRM, RPCMetaprimitive::rpc_t0, cmsdt::RPC_TIME, and shift_back_.

67  {
68  for (auto dt_metaprimitive = dt_metaprimitives.begin(); dt_metaprimitive != dt_metaprimitives.end();
69  dt_metaprimitive++) {
70  RPCMetaprimitive* bestMatch_rpcRecHit = matchDTwithRPC(&*dt_metaprimitive);
71  if (bestMatch_rpcRecHit) {
72  (*dt_metaprimitive).rpcFlag = RPC_CONFIRM;
73  if ((*dt_metaprimitive).quality < m_max_quality_to_overwrite_t0_) {
74  (*dt_metaprimitive).t0 = bestMatch_rpcRecHit->rpc_t0 + 25 * shift_back_;
75  (*dt_metaprimitive).rpcFlag = RPC_TIME;
76  }
77  }
78  }
79 }
int m_max_quality_to_overwrite_t0_
Definition: RPCIntegrator.h:84
double shift_back_
Definition: RPCIntegrator.h:99
RPCMetaprimitive * matchDTwithRPC(cmsdt::metaPrimitive *dt_metaprimitive)

◆ phi_DT_MP_conv()

double RPCIntegrator::phi_DT_MP_conv ( double  rpc_global_phi,
int  rpcSector 
)

Definition at line 240 of file RPCIntegrator.cc.

References edm::conversion(), and M_PI.

Referenced by matchDTwithRPC(), phiBending(), and phiInDTTPFormat().

240  {
241  // Adaptation of https://github.com/cms-sw/cmssw/blob/master/L1Trigger/L1TTwinMux/src/RPCtoDTTranslator.cc#L349
242 
243  if (rpcSector == 1)
244  return rpc_global_phi;
245  else {
246  float conversion = 1 / 6.;
247  if (rpc_global_phi >= 0)
248  return rpc_global_phi - (rpcSector - 1) * M_PI * conversion;
249  else
250  return rpc_global_phi + (13 - rpcSector) * M_PI * conversion;
251  }
252 }
#define M_PI
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9

◆ phiBending()

double RPCIntegrator::phiBending ( RPCMetaprimitive rpc_hit_1,
RPCMetaprimitive rpc_hit_2 
)

Definition at line 220 of file RPCIntegrator.cc.

References DTGeometry::chamber(), distance_between_two_rpc_layers_, dtGeo_, RPCMetaprimitive::global_position, hasPosRF_rpc(), PV3DBase< T, PVType, FrameType >::phi(), phi_DT_MP_conv(), RPCDetId::ring(), RPCMetaprimitive::rpc_id, RPCDetId::sector(), slope, RPCDetId::station(), GeomDet::toGlobal(), GeomDet::toLocal(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by makeRPCOnlySegments().

220  {
221  DTChamberId DT_chamber(rpc_hit_1->rpc_id.ring(), rpc_hit_1->rpc_id.station(), rpc_hit_1->rpc_id.sector());
222  LocalPoint lp_rpc_hit_1_dtconv = dtGeo_->chamber(DT_chamber)->toLocal(rpc_hit_1->global_position);
223  LocalPoint lp_rpc_hit_2_dtconv = dtGeo_->chamber(DT_chamber)->toLocal(rpc_hit_2->global_position);
224  double slope = (lp_rpc_hit_1_dtconv.x() - lp_rpc_hit_2_dtconv.x()) / distance_between_two_rpc_layers_;
225  double average_x = (lp_rpc_hit_1_dtconv.x() + lp_rpc_hit_2_dtconv.x()) / 2;
226  GlobalPoint seg_middle_global =
227  dtGeo_->chamber(DT_chamber)->toGlobal(LocalPoint(average_x, 0., 0.)); // for station 1 and 2, z = 0
228  double seg_phi = phi_DT_MP_conv(seg_middle_global.phi(), rpc_hit_1->rpc_id.sector());
229  double psi = atan(slope);
230  double phiB = hasPosRF_rpc(rpc_hit_1->rpc_id.ring(), rpc_hit_1->rpc_id.sector()) ? psi - seg_phi : -psi - seg_phi;
231  return phiB;
232 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
static const double slope[3]
double phi_DT_MP_conv(double rpc_global_phi, int rpcSector)
int ring() const
Definition: RPCDetId.h:59
GlobalPoint global_position
Definition: RPCIntegrator.h:37
std::map< std::string, int, std::less< std::string > > psi
T x() const
Definition: PV3DBase.h:59
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
static constexpr double distance_between_two_rpc_layers_
Definition: RPCIntegrator.h:97
int station() const
Definition: RPCDetId.h:78
bool hasPosRF_rpc(int wh, int sec) const
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
DTGeometry const * dtGeo_
Definition: RPCIntegrator.h:91

◆ phiInDTTPFormat()

int RPCIntegrator::phiInDTTPFormat ( double  rpc_global_phi,
int  rpcSector 
)

Definition at line 234 of file RPCIntegrator.cc.

References phi_DT_MP_conv(), and cmsdt::PHIBRES_CONV.

Referenced by createL1Phase2MuDTPhDigi().

234  {
235  double rpc_localDT_phi;
236  rpc_localDT_phi = phi_DT_MP_conv(rpc_global_phi, rpcSector) * cmsdt::PHIBRES_CONV;
237  return (int)round(rpc_localDT_phi);
238 }
constexpr float PHIBRES_CONV
Definition: constants.h:225
double phi_DT_MP_conv(double rpc_global_phi, int rpcSector)

◆ prepareMetaPrimitives()

void RPCIntegrator::prepareMetaPrimitives ( edm::Handle< RPCRecHitCollection rpcRecHits)

Definition at line 51 of file RPCIntegrator.cc.

References cmsdt::BX_SHIFT, cmsdt::LHC_CLK_FREQ, RPCDetId::region(), cmsdt::RPC_HIT, RPCGlobalPosition(), RPCMetaprimitives_, rpcRecHits_cfi::rpcRecHits, and rpcRecHits_translated_.

51  {
52  RPCMetaprimitives_.clear();
53  rpcRecHits_translated_.clear();
54  for (const auto& rpcIt : *rpcRecHits) {
55  RPCDetId rpcDetId = (RPCDetId)(rpcIt).rpcId();
56  GlobalPoint global_position = RPCGlobalPosition(rpcDetId, rpcIt);
57  int rpc_region = rpcDetId.region();
58  if (rpc_region != 0)
59  continue; // Region = 0 Barrel
60 
61  // set everyone to rpc single hit (3) not matched to DT flag for now
62  // change last two elements if dt bx centered at zero again
63  RPCMetaprimitives_.emplace_back(
64  rpcDetId, &rpcIt, global_position, RPC_HIT, rpcIt.BunchX() + BX_SHIFT, rpcIt.time() + BX_SHIFT * LHC_CLK_FREQ);
65  }
66 }
std::vector< RPCMetaprimitive > RPCMetaprimitives_
Definition: RPCIntegrator.h:80
GlobalPoint RPCGlobalPosition(RPCDetId rpcId, const RPCRecHit &rpcIt) const
constexpr int BX_SHIFT
Definition: constants.h:257
std::vector< L1Phase2MuDTPhDigi > rpcRecHits_translated_
Definition: RPCIntegrator.h:79
constexpr int LHC_CLK_FREQ
Definition: constants.h:176
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

◆ removeRPCHitsUsed()

void RPCIntegrator::removeRPCHitsUsed ( )

Definition at line 141 of file RPCIntegrator.cc.

References LogDebug, m_debug_, m_storeAllRPCHits_, cmsdt::RPC_ASSOCIATE, and rpcRecHits_translated_.

141  {
142  if (m_debug_)
143  LogDebug("RPCIntegrator") << "RPCIntegrator removeRPCHitsUsed method";
144  if (!m_storeAllRPCHits_) {
145  // Remove RPC hit attached to a DT or RPC segment if required by user
146  // (avoid having two TP's corresponding to the same physical hit)
147  auto rpcRecHit_translated_ = rpcRecHits_translated_.begin();
148  while (rpcRecHit_translated_ != rpcRecHits_translated_.end()) {
149  if (rpcRecHit_translated_->rpcFlag() == RPC_ASSOCIATE || rpcRecHit_translated_->rpcFlag() == 6) {
150  rpcRecHit_translated_ = rpcRecHits_translated_.erase(rpcRecHit_translated_);
151  } else {
152  ++rpcRecHit_translated_;
153  }
154  }
155  }
156 }
std::vector< L1Phase2MuDTPhDigi > rpcRecHits_translated_
Definition: RPCIntegrator.h:79
const bool m_debug_
Definition: RPCIntegrator.h:83
bool m_storeAllRPCHits_
Definition: RPCIntegrator.h:87
#define LogDebug(id)

◆ RPCGlobalPosition()

GlobalPoint RPCIntegrator::RPCGlobalPosition ( RPCDetId  rpcId,
const RPCRecHit rpcIt 
) const

Definition at line 254 of file RPCIntegrator.cc.

References RPCGeometry::idToDet(), RPCRecHit::localPosition(), rpcGeo_, GeomDet::surface(), and Surface::toGlobal().

Referenced by prepareMetaPrimitives().

254  {
255  RPCDetId rpcid = RPCDetId(rpcId);
256  const LocalPoint& rpc_lp = rpcIt.localPosition();
257  const GlobalPoint& rpc_gp = rpcGeo_->idToDet(rpcid)->surface().toGlobal(rpc_lp);
258 
259  return rpc_gp;
260 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: RPCRecHit.h:37
RPCGeometry const * rpcGeo_
Definition: RPCIntegrator.h:92
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:32

◆ storeRPCSingleHits()

void RPCIntegrator::storeRPCSingleHits ( )

Definition at line 130 of file RPCIntegrator.cc.

References createL1Phase2MuDTPhDigi(), cmsdt::RPC_ASSOCIATE, RPCMetaprimitives_, and rpcRecHits_translated_.

130  {
131  for (auto rpc_mp_it = RPCMetaprimitives_.begin(); rpc_mp_it != RPCMetaprimitives_.end(); rpc_mp_it++) {
132  RPCDetId rpcDetId = rpc_mp_it->rpc_id;
133  if (rpc_mp_it->rpcFlag == 6)
134  rpc_mp_it->rpcFlag = RPC_ASSOCIATE;
136  rpcDetId, rpc_mp_it->rpc_bx, rpc_mp_it->rpc_t0, rpc_mp_it->global_position.phi(), -10000, rpc_mp_it->rpcFlag);
137  rpcRecHits_translated_.push_back(rpc_out);
138  }
139 }
L1Phase2MuDTPhDigi createL1Phase2MuDTPhDigi(RPCDetId rpcDetId, int rpc_bx, double rpc_time, double rpc_global_phi, double phiB, int rpc_flag)
std::vector< RPCMetaprimitive > RPCMetaprimitives_
Definition: RPCIntegrator.h:80
std::vector< L1Phase2MuDTPhDigi > rpcRecHits_translated_
Definition: RPCIntegrator.h:79

Member Data Documentation

◆ distance_between_two_rpc_layers_

constexpr double RPCIntegrator::distance_between_two_rpc_layers_ = 35
staticprivate

Definition at line 97 of file RPCIntegrator.h.

Referenced by phiBending().

◆ dtGeo_

DTGeometry const* RPCIntegrator::dtGeo_
private

Definition at line 91 of file RPCIntegrator.h.

Referenced by initialise(), and phiBending().

◆ dtGeomH_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> RPCIntegrator::dtGeomH_
private

Definition at line 88 of file RPCIntegrator.h.

Referenced by initialise(), and RPCIntegrator().

◆ m_bx_window_

int RPCIntegrator::m_bx_window_
private

Definition at line 85 of file RPCIntegrator.h.

Referenced by matchDTwithRPC().

◆ m_debug_

const bool RPCIntegrator::m_debug_
private

◆ m_max_quality_to_overwrite_t0_

int RPCIntegrator::m_max_quality_to_overwrite_t0_
private

Definition at line 84 of file RPCIntegrator.h.

Referenced by matchWithDTAndUseRPCTime().

◆ m_phi_window_

double RPCIntegrator::m_phi_window_
private

Definition at line 86 of file RPCIntegrator.h.

Referenced by matchDTwithRPC().

◆ m_storeAllRPCHits_

bool RPCIntegrator::m_storeAllRPCHits_
private

Definition at line 87 of file RPCIntegrator.h.

Referenced by makeRPCOnlySegments(), and removeRPCHitsUsed().

◆ R_

constexpr double RPCIntegrator::R_[2][2] = {{410.0, 444.8}, {492.7, 527.3}}
staticprivate

Definition at line 96 of file RPCIntegrator.h.

◆ rpcGeo_

RPCGeometry const* RPCIntegrator::rpcGeo_
private

Definition at line 92 of file RPCIntegrator.h.

Referenced by initialise(), and RPCGlobalPosition().

◆ rpcGeomH_

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> RPCIntegrator::rpcGeomH_
private

Definition at line 89 of file RPCIntegrator.h.

Referenced by initialise(), and RPCIntegrator().

◆ RPCMetaprimitives_

std::vector<RPCMetaprimitive> RPCIntegrator::RPCMetaprimitives_

◆ rpcRecHits_translated_

std::vector<L1Phase2MuDTPhDigi> RPCIntegrator::rpcRecHits_translated_

◆ shift_back_

double RPCIntegrator::shift_back_
private

Definition at line 99 of file RPCIntegrator.h.

Referenced by initialise(), matchDTwithRPC(), and matchWithDTAndUseRPCTime().