CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuonTransientTrackingRecHitBuilder.cc
Go to the documentation of this file.
1 
15 
18  : theTrackingGeometry(trackingGeometry) {}
19 
21  const TrackingRecHit* p, edm::ESHandle<GlobalTrackingGeometry> trackingGeometry) const {
22  if (p->geographicalId().det() == DetId::Muon) {
23  return MuonTransientTrackingRecHit::specificBuild(trackingGeometry->idToDet(p->geographicalId()), p);
24  }
25 
26  return RecHitPointer();
27 }
28 
30  const TrackingRecHit* p) const {
32  return build(p, theTrackingGeometry);
33  else
34  throw cms::Exception("Muon|RecoMuon|MuonTransientTrackingRecHitBuilder")
35  << "ERROR! You are trying to build a MuonTransientTrackingRecHit with a non valid GlobalTrackingGeometry";
36 }
37 
39  const trackingRecHit_iterator& start, const trackingRecHit_iterator& stop) const {
41  for (trackingRecHit_iterator hit = start; hit != stop; ++hit)
42  result.push_back(build(&**hit));
43 
44  return result;
45 }
RecHitPointer build(const TrackingRecHit *p, edm::ESHandle< GlobalTrackingGeometry > trackingGeometry) const
Call the MuonTransientTrackingRecHit::specificBuild.
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
TransientTrackingRecHit::RecHitPointer RecHitPointer
tuple result
Definition: mps_fire.py:311
MuonTransientTrackingRecHitBuilder(edm::ESHandle< GlobalTrackingGeometry > trackingGeometry=nullptr)
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
DetId geographicalId() const
bool isValid() const
Definition: ESHandle.h:44
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46