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 
41  virtual ~CSCGeometry();
42 
43  //---- Base class' interface
44 
45  // Return a vector of all det types
46  virtual const DetTypeContainer& detTypes() const;
47 
48  // Return a vector of all GeomDetUnit
49  virtual const DetUnitContainer& detUnits() const;
50 
51  // Return a vector of all GeomDet (including all GeomDetUnits)
52  virtual const DetContainer& dets() const;
53 
54  // Return a vector of all GeomDetUnit DetIds
55  virtual const DetIdContainer& detUnitIds() const;
56 
57  // Return a vector of all GeomDet DetIds (including those of GeomDetUnits)
58  virtual const DetIdContainer& detIds() const;
59 
60  // Return the pointer to the GeomDetUnit corresponding to a given DetId
61  virtual const GeomDetUnit* idToDetUnit(DetId) const;
62 
63  // Return the pointer to the GeomDet corresponding to a given DetId
64  virtual const GeomDet* idToDet(DetId) const;
65 
66  //---- Extension of the interface
67 
69  const CSCChamber* chamber(CSCDetId id) const;
70 
72  const CSCLayer* layer(CSCDetId id) const;
73 
75  const ChamberContainer& chambers() const;
76 
78  const LayerContainer& layers() const;
79 
80 
81 
86  const CSCChamberSpecs* findSpecs( int iChamberType );
87 
93  const CSCChamberSpecs* buildSpecs( int iChamberType,
94  const std::vector<float>& fpar,
95  const std::vector<float>& fupar,
96  const CSCWireGroupPackage& wg );
97 
98  void setGangedStripsInME1a(bool gs) { gangedstripsME1a = gs; }
99  void setOnlyWiresInME1a(bool ow) { onlywiresME1a = ow; }
101  void setUseCentreTIOffsets(bool cti) { useCentreTIOffsets = cti; }
102  void setDebugV(bool dbgv) { debugV = dbgv; }
103 
107  bool gangedStrips() const { return gangedstripsME1a; }
108 
112  bool wiresOnly() const { return onlywiresME1a; }
113 
121  bool realWireGeometry() const { return useRealWireGeometry; }
122 
127  bool centreTIOffsets() const { return useCentreTIOffsets; }
128 
130  void queryModelling() const;
131 
132  private:
133 
135  void addChamber(CSCChamber* ch);
136 
138  void addLayer(CSCLayer* l);
139 
141  void addDetType(GeomDetType* type);
142 
144  void addDetId(DetId id);
145 
147  void addDet(GeomDet* det);
148 
149  // The chambers are owned by the geometry (which in turn own layers)
151 
152  // Map for efficient lookup by DetId
154 
155  // These are used rarely; they could be computed at runtime
156  // to save memory.
158  DetContainer theDets; // all dets (chambers and layers)
162 
163  // These are reduntant copies, to satisfy the interface.
165 
166  // Parameters controlling modelling of geometry
167 
168  bool debugV; // for debug printout etc.
169 
174 
175  // Store pointers to Specs objects as we build them.
177 
178 };
179 
180 #endif
181 
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:176
type
Definition: HCALResponse.h:22
void setOnlyWiresInME1a(bool ow)
Definition: CSCGeometry.h:99
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:50
std::vector< CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:29
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: CSCGeometry.cc:75
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
Definition: CSCGeometry.cc:173
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: CSCGeometry.cc:81
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:63
CSCDetMap theMap
Definition: CSCGeometry.h:153
virtual ~CSCGeometry()
Destructor.
Definition: CSCGeometry.cc:15
bool useRealWireGeometry
Definition: CSCGeometry.h:172
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:127
bool centreTIOffsets() const
Definition: CSCGeometry.h:127
DetContainer theDets
Definition: CSCGeometry.h:158
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
Definition: CSCGeometry.cc:30
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:159
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:100
ChamberContainer theChambers
Definition: CSCGeometry.h:150
std::vector< GeomDet * > DetContainer
bool useCentreTIOffsets
Definition: CSCGeometry.h:173
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:157
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:69
void addLayer(CSCLayer *l)
Add a DetUnit.
Definition: CSCGeometry.cc:36
const CSCChamberSpecs * findSpecs(int iChamberType)
Definition: CSCGeometry.cc:166
bool wiresOnly() const
Definition: CSCGeometry.h:112
bool realWireGeometry() const
Definition: CSCGeometry.h:121
void addDetType(GeomDetType *type)
Add a DetType.
Definition: CSCGeometry.cc:45
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:87
std::vector< GeomDetUnit * > DetUnitContainer
void setGangedStripsInME1a(bool gs)
Definition: CSCGeometry.h:98
void setUseRealWireGeometry(bool wg)
Definition: CSCGeometry.h:100
bool gangedstripsME1a
Definition: CSCGeometry.h:170
std::map< DetId, GeomDet * > CSCDetMap
Definition: CSCGeometry.h:26
void addDetId(DetId id)
Add a DetId.
std::vector< GeomDetType * > DetTypeContainer
bool onlywiresME1a
Definition: CSCGeometry.h:171
bool gangedStrips() const
Definition: CSCGeometry.h:107
Definition: DetId.h:20
virtual const GeomDet * idToDet(DetId) const
Definition: CSCGeometry.cc:93
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:117
DetIdContainer theDetIds
Definition: CSCGeometry.h:160
void setDebugV(bool dbgv)
Definition: CSCGeometry.h:102
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:161
void setUseCentreTIOffsets(bool cti)
Definition: CSCGeometry.h:101
CSCGeometry()
Default constructor.
Definition: CSCGeometry.cc:10
LayerContainer theLayers
Definition: CSCGeometry.h:164
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:123
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: CSCGeometry.cc:57
std::vector< CSCLayer * > LayerContainer
Definition: CSCGeometry.h:30
std::map< int, const CSCChamberSpecs *, std::less< int > > CSCSpecsContainer
Definition: CSCGeometry.h:28
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:106
std::vector< DetId > DetIdContainer