Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DD Cleanup: Remove Access to Writable Graph #23201

Merged
merged 2 commits into from
May 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 5 additions & 11 deletions DetectorDescription/Core/interface/DDCompactView.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ class DDCompactView
// ---------------------------------------------------------------
// +++ DDCore INTERNAL USE ONLY ++++++++++++++++++++++++++++++++++

// to modify the structure! DDCore internal!
graph_type & writeableGraph();

void swap( DDCompactView& );

void lockdown();
Expand All @@ -155,14 +152,11 @@ class DDCompactView
std::unique_ptr<DDCompactViewImpl> rep_;
std::unique_ptr<DDPosData> worldpos_ ;

// 2010-01-27 memory patch
// for copying and protecting DD Store's after parsing is complete.
DDI::Store<DDName, DDI::Material*> matStore_;
DDI::Store<DDName, DDI::Solid*> solidStore_;
DDI::Store<DDName, DDI::LogicalPart*> lpStore_;
DDI::Store<DDName, DDI::Specific*> specStore_;
DDI::Store<DDName, DDRotationMatrix*> rotStore_;

DDI::Store<DDName, DDI::Material*> matStore_;
DDI::Store<DDName, DDI::Solid*> solidStore_;
DDI::Store<DDName, DDI::LogicalPart*> lpStore_;
DDI::Store<DDName, DDI::Specific*> specStore_;
DDI::Store<DDName, DDRotationMatrix*> rotStore_;
};

//! global type for a compact-view walker
Expand Down
5 changes: 0 additions & 5 deletions DetectorDescription/Core/src/DDCompactView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ const DDCompactView::graph_type & DDCompactView::graph() const
return rep_->graph();
}

DDCompactView::graph_type & DDCompactView::writeableGraph()
{
return const_cast<graph_type&>(rep_->graph());
}

const DDLogicalPart & DDCompactView::root() const
{
return rep_->root();
Expand Down
5 changes: 0 additions & 5 deletions DetectorDescription/Parser/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="boost_system"/>
</bin>
<bin file="TestIntegration.cpp" name="DetectorDescriptionParserTE">
<flags TEST_RUNNER_ARGS=" /bin/bash DetectorDescription/Parser/test run_testDoc.sh" />
Expand All @@ -24,7 +23,6 @@
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="Utilities/Xerces"/>
<use name="boost_system"/>
</bin>

<bin name="testmat" file="testmat.cpp">
Expand All @@ -35,7 +33,6 @@
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="boost_system"/>
</bin>
<bin name="dumpDDCompactView" file="dumpDDCompactView.cpp">
<use name="DetectorDescription/Core"/>
Expand All @@ -47,7 +44,6 @@
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="boost_system"/>
</bin>
<bin name="testNew" file="testNew.cpp">
<use name="DetectorDescription/Core"/>
Expand All @@ -62,5 +58,4 @@
<use name="FWCore/PythonParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="boost_system"/>
</bin>
44 changes: 4 additions & 40 deletions DetectorDescription/Parser/test/dumpDDCompactView.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/***************************************************************************
main.cpp - description
-------------------
begin : Wed Oct 24 17:36:15 PDT 2001
author : 2001 Michael Case
email : case@ucdhep.ucdavis.edu
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include <exception>
#include <fstream>
#include <memory>
Expand All @@ -37,7 +20,6 @@
#include "FWCore/ServiceRegistry/interface/ServiceToken.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/Presence.h"
#include "boost/smart_ptr/shared_ptr.hpp"

int main(int argc, char *argv[])
{
Expand All @@ -56,9 +38,9 @@ int main(int argc, char *argv[])
// In particular, the job hangs as soon as the output buffer fills up.
// That's because, without the message service, there is no mechanism for
// emptying the buffers.
boost::shared_ptr<edm::Presence> theMessageServicePresence;
theMessageServicePresence = boost::shared_ptr<edm::Presence>(edm::PresenceFactory::get()->
makePresence("MessageServicePresence").release());
std::shared_ptr<edm::Presence> theMessageServicePresence;
theMessageServicePresence = std::shared_ptr<edm::Presence>(edm::PresenceFactory::get()->
makePresence("MessageServicePresence").release());

// C. Manufacture a configuration and establish it.
std::string config =
Expand Down Expand Up @@ -109,7 +91,7 @@ int main(int argc, char *argv[])

// cpv.setRoot(DDLogicalPart(DDName("cms:World")));

std::cout << "edge size of produce graph:" << cpv.writeableGraph().edge_size() << std::endl;
std::cout << "edge size of produce graph:" << cpv.graph().edge_size() << std::endl;
const DDCompactView::graph_type& gt = cpv.graph();
adjl_iterator git = gt.begin();
adjl_iterator gend = gt.end();
Expand All @@ -127,24 +109,6 @@ int main(int argc, char *argv[])
}
}
}

cpv.writeableGraph().clear();
// cpv.clear();
std::cout << "cleared DDCompactView. " << std::endl;


// DDExpandedView ev(cpv);
// std::cout << "== got the epv ==" << std::endl;

// while ( ev.next() ) {
// if ( ev.logicalPart().name().name() == "MBAT" ) {
// std::cout << ev.geoHistory() << std::endl;
// }
// if ( ev.logicalPart().name().name() == "MUON" ) {
// std::cout << ev.geoHistory() << std::endl;
// }
// }

}
// Deal with any exceptions that may have been thrown.
catch (cms::Exception& e) {
Expand Down
30 changes: 4 additions & 26 deletions DetectorDescription/Parser/test/dumpDDExpandedView.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/***************************************************************************
main.cpp - description
-------------------
begin : Wed Oct 24 17:36:15 PDT 2001
author : Michael Case
email : case@ucdhep.ucdavis.edu
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include <exception>
#include <fstream>
#include <memory>
Expand All @@ -34,7 +17,6 @@
#include "FWCore/ServiceRegistry/interface/ServiceToken.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/Presence.h"
#include "boost/smart_ptr/shared_ptr.hpp"

using namespace xercesc;

Expand All @@ -53,9 +35,9 @@ int main(int argc, char *argv[])
// In particular, the job hangs as soon as the output buffer fills up.
// That's because, without the message service, there is no mechanism for
// emptying the buffers.
boost::shared_ptr<edm::Presence> theMessageServicePresence;
theMessageServicePresence = boost::shared_ptr<edm::Presence>(edm::PresenceFactory::get()->
makePresence("MessageServicePresence").release());
std::shared_ptr<edm::Presence> theMessageServicePresence;
theMessageServicePresence = std::shared_ptr<edm::Presence>(edm::PresenceFactory::get()->
makePresence("MessageServicePresence").release());

// C. Manufacture a configuration and establish it.
std::string config =
Expand Down Expand Up @@ -100,7 +82,7 @@ int main(int argc, char *argv[])
std::cout << std::endl << std::endl << "main::Start checking!" << std::endl << std::endl;
DDCheckMaterials(std::cout);

std::cout << "edge size of produce graph:" << cpv.writeableGraph().edge_size() << std::endl;
std::cout << "edge size of produce graph:" << cpv.graph().edge_size() << std::endl;

DDExpandedView ev(cpv);
std::cout << "== got the epv ==" << std::endl;
Expand All @@ -113,10 +95,6 @@ int main(int argc, char *argv[])
}
plist.close();
std::cout << "Traversing the tree went to " << numPhysParts << " nodes, or \"PhysicalParts\" in online db terms." << std::endl;
cpv.writeableGraph().clear();
// cpv.clear();
std::cout << "cleared DDCompactView. " << std::endl;

}
// Deal with any exceptions that may have been thrown.
catch (cms::Exception& e) {
Expand Down