Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:35

0001 #include "TrackingTools/RecoGeometry/interface/GlobalDetLayerGeometry.h"
0002 #include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
0003 #include "FWCore/Utilities/interface/typelookup.h"
0004 
0005 const DetLayer* GlobalDetLayerGeometry::idToLayer(const DetId& detId) const {
0006   if (detId.det() == DetId::Tracker)
0007     return tracker_->idToLayer(detId);
0008   else if (detId.det() == DetId::Muon)
0009     return muon_->idToLayer(detId);
0010   else if (mtd_ != nullptr && detId.det() == DetId::Forward && detId.subdetId() == FastTime)
0011     return mtd_->idToLayer(detId);
0012   else {
0013     throw cms::Exception("DetLayers")
0014         << "Error: called GlobalDetLayerGeometry::idToLayer() for a detId which is neither Tracker nor Muon "
0015         << (mtd_ == nullptr ? "" : "nor MTD ") << " det rawId " << detId.rawId() << " det " << detId.det()
0016         << " subdetId " << detId.subdetId();
0017   }
0018 }
0019 
0020 TYPELOOKUP_DATA_REG(GlobalDetLayerGeometry);