CMS 3D CMS Logo

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

#include <TracktoRPC.h>

Public Member Functions

std::unique_ptr< RPCRecHitCollectionthePoints (reco::TrackCollection const *alltracks, edm::EventSetup const &iSetup, bool debug)
 
 TracktoRPC (const edm::ParameterSet &iConfig, const edm::InputTag &tracklabel, edm::ConsumesCollector iC)
 

Private Member Functions

bool ValidRPCSurface (RPCDetId rpcid, LocalPoint LocalP, const RPCGeometry *rpcGeo)
 

Private Attributes

edm::ESGetToken< CSCGeometry, MuonGeometryRecordcscGeoToken_
 
edm::ESGetToken< CSCObjectMap, MuonGeometryRecordcscMapToken_
 
edm::ESGetToken< DTGeometry, MuonGeometryRecorddtGeoToken_
 
edm::ESGetToken< DTObjectMap, MuonGeometryRecorddtMapToken_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordpropagatorToken_
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordrpcGeoToken_
 
std::unique_ptr< TrackTransformerBasetheTrackTransformer
 

Detailed Description

Definition at line 65 of file TracktoRPC.h.

Constructor & Destructor Documentation

◆ TracktoRPC()

TracktoRPC::TracktoRPC ( const edm::ParameterSet iConfig,
const edm::InputTag tracklabel,
edm::ConsumesCollector  iC 
)

Definition at line 54 of file TracktoRPC.cc.

55  : rpcGeoToken_(iC.esConsumes()),
56  dtGeoToken_(iC.esConsumes()),
57  dtMapToken_(iC.esConsumes()),
60  propagatorToken_(iC.esConsumes(edm::ESInputTag("", "SteppingHelixPropagatorAny"))) {
61  if (tracklabel.label().find("cosmic") == 0)
62  theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(iConfig);
63  else if (tracklabel.label().find("globalCosmic") == 0)
64  theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(iConfig);
65  else
66  theTrackTransformer = std::make_unique<TrackTransformer>(iConfig, iC);
67 }

References edm::InputTag::label(), and theTrackTransformer.

Member Function Documentation

◆ thePoints()

std::unique_ptr< RPCRecHitCollection > TracktoRPC::thePoints ( reco::TrackCollection const *  alltracks,
edm::EventSetup const &  iSetup,
bool  debug 
)

Definition at line 69 of file TracktoRPC.cc.

71  {
72  auto _ThePoints = std::make_unique<RPCRecHitCollection>();
73  // if(alltracks->empty()) return;
74 
75  theTrackTransformer->setServices(iSetup);
76 
77  const RPCGeometry *rpcGeo = &iSetup.getData(rpcGeoToken_);
78  const DTGeometry *dtGeo = &iSetup.getData(dtGeoToken_);
79  const DTObjectMap *dtMap = &iSetup.getData(dtMapToken_);
80  const CSCGeometry *cscGeo = &iSetup.getData(cscGeoToken_);
81  const CSCObjectMap *cscMap = &iSetup.getData(cscMapToken_);
82  const Propagator *propagator = &iSetup.getData(propagatorToken_);
83 
84  edm::OwnVector<RPCRecHit> RPCPointVector;
85  std::vector<uint32_t> rpcput;
86  double MaxD = 999.;
87 
88  for (TrackCollection::const_iterator track = alltracks->begin(); track != alltracks->end(); track++) {
90  if (debug)
91  std::cout << "Building Trajectory from Track. " << std::endl;
92 
93  std::vector<uint32_t> rpcrolls;
94  std::vector<uint32_t> rpcrolls2;
95  std::map<uint32_t, int> rpcNdtcsc;
96  std::map<uint32_t, int> rpcrollCounter;
97 
98  float tInX = track->innerPosition().X(), tInY = track->innerPosition().Y(), tInZ = track->innerPosition().Z();
99  float tOuX = track->outerPosition().X(), tOuY = track->outerPosition().Y(), tOuZ = track->outerPosition().Z();
100  if (tInX > tOuX) {
101  float temp = tOuX;
102  tOuX = tInX;
103  tInX = temp;
104  }
105  if (tInY > tOuY) {
106  float temp = tOuY;
107  tOuY = tInY;
108  tInY = temp;
109  }
110  if (tInZ > tOuZ) {
111  float temp = tOuZ;
112  tOuZ = tInZ;
113  tInZ = temp;
114  }
115 
116  if (debug)
117  std::cout << "in (x,y,z): (" << tInX << ", " << tInY << ", " << tInZ << ")" << std::endl;
118  if (debug)
119  std::cout << "out (x,y,z): (" << tOuX << ", " << tOuY << ", " << tOuZ << ")" << std::endl;
120 
121  if (debug)
122  std::cout << "1. Search expeted RPC roll detid !!" << std::endl;
123  for (trackingRecHit_iterator hit = track->recHitsBegin(); hit != track->recHitsEnd(); hit++) {
124  if ((*hit)->isValid()) {
125  DetId id = (*hit)->geographicalId();
126 
127  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT) {
128  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
129  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
130  if (dtlayer)
131  for (Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end();
132  ++trajectory) {
133  const BoundPlane &DTSurface = dtlayer->surface();
134  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0., 0., 0.));
135 
136  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
137  const TrajectoryStateOnSurface &upd2 = (tMt).updatedState();
138  if (upd2.isValid()) {
139  LocalPoint trajLP = upd2.localPosition();
140  LocalPoint trackLP = (*hit)->localPosition();
141  float dx = trajLP.x() - trackLP.x(), dy = trajLP.y() - trackLP.y(); //, dz=trajLP.z()-trackLP.z();
142  if (dx > 10. && dy > 10.)
143  continue;
144 
145  DTChamberId dtid(geomDet->geographicalId().rawId());
146  int dtW = dtid.wheel(), dtS = dtid.sector(), dtT = dtid.station();
147  if (dtS == 13)
148  dtS = 4;
149  if (dtS == 14)
150  dtS = 10;
151  DTStationIndex theindex(0, dtW, dtS, dtT);
152  const std::set<RPCDetId> &rollsForThisDT = dtMap->getRolls(theindex);
153  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin(); iteraRoll != rollsForThisDT.end();
154  iteraRoll++) {
155  const RPCRoll *rollasociated = rpcGeo->roll(*iteraRoll);
156 
158  propagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
159  if (ptss.isValid())
160  if (ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), rpcGeo)) {
161  rpcrollCounter[rollasociated->id().rawId()]++;
162  bool check = true;
163  std::vector<uint32_t>::iterator rpcroll;
164  for (rpcroll = rpcrolls.begin(); rpcroll < rpcrolls.end(); rpcroll++)
165  if (rollasociated->id().rawId() == *rpcroll)
166  check = false;
167  if (check == true) {
168  rpcrolls.push_back(rollasociated->id().rawId());
169  RPCGeomServ servId(rollasociated->id().rawId());
170  if (debug)
171  std::cout << "1\t Barrel RPC roll" << rollasociated->id().rawId() << " "
172  << servId.name().c_str() << std::endl;
173  }
174  }
175  }
176  }
177  }
178  } else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
179  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
180  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
181 
182  CSCDetId cscid(geomDet->geographicalId().rawId());
183  if (csclayer)
184  for (Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end();
185  ++trajectory) {
186  const BoundPlane &CSCSurface = csclayer->surface();
187  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0., 0., 0.));
188 
189  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
190  const TrajectoryStateOnSurface &upd2 = (tMt).updatedState();
191 
192  if (upd2.isValid() && cscid.station() != 4 && cscid.ring() != 1) {
193  LocalPoint trajLP = upd2.localPosition();
194  LocalPoint trackLP = (*hit)->localPosition();
195  float dx = trajLP.x() - trackLP.x(), dy = trajLP.y() - trackLP.y(); //, dz=trajLP.z()-trackLP.z();
196  if (dx > 10. && dy > 10.)
197  continue;
198 
199  int En = cscid.endcap(), St = cscid.station(), Ri = cscid.ring();
200  int rpcSegment = cscid.chamber();
201  if (En == 2)
202  En = -1;
203  if (Ri == 4)
204  Ri = 1;
205 
206  CSCStationIndex theindex(En, St, Ri, rpcSegment);
207  const std::set<RPCDetId> &rollsForThisCSC = cscMap->getRolls(theindex);
208  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();
209  iteraRoll != rollsForThisCSC.end();
210  iteraRoll++) {
211  const RPCRoll *rollasociated = rpcGeo->roll(*iteraRoll);
212 
214  propagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
215  if (ptss.isValid())
216  if (ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), rpcGeo)) {
217  rpcrollCounter[rollasociated->id().rawId()]++;
218  bool check = true;
219  std::vector<uint32_t>::iterator rpcroll;
220  for (rpcroll = rpcrolls.begin(); rpcroll < rpcrolls.end(); rpcroll++)
221  if (rollasociated->id().rawId() == *rpcroll)
222  check = false;
223  if (check == true) {
224  rpcrolls.push_back(rollasociated->id().rawId());
225  RPCGeomServ servId(rollasociated->id().rawId());
226  if (debug)
227  std::cout << "1\t Forward RPC roll" << rollasociated->id().rawId() << " "
228  << servId.name().c_str() << std::endl;
229  }
230  }
231  }
232  }
233  }
234  } else {
235  if (debug)
236  std::cout << "1\t The hit is not DT/CSC's. " << std::endl;
237  }
238  }
239  }
240  if (debug)
241  std::cout << "First step OK!!\n2. Search nearest DT/CSC sufrace!!" << std::endl;
242  std::vector<uint32_t>::iterator rpcroll;
243  for (rpcroll = rpcrolls.begin(); rpcroll < rpcrolls.end(); rpcroll++) {
244  RPCDetId rpcid(*rpcroll);
245  const GlobalPoint &rGP = rpcGeo->idToDet(*rpcroll)->surface().toGlobal(LocalPoint(0, 0, 0));
246  RPCGeomServ servId(rpcid);
247  int rEn = rpcid.region(), rSe = rpcid.sector(), rWr = rpcid.ring(), rSt = rpcid.station(), rCh = servId.segment();
248 
249  if (rpcrollCounter[*rpcroll] < 3)
250  continue;
251 
252  uint32_t dtcscid = 0;
253  double distance = MaxD;
254 
255  // if(rSt ==2 && rEn==0) MaxD=100;
256  // else if(rSt ==3 && rEn==0) MaxD=100;
257  // else if(rSt ==4 && rEn==0) MaxD =150;
258  for (trackingRecHit_iterator hit = track->recHitsBegin(); hit != track->recHitsEnd(); hit++) {
259  if ((*hit)->isValid()) {
260  DetId id = (*hit)->geographicalId();
261  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT) {
262  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
263  //const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
264  const GlobalPoint &dtGP = dtGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0, 0, 0));
265  double dx = rGP.x() - dtGP.x(), dy = rGP.y() - dtGP.y(), dz = rGP.z() - dtGP.z();
266  double distanceN = sqrt(dx * dx + dy * dy + dz * dz);
267 
268  DTChamberId dtid(geomDet->geographicalId().rawId());
269  int Se = dtid.sector(), Wh = dtid.wheel(), St = dtid.station();
270  if (Se == 13)
271  Se = 4;
272  if (Se == 14)
273  Se = 10;
274 
275  if (rEn == 0 && (rSe - Se) == 0 && (rWr - Wh) == 0 && (rSt - St) == 0 && distanceN < distance) {
276  dtcscid = geomDet->geographicalId().rawId();
277  distance = distanceN;
278  if (debug)
279  std::cout << "2\t DT " << dtcscid << " Wheel : " << Wh << " station : " << St << " sector : " << Se
280  << std::endl;
281  }
282  } else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
283  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
284  //const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
285  const GlobalPoint &cscGP =
286  cscGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0, 0, 0));
287  double dx = rGP.x() - cscGP.x(), dy = rGP.y() - cscGP.y(), dz = rGP.z() - cscGP.z();
288  double distanceN = sqrt(dx * dx + dy * dy + dz * dz);
289 
290  CSCDetId cscid(geomDet->geographicalId().rawId());
291  int En = cscid.endcap(), Ri = cscid.ring(), St = cscid.station(), Ch = cscid.chamber();
292  if (En == 2)
293  En = -1;
294  if (Ri == 4)
295  Ri = 1;
296 
297  if ((rEn - En) == 0 && (rSt - St) == 0 && (Ch - rCh) == 0 && rWr != 1 && rSt != 4 && distanceN < distance) {
298  dtcscid = geomDet->geographicalId().rawId();
299  distance = distanceN;
300  if (debug)
301  std::cout << "2\t CSC " << dtcscid << " region : " << En << " station : " << St << " Ring : " << Ri
302  << " chamber : " << Ch << std::endl;
303  }
304  }
305  }
306  }
307  if (dtcscid != 0 && distance < MaxD) {
308  rpcrolls2.push_back(*rpcroll);
309  rpcNdtcsc[*rpcroll] = dtcscid;
310  }
311  }
312  if (debug)
313  std::cout << "Second step OK!! \n3. Propagate to RPC from DT/CSC!!" << std::endl;
314  //std::map<uint32_t, int> rpcput;
315  std::vector<uint32_t>::iterator rpcroll2;
316  for (rpcroll2 = rpcrolls2.begin(); rpcroll2 < rpcrolls2.end(); rpcroll2++) {
317  bool check = true;
318  std::vector<uint32_t>::iterator rpcput_;
319  for (rpcput_ = rpcput.begin(); rpcput_ < rpcput.end(); rpcput_++)
320  if (*rpcroll2 == *rpcput_)
321  check = false;
322 
323  if (check == true) {
324  uint32_t dtcscid = rpcNdtcsc[*rpcroll2];
325  DetId id(dtcscid);
326  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT) {
327  const GeomDet *geomDet = dtGeo->idToDet(dtcscid);
328  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
329 
330  if (dtlayer)
331  for (Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end();
332  ++trajectory) {
333  const BoundPlane &DTSurface = dtlayer->surface();
334  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0., 0., 0.));
335 
336  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
337  const TrajectoryStateOnSurface &upd2 = (tMt).updatedState();
338  if (upd2.isValid()) {
339  TrajectoryStateOnSurface ptss = propagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
340  if (ptss.isValid())
341  if (ValidRPCSurface(*rpcroll2, ptss.localPosition(), rpcGeo)) {
342  float rpcGPX = ptss.globalPosition().x();
343  float rpcGPY = ptss.globalPosition().y();
344  float rpcGPZ = ptss.globalPosition().z();
345 
346  if (tInX > rpcGPX || tOuX < rpcGPX)
347  continue;
348  if (tInY > rpcGPY || tOuY < rpcGPY)
349  continue;
350  if (tInZ > rpcGPZ || tOuZ < rpcGPZ)
351  continue;
352 
353  const GeomDet *geomDet2 = rpcGeo->idToDet(*rpcroll2);
354  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet2);
355  const RectangularStripTopology *top_ =
356  dynamic_cast<const RectangularStripTopology *>(&(aroll->topology()));
357  LocalPoint xmin = top_->localPosition(0.);
358  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
359  float rsize = fabs(xmax.x() - xmin.x());
360  float stripl = top_->stripLength();
361  //float stripw = top_->pitch();
362  float eyr = 1;
363 
364  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(),
365  locz = ptss.localPosition().z();
366  if (locx < rsize * eyr && locy < stripl * eyr && locz < 1.) {
367  RPCRecHit RPCPoint(*rpcroll2, 0, LocalPoint(locx, locy, locz));
368 
369  RPCGeomServ servId(*rpcroll2);
370  if (debug)
371  std::cout << "3\t Barrel Expected RPC " << servId.name().c_str()
372  << " \tLocalposition X: " << locx << ", Y: " << locy << " GlobalPosition(x,y,z) ("
373  << rpcGPX << ", " << rpcGPY << ", " << rpcGPZ << ")" << std::endl;
374  RPCPointVector.clear();
375  RPCPointVector.push_back(RPCPoint);
376  _ThePoints->put(*rpcroll2, RPCPointVector.begin(), RPCPointVector.end());
377  rpcput.push_back(*rpcroll2);
378  }
379  }
380  }
381  }
382  } else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
383  const GeomDet *geomDet4 = cscGeo->idToDet(dtcscid);
384  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet4);
385 
386  if (csclayer)
387  for (Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end();
388  ++trajectory) {
389  const BoundPlane &CSCSurface = csclayer->surface();
390  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0., 0., 0.));
391 
392  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
393  const TrajectoryStateOnSurface &upd2 = (tMt).updatedState();
394  if (upd2.isValid()) {
395  TrajectoryStateOnSurface ptss = propagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
396  if (ptss.isValid())
397  if (ValidRPCSurface(*rpcroll2, ptss.localPosition(), rpcGeo)) {
398  float rpcGPX = ptss.globalPosition().x();
399  float rpcGPY = ptss.globalPosition().y();
400  float rpcGPZ = ptss.globalPosition().z();
401 
402  if (tInX > rpcGPX || tOuX < rpcGPX)
403  continue;
404  if (tInY > rpcGPY || tOuY < rpcGPY)
405  continue;
406  if (tInZ > rpcGPZ || tOuZ < rpcGPZ)
407  continue;
408 
409  RPCDetId rpcid(*rpcroll2);
410  const GeomDet *geomDet3 = rpcGeo->idToDet(*rpcroll2);
411  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet3);
412  const TrapezoidalStripTopology *top_ =
413  dynamic_cast<const TrapezoidalStripTopology *>(&(aroll->topology()));
414  LocalPoint xmin = top_->localPosition(0.);
415  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
416  float rsize = fabs(xmax.x() - xmin.x());
417  float stripl = top_->stripLength();
418  //float stripw = top_->pitch();
419 
420  float eyr = 1;
422  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(),
423  locz = ptss.localPosition().z();
424  if (locx < rsize * eyr && locy < stripl * eyr && locz < 1.) {
425  RPCRecHit RPCPoint(*rpcroll2, 0, LocalPoint(locx, locy, locz));
426  RPCGeomServ servId(*rpcroll2);
427  if (debug)
428  std::cout << "3\t Forward Expected RPC " << servId.name().c_str()
429  << " \tLocalposition X: " << locx << ", Y: " << locy << " GlobalPosition(x,y,z) ("
430  << rpcGPX << ", " << rpcGPY << ", " << rpcGPZ << ")" << std::endl;
431  RPCPointVector.clear();
432  RPCPointVector.push_back(RPCPoint);
433  _ThePoints->put(*rpcroll2, RPCPointVector.begin(), RPCPointVector.end());
434  rpcput.push_back(*rpcroll2);
435  }
436  }
437  }
438  }
439  }
440  }
441  }
442  if (debug)
443  std::cout << "last steps OK!! " << std::endl;
444  }
445 
446  return _ThePoints;
447 }

References edm::OwnVector< T, P >::begin(), RPCNoise_example::check, edm::OwnVector< T, P >::clear(), gather_cfg::cout, MuonSubdetId::CSC, cscGeoToken_, cscMapToken_, debug, HLT_FULL_cff::distance, MuonSubdetId::DT, dtGeoToken_, dtMapToken_, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, edm::OwnVector< T, P >::end(), CSCDetId::endcap(), GeomDet::geographicalId(), edm::EventSetup::getData(), CSCObjectMap::getRolls(), DTObjectMap::getRolls(), TrajectoryStateOnSurface::globalPosition(), RPCRoll::id(), triggerObjects_cff::id, RPCGeometry::idToDet(), DTGeometry::idToDet(), CSCGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), RectangularStripTopology::localPosition(), TrapezoidalStripTopology::localPosition(), TrajectoryStateOnSurface::localPosition(), RPCResidualsHLT_cfi::MaxD, DetId::Muon, RPCGeomServ::name(), RPCRoll::nstrips(), TrackCandidateProducer_cfi::propagator, propagatorToken_, edm::OwnVector< T, P >::push_back(), DetId::rawId(), RPCDetId::region(), RPCDetId::ring(), RPCGeometry::roll(), rpcGeoToken_, DTChamberId::sector(), RPCDetId::sector(), RPCGeomServ::segment(), mathSSE::sqrt(), RPCDetId::station(), RectangularStripTopology::stripLength(), TrapezoidalStripTopology::stripLength(), GeomDet::surface(), groupFilesInBlocks::temp, theTrackTransformer, GeomDet::toGlobal(), Surface::toGlobal(), RPCRoll::topology(), HLT_FULL_cff::track, FastTrackerRecHitMaskProducer_cfi::trajectories, ValidRPCSurface(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ ValidRPCSurface()

bool TracktoRPC::ValidRPCSurface ( RPCDetId  rpcid,
LocalPoint  LocalP,
const RPCGeometry rpcGeo 
)
private

Definition at line 21 of file TracktoRPC.cc.

21  {
22  const GeomDet *whichdet3 = rpcGeo->idToDet(rpcid.rawId());
23  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(whichdet3);
24  float locx = LocalP.x(), locy = LocalP.y(); //, locz=LocalP.z();
25  if (aroll->isBarrel()) {
26  const Bounds &rollbound = rpcGeo->idToDet((rpcid))->surface().bounds();
27  float boundlength = rollbound.length();
28  float boundwidth = rollbound.width();
29 
30  if (fabs(locx) < boundwidth / 2 && fabs(locy) < boundlength / 2 && locy > -boundlength / 2)
31  return true;
32  else
33  return false;
34 
35  } else if (aroll->isForward()) {
36  const Bounds &rollbound = rpcGeo->idToDet((rpcid))->surface().bounds();
37  float boundlength = rollbound.length();
38  float boundwidth = rollbound.width();
39 
40  float nminx = TMath::Pi() * (18 * boundwidth / TMath::Pi() - boundlength) / 18;
41  float ylimit = ((boundlength) / (boundwidth / 2 - nminx / 2)) * fabs(locx) + boundlength / 2 -
42  ((boundlength) / (boundwidth / 2 - nminx / 2)) * (boundwidth / 2);
43  if (ylimit < -boundlength / 2)
44  ylimit = -boundlength / 2;
45 
46  if (fabs(locx) < boundwidth / 2 && fabs(locy) < boundlength / 2 && locy > ylimit)
47  return true;
48  else
49  return false;
50  } else
51  return false;
52 }

References Surface::bounds(), RPCGeometry::idToDet(), RPCRoll::isBarrel(), RPCRoll::isForward(), Bounds::length(), Pi, DetId::rawId(), GeomDet::surface(), Bounds::width(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by thePoints().

Member Data Documentation

◆ cscGeoToken_

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> TracktoRPC::cscGeoToken_
private

Definition at line 78 of file TracktoRPC.h.

Referenced by thePoints().

◆ cscMapToken_

edm::ESGetToken<CSCObjectMap, MuonGeometryRecord> TracktoRPC::cscMapToken_
private

Definition at line 79 of file TracktoRPC.h.

Referenced by thePoints().

◆ dtGeoToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> TracktoRPC::dtGeoToken_
private

Definition at line 76 of file TracktoRPC.h.

Referenced by thePoints().

◆ dtMapToken_

edm::ESGetToken<DTObjectMap, MuonGeometryRecord> TracktoRPC::dtMapToken_
private

Definition at line 77 of file TracktoRPC.h.

Referenced by thePoints().

◆ propagatorToken_

edm::ESGetToken<Propagator, TrackingComponentsRecord> TracktoRPC::propagatorToken_
private

Definition at line 80 of file TracktoRPC.h.

Referenced by thePoints().

◆ rpcGeoToken_

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> TracktoRPC::rpcGeoToken_
private

Definition at line 75 of file TracktoRPC.h.

Referenced by thePoints().

◆ theTrackTransformer

std::unique_ptr<TrackTransformerBase> TracktoRPC::theTrackTransformer
private

Definition at line 81 of file TracktoRPC.h.

Referenced by thePoints(), and TracktoRPC().

DTGeometry
Definition: DTGeometry.h:28
RPCRoll
Definition: RPCRoll.h:12
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
TrapezoidalStripTopology::stripLength
float stripLength() const override
det heigth (strip length in the middle)
Definition: TrapezoidalStripTopology.h:63
edm::ESInputTag
Definition: ESInputTag.h:87
RPCGeomServ
Definition: RPCGeomServ.h:8
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11776
Bounds::width
virtual float width() const =0
GeomDet
Definition: GeomDet.h:27
edm::OwnVector::end
iterator end()
Definition: OwnVector.h:285
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CSCGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
TracktoRPC::rpcGeoToken_
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeoToken_
Definition: TracktoRPC.h:75
RPCDetId
Definition: RPCDetId.h:16
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TracktoRPC::dtGeoToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeoToken_
Definition: TracktoRPC.h:76
Bounds
Definition: Bounds.h:18
RPCGeometry::roll
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
CSCLayer
Definition: CSCLayer.h:24
FastTrackerRecHitMaskProducer_cfi.trajectories
trajectories
Definition: FastTrackerRecHitMaskProducer_cfi.py:7
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
RPCRoll::isForward
bool isForward() const
Definition: RPCRoll.cc:43
DTStationIndex
Definition: DTStationIndex.h:4
Bounds::length
virtual float length() const =0
RectangularStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: RectangularStripTopology.cc:17
RPCRoll::topology
const Topology & topology() const override
Definition: RPCRoll.cc:18
RPCRoll::isBarrel
bool isBarrel() const
Definition: RPCRoll.cc:41
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
CSCGeometry
Definition: CSCGeometry.h:24
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
Propagator
Definition: Propagator.h:44
RPCRoll::id
RPCDetId id() const
Definition: RPCRoll.cc:16
DetId
Definition: DetId.h:17
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
debug
#define debug
Definition: HDRShower.cc:19
DTObjectMap::getRolls
std::set< RPCDetId > const & getRolls(DTStationIndex index) const
Definition: DTObjectMap.cc:36
RectangularStripTopology
Definition: RectangularStripTopology.h:11
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
TracktoRPC::propagatorToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
Definition: TracktoRPC.h:80
TracktoRPC::cscGeoToken_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeoToken_
Definition: TracktoRPC.h:78
TrapezoidalStripTopology
Definition: TrapezoidalStripTopology.h:21
RPCRecHit
Definition: RPCRecHit.h:14
DTObjectMap
Definition: DTObjectMap.h:11
CSCObjectMap::getRolls
std::set< RPCDetId > const & getRolls(CSCStationIndex index) const
Definition: CSCObjectMap.cc:42
Trajectories
std::vector< Trajectory > Trajectories
Definition: RPCRecHitFilter.h:59
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
RPCResidualsHLT_cfi.MaxD
MaxD
Definition: RPCResidualsHLT_cfi.py:18
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
Point3DBase< float, GlobalTag >
TracktoRPC::cscMapToken_
edm::ESGetToken< CSCObjectMap, MuonGeometryRecord > cscMapToken_
Definition: TracktoRPC.h:79
TracktoRPC::ValidRPCSurface
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const RPCGeometry *rpcGeo)
Definition: TracktoRPC.cc:21
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
RectangularStripTopology::stripLength
float stripLength() const override
Definition: RectangularStripTopology.h:44
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
CSCDetId
Definition: CSCDetId.h:26
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
RPCRoll::nstrips
int nstrips() const
Definition: RPCRoll.cc:24
PVValHelper::dy
Definition: PVValidationHelpers.h:49
DTLayer
Definition: DTLayer.h:25
TracktoRPC::dtMapToken_
edm::ESGetToken< DTObjectMap, MuonGeometryRecord > dtMapToken_
Definition: TracktoRPC.h:77
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PVValHelper::dz
Definition: PVValidationHelpers.h:50
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
BoundPlane
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
TrapezoidalStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: TrapezoidalStripTopology.cc:27
TracktoRPC::theTrackTransformer
std::unique_ptr< TrackTransformerBase > theTrackTransformer
Definition: TracktoRPC.h:81
RPCGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:32
RPCGeometry
Definition: RPCGeometry.h:20
DetId::Muon
Definition: DetId.h:26
DTChamberId
Definition: DTChamberId.h:14
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
edm::OwnVector::begin
iterator begin()
Definition: OwnVector.h:280
CSCStationIndex
Definition: GEMCSCSegmentBuilder.h:32
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7796
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
DTGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:77
edm::OwnVector::clear
void clear()
Definition: OwnVector.h:481
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
CSCObjectMap
Definition: CSCObjectMap.h:11
PVValHelper::dx
Definition: PVValidationHelpers.h:48
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector
Definition: OwnVector.h:24