diff --git a/Fireworks/Core/src/CmsShowMain.cc b/Fireworks/Core/src/CmsShowMain.cc index 998f188903b70..c31a11fcb78ed 100644 --- a/Fireworks/Core/src/CmsShowMain.cc +++ b/Fireworks/Core/src/CmsShowMain.cc @@ -11,6 +11,8 @@ // // system include files +#include + #include #include #include @@ -561,8 +563,8 @@ void CmsShowMain::appendData() { void CmsShowMain::openDataViaURL() { if (m_searchFiles.get() == nullptr) { - m_searchFiles = std::unique_ptr( - new CmsShowSearchFiles("", "Open Remote Data Files", guiManager()->getMainFrame(), 500, 400)); + m_searchFiles = + std::make_unique("", "Open Remote Data Files", guiManager()->getMainFrame(), 500, 400); m_searchFiles->CenterOnParent(kTRUE, TGTransientFrame::kBottomRight); } std::string chosenFile = m_searchFiles->chooseFileFromURL(); @@ -716,7 +718,7 @@ void CmsShowMain::setLoadedAnyInputFileAfterStartup() { } void CmsShowMain::setupSocket(unsigned int iSocket) { - m_monitor = std::unique_ptr(new TMonitor); + m_monitor = std::make_unique(); TServerSocket* server = new TServerSocket(iSocket, kTRUE); if (server->GetErrorCode()) { fwLog(fwlog::kError) << "CmsShowMain::setupSocket, can't create socket on port " << iSocket << "." << std::endl; @@ -835,7 +837,7 @@ void CmsShowMain::postFiltering(bool doDraw) { void CmsShowMain::setLiveMode() { m_live = true; - m_liveTimer.reset(new SignalTimer()); + m_liveTimer = std::make_unique(); m_liveTimer->timeout_.connect(std::bind(&CmsShowMain::checkLiveMode, this)); Window_t rootw, childw; diff --git a/Fireworks/Core/src/CmsShowMainBase.cc b/Fireworks/Core/src/CmsShowMainBase.cc index 7040c0e66d491..b8eb2eb8b760e 100644 --- a/Fireworks/Core/src/CmsShowMainBase.cc +++ b/Fireworks/Core/src/CmsShowMainBase.cc @@ -6,6 +6,7 @@ #include #include +#include #include "TGLWidget.h" #include "TGMsgBox.h" @@ -205,7 +206,7 @@ void CmsShowMainBase::setup(FWNavigatorBase *navigator, m_colorManager->initialize(); m_contextPtr->initEveElements(); - m_guiManager.reset(new FWGUIManager(m_contextPtr, m_viewManager.get(), m_navigatorPtr)); + m_guiManager = std::make_unique(m_contextPtr, m_viewManager.get(), m_navigatorPtr); m_eiManager->newItem_.connect( std::bind(&FWModelChangeManager::newItemSlot, m_changeManager.get(), std::placeholders::_1)); diff --git a/Fireworks/Core/src/CmsShowSearchFiles.cc b/Fireworks/Core/src/CmsShowSearchFiles.cc index d8ad1aab2116c..d84139cfeeb1b 100644 --- a/Fireworks/Core/src/CmsShowSearchFiles.cc +++ b/Fireworks/Core/src/CmsShowSearchFiles.cc @@ -123,7 +123,7 @@ void CmsShowSearchFiles::prefixChoosen(Int_t iIndex) { void CmsShowSearchFiles::fileEntryChanged(const char* iFileName) { std::string fileName = iFileName; - size_t index = fileName.find_last_of("."); + size_t index = fileName.find_last_of('.'); std::string postfix; if (index != std::string::npos) { postfix = fileName.substr(index, std::string::npos); @@ -149,7 +149,7 @@ void CmsShowSearchFiles::hyperlinkClicked(const char* iLink) { m_webFile->addToVisited(iLink); std::string fileName = iLink; - size_t index = fileName.find_last_of("."); + size_t index = fileName.find_last_of('.'); std::string postfix = fileName.substr(index, std::string::npos); if (postfix != s_rootPostfix) { @@ -175,7 +175,7 @@ void CmsShowSearchFiles::showPrefixes() { int index = 0; for (const char* const(*it)[s_columns] = s_prefixes; it != itEnd; ++it, ++index) { //only add the protocols this version of the code actually can load - std::string prefix = std::string((*it)[0]).substr(0, std::string((*it)[0]).find_first_of(":") + 1); + std::string prefix = std::string((*it)[0]).substr(0, std::string((*it)[0]).find_first_of(':') + 1); if (s_httpPrefix == prefix || s_filePrefix == prefix || (gPluginMgr->FindHandler("TSystem", prefix.c_str()) && gPluginMgr->FindHandler("TSystem", prefix.c_str())->CheckPlugin() != -1)) { @@ -232,7 +232,7 @@ static std::string readRemote(const char* url) { void CmsShowSearchFiles::sendToWebBrowser(std::string& fileName) { // std::cout << "CmsShowSearchFiles::sendToWebBrowser " << fileName << std::endl ; - size_t index = fileName.find_first_of(":"); + size_t index = fileName.find_first_of(':'); if (index != std::string::npos) { ++index; } else { diff --git a/Fireworks/Core/src/FWConfiguration.cc b/Fireworks/Core/src/FWConfiguration.cc index c27518d18f3c3..cc063230454fc 100644 --- a/Fireworks/Core/src/FWConfiguration.cc +++ b/Fireworks/Core/src/FWConfiguration.cc @@ -11,6 +11,8 @@ // // system include files +#include + #include #include #include @@ -58,7 +60,7 @@ FWConfiguration& FWConfiguration::addKeyValue(const std::string& iKey, const FWC throw std::runtime_error("adding key/value to configuration containing string values"); } if (not m_keyValues) { - m_keyValues.reset(new KeyValues(1, std::make_pair(iKey, iConfig))); + m_keyValues = std::make_unique(1, std::make_pair(iKey, iConfig)); } else { m_keyValues->push_back(std::make_pair(iKey, iConfig)); } @@ -73,9 +75,9 @@ FWConfiguration& FWConfiguration::addKeyValue(const std::string& iKey, FWConfigu } if (not m_keyValues) { if (not iDoSwap) { - m_keyValues.reset(new KeyValues(1, std::make_pair(iKey, iConfig))); + m_keyValues = std::make_unique(1, std::make_pair(iKey, iConfig)); } else { - m_keyValues.reset(new KeyValues(1, std::make_pair(iKey, FWConfiguration()))); + m_keyValues = std::make_unique(1, std::make_pair(iKey, FWConfiguration())); m_keyValues->back().second.swap(iConfig); } } else { @@ -94,7 +96,7 @@ FWConfiguration& FWConfiguration::addValue(const std::string& iValue) { throw std::runtime_error("adding string value to configuration containing key/value pairs"); } if (not m_stringValues) { - m_stringValues.reset(new std::vector(1, iValue)); + m_stringValues = std::make_unique>(1, iValue); } else { m_stringValues->push_back(iValue); } diff --git a/Fireworks/Core/src/FWExpressionValidator.cc b/Fireworks/Core/src/FWExpressionValidator.cc index 797b83f795088..f4ace1a3a09dc 100644 --- a/Fireworks/Core/src/FWExpressionValidator.cc +++ b/Fireworks/Core/src/FWExpressionValidator.cc @@ -85,7 +85,7 @@ namespace fireworks { namespace { std::string descriptionFromMember(const edm::FunctionWithDict& iMember) { std::string typeString = iMember.typeName(); - std::string::size_type index = typeString.find_first_of("("); + std::string::size_type index = typeString.find_first_of('('); if (index == std::string::npos) { return iMember.name() + ":" + typeString; } else { diff --git a/Fireworks/Core/src/FWGeometry.cc b/Fireworks/Core/src/FWGeometry.cc index 96733f86ebac4..c61d75fa5d031 100644 --- a/Fireworks/Core/src/FWGeometry.cc +++ b/Fireworks/Core/src/FWGeometry.cc @@ -16,8 +16,10 @@ // AMT deprication of tracker specific DetIds #include "CalibTracker/StandaloneTrackerTopology/interface/StandaloneTrackerTopology.h" -#include #include +#include +#include + #include #include #include @@ -191,8 +193,8 @@ void FWGeometry::loadMap(const char* iFileName) { TNamed* ttopology = static_cast(file->Get("TrackerTopology")); if (ttopology) { std::string xml = ttopology->GetTitle(); - m_trackerTopology = std::unique_ptr( - new TrackerTopology(StandaloneTrackerTopology::fromTrackerParametersXMLString(xml))); + m_trackerTopology = + std::make_unique(StandaloneTrackerTopology::fromTrackerParametersXMLString(xml)); } file->Close(); diff --git a/Fireworks/FWInterface/src/FWPSetCellEditor.cc b/Fireworks/FWInterface/src/FWPSetCellEditor.cc index 8f5b72ffb29e8..77acaf3e12e3a 100644 --- a/Fireworks/FWInterface/src/FWPSetCellEditor.cc +++ b/Fireworks/FWInterface/src/FWPSetCellEditor.cc @@ -81,8 +81,8 @@ bool editVInputTag(edm::ParameterSet &ps, bool tracked, const std::string &label size_t fst, lst; while (getline(iss, vitem, ',')) { - fst = vitem.find("["); - lst = vitem.find("]"); + fst = vitem.find('['); + lst = vitem.find(']'); if (fst != std::string::npos) vitem.erase(fst, 1); @@ -193,8 +193,8 @@ void editVectorParameter(edm::ParameterSet &ps, bool tracked, const std::string size_t fst, lst; while (getline(iss, vitem, ',')) { - fst = vitem.find("["); - lst = vitem.find("]"); + fst = vitem.find('['); + lst = vitem.find(']'); if (fst != std::string::npos) vitem.erase(fst, 1); diff --git a/Fireworks/ParticleFlow/plugins/FWPFCandidateDetailView.cc b/Fireworks/ParticleFlow/plugins/FWPFCandidateDetailView.cc index eda09a916fba9..b62fa29e68cab 100644 --- a/Fireworks/ParticleFlow/plugins/FWPFCandidateDetailView.cc +++ b/Fireworks/ParticleFlow/plugins/FWPFCandidateDetailView.cc @@ -350,6 +350,7 @@ void FWPFCandidateDetailView::addHits(const std::vector* hits) { continue; std::vector hc; + hc.reserve(4); for (int k = 0; k < 4; ++k) { hc.push_back(TEveVector(corners[k].eta(), corners[k].phi(), 0)); // ps->SetNextPoint(corners[k].eta(),corners[k].phi(),0 ); //debug @@ -367,6 +368,7 @@ void FWPFCandidateDetailView::addHits(const std::vector* hits) { centerOfGravity *= 0.25; std::vector radialVectors; + radialVectors.reserve(4); for (int k = 0; k < 4; ++k) radialVectors.push_back(TEveVector(hc[k] - centerOfGravity));