CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 class GeomDetUnit;
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  typedef std::vector<CSCChamber*> ChamberContainer;
30  typedef std::vector<CSCLayer*> LayerContainer;
31 
32  public:
33 
34  friend class CSCGeometryBuilder; //FromDDD;
35  friend class GeometryAligner;
36 
38  CSCGeometry();
39 
42 
44  virtual ~CSCGeometry();
45 
46  //---- Base class' interface
47 
48  // Return a vector of all det types
49  virtual const DetTypeContainer& detTypes() const;
50 
51  // Return a vector of all GeomDetUnit
52  virtual const DetUnitContainer& detUnits() const;
53 
54  // Return a vector of all GeomDet (including all GeomDetUnits)
55  virtual const DetContainer& dets() const;
56 
57  // Return a vector of all GeomDetUnit DetIds
58  virtual const DetIdContainer& detUnitIds() const;
59 
60  // Return a vector of all GeomDet DetIds (including those of GeomDetUnits)
61  virtual const DetIdContainer& detIds() const;
62 
63  // Return the pointer to the GeomDetUnit corresponding to a given DetId
64  virtual const GeomDetUnit* idToDetUnit(DetId) const;
65 
66  // Return the pointer to the GeomDet corresponding to a given DetId
67  virtual const GeomDet* idToDet(DetId) const;
68 
69  //---- Extension of the interface
70 
72  const CSCChamber* chamber(CSCDetId id) const;
73 
75  const CSCLayer* layer(CSCDetId id) const;
76 
78  const ChamberContainer& chambers() const;
79 
81  const LayerContainer& layers() const;
82 
83 
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 
101  void setGangedStripsInME1a(bool gs) { gangedstripsME1a_ = gs; }
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:
136 
138  void addChamber(CSCChamber* ch);
139 
141  void addLayer(CSCLayer* l);
142 
144  void addDetType(GeomDetType* type);
145 
147  void addDetId(DetId id);
148 
150  void addDet(GeomDet* det);
151 
152  // The chambers are owned by the geometry (which in turn own layers)
154 
155  // Map for efficient lookup by DetId
157 
158  // These are used rarely; they could be computed at runtime
159  // to save memory.
161  DetContainer theDets; // all dets (chambers and layers)
165 
166  // These are reduntant copies, to satisfy the interface.
168 
169  // Parameters controlling modelling of geometry
170 
171  bool debugV_; // for debug printout etc.
172 
177 
178  // Store pointers to Specs objects as we build them.
180 
181 };
182 
183 #endif
184 
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:179
type
Definition: HCALResponse.h:21
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:56
std::vector< CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:29
void setUseRealWireGeometry(bool rwg)
Definition: CSCGeometry.h:103
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: CSCGeometry.cc:81
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
Definition: CSCGeometry.cc:176
virtual const DetIdContainer & detIds() const
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.
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: CSCGeometry.cc:69
CSCDetMap theMap
Definition: CSCGeometry.h:156
virtual ~CSCGeometry()
Destructor.
Definition: CSCGeometry.cc:21
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:128
bool centreTIOffsets() const
Definition: CSCGeometry.h:130
DetContainer theDets
Definition: CSCGeometry.h:161
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
Definition: CSCGeometry.cc:36
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:162
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:106
ChamberContainer theChambers
Definition: CSCGeometry.h:153
std::vector< GeomDet * > DetContainer
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:160
bool realWireGeometry_
Definition: CSCGeometry.h:175
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:75
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:115
bool realWireGeometry() const
Definition: CSCGeometry.h:124
void addDetType(GeomDetType *type)
Add a DetType.
Definition: CSCGeometry.cc:51
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:93
std::vector< GeomDetUnit * > DetUnitContainer
void setGangedStripsInME1a(bool gs)
Definition: CSCGeometry.h:101
std::map< DetId, GeomDet * > CSCDetMap
Definition: CSCGeometry.h:26
void addDetId(DetId id)
Add a DetId.
std::vector< GeomDetType * > DetTypeContainer
bool gangedStrips() const
Definition: CSCGeometry.h:110
Definition: DetId.h:20
virtual const GeomDet * idToDet(DetId) const
Definition: CSCGeometry.cc:99
bool useCentreTIOffsets_
Definition: CSCGeometry.h:176
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
DetIdContainer theDetIds
Definition: CSCGeometry.h:163
void setDebugV(bool dbgv)
Definition: CSCGeometry.h:105
bool gangedstripsME1a_
Definition: CSCGeometry.h:173
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:164
void setUseCentreTIOffsets(bool cti)
Definition: CSCGeometry.h:104
CSCGeometry()
Default constructor.
Definition: CSCGeometry.cc:10
LayerContainer theLayers
Definition: CSCGeometry.h:167
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:124
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: CSCGeometry.cc:63
std::vector< CSCLayer * > LayerContainer
Definition: CSCGeometry.h:30
std::map< int, const CSCChamberSpecs *, std::less< int > > CSCSpecsContainer
Definition: CSCGeometry.h:28
bool onlywiresME1a_
Definition: CSCGeometry.h:174
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:112
std::vector< DetId > DetIdContainer