From c810380f6a68b3909343f5b83e6627949fc76367 Mon Sep 17 00:00:00 2001 From: Markus Frank <Markus.Frank@cern.ch> Date: Thu, 8 Feb 2024 10:05:15 +0100 Subject: [PATCH] Suppress default use of std namespace --- DDEve/lcio/LCIOEventHandler.cpp | 35 ++++++------- DDEve/src/Calo2DProjection.cpp | 43 ++++++++-------- DDEve/src/Calo3DProjection.cpp | 6 +-- DDEve/src/CaloLego.cpp | 29 ++++++----- DDEve/src/ContextMenu.cpp | 17 +++--- DDEve/src/DD4hepMenu.cpp | 33 ++++++------ DDEve/src/DDEveEventData.cpp | 2 +- DDEve/src/DDEvePlugins.cpp | 5 +- DDEve/src/DDG4EventHandler.cpp | 15 +++--- DDEve/src/Display.cpp | 22 ++++---- DDEve/src/DisplayConfiguration.cpp | 2 +- DDEve/src/DisplayConfigurationParser.cpp | 54 ++++++++++---------- DDEve/src/ElementList.cpp | 7 ++- DDEve/src/EvePgonSetProjectedContextMenu.cpp | 7 ++- DDEve/src/EveShapeContextMenu.cpp | 9 ++-- DDEve/src/EveUserContextMenu.cpp | 15 +++--- DDEve/src/EventControl.cpp | 5 -- DDEve/src/EventHandler.cpp | 2 +- DDEve/src/FrameControl.cpp | 5 +- DDEve/src/GenericEventHandler.cpp | 13 +++-- DDEve/src/HitActors.cpp | 20 ++++---- DDEve/src/MultiView.cpp | 15 +++--- DDEve/src/ParticleActors.cpp | 31 ++++++----- DDEve/src/PopupMenu.cpp | 6 +-- DDEve/src/Projection.cpp | 11 ++-- DDEve/src/RhoPhiProjection.cpp | 4 +- DDEve/src/RhoZProjection.cpp | 4 +- DDEve/src/Utilities.cpp | 46 ++++++++--------- DDEve/src/View.cpp | 47 +++++++++-------- DDEve/src/View3D.cpp | 4 +- DDEve/src/ViewMenu.cpp | 44 ++++++++-------- 31 files changed, 267 insertions(+), 291 deletions(-) diff --git a/DDEve/lcio/LCIOEventHandler.cpp b/DDEve/lcio/LCIOEventHandler.cpp index c073add12..2e1f8f8a7 100644 --- a/DDEve/lcio/LCIOEventHandler.cpp +++ b/DDEve/lcio/LCIOEventHandler.cpp @@ -13,24 +13,23 @@ // Framework include files #include "LCIOEventHandler.h" -#include "DD4hep/Printout.h" -#include "DD4hep/Objects.h" -#include "DD4hep/Factories.h" +#include <DD4hep/Printout.h> +#include <DD4hep/Objects.h> +#include <DD4hep/Factories.h> -#include "IO/LCReader.h" -#include "EVENT/LCCollection.h" -#include "EVENT/SimCalorimeterHit.h" -#include "EVENT/SimTrackerHit.h" -#include "EVENT/MCParticle.h" +#include <IO/LCReader.h> +#include <EVENT/LCCollection.h> +#include <EVENT/SimCalorimeterHit.h> +#include <EVENT/SimTrackerHit.h> +#include <EVENT/MCParticle.h> -#include "TSystem.h" -#include "TGMsgBox.h" +#include <TSystem.h> +#include <TGMsgBox.h> // C/C++ include files #include <stdexcept> #include <climits> -using namespace std; using namespace lcio; using namespace dd4hep; using namespace EVENT; @@ -168,25 +167,25 @@ bool LCIOEventHandler::NextEvent() { const _S* collnames = m_event->getCollectionNames(); for( _S::const_iterator i = collnames->begin(); i != collnames->end(); ++i) { LCCollection* c = m_event->getCollection(*i); - m_data[c->getTypeName()].push_back(make_pair((*i).c_str(),c->getNumberOfElements())); + m_data[c->getTypeName()].push_back(std::make_pair((*i).c_str(),c->getNumberOfElements())); m_branches[*i] = c; } m_hasEvent = true; return 1; } - throw runtime_error("+++ EventHandler::readEvent: Failed to read event"); + throw std::runtime_error("+++ EventHandler::readEvent: Failed to read event"); } - throw runtime_error("+++ EventHandler::readEvent: No file open!"); + throw std::runtime_error("+++ EventHandler::readEvent: No file open!"); } /// Load the previous event bool LCIOEventHandler::PreviousEvent() { - throw runtime_error("+++ This version of the LCIO reader can only access files sequentially!\n" - "+++ Access to the previous event is not supported."); + throw std::runtime_error("+++ This version of the LCIO reader can only access files sequentially!\n" + "+++ Access to the previous event is not supported."); } /// Goto a specified event in the file bool LCIOEventHandler::GotoEvent(long /* event_number */) { - throw runtime_error("+++ This version of the LCIO reader can only access files sequentially!\n" - "+++ Random access is not supported."); + throw std::runtime_error("+++ This version of the LCIO reader can only access files sequentially!\n" + "+++ Random access is not supported."); } diff --git a/DDEve/src/Calo2DProjection.cpp b/DDEve/src/Calo2DProjection.cpp index 09101b887..bd9f73acb 100644 --- a/DDEve/src/Calo2DProjection.cpp +++ b/DDEve/src/Calo2DProjection.cpp @@ -12,18 +12,17 @@ //========================================================================== // Framework include files -#include "DDEve/Calo2DProjection.h" -#include "DDEve/Annotation.h" -#include "DDEve/Factories.h" -#include "DD4hep/InstanceCount.h" +#include <DDEve/Calo2DProjection.h> +#include <DDEve/Annotation.h> +#include <DDEve/Factories.h> +#include <DD4hep/InstanceCount.h> // Root include files -#include "TEveCalo.h" -#include "TEveScene.h" -#include "TGLViewer.h" -#include "TEveArrow.h" +#include <TEveCalo.h> +#include <TEveScene.h> +#include <TGLViewer.h> +#include <TEveArrow.h> -using namespace std; using namespace dd4hep; ClassImp(Calo2DProjection) @@ -61,18 +60,18 @@ void Calo2DProjection::ConfigureGeometry(const DisplayConfiguration::ViewConfig& TEveElementList& sens = m_eve->GetGeoTopic("Sensitive"); TEveElementList& struc = m_eve->GetGeoTopic("Structure"); for(TEveElementList::List_i i=sens.BeginChildren(); i!=sens.EndChildren(); ++i) { - TEveElementList* ll = dynamic_cast<TEveElementList*>(*i); - if ( ll && cfg.name == ll->GetName() ) { - m_projMgr->ImportElements(*i,m_geoScene); - goto Done; - } + TEveElementList* ll = dynamic_cast<TEveElementList*>(*i); + if ( ll && cfg.name == ll->GetName() ) { + m_projMgr->ImportElements(*i,m_geoScene); + goto Done; + } } for(TEveElementList::List_i i=struc.BeginChildren(); i!=struc.EndChildren(); ++i) { - TEveElementList* ll = dynamic_cast<TEveElementList*>(*i); - if ( ll && cfg.name == ll->GetName() ) { - m_projMgr->ImportElements(*i,m_geoScene); - goto Done; - } + TEveElementList* ll = dynamic_cast<TEveElementList*>(*i); + if ( ll && cfg.name == ll->GetName() ) { + m_projMgr->ImportElements(*i,m_geoScene); + goto Done; + } } Done: continue; @@ -110,8 +109,8 @@ void Calo2DProjection::ConfigureGeometry(const DisplayConfiguration::ViewConfig& #endif legend_y += a->GetTextSize(); printout(INFO,"Calo2DProjection","+++ %s: add detector %s [%s] rmin=%f towerH:%f emax=%f", - name().c_str(),n,ctx.config.hits.c_str(),calo3d.rmin,calo3d.towerH, - calo3d.emax); + name().c_str(),n,ctx.config.hits.c_str(),calo3d.rmin,calo3d.towerH, + calo3d.emax); } } } @@ -122,5 +121,5 @@ void Calo2DProjection::ConfigureEvent(const DisplayConfiguration::ViewConfig& co } /// Call to import geometry topics -void Calo2DProjection::ImportGeoTopics(const string& /* title */) { +void Calo2DProjection::ImportGeoTopics(const std::string& /* title */) { } diff --git a/DDEve/src/Calo3DProjection.cpp b/DDEve/src/Calo3DProjection.cpp index d1c05baa2..6e2355506 100644 --- a/DDEve/src/Calo3DProjection.cpp +++ b/DDEve/src/Calo3DProjection.cpp @@ -12,9 +12,9 @@ //========================================================================== // Framework include files -#include "DDEve/Calo3DProjection.h" -#include "DDEve/Factories.h" -#include "DD4hep/InstanceCount.h" +#include <DDEve/Calo3DProjection.h> +#include <DDEve/Factories.h> +#include <DD4hep/InstanceCount.h> using namespace dd4hep; diff --git a/DDEve/src/CaloLego.cpp b/DDEve/src/CaloLego.cpp index 40c01e9f4..0a8910075 100644 --- a/DDEve/src/CaloLego.cpp +++ b/DDEve/src/CaloLego.cpp @@ -12,23 +12,24 @@ //========================================================================== // Framework include files -#include "DDEve/CaloLego.h" -#include "DDEve/Annotation.h" -#include "DDEve/Factories.h" -#include "DD4hep/InstanceCount.h" +#include <DDEve/CaloLego.h> +#include <DDEve/Annotation.h> +#include <DDEve/Factories.h> +#include <DD4hep/InstanceCount.h> // Root include files -#include "TH2.h" -#include "TEveCalo.h" -#include "TEveTrans.h" -#include "TEveScene.h" -#include "TGLViewer.h" -#include "TGLWidget.h" -#include "TEveCaloLegoOverlay.h" -#include "TEveLegoEventHandler.h" +#include <TH2.h> +#include <TEveCalo.h> +#include <TEveTrans.h> +#include <TEveScene.h> +#include <TGLViewer.h> +#include <TGLWidget.h> +#include <TEveCaloLegoOverlay.h> +#include <TEveLegoEventHandler.h> +// C/C++ include files #include <limits> -using namespace std; + using namespace dd4hep; ClassImp(CaloLego) @@ -123,5 +124,5 @@ void CaloLego::ConfigureEvent(const DisplayConfiguration::ViewConfig& config) { } /// Call to import geometry topics -void CaloLego::ImportGeoTopics(const string&) { +void CaloLego::ImportGeoTopics(const std::string&) { } diff --git a/DDEve/src/ContextMenu.cpp b/DDEve/src/ContextMenu.cpp index c7744e5ec..9f23d3deb 100644 --- a/DDEve/src/ContextMenu.cpp +++ b/DDEve/src/ContextMenu.cpp @@ -12,20 +12,19 @@ //========================================================================== // Framework include files -#include "DDEve/ContextMenu.h" +#include <DDEve/ContextMenu.h> // ROOT include files -#include "TList.h" -#include "TClassMenuItem.h" +#include <TList.h> +#include <TClassMenuItem.h> // C/C++ include files #include <stdexcept> #include <map> -using namespace std; using namespace dd4hep; -typedef map<string,ContextMenu*> Contexts; +typedef std::map<std::string,ContextMenu*> Contexts; static Contexts& mapped_entries() { static Contexts e; return e; @@ -55,7 +54,7 @@ ClassImp(ContextMenu) /// Initializing constructor ContextMenu::ContextMenu(TClass* cl) : m_class(cl) { if ( !cl ) { - throw runtime_error("Failure: Cannot create context menu for NULL class!"); + throw std::runtime_error("Failure: Cannot create context menu for NULL class!"); } } @@ -89,12 +88,12 @@ ContextMenu& ContextMenu::AddSeparator() { } /// Add user callback -ContextMenu& ContextMenu::Add(const string& title, Callback cb, void* ud) { +ContextMenu& ContextMenu::Add(const std::string& title, Callback cb, void* ud) { ContextMenuHandler* handler = new ContextMenuHandler(cb, ud); TClassMenuItem* item = new TClassMenuItem(TClassMenuItem::kPopupUserFunction, - ContextMenuHandler::Class(),title.c_str(), - "Context",handler,"TObject*",2); + ContextMenuHandler::Class(),title.c_str(), + "Context",handler,"TObject*",2); m_calls.push_back(handler); m_class->GetMenuList()->AddLast(item); return *this; diff --git a/DDEve/src/DD4hepMenu.cpp b/DDEve/src/DD4hepMenu.cpp index 32ae2e0c2..2dd9aaba5 100644 --- a/DDEve/src/DD4hepMenu.cpp +++ b/DDEve/src/DD4hepMenu.cpp @@ -12,30 +12,29 @@ //========================================================================== // Framework include files -#include "DD4hep/Plugins.h" -#include "DD4hep/Printout.h" -#include "DD4hep/Primitives.h" -#include "DD4hep/InstanceCount.h" +#include <DD4hep/Plugins.h> +#include <DD4hep/Printout.h> +#include <DD4hep/Primitives.h> +#include <DD4hep/InstanceCount.h> -#include "DDEve/View.h" -#include "DDEve/DD4hepMenu.h" -#include "DDEve/PopupMenu.h" -#include "DDEve/EventControl.h" +#include <DDEve/View.h> +#include <DDEve/DD4hepMenu.h> +#include <DDEve/PopupMenu.h> +#include <DDEve/EventControl.h> // ROOT include files -#include "TEveBrowser.h" -#include "TEveManager.h" -#include "TEveElement.h" -#include "TEveWindow.h" -#include "TEveViewer.h" -#include "TGLViewer.h" -#include "TGClient.h" -#include "TSystem.h" +#include <TEveBrowser.h> +#include <TEveManager.h> +#include <TEveElement.h> +#include <TEveWindow.h> +#include <TEveViewer.h> +#include <TGLViewer.h> +#include <TGClient.h> +#include <TSystem.h> // Forward declarations class TEveWindowSlot; -using namespace std; using namespace dd4hep; ClassImp(DD4hepMenu) diff --git a/DDEve/src/DDEveEventData.cpp b/DDEve/src/DDEveEventData.cpp index 5a48804c6..86f5ba4d6 100644 --- a/DDEve/src/DDEveEventData.cpp +++ b/DDEve/src/DDEveEventData.cpp @@ -12,7 +12,7 @@ //========================================================================== // Framework include files -#include "DDEve/DDEveEventData.h" +#include <DDEve/DDEveEventData.h> using namespace dd4hep; diff --git a/DDEve/src/DDEvePlugins.cpp b/DDEve/src/DDEvePlugins.cpp index ed1b29d95..a44d8a4cb 100644 --- a/DDEve/src/DDEvePlugins.cpp +++ b/DDEve/src/DDEvePlugins.cpp @@ -11,9 +11,8 @@ // //========================================================================== - // Framework include files -#include "DD4hep/detail/Plugins.inl" -#include "DDEve/Factories.h" +#include <DD4hep/detail/Plugins.inl> +#include <DDEve/Factories.h> DD4HEP_IMPLEMENT_PLUGIN_REGISTRY(dd4hep::View*, (dd4hep::Display*, const char*)) diff --git a/DDEve/src/DDG4EventHandler.cpp b/DDEve/src/DDG4EventHandler.cpp index 2268fe25f..f9a8abdcf 100644 --- a/DDEve/src/DDG4EventHandler.cpp +++ b/DDEve/src/DDG4EventHandler.cpp @@ -24,7 +24,6 @@ // C/C++ include files #include <stdexcept> -using namespace std; using namespace dd4hep; ClassImp(DDG4EventHandler) @@ -48,12 +47,12 @@ DECLARE_CONSTRUCTOR(DD4hep_DDEve_DDG4EventHandler,_create) DDG4EventHandler::DDG4EventHandler() : EventHandler(), m_file(0,0), m_entry(-1) { void* ptr = PluginService::Create<void*>("DD4hep_DDEve_DDG4HitAccess",(const char*)""); if ( 0 == ptr ) { - throw runtime_error("FATAL: Failed to access function pointer from factory DD4hep_DDEve_DDG4HitAccess"); + throw std::runtime_error("FATAL: Failed to access function pointer from factory DD4hep_DDEve_DDG4HitAccess"); } m_simhitConverter = FCN(ptr).hits; ptr = PluginService::Create<void*>("DD4hep_DDEve_DDG4ParticleAccess",(const char*)""); if ( 0 == ptr ) { - throw runtime_error("FATAL: Failed to access function pointer from factory DD4hep_DDEve_DDG4ParticleAccess"); + throw std::runtime_error("FATAL: Failed to access function pointer from factory DD4hep_DDEve_DDG4ParticleAccess"); } m_particleConverter = FCN(ptr).particles; } @@ -181,9 +180,9 @@ Int_t DDG4EventHandler::ReadEvent(Long64_t event_number) { return nbytes; } printout(ERROR,"DDG4EventHandler","+++ ReadEvent: Cannot read event data for entry:%d",event_number); - throw runtime_error("+++ EventHandler::readEvent: Failed to read event"); + throw std::runtime_error("+++ EventHandler::readEvent: Failed to read event"); } - throw runtime_error("+++ EventHandler::readEvent: No file open!"); + throw std::runtime_error("+++ EventHandler::readEvent: No file open!"); } /// Open new data file @@ -203,7 +202,7 @@ bool DDG4EventHandler::Open(const std::string&, const std::string& name) { for(Int_t i=0; i<br->GetSize(); ++i) { TBranch* b = (TBranch*)br->At(i); if ( !b ) continue; - m_branches[b->GetName()] = make_pair(b,(void*)0); + m_branches[b->GetName()] = std::make_pair(b,(void*)0); printout(INFO,"DDG4EventHandler::open","+++ Branch %s has %ld entries.",b->GetName(),b->GetEntries()); } for(Int_t i=0; i<br->GetSize(); ++i) { @@ -214,7 +213,7 @@ bool DDG4EventHandler::Open(const std::string&, const std::string& name) { m_hasFile = true; return true; } - throw runtime_error("+++ Failed to access tree EVENT in ROOT file:"+name); + throw std::runtime_error("+++ Failed to access tree EVENT in ROOT file:"+name); } - throw runtime_error("+++ Failed to open ROOT file:"+name); + throw std::runtime_error("+++ Failed to open ROOT file:"+name); } diff --git a/DDEve/src/Display.cpp b/DDEve/src/Display.cpp index 5631b4404..25b266366 100644 --- a/DDEve/src/Display.cpp +++ b/DDEve/src/Display.cpp @@ -146,7 +146,7 @@ void Display::LoadXML(const char* xmlFile) { /// Load geometry from compact xml file void Display::LoadGeometryRoot(const char* /* rootFile */) { - throw runtime_error("This call is not implemented !"); + throw std::runtime_error("This call is not implemented !"); } /// Load geometry with panel @@ -169,7 +169,7 @@ GenericEventHandler& Display::eventHandler() const { if ( m_evtHandler ) { return *m_evtHandler; } - throw runtime_error("Invalid event handler"); + throw std::runtime_error("Invalid event handler"); } /// Add new menu to the main menu bar @@ -238,7 +238,7 @@ Display::CalodataContext& Display::GetCaloHistogram(const std::string& nam) { i = m_calodata.emplace(nam,ctx).first; return (*i).second; } - throw runtime_error("Cannot access calodata configuration "+nam); + throw std::runtime_error("Cannot access calodata configuration "+nam); } return (*i).second; } @@ -289,7 +289,7 @@ void Display::MessageBox(PrintLevel level, const std::string& text, const std::s } /// Popup XML file chooser. returns chosen file name; empty on cancel -string Display::OpenXmlFileDialog(const std::string& default_dir) const { +std::string Display::OpenXmlFileDialog(const std::string& default_dir) const { static const char *evtFiletypes[] = { "xml files", "*.xml", "XML files", "*.XML", @@ -310,7 +310,7 @@ string Display::OpenXmlFileDialog(const std::string& default_dir) const { } /// Popup ROOT file chooser. returns chosen file name; empty on cancel -string Display::OpenEventFileDialog(const std::string& default_dir) const { +std::string Display::OpenEventFileDialog(const std::string& default_dir) const { static const char *evtFiletypes[] = { "ROOT files", "*.root", "SLCIO files", "*.slcio", @@ -348,7 +348,7 @@ void Display::BuildMenus(TGMenuBar* menubar) { TFile* Display::Open(const char* name) const { TFile* f = TFile::Open(name); if ( f && !f->IsZombie() ) return f; - throw runtime_error("+++ Failed to open ROOT file:"+string(name)); + throw std::runtime_error("+++ Failed to open ROOT file:"+std::string(name)); } /// Consumer event data @@ -358,7 +358,7 @@ void Display::OnFileOpen(EventHandler& /* handler */ ) { /// Consumer event data void Display::OnNewEvent(EventHandler& handler ) { typedef EventHandler::TypedEventCollections Types; - typedef vector<EventHandler::Collection> Collections; + typedef std::vector<EventHandler::Collection> Collections; const Types& types = handler.data(); TEveElement* particles = 0; @@ -477,7 +477,7 @@ TEveElementList& Display::GetGeoTopic(const std::string& name) { TEveElementList& Display::GetGeoTopic(const std::string& name) const { Topics::const_iterator i=m_geoTopics.find(name); if ( i == m_geoTopics.end() ) { - throw runtime_error("Display: Attempt to access non-existing geometry topic:"+name); + throw std::runtime_error("Display: Attempt to access non-existing geometry topic:"+name); } return *((*i).second); } @@ -498,7 +498,7 @@ TEveElementList& Display::GetEveTopic(const std::string& name) { TEveElementList& Display::GetEveTopic(const std::string& name) const { Topics::const_iterator i=m_eveTopics.find(name); if ( i == m_eveTopics.end() ) { - throw runtime_error("Display: Attempt to access non-existing event topic:"+name); + throw std::runtime_error("Display: Attempt to access non-existing event topic:"+name); } return *((*i).second); } @@ -542,7 +542,7 @@ void Display::LoadGeoChildren(TEveElement* start, int levels, bool redraw) { DetElement de = (*i).second; SensitiveDetector sd = m_detDesc->sensitiveDetector(de.name()); TEveElementList& parent = sd.isValid() ? sens : struc; - pair<bool,TEveElement*> e = Utilities::LoadDetElement(de,levels,&parent); + std::pair<bool,TEveElement*> e = Utilities::LoadDetElement(de,levels,&parent); if ( e.second && e.first ) { parent.AddElement(e.second); } @@ -556,7 +556,7 @@ void Display::LoadGeoChildren(TEveElement* start, int levels, bool redraw) { const char* node_name = n->GetName(); int level = Utilities::findNodeWithMatrix(detectorDescription().world().placement().ptr(),n,&mat); if ( level > 0 ) { - pair<bool,TEveElement*> e(false,0); + std::pair<bool,TEveElement*> e(false,0); const DetElement::Children& c = world.children(); for (DetElement::Children::const_iterator i = c.begin(); i != c.end(); ++i) { DetElement de = (*i).second; diff --git a/DDEve/src/DisplayConfiguration.cpp b/DDEve/src/DisplayConfiguration.cpp index 463480aa3..a05e3518e 100644 --- a/DDEve/src/DisplayConfiguration.cpp +++ b/DDEve/src/DisplayConfiguration.cpp @@ -12,7 +12,7 @@ //========================================================================== // Framework include files -#include "DDEve/DisplayConfiguration.h" +#include <DDEve/DisplayConfiguration.h> // C/C++ include files #include <stdexcept> diff --git a/DDEve/src/DisplayConfigurationParser.cpp b/DDEve/src/DisplayConfigurationParser.cpp index 1fc3dca70..acd757b07 100644 --- a/DDEve/src/DisplayConfigurationParser.cpp +++ b/DDEve/src/DisplayConfigurationParser.cpp @@ -12,24 +12,22 @@ //========================================================================== // Framework include files -#include "DD4hep/Detector.h" -#include "DD4hep/DetectorLoad.h" -#include "DD4hep/Printout.h" -#include "XML/Conversions.h" -#include "XML/XMLElements.h" -#include "XML/DocumentHandler.h" -#include "DD4hep/DetFactoryHelper.h" +#include <DD4hep/Detector.h> +#include <DD4hep/DetectorLoad.h> +#include <DD4hep/Printout.h> +#include <XML/Conversions.h> +#include <XML/XMLElements.h> +#include <XML/DocumentHandler.h> +#include <DD4hep/DetFactoryHelper.h> -#include "DDEve/Display.h" -#include "DDEve/DisplayConfiguration.h" +#include <DDEve/Display.h> +#include <DDEve/DisplayConfiguration.h> // C/C++ include files #include <stdexcept> -using namespace std; using namespace dd4hep; - namespace dd4hep { namespace { /// Some utility class to specialize the convetrers: class ddeve; @@ -81,7 +79,7 @@ namespace { } static void extract(DisplayConfiguration::Config& c, xml_h e, int typ) { - c.name = e.attr<string>(_U(name)); + c.name = e.attr<std::string>(_U(name)); c.type = typ; c.data.defaults.show_evt = e.hasAttr(u_show_evt) ? e.attr<int>(u_show_evt) : 1; c.data.defaults.load_geo = e.hasAttr(u_load_geo) ? e.attr<int>(u_load_geo) : -1; @@ -91,8 +89,8 @@ static void extract(DisplayConfiguration::Config& c, xml_h e, int typ) { c.data.calo3d.towerH = e.hasAttr(u_towerH) ? e.attr<float>(u_towerH) : 25.0; if ( e.hasAttr(_U(dz)) ) c.data.calo3d.dz = e.attr<float>(_U(dz)); if ( e.hasAttr(_U(rmin)) ) c.data.calo3d.rmin = e.attr<float>(_U(rmin)); - if ( e.hasAttr(u_use) ) c.use = e.attr<string>(u_use); - if ( e.hasAttr(u_hits) ) c.hits = e.attr<string>(u_hits); + if ( e.hasAttr(u_use) ) c.use = e.attr<std::string>(u_use); + if ( e.hasAttr(u_hits) ) c.hits = e.attr<std::string>(u_hits); if ( e.hasAttr(_U(threshold)) ) c.data.calo3d.threshold = e.attr<float>(_U(threshold)); } @@ -126,15 +124,15 @@ template <> void Converter<calodata_configs>::operator()(xml_h e) const { template <> void Converter<collection_configs>::operator()(xml_h e) const { Configurations* configs = (Configurations*)param; DisplayConfiguration::Config c; - c.name = e.attr<string>(_U(name)); + c.name = e.attr<std::string>(_U(name)); c.type = DisplayConfiguration::COLLECTION; c.data.hits.color = e.hasAttr(_U(color)) ? e.attr<int>(_U(color)) : 0xBBBBBB; c.data.hits.alpha = e.hasAttr(_U(alpha)) ? e.attr<float>(_U(alpha)) : -1.0; c.data.hits.emax = e.hasAttr(u_emax) ? e.attr<float>(u_emax) : 25.0; c.data.hits.towerH = e.hasAttr(u_towerH) ? e.attr<float>(u_towerH) : 25.0; c.data.hits.threshold = e.hasAttr(_U(threshold)) ? e.attr<float>(_U(threshold)) : 0.0; - if ( e.hasAttr(u_hits) ) c.hits = e.attr<string>(u_hits); - if ( e.hasAttr(u_use) ) c.use = e.attr<string>(u_use); + if ( e.hasAttr(u_hits) ) c.hits = e.attr<std::string>(u_hits); + if ( e.hasAttr(u_use) ) c.use = e.attr<std::string>(u_use); configs->push_back(c); } @@ -153,8 +151,8 @@ template <> void Converter<view>::operator()(xml_h e) const { ViewConfigurations* configs = (ViewConfigurations*)param; DisplayConfiguration::ViewConfig c; extract(c,e,DisplayConfiguration::VIEW); - c.name = e.attr<string>(_U(name)); - c.type = e.attr<string>(_U(type)); + c.name = e.attr<std::string>(_U(name)); + c.type = e.attr<std::string>(_U(type)); c.show_structure = e.hasAttr(_U(structure)) ? e.attr<bool>(_U(structure)) : true; c.show_sensitive = e.hasAttr(_U(sensitive)) ? e.attr<bool>(_U(sensitive)) : true; printout(INFO,"DisplayConfiguration","+++ View: %s sensitive:%d structure:%d.", @@ -180,14 +178,14 @@ template <> void Converter<view>::operator()(xml_h e) const { template <> void Converter<calodata>::operator()(xml_h e) const { Configurations* configs = (Configurations*)param; DisplayConfiguration::Config c; - c.name = e.attr<string>(_U(name)); + c.name = e.attr<std::string>(_U(name)); c.type = DisplayConfiguration::CALODATA; if ( e.hasAttr(u_use) ) { - c.use = e.attr<string>(u_use); - c.hits = e.attr<string>(u_hits); + c.use = e.attr<std::string>(u_use); + c.hits = e.attr<std::string>(u_hits); } else { - c.hits = e.attr<string>(u_hits); + c.hits = e.attr<std::string>(u_hits); c.data.calodata.n_eta = e.attr<int>(u_n_eta); c.data.calodata.eta_min = e.attr<float>(u_eta_min); c.data.calodata.eta_max = e.attr<float>(u_eta_max); @@ -219,10 +217,10 @@ template <> void Converter<calodata>::operator()(xml_h e) const { template <> void Converter<collection>::operator()(xml_h e) const { Configurations* configs = (Configurations*)param; DisplayConfiguration::Config c; - c.name = e.attr<string>(_U(name)); - c.hits = e.attr<string>(u_hits); + c.name = e.attr<std::string>(_U(name)); + c.hits = e.attr<std::string>(u_hits); c.type = DisplayConfiguration::COLLECTION; - c.use = e.hasAttr(u_use) ? e.attr<string>(u_use) : string(); + c.use = e.hasAttr(u_use) ? e.attr<std::string>(u_use) : std::string(); c.data.hits.size = e.attr<float>(_U(size)); c.data.hits.type = e.attr<float>(_U(type)); c.data.hits.color = e.hasAttr(_U(color)) ? e.attr<int>(_U(color)) : kRed; @@ -249,7 +247,7 @@ template <> void Converter<include>::operator()(xml_h e) const { if ( e ) { DetectorLoad* load = dynamic_cast<DetectorLoad*>(&this->description); if ( load ) { - load->processXML(e,e.attr<string>(_U(ref))); + load->processXML(e,e.attr<std::string>(_U(ref))); return; } except("DisplayConfiguration","++ Invalid DetectorLoad instance in XML converter <include>"); @@ -298,7 +296,7 @@ template <> void Converter<ddeve>::operator()(xml_h e) const { disp->ImportConfiguration(cfg); } -#include "TEveProjections.h" +#include <TEveProjections.h> /** Basic entry point to read display configuration files * * @author M.Frank diff --git a/DDEve/src/ElementList.cpp b/DDEve/src/ElementList.cpp index 6f0f040a3..caaaa5ed5 100644 --- a/DDEve/src/ElementList.cpp +++ b/DDEve/src/ElementList.cpp @@ -12,16 +12,15 @@ //========================================================================== // Framework include files -#include "DD4hep/InstanceCount.h" -#include "DDEve/EveUserContextMenu.h" -#include "DDEve/ElementList.h" +#include <DD4hep/InstanceCount.h> +#include <DDEve/EveUserContextMenu.h> +#include <DDEve/ElementList.h> // ROOT include files // C/C++ include files #include <stdexcept> -using namespace std; using namespace dd4hep; ClassImp(ElementList) diff --git a/DDEve/src/EvePgonSetProjectedContextMenu.cpp b/DDEve/src/EvePgonSetProjectedContextMenu.cpp index f27a301ee..a7f3dc858 100644 --- a/DDEve/src/EvePgonSetProjectedContextMenu.cpp +++ b/DDEve/src/EvePgonSetProjectedContextMenu.cpp @@ -12,16 +12,15 @@ //========================================================================== // Framework include files -#include "DDEve/ContextMenu.h" -#include "DDEve/EvePgonSetProjectedContextMenu.h" +#include <DDEve/ContextMenu.h> +#include <DDEve/EvePgonSetProjectedContextMenu.h> // ROOT include files -#include "TEvePolygonSetProjected.h" +#include <TEvePolygonSetProjected.h> // C/C++ include files #include <stdexcept> -using namespace std; using namespace dd4hep; ClassImp(EvePgonSetProjectedContextMenu) diff --git a/DDEve/src/EveShapeContextMenu.cpp b/DDEve/src/EveShapeContextMenu.cpp index c2399a509..ef84f9920 100644 --- a/DDEve/src/EveShapeContextMenu.cpp +++ b/DDEve/src/EveShapeContextMenu.cpp @@ -12,17 +12,16 @@ //========================================================================== // Framework include files -#include "DD4hep/Printout.h" -#include "DDEve/EveShapeContextMenu.h" +#include <DD4hep/Printout.h> +#include <DDEve/EveShapeContextMenu.h> // ROOT include files -#include "TEveGeoShape.h" -#include "TEveManager.h" +#include <TEveGeoShape.h> +#include <TEveManager.h> // C/C++ include files #include <stdexcept> -using namespace std; using namespace dd4hep; ClassImp(EveShapeContextMenu) diff --git a/DDEve/src/EveUserContextMenu.cpp b/DDEve/src/EveUserContextMenu.cpp index c6aaea7b3..e84af8562 100644 --- a/DDEve/src/EveUserContextMenu.cpp +++ b/DDEve/src/EveUserContextMenu.cpp @@ -12,19 +12,18 @@ //========================================================================== // Framework include files -#include "DD4hep/Printout.h" -#include "DDEve/Display.h" -#include "DDEve/ContextMenu.h" -#include "DDEve/EveUserContextMenu.h" +#include <DD4hep/Printout.h> +#include <DDEve/Display.h> +#include <DDEve/ContextMenu.h> +#include <DDEve/EveUserContextMenu.h> // ROOT include files -#include "TEveGeoShape.h" -#include "TEveManager.h" -#include "TEveElement.h" +#include <TEveGeoShape.h> +#include <TEveManager.h> +#include <TEveElement.h> // C/C++ include files -using namespace std; using namespace dd4hep; ClassImp(EveUserContextMenu) diff --git a/DDEve/src/EventControl.cpp b/DDEve/src/EventControl.cpp index d7824397b..37c36cc1b 100644 --- a/DDEve/src/EventControl.cpp +++ b/DDEve/src/EventControl.cpp @@ -79,11 +79,6 @@ void EventControl::GotoEvent() { /// Open a new event data file bool EventControl::Open() { - // e- shots: - //m_display->eventHandler().Open("/home/frankm/SW/DD4hep_head_dbg.root_v5.34.10/build/CLICSiD_2014-06-10_15-26.root"); - // pi- shots: - //m_display->eventHandler().Open("/home/frankm/SW/DD4hep_head_dbg.root_v5.34.10/build/CLICSiD_2014-06-18_12-48.root"); - std::string fname = m_display->OpenEventFileDialog("."); if ( !fname.empty() ) { return m_display->eventHandler().Open(m_display->getEventHandlerName(),fname); diff --git a/DDEve/src/EventHandler.cpp b/DDEve/src/EventHandler.cpp index efb4bd008..62ad39ced 100644 --- a/DDEve/src/EventHandler.cpp +++ b/DDEve/src/EventHandler.cpp @@ -12,7 +12,7 @@ //========================================================================== // Framework include files -#include "DDEve/EventHandler.h" +#include <DDEve/EventHandler.h> using namespace dd4hep; diff --git a/DDEve/src/FrameControl.cpp b/DDEve/src/FrameControl.cpp index 5ffc54a89..65161dc5b 100644 --- a/DDEve/src/FrameControl.cpp +++ b/DDEve/src/FrameControl.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DDEve/FrameControl.h" -#include "DD4hep/Printout.h" +#include <DDEve/FrameControl.h> +#include <DD4hep/Printout.h> // ROOT include files #include <TSystem.h> @@ -22,7 +22,6 @@ #include <stdexcept> -using namespace std; using namespace dd4hep; ClassImp(FrameControl) diff --git a/DDEve/src/GenericEventHandler.cpp b/DDEve/src/GenericEventHandler.cpp index df213fa74..35c8004de 100644 --- a/DDEve/src/GenericEventHandler.cpp +++ b/DDEve/src/GenericEventHandler.cpp @@ -24,7 +24,6 @@ #include <TSystem.h> #include <climits> -using namespace std; using namespace dd4hep; ClassImp(GenericEventHandler) @@ -43,7 +42,7 @@ EventHandler* GenericEventHandler::current() const { if ( m_current ) { return m_current; } - throw runtime_error("Invalid event handler"); + throw std::runtime_error("Invalid event handler"); } /// Notfy all subscribers @@ -69,7 +68,7 @@ long GenericEventHandler::numEvents() const { } /// Access the data source name -string GenericEventHandler::datasourceName() const { +std::string GenericEventHandler::datasourceName() const { return current()->datasourceName(); } @@ -118,7 +117,7 @@ bool GenericEventHandler::Open(const std::string& file_type, const std::string& m_current = (EventHandler*)PluginService::Create<void*>("DD4hep_DDEve_DDG4EventHandler",(const char*)0); } else { - throw runtime_error("Attempt to open file:"+file_name+" of unknown type:"+file_type); + throw std::runtime_error("Attempt to open file:"+file_name+" of unknown type:"+file_type); } if ( m_current ) { if ( m_current->Open(file_type, file_name) ) { @@ -133,7 +132,7 @@ bool GenericEventHandler::Open(const std::string& file_type, const std::string& err = "+++ Failed to create fikle reader for file '"+file_name+"' of type '"+file_type+"'"; } } - catch(const exception& e) { + catch(const std::exception& e) { err = "\nAn exception occurred \n" "while opening event data:\n" + std::string(e.what()) + "\n\n"; } @@ -155,9 +154,9 @@ bool GenericEventHandler::NextEvent() { return 1; } } - throw runtime_error("+++ EventHandler::readEvent: No file open!"); + throw std::runtime_error("+++ EventHandler::readEvent: No file open!"); } - catch(const exception& e) { + catch(const std::exception& e) { std::string path = TString::Format("%s/stop_t.xpm", TROOT::GetIconPath().Data()).Data(); std::string err = "\nAn exception occurred \n" "while reading a new event:\n" + std::string(e.what()) + "\n\n"; diff --git a/DDEve/src/HitActors.cpp b/DDEve/src/HitActors.cpp index 182aa090c..f48c47112 100644 --- a/DDEve/src/HitActors.cpp +++ b/DDEve/src/HitActors.cpp @@ -12,18 +12,17 @@ //========================================================================== // Framework include files -#include "DDEve/HitActors.h" -#include "DD4hep/Objects.h" -#include "DD4hep/DD4hepUnits.h" +#include <DDEve/HitActors.h> +#include <DD4hep/Objects.h> +#include <DD4hep/DD4hepUnits.h> // ROOT include files -#include "TH2.h" -#include "TVector3.h" -#include "TEveBoxSet.h" -#include "TEvePointSet.h" -#include "TEveCompound.h" +#include <TH2.h> +#include <TVector3.h> +#include <TEveBoxSet.h> +#include <TEvePointSet.h> +#include <TEveCompound.h> -using namespace std; using namespace dd4hep; #ifdef DD4HEP_USE_GEANT4_UNITS @@ -125,7 +124,8 @@ TEveElement* BoxsetCreator::element() const { void BoxsetCreator::operator()(const DDEveHit& hit) { double ene = hit.deposit*MEV_2_GEV <= emax ? hit.deposit*MEV_2_GEV : emax; TVector3 scale(ene/towerH,ene/towerH,ene/towerH); - cout << "Hit:" << ene << " deposit:" << hit.deposit << " " << " emax:" << emax << " towerH:" << towerH << endl; + std::cout << "Hit:" << ene << " deposit:" << hit.deposit << " " + << " emax:" << emax << " towerH:" << towerH << std::endl; TVector3 p(hit.x*MM_2_CM, hit.y*MM_2_CM, hit.z*MM_2_CM); double phi = p.Phi(); float s1X = -0.5*(scale(0)*std::sin(phi)+scale(2)*std::cos(phi)); diff --git a/DDEve/src/MultiView.cpp b/DDEve/src/MultiView.cpp index e7723d05d..afc421dfc 100644 --- a/DDEve/src/MultiView.cpp +++ b/DDEve/src/MultiView.cpp @@ -12,14 +12,13 @@ //========================================================================== // Framework include files -#include "DDEve/MultiView.h" -#include "DDEve/Factories.h" -#include "DDEve/DisplayConfiguration.h" -#include "DD4hep/Plugins.h" +#include <DDEve/MultiView.h> +#include <DDEve/Factories.h> +#include <DDEve/DisplayConfiguration.h> +#include <DD4hep/Plugins.h> #include <iostream> -using namespace std; using namespace dd4hep; ClassImp(MultiView) @@ -35,7 +34,7 @@ static void _build(Display* display, View* v, TEveWindowSlot* slot) { } /// Initializing constructor -MultiView::MultiView(Display* eve, const string& nam) : View(eve, nam) +MultiView::MultiView(Display* eve, const std::string& nam) : View(eve, nam) { } @@ -72,7 +71,7 @@ View& MultiView::Build(TEveWindow* slot) { /// First panel if ( panels.size()>0) { const DisplayConfiguration::Config& cfg = panels[0]; - string typ = "DD4hep_DDEve_"+cfg.use; + std::string typ = "DD4hep_DDEve_"+cfg.use; v = PluginService::Create<View*>(typ.c_str(),m_eve,cfg.name.c_str()); } else { @@ -84,7 +83,7 @@ View& MultiView::Build(TEveWindow* slot) { /// Second panel if ( panels.size()>1) { const DisplayConfiguration::Config& cfg = panels[1]; - string typ = "DD4hep_DDEve_"+cfg.use; + std::string typ = "DD4hep_DDEve_"+cfg.use; v = PluginService::Create<View*>(typ.c_str(),m_eve,cfg.name.c_str()); } else { diff --git a/DDEve/src/ParticleActors.cpp b/DDEve/src/ParticleActors.cpp index b4b1ed5e3..71b5f0284 100644 --- a/DDEve/src/ParticleActors.cpp +++ b/DDEve/src/ParticleActors.cpp @@ -12,22 +12,21 @@ //========================================================================== // Framework include files -#include "DDEve/ParticleActors.h" -#include "DD4hep/DD4hepUnits.h" -#include "DD4hep/Printout.h" -#include "DD4hep/Objects.h" - -#include "TEveTrack.h" -#include "TEveBoxSet.h" -#include "TEvePointSet.h" -#include "TEveCompound.h" -#include "TEveTrackPropagator.h" - -#include "TParticle.h" -#include "TDatabasePDG.h" -#include "TGeoManager.h" - -using namespace std; +#include <DDEve/ParticleActors.h> +#include <DD4hep/DD4hepUnits.h> +#include <DD4hep/Printout.h> +#include <DD4hep/Objects.h> + +#include <TEveTrack.h> +#include <TEveBoxSet.h> +#include <TEvePointSet.h> +#include <TEveCompound.h> +#include <TEveTrackPropagator.h> + +#include <TParticle.h> +#include <TDatabasePDG.h> +#include <TGeoManager.h> + using namespace dd4hep; #ifdef DD4HEP_USE_GEANT4_UNITS diff --git a/DDEve/src/PopupMenu.cpp b/DDEve/src/PopupMenu.cpp index 1dd5e186d..6fabf8d30 100644 --- a/DDEve/src/PopupMenu.cpp +++ b/DDEve/src/PopupMenu.cpp @@ -12,9 +12,9 @@ //========================================================================== // Framework include files -#include "DDEve/PopupMenu.h" -#include "DD4hep/Printout.h" -#include "DD4hep/InstanceCount.h" +#include <DDEve/PopupMenu.h> +#include <DD4hep/Printout.h> +#include <DD4hep/InstanceCount.h> // C/C++ include files diff --git a/DDEve/src/Projection.cpp b/DDEve/src/Projection.cpp index ef7279d0f..86c3a7ffa 100644 --- a/DDEve/src/Projection.cpp +++ b/DDEve/src/Projection.cpp @@ -12,10 +12,10 @@ //========================================================================== // Framework include files -#include "DD4hep/Printout.h" -#include "DDEve/Projection.h" -#include "DDEve/Display.h" -#include "DDEve/Utilities.h" +#include <DD4hep/Printout.h> +#include <DDEve/Projection.h> +#include <DDEve/Display.h> +#include <DDEve/Utilities.h> // Eve include files #include <TEveManager.h> @@ -23,11 +23,10 @@ #include <TEveWindow.h> #include <TGLViewer.h> -using namespace std; using namespace dd4hep; /// Initializing constructor -Projection::Projection(Display* eve, const string& nam) +Projection::Projection(Display* eve, const std::string& nam) : View(eve, nam), m_projMgr(0), m_axis(0) { } diff --git a/DDEve/src/RhoPhiProjection.cpp b/DDEve/src/RhoPhiProjection.cpp index 4d1c3356a..8d3170417 100644 --- a/DDEve/src/RhoPhiProjection.cpp +++ b/DDEve/src/RhoPhiProjection.cpp @@ -13,8 +13,8 @@ //========================================================================== // Framework include files -#include "DDEve/RhoPhiProjection.h" -#include "DDEve/Factories.h" +#include <DDEve/RhoPhiProjection.h> +#include <DDEve/Factories.h> using namespace dd4hep; diff --git a/DDEve/src/RhoZProjection.cpp b/DDEve/src/RhoZProjection.cpp index a273b56a2..7e83a4e89 100644 --- a/DDEve/src/RhoZProjection.cpp +++ b/DDEve/src/RhoZProjection.cpp @@ -13,8 +13,8 @@ //========================================================================== // Framework include files -#include "DDEve/RhoZProjection.h" -#include "DDEve/Factories.h" +#include <DDEve/RhoZProjection.h> +#include <DDEve/Factories.h> using namespace dd4hep; diff --git a/DDEve/src/Utilities.cpp b/DDEve/src/Utilities.cpp index f5d3d09a0..2019f309f 100644 --- a/DDEve/src/Utilities.cpp +++ b/DDEve/src/Utilities.cpp @@ -12,28 +12,26 @@ //========================================================================== // Framework include files -#include "DD4hep/Objects.h" -#include "DD4hep/DetElement.h" -#include "DD4hep/Volumes.h" -#include "DD4hep/Printout.h" -#include "DDEve/Utilities.h" -#include "DDEve/EventHandler.h" -#include "DDEve/ElementList.h" +#include <DD4hep/Objects.h> +#include <DD4hep/DetElement.h> +#include <DD4hep/Volumes.h> +#include <DD4hep/Printout.h> +#include <DDEve/Utilities.h> +#include <DDEve/EventHandler.h> +#include <DDEve/ElementList.h> -#include "TGeoNode.h" -#include "TGeoShape.h" -#include "TGeoVolume.h" -#include "TGeoManager.h" -#include "TGeoShapeAssembly.h" +#include <TGeoNode.h> +#include <TGeoShape.h> +#include <TGeoVolume.h> +#include <TGeoManager.h> +#include <TGeoShapeAssembly.h> -#include "TEveGeoShape.h" -#include "TEveGeoNode.h" -#include "TEveElement.h" -#include "TEveTrans.h" +#include <TEveGeoShape.h> +#include <TEveGeoNode.h> +#include <TEveElement.h> +#include <TEveTrans.h> using namespace dd4hep; -using namespace dd4hep::detail; -using namespace std; /// Set the rendering flags for the object and the next level children void Utilities::SetRnrChildren(TEveElementList* l, bool b) { @@ -84,7 +82,7 @@ Utilities::createEveShape(int level, TGeoVolume* vol = n ? n->GetVolume() : 0; bool created = false; - if ( 0 == vol || level > max_level ) return make_pair(created,(TEveElement*)0); + if ( 0 == vol || level > max_level ) return std::make_pair(created,(TEveElement*)0); VisAttr vis(Volume(vol).visAttributes()); TGeoShape* geoShape = vol->GetShape(); @@ -154,20 +152,20 @@ Utilities::createEveShape(int level, TGeoHMatrix dau_mat(mat); TGeoMatrix* matrix = daughter->GetMatrix(); dau_mat.Multiply(matrix); - pair<bool,TEveElement*> dau_shape = + std::pair<bool,TEveElement*> dau_shape = createEveShape(level+1, max_level, element, daughter, dau_mat, daughter->GetName()); if ( dau_shape.first ) { element->AddElement(dau_shape.second); } } - return make_pair(created,element); + return std::make_pair(created,element); } -int Utilities::findNodeWithMatrix(TGeoNode* p, TGeoNode* n, TGeoHMatrix* mat, string* sub_path) { +int Utilities::findNodeWithMatrix(TGeoNode* p, TGeoNode* n, TGeoHMatrix* mat, std::string* sub_path) { if ( p == n ) return 1; TGeoHMatrix dau_mat; for (Int_t idau = 0, ndau = p->GetNdaughters(); idau < ndau; ++idau) { - string spath; + std::string spath; TGeoNode* daughter = p->GetDaughter(idau); TGeoHMatrix* daughter_matrix = 0; if ( mat ) { @@ -203,5 +201,5 @@ std::pair<bool,TEveElement*> Utilities::LoadDetElement(DetElement de,int levels, return e; } } - return make_pair(false,(TEveGeoShape*)0); + return std::make_pair(false,(TEveGeoShape*)0); } diff --git a/DDEve/src/View.cpp b/DDEve/src/View.cpp index dd5de569e..8a17f379b 100644 --- a/DDEve/src/View.cpp +++ b/DDEve/src/View.cpp @@ -13,12 +13,12 @@ //========================================================================== // Framework include files -#include "DDEve/View.h" -#include "DDEve/Display.h" -#include "DDEve/ElementList.h" -#include "DDEve/Utilities.h" -#include "DDEve/Annotation.h" -#include "DD4hep/InstanceCount.h" +#include <DDEve/View.h> +#include <DDEve/Display.h> +#include <DDEve/ElementList.h> +#include <DDEve/Utilities.h> +#include <DDEve/Annotation.h> +#include <DD4hep/InstanceCount.h> // Eve include files #include <TEveManager.h> @@ -26,18 +26,17 @@ #include <TEveCalo.h> #include <TGLViewer.h> -using namespace std; using namespace dd4hep; template <typename T> -static inline typename T::const_iterator find(const T& cont,const string& str) { +static inline typename T::const_iterator find(const T& cont,const std::string& str) { for(typename T::const_iterator i=cont.begin(); i!=cont.end(); ++i) if ( (*i).name == str ) return i; return cont.end(); } /// Initializing constructor -View::View(Display* eve, const string& nam) +View::View(Display* eve, const std::string& nam) : m_eve(eve), m_view(0), m_geoScene(0), m_eveScene(0), m_global(0), m_name(nam), m_showGlobal(false) { m_config = m_eve->GetViewConfiguration(m_name); @@ -79,7 +78,7 @@ void View::Initialize() { } /// Add the view to the global list of eve objects -TEveElementList* View::AddToGlobalItems(const string& nam) { +TEveElementList* View::AddToGlobalItems(const std::string& nam) { if ( 0 == m_global ) { m_global = new ElementList(nam.c_str(), nam.c_str(), true, true); if ( m_geoScene ) m_global->AddElement(geoScene()); @@ -119,16 +118,16 @@ TEveElement* View::ImportEventElement(TEveElement* el, TEveElementList* list) { } /// Access the global instance of the subdetector geometry -pair<bool,TEveElement*> +std::pair<bool,TEveElement*> View::GetGlobalGeometry(DetElement de, const DisplayConfiguration::Config& /* cfg */) { SensitiveDetector sd = m_eve->detectorDescription().sensitiveDetector(de.name()); TEveElementList& global = m_eve->GetGeoTopic(sd.isValid() ? "Sensitive" : "Structure"); TEveElement* elt = global.FindChild(de.name()); - return pair<bool,TEveElement*>(true,elt); + return std::pair<bool,TEveElement*>(true,elt); } /// Create a new instance of the geometry of a sub-detector -pair<bool,TEveElement*> +std::pair<bool,TEveElement*> View::CreateGeometry(DetElement de, const DisplayConfiguration::Config& cfg) { SensitiveDetector sd = m_eve->detectorDescription().sensitiveDetector(de.name()); TEveElementList& topic = GetGeoTopic(sd.isValid() ? "Sensitive" : "Structure"); @@ -157,14 +156,14 @@ void View::ConfigureGeometryFromGlobal() { /// Configure a single geometry view void View::ConfigureGeometry(const DisplayConfiguration::ViewConfig& config) { - string dets; + std::string dets; DisplayConfiguration::Configurations::const_iterator ic; float legend_y = Annotation::DefaultTextSize()+Annotation::DefaultMargin(); DetElement world = m_eve->detectorDescription().world(); const DetElement::Children& c = world.children(); for( ic=config.subdetectors.begin(); ic != config.subdetectors.end(); ++ic) { const DisplayConfiguration::Config& cfg = *ic; - string nam = cfg.name; + std::string nam = cfg.name; if ( nam == "global" ) { m_view->AddScene(m_eve->manager().GetGlobalScene()); m_view->AddScene(m_eve->manager().GetEventScene()); @@ -186,7 +185,7 @@ void View::ConfigureGeometry(const DisplayConfiguration::ViewConfig& config) DetElement de = (*i).second; SensitiveDetector sd = m_eve->detectorDescription().sensitiveDetector(nam); TEveElementList& topic = GetGeoTopic(sd.isValid() ? "Sensitive" : "Structure"); - pair<bool,TEveElement*> e(false,0); + std::pair<bool,TEveElement*> e(false,0); if ( cfg.data.defaults.load_geo > 0 ) // Create a new instance e = CreateGeometry(de,cfg); // with the given number of levels else if ( cfg.data.defaults.load_geo < 0 ) // Use the global geometry instance @@ -203,7 +202,7 @@ void View::ConfigureGeometry(const DisplayConfiguration::ViewConfig& config) } /// Call to import geometry topics -void View::ImportGeoTopics(const string& title) { +void View::ImportGeoTopics(const std::string& title) { printout(INFO,"View","+++ %s: Import geometry topics.",c_name()); for(Topics::iterator i=m_geoTopics.begin(); i!=m_geoTopics.end(); ++i) { printout(INFO,"ViewConfiguration","+++ Add topic %s",(*i).second->GetName()); @@ -213,7 +212,7 @@ void View::ImportGeoTopics(const string& title) { } /// Call to import geometry elements by topic -void View::ImportGeo(const string& topic, TEveElement* element) { +void View::ImportGeo(const std::string& topic, TEveElement* element) { ImportGeoElement(element,&GetGeoTopic(topic)); } @@ -248,7 +247,7 @@ void View::ConfigureEvent(const DisplayConfiguration::ViewConfig& config) { DisplayConfiguration::Configurations::const_iterator ic; for( ic=config.subdetectors.begin(); ic != config.subdetectors.end(); ++ic) { const DisplayConfiguration::Config& cfg = *ic; - string nam = cfg.name; + std::string nam = cfg.name; if ( nam == "global" ) { continue; } @@ -293,7 +292,7 @@ void View::ImportEvent(TEveElement* el) { } /// Access/Create a topic by name -TEveElementList& View::GetGeoTopic(const string& nam) { +TEveElementList& View::GetGeoTopic(const std::string& nam) { Topics::iterator i=m_geoTopics.find(nam); if ( i == m_geoTopics.end() ) { TEveElementList* topic = new ElementList(nam.c_str(), nam.c_str(), true, true); @@ -314,8 +313,8 @@ View& View::CreateScenes() { /// Create the event scene View& View::CreateEventScene() { if ( 0 == m_eveScene ) { - string nam = m_name+" - Event Data"; - string tool = m_name+" - Scene holding projected event-data for the view."; + std::string nam = m_name+" - Event Data"; + std::string tool = m_name+" - Scene holding projected event-data for the view."; m_eveScene = m_eve->manager().SpawnNewScene(nam.c_str(), tool.c_str()); } return *this; @@ -324,8 +323,8 @@ View& View::CreateEventScene() { /// Create the geometry scene View& View::CreateGeoScene() { if ( 0 == m_geoScene ) { - string nam = m_name+" - Geometry"; - string tool = m_name+" - Scene holding projected geometry for the view."; + std::string nam = m_name+" - Geometry"; + std::string tool = m_name+" - Scene holding projected geometry for the view."; m_geoScene = m_eve->manager().SpawnNewScene(nam.c_str(), tool.c_str()); } return *this; diff --git a/DDEve/src/View3D.cpp b/DDEve/src/View3D.cpp index 55f16fff7..c278fdad6 100644 --- a/DDEve/src/View3D.cpp +++ b/DDEve/src/View3D.cpp @@ -13,8 +13,8 @@ //========================================================================== // Framework include files -#include "DDEve/View3D.h" -#include "DDEve/Factories.h" +#include <DDEve/View3D.h> +#include <DDEve/Factories.h> using namespace dd4hep; diff --git a/DDEve/src/ViewMenu.cpp b/DDEve/src/ViewMenu.cpp index 3c9b5b66a..9be61b293 100644 --- a/DDEve/src/ViewMenu.cpp +++ b/DDEve/src/ViewMenu.cpp @@ -12,29 +12,29 @@ //========================================================================== // Framework include files -#include "DD4hep/Plugins.h" -#include "DD4hep/Printout.h" -#include "DD4hep/InstanceCount.h" +#include <DD4hep/Plugins.h> +#include <DD4hep/Printout.h> +#include <DD4hep/InstanceCount.h> -#include "DDEve/View.h" -#include "DDEve/ViewMenu.h" -#include "DDEve/PopupMenu.h" +#include <DDEve/View.h> +#include <DDEve/ViewMenu.h> +#include <DDEve/PopupMenu.h> // ROOT include files -#include "TEveBrowser.h" -#include "TEveManager.h" -#include "TEveElement.h" -#include "TEveWindow.h" -#include "TEveViewer.h" -#include "TGLViewer.h" -#include "TGClient.h" -#include "TGTab.h" +#include <TEveBrowser.h> +#include <TEveManager.h> +#include <TEveElement.h> +#include <TEveWindow.h> +#include <TEveViewer.h> +#include <TGLViewer.h> +#include <TGClient.h> +#include <TGTab.h> // Forward declarations class TEveWindowSlot; -using namespace std; using namespace dd4hep; +using pair_t = std::pair<std::string, std::string>; ClassImp(ViewMenu) @@ -52,27 +52,27 @@ ViewMenu::~ViewMenu() { /// Add the menu to the menu bar void ViewMenu::Build(TGMenuBar* menubar, int hints) { - pair<string,string>* p = 0; + pair_t* p = 0; PopupMenu* view_menu = this; - view_menu->AddEntry("3&D View", this, &ViewMenu::CreateView, p=new pair<string,string>("DD4hep_DDEve_View3D","3D")); - view_menu->AddEntry("Rho-&Z Projection", this, &ViewMenu::CreateView, p=new pair<string,string>("DD4hep_DDEve_RhoZProjection","Rho-Z")); - view_menu->AddEntry("Rho-&Phi Projection",this, &ViewMenu::CreateView, p=new pair<string,string>("DD4hep_DDEve_RhoPhiProjection","Rho-Phi")); + view_menu->AddEntry("3&D View", this, &ViewMenu::CreateView, p=new pair_t("DD4hep_DDEve_View3D","3D")); + view_menu->AddEntry("Rho-&Z Projection", this, &ViewMenu::CreateView, p=new pair_t("DD4hep_DDEve_RhoZProjection","Rho-Z")); + view_menu->AddEntry("Rho-&Phi Projection",this, &ViewMenu::CreateView, p=new pair_t("DD4hep_DDEve_RhoPhiProjection","Rho-Phi")); const Display::ViewConfigurations& vc = m_display->viewConfigurations(); for(Display::ViewConfigurations::const_iterator i=vc.begin(); i!=vc.end(); ++i) { const Display::ViewConfig& v = (*i).second; - view_menu->AddEntry(v.name.c_str(), this, &ViewMenu::CreateView,p=new pair<string,string>("DD4hep_DDEve_"+v.type,v.name)); + view_menu->AddEntry(v.name.c_str(), this, &ViewMenu::CreateView,p=new pair_t("DD4hep_DDEve_"+v.type,v.name)); } menubar->AddPopup(m_title.c_str(),*view_menu, new TGLayoutHints(hints, 0, 4, 0, 0)); } /// Create a new generic view void ViewMenu::CreateView(TGMenuEntry*, void* ud) { - pair<string,string>* args = (pair<string,string>*)ud; + pair_t* args = (pair_t*)ud; CreateView(args->first,args->second); } View* ViewMenu::CreateView(const std::string& type, const std::string& title) { - pair<string,string> args("DD4hep_DDEve_"+type,title); + pair_t args("DD4hep_DDEve_"+type,title); View* v = PluginService::Create<View*>(type.c_str(),m_display,title.c_str()); BuildView(v); return v; -- GitLab