CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
CSCGeometry Class Reference

#include <CSCGeometry.h>

Inheritance diagram for CSCGeometry:
TrackingGeometry

Public Types

typedef std::vector< const
CSCChamber * > 
ChamberContainer
 
typedef std::vector< const
CSCLayer * > 
LayerContainer
 
- Public Types inherited from TrackingGeometry
typedef std::vector< GeomDet
const * > 
DetContainer
 
typedef std::vector< DetIdDetIdContainer
 
typedef std::vector
< GeomDetType const * > 
DetTypeContainer
 
typedef std::vector
< GeomDetUnit const * > 
DetUnitContainer
 
typedef std::unordered_map
< unsigned int, GeomDet const * > 
mapIdToDet
 
typedef std::unordered_map
< unsigned int, GeomDetUnit
const * > 
mapIdToDetUnit
 

Public Member Functions

const CSCChamberSpecsbuildSpecs (int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
 
bool centreTIOffsets () const
 
const CSCChamberchamber (CSCDetId id) const
 Return the chamber corresponding to given DetId. More...
 
const ChamberContainerchambers () const
 Return a vector of all chambers. More...
 
 CSCGeometry ()
 Default constructor. More...
 
 CSCGeometry (bool debugV, bool gangedstripsME1a_, bool onlywiresME1a_, bool realWireGeometry_, bool useCentreTIOffsets_)
 Real constructor. More...
 
virtual const DetIdContainerdetIds () const override
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits) More...
 
virtual const DetContainerdets () const override
 Returm a vector of all GeomDet (including all GeomDetUnits) More...
 
virtual const DetTypeContainerdetTypes () const override
 Return a vector of all det types. More...
 
virtual const DetIdContainerdetUnitIds () const override
 Returm a vector of all GeomDetUnit DetIds. More...
 
virtual const DetUnitContainerdetUnits () const override
 Returm a vector of all GeomDetUnit. More...
 
const CSCChamberSpecsfindSpecs (int iChamberType)
 
bool gangedStrips () const
 
virtual const GeomDetidToDet (DetId) const override
 
virtual const GeomDetUnitidToDetUnit (DetId) const override
 Return the pointer to the GeomDetUnit corresponding to a given DetId. More...
 
const CSCLayerlayer (CSCDetId id) const
 Return the layer corresponding to given DetId. More...
 
const LayerContainerlayers () const
 Return a vector of all layers. More...
 
void queryModelling () const
 Dump parameters for overall strip and wire modelling. More...
 
bool realWireGeometry () const
 
void setDebugV (bool dbgv)
 
void setGangedStripsInME1a (bool gs)
 
void setOnlyWiresInME1a (bool ow)
 
void setUseCentreTIOffsets (bool cti)
 
void setUseRealWireGeometry (bool rwg)
 
bool wiresOnly () const
 
virtual ~CSCGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from TrackingGeometry
virtual ~TrackingGeometry ()
 Destructor. More...
 

Private Types

typedef std::map< DetId,
GeomDet * > 
CSCDetMap
 
typedef std::map< int, const
CSCChamberSpecs *, std::less
< int > > 
CSCSpecsContainer
 

Private Member Functions

void addChamber (CSCChamber *ch)
 Add a chamber with given DetId. More...
 
void addDet (GeomDet *det)
 Add a GeomDet; not to be called by the builder. More...
 
void addDetId (DetId id)
 Add a DetId. More...
 
void addDetType (GeomDetType *type)
 Add a DetType. More...
 
void addLayer (CSCLayer *l)
 Add a DetUnit. More...
 

Private Attributes

bool debugV_
 
bool gangedstripsME1a_
 
bool onlywiresME1a_
 
bool realWireGeometry_
 
CSCSpecsContainer specsContainer
 
ChamberContainer theChambers
 
DetIdContainer theDetIds
 
DetContainer theDets
 
DetTypeContainer theDetTypes
 
DetIdContainer theDetUnitIds
 
DetUnitContainer theDetUnits
 
LayerContainer theLayers
 
CSCDetMap theMap
 
bool useCentreTIOffsets_
 

Friends

class CSCGeometryBuilder
 
class GeometryAligner
 

Detailed Description

The model of the geometry of the endcap muon CSC detectors.

Author
Tim Cox

Definition at line 24 of file CSCGeometry.h.

Member Typedef Documentation

typedef std::vector<const CSCChamber*> CSCGeometry::ChamberContainer

Definition at line 32 of file CSCGeometry.h.

typedef std::map<DetId, GeomDet*> CSCGeometry::CSCDetMap
private

Definition at line 26 of file CSCGeometry.h.

typedef std::map<int, const CSCChamberSpecs*, std::less<int> > CSCGeometry::CSCSpecsContainer
private

Definition at line 28 of file CSCGeometry.h.

typedef std::vector<const CSCLayer*> CSCGeometry::LayerContainer

Definition at line 33 of file CSCGeometry.h.

Constructor & Destructor Documentation

CSCGeometry::CSCGeometry ( )

Default constructor.

Definition at line 10 of file CSCGeometry.cc.

References debugV_, and queryModelling().

10  : debugV_(false), gangedstripsME1a_(true),
12  if ( debugV_ ) queryModelling();
13 }
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:128
bool realWireGeometry_
Definition: CSCGeometry.h:176
bool useCentreTIOffsets_
Definition: CSCGeometry.h:177
bool gangedstripsME1a_
Definition: CSCGeometry.h:174
bool onlywiresME1a_
Definition: CSCGeometry.h:175
CSCGeometry::CSCGeometry ( bool  debugV,
bool  gangedstripsME1a_,
bool  onlywiresME1a_,
bool  realWireGeometry_,
bool  useCentreTIOffsets_ 
)

Real constructor.

Definition at line 15 of file CSCGeometry.cc.

References debugV_, and queryModelling().

15  :
16  debugV_(dbgv), gangedstripsME1a_( gangedstripsME1a ), onlywiresME1a_( onlywiresME1a ),
17  realWireGeometry_( realWireGeometry ), useCentreTIOffsets_( useCentreTIOffsets ) {
18  if ( debugV_ ) queryModelling();
19 }
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:128
bool realWireGeometry_
Definition: CSCGeometry.h:176
bool realWireGeometry() const
Definition: CSCGeometry.h:125
bool useCentreTIOffsets_
Definition: CSCGeometry.h:177
bool gangedstripsME1a_
Definition: CSCGeometry.h:174
bool onlywiresME1a_
Definition: CSCGeometry.h:175
CSCGeometry::~CSCGeometry ( )
virtual

Destructor.

Definition at line 21 of file CSCGeometry.cc.

References specsContainer, and theChambers.

21  {
22 
23  // delete all the chambers (which will delete the layers)
24  for (ChamberContainer::const_iterator ich=theChambers.begin();
25  ich!=theChambers.end(); ++ich) delete (*ich);
26 
27  // delete specs
28  for ( CSCSpecsContainer::const_iterator it =
29  specsContainer.begin(); it!=specsContainer.end(); ++it) {
30  delete (*it).second; // they are never shared per chamber type so should be no possible double deletion.
31  }
32 
33 }
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:180
ChamberContainer theChambers
Definition: CSCGeometry.h:154

Member Function Documentation

void CSCGeometry::addChamber ( CSCChamber ch)
private

Add a chamber with given DetId.

Definition at line 36 of file CSCGeometry.cc.

References addDet(), and theChambers.

36  {
37  theChambers.push_back(ch);
38  addDet(ch);
39 }
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:56
ChamberContainer theChambers
Definition: CSCGeometry.h:154
void CSCGeometry::addDet ( GeomDet det)
private

Add a GeomDet; not to be called by the builder.

Definition at line 56 of file CSCGeometry.cc.

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

Referenced by addChamber(), and addLayer().

56  {
57  theDets.push_back(det);
58  theDetIds.push_back(det->geographicalId());
59  theMap.insert(CSCDetMap::value_type(det->geographicalId(),det));
60 }
CSCDetMap theMap
Definition: CSCGeometry.h:157
DetContainer theDets
Definition: CSCGeometry.h:162
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
DetIdContainer theDetIds
Definition: CSCGeometry.h:164
void CSCGeometry::addDetId ( DetId  id)
private

Add a DetId.

void CSCGeometry::addDetType ( GeomDetType type)
private

Add a DetType.

Definition at line 51 of file CSCGeometry.cc.

References theDetTypes.

51  {
52  theDetTypes.push_back(type);
53 }
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:161
void CSCGeometry::addLayer ( CSCLayer l)
private

Add a DetUnit.

Definition at line 42 of file CSCGeometry.cc.

References addDet(), CSCLayer::chamber(), GeomDet::geographicalId(), CSCChamber::specs(), theDetTypes, theDetUnitIds, theDetUnits, and theLayers.

42  {
43  theDetUnits.push_back(l);
44  theLayers.push_back(l);
45  theDetTypes.push_back(l->chamber()->specs());
46  theDetUnitIds.push_back(l->geographicalId());
47  addDet(l);
48 }
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:56
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:163
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:161
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:165
LayerContainer theLayers
Definition: CSCGeometry.h:168
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
const CSCChamberSpecs * CSCGeometry::buildSpecs ( int  iChamberType,
const std::vector< float > &  fpar,
const std::vector< float > &  fupar,
const CSCWireGroupPackage wg 
)

Build CSCChamberSpecs for given chamber type.

@ a good candidate to be replaced by a factory?

Definition at line 176 of file CSCGeometry.cc.

References specsContainer.

179  {
180 
181  // Note arg list order is hbot, htop, apothem, hthickness
182  TrapezoidalPlaneBounds bounds( fpar[0], fpar[1], fpar[3], fpar[2] );
183  const CSCChamberSpecs* aSpecs = new CSCChamberSpecs( this, iChamberType, bounds, fupar, wg );
184  specsContainer[ iChamberType ] = aSpecs;
185  return aSpecs;
186 }
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:180
bool CSCGeometry::centreTIOffsets ( ) const
inline

Use the backed-out offsets for theCentreToIntersection in CSCLayerGeometry

Definition at line 131 of file CSCGeometry.h.

References useCentreTIOffsets_.

131 { return useCentreTIOffsets_; }
bool useCentreTIOffsets_
Definition: CSCGeometry.h:177
const CSCChamber * CSCGeometry::chamber ( CSCDetId  id) const

Return the chamber corresponding to given DetId.

Definition at line 118 of file CSCGeometry.cc.

References Reference_intrackfit_cff::endcap, idToDet(), relativeConstraints::ring, and relativeConstraints::station.

Referenced by CSCSegmentBuilder::build(), CSCTriggerGeomManager::chamber(), and CSCTriggerGeomManager::sectorOfChambersInStation().

118  {
119  CSCDetId id1(id.endcap(), id.station(), id.ring(), id.chamber(), 0);
120  return dynamic_cast<const CSCChamber*>(idToDet(id1));
121 }
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
virtual const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:99
const CSCGeometry::ChamberContainer & CSCGeometry::chambers ( ) const

Return a vector of all chambers.

Definition at line 106 of file CSCGeometry.cc.

References theChambers.

107 {
108  return theChambers;
109 }
ChamberContainer theChambers
Definition: CSCGeometry.h:154
const CSCGeometry::DetIdContainer & CSCGeometry::detIds ( ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 87 of file CSCGeometry.cc.

References theDetIds.

88 {
89  return theDetIds;
90 }
DetIdContainer theDetIds
Definition: CSCGeometry.h:164
const CSCGeometry::DetContainer & CSCGeometry::dets ( ) const
overridevirtual

Returm a vector of all GeomDet (including all GeomDetUnits)

Implements TrackingGeometry.

Definition at line 75 of file CSCGeometry.cc.

References theDets.

76 {
77  return theDets;
78 }
DetContainer theDets
Definition: CSCGeometry.h:162
const CSCGeometry::DetTypeContainer & CSCGeometry::detTypes ( ) const
overridevirtual

Return a vector of all det types.

Implements TrackingGeometry.

Definition at line 63 of file CSCGeometry.cc.

References theDetTypes.

64 {
65  return theDetTypes;
66 }
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:161
const CSCGeometry::DetIdContainer & CSCGeometry::detUnitIds ( ) const
overridevirtual

Returm a vector of all GeomDetUnit DetIds.

Implements TrackingGeometry.

Definition at line 81 of file CSCGeometry.cc.

References theDetUnitIds.

82 {
83  return theDetUnitIds;
84 }
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:165
const CSCGeometry::DetUnitContainer & CSCGeometry::detUnits ( ) const
overridevirtual

Returm a vector of all GeomDetUnit.

Implements TrackingGeometry.

Definition at line 69 of file CSCGeometry.cc.

References theDetUnits.

70 {
71  return theDetUnits;
72 }
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:163
const CSCChamberSpecs * CSCGeometry::findSpecs ( int  iChamberType)

Return the CSCChamberSpecs* for given chamber type if it exists, or 0 if it has not been created.

Definition at line 169 of file CSCGeometry.cc.

References specsContainer.

169  {
170  const CSCChamberSpecs* aSpecs = 0;
171  CSCSpecsContainer::const_iterator it = specsContainer.find( iChamberType );
172  if ( it != specsContainer.end() ) aSpecs = (*it).second;
173  return aSpecs;
174 }
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:180
bool CSCGeometry::gangedStrips ( ) const
inline

Ganged strips in ME1a

Definition at line 111 of file CSCGeometry.h.

References gangedstripsME1a_.

111 { return gangedstripsME1a_; }
bool gangedstripsME1a_
Definition: CSCGeometry.h:174
const GeomDet * CSCGeometry::idToDet ( DetId  ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 99 of file CSCGeometry.cc.

References i, and theMap.

Referenced by MuonCSCDetLayerGeometryBuilder::buildLayer(), chamber(), idToDetUnit(), and CSCPairResidualsConstraint::radius().

99  {
100  CSCDetMap::const_iterator i = theMap.find(id);
101  return (i != theMap.end()) ?
102  i->second : 0 ;
103 }
int i
Definition: DBlmapReader.cc:9
CSCDetMap theMap
Definition: CSCGeometry.h:157
const GeomDetUnit * CSCGeometry::idToDetUnit ( DetId  ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 93 of file CSCGeometry.cc.

References idToDet().

Referenced by CSCBaseValidation::findLayer(), and layer().

94 {
95  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
96 }
virtual const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:99
const CSCLayer * CSCGeometry::layer ( CSCDetId  id) const

Return the layer corresponding to given DetId.

Definition at line 124 of file CSCGeometry.cc.

References idToDetUnit().

Referenced by MuonCSCChamberResidual::addResidual(), CSCHitAssociator::associateCSCHitId(), and CSCHitAssociator::associateHitId().

124  {
125  return dynamic_cast<const CSCLayer*>(idToDetUnit(id));
126 }
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:93
const CSCGeometry::LayerContainer & CSCGeometry::layers ( ) const

Return a vector of all layers.

Definition at line 112 of file CSCGeometry.cc.

References theLayers.

113 {
114  return theLayers;
115 }
LayerContainer theLayers
Definition: CSCGeometry.h:168
void CSCGeometry::queryModelling ( ) const

Dump parameters for overall strip and wire modelling.

Definition at line 128 of file CSCGeometry.cc.

References gangedstripsME1a_, LogTrace, onlywiresME1a_, realWireGeometry_, AlCaHLTBitMon_QueryRunRegistry::string, and useCentreTIOffsets_.

Referenced by CSCGeometry().

128  {
129  // Dump user-selected overall modelling parameters.
130  // Only requires calling once per job.
131 
132  LogTrace("CSCGeometry|CSC") << "CSCGeometry::queryModelling entered...";
133 
134  edm::LogInfo("CSC") << "CSCGeometry version 18-Oct-2012 queryModelling...\n";
135 
136  std::string gs = " ";
137  if ( gangedstripsME1a_ )
138  gs = "GANGED";
139  else
140  gs = "UNGANGED";
141 
142  edm::LogInfo("CSC") << "CSCGeometry: in ME1a use " << gs << " strips" << "\n";
143 
144  std::string wo = " ";
145  if ( onlywiresME1a_ )
146  wo = "WIRES ONLY";
147  else
148  wo = "WIRES & STRIPS";
149 
150  edm::LogInfo("CSC") << "CSCGeometry: in ME1a use " << wo << "\n";
151 
152  std::string wg = " ";
153  if ( realWireGeometry_ )
154  wg = "REAL";
155  else
156  wg = "PSEUDO";
157 
158  edm::LogInfo("CSC") << "CSCGeometry: wires are modelled using " << wg << " wire geometry " << "\n";
159 
160  std::string cti = " ";
161  if ( useCentreTIOffsets_ )
162  cti = "WITH";
163  else
164  cti = "WITHOUT";
165 
166  edm::LogInfo("CSC") << "CSCGeometry: strip plane centre-to-intersection ideal " << cti << " corrections " << "\n";
167 }
bool realWireGeometry_
Definition: CSCGeometry.h:176
#define LogTrace(id)
bool useCentreTIOffsets_
Definition: CSCGeometry.h:177
bool gangedstripsME1a_
Definition: CSCGeometry.h:174
bool onlywiresME1a_
Definition: CSCGeometry.h:175
bool CSCGeometry::realWireGeometry ( ) const
inline

Wire geometry modelled as real hardware (complex groupings of wires and dead regions) or as a pseudo geometry with just one wire grouping per chamber type (as was done in ORCA versions up to and including ORCA_8_8_1).

Definition at line 125 of file CSCGeometry.h.

References realWireGeometry_.

125 { return realWireGeometry_; }
bool realWireGeometry_
Definition: CSCGeometry.h:176
void CSCGeometry::setDebugV ( bool  dbgv)
inline

Definition at line 106 of file CSCGeometry.h.

References debugV_.

106 { debugV_ = dbgv; }
void CSCGeometry::setGangedStripsInME1a ( bool  gs)
inline

Definition at line 102 of file CSCGeometry.h.

References gangedstripsME1a_.

102 { gangedstripsME1a_ = gs; }
bool gangedstripsME1a_
Definition: CSCGeometry.h:174
void CSCGeometry::setOnlyWiresInME1a ( bool  ow)
inline

Definition at line 103 of file CSCGeometry.h.

References onlywiresME1a_.

103 { onlywiresME1a_ = ow; }
bool onlywiresME1a_
Definition: CSCGeometry.h:175
void CSCGeometry::setUseCentreTIOffsets ( bool  cti)
inline

Definition at line 105 of file CSCGeometry.h.

References useCentreTIOffsets_.

105 { useCentreTIOffsets_ = cti; }
bool useCentreTIOffsets_
Definition: CSCGeometry.h:177
void CSCGeometry::setUseRealWireGeometry ( bool  rwg)
inline

Definition at line 104 of file CSCGeometry.h.

References realWireGeometry_.

104 { realWireGeometry_ = rwg; }
bool realWireGeometry_
Definition: CSCGeometry.h:176
bool CSCGeometry::wiresOnly ( ) const
inline

Wires only in ME1a

Definition at line 116 of file CSCGeometry.h.

References onlywiresME1a_.

116 { return onlywiresME1a_; }
bool onlywiresME1a_
Definition: CSCGeometry.h:175

Friends And Related Function Documentation

friend class CSCGeometryBuilder
friend

Definition at line 35 of file CSCGeometry.h.

friend class GeometryAligner
friend

Definition at line 36 of file CSCGeometry.h.

Member Data Documentation

bool CSCGeometry::debugV_
private

Definition at line 172 of file CSCGeometry.h.

Referenced by CSCGeometry(), and setDebugV().

bool CSCGeometry::gangedstripsME1a_
private

Definition at line 174 of file CSCGeometry.h.

Referenced by gangedStrips(), queryModelling(), and setGangedStripsInME1a().

bool CSCGeometry::onlywiresME1a_
private

Definition at line 175 of file CSCGeometry.h.

Referenced by queryModelling(), setOnlyWiresInME1a(), and wiresOnly().

bool CSCGeometry::realWireGeometry_
private

Definition at line 176 of file CSCGeometry.h.

Referenced by queryModelling(), realWireGeometry(), and setUseRealWireGeometry().

CSCSpecsContainer CSCGeometry::specsContainer
private

Definition at line 180 of file CSCGeometry.h.

Referenced by buildSpecs(), findSpecs(), and ~CSCGeometry().

ChamberContainer CSCGeometry::theChambers
private

Definition at line 154 of file CSCGeometry.h.

Referenced by addChamber(), chambers(), and ~CSCGeometry().

DetIdContainer CSCGeometry::theDetIds
private

Definition at line 164 of file CSCGeometry.h.

Referenced by addDet(), and detIds().

DetContainer CSCGeometry::theDets
private

Definition at line 162 of file CSCGeometry.h.

Referenced by addDet(), and dets().

DetTypeContainer CSCGeometry::theDetTypes
private

Definition at line 161 of file CSCGeometry.h.

Referenced by addDetType(), addLayer(), and detTypes().

DetIdContainer CSCGeometry::theDetUnitIds
private

Definition at line 165 of file CSCGeometry.h.

Referenced by addLayer(), and detUnitIds().

DetUnitContainer CSCGeometry::theDetUnits
private

Definition at line 163 of file CSCGeometry.h.

Referenced by addLayer(), and detUnits().

LayerContainer CSCGeometry::theLayers
private

Definition at line 168 of file CSCGeometry.h.

Referenced by addLayer(), and layers().

CSCDetMap CSCGeometry::theMap
private

Definition at line 157 of file CSCGeometry.h.

Referenced by addDet(), and idToDet().

bool CSCGeometry::useCentreTIOffsets_
private

Definition at line 177 of file CSCGeometry.h.

Referenced by centreTIOffsets(), queryModelling(), and setUseCentreTIOffsets().