CMS 3D CMS Logo

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

#include <CSCGeometry.h>

Inheritance diagram for CSCGeometry:
TrackingGeometry

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...
 
virtual const DetIdContainerdetIds () const
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits) More...
 
virtual const DetContainerdets () const
 Returm a vector of all GeomDet (including all GeomDetUnits) More...
 
virtual const DetTypeContainerdetTypes () const
 Return a vector of all det types. More...
 
virtual const DetIdContainerdetUnitIds () const
 Returm a vector of all GeomDetUnit DetIds. More...
 
virtual const DetUnitContainerdetUnits () const
 Returm a vector of all GeomDetUnit. More...
 
const CSCChamberSpecsfindSpecs (int iChamberType)
 
bool gangedStrips () const
 
virtual const GeomDetidToDet (DetId) const
 
virtual const GeomDetUnitidToDetUnit (DetId) const
 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 wg)
 
bool wiresOnly () const
 
virtual ~CSCGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from TrackingGeometry
virtual ~TrackingGeometry ()
 Destructor. More...
 

Private Types

typedef std::vector< CSCChamber * > ChamberContainer
 
typedef std::map< DetId,
GeomDet * > 
CSCDetMap
 
typedef std::map< int, const
CSCChamberSpecs *, std::less
< int > > 
CSCSpecsContainer
 
typedef std::vector< CSCLayer * > LayerContainer
 

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
 
CSCSpecsContainer specsContainer
 
ChamberContainer theChambers
 
DetIdContainer theDetIds
 
DetContainer theDets
 
DetTypeContainer theDetTypes
 
DetIdContainer theDetUnitIds
 
DetUnitContainer theDetUnits
 
LayerContainer theLayers
 
CSCDetMap theMap
 
bool useCentreTIOffsets
 
bool useRealWireGeometry
 

Friends

class CSCGeometryBuilder
 
class GeometryAligner
 

Additional Inherited Members

- Public Types inherited from TrackingGeometry
typedef std::vector< GeomDet * > DetContainer
 
typedef std::vector< DetIdDetIdContainer
 
typedef std::vector
< GeomDetType * > 
DetTypeContainer
 
typedef std::vector
< GeomDetUnit * > 
DetUnitContainer
 
typedef __gnu_cxx::hash_map
< unsigned int, GeomDet * > 
mapIdToDet
 
typedef __gnu_cxx::hash_map
< unsigned int, GeomDetUnit * > 
mapIdToDetUnit
 

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<CSCChamber*> CSCGeometry::ChamberContainer
private

Definition at line 29 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<CSCLayer*> CSCGeometry::LayerContainer
private

Definition at line 30 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 }
bool useRealWireGeometry
Definition: CSCGeometry.h:172
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:127
bool useCentreTIOffsets
Definition: CSCGeometry.h:173
bool gangedstripsME1a
Definition: CSCGeometry.h:170
bool onlywiresME1a
Definition: CSCGeometry.h:171
CSCGeometry::~CSCGeometry ( )
virtual

Destructor.

Definition at line 15 of file CSCGeometry.cc.

References specsContainer, and theChambers.

15  {
16 
17  // delete all the chambers (which will delete the layers)
18  for (ChamberContainer::const_iterator ich=theChambers.begin();
19  ich!=theChambers.end(); ++ich) delete (*ich);
20 
21  // delete specs
22  for ( CSCSpecsContainer::const_iterator it =
23  specsContainer.begin(); it!=specsContainer.end(); ++it) {
24  delete (*it).second; // they are never shared per chamber type so should be no possible double deletion.
25  }
26 
27 }
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:176
ChamberContainer theChambers
Definition: CSCGeometry.h:150

Member Function Documentation

void CSCGeometry::addChamber ( CSCChamber ch)
private

Add a chamber with given DetId.

Definition at line 30 of file CSCGeometry.cc.

References addDet(), and theChambers.

30  {
31  theChambers.push_back(ch);
32  addDet(ch);
33 }
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:50
ChamberContainer theChambers
Definition: CSCGeometry.h:150
void CSCGeometry::addDet ( GeomDet det)
private

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

Definition at line 50 of file CSCGeometry.cc.

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

Referenced by addChamber(), and addLayer().

50  {
51  theDets.push_back(det);
52  theDetIds.push_back(det->geographicalId());
53  theMap.insert(CSCDetMap::value_type(det->geographicalId(),det));
54 }
CSCDetMap theMap
Definition: CSCGeometry.h:153
DetContainer theDets
Definition: CSCGeometry.h:158
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
Container::value_type value_type
DetIdContainer theDetIds
Definition: CSCGeometry.h:160
void CSCGeometry::addDetId ( DetId  id)
private

Add a DetId.

void CSCGeometry::addDetType ( GeomDetType type)
private

Add a DetType.

Definition at line 45 of file CSCGeometry.cc.

References theDetTypes.

45  {
46  theDetTypes.push_back(type);
47 }
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:157
void CSCGeometry::addLayer ( CSCLayer l)
private

Add a DetUnit.

Definition at line 36 of file CSCGeometry.cc.

References addDet(), GeomDet::geographicalId(), theDetTypes, theDetUnitIds, theDetUnits, theLayers, and CSCLayer::type().

36  {
37  theDetUnits.push_back(l);
38  theLayers.push_back(l);
39  theDetTypes.push_back(const_cast<GeomDetType*>(&(l->type()))); //@@ FIXME drop const_cast asap!
40  theDetUnitIds.push_back(l->geographicalId());
41  addDet(l);
42 }
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:50
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:159
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:157
const GeomDetType & type() const
Definition: CSCLayer.h:33
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:161
LayerContainer theLayers
Definition: CSCGeometry.h:164
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 173 of file CSCGeometry.cc.

References specsContainer.

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

Use the backed-out offsets for theCentreToIntersection in CSCLayerGeometry

Definition at line 127 of file CSCGeometry.h.

References useCentreTIOffsets.

127 { return useCentreTIOffsets; }
bool useCentreTIOffsets
Definition: CSCGeometry.h:173
const CSCChamber * CSCGeometry::chamber ( CSCDetId  id) const

Return the chamber corresponding to given DetId.

Definition at line 117 of file CSCGeometry.cc.

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

Referenced by CSCSegmentBuilder::build(), CSCHaloAlgo::Calculate(), CSCTriggerGeomManager::chamber(), geometryXMLparser.CSCAlignable::index(), MuonMesh::isClusteredWith(), MuonSimHitProducer::produce(), and CSCTriggerGeomManager::sectorOfChambersInStation().

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

Return a vector of all chambers.

Definition at line 100 of file CSCGeometry.cc.

References theChambers.

Referenced by FWRecoGeometryESProducer::addCSCGeometry(), and AlignableMuon::buildCSCEndcap().

101 {
102  return theChambers;
103 }
ChamberContainer theChambers
Definition: CSCGeometry.h:150
const CSCGeometry::DetIdContainer & CSCGeometry::detIds ( ) const
virtual

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

Implements TrackingGeometry.

Definition at line 81 of file CSCGeometry.cc.

References theDetIds.

82 {
83  return theDetIds;
84 }
DetIdContainer theDetIds
Definition: CSCGeometry.h:160
const CSCGeometry::DetContainer & CSCGeometry::dets ( ) const
virtual

Returm a vector of all GeomDet (including all GeomDetUnits)

Implements TrackingGeometry.

Definition at line 69 of file CSCGeometry.cc.

References theDets.

70 {
71  return theDets;
72 }
DetContainer theDets
Definition: CSCGeometry.h:158
const CSCGeometry::DetTypeContainer & CSCGeometry::detTypes ( ) const
virtual

Return a vector of all det types.

Implements TrackingGeometry.

Definition at line 57 of file CSCGeometry.cc.

References theDetTypes.

58 {
59  return theDetTypes;
60 }
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:157
const CSCGeometry::DetIdContainer & CSCGeometry::detUnitIds ( ) const
virtual

Returm a vector of all GeomDetUnit DetIds.

Implements TrackingGeometry.

Definition at line 75 of file CSCGeometry.cc.

References theDetUnitIds.

76 {
77  return theDetUnitIds;
78 }
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:161
const CSCGeometry::DetUnitContainer & CSCGeometry::detUnits ( ) const
virtual

Returm a vector of all GeomDetUnit.

Implements TrackingGeometry.

Definition at line 63 of file CSCGeometry.cc.

References theDetUnits.

64 {
65  return theDetUnits;
66 }
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:159
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 166 of file CSCGeometry.cc.

References specsContainer.

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

Ganged strips in ME1a

Definition at line 107 of file CSCGeometry.h.

References gangedstripsME1a.

Referenced by CSCLayerGeometry::CSCLayerGeometry().

107 { return gangedstripsME1a; }
bool gangedstripsME1a
Definition: CSCGeometry.h:170
const GeomDet * CSCGeometry::idToDet ( DetId  ) const
virtual

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

Implements TrackingGeometry.

Definition at line 93 of file CSCGeometry.cc.

References i, and theMap.

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

93  {
94  CSCDetMap::const_iterator i = theMap.find(id);
95  return (i != theMap.end()) ?
96  i->second : 0 ;
97 }
int i
Definition: DBlmapReader.cc:9
CSCDetMap theMap
Definition: CSCGeometry.h:153
const GeomDetUnit * CSCGeometry::idToDetUnit ( DetId  ) const
virtual
const CSCLayer * CSCGeometry::layer ( CSCDetId  id) const

Return the layer corresponding to given DetId.

Definition at line 123 of file CSCGeometry.cc.

References idToDetUnit().

Referenced by MuonCSCChamberResidual::addResidual(), MuonTruth::analyze(), MuonTruth::associateCSCHitId(), MuonTruth::associateHitId(), CSCPairResidualsConstraint::calculatePhi(), CSCRecHitDBuilder::getLayer(), geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

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

Return a vector of all layers.

Definition at line 106 of file CSCGeometry.cc.

References theLayers.

107 {
108 // for( DetUnitContainer::const_iterator it = theDetUnits.begin();
109 // it != theDetUnits.end(); ++it ) {
110 // CSCLayer* layer = dynamic_cast<CSCLayer*>( *it );
111 // if ( layer ) theLayers.push_back( layer );
112 // }
113  return theLayers;
114 }
LayerContainer theLayers
Definition: CSCGeometry.h:164
void CSCGeometry::queryModelling ( ) const

Dump parameters for overall strip and wire modelling.

Definition at line 127 of file CSCGeometry.cc.

References gangedstripsME1a, LogTrace, onlywiresME1a, useCentreTIOffsets, and useRealWireGeometry.

Referenced by CSCGeometry().

127  {
128  // Dump user-selected overall modelling parameters.
129  // Only requires calling once per job.
130 
131  LogTrace("CSCGeometry|CSC") << "CSCGeometry::queryModelling entered...";
132 
133  std::string gs = " ";
134  if ( gangedstripsME1a )
135  gs = "GANGED";
136  else
137  gs = "UNGANGED";
138 
139  edm::LogInfo("CSC") << "CSCGeometry: in ME1a use " << gs << " strips" << "\n";
140 
141  std::string wo = " ";
142  if ( onlywiresME1a )
143  wo = "WIRES ONLY";
144  else
145  wo = "WIRES & STRIPS";
146 
147  edm::LogInfo("CSC") << "CSCGeometry: in ME1a use " << wo << "\n";
148 
149  std::string wg = " ";
150  if ( useRealWireGeometry )
151  wg = "REAL";
152  else
153  wg = "PSEUDO";
154 
155  edm::LogInfo("CSC") << "CSCGeometry: wires are modelled using " << wg << " wire geometry " << "\n";
156 
157  std::string cti = " ";
158  if ( useCentreTIOffsets )
159  cti = "WITH";
160  else
161  cti = "WITHOUT";
162 
163  edm::LogInfo("CSC") << "CSCGeometry: strip plane centre-to-intersection ideal " << cti << " corrections " << "\n";
164 }
bool useRealWireGeometry
Definition: CSCGeometry.h:172
bool useCentreTIOffsets
Definition: CSCGeometry.h:173
bool gangedstripsME1a
Definition: CSCGeometry.h:170
#define LogTrace(id)
bool onlywiresME1a
Definition: CSCGeometry.h:171
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 121 of file CSCGeometry.h.

References useRealWireGeometry.

Referenced by CSCLayerGeometry::CSCLayerGeometry().

121 { return useRealWireGeometry; }
bool useRealWireGeometry
Definition: CSCGeometry.h:172
void CSCGeometry::setDebugV ( bool  dbgv)
inline

Definition at line 102 of file CSCGeometry.h.

References debugV.

102 { debugV = dbgv; }
void CSCGeometry::setGangedStripsInME1a ( bool  gs)
inline

Definition at line 98 of file CSCGeometry.h.

References gangedstripsME1a.

98 { gangedstripsME1a = gs; }
bool gangedstripsME1a
Definition: CSCGeometry.h:170
void CSCGeometry::setOnlyWiresInME1a ( bool  ow)
inline

Definition at line 99 of file CSCGeometry.h.

References onlywiresME1a.

99 { onlywiresME1a = ow; }
bool onlywiresME1a
Definition: CSCGeometry.h:171
void CSCGeometry::setUseCentreTIOffsets ( bool  cti)
inline

Definition at line 101 of file CSCGeometry.h.

References useCentreTIOffsets.

101 { useCentreTIOffsets = cti; }
bool useCentreTIOffsets
Definition: CSCGeometry.h:173
void CSCGeometry::setUseRealWireGeometry ( bool  wg)
inline

Definition at line 100 of file CSCGeometry.h.

References useRealWireGeometry.

100 { useRealWireGeometry = wg; }
bool useRealWireGeometry
Definition: CSCGeometry.h:172
bool CSCGeometry::wiresOnly ( ) const
inline

Wires only in ME1a

Definition at line 112 of file CSCGeometry.h.

References onlywiresME1a.

112 { return onlywiresME1a; }
bool onlywiresME1a
Definition: CSCGeometry.h:171

Friends And Related Function Documentation

friend class CSCGeometryBuilder
friend

Definition at line 34 of file CSCGeometry.h.

friend class GeometryAligner
friend

Definition at line 35 of file CSCGeometry.h.

Member Data Documentation

bool CSCGeometry::debugV
private

Definition at line 168 of file CSCGeometry.h.

Referenced by CSCGeometry(), and setDebugV().

bool CSCGeometry::gangedstripsME1a
private

Definition at line 170 of file CSCGeometry.h.

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

bool CSCGeometry::onlywiresME1a
private

Definition at line 171 of file CSCGeometry.h.

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

CSCSpecsContainer CSCGeometry::specsContainer
private

Definition at line 176 of file CSCGeometry.h.

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

ChamberContainer CSCGeometry::theChambers
private

Definition at line 150 of file CSCGeometry.h.

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

DetIdContainer CSCGeometry::theDetIds
private

Definition at line 160 of file CSCGeometry.h.

Referenced by addDet(), and detIds().

DetContainer CSCGeometry::theDets
private

Definition at line 158 of file CSCGeometry.h.

Referenced by addDet(), and dets().

DetTypeContainer CSCGeometry::theDetTypes
private

Definition at line 157 of file CSCGeometry.h.

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

DetIdContainer CSCGeometry::theDetUnitIds
private

Definition at line 161 of file CSCGeometry.h.

Referenced by addLayer(), and detUnitIds().

DetUnitContainer CSCGeometry::theDetUnits
private

Definition at line 159 of file CSCGeometry.h.

Referenced by addLayer(), and detUnits().

LayerContainer CSCGeometry::theLayers
private

Definition at line 164 of file CSCGeometry.h.

Referenced by addLayer(), and layers().

CSCDetMap CSCGeometry::theMap
private

Definition at line 153 of file CSCGeometry.h.

Referenced by addDet(), and idToDet().

bool CSCGeometry::useCentreTIOffsets
private

Definition at line 173 of file CSCGeometry.h.

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

bool CSCGeometry::useRealWireGeometry
private

Definition at line 172 of file CSCGeometry.h.

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