CMS 3D CMS Logo

DTGeometry.cc
Go to the documentation of this file.
1 
8 
9 #include <algorithm>
10 #include <iostream>
11 
13 
15 
17  // delete all the chambers (which will delete the SL which will delete the
18  // layers)
19  for (auto& theChamber : theChambers)
20  delete theChamber;
21 }
22 
24  deallocate();
25 
26  theChambers.clear();
27  theSuperLayers.clear();
28  theLayers.clear();
29  theMap.clear();
30  theDetUnits.clear();
31  theDets.clear();
32  theDetTypes.clear();
33  theDetUnitIds.clear();
34  theDetIds.clear();
35 }
36 
38  // FIXME - fill it at runtime
39  return theDetTypes;
40 }
41 
43  theDets.emplace_back(ch);
44  theChambers.emplace_back(ch);
45  theMap.insert(DTDetMap::value_type(ch->geographicalId(), ch));
46 }
47 
49  theDets.emplace_back(sl);
50  theSuperLayers.emplace_back(sl);
51  theMap.insert(DTDetMap::value_type(sl->geographicalId(), sl));
52 }
53 
55  theDetUnits.emplace_back(l);
56  theDets.emplace_back(l);
57  theLayers.emplace_back(l);
58  theMap.insert(DTDetMap::value_type(l->geographicalId(), l));
59 }
60 
62 
64 
66  // FIXME - fill it at runtime
67  return theDetUnitIds;
68 }
69 
71  // FIXME - fill it at runtime
72  return theDetIds;
73 }
74 
75 const GeomDet* DTGeometry::idToDetUnit(DetId id) const { return dynamic_cast<const GeomDet*>(idToDet(id)); }
76 
77 const GeomDet* DTGeometry::idToDet(DetId id) const {
78  // Strip away wire#, if any!
79  DTLayerId lId(id.rawId());
80  DTDetMap::const_iterator i = theMap.find(lId);
81  return (i != theMap.end()) ? i->second : nullptr;
82 }
83 
84 const std::vector<const DTChamber*>& DTGeometry::chambers() const { return theChambers; }
85 
86 const std::vector<const DTSuperLayer*>& DTGeometry::superLayers() const { return theSuperLayers; }
87 
88 const std::vector<const DTLayer*>& DTGeometry::layers() const { return theLayers; }
89 
90 const DTChamber* DTGeometry::chamber(const DTChamberId& id) const { return (const DTChamber*)(idToDet(id)); }
91 
93  return (const DTSuperLayer*)(idToDet(id));
94 }
95 
96 const DTLayer* DTGeometry::layer(const DTLayerId& id) const { return (const DTLayer*)(idToDet(id)); }
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTGeometry::theChambers
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:103
DTGeometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: DTGeometry.cc:65
mps_fire.i
i
Definition: mps_fire.py:355
DTGeometry::theDetIds
DetIdContainer theDetIds
Definition: DTGeometry.h:123
GeomDet
Definition: GeomDet.h:27
DTGeometry::theDetUnitIds
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:122
DTGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DTGeometry.cc:75
DTGeometry::theDetUnits
DetContainer theDetUnits
Definition: DTGeometry.h:116
DTChamber
Definition: DTChamber.h:24
DTSuperLayer
Definition: DTSuperLayer.h:24
DTGeometry::chamber
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
DetId
Definition: DetId.h:17
DTGeometry::theDets
DetContainer theDets
Definition: DTGeometry.h:117
DTGeometry::layers
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:88
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
DTGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:63
DTLayerId
Definition: DTLayerId.h:12
DTGeometry.h
TrackingGeometry::DetTypeContainer
std::vector< const GeomDetType * > DetTypeContainer
Definition: TrackingGeometry.h:28
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTGeometry::add
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:42
DTGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: DTGeometry.cc:70
TrackingGeometry::DetContainer
std::vector< const GeomDet * > DetContainer
Definition: TrackingGeometry.h:29
DTGeometry::deallocate
void deallocate()
Definition: DTGeometry.cc:16
DTGeometry::superLayers
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:86
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
DTLayer
Definition: DTLayer.h:25
DTGeometry::theMap
DTDetMap theMap
Definition: DTGeometry.h:112
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
DTGeometry::theDetTypes
DetTypeContainer theDetTypes
Definition: DTGeometry.h:121
DTGeometry::~DTGeometry
~DTGeometry() override
Destructor.
Definition: DTGeometry.cc:14
GeomDet.h
DTGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: DTGeometry.cc:61
DTGeometry::theSuperLayers
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:108
DTGeometry::theLayers
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:109
DTGeometry::DTGeometry
DTGeometry()
Default constructor.
Definition: DTGeometry.cc:12
DTGeometry::superLayer
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:92
DTChamberId
Definition: DTChamberId.h:14
DTGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:77
DTGeometry::clear
void clear()
Definition: DTGeometry.cc:23
DTGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: DTGeometry.cc:37