CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DetectorDescription/Core/interface/DDLogicalPart.h

Go to the documentation of this file.
00001 #ifndef DDLogicalPart_h
00002 #define DDLogicalPart_h
00003 
00004 #include <iosfwd>
00005 #include <vector>
00006 #include <string>
00007 #include <map>
00008 #include "DetectorDescription/Core/interface/DDName.h"
00009 #include "DetectorDescription/Core/interface/DDBase.h"
00010 #include "DetectorDescription/Core/interface/DDEnums.h"
00011 #include "DetectorDescription/Base/interface/Singleton.h"
00012 #include "DetectorDescription/Core/interface/DDsvalues.h"
00013 
00014 namespace DDI { class LogicalPart; }
00015 
00016 class DDMaterial;
00017 class DDSolid;
00018 class DDSpecifics;
00019 class DDLogicalPart;
00020 class DDPartSelection;
00021 
00022 std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
00023 
00025 
00088 class DDLogicalPart : public DDBase<DDName,DDI::LogicalPart*>
00089 {
00090   friend std::ostream & operator<<( std::ostream &, const DDLogicalPart &);
00091 
00092 public:  
00094   DDLogicalPart( void ) : DDBase<DDName,DDI::LogicalPart*>(){ }   
00095   
00097   DDLogicalPart( const DDName & name );
00098     
00100   DDLogicalPart( const DDName & name,
00101                  const DDMaterial & material,
00102                  const DDSolid & solid,
00103                  DDEnums::Category cat = DDEnums::unspecified );
00104   
00106   DDEnums::Category category( void ) const;
00107   
00109   const DDMaterial & material( void ) const;
00110   
00112   const DDSolid & solid( void ) const; 
00113   
00115   double & weight( void );
00116   
00118   std::vector<const DDsvalues_type *> specifics( void ) const;
00119   
00121   DDsvalues_type mergedSpecifics( void ) const;
00122   
00124   void addSpecifics( const std::pair<DDPartSelection*,DDsvalues_type*> &);
00125   void removeSpecifics( const std::pair<DDPartSelection*,DDsvalues_type*> &);
00126   const std::vector< std::pair<DDPartSelection*,DDsvalues_type*> > & attachedSpecifics( void ) const;
00127   bool hasDDValue( const DDValue & ) const;
00128 };
00129 
00130 // some helpers .... (not very clean, redesign!!)
00131 std::pair<bool, std::string>
00132 DDIsValid( const std::string & ns, const std::string & name, std::vector<DDLogicalPart> & result, bool doRegex = true );
00133 // std::maps name to std::vector of namespaces
00134 // 2009-2010 re-write...FIX: Understand how this is used by DDSpecifics and FIX
00135 typedef DDI::Singleton<std::map<std::string, std::vector<DDName> > > LPNAMES;
00136 void DD_NC( const DDName & );
00137 
00138 #endif