CMS 3D CMS Logo

CSCGeometry.h
Go to the documentation of this file.
1 #ifndef CSCGeometry_CSCGeometry_h
2 #define CSCGeometry_CSCGeometry_h
3 
15 #include <vector>
16 #include <map>
17 
18 class GeomDetType;
19 
20 class CSCChamber;
21 class CSCChamberSpecs;
23 
24 class CSCGeometry : public TrackingGeometry {
25  typedef std::map<DetId, GeomDet*> CSCDetMap;
26  // The buffer for specs need not really be a map. Could do it with a vector!
27  typedef std::map<int, const CSCChamberSpecs*, std::less<int> > CSCSpecsContainer;
28 
29 public:
30  typedef std::vector<const CSCChamber*> ChamberContainer;
31  typedef std::vector<const CSCLayer*> LayerContainer;
32 
33  friend class CSCGeometryBuilder; //FromDDD;
34  friend class GeometryAligner;
35 
37  CSCGeometry();
38 
42 
44  ~CSCGeometry() override;
45 
46  void clear();
47 
48  //---- Base class' interface
49 
50  // Return a vector of all det types
51  const DetTypeContainer& detTypes() const override;
52 
53  // Return a vector of all GeomDetUnit
54  const DetContainer& detUnits() const override;
55 
56  // Return a vector of all GeomDet (including all GeomDetUnits)
57  const DetContainer& dets() const override;
58 
59  // Return a vector of all GeomDetUnit DetIds
60  const DetIdContainer& detUnitIds() const override;
61 
62  // Return a vector of all GeomDet DetIds (including those of GeomDetUnits)
63  const DetIdContainer& detIds() const override;
64 
65  // Return the pointer to the GeomDetUnit corresponding to a given DetId
66  const GeomDet* idToDetUnit(DetId) const override;
67 
68  // Return the pointer to the GeomDet corresponding to a given DetId
69  const GeomDet* idToDet(DetId) const override;
70 
71  //---- Extension of the interface
72 
74  const CSCChamber* chamber(CSCDetId id) const;
75 
77  const CSCLayer* layer(CSCDetId id) const;
78 
80  const ChamberContainer& chambers() const;
81 
83  const LayerContainer& layers() const;
84 
89  const CSCChamberSpecs* findSpecs(int iChamberType);
90 
96  const CSCChamberSpecs* buildSpecs(int iChamberType,
97  const std::vector<float>& fpar,
98  const std::vector<float>& fupar,
99  const CSCWireGroupPackage& wg);
100 
102  void setOnlyWiresInME1a(bool ow) { onlywiresME1a_ = ow; }
103  void setUseRealWireGeometry(bool rwg) { realWireGeometry_ = rwg; }
104  void setUseCentreTIOffsets(bool cti) { useCentreTIOffsets_ = cti; }
105  void setDebugV(bool dbgv) { debugV_ = dbgv; }
106 
110  bool gangedStrips() const { return gangedstripsME1a_; }
111 
115  bool wiresOnly() const { return onlywiresME1a_; }
116 
124  bool realWireGeometry() const { return realWireGeometry_; }
125 
130  bool centreTIOffsets() const { return useCentreTIOffsets_; }
131 
133  void queryModelling() const;
134 
135 private:
137  void deallocate();
138 
140  void addChamber(CSCChamber* ch);
141 
143  void addLayer(CSCLayer* l);
144 
146  void addDetType(GeomDetType* type);
147 
149  void addDetId(DetId id);
150 
152  void addDet(GeomDet* det);
153 
154  // The chambers are owned by the geometry (which in turn own layers)
156 
157  // Map for efficient lookup by DetId
159 
160  // These are used rarely; they could be computed at runtime
161  // to save memory.
163  DetContainer theDets; // all dets (chambers and layers)
164  DetContainer theDetUnits; // all layers
167 
168  // These are reduntant copies, to satisfy the interface.
170 
171  // Parameters controlling modelling of geometry
172 
173  bool debugV_; // for debug printout etc.
174 
179 
180  // Store pointers to Specs objects as we build them.
182 };
183 
184 #endif
CSCGeometry::theMap
CSCDetMap theMap
Definition: CSCGeometry.h:158
CSCGeometry::setUseRealWireGeometry
void setUseRealWireGeometry(bool rwg)
Definition: CSCGeometry.h:103
CSCGeometry::buildSpecs
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
Definition: CSCGeometry.cc:159
CSCGeometry::theDets
DetContainer theDets
Definition: CSCGeometry.h:163
CSCGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: CSCGeometry.cc:87
CSCGeometry::addChamber
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
Definition: CSCGeometry.cc:58
TrackingGeometry
Definition: TrackingGeometry.h:26
GeomDet
Definition: GeomDet.h:27
CSCGeometry::onlywiresME1a_
bool onlywiresME1a_
Definition: CSCGeometry.h:176
CSCGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
CSCChamberSpecs
Definition: CSCChamberSpecs.h:39
CSCGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: CSCGeometry.cc:81
CSCGeometry::setOnlyWiresInME1a
void setOnlyWiresInME1a(bool ow)
Definition: CSCGeometry.h:102
CSCGeometry::wiresOnly
bool wiresOnly() const
Definition: CSCGeometry.h:115
GeomDetType
Definition: GeomDetType.h:9
TrackingGeometry.h
CSCLayer
Definition: CSCLayer.h:24
CSCGeometry::gangedStrips
bool gangedStrips() const
Definition: CSCGeometry.h:110
CSCGeometry::theDetTypes
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:162
CSCGeometry::debugV_
bool debugV_
Definition: CSCGeometry.h:173
CSCGeometry::realWireGeometry_
bool realWireGeometry_
Definition: CSCGeometry.h:177
CSCGeometry::centreTIOffsets
bool centreTIOffsets() const
Definition: CSCGeometry.h:130
gs
Definition: AbsArchive.cc:45
CSCDetId.h
CSCGeometry::clear
void clear()
Definition: CSCGeometry.cc:33
CSCGeometry::theChambers
ChamberContainer theChambers
Definition: CSCGeometry.h:155
CSCGeometry::addLayer
void addLayer(CSCLayer *l)
Add a DetUnit.
Definition: CSCGeometry.cc:63
CSCGeometry
Definition: CSCGeometry.h:24
DetId
Definition: DetId.h:17
CSCGeometryBuilder
Definition: CSCGeometryBuilder.h:20
CSCGeometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: CSCGeometry.cc:85
CSCGeometry::CSCDetMap
std::map< DetId, GeomDet * > CSCDetMap
Definition: CSCGeometry.h:25
CSCGeometry::addDetId
void addDetId(DetId id)
Add a DetId.
CSCGeometry::queryModelling
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:107
CSCGeometry::setGangedStripsInME1a
void setGangedStripsInME1a(bool gs)
Definition: CSCGeometry.h:101
CSCChamber
Definition: CSCChamber.h:22
CSCGeometry::findSpecs
const CSCChamberSpecs * findSpecs(int iChamberType)
Definition: CSCGeometry.cc:151
TrackingGeometry::DetTypeContainer
std::vector< const GeomDetType * > DetTypeContainer
Definition: TrackingGeometry.h:28
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
CSCGeometry::realWireGeometry
bool realWireGeometry() const
Definition: CSCGeometry.h:124
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
CSCGeometry::addDetType
void addDetType(GeomDetType *type)
Add a DetType.
Definition: CSCGeometry.cc:71
TrackingGeometry::DetContainer
std::vector< const GeomDet * > DetContainer
Definition: TrackingGeometry.h:29
CSCGeometry::gangedstripsME1a_
bool gangedstripsME1a_
Definition: CSCGeometry.h:175
CSCGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: CSCGeometry.cc:79
CSCDetId
Definition: CSCDetId.h:26
CSCGeometry::ChamberContainer
std::vector< const CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:30
CSCGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:83
CSCGeometry::theDetIds
DetIdContainer theDetIds
Definition: CSCGeometry.h:165
CSCWireGroupPackage
Definition: CSCWireGroupPackage.h:18
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
CSCGeometry::setUseCentreTIOffsets
void setUseCentreTIOffsets(bool cti)
Definition: CSCGeometry.h:104
CSCGeometry::useCentreTIOffsets_
bool useCentreTIOffsets_
Definition: CSCGeometry.h:178
CSCGeometry::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
CSCGeometry::setDebugV
void setDebugV(bool dbgv)
Definition: CSCGeometry.h:105
CSCLayer.h
DetId.h
CSCGeometry::~CSCGeometry
~CSCGeometry() override
Destructor.
Definition: CSCGeometry.cc:31
CSCGeometry::layers
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:98
CSCGeometry::CSCGeometry
CSCGeometry()
Default constructor.
Definition: CSCGeometry.cc:10
CSCGeometry::theLayers
LayerContainer theLayers
Definition: CSCGeometry.h:169
CSCGeometry::chambers
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:96
CSCGeometry::specsContainer
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:181
CSCGeometry::addDet
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:73
CSCGeometry::theDetUnitIds
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:166
CSCGeometry::theDetUnits
DetContainer theDetUnits
Definition: CSCGeometry.h:164
AlignmentProducer_cff.debugV
debugV
Definition: AlignmentProducer_cff.py:89
CSCGeometry::LayerContainer
std::vector< const CSCLayer * > LayerContainer
Definition: CSCGeometry.h:31
CSCGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:89
CSCGeometry::deallocate
void deallocate()
deallocate managed memory
Definition: CSCGeometry.cc:47
CSCGeometry::CSCSpecsContainer
std::map< int, const CSCChamberSpecs *, std::less< int > > CSCSpecsContainer
Definition: CSCGeometry.h:27
CSCGeometry::chamber
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33