CMS 3D CMS Logo

GlobalDetLayerGeometry.cc
Go to the documentation of this file.
4 
5 const DetLayer* GlobalDetLayerGeometry::idToLayer(const DetId& detId) const {
6  if (detId.det() == DetId::Tracker)
7  return tracker_->idToLayer(detId);
8  else if (detId.det() == DetId::Muon)
9  return muon_->idToLayer(detId);
10  else if (mtd_ != nullptr && detId.det() == DetId::Forward && detId.subdetId() == FastTime)
11  return mtd_->idToLayer(detId);
12  else {
13  throw cms::Exception("DetLayers")
14  << "Error: called GlobalDetLayerGeometry::idToLayer() for a detId which is neither Tracker nor Muon "
15  << (mtd_ == nullptr ? "" : "nor MTD ") << " det rawId " << detId.rawId() << " det " << detId.det()
16  << " subdetId " << detId.subdetId();
17  }
18 }
19 
GlobalDetLayerGeometry::muon_
const MuonDetLayerGeometry * muon_
Definition: GlobalDetLayerGeometry.h:44
DetLayer
Definition: DetLayer.h:21
MuonDetLayerGeometry::idToLayer
const DetLayer * idToLayer(const DetId &detId) const override
return the DetLayer which correspond to a certain DetId
Definition: MuonDetLayerGeometry.cc:215
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
typelookup.h
GlobalDetLayerGeometry::tracker_
const GeometricSearchTracker * tracker_
Definition: GlobalDetLayerGeometry.h:43
ForwardSubdetector.h
DetId
Definition: DetId.h:17
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
DetId::Tracker
Definition: DetId.h:25
FastTime
Definition: ForwardSubdetector.h:6
MTDDetLayerGeometry::idToLayer
const DetLayer * idToLayer(const DetId &detId) const override
return the DetLayer which correspond to a certain DetId
Definition: MTDDetLayerGeometry.cc:97
GlobalDetLayerGeometry::idToLayer
const DetLayer * idToLayer(const DetId &detId) const override
Give the DetId of a module, returns the pointer to the corresponding DetLayer.
Definition: GlobalDetLayerGeometry.cc:5
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
GlobalDetLayerGeometry.h
GeometricSearchTracker::idToLayer
const DetLayer * idToLayer(const DetId &detId) const override
Give the DetId of a module, returns the pointer to the corresponding DetLayer.
Definition: GeometricSearchTracker.cc:80
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Exception
Definition: hltDiff.cc:245
GlobalDetLayerGeometry::mtd_
const MTDDetLayerGeometry * mtd_
Definition: GlobalDetLayerGeometry.h:45
GlobalDetLayerGeometry
Definition: GlobalDetLayerGeometry.h:20
DetId::Muon
Definition: DetId.h:26
DetId::Forward
Definition: DetId.h:30