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  void clear();
48 
49  //---- Base class' interface
50 
51  // Return a vector of all det types
52  const DetTypeContainer& detTypes() const override;
53 
54  // Return a vector of all GeomDetUnit
55  const DetContainer& detUnits() const override;
56 
57  // Return a vector of all GeomDet (including all GeomDetUnits)
58  const DetContainer& dets() const override;
59 
60  // Return a vector of all GeomDetUnit DetIds
61  const DetIdContainer& detUnitIds() const override;
62 
63  // Return a vector of all GeomDet DetIds (including those of GeomDetUnits)
64  const DetIdContainer& detIds() const override;
65 
66  // Return the pointer to the GeomDetUnit corresponding to a given DetId
67  const GeomDet* idToDetUnit(DetId) const override;
68 
69  // Return the pointer to the GeomDet corresponding to a given DetId
70  const GeomDet* idToDet(DetId) const override;
71 
72  //---- Extension of the interface
73 
75  const CSCChamber* chamber(CSCDetId id) const;
76 
78  const CSCLayer* layer(CSCDetId id) const;
79 
81  const ChamberContainer& chambers() const;
82 
84  const LayerContainer& layers() const;
85 
86 
87 
92  const CSCChamberSpecs* findSpecs( int iChamberType );
93 
99  const CSCChamberSpecs* buildSpecs( int iChamberType,
100  const std::vector<float>& fpar,
101  const std::vector<float>& fupar,
102  const CSCWireGroupPackage& wg );
103 
105  void setOnlyWiresInME1a(bool ow) { onlywiresME1a_ = ow; }
106  void setUseRealWireGeometry(bool rwg) { realWireGeometry_ = rwg; }
107  void setUseCentreTIOffsets(bool cti) { useCentreTIOffsets_ = cti; }
108  void setDebugV(bool dbgv) { debugV_ = dbgv; }
109 
113  bool gangedStrips() const { return gangedstripsME1a_; }
114 
118  bool wiresOnly() const { return onlywiresME1a_; }
119 
127  bool realWireGeometry() const { return realWireGeometry_; }
128 
133  bool centreTIOffsets() const { return useCentreTIOffsets_; }
134 
136  void queryModelling() const;
137 
138  private:
139 
141  void deallocate();
142 
144  void addChamber(CSCChamber* ch);
145 
147  void addLayer(CSCLayer* l);
148 
150  void addDetType(GeomDetType* type);
151 
153  void addDetId(DetId id);
154 
156  void addDet(GeomDet* det);
157 
158  // The chambers are owned by the geometry (which in turn own layers)
159  ChamberContainer theChambers;
160 
161  // Map for efficient lookup by DetId
162  CSCDetMap theMap;
163 
164  // These are used rarely; they could be computed at runtime
165  // to save memory.
167  DetContainer theDets; // all dets (chambers and layers)
168  DetContainer theDetUnits; // all layers
171 
172  // These are reduntant copies, to satisfy the interface.
173  LayerContainer theLayers;
174 
175  // Parameters controlling modelling of geometry
176 
177  bool debugV_; // for debug printout etc.
178 
183 
184  // Store pointers to Specs objects as we build them.
185  CSCSpecsContainer specsContainer;
186 
187 };
188 
189 #endif
190 
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:185
void deallocate()
deallocate managed memory
Definition: CSCGeometry.cc:39
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: CSCGeometry.cc:102
type
Definition: HCALResponse.h:21
void setOnlyWiresInME1a(bool ow)
Definition: CSCGeometry.h:105
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:71
DetContainer theDetUnits
Definition: CSCGeometry.h:168
void setUseRealWireGeometry(bool rwg)
Definition: CSCGeometry.h:106
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
Definition: CSCGeometry.cc:191
Class to update a given geometry with a set of alignments.
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:114
void clear()
Definition: CSCGeometry.cc:25
CSCDetMap theMap
Definition: CSCGeometry.h:162
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:143
bool centreTIOffsets() const
Definition: CSCGeometry.h:133
DetContainer theDets
Definition: CSCGeometry.h:167
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
Definition: CSCGeometry.cc:51
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:121
ChamberContainer theChambers
Definition: CSCGeometry.h:159
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:166
bool realWireGeometry_
Definition: CSCGeometry.h:181
void addLayer(CSCLayer *l)
Add a DetUnit.
Definition: CSCGeometry.cc:57
const CSCChamberSpecs * findSpecs(int iChamberType)
Definition: CSCGeometry.cc:184
bool wiresOnly() const
Definition: CSCGeometry.h:118
bool realWireGeometry() const
Definition: CSCGeometry.h:127
void addDetType(GeomDetType *type)
Add a DetType.
Definition: CSCGeometry.cc:66
void setGangedStripsInME1a(bool gs)
Definition: CSCGeometry.h:104
std::map< DetId, GeomDet * > CSCDetMap
Definition: CSCGeometry.h:26
void addDetId(DetId id)
Add a DetId.
bool gangedStrips() const
Definition: CSCGeometry.h:113
Definition: DetId.h:18
bool useCentreTIOffsets_
Definition: CSCGeometry.h:182
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: CSCGeometry.cc:96
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:133
DetIdContainer theDetIds
Definition: CSCGeometry.h:169
void setDebugV(bool dbgv)
Definition: CSCGeometry.h:108
bool gangedstripsME1a_
Definition: CSCGeometry.h:179
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:170
std::vector< DetId > DetIdContainer
void setUseCentreTIOffsets(bool cti)
Definition: CSCGeometry.h:107
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:108
std::vector< const CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:32
CSCGeometry()
Default constructor.
Definition: CSCGeometry.cc:10
LayerContainer theLayers
Definition: CSCGeometry.h:173
std::vector< const GeomDet * > DetContainer
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: CSCGeometry.cc:78
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:139
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:84
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:180
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:90
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:127