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
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:181
void deallocate()
deallocate managed memory
Definition: CSCGeometry.cc:47
void setOnlyWiresInME1a(bool ow)
Definition: CSCGeometry.h:102
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:73
DetContainer theDetUnits
Definition: CSCGeometry.h:164
void setUseRealWireGeometry(bool rwg)
Definition: CSCGeometry.h:103
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
Definition: CSCGeometry.cc:159
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: CSCGeometry.cc:81
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: CSCGeometry.cc:87
Class to update a given geometry with a set of alignments.
bool wiresOnly() const
Definition: CSCGeometry.h:115
void clear()
Definition: CSCGeometry.cc:33
CSCDetMap theMap
Definition: CSCGeometry.h:158
DetContainer theDets
Definition: CSCGeometry.h:163
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
Definition: CSCGeometry.cc:58
bool centreTIOffsets() const
Definition: CSCGeometry.h:130
ChamberContainer theChambers
Definition: CSCGeometry.h:155
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:107
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:162
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: CSCGeometry.cc:85
bool realWireGeometry_
Definition: CSCGeometry.h:177
void addLayer(CSCLayer *l)
Add a DetUnit.
Definition: CSCGeometry.cc:63
std::vector< const GeomDet * > DetContainer
const CSCChamberSpecs * findSpecs(int iChamberType)
Definition: CSCGeometry.cc:151
bool realWireGeometry() const
Definition: CSCGeometry.h:124
bool gangedStrips() const
Definition: CSCGeometry.h:110
void addDetType(GeomDetType *type)
Add a DetType.
Definition: CSCGeometry.cc:71
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: CSCGeometry.cc:79
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:83
void setGangedStripsInME1a(bool gs)
Definition: CSCGeometry.h:101
std::map< DetId, GeomDet * > CSCDetMap
Definition: CSCGeometry.h:25
void addDetId(DetId id)
Add a DetId.
Definition: DetId.h:17
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:98
bool useCentreTIOffsets_
Definition: CSCGeometry.h:178
DetIdContainer theDetIds
Definition: CSCGeometry.h:165
void setDebugV(bool dbgv)
Definition: CSCGeometry.h:105
bool gangedstripsME1a_
Definition: CSCGeometry.h:175
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:166
std::vector< DetId > DetIdContainer
void setUseCentreTIOffsets(bool cti)
Definition: CSCGeometry.h:104
std::vector< const CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:30
CSCGeometry()
Default constructor.
Definition: CSCGeometry.cc:10
LayerContainer theLayers
Definition: CSCGeometry.h:169
std::vector< const GeomDetType * > DetTypeContainer
std::vector< const CSCLayer * > LayerContainer
Definition: CSCGeometry.h:31
Definition: AbsArchive.cc:46
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:96
std::map< int, const CSCChamberSpecs *, std::less< int > > CSCSpecsContainer
Definition: CSCGeometry.h:27
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
~CSCGeometry() override
Destructor.
Definition: CSCGeometry.cc:31
bool onlywiresME1a_
Definition: CSCGeometry.h:176
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:89
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91