CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
DTGeometry Class Reference

#include <DTGeometry.h>

Inheritance diagram for DTGeometry:
TrackingGeometry

Public Member Functions

const DTChamberchamber (const DTChamberId &id) const
 Return a DTChamber given its id. More...
 
const std::vector< const DTChamber * > & chambers () const
 Return a vector of all Chamber. More...
 
void clear ()
 
const DetIdContainerdetIds () const override
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits) More...
 
const DetContainerdets () const override
 Returm a vector of all GeomDet (including all GeomDetUnits) More...
 
const DetTypeContainerdetTypes () const override
 Return a vector of all det types. More...
 
const DetIdContainerdetUnitIds () const override
 Returm a vector of all GeomDetUnit DetIds. More...
 
const DetContainerdetUnits () const override
 Returm a vector of all GeomDet. More...
 
 DTGeometry ()
 Default constructor. More...
 
const GeomDetidToDet (DetId) const override
 
const GeomDetidToDetUnit (DetId) const override
 Return the pointer to the GeomDetUnit corresponding to a given DetId. More...
 
const DTLayerlayer (const DTLayerId &id) const
 Return a layer given its id. More...
 
const std::vector< const DTLayer * > & layers () const
 Return a vector of all SuperLayer. More...
 
const DTSuperLayersuperLayer (const DTSuperLayerId &id) const
 Return a DTSuperLayer given its id. More...
 
const std::vector< const DTSuperLayer * > & superLayers () const
 Return a vector of all SuperLayer. More...
 
 ~DTGeometry () override
 Destructor. More...
 
- Public Member Functions inherited from TrackingGeometry
virtual ~TrackingGeometry ()
 Destructor. More...
 

Private Types

typedef std::map< DetId, GeomDet * > DTDetMap
 

Private Member Functions

void add (DTChamber *ch)
 Add a DTChamber to Geometry. More...
 
void add (DTLayer *l)
 Add a DTLayer to Geometry. More...
 
void add (DTSuperLayer *sl)
 Add a DTSuperLayer to Geometry. More...
 
void deallocate ()
 

Private Attributes

std::vector< const DTChamber * > theChambers
 
DetIdContainer theDetIds
 
DetContainer theDets
 
DetTypeContainer theDetTypes
 
DetIdContainer theDetUnitIds
 
DetContainer theDetUnits
 
std::vector< const DTLayer * > theLayers
 
DTDetMap theMap
 
std::vector< const DTSuperLayer * > theSuperLayers
 

Friends

class cms::DTGeometryBuilder
 
class DTGeometryBuilderFromCondDB
 
class DTGeometryBuilderFromDD4Hep
 
class DTGeometryBuilderFromDDD
 
class GeometryAligner
 

Additional Inherited Members

- Public Types inherited from TrackingGeometry
using DetContainer = std::vector< const GeomDet * >
 
using DetIdContainer = std::vector< DetId >
 
using DetTypeContainer = std::vector< const GeomDetType * >
 
using mapIdToDet = std::unordered_map< unsigned int, const GeomDet * >
 
using mapIdToDetUnit = std::unordered_map< unsigned int, const GeomDet * >
 

Detailed Description

The model of the geometry of Muon Drift Tube detectors.

The geometry owns the DTChamber s; these own their DTSuperLayer s which in turn own their DTLayer s.

Author
N. Amapane - CERN

Definition at line 28 of file DTGeometry.h.

Member Typedef Documentation

◆ DTDetMap

typedef std::map<DetId, GeomDet*> DTGeometry::DTDetMap
private

Definition at line 29 of file DTGeometry.h.

Constructor & Destructor Documentation

◆ DTGeometry()

DTGeometry::DTGeometry ( )

Default constructor.

Definition at line 12 of file DTGeometry.cc.

12 {}

◆ ~DTGeometry()

DTGeometry::~DTGeometry ( )
override

Destructor.

Definition at line 14 of file DTGeometry.cc.

14 { deallocate(); }

References deallocate().

Member Function Documentation

◆ add() [1/3]

void DTGeometry::add ( DTChamber ch)
private

Add a DTChamber to Geometry.

Definition at line 42 of file DTGeometry.cc.

42  {
43  theDets.emplace_back(ch);
44  theChambers.emplace_back(ch);
45  theMap.insert(DTDetMap::value_type(ch->geographicalId(), ch));
46 }

References GeomDet::geographicalId(), theChambers, theDets, and theMap.

Referenced by DTGeometryBuilderFromDDD::buildGeometry(), and counter.Counter::register().

◆ add() [2/3]

void DTGeometry::add ( DTLayer l)
private

Add a DTLayer to Geometry.

Definition at line 54 of file DTGeometry.cc.

54  {
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 }

References cmsLHEtoEOSManager::l, theDets, theDetUnits, theLayers, and theMap.

Referenced by counter.Counter::register().

◆ add() [3/3]

void DTGeometry::add ( DTSuperLayer sl)
private

Add a DTSuperLayer to Geometry.

Definition at line 48 of file DTGeometry.cc.

48  {
49  theDets.emplace_back(sl);
50  theSuperLayers.emplace_back(sl);
51  theMap.insert(DTDetMap::value_type(sl->geographicalId(), sl));
52 }

References GeomDet::geographicalId(), theDets, theMap, and theSuperLayers.

Referenced by counter.Counter::register().

◆ chamber()

const DTChamber * DTGeometry::chamber ( const DTChamberId id) const

◆ chambers()

const std::vector< const DTChamber * > & DTGeometry::chambers ( ) const

◆ clear()

void DTGeometry::clear ( void  )

Definition at line 23 of file DTGeometry.cc.

23  {
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 }

References deallocate(), theChambers, theDetIds, theDets, theDetTypes, theDetUnitIds, theDetUnits, theLayers, theMap, and theSuperLayers.

◆ deallocate()

void DTGeometry::deallocate ( )
private

Definition at line 16 of file DTGeometry.cc.

16  {
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 }

References theChambers.

Referenced by clear(), and ~DTGeometry().

◆ detIds()

const DTGeometry::DetIdContainer & DTGeometry::detIds ( ) const
overridevirtual

Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)

Implements TrackingGeometry.

Definition at line 70 of file DTGeometry.cc.

70  {
71  // FIXME - fill it at runtime
72  return theDetIds;
73 }

References theDetIds.

◆ dets()

const DTGeometry::DetContainer & DTGeometry::dets ( ) const
overridevirtual

Returm a vector of all GeomDet (including all GeomDetUnits)

Implements TrackingGeometry.

Definition at line 63 of file DTGeometry.cc.

63 { return theDets; }

References theDets.

Referenced by DTGeometryTest::analyze().

◆ detTypes()

const DTGeometry::DetTypeContainer & DTGeometry::detTypes ( ) const
overridevirtual

Return a vector of all det types.

Implements TrackingGeometry.

Definition at line 37 of file DTGeometry.cc.

37  {
38  // FIXME - fill it at runtime
39  return theDetTypes;
40 }

References theDetTypes.

Referenced by DTGeometryTest::analyze().

◆ detUnitIds()

const DTGeometry::DetIdContainer & DTGeometry::detUnitIds ( ) const
overridevirtual

Returm a vector of all GeomDetUnit DetIds.

Implements TrackingGeometry.

Definition at line 65 of file DTGeometry.cc.

65  {
66  // FIXME - fill it at runtime
67  return theDetUnitIds;
68 }

References theDetUnitIds.

◆ detUnits()

const DTGeometry::DetContainer & DTGeometry::detUnits ( ) const
overridevirtual

Returm a vector of all GeomDet.

Implements TrackingGeometry.

Definition at line 61 of file DTGeometry.cc.

61 { return theDetUnits; }

References theDetUnits.

Referenced by DTGeometryTest::analyze().

◆ idToDet()

const GeomDet * DTGeometry::idToDet ( DetId  ) const
overridevirtual

Return the pointer to the GeomDet corresponding to a given DetId (valid also for GeomDetUnits)

Implements TrackingGeometry.

Definition at line 77 of file DTGeometry.cc.

77  {
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 }

References mps_fire::i, and theMap.

Referenced by MuonGeometrySanityCheck::analyze(), MuonDTDetLayerGeometryBuilder::buildLayers(), DTSegmentUpdator::calculateT0corr(), chamber(), DTSegmentUpdator::fit(), idToDetUnit(), layer(), MuonSegmentProducer::produce(), TrackerToMuonPropagator::produce(), DTSurvey::ReadChambers(), DTSegmentUpdator::rejectBadHits(), superLayer(), DTSegtoRPC::thePoints(), TracktoRPC::thePoints(), and DTSegmentUpdator::update().

◆ idToDetUnit()

const GeomDet * DTGeometry::idToDetUnit ( DetId  ) const
overridevirtual

Return the pointer to the GeomDetUnit corresponding to a given DetId.

Implements TrackingGeometry.

Definition at line 75 of file DTGeometry.cc.

75 { return dynamic_cast<const GeomDet*>(idToDet(id)); }

References idToDet().

Referenced by MuonSimHitsValidAnalyzer::fillDT(), and MuonSimHitProducer::produce().

◆ layer()

const DTLayer * DTGeometry::layer ( const DTLayerId id) const

◆ layers()

const std::vector< const DTLayer * > & DTGeometry::layers ( ) const

◆ superLayer()

const DTSuperLayer * DTGeometry::superLayer ( const DTSuperLayerId id) const

◆ superLayers()

const std::vector< const DTSuperLayer * > & DTGeometry::superLayers ( ) const

Friends And Related Function Documentation

◆ cms::DTGeometryBuilder

friend class cms::DTGeometryBuilder
friend

Definition at line 84 of file DTGeometry.h.

◆ DTGeometryBuilderFromCondDB

friend class DTGeometryBuilderFromCondDB
friend

Definition at line 87 of file DTGeometry.h.

◆ DTGeometryBuilderFromDD4Hep

friend class DTGeometryBuilderFromDD4Hep
friend

Definition at line 86 of file DTGeometry.h.

◆ DTGeometryBuilderFromDDD

friend class DTGeometryBuilderFromDDD
friend

Definition at line 85 of file DTGeometry.h.

◆ GeometryAligner

friend class GeometryAligner
friend

Definition at line 89 of file DTGeometry.h.

Member Data Documentation

◆ theChambers

std::vector<const DTChamber*> DTGeometry::theChambers
private

Definition at line 104 of file DTGeometry.h.

Referenced by add(), chambers(), clear(), and deallocate().

◆ theDetIds

DetIdContainer DTGeometry::theDetIds
private

Definition at line 124 of file DTGeometry.h.

Referenced by clear(), and detIds().

◆ theDets

DetContainer DTGeometry::theDets
private

Definition at line 118 of file DTGeometry.h.

Referenced by add(), clear(), and dets().

◆ theDetTypes

DetTypeContainer DTGeometry::theDetTypes
private

Definition at line 122 of file DTGeometry.h.

Referenced by clear(), and detTypes().

◆ theDetUnitIds

DetIdContainer DTGeometry::theDetUnitIds
private

Definition at line 123 of file DTGeometry.h.

Referenced by clear(), and detUnitIds().

◆ theDetUnits

DetContainer DTGeometry::theDetUnits
private

Definition at line 117 of file DTGeometry.h.

Referenced by add(), clear(), and detUnits().

◆ theLayers

std::vector<const DTLayer*> DTGeometry::theLayers
private

Definition at line 110 of file DTGeometry.h.

Referenced by add(), clear(), and layers().

◆ theMap

DTDetMap DTGeometry::theMap
private

Definition at line 113 of file DTGeometry.h.

Referenced by add(), clear(), and idToDet().

◆ theSuperLayers

std::vector<const DTSuperLayer*> DTGeometry::theSuperLayers
private

Definition at line 109 of file DTGeometry.h.

Referenced by add(), clear(), and superLayers().

DTGeometry::theChambers
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:104
mps_fire.i
i
Definition: mps_fire.py:428
DTGeometry::theDetIds
DetIdContainer theDetIds
Definition: DTGeometry.h:124
DTGeometry::theDetUnitIds
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:123
DTGeometry::theDetUnits
DetContainer theDetUnits
Definition: DTGeometry.h:117
DTChamber
Definition: DTChamber.h:24
DTSuperLayer
Definition: DTSuperLayer.h:24
DTGeometry::theDets
DetContainer theDets
Definition: DTGeometry.h:118
DTLayerId
Definition: DTLayerId.h:12
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
DTGeometry::deallocate
void deallocate()
Definition: DTGeometry.cc:16
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:113
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
DTGeometry::theDetTypes
DetTypeContainer theDetTypes
Definition: DTGeometry.h:122
DTGeometry::theSuperLayers
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:109
DTGeometry::theLayers
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:110
DTGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:77