CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Geometry/CSCGeometry/interface/CSCGeometry.h

Go to the documentation of this file.
00001 #ifndef CSCGeometry_CSCGeometry_h
00002 #define CSCGeometry_CSCGeometry_h
00003 
00011 #include <DataFormats/DetId/interface/DetId.h>
00012 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
00013 #include <Geometry/CommonDetUnit/interface/TrackingGeometry.h>
00014 #include <Geometry/CSCGeometry/interface/CSCLayer.h>
00015 #include <vector>
00016 #include <map>
00017 
00018 class GeomDetType;
00019 class GeomDetUnit;
00020 class CSCChamber;
00021 class CSCChamberSpecs;
00022 class CSCWireGroupPackage;
00023 
00024 class CSCGeometry : public TrackingGeometry {
00025 
00026   typedef std::map<DetId, GeomDet*> CSCDetMap;
00027   // The buffer for specs need not really be a map. Could do it with a vector!
00028   typedef std::map<int, const CSCChamberSpecs*, std::less<int> > CSCSpecsContainer;
00029   typedef std::vector<CSCChamber*> ChamberContainer;
00030   typedef std::vector<CSCLayer*> LayerContainer;
00031 
00032  public:
00033 
00034   friend class CSCGeometryBuilder; //FromDDD;
00035   friend class GeometryAligner;
00036 
00038   CSCGeometry();
00039 
00041   virtual ~CSCGeometry();
00042 
00043   //---- Base class' interface
00044 
00045   // Return a vector of all det types
00046   virtual const DetTypeContainer&  detTypes() const;
00047 
00048   // Return a vector of all GeomDetUnit
00049   virtual const DetUnitContainer& detUnits() const;
00050 
00051   // Return a vector of all GeomDet (including all GeomDetUnits)
00052   virtual const DetContainer& dets() const;
00053   
00054   // Return a vector of all GeomDetUnit DetIds
00055   virtual const DetIdContainer&    detUnitIds() const;
00056 
00057   // Return a vector of all GeomDet DetIds (including those of GeomDetUnits)
00058   virtual const DetIdContainer& detIds() const;
00059 
00060   // Return the pointer to the GeomDetUnit corresponding to a given DetId
00061   virtual const GeomDetUnit* idToDetUnit(DetId) const;
00062 
00063   // Return the pointer to the GeomDet corresponding to a given DetId
00064   virtual const GeomDet* idToDet(DetId) const;
00065 
00066   //---- Extension of the interface
00067 
00069   const CSCChamber* chamber(CSCDetId id) const;
00070 
00072   const CSCLayer* layer(CSCDetId id) const;
00073 
00075   const ChamberContainer& chambers() const;
00076 
00078   const LayerContainer& layers() const;
00079 
00080 
00081 
00086   const CSCChamberSpecs* findSpecs( int iChamberType );
00087 
00093   const CSCChamberSpecs* buildSpecs( int iChamberType,
00094                                  const std::vector<float>& fpar,
00095                                  const std::vector<float>& fupar,
00096                                  const CSCWireGroupPackage& wg );
00097 
00098   void setGangedStripsInME1a(bool gs) { gangedstripsME1a = gs; }
00099   void setOnlyWiresInME1a(bool ow) { onlywiresME1a = ow; }
00100   void setUseRealWireGeometry(bool wg) { useRealWireGeometry = wg; }
00101   void setUseCentreTIOffsets(bool cti) { useCentreTIOffsets = cti; }
00102   void setDebugV(bool dbgv) { debugV = dbgv; }
00103 
00107   bool gangedStrips() const { return gangedstripsME1a; }
00108 
00112   bool wiresOnly() const { return onlywiresME1a; }
00113 
00121   bool realWireGeometry() const { return useRealWireGeometry; }
00122 
00127   bool centreTIOffsets() const { return useCentreTIOffsets; }
00128 
00130   void queryModelling() const;
00131 
00132  private:
00133 
00135   void addChamber(CSCChamber* ch);
00136   
00138   void addLayer(CSCLayer* l);
00139 
00141   void addDetType(GeomDetType* type);
00142 
00144   void addDetId(DetId id);
00145 
00147   void addDet(GeomDet* det);
00148 
00149   // The chambers are owned by the geometry (which in turn own layers)
00150   ChamberContainer  theChambers; 
00151 
00152   // Map for efficient lookup by DetId 
00153   CSCDetMap         theMap;
00154 
00155   // These are used rarely; they could be computed at runtime 
00156   // to save memory.
00157   DetTypeContainer  theDetTypes;
00158   DetContainer      theDets;       // all dets (chambers and layers)
00159   DetUnitContainer  theDetUnits;   // all layers
00160   DetIdContainer    theDetIds;
00161   DetIdContainer    theDetUnitIds;
00162 
00163   // These are reduntant copies, to satisfy the interface.
00164   LayerContainer    theLayers;
00165 
00166   // Parameters controlling modelling of geometry 
00167 
00168   bool debugV; // for debug printout etc.
00169 
00170   bool gangedstripsME1a;
00171   bool onlywiresME1a;
00172   bool useRealWireGeometry;
00173   bool useCentreTIOffsets;
00174 
00175   // Store pointers to Specs objects as we build them.
00176   CSCSpecsContainer specsContainer;
00177 
00178 };
00179 
00180 #endif
00181