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