diff --git a/DetectorDescription/Core/interface/DDAlgorithmHandler.h b/DetectorDescription/Core/interface/DDAlgorithmHandler.h index 2866cd6889107..1803cadfd8586 100644 --- a/DetectorDescription/Core/interface/DDAlgorithmHandler.h +++ b/DetectorDescription/Core/interface/DDAlgorithmHandler.h @@ -21,7 +21,7 @@ class DDAlgorithmHandler //! initializes the wrapped algorithm algo_ and does some pre- and post-processing /** pre- and postprocessing mainly covers exception handling, the algorithm object algo_ is fetched from the plugin-manager */ - void initialize( const std::string & algoName, + void initialize( const DDName & algoName, const DDLogicalPart & parent, const DDNumericArguments & nArgs, const DDVectorArguments & vArgs, @@ -34,8 +34,6 @@ class DDAlgorithmHandler private: std::unique_ptr algo_; //!< the wrapped algorithm object - std::string algoname_; //!< name of the algorithm object - DDLogicalPart parent_; //!< parent logical part }; #endif // DD_DDALGORITHMHANDLER_H diff --git a/DetectorDescription/Core/interface/DDINumberingScheme.h b/DetectorDescription/Core/interface/DDINumberingScheme.h deleted file mode 100644 index df41aab4cd2de..0000000000000 --- a/DetectorDescription/Core/interface/DDINumberingScheme.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef DDD_DDINumberingScheme -#define DDD_DDINumberingScheme - -#include "DetectorDescription/Core/interface/DDExpandedNode.h" - -/** abstract interface for a numbering scheme */ -class DDINumberingScheme -{ -public: - virtual int id(const DDExpandedNode &) const = 0; - virtual int id(const DDGeoHistory &) const = 0; - virtual DDExpandedNode node(int) const = 0; - virtual DDGeoHistory history(int) const = 0; -}; - -#endif // DDD_DDINumberingScheme diff --git a/DetectorDescription/Core/interface/DDName.h b/DetectorDescription/Core/interface/DDName.h index 7589487bd90c0..da8dcf47ab6be 100644 --- a/DetectorDescription/Core/interface/DDName.h +++ b/DetectorDescription/Core/interface/DDName.h @@ -1,5 +1,5 @@ -#ifndef DDName_h -#define DDName_h +#ifndef DETECTOR_DESCRIPTION_CORE_DDNAME_H +#define DETECTOR_DESCRIPTION_CORE_DDNAME_H #include #include @@ -14,32 +14,23 @@ class DDCurrentNamespace; */ class DDName { - friend class DStreamer; // intrusive! - public: - typedef DDCurrentNamespace CNS; - typedef int id_type; - typedef std::map,id_type> Registry; - typedef std::vector IdToName; + using id_type = int; + using Registry = std::map, id_type>; + using IdToName = std::vector; //! Constructs a DDName with name \a name and assigns \a name to the namespace \a ns. DDName( const std::string & name, - const std::string & ns); + const std::string & ns ); //! Creates a DDName with \a name in the current namespace defined in the singleton DDCurrentNamespace DDName( const std::string & name ); DDName( const char* name ); DDName( const char* name, const char* ns ); - // DDName(pair); - DDName(id_type); - //! register pre-defined ids - static void defineId( const std::pair &, id_type id); explicit DDName(); - //! true, if a DDName with given name and namespace (ns) already is registerd, otherwise false - static bool exists(const std::string & name, const std::string & ns); //! Returns the \a name const std::string & name() const; @@ -51,44 +42,16 @@ class DDName */ const std::string fullname() const { return ns() + ":" + name(); } - // DEPRECATED!!! - operator std::string() const { return ns() + ":" + name(); } - - id_type id() const { return id_;} - bool operator<(const DDName & rhs) const { return id_ < rhs.id_; } bool operator==(const DDName & rhs) const { return id_ == rhs.id_; } private: + id_type id_; - static Registry::iterator registerName(const std::pair & s); -}; - -//! DDNameInterface provides a common interface to DDD entities -/** DDLogicalPart, DDMaterial, DDSolids, ... all are uniquely identified by - their class and the value of their associated DDName. - DDNameInterface provides read-access to their DDName. -*/ -struct DDNameInterface -{ - virtual ~DDNameInterface() {} - - //! Returns the \a name without the \a namespace - virtual const std::string & name() const=0; // name without namespace - - //! Return the \a namespace - virtual const std::string & ns() const=0; // only the namespace - - //! Return the DDName - DDName ddname() const { return DDName(name(),ns()); } - - virtual operator bool() const=0; - - //! \b don't \b use \b! - virtual int id() const=0; // dont't know if usefull ... + static Registry::iterator registerName( const std::pair & s ); }; -std::ostream & operator<<(std::ostream & os, const DDName & n); +std::ostream & operator<<( std::ostream & os, const DDName & n ); #endif diff --git a/DetectorDescription/Core/interface/DDNodeSelector.h b/DetectorDescription/Core/interface/DDNodeSelector.h deleted file mode 100644 index 7b594cd1c3fea..0000000000000 --- a/DetectorDescription/Core/interface/DDNodeSelector.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef DD_DDNodeSelector_h -#define DD_DDNodeSelector_h - -#include - -class DDCompactView; -class DDGeoHistory; - -/** given a part selection std::string, a node selector calculates all expanded nodes in the geometry tree */ -class DDNodeSelector -{ -public: - - /** The compact view given in the constructor represents the geometry on which the node selector works */ - explicit DDNodeSelector(const DDCompactView &); - - /** you can derive your own node selector */ - virtual ~DDNodeSelector(); - - /** sets the selection std::string from which all expanded nodes in the geometry tree should be - calculated */ - bool setPartSelection(const std::string &, bool useRegex=false); - - /** the current node matching the selection std::string; copy it, if you want to keep it! */ - const DDGeoHistory & current() const; - - /** the next node matching the selection std::string, returns false, if there is no next node */ - bool next(); - - -}; - -#endif diff --git a/DetectorDescription/Core/interface/DDNumberingScheme.h b/DetectorDescription/Core/interface/DDNumberingScheme.h deleted file mode 100644 index bb56a99943360..0000000000000 --- a/DetectorDescription/Core/interface/DDNumberingScheme.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef DDNumberingScheme_h -#define DDNumberingScheme_h - -#include - -class DDExpandedView; -//typename DDExpandedView::nav_type; -class DDFilteredView; -//class DDFilteredView::nav_type; -//! Base for user specfic numbering schemes -/** - implements a default - numbering scheme - throws an DDException when it fails ... -*/ -class DDNumberingScheme //: throw DDException -{ -public: - typedef std::vector nav_type; - virtual ~DDNumberingScheme(); - - //! calculate the id of a given node - virtual int id(const DDExpandedView &) const = 0; - - //! calculate the id of a given node - virtual int id(const DDFilteredView &) const = 0; - - //! calculate the id of a given node - virtual int id(const nav_type &) const = 0 ; - - - //! calculate the node given an id - /** - returns true, if a node was found. view then corresponds to this node. - */ - virtual bool node(int id, DDExpandedView & view) const = 0; - - //! calculate the node given an id - /** - returns true, if a node was found. view then corresponds to this node. - */ - virtual bool node(int id, DDFilteredView & view) const = 0; - -}; - - - - -#include -//! Default numbering scheme -/** - implements a default - numbering scheme - throws an DDException when it fails ... -*/ -class DDDefaultNumberingScheme : public DDNumberingScheme //: throw DDException -{ -public: - typedef DDNumberingScheme::nav_type nav_type; - DDDefaultNumberingScheme(const DDExpandedView & e); - DDDefaultNumberingScheme(const DDFilteredView & f); - ~DDDefaultNumberingScheme() override; - - //! calculate the id of a given node - int id(const DDExpandedView &) const override; - - //! calculate the id of a given node - int id(const DDNumberingScheme::nav_type &) const override; - - //! calculate the id of a given node - int id(const DDFilteredView &) const override; - - //! calculate the node given an id - /** - returns true, if a node was found. view then corresponds to this node. - */ - bool node(int id, DDExpandedView & view) const override; - - //! calculate the node given an id - /** - returns true, if a node was found. view then corresponds to this node. - */ - bool node(int id, DDFilteredView & view) const override; - -protected: - DDNumberingScheme::nav_type idToNavType(int id) const; - -protected: - std::map path2id_; - std::vector::iterator> id2path_; -}; - - - - -#endif diff --git a/DetectorDescription/Core/src/DDAlgorithmHandler.cc b/DetectorDescription/Core/src/DDAlgorithmHandler.cc index 89ec0379e4f08..3b749155e420b 100644 --- a/DetectorDescription/Core/src/DDAlgorithmHandler.cc +++ b/DetectorDescription/Core/src/DDAlgorithmHandler.cc @@ -6,7 +6,7 @@ class DDCompactView; void -DDAlgorithmHandler::initialize( const std::string & algoName, +DDAlgorithmHandler::initialize( const DDName & algoName, const DDLogicalPart & parent, const DDNumericArguments & nArgs, const DDVectorArguments & vArgs, @@ -14,8 +14,7 @@ DDAlgorithmHandler::initialize( const std::string & algoName, const DDStringArguments & sArgs, const DDStringVectorArguments & svArgs ) { - algoname_ = algoName; - algo_ = std::unique_ptr(DDAlgorithmFactory::get()->create( algoname_ )); + algo_ = std::unique_ptr(DDAlgorithmFactory::get()->create( algoName.fullname())); algo_->setParent( parent ); algo_->initialize( nArgs, vArgs, mArgs, sArgs, svArgs ); } diff --git a/DetectorDescription/Core/src/DDName.cc b/DetectorDescription/Core/src/DDName.cc index afc31eab530b2..478631b03139d 100644 --- a/DetectorDescription/Core/src/DDName.cc +++ b/DetectorDescription/Core/src/DDName.cc @@ -1,95 +1,60 @@ #include "DetectorDescription/Core/interface/DDName.h" +#include "DetectorDescription/Core/interface/DDCurrentNamespace.h" +#include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/Singleton.h" #include #include #include -#include "DetectorDescription/Core/interface/Singleton.h" -#include "DetectorDescription/Core/interface/DDCurrentNamespace.h" -#include "DetectorDescription/Core/interface/DDSplit.h" -#include "FWCore/Utilities/interface/Exception.h" - -std::ostream & operator<<(std::ostream & os, const DDName & n) +std::ostream & operator<<( std::ostream & os, const DDName & n ) { os << n.ns() << ':' << n.name(); return os; } -// Implementation of DDName - -DDName::DDName( const std::string & name, const std::string & ns) - : id_(registerName(std::make_pair(name,ns))->second) +DDName::DDName( const std::string & name, const std::string & ns ) + : id_( registerName( std::make_pair( name, ns ))->second ) { } - DDName::DDName( const std::string & name ) - : id_(0) + : id_( 0 ) { - std::pair result = DDSplit(name); - if (result.second.empty()) { - id_ = registerName(std::make_pair(result.first,DDCurrentNamespace::ns()))->second; + std::pair result = DDSplit( name ); + if( result.second.empty()) { + id_ = registerName( std::make_pair( result.first, DDCurrentNamespace::ns()))->second; } else { - id_ = registerName(result)->second; + id_ = registerName( result )->second; } } - DDName::DDName( const char* name ) - : id_(0) + : id_( 0 ) { - std::pair result = DDSplit(name); - if (result.second.empty()) { - id_ = registerName(std::make_pair(result.first,DDCurrentNamespace::ns()))->second; + std::pair< std::string, std::string > result = DDSplit( name ); + if( result.second.empty()) { + id_ = registerName( std::make_pair( result.first, DDCurrentNamespace::ns()))->second; } else { - id_ = registerName(result)->second; + id_ = registerName( result )->second; } } - -DDName::DDName( const char* name, const char* ns) - : id_(registerName(std::make_pair(std::string(name),std::string(ns)))->second) +DDName::DDName( const char* name, const char* ns ) + : id_( registerName( std::make_pair( std::string( name ), std::string( ns )))->second ) { } - DDName::DDName() - : id_(0) -{ } - -DDName::DDName(DDName::id_type id) - : id_(id) + : id_(0) { } -void DDName::defineId(const std::pair & nm, DDName::id_type id) -{ - IdToName & id2n = DDI::Singleton::instance(); - - /* - Semantics: - If id exists && the registered value matches the given one, do nothing - If id exists && the registered value DOES NOT match, throw - If id DOES NOT exists, register with the given value - */ - if ( id < id_type(id2n.size()) ) { - if(id2n[id]->first != nm) { - std::stringstream s; - s << id; - throw cms::Exception("DDException") << "DDName::DDName(std::pair,id_type): id=" + s.str() + " reg-name=?"; - } - } - else { - id2n.resize(id+1); - DDI::Singleton::instance()[nm]=id; - id2n[id] = DDI::Singleton::instance().find(nm); - } -} - -const std::string & DDName::name() const +const std::string & +DDName::name() const { - const static std::string ano_("anonymous"); + const static std::string ano_( "anonymous" ); const std::string * result; - if (id_ < 0) { + if( id_ < 0 ) { result = &ano_; } else { @@ -98,13 +63,13 @@ const std::string & DDName::name() const return *result; } - -const std::string & DDName::ns() const +const std::string & +DDName::ns() const { - const static std::string ano_("anonymous"); + const static std::string ano_( "anonymous" ); const std::string * result; - if (id_ < 0) { - result = &ano_; + if( id_ < 0 ) { + result = &ano_; } else { result = &DDI::Singleton::instance()[id_]->first.second; @@ -112,30 +77,22 @@ const std::string & DDName::ns() const return *result; } - - -bool DDName::exists(const std::string & name, const std::string & ns) +DDName::Registry::iterator +DDName::registerName( const std::pair & nm ) { - const std::pair p(name,ns); - Registry::const_iterator it = DDI::Singleton::instance().find(p); - return it != DDI::Singleton::instance().end() ? true : false; -} - - -DDName::Registry::iterator DDName::registerName(const std::pair & nm) { - Registry& reg_ = DDI::Singleton::instance(); - IdToName & idToName = DDI::Singleton::instance(); - Registry::size_type sz = reg_.size(); - if (!sz) { - reg_[std::make_pair(std::string(""),std::string(""))] = 0; - idToName.emplace_back(reg_.begin()); - ++sz; - } - Registry::value_type val(nm, sz); - std::pair result = reg_.insert(val); - if (result.second) { - idToName.emplace_back(result.first); - } - return result.first; + Registry& reg = DDI::Singleton::instance(); + IdToName & idToName = DDI::Singleton::instance(); + Registry::size_type sz = reg.size(); + if( !sz ) + { + reg[std::make_pair( std::string(""), std::string(""))] = 0; + idToName.emplace_back( reg.begin()); + ++sz; + } + Registry::value_type val( nm, sz ); + std::pair result = reg.insert( val ); + if( result.second ) { + idToName.emplace_back( result.first ); + } + return result.first; } - diff --git a/DetectorDescription/Core/src/DDNumberingScheme.cc b/DetectorDescription/Core/src/DDNumberingScheme.cc deleted file mode 100644 index 118297aed3a16..0000000000000 --- a/DetectorDescription/Core/src/DDNumberingScheme.cc +++ /dev/null @@ -1,109 +0,0 @@ -#include "DetectorDescription/Core/interface/DDNumberingScheme.h" - -#include -#include - -#include "DetectorDescription/Core/interface/DDExpandedView.h" -#include "DetectorDescription/Core/interface/DDFilteredView.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -DDNumberingScheme::~DDNumberingScheme() {} - -DDDefaultNumberingScheme::DDDefaultNumberingScheme(const DDExpandedView & ex) -{ - // extremely memory consuming & slow. - - /* - assign a node-number (from 0, ...) to every node in the view - - save the node-number in a map, key is the stack of sibling-numbers of the node - -> enables node to id calculation (slow O(log(max. node-number))). - - save in a std::vector the stack of sibling-numbers; index in the std::vector is the - assigned node number -> enables id to node calculation (fast) - */ - typedef std::map::iterator m_it; - - DDExpandedView e = ex; - e.reset(); - bool go = true; - int count = 0; - while (go) { - std::pair res = path2id_.insert(std::make_pair(e.navPos(),count)); - id2path_.emplace_back(res.first); - ++count; - go = e.next(); - } -} - - -DDDefaultNumberingScheme::DDDefaultNumberingScheme(const DDFilteredView & fv) -{ - // very memory consuming & slow, depending on the amount of nodes - // selected by the FilteredView; same algorithm then in ctor above - typedef std::map::iterator m_it; - - DDFilteredView f = fv; - f.reset(); - bool go = true; - int count = 0; - while (go) { - std::pair res = path2id_.insert(std::make_pair(f.navPos(),count)); - id2path_.emplace_back(res.first); - ++count; - go = f.next(); - } -} - - -DDDefaultNumberingScheme::~DDDefaultNumberingScheme() -{ } - - -int DDDefaultNumberingScheme::id(const DDExpandedView & e) const -{ - return id(e.navPos()); -} - - -int DDDefaultNumberingScheme::id(const DDFilteredView & f) const -{ - return id(f.navPos()); -} - - -int DDDefaultNumberingScheme::id(const DDDefaultNumberingScheme::nav_type & n) const -{ - std::map::const_iterator it = path2id_.find(n); - int result = -1; - if (it != path2id_.end()) - result = it->second; - return result; -} - - -bool DDDefaultNumberingScheme::node(int id, DDExpandedView & view) const -{ - return view.goTo(idToNavType(id)); -} - - -bool DDDefaultNumberingScheme::node(int id, DDFilteredView & view) const -{ - edm::LogError("DDNumberingScheme") << "DDDefaultNumberingScheme::node(int,DDFilteredView&) NOT IMPLEMENTED!" - << std::endl; - return view.goTo(idToNavType(id)); -} - - -DDNumberingScheme::nav_type DDDefaultNumberingScheme::idToNavType(int id) const -{ - std::vector::size_type pos = id; - nav_type result; - if ( (id>=(int)id2path_.size()) || ( id < 0) ) - ; - - else { - std::map::iterator it = id2path_[pos]; - result = it->first; - } - return result; -} - diff --git a/DetectorDescription/Parser/src/DDDividedPolycone.cc b/DetectorDescription/Parser/src/DDDividedPolycone.cc index d126861731dde..cc10c115618b3 100644 --- a/DetectorDescription/Parser/src/DDDividedPolycone.cc +++ b/DetectorDescription/Parser/src/DDDividedPolycone.cc @@ -100,7 +100,6 @@ DDDividedPolyconeRho::makeDDTranslation( const int copyNo ) const DDLogicalPart DDDividedPolyconeRho::makeDDLogicalPart( const int copyNo ) const { - DDName solname; DDSolid ddpolycone; DDMaterial usemat(div_.parent().material()); @@ -119,15 +118,11 @@ DDDividedPolyconeRho::makeDDLogicalPart( const int copyNo ) const { width = calculateWidth( localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset() ); - // hmmm different width every time... probably should use width - // not compWidth_ - // newrMinVec[ii] = localrMinVec[ii]+div_.offset()+compWidth_*copyNo; - // newrMaxVec[ii] = localrMinVec[ii]+div_.offset()+compWidth_*(copyNo+1); newrMinVec.emplace_back(localrMinVec[ii]+div_.offset()+width*copyNo); newrMaxVec.emplace_back(localrMinVec[ii]+div_.offset()+width*(copyNo+1)); } - solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), - div_.parent().ddname().ns()); + DDName solname( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), + div_.parent().ddname().ns()); ddpolycone = DDSolidFactory::polycone( solname, msol.startPhi(), @@ -204,7 +199,6 @@ DDDividedPolyconePhi::makeDDTranslation( const int copyNo ) const DDLogicalPart DDDividedPolyconePhi::makeDDLogicalPart( const int copyNo ) const { - DDName solname; DDSolid ddpolycone; DDMaterial usemat(div_.parent().material()); @@ -213,8 +207,8 @@ DDDividedPolyconePhi::makeDDLogicalPart( const int copyNo ) const std::vector localrMinVec = msol.rMinVec(); std::vector localzVec = msol.zVec(); - solname = DDName(div_.parent().ddname().name() + "_DIVCHILD", - div_.parent().ddname().ns()); + DDName solname( div_.parent().ddname().name() + "_DIVCHILD", + div_.parent().ddname().ns()); DDSolid sol( solname ); if( !sol.isDefined().second ) { @@ -314,7 +308,6 @@ DDDividedPolyconeZ::makeDDTranslation( const int copyNo ) const DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart( const int copyNo ) const { - DDName solname; DDSolid ddpolycone; DDMaterial usemat(div_.parent().material()); @@ -323,8 +316,8 @@ DDDividedPolyconeZ::makeDDLogicalPart( const int copyNo ) const std::vector localrMinVec = msol.rMinVec(); std::vector localzVec = msol.zVec(); - solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), - div_.parent().ddname().ns()); + DDName solname( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), + div_.parent().ddname().ns()); ddpolycone = DDSolidFactory::cons( solname, compWidth_ / 2, localrMinVec[copyNo], diff --git a/DetectorDescription/Parser/src/DDLPosPart.cc b/DetectorDescription/Parser/src/DDLPosPart.cc index 0c3c1267e75b1..55a1225ace6b7 100644 --- a/DetectorDescription/Parser/src/DDLPosPart.cc +++ b/DetectorDescription/Parser/src/DDLPosPart.cc @@ -57,26 +57,29 @@ DDLPosPart::processElement( const std::string& name, const std::string& nmspace, // rRotation, Rotation, ReflectionRotation, rReflectionRotation. // If it falls through here, a default call will result in a nameless // "identity" rotation being passed to DDCore. - DDName rotn; - if (myrRotation->size() > 0){ - rotn = myrRotation->getDDName(nmspace); - } - else if (myDDLRotation->size() > 0) { - // The assumption here is that the Rotation element created - // a DDRotation already, and so we can use this as an rRotation - // just provide DDCore with the name of the one just added... - // How to handle name conflicts? OVERWRITTEN by DDCore for now. - rotn = myDDLRotation->getDDName(nmspace); - } - else if (myDDLRefl->size() > 0) { - // The assumption is that a ReflectionRotation has been created and therefore - // we can refer to it as the rotation associated with this PosPart. - // we can further assume that the namespace is the same as this PosPart. - rotn = myDDLRefl->getDDName(nmspace); - } - else if (myrRefl->size() > 0) { - rotn = myrRefl->getDDName(nmspace); - } + DDName rotn(( myrRotation->size() > 0) ? myrRotation->getDDName( nmspace ) : + (( myDDLRotation->size() > 0) ? myDDLRotation->getDDName( nmspace ) : + (( myDDLRefl->size() > 0) ? myDDLRefl->getDDName(nmspace) : + (( myrRefl->size() > 0 ) ? myrRefl->getDDName(nmspace) : DDName(""))))); + // if (myrRotation->size() > 0){ + // rotn = myrRotation->getDDName(nmspace); + // } + // else if (myDDLRotation->size() > 0) { + // // The assumption here is that the Rotation element created + // // a DDRotation already, and so we can use this as an rRotation + // // just provide DDCore with the name of the one just added... + // // How to handle name conflicts? OVERWRITTEN by DDCore for now. + // rotn = myDDLRotation->getDDName(nmspace); + // } + // else if (myDDLRefl->size() > 0) { + // // The assumption is that a ReflectionRotation has been created and therefore + // // we can refer to it as the rotation associated with this PosPart. + // // we can further assume that the namespace is the same as this PosPart. + // rotn = myDDLRefl->getDDName(nmspace); + // } + // else if (myrRefl->size() > 0) { + // rotn = myrRefl->getDDName(nmspace); + // } ClhepEvaluator & ev = myRegistry_->evaluator(); diff --git a/DetectorDescription/RegressionTest/interface/DDErrorDetection.h b/DetectorDescription/RegressionTest/interface/DDErrorDetection.h index 3ebac075d32cd..9b80bfe7e1ae0 100644 --- a/DetectorDescription/RegressionTest/interface/DDErrorDetection.h +++ b/DetectorDescription/RegressionTest/interface/DDErrorDetection.h @@ -127,7 +127,7 @@ class DDErrorDetection void nix(); - const std::vector > & ma(); + const std::vector > & ma(); void report(const DDCompactView& cpv, std::ostream & o); diff --git a/DetectorDescription/RegressionTest/src/DDCheck.h b/DetectorDescription/RegressionTest/src/DDCheck.h index d77f0a84de48e..4a8f58e9712b0 100644 --- a/DetectorDescription/RegressionTest/src/DDCheck.h +++ b/DetectorDescription/RegressionTest/src/DDCheck.h @@ -15,6 +15,6 @@ class DDName; // some self-consistency checks bool DDCheck(std::ostream&); bool DDCheck(const DDCompactView& cpv, std::ostream&); -bool DDCheckMaterials(std::ostream&, std::vector > * = nullptr); +bool DDCheckMaterials(std::ostream&, std::vector > * = nullptr); #endif diff --git a/DetectorDescription/RegressionTest/src/DDCheckMaterials.cc b/DetectorDescription/RegressionTest/src/DDCheckMaterials.cc index 85e9cb9be9d65..8181d555bc7c2 100644 --- a/DetectorDescription/RegressionTest/src/DDCheckMaterials.cc +++ b/DetectorDescription/RegressionTest/src/DDCheckMaterials.cc @@ -13,110 +13,111 @@ namespace DDI { } // internal usage -bool DDCheckMaterial(DDMaterial& mip, std::pair & result, int rlevel = 0) +bool +DDCheckMaterial( DDMaterial& mip, std::pair< std::string, std::string > & result, int rlevel = 0 ) { - std::string no_composites = " NO-COMPOSITES "; - std::string no_density = " NO-DENSITY "; - std::string costit_nok = " CONSTITUENT NOK "; - std::string no_z = " NO-Z "; - std::string no_a = " NO-A "; + std::string no_composites = " NO-COMPOSITES "; + std::string no_density = " NO-DENSITY "; + std::string costit_nok = " CONSTITUENT NOK "; + std::string no_z = " NO-Z "; + std::string no_a = " NO-A "; + + std::string curr_err = ""; + bool err = false; - std::string curr_err = ""; - bool err = false; - - if (mip.isDefined().first == nullptr) { - err=true; - curr_err += "material not declared; unknown material!"; - //edm::LogError("DDCheckMaterials") << "material not declared!" << std::endl; //exit(1); - result.first = curr_err; - return err; - } - - if (mip.isDefined().second == 0) { - err=true; - curr_err += "material name=" + mip.name().ns() + ":" + mip.name().name() - + " is declared but not defined"; - result.first = curr_err; - return err; - } - - DDMaterial & mp = mip; - result.second=mp.ddname(); - - if (!mp.density()) { - err=true; - curr_err += no_density; - } - - if ( ( !mp.z() || !mp.a() ) && !mp.noOfConstituents() ) { - err=true; - curr_err += no_z; - curr_err += "or"; - curr_err += no_a; - } - - if ( ( !mp.z() && !mp.a() ) && !mp.noOfConstituents() ) { - err=true; - curr_err += no_composites; - } - - if ( !mp.z() && !mp.a() && !mp.density() && !mp.noOfConstituents() ){ - err=true; - curr_err = " NOT-DEFINED "; - } - - if (err) { - result.first=curr_err; - } - - // recursive checking of constituents - // the composite material is not ok if only one constituent is not ok - int loop = mp.noOfConstituents() - 1; - - for (; loop>=0; --loop) { - std::pair res("",""); - DDMaterial mat(mp.ddname()); // bit slow but comfortable ... - DDMaterial mimpl = mat.constituent(loop).first; - ++rlevel; // recursion level - bool c_err = DDCheckMaterial(mimpl,res, rlevel); - if (c_err) { - err = err | c_err; - curr_err = curr_err + std::string(" constituents have errors:\n") + std::string(4*rlevel,' ') - + std::string(" ") + res.first; - result.first=curr_err; - } - --rlevel; - } - - return err; + if (mip.isDefined().first == nullptr) { + err=true; + curr_err += "material not declared; unknown material!"; + //edm::LogError("DDCheckMaterials") << "material not declared!" << std::endl; //exit(1); + result.first = curr_err; + return err; + } + + if (mip.isDefined().second == 0) { + err=true; + curr_err += "material name=" + mip.name().ns() + ":" + mip.name().name() + + " is declared but not defined"; + result.first = curr_err; + return err; + } + + DDMaterial & mp = mip; + result.second=mp.ddname().fullname(); + + if (!mp.density()) { + err=true; + curr_err += no_density; + } + + if ( ( !mp.z() || !mp.a() ) && !mp.noOfConstituents() ) { + err=true; + curr_err += no_z; + curr_err += "or"; + curr_err += no_a; + } + + if ( ( !mp.z() && !mp.a() ) && !mp.noOfConstituents() ) { + err=true; + curr_err += no_composites; + } + + if ( !mp.z() && !mp.a() && !mp.density() && !mp.noOfConstituents() ){ + err=true; + curr_err = " NOT-DEFINED "; + } + + if (err) { + result.first=curr_err; + } + + // recursive checking of constituents + // the composite material is not ok if only one constituent is not ok + int loop = mp.noOfConstituents() - 1; + + for (; loop>=0; --loop) { + std::pair< std::string, std::string > res("",""); + DDMaterial mat( mp.ddname()); // bit slow but comfortable ... + DDMaterial mimpl = mat.constituent(loop).first; + ++rlevel; // recursion level + bool c_err = DDCheckMaterial(mimpl,res, rlevel); + if (c_err) { + err = err | c_err; + curr_err = curr_err + std::string(" constituents have errors:\n") + std::string(4*rlevel,' ') + + std::string(" ") + res.first; + result.first=curr_err; + } + --rlevel; + } + + return err; } - //! Checks all registered materials and sends a report /p os -bool DDCheckMaterials(std::ostream & os, std::vector > * res) +bool +DDCheckMaterials( std::ostream & os, std::vector< std::pair< std::string, std::string >> * res ) { - bool result = false; - std::vector > errors; - - auto& mr = DDBase>::StoreT::instance(); - - for( const auto& i : mr ) { - std::pair error("",""); - DDMaterial tmat(i.first); - - if (DDCheckMaterial(tmat,error)) { - errors.emplace_back(error); - } - } - - std::string s(" "); - os << "[DDCore:Report] Materials " << std::endl; - os << s << mr.size() << " Materials declared" << std::endl; - os << s << "detected errors:" << errors.size() << std::endl; - for( auto j : errors ) { - os << std::endl << s << j.second << " " << j.first << std::endl; - result = true; - } - if(res) *res = errors; - return result; + bool result = false; + std::vector< std::pair< std::string, std::string > > errors; + + auto& mr = DDBase>::StoreT::instance(); + + for( const auto& i : mr ) { + std::pair error("",""); + DDMaterial tmat(i.first); + + if (DDCheckMaterial(tmat,error)) { + errors.emplace_back(error); + } + } + + std::string s(" "); + os << "[DDCore:Report] Materials " << std::endl; + os << s << mr.size() << " Materials declared" << std::endl; + os << s << "detected errors:" << errors.size() << std::endl; + for( auto j : errors ) { + os << std::endl << s << j.second << " " << j.first << std::endl; + result = true; + } + if(res) *res = errors; + return result; } diff --git a/DetectorDescription/RegressionTest/src/DDErrorDetection.cc b/DetectorDescription/RegressionTest/src/DDErrorDetection.cc index 84c78f354c489..c6ef1648c31b4 100644 --- a/DetectorDescription/RegressionTest/src/DDErrorDetection.cc +++ b/DetectorDescription/RegressionTest/src/DDErrorDetection.cc @@ -153,19 +153,17 @@ const std::map > & DDErrorDetection::ma_lp() static std::map > result_; if (!result_.empty()) return result_; - const std::vector > & err_mat = ma(); - std::vector >::const_iterator it(err_mat.begin()), ed(err_mat.end()); + const std::vector > & err_mat = ma(); + std::vector >::const_iterator it(err_mat.begin()), ed(err_mat.end()); for (; it != ed; ++it) { std::set s; DDMaterial m(it->second); result_[m]=s; - //std::cout << "insert: " << m.name() << std::endl; } DDLogicalPart::iterator lpit,lped; lped.end(); for (; lpit != lped; ++lpit) { if (lpit->isDefined().second) { std::map >::iterator i = result_.find(lpit->material()); - //std::cout << "searching: " << lpit->name() << std::endl; if ( i != result_.end() ) { //std::cout << std::endl << "FOUND: " << lpit->name() << std::endl << std::endl; i->second.insert(*lpit); @@ -176,9 +174,9 @@ const std::map > & DDErrorDetection::ma_lp() } -const std::vector > & DDErrorDetection::ma() +const std::vector > & DDErrorDetection::ma() { - static std::vector > result_; + static std::vector > result_; ofstream o("/dev/null"); if (!result_.empty()) return result_; @@ -258,8 +256,8 @@ void DDErrorDetection::report(const DDCompactView& cpv, ostream & o) o << lp_cpv(cpv) << std::endl; o << "B) Detailed report on Materials:" << std::endl; - const std::vector > & res = ma(); - std::vector >::const_iterator it(res.begin()), ed(res.end()); + const std::vector> & res = ma(); + std::vector>::const_iterator it(res.begin()), ed(res.end()); for (; it != ed; ++it) { std::cout << it->second << ": " << it->first << std::endl; } diff --git a/DetectorDescription/RegressionTest/test/tutorial.cc b/DetectorDescription/RegressionTest/test/tutorial.cc index b0c47b5692234..2e91e6e153b8d 100644 --- a/DetectorDescription/RegressionTest/test/tutorial.cc +++ b/DetectorDescription/RegressionTest/test/tutorial.cc @@ -19,7 +19,6 @@ #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDName.h" #include "DetectorDescription/Core/interface/DDNodes.h" -#include "DetectorDescription/Core/interface/DDNumberingScheme.h" #include "DetectorDescription/Core/interface/DDPartSelection.h" #include "DetectorDescription/Core/interface/DDPosData.h" #include "DetectorDescription/Core/interface/DDScope.h" @@ -388,7 +387,6 @@ void tutorial() std::cout << "creating the default numbering scheme ..." << std::endl; DDExpandedView eeeee(aaaaa); - DDDefaultNumberingScheme nums(eeeee); std::cout << "do sibling-stack navigation?"; std::cin >> ans; @@ -411,7 +409,6 @@ void tutorial() std::cout << "input=" << n << std::endl; if (e.goTo(n)) { std::cout << "node=" << e.geoHistory() << std::endl; - std::cout << " id=" << nums.id(e) << std::endl; } else { std::cout << "no match!" << std::endl; @@ -431,12 +428,6 @@ void tutorial() int s; std::cin >> s; go = (bool)s; - if (nums.node(s,e)) { - std::cout << "node=" << e.geoHistory() << std::endl; - } - else { - std::cout << "no match!" << std::endl; - } } } } diff --git a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc index af91da580239a..7c3bf8451d72a 100644 --- a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc +++ b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc @@ -53,7 +53,6 @@ void HGCalGeomParameters::loadGeometryHexagon(const DDFilteredView& _fv, while (dodet) { const DDSolid & sol = fv.logicalPart().solid(); - std::string name = sol.name(); // Layers first std::vector copy = fv.copyNumbers(); int nsiz = (int)(copy.size()); @@ -123,7 +122,7 @@ void HGCalGeomParameters::loadGeometryHexagon(const DDFilteredView& _fv, std::unordered_set names; while (dodet) { const DDSolid & sol = fv1.logicalPart().solid(); - std::string name = fv1.logicalPart().name(); + const std::string & name = fv1.logicalPart().name().name(); std::vector copy = fv1.copyNumbers(); int nsiz = (int)(copy.size()); int wafer = (nsiz > 0) ? copy[nsiz-1] : 0; @@ -198,7 +197,7 @@ void HGCalGeomParameters::loadGeometryHexagon(const DDFilteredView& _fv, dodet = true; while (dodet) { const DDSolid & sol = fv2.logicalPart().solid(); - std::string name = sol.name(); + const std::string & name = sol.name().name(); std::vector copy = fv2.copyNumbers(); int nsiz = (int)(copy.size()); int cellx= (nsiz > 0) ? copy[nsiz-1] : 0; @@ -483,7 +482,6 @@ void HGCalGeomParameters::loadGeometryHexagon8(const DDFilteredView& _fv, int levelTop = 3+std::max(php.levelT_[0],php.levelT_[1]); while (dodet) { const DDSolid & sol = fv.logicalPart().solid(); - std::string name = sol.name(); // Layers first std::vector copy = fv.copyNumbers(); int nsiz = (int)(copy.size()); diff --git a/Geometry/HGCalCommonData/test/HGCGeometryTester.cc b/Geometry/HGCalCommonData/test/HGCGeometryTester.cc index a79bed01bb402..7e2d678658c39 100644 --- a/Geometry/HGCalCommonData/test/HGCGeometryTester.cc +++ b/Geometry/HGCalCommonData/test/HGCGeometryTester.cc @@ -70,7 +70,7 @@ void HGCGeometryTester::analyze( const edm::Event& iEvent, std::map > svPars; do { const DDLogicalPart &logPart=eview.logicalPart(); - std::string name=logPart.name(); + const std::string & name=logPart.name().fullname(); //only EE sensitive volumes for the moment if ((name.find("HGCal") != std::string::npos) && diff --git a/Geometry/HcalTestBeamData/plugins/DDEcalPreshowerAlgoTB.cc b/Geometry/HcalTestBeamData/plugins/DDEcalPreshowerAlgoTB.cc index 1193265fcf291..775bcd7358944 100644 --- a/Geometry/HcalTestBeamData/plugins/DDEcalPreshowerAlgoTB.cc +++ b/Geometry/HcalTestBeamData/plugins/DDEcalPreshowerAlgoTB.cc @@ -153,12 +153,10 @@ void DDEcalPreshowerAlgoTB::doWedges(DDCompactView& cpv) { int sz = int(quadMax_.size()); DDTranslation tran; - DDRotation rot1, rot2; - DDName name1, name2; - name1 = DDName("SWED", idNameSpace); - name2 = DDName("SFBX", idNameSpace); - rot1 = DDRotation("rotations:RM1299"); - rot2 = DDRotation("rotations:RM1298"); + DDName name1("SWED", idNameSpace); + DDName name2("SFBX", idNameSpace); + DDRotation rot1("rotations:RM1299"); + DDRotation rot2("rotations:RM1298"); // Do Plane X for(int I=1; I<=sz;++I) { for(int J=int(quadMax_[I-1]); J>=int(quadMin_[I-1]); --J) { diff --git a/Geometry/MTCCTrackerCommonData/plugins/DDTIBLayerAlgo_MTCC.cc b/Geometry/MTCCTrackerCommonData/plugins/DDTIBLayerAlgo_MTCC.cc index 6884fe7c9f615..fc4b501697ecc 100644 --- a/Geometry/MTCCTrackerCommonData/plugins/DDTIBLayerAlgo_MTCC.cc +++ b/Geometry/MTCCTrackerCommonData/plugins/DDTIBLayerAlgo_MTCC.cc @@ -190,8 +190,7 @@ void DDTIBLayerAlgo_MTCC::execute(DDCompactView& cpv) { << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg << " with Rin " << rmin << " Rout " << rmax << " ZHalf " << 0.5*layerL; - DDName matname(DDSplit(genMat).first, DDSplit(genMat).second); - DDMaterial matter(matname); + DDMaterial matter( DDName( DDSplit(genMat).first, DDSplit(genMat).second )); DDLogicalPart layer(solid.ddname(), matter, solid); //Lower part first @@ -387,10 +386,9 @@ void DDTIBLayerAlgo_MTCC::execute(DDCompactView& cpv) { << cylinderMat << " from " << phiMin/CLHEP::deg << " to " << (phiMin+phidiff)/CLHEP::deg << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.25*layerL; - matname = DDName(DDSplit(cylinderMat).first, DDSplit(cylinderMat).second); - DDMaterial matcyl(matname); + DDMaterial matcyl( DDName( DDSplit(cylinderMat).first, DDSplit(cylinderMat).second )); DDLogicalPart cylinder(solid.ddname(), matcyl, solid); - cpv.position(cylinder, layer, 1, DDTranslation(0.0,0.0,0.25*layerL), DDRotation()); + cpv.position(cylinder, layer, 1, DDTranslation(0.0,0.0,0.25*layerL), DDRotation()); LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << cylinder.name() << " number 1 positioned in " << layer.name() << " at (0,0," << 0.25*layerL << ") with no rotation"; @@ -406,7 +404,7 @@ void DDTIBLayerAlgo_MTCC::execute(DDCompactView& cpv) { << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5*layerL; DDLogicalPart cylinderIn(solid.ddname(), matter, solid); - cpv.position(cylinderIn, cylinder, 1, DDTranslation(0.0, 0.0, -0.25*layerL), DDRotation()); + cpv.position(cylinderIn, cylinder, 1, DDTranslation(0.0, 0.0, -0.25*layerL), DDRotation()); LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << cylinderIn.name() << " number 1 positioned in " << cylinder.name() << " at (0,0," << -0.25*layerL << ") with no rotation"; @@ -418,15 +416,13 @@ void DDTIBLayerAlgo_MTCC::execute(DDCompactView& cpv) { << genMat << " from " << phiMin/CLHEP::deg << " to " << (phiMin+phidiff)/CLHEP::deg << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5*supportW; - matname = DDName(DDSplit(supportMat).first, DDSplit(supportMat).second); - DDMaterial matsup(matname); + DDMaterial matsup( DDName( DDSplit(supportMat).first, DDSplit(supportMat).second )); DDLogicalPart cylinderSup(solid.ddname(), matsup, solid); - cpv.position(cylinderSup, cylinderIn, 1, DDTranslation(0., 0., 0.), DDRotation()); + cpv.position(cylinderSup, cylinderIn, 1, DDTranslation(0., 0., 0.), DDRotation()); LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << cylinderSup.name() << " number 1 positioned in " << cylinderIn.name() << " at (0,0,0) with no rotation"; - matname = DDName(DDSplit(ribMat).first, DDSplit(ribMat).second); - DDMaterial matrib(matname); + DDMaterial matrib( DDName( DDSplit(ribMat).first, DDSplit(ribMat).second )); for (unsigned int i = 0; i < ribW.size(); i++) { name = idName + "Rib" + std::to_string(i); double width = 2.*ribW[i]/(rin+rout); diff --git a/Geometry/MTDCommonData/test/TestMTDNumbering.cc b/Geometry/MTDCommonData/test/TestMTDNumbering.cc index 7427f0ebf0a98..6c319e3902c1c 100644 --- a/Geometry/MTDCommonData/test/TestMTDNumbering.cc +++ b/Geometry/MTDCommonData/test/TestMTDNumbering.cc @@ -186,7 +186,7 @@ void TestMTDNumbering::theBaseNumber( const DDGeoHistory& gh ) { thisN_.setSize( gh.size() ); for ( uint i = gh.size(); i-- > 0; ) { - std::string name(gh[i].logicalPart().name()); + std::string name(gh[i].logicalPart().name().fullname()); int copyN(gh[i].copyno()); thisN_.addLevel( name, copyN ); #ifdef EDM_ML_DEBUG diff --git a/Geometry/TrackerCommonData/plugins/DDCutTubsFromPoints.cc b/Geometry/TrackerCommonData/plugins/DDCutTubsFromPoints.cc index acf2e649e5206..3bd13e67ca0ed 100644 --- a/Geometry/TrackerCommonData/plugins/DDCutTubsFromPoints.cc +++ b/Geometry/TrackerCommonData/plugins/DDCutTubsFromPoints.cc @@ -22,10 +22,10 @@ DDCutTubsFromPoints::DDCutTubsFromPoints() { DDCutTubsFromPoints::~DDCutTubsFromPoints() {} void DDCutTubsFromPoints::initialize(const DDNumericArguments & nArgs, - const DDVectorArguments & vArgs, - const DDMapArguments & , - const DDStringArguments & sArgs, - const DDStringVectorArguments &) { + const DDVectorArguments & vArgs, + const DDMapArguments & , + const DDStringArguments & sArgs, + const DDStringVectorArguments &) { r_min = nArgs["rMin"]; r_max = nArgs["rMax"]; diff --git a/Geometry/TrackerCommonData/plugins/DDPixBarLayerUpgradeAlgo.cc b/Geometry/TrackerCommonData/plugins/DDPixBarLayerUpgradeAlgo.cc index d830c4e2bb9c5..2291a57b3cd8d 100644 --- a/Geometry/TrackerCommonData/plugins/DDPixBarLayerUpgradeAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/DDPixBarLayerUpgradeAlgo.cc @@ -72,7 +72,7 @@ void DDPixBarLayerUpgradeAlgo::initialize(const DDNumericArguments & nArgs, void DDPixBarLayerUpgradeAlgo::execute(DDCompactView& cpv) { DDName mother = parent().name(); - std::string idName = DDSplit(mother).first; + const std::string & idName = mother.name(); double dphi = CLHEP::twopi/number; double x2 = coolDist*sin(0.5*dphi); diff --git a/Geometry/TrackerCommonData/plugins/DDPixFwdBlades.cc b/Geometry/TrackerCommonData/plugins/DDPixFwdBlades.cc index aa3cd7dae0901..e515d71d8ef0e 100644 --- a/Geometry/TrackerCommonData/plugins/DDPixFwdBlades.cc +++ b/Geometry/TrackerCommonData/plugins/DDPixFwdBlades.cc @@ -185,7 +185,7 @@ void DDPixFwdBlades::execute(DDCompactView& cpv) { // create DDRotation for placing the child if not already existent : DDRotation rotation; - std::string rotstr = DDSplit(mother).first + DDSplit(childName).first + std::to_string(copy); + std::string rotstr = mother.name() + DDSplit(childName).first + std::to_string(copy); rotation = DDRotation(DDName(rotstr, idNameSpace)); if (!rotation) { diff --git a/Geometry/TrackerCommonData/plugins/DDTIDAxialCableAlgo.cc b/Geometry/TrackerCommonData/plugins/DDTIDAxialCableAlgo.cc index e07c06d1062b3..64edb760e112e 100644 --- a/Geometry/TrackerCommonData/plugins/DDTIDAxialCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/DDTIDAxialCableAlgo.cc @@ -164,8 +164,7 @@ void DDTIDAxialCableAlgo::execute(DDCompactView& cpv) { << "\tRmin = "<< pconRmin[i] << "\tRmax = " << pconRmax[i]; - DDName mat(DDSplit(matIn).first, DDSplit(matIn).second); - DDMaterial matter(mat); + DDMaterial matter(DDName(DDSplit(matIn).first, DDSplit(matIn).second)); DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid); logs.emplace_back(DDName(name, idNameSpace)); @@ -179,8 +178,7 @@ void DDTIDAxialCableAlgo::execute(DDCompactView& cpv) { << matOut << " from " << -0.5*width/CLHEP::deg << " to " << 0.5*width/CLHEP::deg << " with Rin " << r << " Rout " << rTop << " ZHalf " << 0.5*(zEnd-zBend); - mat = DDName(DDSplit(matOut).first, DDSplit(matOut).second); - matter = DDMaterial(mat); + matter = DDMaterial(DDName(DDSplit(matOut).first, DDSplit(matOut).second)); genlogic = DDLogicalPart(DDName(name, idNameSpace), matter, solid); logs.emplace_back(DDName(name, idNameSpace)); diff --git a/Geometry/TrackerCommonData/plugins/DDTIDModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/DDTIDModuleAlgo.cc index 123aa4ee91d42..98014b276d1bf 100644 --- a/Geometry/TrackerCommonData/plugins/DDTIDModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/DDTIDModuleAlgo.cc @@ -31,7 +31,7 @@ void DDTIDModuleAlgo::initialize(const DDNumericArguments & nArgs, int i; genMat = sArgs["GeneralMaterial"]; detectorN = (int)(nArgs["DetectorNumber"]); - DDName parentName = parent().name(); + DDName parentName(parent().name()); LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: Parent " << parentName << " General Material " << genMat @@ -158,8 +158,7 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { LogDebug("TIDGeom") << "==>> Constructing DDTIDModuleAlgo..."; - DDName parentName = parent().name(); - DDName name; + DDName parentName(parent().name()); double sidfr = sideFrameWidth - sideFrameOver; // width of side frame on the sides of module double botfr; // width of side frame at the the bottom of the modules @@ -202,8 +201,7 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { DDSolid solidUncut, solidCut; DDSolid solid = DDSolidFactory::trap(parentName, dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - DDName matname = DDName(DDSplit(genMat).first, DDSplit(genMat).second); - DDMaterial matter = DDMaterial(matname); + DDMaterial matter = DDMaterial(DDName(DDSplit(genMat).first, DDSplit(genMat).second)); DDLogicalPart module(solid.ddname(), matter, solid); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << genMat << " of dimensions " << dz @@ -214,42 +212,39 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { if (doComponents) { //Box frame - name = DDName(DDSplit(boxFrameName).first,DDSplit(boxFrameName).second); - matname = DDName(DDSplit(boxFrameMat).first, DDSplit(boxFrameMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(boxFrameMat).first, DDSplit(boxFrameMat).second)); double dx = 0.5 * boxFrameWidth; double dy = 0.5 * boxFrameThick; double dz = 0.5 * boxFrameHeight; - solid = DDSolidFactory::box(name, dx, dy, dz); + solid = DDSolidFactory::box(DDName(DDSplit( boxFrameName ).first, DDSplit( boxFrameName ).second ), + dx, dy, dz); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Box made of " << matname << " of dimensions " + << " Box made of " << matter.ddname() << " of dimensions " << dx << ", " << dy << ", " << dz; DDLogicalPart boxFrame(solid.ddname(), matter, solid); // Hybrid - name = DDName(DDSplit(hybridName).first, DDSplit(hybridName).second); - matname = DDName(DDSplit(hybridMat).first, DDSplit(hybridMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(hybridMat).first, DDSplit(hybridMat).second)); dx = 0.5 * hybridWidth; dy = 0.5 * hybridThick; dz = 0.5 * hybridHeight; - solid = DDSolidFactory::box(name, dx, dy, dz); + solid = DDSolidFactory::box( DDName(DDSplit(hybridName).first, DDSplit(hybridName).second), + dx, dy, dz); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Box made of " << matname << " of dimensions " + << " Box made of " << matter.ddname() << " of dimensions " << dx << ", " << dy << ", " << dz; DDLogicalPart hybrid(solid.ddname(), matter, solid); // Cool Insert - name = DDName(DDSplit(coolName).first, DDSplit(coolName).second); - matname = DDName(DDSplit(coolMat).first, DDSplit(coolMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second)); dx = 0.5 * coolWidth; dy = 0.5 * coolThick; dz = 0.5 * coolHeight; - solid = DDSolidFactory::box(name, dx, dy, dz); + solid = DDSolidFactory::box(DDName(DDSplit(coolName).first, DDSplit(coolName).second), + dx, dy, dz); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Box made of " << matname << " of dimensions " + << " Box made of " << matter.ddname() << " of dimensions " << dx << ", " << dy << ", " << dz; DDLogicalPart cool(solid.ddname(), matter, solid); @@ -259,11 +254,8 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { double bbl1, bbl2; // perhaps useless (bl1 enough) // Frame Sides - name = DDName(DDSplit(sideFrameName[k]).first, - DDSplit(sideFrameName[k]).second); - matname = DDName(DDSplit(sideFrameMat).first, - DDSplit(sideFrameMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(sideFrameMat).first, + DDSplit(sideFrameMat).second)); if (dlHybrid > dlTop) { // ring 1, ring 2 bbl1 = dxtop - (dxtop-dxbot)*(fullHeight+botfr)/fullHeight; @@ -275,10 +267,12 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { } h1 = 0.5 * sideFrameThick; dz = 0.5 * sideFrameHeight; - solid = DDSolidFactory::trap(name, dz, 0, 0, h1, bbl1, bbl1, 0, + solid = DDSolidFactory::trap(DDName(DDSplit(sideFrameName[k]).first, + DDSplit(sideFrameName[k]).second), + dz, 0, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Trap made of " << matname << " of dimensions " + << " Trap made of " << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; @@ -288,10 +282,7 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { DDRotation rot; // Hole in the frame below the wafer - name = DDName(DDSplit(holeFrameName[k]).first, - DDSplit(holeFrameName[k]).second); - matname = DDName(DDSplit(genMat).first, DDSplit(genMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(genMat).first, DDSplit(genMat).second)); double xpos, zpos; dz = fullHeight - bottomFrameOver - topFrameOver; bbl1 = dxbot - sideFrameWidth + bottomFrameOver*(dxtop-dxbot)/fullHeight; @@ -304,10 +295,12 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { zpos = bottomFrameHeight+0.5*dz-0.5*sideFrameHeight; } dz /= 2.; - solid = DDSolidFactory::trap(name, dz, 0,0, h1,bbl1,bbl1, 0, + solid = DDSolidFactory::trap(DDName(DDSplit(holeFrameName[k]).first, + DDSplit(holeFrameName[k]).second), + dz, 0,0, h1,bbl1,bbl1, 0, h1,bbl2,bbl2, 0); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Trap made of " << matname << " of dimensions " + << " Trap made of " << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; @@ -320,15 +313,13 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { } else { rot = DDRotation(); } - cpv.position(holeFrame, sideFrame, 1, DDTranslation(0.0, 0.0, zpos), rot ); + cpv.position(holeFrame, sideFrame, 1, DDTranslation(0.0, 0.0, zpos), rot ); LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << holeFrame.name() << " number 1 positioned in " << sideFrame.name() << " at (0,0," << zpos << ") with no rotation"; // Kapton circuit - // name = DDName(DDSplit(kaptonName[k]).first,DDSplit(kaptonName[k]).second); - matname = DDName(DDSplit(kaptonMat).first,DDSplit(kaptonMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(kaptonMat).first,DDSplit(kaptonMat).second)); double kaptonExtraHeight=0; // kapton extra height in the stereo if (dlHybrid > dlTop) { // ring 1, ring 2 @@ -359,15 +350,13 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { if ( k == 1 ) { // Uncut solid std::string kaptonUncutName=kaptonName[k]+"Uncut"; - name = DDName(DDSplit(kaptonUncutName).first, - DDSplit(kaptonUncutName).second); - solidUncut = DDSolidFactory::trap(name, dz, 0, 0, h1, bbl1, bbl1, 0, + solidUncut = DDSolidFactory::trap(DDName(DDSplit(kaptonUncutName).first, + DDSplit(kaptonUncutName).second), + dz, 0, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0); // Piece to be cut std::string kaptonCutName=kaptonName[k]+"Cut"; - name = DDName(DDSplit(kaptonCutName).first, - DDSplit(kaptonCutName).second); if (dlHybrid > dlTop) { dz = 0.5 * dlTop; @@ -378,7 +367,9 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { bbl1 = fabs(dz*sin(detTilt)); bbl2 = bbl1*0.000001; double thet = atan((bbl1-bbl2)/(2*dz)); - solidCut = DDSolidFactory::trap(name, dz, thet, 0, h1, bbl1, bbl1, 0, + solidCut = DDSolidFactory::trap(DDName(DDSplit(kaptonCutName).first, + DDSplit(kaptonCutName).second), + dz, thet, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0); std::string aRot("tidmodpar:9PYX"); @@ -390,30 +381,27 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { zpos = 0.5 * kaptonHeight - bbl2; // Subtraction Solid - name = DDName(DDSplit(kaptonName[k]).first, - DDSplit(kaptonName[k]).second); - solid = DDSolidFactory::subtraction(name, solidUncut, solidCut, + solid = DDSolidFactory::subtraction(DDName(DDSplit(kaptonName[k]).first, + DDSplit(kaptonName[k]).second), + solidUncut, solidCut, DDTranslation(xpos,0.0,zpos),rot); } else { - name = DDName(DDSplit(kaptonName[k]).first, - DDSplit(kaptonName[k]).second); - solid = DDSolidFactory::trap(name, dz, 0, 0, h1, bbl1, bbl1, 0, + solid = DDSolidFactory::trap(DDName(DDSplit(kaptonName[k]).first, + DDSplit(kaptonName[k]).second), + dz, 0, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0); } DDLogicalPart kapton(solid.ddname(), matter, solid); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " SUBTRACTION SOLID Trap made of " << matname + << " SUBTRACTION SOLID Trap made of " << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; // Hole in the kapton below the wafer - name = DDName(DDSplit(holeKaptonName[k]).first, - DDSplit(holeKaptonName[k]).second); - matname = DDName(DDSplit(genMat).first, DDSplit(genMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(genMat).first, DDSplit(genMat).second)); dz = fullHeight - kaptonOver; xpos = 0; if (dlHybrid > dlTop) { @@ -432,10 +420,12 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { zpos = -0.5*(kaptonHeight-kaptonExtraHeight-dz); } dz /= 2.; - solid = DDSolidFactory::trap(name, dz, 0,0, h1,bbl1,bbl1, 0, + solid = DDSolidFactory::trap(DDName(DDSplit(holeKaptonName[k]).first, + DDSplit(holeKaptonName[k]).second), + dz, 0,0, h1,bbl1,bbl1, 0, h1,bbl2,bbl2, 0); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Trap made of " << matname << " of dimensions " + << " Trap made of " << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; @@ -448,7 +438,7 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { } else { rot = DDRotation(); } - cpv.position(holeKapton, kapton, 1, DDTranslation(xpos, 0.0, zpos), rot ); + cpv.position(holeKapton, kapton, 1, DDTranslation(xpos, 0.0, zpos), rot ); LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << holeKapton.name() << " number 1 positioned in " << kapton.name() << " at (0,0," << zpos << ") with no rotation"; @@ -456,10 +446,7 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { // Wafer - name = DDName(DDSplit(waferName[k]).first, - DDSplit(waferName[k]).second); - matname = DDName(DDSplit(waferMat).first, DDSplit(waferMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(waferMat).first, DDSplit(waferMat).second)); if (k == 0 && dlHybrid < dlTop) { bl1 = 0.5 * dlTop; bl2 = 0.5 * dlBottom; @@ -469,19 +456,18 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { } h1 = 0.5 * waferThick[k]; dz = 0.5 * fullHeight; - solid = DDSolidFactory::trap(name, dz, 0,0, h1,bl1,bl1,0, h1,bl2,bl2,0); + solid = DDSolidFactory::trap(DDName(DDSplit(waferName[k]).first, + DDSplit(waferName[k]).second), + dz, 0,0, h1,bl1,bl1,0, h1,bl2,bl2,0); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Trap made of " << matname << " of dimensions " + << " Trap made of " << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; DDLogicalPart wafer(solid.ddname(), matter, solid); // Active - name = DDName(DDSplit(activeName[k]).first, - DDSplit(activeName[k]).second); - matname = DDName(DDSplit(activeMat).first, DDSplit(activeMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(activeMat).first, DDSplit(activeMat).second)); if (k == 0 && dlHybrid < dlTop) { bl1 -= sideWidthTop; bl2 -= sideWidthBottom; @@ -492,9 +478,11 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { } dz = 0.5 * (waferThick[k] - backplaneThick[k]); // inactive backplane h1 = 0.5 * activeHeight; - solid = DDSolidFactory::trap(name, dz, 0,0, h1,bl2,bl1,0, h1,bl2,bl1,0); + solid = DDSolidFactory::trap(DDName(DDSplit(activeName[k]).first, + DDSplit(activeName[k]).second), + dz, 0,0, h1,bl2,bl1,0, h1,bl2,bl1,0); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Trap made of " << matname << " of dimensions " + << " Trap made of " << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0"; @@ -507,16 +495,13 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { rot = DDRotation(); } DDTranslation tran(0.0,-0.5 * backplaneThick[k],0.0); // from the definition of the wafer local axes - cpv.position(active, wafer, 1, tran, rot); // inactive backplane + cpv.position(active, wafer, 1, tran, rot); // inactive backplane LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << active.name() << " number 1 positioned in " << wafer.name() << " at " << tran << " with " << rot; //Pitch Adapter - name = DDName(DDSplit(pitchName[k]).first, - DDSplit(pitchName[k]).second); - matname = DDName(DDSplit(pitchMat).first, DDSplit(pitchMat).second); - matter = DDMaterial(matname); + matter = DDMaterial(DDName(DDSplit(pitchMat).first, DDSplit(pitchMat).second)); if (dlHybrid > dlTop) { dz = 0.5 * dlTop; } else { @@ -526,9 +511,11 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { dx = dz; dy = 0.5 * pitchThick; dz = 0.5 * pitchHeight; - solid = DDSolidFactory::box(name, dx, dy, dz); + solid = DDSolidFactory::box(DDName(DDSplit(pitchName[k]).first, + DDSplit(pitchName[k]).second), + dx, dy, dz); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Box made of " << matname << " of dimensions" + << " Box made of " << matter.ddname() << " of dimensions" << " " << dx << ", " << dy << ", " << dz; } else { h1 = 0.5 * pitchThick; @@ -540,10 +527,12 @@ void DDTIDModuleAlgo::execute(DDCompactView& cpv) { bl2-=pitchStereoTol; double thet = atan((bl1-bl2)/(2.*dz)); - solid = DDSolidFactory::trap(name, dz, thet, 0, h1, bl1, bl1, 0, + solid = DDSolidFactory::trap(DDName(DDSplit(pitchName[k]).first, + DDSplit(pitchName[k]).second), + dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() - << " Trap made of " << matname << " of " + << " Trap made of " << matter.ddname() << " of " << "dimensions " << dz << ", " << thet/CLHEP::deg << ", 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 diff --git a/Geometry/TrackerCommonData/plugins/DDTIDModulePosAlgo.cc b/Geometry/TrackerCommonData/plugins/DDTIDModulePosAlgo.cc index f44285b0948f5..ef79d16bdac25 100644 --- a/Geometry/TrackerCommonData/plugins/DDTIDModulePosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/DDTIDModulePosAlgo.cc @@ -130,7 +130,6 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { LogDebug("TIDGeom") << "==>> Constructing DDTIDModulePosAlgo..."; DDName parentName = parent().name(); - DDName name; double botfr; // width of side frame at the the bottom of the modules double topfr; // width of side frame at the the top of the modules @@ -175,7 +174,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { double xpos=0; double ypos=0; double zpos=0; // Cool Inserts - name = DDName(DDSplit(coolName).first, DDSplit(coolName).second); + DDName name = DDName(DDSplit(coolName).first, DDSplit(coolName).second); ypos = coolZ; double zCool; @@ -212,7 +211,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { if ( doSpacers ) { // Bottom Spacers (Alumina) - name = DDName(DDSplit(botSpacersName).first, DDSplit(botSpacersName).second); + DDName name = DDName(DDSplit(botSpacersName).first, DDSplit(botSpacersName).second); ypos = botSpacersZ; double zBotSpacers; @@ -223,7 +222,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { } zpos = zBotSpacers - zCenter; rot = DDRotation(); - cpv.position(name, parentName, 1, DDTranslation(0.0,ypos,zpos), rot ); + cpv.position(name, parentName, 1, DDTranslation(0.0,ypos,zpos), rot ); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << 1 << " positioned in " << parentName << " at " << DDTranslation(0.0,ypos,zpos) << " with no rotation"; @@ -264,7 +263,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { phix, thetay, phiy, thetaz, phiz); } - cpv.position(name, parentName, copy, DDTranslation(xpos,ypos,zpos), rot); + cpv.position(name, parentName, copy, DDTranslation(xpos,ypos,zpos), rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << copy << " positioned in " << parentName << " at " << DDTranslation(xpos,ypos,zpos) << " with " << rot; @@ -293,7 +292,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { rotns = DDSplit(waferRot[k]).second; rot = DDRotation(DDName(rotstr, rotns)); } - cpv.position(name, parentName, k+1, tran, rot); + cpv.position(name, parentName, k+1, tran, rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << k+1 << " positioned in " << parentName << " at " << tran << " with " << rot; @@ -321,7 +320,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { rot = DDRotation(); } tran = DDTranslation(xpos,ypos,zpos); - cpv.position(name, parentName, k+1, tran, rot); + cpv.position(name, parentName, k+1, tran, rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << k+1 << " positioned in " << parentName << " at " << tran << " with " << rot; @@ -338,7 +337,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { zpos = zHybrid - zCenter; tran = DDTranslation(0,ypos,zpos); rot = DDRotation(); - cpv.position(name, parentName, k+1, tran, rot); + cpv.position(name, parentName, k+1, tran, rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << k+1 << " positioned in " << parentName << " at " << tran << " with " << rot; @@ -356,7 +355,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { zpos = zBoxFrame - zCenter; tran = DDTranslation(0,ypos,zpos); rot = DDRotation(); - cpv.position(name, parentName, k+1, tran, rot); + cpv.position(name, parentName, k+1, tran, rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << k+1 << " positioned in " << parentName << " at " << tran << " with " << rot; @@ -380,7 +379,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { rot = DDRotation(); } tran = DDTranslation(0,ypos,zpos); - cpv.position(name, parentName, k+1, tran, rot); + cpv.position(name, parentName, k+1, tran, rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << k+1 << " positioned in " << parentName << " at " << tran << " with " << rot; @@ -409,7 +408,7 @@ void DDTIDModulePosAlgo::execute(DDCompactView& cpv) { rot = DDRotation(); } tran = DDTranslation(0,ypos,zpos); - cpv.position(name, parentName, k+1, tran, rot); + cpv.position(name, parentName, k+1, tran, rot); LogDebug("TIDGeom") << "DDTIDModulePosAlgo test: " << name <<" number " << k+1 << " positioned in " << parentName << " at " << tran << " with " << rot; diff --git a/Geometry/TrackerCommonData/plugins/DDTOBAxCableAlgo.cc b/Geometry/TrackerCommonData/plugins/DDTOBAxCableAlgo.cc index 09e1f1690ef39..2e54db5d2cd93 100644 --- a/Geometry/TrackerCommonData/plugins/DDTOBAxCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/DDTOBAxCableAlgo.cc @@ -31,8 +31,7 @@ void DDTOBAxCableAlgo::initialize(const DDNumericArguments & nArgs, const DDStringVectorArguments & vsArgs) { idNameSpace = DDCurrentNamespace::ns(); - DDName parentName = parent().name(); - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Parent " << parentName + LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Parent " << parent().name() << " NameSpace " << idNameSpace; sectorNumber = vsArgs["SectorNumber"]; @@ -73,7 +72,7 @@ void DDTOBAxCableAlgo::initialize(const DDNumericArguments & nArgs, void DDTOBAxCableAlgo::execute(DDCompactView& cpv) { LogDebug("TOBGeom") << "==>> Constructing DDTOBAxCableAlgo..."; - DDName tubsName = parent().name(); + DDName tubsName(parent().name()); // Loop over sectors (sectorNumber vector) for (int i=0; i<(int)(sectorNumber.size()); i++) { diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeometry.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeometry.cc index e8040ffc5505c..eaa91b7ebe835 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeometry.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeometry.cc @@ -250,7 +250,7 @@ TrackerGeometry::isThere(GeomDetEnumerators::SubDetector subdet) const { void TrackerGeometry::fillTestMap(const GeometricDet* gd) { - std::string temp = gd->name(); + const std::string temp = gd->name().fullname(); std::string name = temp.substr(temp.find(":")+1); DetId detid = gd->geographicalId(); float thickness = gd->bounds()->thickness(); diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase1EndcapBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase1EndcapBuilder.cc index a5cfa685788de..3c9f4739f5c72 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase1EndcapBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase1EndcapBuilder.cc @@ -18,7 +18,7 @@ CmsTrackerPixelPhase1EndcapBuilder::buildComponent( DDFilteredView& fv, Geometri CmsTrackerPhase1DiskBuilder theCmsTrackerPhase1DiskBuilder; GeometricDet * subdet = new GeometricDet( &fv, theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv ))); - std::string subdet_name = subdet->name(); + const std::string & subdet_name = subdet->name().name(); switch( theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv ))) { case GeometricDet::PixelPhase1Disk: diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2EndcapBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2EndcapBuilder.cc index 4066ad926bb3d..481e878599b33 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2EndcapBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPixelPhase2EndcapBuilder.cc @@ -22,7 +22,6 @@ CmsTrackerPixelPhase2EndcapBuilder::buildComponent( DDFilteredView& fv, Geometri CmsTrackerOTDiscBuilder theCmsTrackerOTDiscBuilder; GeometricDet * subdet = new GeometricDet( &fv, theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv ))); - std::string subdet_name = subdet->name(); switch( theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv ))) { case GeometricDet::PixelPhase2FullDisk: diff --git a/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h b/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h index 5bec39d227773..594178e84c157 100644 --- a/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h +++ b/Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h @@ -84,7 +84,7 @@ class DetGeomDesc DDTranslation translation() const {return _trans;} DDSolidShape shape() const {return _shape;} GeometricEnumType type() const {return _type;} - DDName name() const {return _ddname;}; + DDName name() const {return _name;}; nav_type navType() const {return _ddd;} std::vector params() const {return _params;} virtual int copyno() const {return _copy;} @@ -102,7 +102,7 @@ class DetGeomDesc DDTranslation _trans; DDRotationMatrix _rot; DDSolidShape _shape; - DDName _ddname; + std::string _name; GeometricEnumType _type; std::vector _params; DetId _geographicalID; diff --git a/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc b/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc index 6f4c520b7b133..ca652c5b25005 100644 --- a/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc +++ b/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc @@ -30,13 +30,13 @@ DetGeomDesc::DetGeomDesc(nav_type navtype, GeometricEnumType type) : _ddd(std::m _trans = ev.translation(); _rot = ev.rotation(); _shape = ((ev.logicalPart()).solid()).shape(); - _ddname = ((ev.logicalPart()).ddname()).name(); + _name = ((ev.logicalPart()).ddname()).name(); _parents = ev.geoHistory(); _volume = ((ev.logicalPart()).solid()).volume(); _density = ((ev.logicalPart()).material()).density(); _weight = _density * ( _volume / 1000.); // volume mm3->cm3 _copy = ev.copyno(); - _material = ((ev.logicalPart()).material()).name(); + _material = ((ev.logicalPart()).material()).name().fullname(); } //---------------------------------------------------------------------------------------------------- @@ -48,13 +48,13 @@ DetGeomDesc::DetGeomDesc(DDExpandedView* fv, GeometricEnumType type) : _type(typ _trans = fv->translation(); _rot = fv->rotation(); _shape = ((fv->logicalPart()).solid()).shape(); - _ddname = ((fv->logicalPart()).ddname()).name(); + _name = ((fv->logicalPart()).ddname()).name(); _parents = fv->geoHistory(); _volume = ((fv->logicalPart()).solid()).volume(); _density = ((fv->logicalPart()).material()).density(); _weight = _density * ( _volume / 1000.); // volume mm3->cm3 _copy = fv->copyno(); - _material = ((fv->logicalPart()).material()).name(); + _material = ((fv->logicalPart()).material()).name().fullname(); } //---------------------------------------------------------------------------------------------------- @@ -66,13 +66,13 @@ DetGeomDesc::DetGeomDesc(DDFilteredView* fv, GeometricEnumType type) : _type(typ _trans = fv->translation(); _rot = fv->rotation(); _shape = ((fv->logicalPart()).solid()).shape(); - _ddname = ((fv->logicalPart()).ddname()).name(); + _name = ((fv->logicalPart()).ddname()).name(); _parents = fv->geoHistory(); _volume = ((fv->logicalPart()).solid()).volume(); _density = ((fv->logicalPart()).material()).density(); _weight = _density * ( _volume / 1000.); // volume mm3->cm3 _copy = fv->copyno(); - _material = ((fv->logicalPart()).material()).name(); + _material = ((fv->logicalPart()).material()).name().fullname(); } //---------------------------------------------------------------------------------------------------- @@ -91,7 +91,7 @@ DetGeomDesc& DetGeomDesc::operator= (const DetGeomDesc &ref) _trans = ref._trans; _rot = ref._rot; _shape = ref._shape; - _ddname = ref._ddname; + _name = ref._name; _parents = ref._parents; _volume = ref._volume; _density = ref._density; diff --git a/Validation/HGCalValidation/plugins/HGCalSimHitValidation.cc b/Validation/HGCalValidation/plugins/HGCalSimHitValidation.cc index 4e5eda80fa2bb..019b2261876ff 100644 --- a/Validation/HGCalValidation/plugins/HGCalSimHitValidation.cc +++ b/Validation/HGCalValidation/plugins/HGCalSimHitValidation.cc @@ -404,7 +404,7 @@ bool HGCalSimHitValidation::defineGeometry(edm::ESTransientHandle while (dodet) { const DDSolid & sol = fv.logicalPart().solid(); - std::string name = sol.name(); + const std::string & name = sol.name().fullname(); int isd = (name.find(nameDetector_) == std::string::npos) ? -1 : 1; if (isd > 0) { std::vector copy = fv.copyNumbers();