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 (DTSuperLayer *sl)
 Add a DTSuperLayer to Geometry. More...
 
void add (DTLayer *l)
 Add a DTLayer 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 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

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

Definition at line 30 of file DTGeometry.h.

Constructor & Destructor Documentation

DTGeometry::DTGeometry ( )

Default constructor.

Definition at line 12 of file DTGeometry.cc.

12 {}
DTGeometry::~DTGeometry ( )
override

Destructor.

Definition at line 14 of file DTGeometry.cc.

References deallocate().

14  {
15  deallocate();
16 }
void deallocate()
Definition: DTGeometry.cc:18

Member Function Documentation

void DTGeometry::add ( DTChamber ch)
private

Add a DTChamber to Geometry.

Definition at line 44 of file DTGeometry.cc.

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

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

44  {
45  theDets.emplace_back(ch);
46  theChambers.emplace_back(ch);
47  theMap.insert(DTDetMap::value_type(ch->geographicalId(),ch));
48 }
DTDetMap theMap
Definition: DTGeometry.h:118
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:109
DetContainer theDets
Definition: DTGeometry.h:123
void DTGeometry::add ( DTSuperLayer sl)
private

Add a DTSuperLayer to Geometry.

Definition at line 51 of file DTGeometry.cc.

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

Referenced by counter.Counter::register().

51  {
52  theDets.emplace_back(sl);
53  theSuperLayers.emplace_back(sl);
54  theMap.insert(DTDetMap::value_type(sl->geographicalId(),sl));
55 }
DTDetMap theMap
Definition: DTGeometry.h:118
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:114
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
DetContainer theDets
Definition: DTGeometry.h:123
void DTGeometry::add ( DTLayer l)
private

Add a DTLayer to Geometry.

Definition at line 58 of file DTGeometry.cc.

References GeomDet::geographicalId(), checklumidiff::l, theDets, theDetUnits, theLayers, and theMap.

Referenced by counter.Counter::register().

58  {
59  theDetUnits.emplace_back(l);
60  theDets.emplace_back(l);
61  theLayers.emplace_back(l);
63 }
DTDetMap theMap
Definition: DTGeometry.h:118
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:115
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
DetContainer theDetUnits
Definition: DTGeometry.h:122
DetContainer theDets
Definition: DTGeometry.h:123
const DTChamber * DTGeometry::chamber ( const DTChamberId id) const
const std::vector< const DTChamber * > & DTGeometry::chambers ( ) const
void DTGeometry::clear ( void  )

Definition at line 24 of file DTGeometry.cc.

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

24  {
25  deallocate();
26 
27  theChambers.clear();
28  theSuperLayers.clear();
29  theLayers.clear();
30  theMap.clear();
31  theDetUnits.clear();
32  theDets.clear();
33  theDetTypes.clear();
34  theDetUnitIds.clear();
35  theDetIds.clear();
36 }
void deallocate()
Definition: DTGeometry.cc:18
DTDetMap theMap
Definition: DTGeometry.h:118
DetTypeContainer theDetTypes
Definition: DTGeometry.h:127
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:114
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:115
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:128
DetIdContainer theDetIds
Definition: DTGeometry.h:129
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:109
DetContainer theDetUnits
Definition: DTGeometry.h:122
DetContainer theDets
Definition: DTGeometry.h:123
void DTGeometry::deallocate ( )
private

Definition at line 18 of file DTGeometry.cc.

References theChambers.

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

18  {
19  // delete all the chambers (which will delete the SL which will delete the
20  // layers)
21  for (auto & theChamber : theChambers) delete theChamber;
22 }
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:109
const DTGeometry::DetIdContainer & DTGeometry::detIds ( ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 82 of file DTGeometry.cc.

References theDetIds.

82  {
83  // FIXME - fill it at runtime
84  return theDetIds;
85 }
DetIdContainer theDetIds
Definition: DTGeometry.h:129
const DTGeometry::DetContainer & DTGeometry::dets ( ) const
overridevirtual

Returm a vector of all GeomDet (including all GeomDetUnits)

Implements TrackingGeometry.

Definition at line 71 of file DTGeometry.cc.

References theDets.

Referenced by DTGeometryTest::analyze().

71  {
72  return theDets;
73 }
DetContainer theDets
Definition: DTGeometry.h:123
const DTGeometry::DetTypeContainer & DTGeometry::detTypes ( ) const
overridevirtual

Return a vector of all det types.

Implements TrackingGeometry.

Definition at line 38 of file DTGeometry.cc.

References theDetTypes.

Referenced by DTGeometryTest::analyze().

38  {
39  // FIXME - fill it at runtime
40  return theDetTypes;
41 }
DetTypeContainer theDetTypes
Definition: DTGeometry.h:127
const DTGeometry::DetIdContainer & DTGeometry::detUnitIds ( ) const
overridevirtual

Returm a vector of all GeomDetUnit DetIds.

Implements TrackingGeometry.

Definition at line 76 of file DTGeometry.cc.

References theDetUnitIds.

76  {
77  // FIXME - fill it at runtime
78  return theDetUnitIds;
79 }
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:128
const DTGeometry::DetContainer & DTGeometry::detUnits ( ) const
overridevirtual

Returm a vector of all GeomDet.

Implements TrackingGeometry.

Definition at line 66 of file DTGeometry.cc.

References theDetUnits.

Referenced by DTGeometryTest::analyze().

66  {
67  return theDetUnits;
68 }
DetContainer theDetUnits
Definition: DTGeometry.h:122
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 93 of file DTGeometry.cc.

References mps_fire::i, and theMap.

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

93  {
94  // Strip away wire#, if any!
95  DTLayerId lId(id.rawId());
96  DTDetMap::const_iterator i = theMap.find(lId);
97  return (i != theMap.end()) ?
98  i->second : nullptr ;
99 }
DTDetMap theMap
Definition: DTGeometry.h:118
const GeomDet * DTGeometry::idToDetUnit ( DetId  ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 88 of file DTGeometry.cc.

References idToDet().

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

88  {
89  return dynamic_cast<const GeomDet*>(idToDet(id));
90 }
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:93
const DTLayer * DTGeometry::layer ( const DTLayerId id) const
const std::vector< const DTLayer * > & DTGeometry::layers ( ) const

Return a vector of all SuperLayer.

Definition at line 112 of file DTGeometry.cc.

References theLayers.

Referenced by FWRecoGeometryESProducer::addDTGeometry(), DTGeometryTest::analyze(), DTDCSByLumiTask::endLuminosityBlock(), DTGeometryValidate::validateDTLayerGeometry(), and ValidateGeometry::validateDTLayerGeometry().

112  {
113  return theLayers;
114 }
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:115
const DTSuperLayer * DTGeometry::superLayer ( const DTSuperLayerId id) const
const std::vector< const DTSuperLayer * > & DTGeometry::superLayers ( ) const

Return a vector of all SuperLayer.

Definition at line 107 of file DTGeometry.cc.

References theSuperLayers.

Referenced by DTGeometryTest::analyze(), DTTTrigWriter::analyze(), DTVDriftWriter::endJob(), DTT0Correction::endJob(), DTTTrigCorrection::endJob(), DTT0Calibration::endJob(), and dtCalibration::DTTTrigFillWithAverage::getAverage().

107  {
108  return theSuperLayers;
109 }
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:114

Friends And Related Function Documentation

friend class cms::DTGeometryBuilder
friend

Definition at line 89 of file DTGeometry.h.

friend class DTGeometryBuilderFromCondDB
friend

Definition at line 91 of file DTGeometry.h.

friend class DTGeometryBuilderFromDDD
friend

Definition at line 90 of file DTGeometry.h.

friend class GeometryAligner
friend

Definition at line 93 of file DTGeometry.h.

Member Data Documentation

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

Definition at line 109 of file DTGeometry.h.

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

DetIdContainer DTGeometry::theDetIds
private

Definition at line 129 of file DTGeometry.h.

Referenced by clear(), and detIds().

DetContainer DTGeometry::theDets
private

Definition at line 123 of file DTGeometry.h.

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

DetTypeContainer DTGeometry::theDetTypes
private

Definition at line 127 of file DTGeometry.h.

Referenced by clear(), and detTypes().

DetIdContainer DTGeometry::theDetUnitIds
private

Definition at line 128 of file DTGeometry.h.

Referenced by clear(), and detUnitIds().

DetContainer DTGeometry::theDetUnits
private

Definition at line 122 of file DTGeometry.h.

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

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

Definition at line 115 of file DTGeometry.h.

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

DTDetMap DTGeometry::theMap
private

Definition at line 118 of file DTGeometry.h.

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

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

Definition at line 114 of file DTGeometry.h.

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