CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/Fireworks/Geometry/interface/TGeoMgrFromDdd.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Geometry_TGeoMgrFromDdd_h
00002 #define Fireworks_Geometry_TGeoMgrFromDdd_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Geometry
00006 // Class  :     TGeoMgrFromDdd
00007 // 
00016 //
00017 // Original Author:  
00018 //         Created:  Fri Jul  2 16:11:33 CEST 2010
00019 // $Id: TGeoMgrFromDdd.h,v 1.1 2010/07/06 18:42:13 matevz Exp $
00020 //
00021 
00022 // system include files
00023 #include <string>
00024 #include <map>
00025 
00026 #include "boost/shared_ptr.hpp"
00027 
00028 // user include files
00029 #include "FWCore/Framework/interface/ESProducer.h"
00030 
00031 // forward declarations
00032 
00033 namespace edm
00034 {
00035    class ParameterSet;
00036 }
00037 
00038 class DDSolid;
00039 class DDMaterial;
00040 class DisplayGeomRecord;
00041 
00042 class TGeoManager;
00043 class TGeoShape;
00044 class TGeoVolume;
00045 class TGeoMaterial;
00046 class TGeoMedium;
00047 
00048 class TGeoMgrFromDdd : public edm::ESProducer
00049 {
00050 public:
00051    TGeoMgrFromDdd(const edm::ParameterSet&);
00052    virtual ~TGeoMgrFromDdd();
00053 
00054    typedef boost::shared_ptr<TGeoManager> ReturnType;
00055 
00056    // ---------- const member functions ---------------------
00057 
00058    // ---------- static member functions --------------------
00059 
00060    // ---------- member functions ---------------------------
00061 
00062    ReturnType produce(const DisplayGeomRecord&);
00063 
00064 private:
00065    TGeoMgrFromDdd(const TGeoMgrFromDdd&);                  // stop default
00066    const TGeoMgrFromDdd& operator=(const TGeoMgrFromDdd&); // stop default
00067 
00068 
00069    TGeoManager*  createManager(int level);
00070 
00071    TGeoShape*    createShape(const std::string& iName,
00072                              const DDSolid& iSolid);
00073    TGeoVolume*   createVolume(const std::string& iName,
00074                               const DDSolid& iSolid,
00075                               const DDMaterial& iMaterial);
00076    TGeoMaterial* createMaterial(const DDMaterial& iMaterial);
00077 
00078    // ---------- member data --------------------------------
00079 
00080    int                      m_level;
00081    bool                     m_verbose;
00082 
00083    std::map<std::string, TGeoShape*>    nameToShape_;
00084    std::map<std::string, TGeoVolume*>   nameToVolume_;
00085    std::map<std::string, TGeoMaterial*> nameToMaterial_;
00086    std::map<std::string, TGeoMedium*>   nameToMedium_;
00087 };
00088 
00089 #endif