From 08dd65a0fcc3aaf847f2ae0c78dd1becefd174b4 Mon Sep 17 00:00:00 2001
From: Axel Naumann <Axel.Naumann@cern.ch>
Date: Mon, 4 Jun 2012 12:30:41 +0000
Subject: [PATCH] Remove   using namespace std; from Riostream.h, which has
 huge consequences for all of ROOT. Riostream.h is now a simple wrapper for
 fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps
 iosfwd.

Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.

Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.


git-svn-id: http://root.cern.ch/svn/root/trunk@44507 27541ba8-7e3a-0410-8455-c3a389f83636
---
 build/package/msi/makemsi.cxx                 |  66 +-
 cint/tool/makecint.cxx                        |   2 +-
 core/base/inc/LinkDef1.h                      |   4 +-
 core/base/inc/LinkDef2.h                      |  32 +-
 core/base/inc/LinkDef3.h                      |  12 +-
 core/base/inc/RConfig.h                       |  32 +-
 core/base/inc/Riosfwd.h                       |  28 +-
 core/base/inc/TApplication.h                  |   2 +-
 core/base/inc/TAttAxis.h                      |   2 +-
 core/base/inc/TAttFill.h                      |   2 +-
 core/base/inc/TAttLine.h                      |   2 +-
 core/base/inc/TAttMarker.h                    |   2 +-
 core/base/inc/TAttText.h                      |   2 +-
 core/base/inc/TColor.h                        |   2 +-
 core/base/inc/TExec.h                         |   2 +-
 core/base/inc/TMacro.h                        |   2 +-
 core/base/inc/TObject.h                       |   2 +-
 core/base/inc/TParameter.h                    |   4 +-
 core/base/inc/TString.h                       |  14 +-
 core/base/inc/TStyle.h                        |   2 +-
 core/base/inc/TTimeStamp.h                    |   2 +-
 core/base/inc/TVirtualPS.h                    |   4 +-
 core/base/src/Stringio.cxx                    |  30 +-
 core/base/src/TApplication.cxx                |   4 +-
 core/base/src/TAttAxis.cxx                    |  30 +-
 core/base/src/TAttFill.cxx                    |   8 +-
 core/base/src/TAttLine.cxx                    |  10 +-
 core/base/src/TAttMarker.cxx                  |  10 +-
 core/base/src/TAttText.cxx                    |  14 +-
 core/base/src/TColor.cxx                      |  10 +-
 core/base/src/TExec.cxx                       |   6 +-
 core/base/src/TFileCollection.cxx             |   2 +-
 core/base/src/TFolder.cxx                     |   4 +-
 core/base/src/TMacro.cxx                      |  18 +-
 core/base/src/TNamed.cxx                      |   6 +-
 core/base/src/TObject.cxx                     |  26 +-
 core/base/src/TPRegexp.cxx                    |   6 +-
 core/base/src/TQConnection.cxx                |   8 +-
 core/base/src/TQObject.cxx                    |   2 +-
 core/base/src/TROOT.cxx                       |   4 +-
 core/base/src/TString.cxx                     |   6 +-
 core/base/src/TStyle.cxx                      | 366 ++++----
 core/base/src/TSystem.cxx                     |  50 +-
 core/base/src/TTask.cxx                       |   6 +-
 core/base/src/TTimeStamp.cxx                  |   6 +-
 core/cont/inc/LinkDef.h                       |  16 +-
 core/cont/inc/TBits.h                         |   4 +-
 core/cont/inc/TBtree.h                        |  12 +-
 core/cont/inc/TCollectionProxyInfo.h          |   6 +-
 core/cont/src/TBits.cxx                       |   4 +-
 core/cont/src/TBtree.cxx                      |   6 +-
 core/cont/src/TClassTable.cxx                 |   2 +-
 core/cont/src/TCollection.cxx                 |   4 +-
 core/meta/src/TSchemaRule.cxx                 |  32 +-
 core/meta/src/TSchemaRuleSet.cxx              |   2 +-
 core/pcre/src/win32/pcre_stringpiece.h        |   6 +-
 core/rint/inc/TRint.h                         |   2 +-
 core/rint/inc/TTabCom.h                       |   4 +-
 core/rint/src/TRint.cxx                       |   4 +-
 core/rint/src/TTabCom.cxx                     | 200 ++--
 core/unix/src/TUnixSystem.cxx                 |   8 +-
 geom/geom/inc/TGeoArb8.h                      |   6 +-
 geom/geom/inc/TGeoBBox.h                      |   2 +-
 geom/geom/inc/TGeoBoolNode.h                  |   8 +-
 geom/geom/inc/TGeoCompositeShape.h            |   2 +-
 geom/geom/inc/TGeoCone.h                      |   4 +-
 geom/geom/inc/TGeoElement.h                   |   4 +-
 geom/geom/inc/TGeoEltu.h                      |   2 +-
 geom/geom/inc/TGeoHalfSpace.h                 |   2 +-
 geom/geom/inc/TGeoHype.h                      |   2 +-
 geom/geom/inc/TGeoMaterial.h                  |   4 +-
 geom/geom/inc/TGeoMatrix.h                    |  10 +-
 geom/geom/inc/TGeoMedium.h                    |   2 +-
 geom/geom/inc/TGeoNode.h                      |   2 +-
 geom/geom/inc/TGeoPara.h                      |   2 +-
 geom/geom/inc/TGeoParaboloid.h                |   2 +-
 geom/geom/inc/TGeoPatternFinder.h             |  24 +-
 geom/geom/inc/TGeoPcon.h                      |   2 +-
 geom/geom/inc/TGeoPgon.h                      |   2 +-
 geom/geom/inc/TGeoScaledShape.h               |   2 +-
 geom/geom/inc/TGeoShapeAssembly.h             |   2 +-
 geom/geom/inc/TGeoSphere.h                    |   2 +-
 geom/geom/inc/TGeoTorus.h                     |   2 +-
 geom/geom/inc/TGeoTrd1.h                      |   2 +-
 geom/geom/inc/TGeoTrd2.h                      |   2 +-
 geom/geom/inc/TGeoTube.h                      |   6 +-
 geom/geom/inc/TGeoVolume.h                    |   2 +-
 geom/geom/inc/TGeoXtru.h                      |   2 +-
 geom/geom/src/TGeoArb8.cxx                    |  98 +-
 geom/geom/src/TGeoBBox.cxx                    |  20 +-
 geom/geom/src/TGeoBoolNode.cxx                |  20 +-
 geom/geom/src/TGeoCompositeShape.cxx          |   8 +-
 geom/geom/src/TGeoCone.cxx                    |  36 +-
 geom/geom/src/TGeoElement.cxx                 |  58 +-
 geom/geom/src/TGeoEltu.cxx                    |  12 +-
 geom/geom/src/TGeoHalfSpace.cxx               |  18 +-
 geom/geom/src/TGeoHype.cxx                    |  16 +-
 geom/geom/src/TGeoManager.cxx                 |  74 +-
 geom/geom/src/TGeoMaterial.cxx                |  34 +-
 geom/geom/src/TGeoMatrix.cxx                  |  64 +-
 geom/geom/src/TGeoMedium.cxx                  |  24 +-
 geom/geom/src/TGeoNode.cxx                    |  22 +-
 geom/geom/src/TGeoPara.cxx                    |  18 +-
 geom/geom/src/TGeoParaboloid.cxx              |  12 +-
 geom/geom/src/TGeoPatternFinder.cxx           |  24 +-
 geom/geom/src/TGeoPcon.cxx                    |  22 +-
 geom/geom/src/TGeoPgon.cxx                    |  24 +-
 geom/geom/src/TGeoScaledShape.cxx             |  12 +-
 geom/geom/src/TGeoShapeAssembly.cxx           |   2 +-
 geom/geom/src/TGeoSphere.cxx                  |  18 +-
 geom/geom/src/TGeoTorus.cxx                   |  16 +-
 geom/geom/src/TGeoTrd1.cxx                    |  14 +-
 geom/geom/src/TGeoTrd2.cxx                    |  16 +-
 geom/geom/src/TGeoTube.cxx                    |  56 +-
 geom/geom/src/TGeoVolume.cxx                  | 106 +--
 geom/geom/src/TGeoXtru.cxx                    |  28 +-
 graf2d/asimage/inc/TASImage.h                 |   2 +-
 graf2d/asimage/src/TASImage.cxx               |  10 +-
 graf2d/gpad/inc/TButton.h                     |   2 +-
 graf2d/gpad/inc/TCanvas.h                     |   2 +-
 graf2d/gpad/inc/TGroupButton.h                |   2 +-
 graf2d/gpad/inc/TPad.h                        |   2 +-
 graf2d/gpad/inc/TPaveClass.h                  |   2 +-
 graf2d/gpad/inc/TSlider.h                     |   2 +-
 graf2d/gpad/inc/TSliderBox.h                  |   2 +-
 graf2d/gpad/src/TButton.cxx                   |  18 +-
 graf2d/gpad/src/TCanvas.cxx                   |  64 +-
 graf2d/gpad/src/TClassTree.cxx                |   4 +-
 graf2d/gpad/src/TGroupButton.cxx              |  14 +-
 graf2d/gpad/src/TPad.cxx                      |  98 +-
 graf2d/gpad/src/TPaveClass.cxx                |   8 +-
 graf2d/gpad/src/TSlider.cxx                   |  12 +-
 graf2d/gpad/src/TSliderBox.cxx                |   2 +-
 graf2d/graf/inc/TArc.h                        |   2 +-
 graf2d/graf/inc/TArrow.h                      |   2 +-
 graf2d/graf/inc/TAttImage.h                   |   2 +-
 graf2d/graf/inc/TBox.h                        |   2 +-
 graf2d/graf/inc/TCrown.h                      |   2 +-
 graf2d/graf/inc/TCurlyArc.h                   |   2 +-
 graf2d/graf/inc/TCurlyLine.h                  |   2 +-
 graf2d/graf/inc/TCutG.h                       |   2 +-
 graf2d/graf/inc/TDiamond.h                    |   2 +-
 graf2d/graf/inc/TEllipse.h                    |   2 +-
 graf2d/graf/inc/TFrame.h                      |   2 +-
 graf2d/graf/inc/TGaxis.h                      |   2 +-
 graf2d/graf/inc/TLatex.h                      |   2 +-
 graf2d/graf/inc/TLegend.h                     |   2 +-
 graf2d/graf/inc/TLegendEntry.h                |   2 +-
 graf2d/graf/inc/TLine.h                       |   2 +-
 graf2d/graf/inc/TMarker.h                     |   2 +-
 graf2d/graf/inc/TPave.h                       |   2 +-
 graf2d/graf/inc/TPaveLabel.h                  |   2 +-
 graf2d/graf/inc/TPaveStats.h                  |   2 +-
 graf2d/graf/inc/TPaveText.h                   |   4 +-
 graf2d/graf/inc/TPavesText.h                  |   2 +-
 graf2d/graf/inc/TPie.h                        |   2 +-
 graf2d/graf/inc/TPieSlice.h                   |   2 +-
 graf2d/graf/inc/TPolyLine.h                   |   2 +-
 graf2d/graf/inc/TText.h                       |   2 +-
 graf2d/graf/inc/TWbox.h                       |   2 +-
 graf2d/graf/src/TArc.cxx                      |  10 +-
 graf2d/graf/src/TArrow.cxx                    |   8 +-
 graf2d/graf/src/TAttImage.cxx                 |   8 +-
 graf2d/graf/src/TBox.cxx                      |   6 +-
 graf2d/graf/src/TCrown.cxx                    |  10 +-
 graf2d/graf/src/TCurlyArc.cxx                 |   8 +-
 graf2d/graf/src/TCurlyLine.cxx                |   8 +-
 graf2d/graf/src/TCutG.cxx                     |  16 +-
 graf2d/graf/src/TDiamond.cxx                  |   6 +-
 graf2d/graf/src/TEllipse.cxx                  |  10 +-
 graf2d/graf/src/TFrame.cxx                    |   2 +-
 graf2d/graf/src/TGaxis.cxx                    |  44 +-
 graf2d/graf/src/TLatex.cxx                    |  28 +-
 graf2d/graf/src/TLegend.cxx                   |  10 +-
 graf2d/graf/src/TLegendEntry.cxx              |  14 +-
 graf2d/graf/src/TLine.cxx                     |   6 +-
 graf2d/graf/src/TMarker.cxx                   |   6 +-
 graf2d/graf/src/TPave.cxx                     |  12 +-
 graf2d/graf/src/TPaveLabel.cxx                |  12 +-
 graf2d/graf/src/TPaveStats.cxx                |  18 +-
 graf2d/graf/src/TPaveText.cxx                 |  78 +-
 graf2d/graf/src/TPavesText.cxx                |  14 +-
 graf2d/graf/src/TPie.cxx                      |  44 +-
 graf2d/graf/src/TPieSlice.cxx                 |   2 +-
 graf2d/graf/src/TPolyLine.cxx                 |  12 +-
 graf2d/graf/src/TText.cxx                     |   8 +-
 graf2d/graf/src/TWbox.cxx                     |   6 +-
 graf2d/gviz/inc/TGraphEdge.h                  |   4 +-
 graf2d/gviz/inc/TGraphNode.h                  |   4 +-
 graf2d/gviz/inc/TGraphStruct.h                |   2 +-
 graf2d/gviz/src/TGraphEdge.cxx                |   4 +-
 graf2d/gviz/src/TGraphNode.cxx                |   4 +-
 graf2d/gviz/src/TGraphStruct.cxx              |  18 +-
 graf2d/postscript/src/TPDF.cxx                |   6 +-
 graf2d/postscript/src/TPostScript.cxx         |   2 +-
 graf2d/postscript/src/TSVG.cxx                |   2 +-
 graf3d/eve/inc/TEveElement.h                  |   4 +-
 graf3d/eve/inc/TEveLine.h                     |   2 +-
 graf3d/eve/inc/TEvePointSet.h                 |   2 +-
 graf3d/eve/inc/TEveShape.h                    |   2 +-
 graf3d/eve/inc/TEveStraightLineSet.h          |   2 +-
 graf3d/eve/inc/TEveTrack.h                    |   4 +-
 graf3d/eve/inc/TEveTrans.h                    |   2 +-
 graf3d/eve/src/TEveElement.cxx                |   4 +-
 graf3d/eve/src/TEveLine.cxx                   |   2 +-
 graf3d/eve/src/TEveManager.cxx                |   2 +-
 graf3d/eve/src/TEvePointSet.cxx               |   2 +-
 graf3d/eve/src/TEveShape.cxx                  |   2 +-
 graf3d/eve/src/TEveStraightLineSet.cxx        |   2 +-
 graf3d/eve/src/TEveTrack.cxx                  |   4 +-
 graf3d/eve/src/TEveTrans.cxx                  |   4 +-
 graf3d/ftgl/inc/FTCharToGlyphIndexMap.h       |   2 +-
 graf3d/g3d/inc/TAxis3D.h                      |   2 +-
 graf3d/g3d/inc/THelix.h                       |   2 +-
 graf3d/g3d/inc/TMarker3DBox.h                 |   2 +-
 graf3d/g3d/inc/TPolyLine3D.h                  |   2 +-
 graf3d/g3d/inc/TPolyMarker3D.h                |   2 +-
 graf3d/g3d/src/TAxis3D.cxx                    |   2 +-
 graf3d/g3d/src/THelix.cxx                     |  10 +-
 graf3d/g3d/src/TMarker3DBox.cxx               |   8 +-
 graf3d/g3d/src/TNode.cxx                      |  16 +-
 graf3d/g3d/src/TPolyLine3D.cxx                |  12 +-
 graf3d/g3d/src/TPolyMarker3D.cxx              |  14 +-
 graf3d/g3d/src/TXTRU.cxx                      |  20 +-
 graf3d/gl/src/TGLOutput.cxx                   |   4 +-
 gui/fitpanel/src/TFitEditor.cxx               |  24 +-
 gui/ged/inc/TGedMarkerSelect.h                |   2 +-
 gui/ged/inc/TGedPatternSelect.h               |   2 +-
 gui/ged/src/TCurlyArcEditor.cxx               |   2 +-
 gui/ged/src/TCurlyLineEditor.cxx              |   2 +-
 gui/ged/src/TGedMarkerSelect.cxx              |   4 +-
 gui/ged/src/TGedPatternSelect.cxx             |   4 +-
 gui/gui/inc/TG3DLine.h                        |   4 +-
 gui/gui/inc/TGButton.h                        |  10 +-
 gui/gui/inc/TGButtonGroup.h                   |   6 +-
 gui/gui/inc/TGCanvas.h                        |   4 +-
 gui/gui/inc/TGColorSelect.h                   |   2 +-
 gui/gui/inc/TGComboBox.h                      |   6 +-
 gui/gui/inc/TGDockableFrame.h                 |   2 +-
 gui/gui/inc/TGDoubleSlider.h                  |   4 +-
 gui/gui/inc/TGFSComboBox.h                    |   2 +-
 gui/gui/inc/TGFSContainer.h                   |   2 +-
 gui/gui/inc/TGFont.h                          |   2 +-
 gui/gui/inc/TGFrame.h                         |  18 +-
 gui/gui/inc/TGGC.h                            |   2 +-
 gui/gui/inc/TGIcon.h                          |   2 +-
 gui/gui/inc/TGLabel.h                         |   2 +-
 gui/gui/inc/TGLayout.h                        |  18 +-
 gui/gui/inc/TGListBox.h                       |   4 +-
 gui/gui/inc/TGListTree.h                      |   8 +-
 gui/gui/inc/TGListView.h                      |   4 +-
 gui/gui/inc/TGMdiFrame.h                      |   2 +-
 gui/gui/inc/TGMdiMainFrame.h                  |   2 +-
 gui/gui/inc/TGMdiMenu.h                       |   2 +-
 gui/gui/inc/TGMenu.h                          |   6 +-
 gui/gui/inc/TGNumberEntry.h                   |   4 +-
 gui/gui/inc/TGProgressBar.h                   |   6 +-
 gui/gui/inc/TGScrollBar.h                     |   4 +-
 gui/gui/inc/TGShapedFrame.h                   |   2 +-
 gui/gui/inc/TGShutter.h                       |   4 +-
 gui/gui/inc/TGSlider.h                        |   4 +-
 gui/gui/inc/TGSplitFrame.h                    |   2 +-
 gui/gui/inc/TGSplitter.h                      |   6 +-
 gui/gui/inc/TGStatusBar.h                     |   2 +-
 gui/gui/inc/TGTab.h                           |   4 +-
 gui/gui/inc/TGTableLayout.h                   |   4 +-
 gui/gui/inc/TGTextEdit.h                      |   2 +-
 gui/gui/inc/TGTextEntry.h                     |   2 +-
 gui/gui/inc/TGTextView.h                      |   2 +-
 gui/gui/inc/TGToolBar.h                       |   2 +-
 gui/gui/inc/TGTripleSlider.h                  |   4 +-
 gui/gui/inc/TGXYLayout.h                      |   4 +-
 gui/gui/inc/TRootEmbeddedCanvas.h             |   2 +-
 gui/gui/src/TG3DLine.cxx                      |  20 +-
 gui/gui/src/TGButton.cxx                      |  90 +-
 gui/gui/src/TGButtonGroup.cxx                 |  90 +-
 gui/gui/src/TGCanvas.cxx                      |  42 +-
 gui/gui/src/TGColorSelect.cxx                 |  16 +-
 gui/gui/src/TGComboBox.cxx                    |  42 +-
 gui/gui/src/TGDockableFrame.cxx               |  36 +-
 gui/gui/src/TGDoubleSlider.cxx                |  36 +-
 gui/gui/src/TGFSComboBox.cxx                  |  16 +-
 gui/gui/src/TGFSContainer.cxx                 |  20 +-
 gui/gui/src/TGFont.cxx                        |  10 +-
 gui/gui/src/TGFrame.cxx                       | 328 +++----
 gui/gui/src/TGGC.cxx                          |  66 +-
 gui/gui/src/TGIcon.cxx                        |  12 +-
 gui/gui/src/TGLabel.cxx                       |  22 +-
 gui/gui/src/TGLayout.cxx                      |  68 +-
 gui/gui/src/TGListBox.cxx                     |  20 +-
 gui/gui/src/TGListTree.cxx                    |  58 +-
 gui/gui/src/TGListView.cxx                    |  36 +-
 gui/gui/src/TGMdiFrame.cxx                    |  22 +-
 gui/gui/src/TGMdiMainFrame.cxx                |  22 +-
 gui/gui/src/TGMdiMenu.cxx                     |  14 +-
 gui/gui/src/TGMenu.cxx                        |  44 +-
 gui/gui/src/TGNumberEntry.cxx                 |  42 +-
 gui/gui/src/TGProgressBar.cxx                 |  36 +-
 gui/gui/src/TGScrollBar.cxx                   |  28 +-
 gui/gui/src/TGShapedFrame.cxx                 |  14 +-
 gui/gui/src/TGShutter.cxx                     |  32 +-
 gui/gui/src/TGSlider.cxx                      |  36 +-
 gui/gui/src/TGSplitFrame.cxx                  |  14 +-
 gui/gui/src/TGSplitter.cxx                    |  42 +-
 gui/gui/src/TGStatusBar.cxx                   |  24 +-
 gui/gui/src/TGTab.cxx                         |  44 +-
 gui/gui/src/TGTable.cxx                       |   8 +-
 gui/gui/src/TGTableLayout.cxx                 |   4 +-
 gui/gui/src/TGTextEdit.cxx                    |  14 +-
 gui/gui/src/TGTextEntry.cxx                   |  32 +-
 gui/gui/src/TGTextView.cxx                    |  10 +-
 gui/gui/src/TGToolBar.cxx                     |  44 +-
 gui/gui/src/TGTripleSlider.cxx                |  40 +-
 gui/gui/src/TGWindow.cxx                      |   6 +-
 gui/gui/src/TGXYLayout.cxx                    |   4 +-
 gui/gui/src/TRootCanvas.cxx                   |  12 +-
 gui/gui/src/TRootEmbeddedCanvas.cxx           |  18 +-
 gui/guihtml/inc/TGHtml.h                      |   2 +-
 gui/guihtml/src/TGHtml.cxx                    |  34 +-
 gui/qtgsi/src/TQCanvasMenu.cxx                |   4 +-
 gui/qtgsi/src/TQRootCanvas.cxx                |   4 +-
 gui/recorder/inc/TRecorder.h                  |   2 +-
 gui/recorder/src/TRecorder.cxx                |  42 +-
 hist/hist/inc/TAxis.h                         |   2 +-
 hist/hist/inc/TEfficiency.h                   |   2 +-
 hist/hist/inc/TF1.h                           |   2 +-
 hist/hist/inc/TF12.h                          |   2 +-
 hist/hist/inc/TF2.h                           |   2 +-
 hist/hist/inc/TF3.h                           |   2 +-
 hist/hist/inc/TGraph.h                        |   2 +-
 hist/hist/inc/TGraph2D.h                      |   2 +-
 hist/hist/inc/TGraphAsymmErrors.h             |   2 +-
 hist/hist/inc/TGraphBentErrors.h              |   2 +-
 hist/hist/inc/TGraphErrors.h                  |   2 +-
 hist/hist/inc/TH1.h                           |   4 +-
 hist/hist/inc/TH1K.h                          |   2 +-
 hist/hist/inc/TH2Poly.h                       |   2 +-
 hist/hist/inc/THStack.h                       |   2 +-
 hist/hist/inc/TMultiGraph.h                   |   2 +-
 hist/hist/inc/TPolyMarker.h                   |   2 +-
 hist/hist/inc/TProfile.h                      |   2 +-
 hist/hist/inc/TProfile2D.h                    |   2 +-
 hist/hist/inc/TProfile3D.h                    |   2 +-
 hist/hist/inc/TSpline.h                       |   4 +-
 hist/hist/src/HFitInterface.cxx               |  18 +-
 hist/hist/src/TAxis.cxx                       |  28 +-
 hist/hist/src/TConfidenceLevel.cxx            |   2 +-
 hist/hist/src/TEfficiency.cxx                 |   2 +-
 hist/hist/src/TF1.cxx                         |  64 +-
 hist/hist/src/TF12.cxx                        |   2 +-
 hist/hist/src/TF2.cxx                         |  42 +-
 hist/hist/src/TF3.cxx                         |  28 +-
 hist/hist/src/TFractionFitter.cxx             |   2 +-
 hist/hist/src/TGraph.cxx                      |  32 +-
 hist/hist/src/TGraph2D.cxx                    |  22 +-
 hist/hist/src/TGraphAsymmErrors.cxx           |  28 +-
 hist/hist/src/TGraphBentErrors.cxx            |  26 +-
 hist/hist/src/TGraphErrors.cxx                |  30 +-
 hist/hist/src/TGraphSmooth.cxx                |   8 +-
 hist/hist/src/TH1.cxx                         |  50 +-
 hist/hist/src/TH1K.cxx                        |  22 +-
 hist/hist/src/TH2Poly.cxx                     |  12 +-
 hist/hist/src/THStack.cxx                     |  26 +-
 hist/hist/src/THnSparse.cxx                   |   6 +-
 hist/hist/src/TLimit.cxx                      |  18 +-
 hist/hist/src/TMultiDimFit.cxx                | 398 ++++----
 hist/hist/src/TMultiGraph.cxx                 |  14 +-
 hist/hist/src/TPolyMarker.cxx                 |  12 +-
 hist/hist/src/TPrincipal.cxx                  | 180 ++--
 hist/hist/src/TProfile.cxx                    |  14 +-
 hist/hist/src/TProfile2D.cxx                  |  12 +-
 hist/hist/src/TProfile3D.cxx                  |  12 +-
 hist/hist/src/TSpline.cxx                     |  36 +-
 hist/histpainter/inc/TPaletteAxis.h           |   2 +-
 hist/histpainter/src/TPaletteAxis.cxx         |  20 +-
 html/src/TClassDocOutput.cxx                  | 336 +++----
 html/src/TDocOutput.cxx                       | 242 ++---
 html/src/TDocParser.cxx                       |   8 +-
 html/src/THtml.cxx                            |   4 +-
 io/io/src/TDirectoryFile.cxx                  |   2 +-
 io/io/src/TEmulatedCollectionProxy.cxx        |   6 +-
 io/io/src/TFile.cxx                           |   7 +-
 io/io/src/TFree.cxx                           |   2 +-
 io/io/src/TGenCollectionProxy.cxx             |   4 +-
 io/io/src/TKey.cxx                            |  14 +-
 io/sql/src/TBufferSQL2.cxx                    |  44 +-
 io/sql/src/TSQLFile.cxx                       |   8 +-
 io/sql/src/TSQLStructure.cxx                  |  52 +-
 io/xml/inc/TXMLPlayer.h                       |   8 +-
 io/xml/src/TXMLPlayer.cxx                     | 262 +++---
 io/xml/src/TXMLSetup.cxx                      |  12 +-
 main/src/hadd.cxx                             |  62 +-
 math/foam/src/TFoam.cxx                       | 132 +--
 math/foam/src/TFoamCell.cxx                   |  28 +-
 math/foam/src/TFoamMaxwt.cxx                  |  14 +-
 math/foam/src/TFoamVect.cxx                   |  18 +-
 math/fumili/src/TFumili.cxx                   |   8 +-
 math/genetic/test/GAMinTutorial.cxx           |  22 +-
 math/genetic/test/testGAMinimizer.cxx         |  10 +-
 math/genetic/test/timeGA.cxx                  |   8 +-
 math/genvector/inc/Math/LinkDef_GenVector2.h  |  12 +-
 math/genvector/test/TrackLinkDef.h            |   4 +-
 math/mathcore/inc/Fit/SparseData.h            |   2 +-
 math/mathcore/inc/LinkDef1.h                  |   4 +-
 math/mathcore/inc/LinkDef2.h                  |  18 +-
 math/mathcore/inc/LinkDef3.h                  |   2 +-
 math/mathcore/inc/Math/Error.h                |   4 +-
 math/mathcore/inc/TComplex.h                  |   4 +-
 math/mathcore/src/GenAlgoOptions.cxx          |   2 +-
 math/mathcore/src/TComplex.cxx                |   4 +-
 math/mathcore/src/TMath.cxx                   |   4 +-
 math/mathcore/test/stressTMath.cxx            |  54 +-
 math/mathcore/test/testSampleQuantiles.cxx    |  26 +-
 math/mathcore/test/testSpecFuncSiCi.cxx       |  24 +-
 math/mathmore/inc/Math/GSLSimAnnealing.h      |   2 +-
 math/mathmore/src/GSLSimAnnealing.cxx         |   2 +-
 math/mathmore/test/simanTSP.cxx               |   8 +-
 .../mathmore/test/testIntegrationMultiDim.cxx |   8 +-
 math/mathmore/test/testInterpolation.cxx      |   8 +-
 math/mathmore/test/testRandom.cxx             |   2 +-
 math/minuit2/inc/LinkDef.h                    |   2 +-
 math/minuit2/inc/Minuit2/MnPrint.h            |   2 +-
 math/minuit2/inc/Minuit2/StackAllocator.h     |  14 +-
 math/mlp/src/TMLPAnalyzer.cxx                 |   8 +-
 math/mlp/src/TMultiLayerPerceptron.cxx        | 248 ++---
 math/physics/src/TFeldmanCousins.cxx          |   2 +-
 math/physics/src/TRolke.cxx                   |  34 +-
 math/quadp/src/TGondzioSolver.cxx             |  32 +-
 math/quadp/src/TMehrotraSolver.cxx            |  18 +-
 math/quadp/src/TQpVar.cxx                     |  14 +-
 math/smatrix/test/testSMatrix.cxx             | 124 +--
 math/unuran/test/unuranDistr.cxx              |  24 +-
 math/unuran/test/unuranMulti2D.cxx            |   8 +-
 math/unuran/test/unuranMultiDim.cxx           |  14 +-
 math/unuran/test/unuranSimple.cxx             |  68 +-
 misc/memstat/src/TMemStatMng.cxx              |   8 +-
 misc/table/inc/LinkDef.h                      |   2 +-
 misc/table/inc/TChair.h                       |   6 +-
 misc/table/inc/TTable.h                       |   6 +-
 misc/table/inc/TVolumePosition.h              |   4 +-
 misc/table/inc/TVolumeView.h                  |   2 +-
 misc/table/src/TDataSet.cxx                   |   6 +-
 misc/table/src/TDataSetIter.cxx               |  12 +-
 misc/table/src/TPoints3D.cxx                  |   8 +-
 misc/table/src/TPointsArray3D.cxx             |   4 +-
 misc/table/src/TTable.cxx                     | 158 ++--
 misc/table/src/TVolume.cxx                    |   2 +-
 misc/table/src/TVolumePosition.cxx            |  24 +-
 misc/table/src/TVolumeView.cxx                |  20 +-
 montecarlo/vmc/src/TMCVerbose.cxx             |  76 +-
 net/alien/src/TAlienJDL.cxx                   |   2 +-
 net/alien/src/TAlienResult.cxx                |  10 +-
 net/auth/src/TAuthenticate.cxx                |   6 +-
 net/bonjour/src/TBonjourRecord.cxx            |   4 +-
 net/glite/src/TGLiteResult.cxx                |  14 +-
 net/ldap/src/TLDAPAttribute.cxx               |   4 +-
 net/ldap/src/TLDAPEntry.cxx                   |   4 +-
 net/monalisa/src/TMonaLisaWriter.cxx          |  14 +-
 net/net/src/TApplicationServer.cxx            |   4 +-
 net/net/src/TSQLColumnInfo.cxx                |  36 +-
 net/net/src/TSQLServer.cxx                    |   2 +-
 net/net/src/TSQLStatement.cxx                 |   6 +-
 net/net/src/TSQLTableInfo.cxx                 |  12 +-
 net/rpdutils/src/rpdutils.cxx                 |   6 +-
 proof/clarens/src/TClProxy.cxx                |   4 +-
 proof/clarens/src/TClSession.cxx              |   6 +-
 proof/clarens/src/TEcho.cxx                   |   4 +-
 proof/clarens/src/TGM.cxx                     |   4 +-
 proof/clarens/src/TLM.cxx                     |   4 +-
 proof/proof/src/TCondor.cxx                   |   8 +-
 proof/proof/src/TDataSetManager.cxx           |   2 +-
 proof/proof/src/TProof.cxx                    |   6 +-
 proof/proof/src/TProofMgr.cxx                 |   4 +-
 proof/proof/src/TProofMgrLite.cxx             |   2 +-
 proof/proof/src/TProofResourcesStatic.cxx     |   2 +-
 proof/proof/src/TProofServ.cxx                |   4 +-
 proof/proof/src/TProofServLite.cxx            |   4 +-
 proof/proofd/inc/XrdProofdTrace.h             |  16 +-
 proof/proofd/src/XrdProofdNetMgr.cxx          |  10 +-
 proof/proofplayer/src/TPacketizer.cxx         |   8 +-
 proof/proofx/src/TXProofServ.cxx              |   4 +-
 proof/proofx/src/TXSocket.cxx                 |   6 +-
 .../inc/RooStats/HistFactory/ParamHistFunc.h  |   4 +-
 .../HistFactory/PiecewiseInterpolation.h      |   4 +-
 .../inc/RooStats/HistFactory/Sample.h         |   2 +-
 roofit/histfactory/src/Channel.cxx            |   7 +-
 roofit/histfactory/src/FlexibleInterpVar.cxx  |   2 +
 roofit/histfactory/src/LinInterpVar.cxx       |   2 +
 roofit/histfactory/src/Measurement.cxx        |   2 +
 roofit/histfactory/src/ParamHistFunc.cxx      |   2 +
 .../src/PiecewiseInterpolation.cxx            |   2 +
 roofit/roofit/inc/Roo2DKeysPdf.h              |   2 +-
 roofit/roofit/inc/RooCFunction1Binding.h      |  10 +-
 roofit/roofit/inc/RooCFunction2Binding.h      |  10 +-
 roofit/roofit/inc/RooCFunction3Binding.h      |  10 +-
 roofit/roofit/inc/RooCFunction4Binding.h      |  10 +-
 roofit/roofit/inc/RooFunctor1DBinding.h       |   4 +-
 roofit/roofit/inc/RooFunctorBinding.h         |   4 +-
 roofit/roofit/inc/RooTFnBinding.h             |   2 +-
 roofit/roofit/inc/RooTFnPdfBinding.h          |   2 +-
 .../roofit/src/Roo1DMomentMorphFunction.cxx   |   2 +
 .../roofit/src/Roo2DMomentMorphFunction.cxx   |   2 +
 roofit/roofit/src/RooArgusBG.cxx              |   2 +
 roofit/roofit/src/RooBCPEffDecay.cxx          |   2 +
 roofit/roofit/src/RooBCPGenDecay.cxx          |   2 +
 roofit/roofit/src/RooBDecay.cxx               |   2 +
 roofit/roofit/src/RooBMixDecay.cxx            |   2 +
 roofit/roofit/src/RooBernstein.cxx            |   2 +
 roofit/roofit/src/RooBifurGauss.cxx           |   2 +
 roofit/roofit/src/RooBlindTools.cxx           |   2 +
 roofit/roofit/src/RooBreitWigner.cxx          |   2 +
 roofit/roofit/src/RooBukinPdf.cxx             |   2 +
 roofit/roofit/src/RooCBShape.cxx              |   2 +
 roofit/roofit/src/RooChebychev.cxx            |   2 +
 roofit/roofit/src/RooChi2MCSModule.cxx        |   2 +
 roofit/roofit/src/RooChiSquarePdf.cxx         |   2 +
 roofit/roofit/src/RooDecay.cxx                |   2 +
 roofit/roofit/src/RooDstD0BG.cxx              |   2 +
 roofit/roofit/src/RooExponential.cxx          |   2 +
 roofit/roofit/src/RooGExpModel.cxx            |   2 +
 roofit/roofit/src/RooGamma.cxx                |   2 +
 roofit/roofit/src/RooGaussModel.cxx           |   2 +
 roofit/roofit/src/RooGaussian.cxx             |   2 +
 roofit/roofit/src/RooHistConstraint.cxx       |   2 +
 roofit/roofit/src/RooIntegralMorph.cxx        |   2 +
 roofit/roofit/src/RooJeffreysPrior.cxx        |   2 +
 roofit/roofit/src/RooKeysPdf.cxx              |   2 +
 roofit/roofit/src/RooLandau.cxx               |   2 +
 roofit/roofit/src/RooLegendre.cxx             |   2 +
 roofit/roofit/src/RooLognormal.cxx            |   2 +
 roofit/roofit/src/RooMomentMorph.cxx          |   2 +
 roofit/roofit/src/RooNonCPEigenDecay.cxx      |   2 +
 roofit/roofit/src/RooNonCentralChiSquare.cxx  |   2 +
 roofit/roofit/src/RooNovosibirsk.cxx          |   2 +
 roofit/roofit/src/RooParamHistFunc.cxx        |   2 +
 .../roofit/src/RooParametricStepFunction.cxx  |   2 +
 roofit/roofit/src/RooPoisson.cxx              |   2 +
 roofit/roofit/src/RooPolynomial.cxx           |   2 +
 roofit/roofit/src/RooSpHarmonic.cxx           |   2 +
 roofit/roofit/src/RooStepFunction.cxx         |   2 +
 roofit/roofit/src/RooTFnBinding.cxx           |   2 +
 roofit/roofit/src/RooTFnPdfBinding.cxx        |   2 +
 roofit/roofit/src/RooUnblindCPAsymVar.cxx     |   2 +
 roofit/roofit/src/RooUnblindOffset.cxx        |   2 +
 roofit/roofit/src/RooUnblindPrecision.cxx     |   2 +
 roofit/roofit/src/RooUnblindUniform.cxx       |   2 +
 roofit/roofit/src/RooUniform.cxx              |   2 +
 roofit/roofit/src/RooVoigtian.cxx             |   2 +
 roofit/roofitcore/inc/LinkDef3.h              |  20 +-
 roofit/roofitcore/inc/Roo1DTable.h            |  10 +-
 roofit/roofitcore/inc/RooAbsAnaConvPdf.h      |   2 +-
 roofit/roofitcore/inc/RooAbsArg.h             |  40 +-
 roofit/roofitcore/inc/RooAbsBinning.h         |  10 +-
 roofit/roofitcore/inc/RooAbsCache.h           |   2 +-
 roofit/roofitcore/inc/RooAbsCategory.h        |   8 +-
 roofit/roofitcore/inc/RooAbsCategoryLValue.h  |   4 +-
 roofit/roofitcore/inc/RooAbsCollection.h      |  12 +-
 roofit/roofitcore/inc/RooAbsData.h            |   8 +-
 roofit/roofitcore/inc/RooAbsDataStore.h       |  12 +-
 roofit/roofitcore/inc/RooAbsGenContext.h      |  10 +-
 roofit/roofitcore/inc/RooAbsHiddenReal.h      |   6 +-
 roofit/roofitcore/inc/RooAbsNumGenerator.h    |   8 +-
 .../roofitcore/inc/RooAbsOptTestStatistic.h   |   2 +-
 roofit/roofitcore/inc/RooAbsPdf.h             |   4 +-
 roofit/roofitcore/inc/RooAbsProxy.h           |   2 +-
 roofit/roofitcore/inc/RooAbsReal.h            |  12 +-
 roofit/roofitcore/inc/RooAbsRealLValue.h      |   6 +-
 roofit/roofitcore/inc/RooAbsString.h          |   6 +-
 roofit/roofitcore/inc/RooAbsTestStatistic.h   |   2 +-
 roofit/roofitcore/inc/RooAddGenContext.h      |   2 +-
 roofit/roofitcore/inc/RooAddModel.h           |   2 +-
 roofit/roofitcore/inc/RooAddPdf.h             |   2 +-
 roofit/roofitcore/inc/RooAddition.h           |   2 +-
 roofit/roofitcore/inc/RooArgList.h            |   4 +-
 roofit/roofitcore/inc/RooArgProxy.h           |   2 +-
 roofit/roofitcore/inc/RooArgSet.h             |   6 +-
 roofit/roofitcore/inc/RooBinnedGenContext.h   |   2 +-
 roofit/roofitcore/inc/RooBinningCategory.h    |   2 +-
 roofit/roofitcore/inc/RooCacheManager.h       |   2 +-
 roofit/roofitcore/inc/RooCatType.h            |   8 +-
 roofit/roofitcore/inc/RooCategory.h           |   4 +-
 roofit/roofitcore/inc/RooComplex.h            |   2 +-
 roofit/roofitcore/inc/RooConstVar.h           |   2 +-
 roofit/roofitcore/inc/RooConvGenContext.h     |   2 +-
 roofit/roofitcore/inc/RooCurve.h              |   8 +-
 roofit/roofitcore/inc/RooCustomizer.h         |  10 +-
 roofit/roofitcore/inc/RooDataHist.h           |   6 +-
 roofit/roofitcore/inc/RooDataSet.h            |   6 +-
 roofit/roofitcore/inc/RooEllipse.h            |   8 +-
 roofit/roofitcore/inc/RooErrorVar.h           |   4 +-
 roofit/roofitcore/inc/RooFFTConvPdf.h         |   2 +-
 roofit/roofitcore/inc/RooFitResult.h          |  12 +-
 roofit/roofitcore/inc/RooFormula.h            |  12 +-
 roofit/roofitcore/inc/RooFormulaVar.h         |   8 +-
 roofit/roofitcore/inc/RooGenCategory.h        |   6 +-
 roofit/roofitcore/inc/RooGenContext.h         |   2 +-
 roofit/roofitcore/inc/RooGenericPdf.h         |   8 +-
 roofit/roofitcore/inc/RooGlobalFunc.h         |   2 +-
 roofit/roofitcore/inc/RooGrid.h               |   8 +-
 roofit/roofitcore/inc/RooHist.h               |   8 +-
 roofit/roofitcore/inc/RooLinearVar.h          |   4 +-
 roofit/roofitcore/inc/RooListProxy.h          |   2 +-
 roofit/roofitcore/inc/RooMappedCategory.h     |   8 +-
 roofit/roofitcore/inc/RooMinimizer.h          |   2 +-
 roofit/roofitcore/inc/RooMinimizerFcn.h       |   4 +-
 roofit/roofitcore/inc/RooMinuit.h             |   4 +-
 roofit/roofitcore/inc/RooMsgService.h         |   6 +-
 roofit/roofitcore/inc/RooMultiCategory.h      |   6 +-
 roofit/roofitcore/inc/RooNameSet.h            |   8 +-
 roofit/roofitcore/inc/RooNumConvPdf.h         |   2 +-
 roofit/roofitcore/inc/RooNumConvolution.h     |   2 +-
 roofit/roofitcore/inc/RooNumGenConfig.h       |   2 +-
 roofit/roofitcore/inc/RooNumIntConfig.h       |   2 +-
 roofit/roofitcore/inc/RooParamBinning.h       |   2 +-
 roofit/roofitcore/inc/RooPlot.h               |  12 +-
 roofit/roofitcore/inc/RooPlotable.h           |   2 +-
 roofit/roofitcore/inc/RooPrintable.h          |  24 +-
 roofit/roofitcore/inc/RooProdGenContext.h     |   2 +-
 roofit/roofitcore/inc/RooProdPdf.h            |   2 +-
 roofit/roofitcore/inc/RooProduct.h            |   2 +-
 roofit/roofitcore/inc/RooProjectedPdf.h       |   2 +-
 roofit/roofitcore/inc/RooRealIntegral.h       |   4 +-
 roofit/roofitcore/inc/RooRealSumPdf.h         |   2 +-
 roofit/roofitcore/inc/RooRealVar.h            |  10 +-
 roofit/roofitcore/inc/RooResolutionModel.h    |   2 +-
 roofit/roofitcore/inc/RooSetProxy.h           |   2 +-
 roofit/roofitcore/inc/RooSimGenContext.h      |   2 +-
 roofit/roofitcore/inc/RooSimSplitGenContext.h |   2 +-
 roofit/roofitcore/inc/RooSimWSTool.h          |   4 +-
 roofit/roofitcore/inc/RooStreamParser.h       |   8 +-
 roofit/roofitcore/inc/RooStringVar.h          |   4 +-
 roofit/roofitcore/inc/RooSuperCategory.h      |   6 +-
 roofit/roofitcore/inc/RooThresholdCategory.h  |   4 +-
 roofit/roofitcore/inc/RooTrace.h              |   2 +-
 roofit/roofitcore/inc/RooVectorDataStore.h    |   4 +-
 roofit/roofitcore/src/RooAICRegistry.cxx      |   2 +
 roofit/roofitcore/src/RooAbsAnaConvPdf.cxx    |   2 +
 roofit/roofitcore/src/RooAbsBinning.cxx       |   2 +
 roofit/roofitcore/src/RooAbsCache.cxx         |   2 +
 roofit/roofitcore/src/RooAbsCacheElement.cxx  |   2 +
 roofit/roofitcore/src/RooAbsCategory.cxx      |   2 +
 .../roofitcore/src/RooAbsCategoryLValue.cxx   |   2 +
 roofit/roofitcore/src/RooAbsData.cxx          |   2 +
 roofit/roofitcore/src/RooAbsFunc.cxx          |   2 +
 roofit/roofitcore/src/RooAbsGenContext.cxx    |   2 +
 roofit/roofitcore/src/RooAbsHiddenReal.cxx    |   2 +
 roofit/roofitcore/src/RooAbsIntegrator.cxx    |   2 +
 roofit/roofitcore/src/RooAbsLValue.cxx        |   2 +
 roofit/roofitcore/src/RooAbsMCStudyModule.cxx |   2 +
 roofit/roofitcore/src/RooAbsNumGenerator.cxx  |   2 +
 .../roofitcore/src/RooAbsOptTestStatistic.cxx |   2 +
 roofit/roofitcore/src/RooAbsPdf.cxx           |   2 +
 roofit/roofitcore/src/RooAbsProxy.cxx         |   2 +
 roofit/roofitcore/src/RooAbsRealLValue.cxx    |   2 +
 roofit/roofitcore/src/RooAbsRootFinder.cxx    |   2 +
 roofit/roofitcore/src/RooAbsString.cxx        |   2 +
 roofit/roofitcore/src/RooAbsTestStatistic.cxx |   2 +
 roofit/roofitcore/src/RooAcceptReject.cxx     |   2 +
 .../src/RooAdaptiveIntegratorND.cxx           |   2 +
 roofit/roofitcore/src/RooAddGenContext.cxx    |   2 +
 roofit/roofitcore/src/RooAddModel.cxx         |   2 +
 roofit/roofitcore/src/RooAddPdf.cxx           |   2 +
 roofit/roofitcore/src/RooArgList.cxx          |   2 +
 roofit/roofitcore/src/RooBanner.cxx           |   3 +-
 roofit/roofitcore/src/RooBinIntegrator.cxx    |   2 +
 roofit/roofitcore/src/RooBinnedGenContext.cxx |   2 +
 roofit/roofitcore/src/RooBinning.cxx          |   2 +
 roofit/roofitcore/src/RooBinningCategory.cxx  |   2 +
 roofit/roofitcore/src/RooBrentRootFinder.cxx  |   2 +
 roofit/roofitcore/src/RooCachedPdf.cxx        |   2 +
 roofit/roofitcore/src/RooCachedReal.cxx       |   2 +
 roofit/roofitcore/src/RooCatType.cxx          |   2 +
 roofit/roofitcore/src/RooCategory.cxx         |   2 +
 roofit/roofitcore/src/RooCategoryProxy.cxx    |   2 +
 roofit/roofitcore/src/RooChi2Var.cxx          |   2 +
 roofit/roofitcore/src/RooCmdArg.cxx           |   2 +
 roofit/roofitcore/src/RooCmdConfig.cxx        |   2 +
 roofit/roofitcore/src/RooComplex.cxx          |   2 +
 roofit/roofitcore/src/RooConstVar.cxx         |   2 +
 roofit/roofitcore/src/RooConstraintSum.cxx    |   2 +
 roofit/roofitcore/src/RooConvCoefVar.cxx      |   2 +
 roofit/roofitcore/src/RooConvGenContext.cxx   |   2 +
 .../src/RooConvIntegrandBinding.cxx           |   2 +
 roofit/roofitcore/src/RooCustomizer.cxx       |   2 +
 .../src/RooDLLSignificanceMCSModule.cxx       |   2 +
 .../roofitcore/src/RooDataHistSliceIter.cxx   |   2 +
 roofit/roofitcore/src/RooDataProjBinding.cxx  |   2 +
 roofit/roofitcore/src/RooDataSet.cxx          |   2 +
 .../roofitcore/src/RooDataWeightedAverage.cxx |   2 +
 roofit/roofitcore/src/RooDerivative.cxx       |   2 +
 roofit/roofitcore/src/RooDirItem.cxx          |   2 +
 roofit/roofitcore/src/RooDouble.cxx           |   2 +
 roofit/roofitcore/src/RooEffGenContext.cxx    |   2 +
 roofit/roofitcore/src/RooEffProd.cxx          |   2 +
 roofit/roofitcore/src/RooEfficiency.cxx       |   2 +
 roofit/roofitcore/src/RooEllipse.cxx          |   2 +
 roofit/roofitcore/src/RooErrorVar.cxx         |   2 +
 roofit/roofitcore/src/RooExtendPdf.cxx        |   2 +
 roofit/roofitcore/src/RooExtendedTerm.cxx     |   2 +
 roofit/roofitcore/src/RooFitResult.cxx        |   2 +
 roofit/roofitcore/src/RooFoamGenerator.cxx    |   2 +
 roofit/roofitcore/src/RooFormula.cxx          |   2 +
 roofit/roofitcore/src/RooFormulaVar.cxx       |   2 +
 roofit/roofitcore/src/RooFracRemainder.cxx    |   2 +
 roofit/roofitcore/src/RooFunctor.cxx          |   2 +
 .../src/RooGaussKronrodIntegrator1D.cxx       |   2 +
 roofit/roofitcore/src/RooGenCategory.cxx      |   2 +
 roofit/roofitcore/src/RooGenContext.cxx       |   2 +
 roofit/roofitcore/src/RooGenFunction.cxx      |   2 +
 roofit/roofitcore/src/RooGenProdProj.cxx      |   2 +
 roofit/roofitcore/src/RooGenericPdf.cxx       |   2 +
 roofit/roofitcore/src/RooGlobalFunc.cxx       |   5 +-
 roofit/roofitcore/src/RooGrid.cxx             |   2 +
 roofit/roofitcore/src/RooHashTable.cxx        |   2 +
 roofit/roofitcore/src/RooHist.cxx             |   2 +
 roofit/roofitcore/src/RooHistError.cxx        |   2 +
 roofit/roofitcore/src/RooHistFunc.cxx         |   2 +
 roofit/roofitcore/src/RooHistPdf.cxx          |   2 +
 .../src/RooImproperIntegrator1D.cxx           |   2 +
 roofit/roofitcore/src/RooInt.cxx              |   2 +
 roofit/roofitcore/src/RooIntegrator1D.cxx     |   2 +
 roofit/roofitcore/src/RooIntegrator2D.cxx     |   2 +
 .../roofitcore/src/RooIntegratorBinding.cxx   |   2 +
 roofit/roofitcore/src/RooInvTransform.cxx     |   2 +
 roofit/roofitcore/src/RooLinTransBinning.cxx  |   2 +
 roofit/roofitcore/src/RooLinearVar.cxx        |   2 +
 roofit/roofitcore/src/RooLinkedList.cxx       |   2 +
 roofit/roofitcore/src/RooLinkedListElem.cxx   |   2 +
 roofit/roofitcore/src/RooLinkedListIter.cxx   |   2 +
 roofit/roofitcore/src/RooList.cxx             |   2 +
 roofit/roofitcore/src/RooListProxy.cxx        |   2 +
 roofit/roofitcore/src/RooMCIntegrator.cxx     |   2 +
 roofit/roofitcore/src/RooMPSentinel.cxx       |   2 +
 roofit/roofitcore/src/RooMapCatEntry.cxx      |   2 +
 roofit/roofitcore/src/RooMath.cxx             |   2 +
 roofit/roofitcore/src/RooMinimizer.cxx        |   2 +
 roofit/roofitcore/src/RooMinimizerFcn.cxx     |   2 +
 roofit/roofitcore/src/RooMinuit.cxx           |   2 +
 roofit/roofitcore/src/RooMultiCatIter.cxx     |   2 +
 roofit/roofitcore/src/RooMultiCategory.cxx    |   2 +
 roofit/roofitcore/src/RooMultiGenFunction.cxx |   2 +
 roofit/roofitcore/src/RooMultiVarGaussian.cxx |   2 +
 roofit/roofitcore/src/RooNLLVar.cxx           |   2 +
 roofit/roofitcore/src/RooNameSet.cxx          |   2 +
 roofit/roofitcore/src/RooNumCdf.cxx           |   2 +
 roofit/roofitcore/src/RooNumConvPdf.cxx       |   2 +
 roofit/roofitcore/src/RooNumConvolution.cxx   |   2 +
 roofit/roofitcore/src/RooNumGenConfig.cxx     |   2 +
 roofit/roofitcore/src/RooNumIntConfig.cxx     |   2 +
 roofit/roofitcore/src/RooNumRunningInt.cxx    |   2 +
 roofit/roofitcore/src/RooNumber.cxx           |   2 +
 roofit/roofitcore/src/RooParamBinning.cxx     |   2 +
 roofit/roofitcore/src/RooPlot.cxx             |   2 +
 roofit/roofitcore/src/RooPlotable.cxx         |   2 +
 roofit/roofitcore/src/RooPolyVar.cxx          |   2 +
 roofit/roofitcore/src/RooPrintable.cxx        |   2 +
 roofit/roofitcore/src/RooProdGenContext.cxx   |   2 +
 roofit/roofitcore/src/RooProdPdf.cxx          |   2 +
 roofit/roofitcore/src/RooProjectedPdf.cxx     |   1 +
 roofit/roofitcore/src/RooPullVar.cxx          |   2 +
 .../src/RooQuasiRandomGenerator.cxx           |   2 +
 roofit/roofitcore/src/RooRandom.cxx           |   2 +
 roofit/roofitcore/src/RooRangeBinning.cxx     |   2 +
 roofit/roofitcore/src/RooRangeBoolean.cxx     |   2 +
 roofit/roofitcore/src/RooRealAnalytic.cxx     |   2 +
 roofit/roofitcore/src/RooRealBinding.cxx      |   2 +
 roofit/roofitcore/src/RooRealConstant.cxx     |   2 +
 roofit/roofitcore/src/RooRealIntegral.cxx     |   2 +
 roofit/roofitcore/src/RooRealMPFE.cxx         |   2 +
 roofit/roofitcore/src/RooRealProxy.cxx        |   2 +
 roofit/roofitcore/src/RooRealSumPdf.cxx       |   2 +
 roofit/roofitcore/src/RooRealVar.cxx          |   2 +
 .../src/RooRealVarSharedProperties.cxx        |   2 +
 .../roofitcore/src/RooRecursiveFraction.cxx   |   2 +
 roofit/roofitcore/src/RooRefCountList.cxx     |   2 +
 roofit/roofitcore/src/RooResolutionModel.cxx  |   2 +
 roofit/roofitcore/src/RooScaledFunc.cxx       |   2 +
 .../src/RooSegmentedIntegrator1D.cxx          |   2 +
 .../src/RooSegmentedIntegrator2D.cxx          |   2 +
 roofit/roofitcore/src/RooSetPair.cxx          |   2 +
 roofit/roofitcore/src/RooSetProxy.cxx         |   2 +
 roofit/roofitcore/src/RooSharedProperties.cxx |   2 +
 .../src/RooSharedPropertiesList.cxx           |   2 +
 roofit/roofitcore/src/RooSimGenContext.cxx    |   2 +
 .../roofitcore/src/RooSimSplitGenContext.cxx  |   2 +
 roofit/roofitcore/src/RooStreamParser.cxx     |   2 +
 roofit/roofitcore/src/RooStringVar.cxx        |   2 +
 roofit/roofitcore/src/RooSuperCategory.cxx    |   2 +
 roofit/roofitcore/src/RooTFoamBinding.cxx     |   2 +
 roofit/roofitcore/src/RooTObjWrap.cxx         |   2 +
 roofit/roofitcore/src/RooTable.cxx            |   2 +
 roofit/roofitcore/src/RooThreshEntry.cxx      |   2 +
 .../roofitcore/src/RooThresholdCategory.cxx   |   2 +
 roofit/roofitcore/src/RooTrace.cxx            |   2 +
 roofit/roofitcore/src/RooTreeData.cxx         |   2 +
 roofit/roofitcore/src/RooUniformBinning.cxx   |   2 +
 roofit/roofitcore/src/RooXYChi2Var.cxx        |   2 +
 .../inc/RooStats/NeymanConstruction.h         |   2 +-
 .../RooStats/SimpleLikelihoodRatioTestStat.h  |  10 +-
 roofit/roostats/src/HLFactory.cxx             |   2 +
 roofit/roostats/src/Heaviside.cxx             |   2 +
 .../roostats/src/HybridCalculatorOriginal.cxx |   2 +
 roofit/roostats/src/HybridPlot.cxx            |   2 +
 roofit/roostats/src/HybridResult.cxx          |   2 +
 roofit/roostats/src/HypoTestInverterPlot.cxx  |   2 +
 .../roostats/src/LikelihoodIntervalPlot.cxx   |   2 +
 roofit/roostats/src/MarkovChain.cxx           |   2 +
 roofit/roostats/src/PointSetInterval.cxx      |   2 +
 .../src/ProfileLikelihoodCalculator.cxx       |   2 +
 roofit/roostats/src/SequentialProposal.cxx    |   2 +
 roofit/roostats/src/SimpleInterval.cxx        |   2 +
 roofit/roostats/src/UniformProposal.cxx       |   2 +
 roofit/roostats/src/UpperLimitMCSModule.cxx   |   2 +
 sql/odbc/src/TODBCServer.cxx                  |   8 +-
 test/MainEvent.cxx                            |   3 +-
 test/QpRandomDriver.cxx                       |  24 +-
 test/RootShower/RootShower.cxx                |   4 +-
 test/TBench.cxx                               |   8 +-
 test/bench.cxx                                |   2 +
 test/benchLinkDef.h                           |   4 +-
 test/ctorture.cxx                             |   4 +-
 test/guiviewer.cxx                            |   2 +-
 test/periodic/NdbMF.cxx                       |   4 +-
 test/periodic/NdbMTReactionXS.cxx             |   8 +-
 test/periodic/NdbParticleList.cxx             |   2 +-
 test/stressFit.cxx                            |  14 +-
 test/stressGUI.cxx                            |  70 +-
 test/stressGraphics.cxx                       |  54 +-
 test/stressHistogram.cxx                      | 234 ++---
 test/stressLinear.cxx                         | 868 +++++++++---------
 test/stressSpectrum.cxx                       |   6 +-
 test/tcollbm.cxx                              |   8 +-
 test/tstring.cxx                              |  52 +-
 test/vlazy.cxx                                |  18 +-
 test/vmatrix.cxx                              | 330 +++----
 test/vvector.cxx                              | 164 ++--
 tmva/inc/TMVA/BinaryTree.h                    |  12 +-
 tmva/inc/TMVA/CCTreeWrapper.h                 |   4 +-
 tmva/inc/TMVA/Configurable.h                  |   2 +-
 tmva/inc/TMVA/DataSet.h                       |   4 +-
 tmva/inc/TMVA/DecisionTreeNode.h              |  10 +-
 tmva/inc/TMVA/GeneticPopulation.h             |   2 +-
 tmva/inc/TMVA/MethodANNBase.h                 |   2 +-
 tmva/inc/TMVA/MethodBDT.h                     |   2 +-
 tmva/inc/TMVA/MethodBayesClassifier.h         |   2 +-
 tmva/inc/TMVA/MethodCFMlpANN.h                |   2 +-
 tmva/inc/TMVA/MethodCommittee.h               |   2 +-
 tmva/inc/TMVA/MethodCompositeBase.h           |   2 +-
 tmva/inc/TMVA/MethodDT.h                      |   2 +-
 tmva/inc/TMVA/MethodHMatrix.h                 |   2 +-
 tmva/inc/TMVA/MethodLikelihood.h              |   4 +-
 tmva/inc/TMVA/MethodPDERS.h                   |   2 +-
 tmva/inc/TMVA/MethodRuleFit.h                 |   2 +-
 tmva/inc/TMVA/MethodTMlpANN.h                 |   2 +-
 tmva/inc/TMVA/Option.h                        |  14 +-
 tmva/inc/TMVA/PDF.h                           |  10 +-
 tmva/inc/TMVA/Rule.h                          |  10 +-
 tmva/inc/TMVA/RuleEnsemble.h                  |   8 +-
 tmva/inc/TMVA/RuleFitAPI.h                    |  16 +-
 tmva/inc/TMVA/Tools.h                         |   4 +-
 tmva/inc/TMVA/VariableDecorrTransform.h       |   2 +-
 tmva/inc/TMVA/VariableGaussTransform.h        |   2 +-
 tmva/inc/TMVA/VariableNormalizeTransform.h    |   2 +-
 tmva/inc/TMVA/VariableRearrangeTransform.h    |   2 +-
 tmva/inc/TMVA/VariableTransformBase.h         |   2 +-
 tmva/src/BinarySearchTree.cxx                 |   8 +-
 tmva/src/BinarySearchTreeNode.cxx             |   6 +-
 tmva/src/BinaryTree.cxx                       |  10 +-
 tmva/src/CCPruner.cxx                         |   2 +-
 tmva/src/CCTreeWrapper.cxx                    |   4 +-
 tmva/src/Configurable.cxx                     |   4 +-
 tmva/src/DataInputHandler.cxx                 |   2 +-
 tmva/src/DecisionTree.cxx                     |  38 +-
 tmva/src/DecisionTreeNode.cxx                 |  10 +-
 tmva/src/Event.cxx                            |   2 +-
 tmva/src/GeneticAlgorithm.cxx                 |   2 +-
 tmva/src/MethodANNBase.cxx                    | 145 +--
 tmva/src/MethodBDT.cxx                        | 365 ++++----
 tmva/src/MethodBase.cxx                       | 382 ++++----
 tmva/src/MethodBayesClassifier.cxx            |   6 +-
 tmva/src/MethodBoost.cxx                      |  16 +-
 tmva/src/MethodCFMlpANN.cxx                   |  35 +-
 tmva/src/MethodCommittee.cxx                  |  14 +-
 tmva/src/MethodCompositeBase.cxx              |  10 +-
 tmva/src/MethodCuts.cxx                       |  42 +-
 tmva/src/MethodDT.cxx                         |   6 +-
 tmva/src/MethodFDA.cxx                        |  48 +-
 tmva/src/MethodFisher.cxx                     |  80 +-
 tmva/src/MethodHMatrix.cxx                    | 144 +--
 tmva/src/MethodKNN.cxx                        |   4 +-
 tmva/src/MethodLD.cxx                         |  78 +-
 tmva/src/MethodLikelihood.cxx                 | 274 +++---
 tmva/src/MethodMLP.cxx                        |   6 +-
 tmva/src/MethodPDEFoam.cxx                    |   2 +-
 tmva/src/MethodPDERS.cxx                      |   2 +-
 tmva/src/MethodRuleFit.cxx                    |  24 +-
 tmva/src/MethodSVM.cxx                        | 100 +-
 tmva/src/MethodTMlpANN.cxx                    |   2 +-
 tmva/src/ModulekNN.cxx                        |   2 +-
 tmva/src/Node.cxx                             |   4 +-
 tmva/src/PDF.cxx                              |  10 +-
 tmva/src/Reader.cxx                           |   6 +-
 tmva/src/Rule.cxx                             |  10 +-
 tmva/src/RuleEnsemble.cxx                     |   8 +-
 tmva/src/VariableDecorrTransform.cxx          |   2 +-
 tmva/src/VariableGaussTransform.cxx           |   2 +-
 tmva/src/VariableNormalizeTransform.cxx       |   2 +-
 tmva/src/VariableRearrangeTransform.cxx       |   2 +-
 tmva/test/TMVAMulticlass.cxx                  |   4 +-
 tree/tree/inc/TLeaf.h                         |   2 +-
 tree/tree/inc/TLeafB.h                        |   2 +-
 tree/tree/inc/TLeafC.h                        |   2 +-
 tree/tree/inc/TLeafD.h                        |   2 +-
 tree/tree/inc/TLeafF.h                        |   2 +-
 tree/tree/inc/TLeafI.h                        |   2 +-
 tree/tree/inc/TLeafL.h                        |   2 +-
 tree/tree/inc/TLeafO.h                        |   2 +-
 tree/tree/inc/TLeafS.h                        |   2 +-
 tree/tree/inc/TNtuple.h                       |   2 +-
 tree/tree/inc/TNtupleD.h                      |   2 +-
 tree/tree/inc/TTree.h                         |   4 +-
 tree/tree/src/TBasketSQL.cxx                  |   4 +-
 tree/tree/src/TBufferSQL.cxx                  |  10 +-
 tree/tree/src/TChainElement.cxx               |   2 +-
 tree/tree/src/TLeafB.cxx                      |   4 +-
 tree/tree/src/TLeafC.cxx                      |   6 +-
 tree/tree/src/TLeafD.cxx                      |   4 +-
 tree/tree/src/TLeafF.cxx                      |   4 +-
 tree/tree/src/TLeafI.cxx                      |   4 +-
 tree/tree/src/TLeafL.cxx                      |   4 +-
 tree/tree/src/TLeafO.cxx                      |   4 +-
 tree/tree/src/TLeafS.cxx                      |   4 +-
 tree/tree/src/TNtuple.cxx                     |   2 +-
 tree/tree/src/TNtupleD.cxx                    |   2 +-
 tree/tree/src/TTree.cxx                       |   4 +-
 tree/tree/src/TTreeSQL.cxx                    |  12 +-
 tree/treeplayer/inc/TBranchProxy.h            |  40 +-
 tree/treeplayer/inc/TBranchProxyTemplate.h    |  12 +-
 tree/treeplayer/inc/TTreePerfStats.h          |   2 +-
 tree/treeplayer/src/TBranchProxy.cxx          |   8 +-
 tree/treeplayer/src/TTreePerfStats.cxx        |  60 +-
 tree/treeplayer/src/TTreePlayer.cxx           |  18 +-
 tree/treeviewer/inc/TParallelCoord.h          |   2 +-
 tree/treeviewer/inc/TParallelCoordVar.h       |   2 +-
 tree/treeviewer/inc/TTVSession.h              |   4 +-
 tree/treeviewer/src/TParallelCoord.cxx        |  82 +-
 tree/treeviewer/src/TParallelCoordEditor.cxx  |   2 +-
 tree/treeviewer/src/TParallelCoordRange.cxx   |   2 +-
 tree/treeviewer/src/TParallelCoordVar.cxx     |  46 +-
 tree/treeviewer/src/TTVSession.cxx            |  50 +-
 tree/treeviewer/src/TTreeViewer.cxx           |  96 +-
 tutorials/proof/ProofStdVect.h                |   4 +-
 tutorials/quadp/Quad.cxx                      |  14 +-
 tutorials/tree/clonesA_Event.cxx              |   6 +-
 tutorials/tree/clonesA_Event.h                |   4 +-
 955 files changed, 7417 insertions(+), 6984 deletions(-)

diff --git a/build/package/msi/makemsi.cxx b/build/package/msi/makemsi.cxx
index 5e1fe505553..d55db9deb21 100644
--- a/build/package/msi/makemsi.cxx
+++ b/build/package/msi/makemsi.cxx
@@ -53,8 +53,8 @@ public:
    string GetId() const;
    MSIDir* GetParent() const {return fParent;}
 
-   virtual void WriteRecurse(ostream& out, string indent) const = 0;
-   ostream& WriteLongShort(ostream& out) const;
+   virtual void WriteRecurse(std::ostream& out, string indent) const = 0;
+   std::ostream& WriteLongShort(std::ostream& out) const;
 
 private:
    void SetShortName(bool dir);
@@ -77,14 +77,14 @@ public:
 
    void AddFile(const char* file);
 
-   void Write(ostream& out) const;
+   void Write(std::ostream& out) const;
 
 private:
-   void WriteRecurse(ostream& out, string indent) const;
-   void WriteComponentsRecurse(ostream& out, string indent) const;
+   void WriteRecurse(std::ostream& out, string indent) const;
+   void WriteComponentsRecurse(std::ostream& out, string indent) const;
    const char* GetGuid() const {
       if (!fgGuids.size() && !fgNewGuids.size()) SetupGuids();
-      map<string, string>::const_iterator iGuid = fgGuids.find(GetId());
+      std::map<string, string>::const_iterator iGuid = fgGuids.find(GetId());
       if (iGuid == fgGuids.end()) return CreateGuid();
       return iGuid->second.c_str();
    }
@@ -92,11 +92,11 @@ private:
    static void SetupGuids();
    static void UpdateGuids();
 
-   map<string, MSIDir*> fSubdirs;
-   list<MSIFile*> fFiles;
+   std::map<string, MSIDir*> fSubdirs;
+   std::list<MSIFile*> fFiles;
 
-   static map<string, string> fgGuids;
-   static map<string, string> fgNewGuids; // guids created during this process
+   static std::map<string, string> fgGuids;
+   static std::map<string, string> fgNewGuids; // guids created during this process
    static const char* fgGuidFileName; // location of the GUID file
 };
 
@@ -106,7 +106,7 @@ class MSIFile: public MSIDirEntry {
 public:
    MSIFile(const char* name, MSIDir* parent): MSIDirEntry(name, parent, false) {}
 
-   void WriteRecurse(ostream& out, string indent) const {
+   void WriteRecurse(std::ostream& out, string indent) const {
       out << indent << "<File Id=\"" << GetId() << "\" ";
       WriteLongShort(out) << "DiskId=\"1\"></File>" << std::endl;
    };
@@ -130,11 +130,11 @@ void MSIDirEntry::SetShortName(bool dir) {
    string filename(GetPath());
    HANDLE hFind = ::FindFirstFile(filename.c_str(), &findData);
    if (hFind == INVALID_HANDLE_VALUE) {
-      cerr << "Cannot find " << filename << endl;
+      std::cerr << "Cannot find " << filename << std::endl;
    } else {
       bool foundDir = (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) > 0;
       if (foundDir == !dir)
-         cerr << filename << " is not what I expected it to be!" << endl;
+         std::cerr << filename << " is not what I expected it to be!" << std::endl;
       else
          fShortName = findData.cAlternateFileName;
    } 
@@ -157,7 +157,7 @@ string MSIDirEntry::GetMyId() const {
    return ret;
 }
 
-ostream& MSIDirEntry::WriteLongShort(ostream& out) const {
+std::ostream& MSIDirEntry::WriteLongShort(std::ostream& out) const {
    if (!fShortName.empty()) 
       out << "LongName=\"" << fLongName <<"\" Name=\"" << fShortName << "\" ";
    else out << "Name=\"" << fLongName << "\" ";
@@ -170,8 +170,8 @@ ostream& MSIDirEntry::WriteLongShort(ostream& out) const {
 // MSIDir DEFINITIONS
 ////////////////////////////////////////////////////////////////////////////////
 
-map<string, string> MSIDir::fgGuids;
-map<string, string> MSIDir::fgNewGuids;
+std::map<string, string> MSIDir::fgGuids;
+std::map<string, string> MSIDir::fgNewGuids;
 const char* MSIDir::fgGuidFileName = 0; // set to e.g. "guids.txt" make GUIDs persistent
 
 void MSIDir::AddFile(const char* file) {
@@ -185,7 +185,7 @@ void MSIDir::AddFile(const char* file) {
    } else subdir.erase();
 
    if (filename.empty()) {
-      cerr << "Cannot add empty filename!" << endl;
+      std::cerr << "Cannot add empty filename!" << std::endl;
       return;
    }
    if (subdir.empty()) fFiles.push_back(new MSIFile(filename.c_str(), this));
@@ -195,7 +195,7 @@ void MSIDir::AddFile(const char* file) {
    }
 }
 
-void MSIDir::Write(ostream& out) const {
+void MSIDir::Write(std::ostream& out) const {
    const DWORD bufsize = MAX_PATH;
    char pwd[bufsize];
    DWORD len = ::GetCurrentDirectory(bufsize, pwd);
@@ -268,7 +268,7 @@ void MSIDir::Write(ostream& out) const {
    out << "</Wix>" << std::endl;
 }
 
-void MSIDir::WriteRecurse(ostream& out, string indent) const {
+void MSIDir::WriteRecurse(std::ostream& out, string indent) const {
    // write to out recursively
    if (!fFiles.size() && !fSubdirs.size()) return;
 
@@ -284,13 +284,13 @@ void MSIDir::WriteRecurse(ostream& out, string indent) const {
          << GetGuid() << "\">" << std::endl;
       indent+="   ";
 
-      for (list<MSIFile*>::const_iterator iFile = fFiles.begin(); iFile != fFiles.end(); ++iFile) {
+      for (std::list<MSIFile*>::const_iterator iFile = fFiles.begin(); iFile != fFiles.end(); ++iFile) {
          (*iFile)->WriteRecurse(out, indent);
       }
       indent.erase(indent.length()-3, 3);
       out << indent << "</Component>" << std::endl;
    }
-   for (map<string, MSIDir*>::const_iterator iSubdir = fSubdirs.begin(); iSubdir != fSubdirs.end(); ++iSubdir)
+   for (std::map<string, MSIDir*>::const_iterator iSubdir = fSubdirs.begin(); iSubdir != fSubdirs.end(); ++iSubdir)
       iSubdir->second->WriteRecurse(out, indent);
 
    indent.erase(indent.length()-3, 3);
@@ -300,11 +300,11 @@ void MSIDir::WriteRecurse(ostream& out, string indent) const {
    }
 }
 
-void MSIDir::WriteComponentsRecurse(ostream& out, string indent) const {
+void MSIDir::WriteComponentsRecurse(std::ostream& out, string indent) const {
    // write all components to out
    if (!fFiles.empty()) 
       out << indent << "<ComponentRef Id=\"Component_" << GetId() << "\" />" << std::endl;
-   for (map<string, MSIDir*>::const_iterator iSubdir = fSubdirs.begin(); iSubdir != fSubdirs.end(); ++iSubdir)
+   for (std::map<string, MSIDir*>::const_iterator iSubdir = fSubdirs.begin(); iSubdir != fSubdirs.end(); ++iSubdir)
       iSubdir->second->WriteComponentsRecurse(out, indent);
 }
 
@@ -339,15 +339,15 @@ void MSIDir::UpdateGuids() {
 
    std::ofstream out(fgGuidFileName, std::ios_base::app);
    if (!out) {
-      cerr << "ERROR: cannot write to GUID file " 
-         << fgGuidFileName << "!" << endl;
-      cerr << "ERROR: You should NOT use this MSI file, but re-generate with with accessible GUID file!"
-         << endl;
+      std::cerr << "ERROR: cannot write to GUID file " 
+         << fgGuidFileName << "!" << std::endl;
+      std::cerr << "ERROR: You should NOT use this MSI file, but re-generate with with accessible GUID file!"
+         << std::endl;
       return;
    }
-   for (map<string, string>::const_iterator iGuid = fgNewGuids.begin(); iGuid != fgNewGuids.end(); ++iGuid)
-      out << iGuid->first << " " << iGuid->second << endl;
-   std::cout << "WARNING: new GUIDs created; please cvs checkin " << fgGuidFileName << "!" << endl;
+   for (std::map<string, string>::const_iterator iGuid = fgNewGuids.begin(); iGuid != fgNewGuids.end(); ++iGuid)
+      out << iGuid->first << " " << iGuid->second << std::endl;
+   std::cout << "WARNING: new GUIDs created; please cvs checkin " << fgGuidFileName << "!" << std::endl;
 }
 
 
@@ -358,21 +358,21 @@ void MSIDir::UpdateGuids() {
 
 int main(int argc, char *argv[]) {
    if (argc<4 || string(argv[2]) != "-T") {
-      cerr << "USAGE: " << argv[0] << " <msifile> -T <inputlistfile>" << endl;
+      std::cerr << "USAGE: " << argv[0] << " <msifile> -T <inputlistfile>" << std::endl;
       return 1;
    }
 
    string outfile = argv[1];
    std::ofstream out(outfile.c_str());
    if (!out) {
-      cerr << "Cannot open output file " << outfile << "!" << endl;
+      std::cerr << "Cannot open output file " << outfile << "!" << std::endl;
       return 2;
    }
 
    string infile = argv[3];
    std::ifstream in(infile.c_str());
    if (!in) {
-      cerr << "Cannot open input file " << infile << "!" << endl;
+      std::cerr << "Cannot open input file " << infile << "!" << std::endl;
       return 2;
    }
 
diff --git a/cint/tool/makecint.cxx b/cint/tool/makecint.cxx
index 27fb8be7272..0f5d19c0a98 100644
--- a/cint/tool/makecint.cxx
+++ b/cint/tool/makecint.cxx
@@ -757,7 +757,7 @@ void G__outputmakefile(int argc,char **argv)
   else if(G__flags & G__ismain) {
 #ifdef _AIX
 TODO!
-  cout << "$(OBJECT) : $(CINTLIB) $(READLINEA) $(DLFCN) G__setup" << G__CFG_OBJEXT << " $(COFILES) $(CXXOFILES) $(CIFO) $(CXXIFO)";
+  std::cout << "$(OBJECT) : $(CINTLIB) $(READLINEA) $(DLFCN) G__setup" << G__CFG_OBJEXT << " $(COFILES) $(CXXOFILES) $(CIFO) $(CXXIFO)";
  out << "\t";
    if (G__quiet) out << "@";
    out << "$(LD) $(IPATH) $(MACRO) $(CCOPT) -o $(OBJECT) $(CIFO) $(CXXIFO) $(COFILES) $(CXXOFILES) G__setup" << G__CFG_OBJEXT << " $(READLINEA) $(DLFCN) $(LIBS)" 
diff --git a/core/base/inc/LinkDef1.h b/core/base/inc/LinkDef1.h
index f410853dde0..d3bcf8c1fd2 100644
--- a/core/base/inc/LinkDef1.h
+++ b/core/base/inc/LinkDef1.h
@@ -111,8 +111,8 @@
 #pragma link C++ function operator>(const char*,const TString&);
 #pragma link C++ function operator<=(const char*,const TString&);
 #pragma link C++ function operator>=(const char*,const TString&);
-#pragma link C++ function operator>>(istream&,TString&);
-#pragma link C++ function operator<<(ostream&,const TString&);
+#pragma link C++ function operator>>(std::istream&,TString&);
+#pragma link C++ function operator<<(std::ostream&,const TString&);
 //#pragma link C++ function operator>>(TBuffer&,TString&);
 //#pragma link C++ function operator<<(TBuffer&,const TString&);
 //#pragma link C++ function operator>>(TBuffer&,const TObject*&);
diff --git a/core/base/inc/LinkDef2.h b/core/base/inc/LinkDef2.h
index 949aa69d4f7..a4ad0937b28 100644
--- a/core/base/inc/LinkDef2.h
+++ b/core/base/inc/LinkDef2.h
@@ -21,26 +21,26 @@
 #pragma extra_include "iostream";
 
 #pragma create TClass string;
-#pragma link C++ class vector<string>;
-#pragma link C++ operator vector<string>;
+#pragma link C++ class std::vector<string>;
+#pragma link C++ operator std::vector<string>;
 #ifdef G__VECTOR_HAS_CLASS_ITERATOR
-#pragma link C++ class vector<string>::iterator; 
-#pragma link C++ class vector<string>::const_iterator;
-#pragma link C++ class vector<string>::reverse_iterator;
-#pragma link C++ operator vector<string>::iterator; 
-#pragma link C++ operator vector<string>::const_iterator;
-#pragma link C++ operator vector<string>::reverse_iterator;
+#pragma link C++ class std::vector<string>::iterator; 
+#pragma link C++ class std::vector<string>::const_iterator;
+#pragma link C++ class std::vector<string>::reverse_iterator;
+#pragma link C++ operator std::vector<string>::iterator; 
+#pragma link C++ operator std::vector<string>::const_iterator;
+#pragma link C++ operator std::vector<string>::reverse_iterator;
 #endif
 
-#pragma link C++ class vector<TString>;
-#pragma link C++ operators vector<TString>;
+#pragma link C++ class std::vector<TString>;
+#pragma link C++ operators std::vector<TString>;
 #ifdef G__VECTOR_HAS_CLASS_ITERATOR
-#pragma link C++ class vector<TString>::iterator; 
-#pragma link C++ class vector<TString>::const_iterator; 
-#pragma link C++ class vector<TString>::reverse_iterator; 
-#pragma link C++ operator vector<TString>::iterator; 
-#pragma link C++ operator vector<TString>::const_iterator;
-#pragma link C++ operator vector<TString>::reverse_iterator;
+#pragma link C++ class std::vector<TString>::iterator; 
+#pragma link C++ class std::vector<TString>::const_iterator; 
+#pragma link C++ class std::vector<TString>::reverse_iterator; 
+#pragma link C++ operator std::vector<TString>::iterator; 
+#pragma link C++ operator std::vector<TString>::const_iterator;
+#pragma link C++ operator std::vector<TString>::reverse_iterator;
 #endif
 
 #include <vector>
diff --git a/core/base/inc/LinkDef3.h b/core/base/inc/LinkDef3.h
index 24f3c58cc95..64c35bf85d7 100644
--- a/core/base/inc/LinkDef3.h
+++ b/core/base/inc/LinkDef3.h
@@ -146,7 +146,7 @@
 #pragma link C++ struct Rectangle_t;
 #pragma link C++ struct timespec;
 
-#pragma link C++ function operator<<(ostream&, const TTimeStamp&);
+#pragma link C++ function operator<<(std::ostream&, const TTimeStamp&);
 #pragma link C++ function operator<<(TBuffer&, const TTimeStamp&);
 #pragma link C++ function operator>>(TBuffer&, TTimeStamp&);
 #pragma link C++ function operator==(const TTimeStamp&, const TTimeStamp&);
@@ -226,11 +226,11 @@
 #pragma link C++ class std::pair<const char*,double>+;
 #pragma link C++ class std::pair<const char*,void*>+;
 #pragma link C++ class std::pair<const char*,char*>+;
-#pragma link C++ class std::pair<const string,int>+;
-#pragma link C++ class std::pair<const string,long>+;
-#pragma link C++ class std::pair<const string,float>+;
-#pragma link C++ class std::pair<const string,double>+;
-#pragma link C++ class std::pair<const string,void*>+;
+#pragma link C++ class std::pair<const std::string,int>+;
+#pragma link C++ class std::pair<const std::string,long>+;
+#pragma link C++ class std::pair<const std::string,float>+;
+#pragma link C++ class std::pair<const std::string,double>+;
+#pragma link C++ class std::pair<const std::string,void*>+;
 #pragma link C++ class std::pair<const int,int>+;
 #pragma link C++ class std::pair<const int,long>+;
 #pragma link C++ class std::pair<const int,float>+;
diff --git a/core/base/inc/RConfig.h b/core/base/inc/RConfig.h
index b797ea4bec5..fa71ac2d0e5 100644
--- a/core/base/inc/RConfig.h
+++ b/core/base/inc/RConfig.h
@@ -28,6 +28,11 @@
 
 #define R__USE_SHADOW_CLASS
 
+/* Now required, thus defined by default for backward compatibility */
+#define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
+#define R__SSTREAM         /* use sstream or strstream header */
+
+
 /*---- machines --------------------------------------------------------------*/
 
 #ifdef __hpux
@@ -50,7 +55,6 @@
 #   define R__SEEK64
 #   define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
 #   define NEED_STRCASECMP
-#   define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
 #endif
 
 #ifdef __linux
@@ -73,8 +77,6 @@
 #   ifndef __USE_STD_IOSTREAM
 #   define __USE_STD_IOSTREAM
 #   endif
-#   define R__ANSISTREAM
-#   define R__SSTREAM
 #   define R__TMPLTSTREAM
 #   ifdef _XOPEN_SOURCE
 #      if _XOPEN_SOURCE+0 > 0
@@ -126,8 +128,6 @@
 #   define NEED_SIGJMP
 #   if __SUNPRO_CC > 0x420
 #      define R__SOLARIS_CC50
-#      define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
-#      define R__SSTREAM         /* use sstream or strstream header */
 #      define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
 #   endif
 #   if __SUNPRO_CC >= 0x420
@@ -148,7 +148,6 @@
 #   define R__UNIX
 #   define NEED_STRING
 #   define NEED_SIGJMP
-#   define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
 #endif
 
 #if defined(__sgi) && !defined(linux)
@@ -169,9 +168,6 @@
 #      define R__B64
 #      undef R__SEEK64
 #   endif
-#   if !defined(__KCC)
-#      define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
-#   endif
 #endif
 
 #if defined(linux)
@@ -375,7 +371,6 @@
 #   define R__UNIX
 #   if defined(__xlC__) || defined(__xlc__)
 #      define ANSICPP
-#      define R__ANSISTREAM
 #      define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
 #   endif
 #   if defined(__ppc64__)
@@ -412,16 +407,9 @@
 #   if __GNUC__ >= 3 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)
 #         define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
 #   endif
-#   if __GNUC__ >= 3 || __GNUC_MINOR__ >= 91    /* egcs 1.1.x */
-#      define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
-#   endif
-#   if __GNUC__ >= 3 && __GNUC_MINOR__ >=0 && __GNUC_MINOR__ < 8
-#      define R__SSTREAM         /* use sstream or strstream header */
-#   endif
 #   if defined(__ia64__) &&  __GNUC__ < 3       /* gcc 2.9x (MINOR is 9!) */
 #      define R__VECNEWDELETE    /* supports overloading of new[] and delete[] */
 #      define R__PLACEMENTDELETE /* supports overloading placement delete */
-#      define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
 #   endif
 #   if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ > 1)
 #      define R__PRAGMA_DIAGNOSTIC
@@ -438,7 +426,6 @@
 
 #ifdef __INTEL_COMPILER
 #   define R__INTEL_COMPILER
-#   define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
 #   define R__VECNEWDELETE    /* supports overloading of new[] and delete[] */
 #   define R__PLACEMENTDELETE /* supports overloading placement delete */
 #   define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
@@ -456,8 +443,7 @@
 #      define R__GLOBALSTL       /* STL in global name space */
 #   else
 #      define R__PLACEMENTDELETE /* supports overloading placement delete */
-#      define R__ANSISTREAM      /* ANSI C++ Standard Library conformant */
-#      define R__TMPLTSTREAM     /* iostream implemented with templates */
+#      define R__TMPLTSTREAM     /* std::iostream implemented with templates */
 #   endif
 #   ifndef _INCLUDE_LONGLONG
 #      define _INCLUDE_LONGLONG
@@ -497,12 +483,6 @@
 #   define R__VECNEWDELETE    /* supports overloading of new[] and delete[] */
 #   define R__PLACEMENTDELETE /* supports overloading placement delete */
 #   define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
-#   if _MSC_VER >= 1200
-#     define R__ANSISTREAM    /* ANSI C++ Standard Library conformant */
-#   endif
-#   if _MSC_VER >= 1310
-#     define R__SSTREAM       /* has <sstream> iso <strstream> */
-#   endif
 #   if _MSC_VER >= 1400
 #     define DONTNEED_VSNPRINTF
 #   endif
diff --git a/core/base/inc/Riosfwd.h b/core/base/inc/Riosfwd.h
index 80dbba2a4cb..ff95f4d6cc2 100644
--- a/core/base/inc/Riosfwd.h
+++ b/core/base/inc/Riosfwd.h
@@ -2,7 +2,7 @@
 // Author: Fons Rademakers   23/1/02
 
 /*************************************************************************
- * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
+ * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers.               *
  * All rights reserved.                                                  *
  *                                                                       *
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
@@ -17,32 +17,10 @@
 //                                                                      //
 // Riosfwd                                                              //
 //                                                                      //
-// This headers is only supposed to be used in header files.            //
-// Never in sources, in source files use the companion Riostream.h.     //
+// Backward compatibility header; #includes <iosfwd>.                   //
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
-#ifndef ROOT_RConfig
-#include "RConfig.h"
-#endif
-
-#if defined(R__ANSISTREAM)
-#   if defined(R__TMPLTSTREAM)
-#      include <iostream>
-#   else
-#      include <iosfwd>
-#   endif
-using std::istream;
-using std::ostream;
-using std::fstream;
-using std::ifstream;
-using std::ofstream;
-#else
-class istream;
-class ostream;
-class fstream;
-class ifstream;
-class ofstream;
-#endif
+#include <iosfwd>
 
 #endif
diff --git a/core/base/inc/TApplication.h b/core/base/inc/TApplication.h
index 65a03cf2713..de1d1bca12f 100644
--- a/core/base/inc/TApplication.h
+++ b/core/base/inc/TApplication.h
@@ -154,7 +154,7 @@ public:
    virtual void    Terminate(Int_t status = 0);       //*SIGNAL*
    virtual void    KeyPressed(Int_t key);             //*SIGNAL*
    virtual void    ReturnPressed(char *text );        //*SIGNAL*
-   virtual Int_t   TabCompletionHook(char *buf, int *pLoc, ostream& out);
+   virtual Int_t   TabCompletionHook(char *buf, int *pLoc, std::ostream& out);
 
    static Long_t   ExecuteFile(const char *file, Int_t *error = 0, Bool_t keep = kFALSE);
    static TList   *GetApplications();
diff --git a/core/base/inc/TAttAxis.h b/core/base/inc/TAttAxis.h
index 6f91d369f1e..29e49e8742d 100644
--- a/core/base/inc/TAttAxis.h
+++ b/core/base/inc/TAttAxis.h
@@ -59,7 +59,7 @@ public:
    virtual Color_t  GetTitleColor()  const {return fTitleColor;}
    virtual Style_t  GetTitleFont()   const {return fTitleFont;}
    virtual void     ResetAttAxis(Option_t *option="");
-   virtual void     SaveAttributes(ostream &out, const char *name, const char *subname);
+   virtual void     SaveAttributes(std::ostream &out, const char *name, const char *subname);
    virtual void     SetNdivisions(Int_t n=510, Bool_t optim=kTRUE);  // *MENU*
    virtual void     SetNdivisions(Int_t n1, Int_t n2, Int_t n3, Bool_t optim=kTRUE);
    virtual void     SetAxisColor(Color_t color=1);        // *MENU*
diff --git a/core/base/inc/TAttFill.h b/core/base/inc/TAttFill.h
index 6c67b1bbf0e..b5e104a2927 100644
--- a/core/base/inc/TAttFill.h
+++ b/core/base/inc/TAttFill.h
@@ -45,7 +45,7 @@ public:
    virtual Bool_t   IsTransparent() const;
    virtual void     Modify();
    virtual void     ResetAttFill(Option_t *option="");
-   virtual void     SaveFillAttributes(ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001);
+   virtual void     SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001);
    virtual void     SetFillAttributes(); // *MENU*
    virtual void     SetFillColor(Color_t fcolor) { fFillColor = fcolor; }
    virtual void     SetFillStyle(Style_t fstyle) { fFillStyle = fstyle; }
diff --git a/core/base/inc/TAttLine.h b/core/base/inc/TAttLine.h
index 78a8d67a786..e6cbe12e313 100644
--- a/core/base/inc/TAttLine.h
+++ b/core/base/inc/TAttLine.h
@@ -49,7 +49,7 @@ public:
    virtual Width_t  GetLineWidth() const {return fLineWidth;}
    virtual void     Modify();
    virtual void     ResetAttLine(Option_t *option="");
-   virtual void     SaveLineAttributes(ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1);
+   virtual void     SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1);
    virtual void     SetLineAttributes(); // *MENU*
    virtual void     SetLineColor(Color_t lcolor) { fLineColor = lcolor;}
    virtual void     SetLineStyle(Style_t lstyle) { fLineStyle = lstyle;}
diff --git a/core/base/inc/TAttMarker.h b/core/base/inc/TAttMarker.h
index fc07724057e..b4f46dd394f 100644
--- a/core/base/inc/TAttMarker.h
+++ b/core/base/inc/TAttMarker.h
@@ -46,7 +46,7 @@ public:
    virtual Size_t   GetMarkerSize()  const {return fMarkerSize;}
    virtual void     Modify();
    virtual void     ResetAttMarker(Option_t *toption="");
-   virtual void     SaveMarkerAttributes(ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1);
+   virtual void     SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1);
    virtual void     SetMarkerAttributes();  // *MENU*
    virtual void     SetMarkerColor(Color_t tcolor=1) { fMarkerColor = tcolor;}
    virtual void     SetMarkerStyle(Style_t mstyle=1) { fMarkerStyle = mstyle;}
diff --git a/core/base/inc/TAttText.h b/core/base/inc/TAttText.h
index 7103b1c9bce..b67b2a565a7 100644
--- a/core/base/inc/TAttText.h
+++ b/core/base/inc/TAttText.h
@@ -50,7 +50,7 @@ public:
    virtual Float_t  GetTextSize()  const {return fTextSize;}
    virtual void     Modify();
    virtual void     ResetAttText(Option_t *toption="");
-   virtual void     SaveTextAttributes(ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1);
+   virtual void     SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1);
    virtual void     SetTextAttributes();  // *MENU*
    virtual void     SetTextAlign(Short_t align=11) { fTextAlign = align;}
    virtual void     SetTextAngle(Float_t tangle=0) { fTextAngle = tangle;}  // *MENU*
diff --git a/core/base/inc/TColor.h b/core/base/inc/TColor.h
index dae28c6ece9..1b09908dc79 100644
--- a/core/base/inc/TColor.h
+++ b/core/base/inc/TColor.h
@@ -119,7 +119,7 @@ public:
    static void    Pixel2RGB(ULong_t pixel, Int_t &r, Int_t &g, Int_t &b);
    static void    Pixel2RGB(ULong_t pixel, Float_t &r, Float_t &g, Float_t &b);
    static const char *PixelAsHexString(ULong_t pixel);
-   static void    SaveColor(ostream &out, Int_t ci);
+   static void    SaveColor(std::ostream &out, Int_t ci);
    static Bool_t  IsGrayscale();
    static void    SetGrayscale(Bool_t set = kTRUE);
    static void    SetPalette(Int_t ncolors, Int_t *colors);
diff --git a/core/base/inc/TExec.h b/core/base/inc/TExec.h
index f5af33734ea..f3b4d0317ce 100644
--- a/core/base/inc/TExec.h
+++ b/core/base/inc/TExec.h
@@ -37,7 +37,7 @@ public:
    virtual ~TExec();
    virtual void     Exec(const char *command="");
    virtual void     Paint(Option_t *option="");
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetAction(const char *action) {SetTitle(action);}
    
    ClassDef(TExec,1);  //To execute a CINT command
diff --git a/core/base/inc/TMacro.h b/core/base/inc/TMacro.h
index 1e00e552048..0164ece275f 100644
--- a/core/base/inc/TMacro.h
+++ b/core/base/inc/TMacro.h
@@ -52,7 +52,7 @@ public:
    virtual void         Print(Option_t *option="") const;  //*MENU*
    virtual Int_t        ReadFile(const char *filename);
    virtual void         SaveSource(const char *filename);  //*MENU*
-   virtual void         SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void         SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void         SetParams(const char *params=0); //*MENU*
 
    ClassDef(TMacro,1)  // Class supporting a collection of lines with C++ code.
diff --git a/core/base/inc/TObject.h b/core/base/inc/TObject.h
index 01f60b068bc..c826309c873 100644
--- a/core/base/inc/TObject.h
+++ b/core/base/inc/TObject.h
@@ -145,7 +145,7 @@ public:
    virtual Int_t       Read(const char *name);
    virtual void        RecursiveRemove(TObject *obj);
    virtual void        SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        SetDrawOption(Option_t *option="");  // *MENU*
    virtual void        SetUniqueID(UInt_t uid);
    virtual void        UseCurrentStyle();
diff --git a/core/base/inc/TParameter.h b/core/base/inc/TParameter.h
index ab399895692..dde1537d768 100644
--- a/core/base/inc/TParameter.h
+++ b/core/base/inc/TParameter.h
@@ -82,13 +82,13 @@ public:
    virtual void ls(Option_t *) const {
       // Print this parameter content
       TROOT::IndentLevel();
-      cout << "OBJ: " << IsA()->GetName() << "\t" << fName << " = " << fVal << endl;
+      std::cout << "OBJ: " << IsA()->GetName() << "\t" << fName << " = " << fVal << std::endl;
    }
 
    virtual void Print(Option_t *) const {
       // Print this parameter content
       TROOT::IndentLevel();
-      cout << IsA()->GetName() << "\t" << fName << " = " << fVal << endl;
+      std::cout << IsA()->GetName() << "\t" << fName << " = " << fVal << std::endl;
    }
 
    virtual Int_t Merge(TCollection *in);
diff --git a/core/base/inc/TString.h b/core/base/inc/TString.h
index 1eba4754174..432ca0fc6d8 100644
--- a/core/base/inc/TString.h
+++ b/core/base/inc/TString.h
@@ -387,12 +387,12 @@ public:
    TString     &Prepend(const TString &s);
    TString     &Prepend(const TString &s, Ssiz_t n);
    TString     &Prepend(char c, Ssiz_t rep = 1);  // Prepend c rep times
-   istream     &ReadFile(istream &str);      // Read to EOF or null character
-   istream     &ReadLine(istream &str,
+   std::istream     &ReadFile(std::istream &str);      // Read to EOF or null character
+   std::istream     &ReadLine(std::istream &str,
                          Bool_t skipWhite = kTRUE);   // Read to EOF or newline
-   istream     &ReadString(istream &str);             // Read to EOF or null character
-   istream     &ReadToDelim(istream &str, char delim = '\n'); // Read to EOF or delimitor
-   istream     &ReadToken(istream &str);                // Read separated by white space
+   std::istream     &ReadString(std::istream &str);             // Read to EOF or null character
+   std::istream     &ReadToDelim(std::istream &str, char delim = '\n'); // Read to EOF or delimitor
+   std::istream     &ReadToken(std::istream &str);                // Read separated by white space
    TString     &Remove(Ssiz_t pos);                     // Remove pos to end of string
    TString     &Remove(Ssiz_t pos, Ssiz_t n);           // Remove n chars starting at pos
    TString     &Remove(EStripType s, char c);           // Like Strip() but changing string directly
@@ -435,8 +435,8 @@ public:
 };
 
 // Related global functions
-istream  &operator>>(istream &str,       TString &s);
-ostream  &operator<<(ostream &str, const TString &s);
+std::istream  &operator>>(std::istream &str,       TString &s);
+std::ostream  &operator<<(std::ostream &str, const TString &s);
 #if defined(R__TEMPLATE_OVERLOAD_BUG)
 template <>
 #endif
diff --git a/core/base/inc/TStyle.h b/core/base/inc/TStyle.h
index 6392f7ca016..89eb15cefd2 100644
--- a/core/base/inc/TStyle.h
+++ b/core/base/inc/TStyle.h
@@ -402,7 +402,7 @@ public:
    void             ToggleToolBar() { fShowToolBar = fShowToolBar ? 0 : 1; }
    void             SetIsReading(Bool_t reading=kTRUE);
    void             SetPalette(Int_t ncolors=0, Int_t *colors=0);
-   void             SavePrimitive(ostream &out, Option_t * = "");
+   void             SavePrimitive(std::ostream &out, Option_t * = "");
    void             SaveSource(const char *filename, Option_t *option=0);
 
    ClassDef(TStyle, 14);  //A collection of all graphics attributes
diff --git a/core/base/inc/TTimeStamp.h b/core/base/inc/TTimeStamp.h
index 3876788fcc4..0ae4e9e8d22 100644
--- a/core/base/inc/TTimeStamp.h
+++ b/core/base/inc/TTimeStamp.h
@@ -84,7 +84,7 @@ typedef struct tm       tm_t;
 
 class TVirtualMutex;
 class TTimeStamp;
-ostream &operator<<(ostream &os,  const TTimeStamp &ts);
+std::ostream &operator<<(std::ostream &os,  const TTimeStamp &ts);
 TBuffer &operator<<(TBuffer &buf, const TTimeStamp &ts);
 TBuffer &operator>>(TBuffer &buf, TTimeStamp &ts);
 Bool_t operator==(const TTimeStamp &lhs, const TTimeStamp &rhs);
diff --git a/core/base/inc/TVirtualPS.h b/core/base/inc/TVirtualPS.h
index f89d642f1a2..8cdae4a2763 100644
--- a/core/base/inc/TVirtualPS.h
+++ b/core/base/inc/TVirtualPS.h
@@ -48,7 +48,7 @@ protected:
    Int_t        fLenBuffer;       //Buffer length
    Int_t        fSizBuffer;       //Buffer size
    Bool_t       fPrinted;         //True when a page must be printed
-   ofstream    *fStream;          //File stream identifier
+   std::ofstream    *fStream;          //File stream identifier
    char        *fBuffer;          //File buffer
    const char  *fImplicitCREsc;   //Escape symbol before enforced new line
 
@@ -77,7 +77,7 @@ public:
    virtual void  WriteInteger(Int_t i, Bool_t space=kTRUE);
    virtual void  WriteReal(Float_t r);
    virtual void *GetStream() const {  return (void*)fStream; }
-   virtual void  SetStream(ofstream *os) {  fStream = os; }
+   virtual void  SetStream(std::ofstream *os) {  fStream = os; }
 
    virtual void  SetType(Int_t /*type*/ = -111) { }
    virtual Int_t GetType() const { return 111; }
diff --git a/core/base/src/Stringio.cxx b/core/base/src/Stringio.cxx
index 888be3d3fd6..a0795b91de7 100644
--- a/core/base/src/Stringio.cxx
+++ b/core/base/src/Stringio.cxx
@@ -23,13 +23,13 @@
 
 
 //______________________________________________________________________________
-istream& TString::ReadFile(istream& strm)
+std::istream& TString::ReadFile(std::istream& strm)
 {
    // Replace string with the contents of strm, stopping at an EOF.
 
    // get file size
    Ssiz_t end, cur = strm.tellg();
-   strm.seekg(0, ios::end);
+   strm.seekg(0, std::ios::end);
    end = strm.tellg();
    strm.seekg(cur);
 
@@ -60,18 +60,18 @@ istream& TString::ReadFile(istream& strm)
 }
 
 //______________________________________________________________________________
-istream& TString::ReadLine(istream& strm, Bool_t skipWhite)
+std::istream& TString::ReadLine(std::istream& strm, Bool_t skipWhite)
 {
    // Read a line from stream upto newline skipping any whitespace.
 
    if (skipWhite)
-      strm >> ws;
+      strm >> std::ws;
 
    return ReadToDelim(strm, '\n');
 }
 
 //______________________________________________________________________________
-istream& TString::ReadString(istream& strm)
+std::istream& TString::ReadString(std::istream& strm)
 {
    // Read a line from stream upto \0, including any newline.
 
@@ -79,7 +79,7 @@ istream& TString::ReadString(istream& strm)
 }
 
 //______________________________________________________________________________
-istream& TString::ReadToDelim(istream& strm, char delim)
+std::istream& TString::ReadToDelim(std::istream& strm, char delim)
 {
    // Read up to an EOF, or a delimiting character, whichever comes
    // first.  The delimiter is not stored in the string,
@@ -122,7 +122,7 @@ istream& TString::ReadToDelim(istream& strm, char delim)
 }
 
 //______________________________________________________________________________
-istream& TString::ReadToken(istream& strm)
+std::istream& TString::ReadToken(std::istream& strm)
 {
    // Read a token, delimited by whitespace, from the input stream.
 
@@ -131,7 +131,7 @@ istream& TString::ReadToken(istream& strm)
 
    Clobber(incr);
 
-   strm >> ws;                                   // Eat whitespace
+   strm >> std::ws;                                   // Eat whitespace
 
    UInt_t wid = strm.width(0);
    char c;
@@ -158,7 +158,7 @@ istream& TString::ReadToken(istream& strm)
 }
 
 //______________________________________________________________________________
-istream& operator>>(istream& strm, TString& s)
+std::istream& operator>>(std::istream& strm, TString& s)
 {
    // Read string from stream.
 
@@ -166,7 +166,7 @@ istream& operator>>(istream& strm, TString& s)
 }
 
 //______________________________________________________________________________
-ostream& operator<<(ostream& os, const TString& s)
+std::ostream& operator<<(std::ostream& os, const TString& s)
 {
    // Write string to stream.
 
@@ -177,14 +177,14 @@ ostream& operator<<(ostream& os, const TString& s)
       wid = (len < wid) ? wid - len : 0;
       os.width(wid);
       long flags = os.flags();
-      if (wid && !(flags & ios::left))
-         os << "";  // let the ostream fill
+      if (wid && !(flags & std::ios::left))
+         os << "";  // let the std::ostream fill
       os.write((char*)s.Data(), s.Length());
-      if (wid && (flags & ios::left))
-         os << "";  // let the ostream fill
+      if (wid && (flags & std::ios::left))
+         os << "";  // let the std::ostream fill
    }
    // instead of os.osfx();
-   if (os.flags() & ios::unitbuf)
+   if (os.flags() & std::ios::unitbuf)
       os.flush();
    return os;
 }
diff --git a/core/base/src/TApplication.cxx b/core/base/src/TApplication.cxx
index d0d847ba5a3..ef1fa8c1c69 100644
--- a/core/base/src/TApplication.cxx
+++ b/core/base/src/TApplication.cxx
@@ -927,7 +927,7 @@ Long_t TApplication::ExecuteFile(const char *file, Int_t *error, Bool_t keep)
       return 0;
    }
 
-   ::ifstream macro(exnam, ios::in);
+   ::std::ifstream macro(exnam, std::ios::in);
    if (!macro.good()) {
       ::Error("TApplication::ExecuteFile", "%s no such file", exnam);
       delete [] exnam;
@@ -1089,7 +1089,7 @@ void TApplication::StopIdleing()
 }
 
 //______________________________________________________________________________
-Int_t TApplication::TabCompletionHook(char* /*buf*/, int* /*pLoc*/, ostream& /*out*/)
+Int_t TApplication::TabCompletionHook(char* /*buf*/, int* /*pLoc*/, std::ostream& /*out*/)
 {
    // What to do when tab is pressed. Re-implemented by TRint.
    // See TTabCom::Hook() for meaning of return values.
diff --git a/core/base/src/TAttAxis.cxx b/core/base/src/TAttAxis.cxx
index c350bc7c104..a950fc3d361 100644
--- a/core/base/src/TAttAxis.cxx
+++ b/core/base/src/TAttAxis.cxx
@@ -93,54 +93,54 @@ void TAttAxis::ResetAttAxis(Option_t *option)
 
 
 //______________________________________________________________________________
-void TAttAxis::SaveAttributes(ostream &out, const char *name, const char *subname)
+void TAttAxis::SaveAttributes(std::ostream &out, const char *name, const char *subname)
 {
     // Save axis attributes as C++ statement(s) on output stream out
 
    if (fNdivisions != 510) {
-      out<<"   "<<name<<subname<<"->SetNdivisions("<<fNdivisions<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetNdivisions("<<fNdivisions<<");"<<std::endl;
    }
    if (fAxisColor != 1) {
       if (fAxisColor > 228) {
          TColor::SaveColor(out, fAxisColor);
-         out<<"   "<<name<<subname<<"->SetAxisColor(ci);" << endl;
+         out<<"   "<<name<<subname<<"->SetAxisColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<subname<<"->SetAxisColor("<<fAxisColor<<");"<<endl;
+         out<<"   "<<name<<subname<<"->SetAxisColor("<<fAxisColor<<");"<<std::endl;
    }
    if (fLabelColor != 1) {
       if (fLabelColor > 228) {
          TColor::SaveColor(out, fLabelColor);
-         out<<"   "<<name<<subname<<"->SetLabelColor(ci);" << endl;
+         out<<"   "<<name<<subname<<"->SetLabelColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<subname<<"->SetLabelColor("<<fLabelColor<<");"<<endl;
+         out<<"   "<<name<<subname<<"->SetLabelColor("<<fLabelColor<<");"<<std::endl;
    }
    if (fLabelFont != 62) {
-      out<<"   "<<name<<subname<<"->SetLabelFont("<<fLabelFont<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetLabelFont("<<fLabelFont<<");"<<std::endl;
    }
    if (TMath::Abs(fLabelOffset-0.005) > 0.0001) {
-      out<<"   "<<name<<subname<<"->SetLabelOffset("<<fLabelOffset<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetLabelOffset("<<fLabelOffset<<");"<<std::endl;
    }
    if (TMath::Abs(fLabelSize-0.04) > 0.001) {
-      out<<"   "<<name<<subname<<"->SetLabelSize("<<fLabelSize<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetLabelSize("<<fLabelSize<<");"<<std::endl;
    }
    if (TMath::Abs(fTitleSize-0.04) > 0.001) {
-      out<<"   "<<name<<subname<<"->SetTitleSize("<<fTitleSize<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetTitleSize("<<fTitleSize<<");"<<std::endl;
    }
    if (TMath::Abs(fTickLength-0.03) > 0.001) {
-      out<<"   "<<name<<subname<<"->SetTickLength("<<fTickLength<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetTickLength("<<fTickLength<<");"<<std::endl;
    }
    if (TMath::Abs(fTitleOffset-1) > 0.001) {
-      out<<"   "<<name<<subname<<"->SetTitleOffset("<<fTitleOffset<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetTitleOffset("<<fTitleOffset<<");"<<std::endl;
    }
    if (fTitleColor != 1) {
       if (fTitleColor > 228) {
          TColor::SaveColor(out, fTitleColor);
-         out<<"   "<<name<<subname<<"->SetTitleColor(ci);" << endl;
+         out<<"   "<<name<<subname<<"->SetTitleColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<subname<<"->SetTitleColor("<<fTitleColor<<");"<<endl;
+         out<<"   "<<name<<subname<<"->SetTitleColor("<<fTitleColor<<");"<<std::endl;
    }
    if (fTitleFont != 62) {
-      out<<"   "<<name<<subname<<"->SetTitleFont("<<fTitleFont<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetTitleFont("<<fTitleFont<<");"<<std::endl;
    }
 }
 
diff --git a/core/base/src/TAttFill.cxx b/core/base/src/TAttFill.cxx
index 474ca6ae086..98f9b7a1bba 100644
--- a/core/base/src/TAttFill.cxx
+++ b/core/base/src/TAttFill.cxx
@@ -218,19 +218,19 @@ void TAttFill::ResetAttFill(Option_t *)
 
 
 //______________________________________________________________________________
-void TAttFill::SaveFillAttributes(ostream &out, const char *name, Int_t coldef, Int_t stydef)
+void TAttFill::SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef, Int_t stydef)
 {
     // Save fill attributes as C++ statement(s) on output stream out
 
    if (fFillColor != coldef) {
       if (fFillColor > 228) {
          TColor::SaveColor(out, fFillColor);
-         out<<"   "<<name<<"->SetFillColor(ci);" << endl;
+         out<<"   "<<name<<"->SetFillColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<"->SetFillColor("<<fFillColor<<");"<<endl;
+         out<<"   "<<name<<"->SetFillColor("<<fFillColor<<");"<<std::endl;
    }
    if (fFillStyle != stydef) {
-      out<<"   "<<name<<"->SetFillStyle("<<fFillStyle<<");"<<endl;
+      out<<"   "<<name<<"->SetFillStyle("<<fFillStyle<<");"<<std::endl;
    }
 }
 
diff --git a/core/base/src/TAttLine.cxx b/core/base/src/TAttLine.cxx
index 36402f8f0ea..c7da772e47a 100644
--- a/core/base/src/TAttLine.cxx
+++ b/core/base/src/TAttLine.cxx
@@ -250,22 +250,22 @@ void TAttLine::ResetAttLine(Option_t *)
 
 
 //______________________________________________________________________________
-void TAttLine::SaveLineAttributes(ostream &out, const char *name, Int_t coldef, Int_t stydef, Int_t widdef)
+void TAttLine::SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef, Int_t stydef, Int_t widdef)
 {
    // Save line attributes as C++ statement(s) on output stream out.
 
    if (fLineColor != coldef) {
       if (fLineColor > 228) {
          TColor::SaveColor(out, fLineColor);
-         out<<"   "<<name<<"->SetLineColor(ci);" << endl;
+         out<<"   "<<name<<"->SetLineColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<"->SetLineColor("<<fLineColor<<");"<<endl;
+         out<<"   "<<name<<"->SetLineColor("<<fLineColor<<");"<<std::endl;
    }
    if (fLineStyle != stydef) {
-      out<<"   "<<name<<"->SetLineStyle("<<fLineStyle<<");"<<endl;
+      out<<"   "<<name<<"->SetLineStyle("<<fLineStyle<<");"<<std::endl;
    }
    if (fLineWidth != widdef) {
-      out<<"   "<<name<<"->SetLineWidth("<<fLineWidth<<");"<<endl;
+      out<<"   "<<name<<"->SetLineWidth("<<fLineWidth<<");"<<std::endl;
    }
 }
 
diff --git a/core/base/src/TAttMarker.cxx b/core/base/src/TAttMarker.cxx
index 035afde1b1e..0e883a50053 100644
--- a/core/base/src/TAttMarker.cxx
+++ b/core/base/src/TAttMarker.cxx
@@ -217,22 +217,22 @@ void TAttMarker::ResetAttMarker(Option_t *)
 
 
 //______________________________________________________________________________
-void TAttMarker::SaveMarkerAttributes(ostream &out, const char *name, Int_t coldef, Int_t stydef, Int_t sizdef)
+void TAttMarker::SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef, Int_t stydef, Int_t sizdef)
 {
    // Save line attributes as C++ statement(s) on output stream out.
 
    if (fMarkerColor != coldef) {
       if (fMarkerColor > 228) {
          TColor::SaveColor(out, fMarkerColor);
-         out<<"   "<<name<<"->SetMarkerColor(ci);" << endl;
+         out<<"   "<<name<<"->SetMarkerColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<"->SetMarkerColor("<<fMarkerColor<<");"<<endl;
+         out<<"   "<<name<<"->SetMarkerColor("<<fMarkerColor<<");"<<std::endl;
    }
    if (fMarkerStyle != stydef) {
-      out<<"   "<<name<<"->SetMarkerStyle("<<fMarkerStyle<<");"<<endl;
+      out<<"   "<<name<<"->SetMarkerStyle("<<fMarkerStyle<<");"<<std::endl;
    }
    if (fMarkerSize != sizdef) {
-      out<<"   "<<name<<"->SetMarkerSize("<<fMarkerSize<<");"<<endl;
+      out<<"   "<<name<<"->SetMarkerSize("<<fMarkerSize<<");"<<std::endl;
    }
 }
 
diff --git a/core/base/src/TAttText.cxx b/core/base/src/TAttText.cxx
index 154b0a27248..e434c1d0cbb 100644
--- a/core/base/src/TAttText.cxx
+++ b/core/base/src/TAttText.cxx
@@ -304,30 +304,30 @@ void TAttText::ResetAttText(Option_t *)
 
 
 //______________________________________________________________________________
-void TAttText::SaveTextAttributes(ostream &out, const char *name, Int_t alidef,
+void TAttText::SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef,
                                   Float_t angdef, Int_t coldef, Int_t fondef,
                                   Float_t sizdef)
 {
    // Save text attributes as C++ statement(s) on output stream out.
 
    if (fTextAlign != alidef) {
-      out<<"   "<<name<<"->SetTextAlign("<<fTextAlign<<");"<<endl;
+      out<<"   "<<name<<"->SetTextAlign("<<fTextAlign<<");"<<std::endl;
    }
    if (fTextColor != coldef) {
       if (fTextColor > 228) {
          TColor::SaveColor(out, fTextColor);
-         out<<"   "<<name<<"->SetTextColor(ci);" << endl;
+         out<<"   "<<name<<"->SetTextColor(ci);" << std::endl;
       } else
-         out<<"   "<<name<<"->SetTextColor("<<fTextColor<<");"<<endl;
+         out<<"   "<<name<<"->SetTextColor("<<fTextColor<<");"<<std::endl;
    }
    if (fTextFont != fondef) {
-      out<<"   "<<name<<"->SetTextFont("<<fTextFont<<");"<<endl;
+      out<<"   "<<name<<"->SetTextFont("<<fTextFont<<");"<<std::endl;
    }
    if (fTextSize != sizdef) {
-      out<<"   "<<name<<"->SetTextSize("<<fTextSize<<");"<<endl;
+      out<<"   "<<name<<"->SetTextSize("<<fTextSize<<");"<<std::endl;
    }
    if (fTextAngle != angdef) {
-      out<<"   "<<name<<"->SetTextAngle("<<fTextAngle<<");"<<endl;
+      out<<"   "<<name<<"->SetTextAngle("<<fTextAngle<<");"<<std::endl;
    }
 }
 
diff --git a/core/base/src/TColor.cxx b/core/base/src/TColor.cxx
index 2ed06c8860a..1aecf4cd690 100644
--- a/core/base/src/TColor.cxx
+++ b/core/base/src/TColor.cxx
@@ -1385,7 +1385,7 @@ const char *TColor::PixelAsHexString(ULong_t pixel)
 
 
 //______________________________________________________________________________
-void TColor::SaveColor(ostream &out, Int_t ci)
+void TColor::SaveColor(std::ostream &out, Int_t ci)
 {
    /* Begin_html
    Save a color with index > 228 as a C++ statement(s) on output stream out.
@@ -1406,13 +1406,13 @@ void TColor::SaveColor(ostream &out, Int_t ci)
    cname.Form("#%02x%02x%02x", ri, gi, bi);
 
    if (gROOT->ClassSaved(TColor::Class())) {
-      out << endl;
+      out << std::endl;
    } else {
-      out << endl;
-      out << "   Int_t ci;   // for color index setting" << endl;
+      out << std::endl;
+      out << "   Int_t ci;   // for color index setting" << std::endl;
    }
 
-   out<<"   ci = TColor::GetColor("<<quote<<cname.Data()<<quote<<");"<<endl;
+   out<<"   ci = TColor::GetColor("<<quote<<cname.Data()<<quote<<");"<<std::endl;
 }
 
 
diff --git a/core/base/src/TExec.cxx b/core/base/src/TExec.cxx
index 0366b5bab95..497fdec2aae 100644
--- a/core/base/src/TExec.cxx
+++ b/core/base/src/TExec.cxx
@@ -156,7 +156,7 @@ void TExec::Paint(Option_t *)
 
 
 //______________________________________________________________________________
-void TExec::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TExec::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out.
 
@@ -166,7 +166,7 @@ void TExec::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    } else {
       out<<"   TExec *";
    }
-   out<<"exec = new TExec("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<"exec = new TExec("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<");"<<std::endl;
 
-   out<<"   exec->Draw();"<<endl;
+   out<<"   exec->Draw();"<<std::endl;
 }
diff --git a/core/base/src/TFileCollection.cxx b/core/base/src/TFileCollection.cxx
index 573ba5b4cd4..9c7384e1238 100644
--- a/core/base/src/TFileCollection.cxx
+++ b/core/base/src/TFileCollection.cxx
@@ -116,7 +116,7 @@ Int_t TFileCollection::AddFromFile(const char *textfile, Int_t nfiles, Int_t fir
    Int_t nf = 0;
    TString fn(textfile);
    if (!fn.IsNull() && !gSystem->ExpandPathName(fn)) {
-      ifstream f;
+      std::ifstream f;
       f.open(fn);
       if (f.is_open()) {
          Bool_t all = (nfiles <= 0) ? kTRUE : kFALSE;
diff --git a/core/base/src/TFolder.cxx b/core/base/src/TFolder.cxx
index a5fa4ceeb59..e4162f7018d 100644
--- a/core/base/src/TFolder.cxx
+++ b/core/base/src/TFolder.cxx
@@ -156,7 +156,7 @@ TFolder::~TFolder()
    TCollection::EmptyGarbageCollection();
    
    if (gDebug)
-      cerr << "TFolder dtor called for "<< GetName() << endl;
+      std::cerr << "TFolder dtor called for "<< GetName() << std::endl;
 }
 
 //______________________________________________________________________________
@@ -388,7 +388,7 @@ void TFolder::ls(Option_t *option) const
 
    if (!fFolders) return;
    TROOT::IndentLevel();
-   cout <<ClassName()<<"*\t\t"<<GetName()<<"\t"<<GetTitle()<<endl;
+   std::cout <<ClassName()<<"*\t\t"<<GetName()<<"\t"<<GetTitle()<<std::endl;
    TROOT::IncreaseDirLevel();
 
    TString opt = option;
diff --git a/core/base/src/TMacro.cxx b/core/base/src/TMacro.cxx
index 4541edc35c0..ca6f0e52dd5 100644
--- a/core/base/src/TMacro.cxx
+++ b/core/base/src/TMacro.cxx
@@ -304,7 +304,7 @@ Int_t TMacro::ReadFile(const char *filename)
    // Read lines in filename in this macro.
 
    if (!fLines) fLines = new TList();
-   ifstream in;
+   std::ifstream in;
    in.open(filename);
    if (!in.good()) {
       Error("ReadFile","Cannot open file: %s",filename);
@@ -328,8 +328,8 @@ void TMacro::SaveSource(const char *filename)
 {
    // Save macro source in filename.
 
-   ofstream out;
-   out.open(filename, ios::out);
+   std::ofstream out;
+   out.open(filename, std::ios::out);
    if (!out.good ()) {
       Printf("SaveSource cannot open file: %s",filename);
       return;
@@ -338,33 +338,33 @@ void TMacro::SaveSource(const char *filename)
    TIter next(fLines);
    TObjString *obj;
    while ((obj = (TObjString*) next())) {
-      out<<obj->GetName()<<endl;
+      out<<obj->GetName()<<std::endl;
    }
    out.close();
 }
 
 //______________________________________________________________________________
-void TMacro::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TMacro::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save macro source on stream out.
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TMacro::Class())) {
       out<<"   ";
    } else {
       out<<"   "<<ClassName()<<" *";
    }
-   out<<"macro = new "<<ClassName()<<"("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<"macro = new "<<ClassName()<<"("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<");"<<std::endl;
    if (!fLines) return;
    TIter next(fLines);
    TObjString *obj;
    while ((obj = (TObjString*) next())) {
       TString s = obj->GetName();
       s.ReplaceAll("\"","\\\"");
-      out<<"   macro->AddLine("<<quote<<s.Data()<<quote<<");"<<endl;
+      out<<"   macro->AddLine("<<quote<<s.Data()<<quote<<");"<<std::endl;
    }
-   out<<"   macro->Draw("<<quote<<option<<quote<<");"<<endl;
+   out<<"   macro->Draw("<<quote<<option<<quote<<");"<<std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/core/base/src/TNamed.cxx b/core/base/src/TNamed.cxx
index 78b1d20e5c2..ef851d3e67c 100644
--- a/core/base/src/TNamed.cxx
+++ b/core/base/src/TNamed.cxx
@@ -104,8 +104,8 @@ void TNamed::ls(Option_t *) const
    // List TNamed name and title.
 
    TROOT::IndentLevel();
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
-        << Int_t(TestBit(kCanDelete)) << " at: "<<this<< endl;
+   std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
+        << Int_t(TestBit(kCanDelete)) << " at: "<<this<< std::endl;
 }
 
 //______________________________________________________________________________
@@ -113,7 +113,7 @@ void TNamed::Print(Option_t *) const
 {
    // Print TNamed name and title.
 
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
+   std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/core/base/src/TObject.cxx b/core/base/src/TObject.cxx
index daa4514285f..a3a22ad3989 100644
--- a/core/base/src/TObject.cxx
+++ b/core/base/src/TObject.cxx
@@ -539,12 +539,12 @@ void TObject::ls(Option_t *option) const
    // is typically much less verbose then Dump().
 
    TROOT::IndentLevel();
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : ";
-   cout << Int_t(TestBit(kCanDelete));  
+   std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : ";
+   std::cout << Int_t(TestBit(kCanDelete));  
    if (strstr(option,"noaddr")==0) {
-      cout <<" at: "<< this ;
+      std::cout <<" at: "<< this ;
    }
-   cout << endl;
+   std::cout << std::endl;
 }
 
 //______________________________________________________________________________
@@ -596,7 +596,7 @@ void TObject::Print(Option_t *) const
 {
    // This method must be overridden when a class wants to print itself.
 
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
+   std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
 }
 
 //______________________________________________________________________________
@@ -653,28 +653,28 @@ void TObject::SaveAs(const char *filename, Option_t *option) const
    } else {
       fname = Form("%s.C", GetName());
    }
-   ofstream out;
-   out.open(fname, ios::out);
+   std::ofstream out;
+   out.open(fname, std::ios::out);
    if (!out.good ()) {
       Error("SaveAs", "cannot open file: %s", fname);
       return;
    }
-   out <<"{"<<endl;
-   out <<"//========= Macro generated from object: "<<GetName()<<"/"<<GetTitle()<<endl;
-   out <<"//========= by ROOT version"<<gROOT->GetVersion()<<endl;
+   out <<"{"<<std::endl;
+   out <<"//========= Macro generated from object: "<<GetName()<<"/"<<GetTitle()<<std::endl;
+   out <<"//========= by ROOT version"<<gROOT->GetVersion()<<std::endl;
    ((TObject*)this)->SavePrimitive(out,option);
-   out <<"}"<<endl;
+   out <<"}"<<std::endl;
    out.close();
    Info("SaveAs", "C++ Macro file: %s has been generated", fname);
 }
 
 //______________________________________________________________________________
-void TObject::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TObject::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
 
    out << "//Primitive: " << GetName() << "/" << GetTitle()
-       <<". You must implement " << ClassName() << "::SavePrimitive" << endl;
+       <<". You must implement " << ClassName() << "::SavePrimitive" << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/core/base/src/TPRegexp.cxx b/core/base/src/TPRegexp.cxx
index 90bc9e421c3..09c5cbdef41 100644
--- a/core/base/src/TPRegexp.cxx
+++ b/core/base/src/TPRegexp.cxx
@@ -353,9 +353,9 @@ TObjArray *TPRegexp::MatchS(const TString &s, const TString &mods,
    // TObjArray *subStrL = TPRegexp("(a|(z))(bc)").MatchS("abc");
    // for (Int_t i = 0; i < subStrL->GetLast()+1; i++) {
    //    const TString subStr = ((TObjString *)subStrL->At(i))->GetString();
-   //    cout << "\"" << subStr << "\" ";
+   //    std::cout << "\"" << subStr << "\" ";
    // }
-   // cout << subStr << endl;
+   // std::cout << subStr << std::endl;
    //
    // produces:  "abc" "a" "" "bc"
    // For meaning of mods see ParseMods().
@@ -456,7 +456,7 @@ Int_t TPRegexp::Substitute(TString &s, const TString &replacePattern,
    //
    // TString s("aap noot mies");
    // const Int_t nrSub = TPRegexp("(\\w*) noot (\\w*)").Substitute(s,"$2 noot $1");
-   // cout << nrSub << " \"" << s << "\"" <<endl;
+   // std::cout << nrSub << " \"" << s << "\"" <<std::endl;
    //
    // produces: 2 "mies noot aap"
    // For meaning of mods see ParseMods().
diff --git a/core/base/src/TQConnection.cxx b/core/base/src/TQConnection.cxx
index de00d4c3a37..179dcfd6056 100644
--- a/core/base/src/TQConnection.cxx
+++ b/core/base/src/TQConnection.cxx
@@ -412,8 +412,8 @@ void TQSlot::Print(Option_t *) const
 {
    // Print info about slot.
 
-   cout <<IsA()->GetName() << "\t" << GetName() << "\t"
-   << "Number of Connections = " << References() << endl;
+   std::cout <<IsA()->GetName() << "\t" << GetName() << "\t"
+   << "Number of Connections = " << References() << std::endl;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -591,7 +591,7 @@ void TQConnection::ls(Option_t *option) const
    // List TQConnection full method name and list all signals
    // connected to this connection.
 
-   cout << "\t" <<  IsA()->GetName() << "\t" << GetName() << endl;
+   std::cout << "\t" <<  IsA()->GetName() << "\t" << GetName() << std::endl;
    ((TQConnection*)this)->R__FOR_EACH(TList,ls)(option);
 }
 
@@ -602,7 +602,7 @@ void TQConnection::PrintCollectionHeader(Option_t *) const
    // signals connected to this connection.
 
    TROOT::IndentLevel();
-   cout << IsA()->GetName() << "\t" << fReceiver << "\t" << GetName() << endl;
+   std::cout << IsA()->GetName() << "\t" << fReceiver << "\t" << GetName() << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/core/base/src/TQObject.cxx b/core/base/src/TQObject.cxx
index b2982a121c3..80a707644ac 100644
--- a/core/base/src/TQObject.cxx
+++ b/core/base/src/TQObject.cxx
@@ -457,7 +457,7 @@ void TQConnectionList::ls(Option_t *option) const
 {
    // List signal name and list all connections in this signal list.
 
-   cout <<  "TQConnectionList:" << "\t" << GetName() << endl;
+   std::cout <<  "TQConnectionList:" << "\t" << GetName() << std::endl;
    ((TQConnectionList*)this)->R__FOR_EACH(TQConnection,Print)(option);
 }
 
diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx
index f47c1681691..b51fcfaa181 100644
--- a/core/base/src/TROOT.cxx
+++ b/core/base/src/TROOT.cxx
@@ -330,7 +330,7 @@ TROOT::TROOT(const char *name, const char *title, VoidFuncPtr_t *initfunc)
    fPluginManager->LoadHandlersFromEnv(gEnv);
 #if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
    if (TARGET_OS_IPHONE | TARGET_IPHONE_SIMULATOR) {
-      TEnv plugins(".plugins-ios");
+      TEnv plugins(".plugins-std::ios");
       fPluginManager->LoadHandlersFromEnv(&plugins);
    }
 #endif
@@ -2014,7 +2014,7 @@ void TROOT::IndentLevel()
 {
    // Functions used by ls() to indent an object hierarchy.
 
-   for (int i = 0; i < fgDirLevel; i++) cout.put(' ');
+   for (int i = 0; i < fgDirLevel; i++) std::cout.put(' ');
 }
 
 //______________________________________________________________________________
diff --git a/core/base/src/TString.cxx b/core/base/src/TString.cxx
index b1010e2d953..c710fe48e87 100644
--- a/core/base/src/TString.cxx
+++ b/core/base/src/TString.cxx
@@ -2064,9 +2064,9 @@ TString TString::Itoa(Int_t value, Int_t base)
    // Thus it is an enhanced version of sprintf (adapted from versions 0.4 of
    // http://www.jb.man.ac.uk/~slowe/cpp/itoa.html).
    // Usage: the following statement produce the same output, namely "1111"
-   //   cout << TString::Itoa(15,2) ;
-   //   cout << TString::Itoa(0xF,2) ; /// 0x prefix to handle hex
-   //   cout << TString::Itoa(017,2) ; /// 0  prefix to handle oct
+   //   std::cout << TString::Itoa(15,2) ;
+   //   std::cout << TString::Itoa(0xF,2) ; /// 0x prefix to handle hex
+   //   std::cout << TString::Itoa(017,2) ; /// 0  prefix to handle oct
    // In case of error returns the "!" string.
 
    std::string buf;
diff --git a/core/base/src/TStyle.cxx b/core/base/src/TStyle.cxx
index 07c0ff4f70f..5202bd00ebb 100644
--- a/core/base/src/TStyle.cxx
+++ b/core/base/src/TStyle.cxx
@@ -1535,8 +1535,8 @@ void TStyle::SaveSource(const char *filename, Option_t *option)
    sname[i] = 0;
 
    // Tries to open the file.
-   ofstream out;
-   out.open(ff.Data(), ios::out);
+   std::ofstream out;
+   out.open(ff.Data(), std::ios::out);
    if (!out.good()) {
       delete [] sname;
       Error("SaveSource", "cannot open file: %s", ff.Data());
@@ -1545,28 +1545,28 @@ void TStyle::SaveSource(const char *filename, Option_t *option)
 
    // Writes macro header, date/time stamp as string, and the used Root version
    TDatime t;
-   out <<"// Mainframe macro generated from application: " << gApplication->Argv(0) << endl;
-   out <<"// By ROOT version " << gROOT->GetVersion() << " on " << t.AsSQLString() << endl;
-   out << endl;
+   out <<"// Mainframe macro generated from application: " << gApplication->Argv(0) << std::endl;
+   out <<"// By ROOT version " << gROOT->GetVersion() << " on " << t.AsSQLString() << std::endl;
+   out << std::endl;
 
    char quote = '"';
 
    // Writes include.
-   out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << endl << endl;
-   out << "#ifndef ROOT_TStyle" << endl;
-   out << "#include " << quote << "TStyle.h" << quote << endl;
-   out << "#endif" << endl;
-   out << endl << "#endif" << endl;
+   out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << std::endl << std::endl;
+   out << "#ifndef ROOT_TStyle" << std::endl;
+   out << "#include " << quote << "TStyle.h" << quote << std::endl;
+   out << "#endif" << std::endl;
+   out << std::endl << "#endif" << std::endl;
 
    // Writes the macro entry point equal to the fname
-   out << endl;
-   out << "void " << sname << "()" << endl;
-   out << "{" << endl;
+   out << std::endl;
+   out << "void " << sname << "()" << std::endl;
+   out << "{" << std::endl;
    delete [] sname;
 
    TStyle::SavePrimitive(out, option);
 
-   out << "}" << endl;
+   out << "}" << std::endl;
    out.close();
 
    printf(" C++ macro file %s has been generated\n", gSystem->BaseName(ff));
@@ -1574,217 +1574,217 @@ void TStyle::SaveSource(const char *filename, Option_t *option)
 
 
 //______________________________________________________________________________
-void TStyle::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TStyle::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save a main frame widget as a C++ statement(s) on output stream out.
 
    char quote = '"';
 
-   out << "   // Add the saved style to the current ROOT session." << endl;
-   out << endl;
-   out<<"   "<<"delete gROOT->GetStyle("<<quote<<GetName()<<quote<<");"<< endl;
-   out << endl;
+   out << "   // Add the saved style to the current ROOT session." << std::endl;
+   out << std::endl;
+   out<<"   "<<"delete gROOT->GetStyle("<<quote<<GetName()<<quote<<");"<< std::endl;
+   out << std::endl;
    out<<"   "<<"TStyle *tmpStyle = new TStyle("
                            << quote << GetName()  << quote << ", "
-                           << quote << GetTitle() << quote << ");" << endl;
+                           << quote << GetTitle() << quote << ");" << std::endl;
 
    // fXAxis, fYAxis and fZAxis
-   out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("x") <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("y") <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("z") <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("x")  <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("y")  <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("z")  <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("x") <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("y") <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("z") <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("x")  <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("y")  <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("z")  <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("x")<<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("y")<<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("z")<<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("x")  <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("y")  <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("z")  <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("x") <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("y") <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("z") <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("x")<<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("y")<<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("z")<<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("x")  <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("y")  <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("z")  <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("x") <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("y") <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("z") <<", \"z\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("x")  <<", \"x\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("y")  <<", \"y\");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("z")  <<", \"z\");"<<endl;
-
-   out<<"   "<<"tmpStyle->SetBarWidth("       <<GetBarWidth()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetBarOffset("      <<GetBarOffset()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetDrawBorder("     <<GetDrawBorder()     <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetOptLogx("        <<GetOptLogx()        <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetOptLogy("        <<GetOptLogy()        <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetOptLogz("        <<GetOptLogz()        <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetOptDate("        <<GetOptDate()        <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetOptStat("        <<GetOptStat()        <<");"<<endl;
-
-   if (GetOptTitle()) out << "   tmpStyle->SetOptTitle(kTRUE);"  << endl;
-   else               out << "   tmpStyle->SetOptTitle(kFALSE);" << endl;
-   out<<"   "<<"tmpStyle->SetOptFit("         <<GetOptFit()         <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetNumberContours(" <<GetNumberContours() <<");"<<endl;
+   out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("x") <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("y") <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("z") <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("x")  <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("y")  <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("z")  <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("x") <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("y") <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("z") <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("x")  <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("y")  <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("z")  <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("x")<<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("y")<<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("z")<<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("x")  <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("y")  <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("z")  <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("x") <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("y") <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("z") <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("x")<<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("y")<<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("z")<<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("x")  <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("y")  <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("z")  <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("x") <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("y") <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("z") <<", \"z\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("x")  <<", \"x\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("y")  <<", \"y\");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("z")  <<", \"z\");"<<std::endl;
+
+   out<<"   "<<"tmpStyle->SetBarWidth("       <<GetBarWidth()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetBarOffset("      <<GetBarOffset()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetDrawBorder("     <<GetDrawBorder()     <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetOptLogx("        <<GetOptLogx()        <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetOptLogy("        <<GetOptLogy()        <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetOptLogz("        <<GetOptLogz()        <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetOptDate("        <<GetOptDate()        <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetOptStat("        <<GetOptStat()        <<");"<<std::endl;
+
+   if (GetOptTitle()) out << "   tmpStyle->SetOptTitle(kTRUE);"  << std::endl;
+   else               out << "   tmpStyle->SetOptTitle(kFALSE);" << std::endl;
+   out<<"   "<<"tmpStyle->SetOptFit("         <<GetOptFit()         <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetNumberContours(" <<GetNumberContours() <<");"<<std::endl;
 
    // fAttDate
-   out<<"   "<<"tmpStyle->GetAttDate()->SetTextFont(" <<GetAttDate()->GetTextFont() <<");"<<endl;
-   out<<"   "<<"tmpStyle->GetAttDate()->SetTextSize(" <<GetAttDate()->GetTextSize() <<");"<<endl;
-   out<<"   "<<"tmpStyle->GetAttDate()->SetTextAngle("<<GetAttDate()->GetTextAngle()<<");"<<endl;
-   out<<"   "<<"tmpStyle->GetAttDate()->SetTextAlign("<<GetAttDate()->GetTextAlign()<<");"<<endl;
-   out<<"   "<<"tmpStyle->GetAttDate()->SetTextColor("<<GetAttDate()->GetTextColor()<<");"<<endl;
-
-   out<<"   "<<"tmpStyle->SetDateX("           <<GetDateX()           <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetDateY("           <<GetDateY()           <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetEndErrorSize("    <<GetEndErrorSize()    <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetErrorX("          <<GetErrorX()          <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFuncColor("       <<GetFuncColor()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFuncStyle("       <<GetFuncStyle()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFuncWidth("       <<GetFuncWidth()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetGridColor("       <<GetGridColor()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetGridStyle("       <<GetGridStyle()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetGridWidth("       <<GetGridWidth()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetLegendBorderSize("<<GetLegendBorderSize()<<");"<<endl;
-   out<<"   "<<"tmpStyle->SetLegendFillColor(" <<GetLegendFillColor() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetLegendFont("      <<GetLegendFont()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHatchesLineWidth("<<GetHatchesLineWidth()<<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHatchesSpacing("  <<GetHatchesSpacing()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameFillColor("  <<GetFrameFillColor()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameLineColor("  <<GetFrameLineColor()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameFillStyle("  <<GetFrameFillStyle()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameLineStyle("  <<GetFrameLineStyle()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameLineWidth("  <<GetFrameLineWidth()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameBorderSize(" <<GetFrameBorderSize() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetFrameBorderMode(" <<GetFrameBorderMode() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHistFillColor("   <<GetHistFillColor()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHistLineColor("   <<GetHistLineColor()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHistFillStyle("   <<GetHistFillStyle()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHistLineStyle("   <<GetHistLineStyle()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetHistLineWidth("   <<GetHistLineWidth()   <<");"<<endl;
-   if (GetHistMinimumZero()) out<<"   tmpStyle->SetHistMinimumZero(kTRUE);" <<endl;
-   else                      out<<"   tmpStyle->SetHistMinimumZero(kFALSE);"<<endl;
-   if (GetCanvasPreferGL()) out<<"   tmpStyle->SetCanvasPreferGL(kTRUE);" <<endl;
-   else                     out<<"   tmpStyle->SetCanvasPreferGL(kFALSE);"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasColor("     <<GetCanvasColor()     <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasBorderSize("<<GetCanvasBorderSize()<<");"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasBorderMode("<<GetCanvasBorderMode()<<");"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasDefH("      <<GetCanvasDefH()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasDefW("      <<GetCanvasDefW()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasDefX("      <<GetCanvasDefX()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetCanvasDefY("      <<GetCanvasDefY()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadColor("        <<GetPadColor()        <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadBorderSize("   <<GetPadBorderSize()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadBorderMode("   <<GetPadBorderMode()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadBottomMargin(" <<GetPadBottomMargin() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadTopMargin("    <<GetPadTopMargin()    <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadLeftMargin("   <<GetPadLeftMargin()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadRightMargin("  <<GetPadRightMargin()  <<");"<<endl;
-   if (GetPadGridX()) out<<"   tmpStyle->SetPadGridX(kTRUE);" <<endl;
-   else               out<<"   tmpStyle->SetPadGridX(kFALSE);"<<endl;
-   if (GetPadGridY()) out<<"   tmpStyle->SetPadGridY(kTRUE);" <<endl;
-   else               out<<"   tmpStyle->SetPadGridY(kFALSE);"<<endl;
-   out<<"   "<<"tmpStyle->SetPadTickX("        <<GetPadTickX()         <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetPadTickY("        <<GetPadTickY()         <<");"<<endl;
+   out<<"   "<<"tmpStyle->GetAttDate()->SetTextFont(" <<GetAttDate()->GetTextFont() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->GetAttDate()->SetTextSize(" <<GetAttDate()->GetTextSize() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->GetAttDate()->SetTextAngle("<<GetAttDate()->GetTextAngle()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->GetAttDate()->SetTextAlign("<<GetAttDate()->GetTextAlign()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->GetAttDate()->SetTextColor("<<GetAttDate()->GetTextColor()<<");"<<std::endl;
+
+   out<<"   "<<"tmpStyle->SetDateX("           <<GetDateX()           <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetDateY("           <<GetDateY()           <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetEndErrorSize("    <<GetEndErrorSize()    <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetErrorX("          <<GetErrorX()          <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFuncColor("       <<GetFuncColor()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFuncStyle("       <<GetFuncStyle()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFuncWidth("       <<GetFuncWidth()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetGridColor("       <<GetGridColor()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetGridStyle("       <<GetGridStyle()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetGridWidth("       <<GetGridWidth()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLegendBorderSize("<<GetLegendBorderSize()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLegendFillColor(" <<GetLegendFillColor() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLegendFont("      <<GetLegendFont()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHatchesLineWidth("<<GetHatchesLineWidth()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHatchesSpacing("  <<GetHatchesSpacing()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameFillColor("  <<GetFrameFillColor()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameLineColor("  <<GetFrameLineColor()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameFillStyle("  <<GetFrameFillStyle()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameLineStyle("  <<GetFrameLineStyle()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameLineWidth("  <<GetFrameLineWidth()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameBorderSize(" <<GetFrameBorderSize() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetFrameBorderMode(" <<GetFrameBorderMode() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHistFillColor("   <<GetHistFillColor()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHistLineColor("   <<GetHistLineColor()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHistFillStyle("   <<GetHistFillStyle()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHistLineStyle("   <<GetHistLineStyle()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetHistLineWidth("   <<GetHistLineWidth()   <<");"<<std::endl;
+   if (GetHistMinimumZero()) out<<"   tmpStyle->SetHistMinimumZero(kTRUE);" <<std::endl;
+   else                      out<<"   tmpStyle->SetHistMinimumZero(kFALSE);"<<std::endl;
+   if (GetCanvasPreferGL()) out<<"   tmpStyle->SetCanvasPreferGL(kTRUE);" <<std::endl;
+   else                     out<<"   tmpStyle->SetCanvasPreferGL(kFALSE);"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasColor("     <<GetCanvasColor()     <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasBorderSize("<<GetCanvasBorderSize()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasBorderMode("<<GetCanvasBorderMode()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasDefH("      <<GetCanvasDefH()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasDefW("      <<GetCanvasDefW()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasDefX("      <<GetCanvasDefX()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetCanvasDefY("      <<GetCanvasDefY()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadColor("        <<GetPadColor()        <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadBorderSize("   <<GetPadBorderSize()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadBorderMode("   <<GetPadBorderMode()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadBottomMargin(" <<GetPadBottomMargin() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadTopMargin("    <<GetPadTopMargin()    <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadLeftMargin("   <<GetPadLeftMargin()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadRightMargin("  <<GetPadRightMargin()  <<");"<<std::endl;
+   if (GetPadGridX()) out<<"   tmpStyle->SetPadGridX(kTRUE);" <<std::endl;
+   else               out<<"   tmpStyle->SetPadGridX(kFALSE);"<<std::endl;
+   if (GetPadGridY()) out<<"   tmpStyle->SetPadGridY(kTRUE);" <<std::endl;
+   else               out<<"   tmpStyle->SetPadGridY(kFALSE);"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadTickX("        <<GetPadTickX()         <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetPadTickY("        <<GetPadTickY()         <<");"<<std::endl;
 
    // fPaperSizeX, fPaperSizeY
    out<<"   "<<"tmpStyle->SetPaperSize("       <<fPaperSizeX          <<", "
-                                             <<fPaperSizeY          <<");"<<endl;
-
-   out<<"   "<<"tmpStyle->SetScreenFactor("   <<GetScreenFactor()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatColor("      <<GetStatColor()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatTextColor("  <<GetStatTextColor()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatBorderSize(" <<GetStatBorderSize() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatFont("       <<GetStatFont()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatFontSize("   <<GetStatFontSize()   <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatStyle("      <<GetStatStyle()      <<");"<<endl;
+                                             <<fPaperSizeY          <<");"<<std::endl;
+
+   out<<"   "<<"tmpStyle->SetScreenFactor("   <<GetScreenFactor()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatColor("      <<GetStatColor()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatTextColor("  <<GetStatTextColor()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatBorderSize(" <<GetStatBorderSize() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatFont("       <<GetStatFont()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatFontSize("   <<GetStatFontSize()   <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatStyle("      <<GetStatStyle()      <<");"<<std::endl;
    out<<"   "<<"tmpStyle->SetStatFormat("     <<quote << GetStatFormat()
-                                            <<quote               <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatX("          <<GetStatX()          <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatY("          <<GetStatY()          <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatW("          <<GetStatW()          <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetStatH("          <<GetStatH()          <<");"<<endl;
-   if (GetStripDecimals()) out<<"   tmpStyle->SetStripDecimals(kTRUE);" <<endl;
-   else                    out<<"   tmpStyle->SetStripDecimals(kFALSE);"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleAlign("     <<GetTitleAlign()     <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleFillColor(" <<GetTitleFillColor() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleTextColor(" <<GetTitleTextColor() <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleBorderSize("<<GetTitleBorderSize()<<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleFont("      <<GetTitleFont()      <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleFontSize("  <<GetTitleFontSize()  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleStyle("     <<GetTitleStyle()     <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleX("         <<GetTitleX()         <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleY("         <<GetTitleY()         <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleW("         <<GetTitleW()         <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetTitleH("         <<GetTitleH()         <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetLegoInnerR("     <<GetLegoInnerR()     <<");"<<endl;
-   out<<endl;
+                                            <<quote               <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatX("          <<GetStatX()          <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatY("          <<GetStatY()          <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatW("          <<GetStatW()          <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetStatH("          <<GetStatH()          <<");"<<std::endl;
+   if (GetStripDecimals()) out<<"   tmpStyle->SetStripDecimals(kTRUE);" <<std::endl;
+   else                    out<<"   tmpStyle->SetStripDecimals(kFALSE);"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleAlign("     <<GetTitleAlign()     <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleFillColor(" <<GetTitleFillColor() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleTextColor(" <<GetTitleTextColor() <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleBorderSize("<<GetTitleBorderSize()<<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleFont("      <<GetTitleFont()      <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleFontSize("  <<GetTitleFontSize()  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleStyle("     <<GetTitleStyle()     <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleX("         <<GetTitleX()         <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleY("         <<GetTitleY()         <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleW("         <<GetTitleW()         <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetTitleH("         <<GetTitleH()         <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLegoInnerR("     <<GetLegoInnerR()     <<");"<<std::endl;
+   out<<std::endl;
 
    // fPalette
    out<<"   "<<"Int_t fPaletteColor["       <<GetNumberOfColors() <<"] = {";
    for (Int_t ci=0; ci<GetNumberOfColors()-1; ++ci) {
       if (ci % 10 == 9)
-         out<<endl<<"                             ";
+         out<<std::endl<<"                             ";
       out<<GetColorPalette(ci)<<", ";
    }
-   out<<GetColorPalette(GetNumberOfColors() - 1)                <<"};"<<endl;
+   out<<GetColorPalette(GetNumberOfColors() - 1)                <<"};"<<std::endl;
    out<<"   "<<"tmpStyle->SetPalette("        << GetNumberOfColors()
-                                            << ", fPaletteColor);" << endl;
-   out<<endl;
+                                            << ", fPaletteColor);" << std::endl;
+   out<<std::endl;
 
    // fLineStyle
    out<<"   "<<"TString fLineStyleArrayTmp[30] = {";
    for (Int_t li=0; li<29; ++li) {
       if (li % 5 == 4)
-         out<<endl<<"                             ";
+         out<<std::endl<<"                             ";
       out<<quote << fLineStyle[li].Data() << quote << ", ";
    }
-   out<<quote<<fLineStyle[29].Data()<<quote<<"};"<<endl;
-   out<<"   "<<"for (Int_t i=0; i<30; i++)"<<endl;
-   out<<"   "<<"   tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]);"<<endl;
-   out<<endl;
+   out<<quote<<fLineStyle[29].Data()<<quote<<"};"<<std::endl;
+   out<<"   "<<"for (Int_t i=0; i<30; i++)"<<std::endl;
+   out<<"   "<<"   tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]);"<<std::endl;
+   out<<std::endl;
 
    out<<"   "<<"tmpStyle->SetHeaderPS("       <<quote<<GetHeaderPS()
-                                            <<quote                  <<");"<<endl;
+                                            <<quote                  <<");"<<std::endl;
    out<<"   "<<"tmpStyle->SetTitlePS("        <<quote<<GetTitlePS()
-                                            <<quote                  <<");"<<endl;
+                                            <<quote                  <<");"<<std::endl;
    out<<"   "<<"tmpStyle->SetFitFormat("      <<quote<<GetFitFormat()
-                                            <<quote                  <<");"<<endl;
+                                            <<quote                  <<");"<<std::endl;
    out<<"   "<<"tmpStyle->SetPaintTextFormat("<<quote<<GetPaintTextFormat()
-                                            <<quote                  <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetLineScalePS("    <<GetLineScalePS()       <<");"<<endl;
-   out<<"   "<<"tmpStyle->SetColorModelPS("   <<GetColorModelPS()      <<");"<<endl;
-   out<<"   "<<Form("tmpStyle->SetTimeOffset(%9.0f);", GetTimeOffset()) <<endl;
-   out<<endl;
+                                            <<quote                  <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetLineScalePS("    <<GetLineScalePS()       <<");"<<std::endl;
+   out<<"   "<<"tmpStyle->SetColorModelPS("   <<GetColorModelPS()      <<");"<<std::endl;
+   out<<"   "<<Form("tmpStyle->SetTimeOffset(%9.0f);", GetTimeOffset()) <<std::endl;
+   out<<std::endl;
 
    // Inheritance :
    // TAttLine :
-   out <<"   " <<"tmpStyle->SetLineColor(" <<GetLineColor() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetLineStyle(" <<GetLineStyle() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetLineWidth(" <<GetLineWidth() <<");" <<endl;
+   out <<"   " <<"tmpStyle->SetLineColor(" <<GetLineColor() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetLineStyle(" <<GetLineStyle() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetLineWidth(" <<GetLineWidth() <<");" <<std::endl;
 
    // TAttFill
-   out <<"   " <<"tmpStyle->SetFillColor(" <<GetFillColor() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetFillStyle(" <<GetFillStyle() <<");" <<endl;
+   out <<"   " <<"tmpStyle->SetFillColor(" <<GetFillColor() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetFillStyle(" <<GetFillStyle() <<");" <<std::endl;
 
    // TAttMarker
-   out <<"   " <<"tmpStyle->SetMarkerColor(" <<GetMarkerColor() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetMarkerSize("  <<GetMarkerSize() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetMarkerStyle(" <<GetMarkerStyle() <<");" <<endl;
+   out <<"   " <<"tmpStyle->SetMarkerColor(" <<GetMarkerColor() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetMarkerSize("  <<GetMarkerSize() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetMarkerStyle(" <<GetMarkerStyle() <<");" <<std::endl;
 
    // TAttText
-   out <<"   " <<"tmpStyle->SetTextAlign(" <<GetTextAlign() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetTextAngle(" <<GetTextAngle() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetTextColor(" <<GetTextColor() <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetTextFont("  <<GetTextFont()  <<");" <<endl;
-   out <<"   " <<"tmpStyle->SetTextSize("  <<GetTextSize()  <<");" <<endl;
+   out <<"   " <<"tmpStyle->SetTextAlign(" <<GetTextAlign() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetTextAngle(" <<GetTextAngle() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetTextColor(" <<GetTextColor() <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetTextFont("  <<GetTextFont()  <<");" <<std::endl;
+   out <<"   " <<"tmpStyle->SetTextSize("  <<GetTextSize()  <<");" <<std::endl;
 }
diff --git a/core/base/src/TSystem.cxx b/core/base/src/TSystem.cxx
index dc5feea2a25..3bc48693e23 100644
--- a/core/base/src/TSystem.cxx
+++ b/core/base/src/TSystem.cxx
@@ -3223,15 +3223,15 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
    TString linkdef;
    AssignAndDelete( linkdef, ConcatFileName( build_loc, libname ) );
    linkdef += "_ACLiC_linkdef.h";
-   ofstream linkdefFile( linkdef, ios::out );
+   std::ofstream linkdefFile( linkdef, std::ios::out );
    linkdefFile << "// File Automatically generated by the ROOT Script Compiler "
-               << endl;
-   linkdefFile << endl;
-   linkdefFile << "#ifdef __CINT__" << endl;
-   linkdefFile << endl;
-   linkdefFile << "#pragma link C++ nestedclasses;" << endl;
-   linkdefFile << "#pragma link C++ nestedtypedefs;" << endl;
-   linkdefFile << endl;
+               << std::endl;
+   linkdefFile << std::endl;
+   linkdefFile << "#ifdef __CINT__" << std::endl;
+   linkdefFile << std::endl;
+   linkdefFile << "#pragma link C++ nestedclasses;" << std::endl;
+   linkdefFile << "#pragma link C++ nestedtypedefs;" << std::endl;
+   linkdefFile << std::endl;
 
    // We want to look for a header file that has the same name as the macro
 
@@ -3246,7 +3246,7 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
       name = Which(incPath,extra_linkdef);
       if (name) {
          if (gDebug>4) Info("ACLiC","including extra linkdef file: %s",name);
-         linkdefFile << "#include \"" << name << "\"" << endl;
+         linkdefFile << "#include \"" << name << "\"" << std::endl;
          delete [] name;
       }
    }
@@ -3258,13 +3258,13 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
       lookup.Append(extensions[i]);
       name = Which(incPath,lookup);
       if (name) {
-         linkdefFile << "#pragma link C++ defined_in "<<name<<";"<< endl;
+         linkdefFile << "#pragma link C++ defined_in "<<name<<";"<< std::endl;
          delete [] name;
       }
    }
-   linkdefFile << "#pragma link C++ defined_in \""<<filename_fullpath << "\";" << endl;
-   linkdefFile << endl;
-   linkdefFile << "#endif" << endl;
+   linkdefFile << "#pragma link C++ defined_in \""<<filename_fullpath << "\";" << std::endl;
+   linkdefFile << std::endl;
+   linkdefFile << "#endif" << std::endl;
    linkdefFile.close();
 
    // ======= Generate the list of rootmap files to be looked at
@@ -3281,7 +3281,7 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
       needLoadMap = kTRUE;
    }
 
-   ofstream mapfileStream( mapfilein, ios::out );
+   std::ofstream mapfileStream( mapfilein, std::ios::out );
    {
       TString name = ".rootmap";
       TString sname = "system.rootmap";
@@ -3307,13 +3307,13 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
          }
       }
 #endif
-      mapfileStream << file << endl;
+      mapfileStream << file << std::endl;
       AssignAndDelete(file, ConcatFileName(gSystem->HomeDirectory(), name) );
-      mapfileStream << file << endl;
-      mapfileStream << name << endl;
+      mapfileStream << file << std::endl;
+      mapfileStream << name << std::endl;
       if (gInterpreter->GetRootMapFiles()) {
          for (i = 0; i < gInterpreter->GetRootMapFiles()->GetEntriesFast(); i++) {
-            mapfileStream << ((TNamed*)gInterpreter->GetRootMapFiles()->At(i))->GetTitle() << endl;
+            mapfileStream << ((TNamed*)gInterpreter->GetRootMapFiles()->At(i))->GetTitle() << std::endl;
          }
       }
    }
@@ -3369,9 +3369,9 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
       TString linkedlibs = GetLibraries("", "S");
       TString libtoload;
       TString all_libtoload;
-      ifstream liblist(mapfileout);
+      std::ifstream liblist(mapfileout);
 
-      ofstream libmapfile;
+      std::ofstream libmapfile;
       if (produceRootmap) {
          libmapfile.open(libmapfilename);
          libmapfile << "Library." << libname << ": " << libname;
@@ -3422,11 +3422,11 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
             }
             std::replace(clname.begin(), clname.end(), ':', '@');
             std::replace(clname.begin(), clname.end(), ' ', '_');
-            libmapfile << endl;
+            libmapfile << std::endl;
             libmapfile << "Library." << clname << ": " << libname << " " << all_libtoload;
          }
 
-         libmapfile << endl;
+         libmapfile << std::endl;
          libmapfile.close();
       }
 //      depLibraries = all_libtoload;
@@ -3482,10 +3482,10 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
    AssignAndDelete( fakeMain, ConcatFileName( build_loc, libname ) );
    fakeMain += "_ACLiC_main";
    fakeMain += extension;
-   ofstream fakeMainFile( fakeMain, ios::out );
+   std::ofstream fakeMainFile( fakeMain, std::ios::out );
    fakeMainFile << "// File Automatically generated by the ROOT Script Compiler "
-                << endl;
-   fakeMainFile << "int main(char*argc,char**argvv) {};" << endl;
+                << std::endl;
+   fakeMainFile << "int main(char*argc,char**argvv) {};" << std::endl;
    fakeMainFile.close();
    // We could append this fake main routine to the compilation line.
    // But in this case compiler may output the name of the dictionary file
diff --git a/core/base/src/TTask.cxx b/core/base/src/TTask.cxx
index e85aeb83d3f..857a4d1cf53 100644
--- a/core/base/src/TTask.cxx
+++ b/core/base/src/TTask.cxx
@@ -266,7 +266,7 @@ void TTask::ExecuteTask(Option_t *option)
    if (fBreakin) return;
    if (gDebug > 1) {
       TROOT::IndentLevel();
-      cout<<"Execute task:"<<GetName()<<" : "<<GetTitle()<<endl;
+      std::cout<<"Execute task:"<<GetName()<<" : "<<GetTitle()<<std::endl;
       TROOT::IncreaseDirLevel();
    }
    Exec(option);
@@ -306,7 +306,7 @@ void TTask::ExecuteTasks(Option_t *option)
 
       if (gDebug > 1) {
          TROOT::IndentLevel();
-         cout<<"Execute task:"<<task->GetName()<<" : "<<task->GetTitle()<<endl;
+         std::cout<<"Execute task:"<<task->GetName()<<" : "<<task->GetTitle()<<std::endl;
          TROOT::IncreaseDirLevel();
       }
       task->Exec(option);
@@ -329,7 +329,7 @@ void TTask::ls(Option_t *option) const
    // Indentation is used to identify the task tree.
 
    TROOT::IndentLevel();
-   cout <<GetName()<<"\t"<<GetTitle()<<endl;
+   std::cout <<GetName()<<"\t"<<GetTitle()<<std::endl;
    TROOT::IncreaseDirLevel();
 
    TString opta = option;
diff --git a/core/base/src/TTimeStamp.cxx b/core/base/src/TTimeStamp.cxx
index c56d29cbdc3..0e316896570 100644
--- a/core/base/src/TTimeStamp.cxx
+++ b/core/base/src/TTimeStamp.cxx
@@ -54,16 +54,16 @@ ClassImp(TTimeStamp);
 TVirtualMutex *gTimeMutex = 0; // local mutex
 
 //______________________________________________________________________________
-ostream& operator<<(ostream& os, const TTimeStamp& ts)
+std::ostream& operator<<(std::ostream& os, const TTimeStamp& ts)
 {
-   // Write time stamp to ostream.
+   // Write time stamp to std::ostream.
 
    if (os.good()) {
       if (os.tie()) os.tie()->flush(); // instead of opfx
       os << ts.AsString("c");
    }
    // instead of os.osfx()
-   if (os.flags() & ios::unitbuf) os.flush();
+   if (os.flags() & std::ios::unitbuf) os.flush();
    return os;
 }
 
diff --git a/core/cont/inc/LinkDef.h b/core/cont/inc/LinkDef.h
index 418bd1c12d3..2fdcd766396 100644
--- a/core/cont/inc/LinkDef.h
+++ b/core/cont/inc/LinkDef.h
@@ -55,15 +55,15 @@
 #pragma link C++ class TRefTable-;
 #pragma link C++ class TVirtualCollectionProxy-;
 
-#pragma link C++ class vector<Int_t>;
-#pragma link C++ operators vector<Int_t>;
+#pragma link C++ class std::vector<Int_t>;
+#pragma link C++ operators std::vector<Int_t>;
 #ifdef G__VECTOR_HAS_CLASS_ITERATOR
-#pragma link C++ class vector<Int_t>::iterator;
-#pragma link C++ operators vector<Int_t>::iterator;
-#pragma link C++ class vector<Int_t>::const_iterator;
-#pragma link C++ operators vector<Int_t>::const_iterator;
-#pragma link C++ class vector<Int_t>::reverse_iterator;
-#pragma link C++ operators vector<Int_t>::reverse_iterator;
+#pragma link C++ class std::vector<Int_t>::iterator;
+#pragma link C++ operators std::vector<Int_t>::iterator;
+#pragma link C++ class std::vector<Int_t>::const_iterator;
+#pragma link C++ operators std::vector<Int_t>::const_iterator;
+#pragma link C++ class std::vector<Int_t>::reverse_iterator;
+#pragma link C++ operators std::vector<Int_t>::reverse_iterator;
 #endif
 
 #pragma link C++ nestedclass;
diff --git a/core/cont/inc/TBits.h b/core/cont/inc/TBits.h
index cae92b286c4..661647cfaf0 100644
--- a/core/cont/inc/TBits.h
+++ b/core/cont/inc/TBits.h
@@ -144,7 +144,7 @@ public:
 
    void    Paint(Option_t *option="");        // to visualize the bits array as an histogram, etc
    void    Print(Option_t *option="") const;  // to show the list of active bits
-   void    Output(ostream &) const;
+   void    Output(std::ostream &) const;
 
    ClassDef(TBits,1)        // Bit container
 };
@@ -186,7 +186,7 @@ inline TBits operator^(const TBits& lhs, const TBits& rhs)
    return result;
 }
 
-inline ostream &operator<<(ostream& os, const TBits& rhs)
+inline std::ostream &operator<<(std::ostream& os, const TBits& rhs)
 {
    rhs.Output(os); return os;
 }
diff --git a/core/cont/inc/TBtree.h b/core/cont/inc/TBtree.h
index 6724ade49f2..ea59ebc3310 100644
--- a/core/cont/inc/TBtree.h
+++ b/core/cont/inc/TBtree.h
@@ -95,7 +95,7 @@ public:
    TObject    *First() const;
    TObject    *Last() const;
 
-   //void PrintOn(ostream &os) const;
+   //void PrintOn(std::ostream &os) const;
 
    Int_t       Order() { return fOrder; }
    TObject    *operator[](Int_t i) const;
@@ -149,8 +149,8 @@ public:
 
    virtual void Split() = 0;
 #endif
-   // virtual void PrintOn(ostream &os) const = 0;
-   // friend ostream &operator<<(ostream &os, const TBtNode &node);
+   // virtual void PrintOn(std::ostream &os) const = 0;
+   // friend std::ostream &operator<<(std::ostream &os, const TBtNode &node);
 };
 
 
@@ -252,7 +252,7 @@ public:
    Int_t     MaxIndex() const { return fTree->fInnerMaxIndex; }
    Int_t     MaxPsize() const { return fTree->fInnerMaxIndex; }
 
-   // void      PrintOn(ostream &os) const;
+   // void      PrintOn(std::ostream &os) const;
 
    Int_t     IsFull() const { return fLast == MaxIndex(); }
    void      IsFull(TBtNode *n);
@@ -318,7 +318,7 @@ public:
    Int_t      MaxIndex() const { return fTree->fLeafMaxIndex; }
    Int_t      MaxPsize() const { return fTree->fLeafMaxIndex + 1; }
 
-   // void       PrintOn(ostream &os) const;
+   // void       PrintOn(std::ostream &os) const;
 
    Int_t      IsFull() const { return fLast == MaxIndex(); }
    Int_t      IsAlmostFull() const { return fLast >= MaxIndex() - 1; }
@@ -437,7 +437,7 @@ inline Int_t TBtLeafNode::Vsize() const
    return Psize()+1;
 }
 
-//inline ostream &operator<<(ostream& outputStream, const TBtNode &aNode)
+//inline std::ostream &operator<<(std::ostream& outputStream, const TBtNode &aNode)
 //{
 //   aNode.PrintOn(outputStream);
 //   return outputStream;
diff --git a/core/cont/inc/TCollectionProxyInfo.h b/core/cont/inc/TCollectionProxyInfo.h
index f12f4b2735e..df7b6166698 100644
--- a/core/cont/inc/TCollectionProxyInfo.h
+++ b/core/cont/inc/TCollectionProxyInfo.h
@@ -349,7 +349,7 @@ namespace ROOT {
          // Generate a TCollectionProxyInfo given a TCollectionProxyInfo::Type
          // template (used to described the behavior of the stl collection.
          // Typical use looks like:
-         //      ::ROOT::TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<string> >()));
+         //      ::ROOT::TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< std::vector<string> >()));
          
          PairHolder<TYPENAME T::Value_t, TYPENAME T::Value_t>* p =
             (PairHolder<TYPENAME T::Value_t, TYPENAME T::Value_t>*)0x1000;
@@ -374,7 +374,7 @@ namespace ROOT {
          // Generate a TCollectionProxyInfo given a TCollectionProxyInfo::Type
          // template (used to described the behavior of the stl collection.
          // Typical use looks like:
-         //      ::ROOT::TCollectionProxyInfo::Get(TCollectionProxyInfo::Pushback< vector<string> >()));
+         //      ::ROOT::TCollectionProxyInfo::Get(TCollectionProxyInfo::Pushback< std::vector<string> >()));
          
          PairHolder<TYPENAME T::Value_t, TYPENAME T::Value_t>* p =
             (PairHolder<TYPENAME T::Value_t, TYPENAME T::Value_t>*)0x1000;
@@ -482,7 +482,7 @@ namespace ROOT {
    };
 
 #ifndef __CINT__
-   // Need specialization for boolean references due to stupid STL vector<bool>
+   // Need specialization for boolean references due to stupid STL std::vector<bool>
    template<> inline void* ::ROOT::TCollectionProxyInfo::Address<std::vector<Bool_t>::const_reference>::address(std::vector<Bool_t>::const_reference ) {
       R__ASSERT(0);
       return 0;
diff --git a/core/cont/src/TBits.cxx b/core/cont/src/TBits.cxx
index 63b9b2f2282..4f417fccaa0 100644
--- a/core/cont/src/TBits.cxx
+++ b/core/cont/src/TBits.cxx
@@ -348,9 +348,9 @@ UInt_t TBits::FirstSetBit(UInt_t startBit) const
 }
 
 //______________________________________________________________________________
-void TBits::Output(ostream &os) const
+void TBits::Output(std::ostream &os) const
 {
-   // Print the value to the ostream
+   // Print the value to the std::ostream
 
    for(UInt_t i=0; i<fNbytes; ++i) {
       UChar_t val = fAllBits[fNbytes - 1 - i];
diff --git a/core/cont/src/TBtree.cxx b/core/cont/src/TBtree.cxx
index 08af58b6fa7..2c865e1583b 100644
--- a/core/cont/src/TBtree.cxx
+++ b/core/cont/src/TBtree.cxx
@@ -324,7 +324,7 @@ Int_t TBtree::IdxAdd(const TObject &obj)
          // Nothing is here now, but later we might give the user
          // the ability to declare a B-tree as `unique elements only',
          // in which case we would handle an exception here.
-         // cerr << "Multiple entry warning\n";
+         // std::cerr << "Multiple entry warning\n";
       } else {
          R__CHECK(loc->fIsLeaf);
       }
@@ -374,7 +374,7 @@ void TBtree::Init(Int_t order)
 }
 
 //______________________________________________________________________________
-//void TBtree::PrintOn(ostream& out) const
+//void TBtree::PrintOn(std::ostream& out) const
 //{
 //   // Print a B-tree.
 //
@@ -1606,7 +1606,7 @@ Int_t TBtLeafNode::NofKeys() const
 }
 
 //______________________________________________________________________________
-//void TBtLeafNode::PrintOn(ostream& out) const
+//void TBtLeafNode::PrintOn(std::ostream& out) const
 //{
 //    out << " < ";
 //    for (Int_t i = 0; i <= fLast; i++)
diff --git a/core/cont/src/TClassTable.cxx b/core/cont/src/TClassTable.cxx
index 7f239e0d55c..e5b24787547 100644
--- a/core/cont/src/TClassTable.cxx
+++ b/core/cont/src/TClassTable.cxx
@@ -57,7 +57,7 @@ namespace ROOT {
      // TROOT.h header file.
    public:
 #ifdef R__GLOBALSTL
-      typedef map<string, TClassRec*>           IdMap_t;
+      typedef std::map<string, TClassRec*>           IdMap_t;
 #else
       typedef std::map<std::string, TClassRec*> IdMap_t;
 #endif
diff --git a/core/cont/src/TCollection.cxx b/core/cont/src/TCollection.cxx
index c632446f331..1f645d70555 100644
--- a/core/cont/src/TCollection.cxx
+++ b/core/cont/src/TCollection.cxx
@@ -251,8 +251,8 @@ void TCollection::ls(Option_t *option) const
    // with names xxx*.
 
    TROOT::IndentLevel();
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
-        << Int_t(TestBit(kCanDelete)) << endl;
+   std::cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
+        << Int_t(TestBit(kCanDelete)) << std::endl;
 
    TRegexp re(option,kTRUE);
    TIter next(this);
diff --git a/core/meta/src/TSchemaRule.cxx b/core/meta/src/TSchemaRule.cxx
index 40393bc3e46..c1b5d95c062 100644
--- a/core/meta/src/TSchemaRule.cxx
+++ b/core/meta/src/TSchemaRule.cxx
@@ -114,33 +114,33 @@ void TSchemaRule::ls(Option_t *targetname) const
    // is typically much less verbose then Dump().
    
    TROOT::IndentLevel();
-   cout << "Schema Evolution Rule: ";
-   if (fRuleType==kReadRule) cout <<  "read ";
-   else if (fRuleType==kReadRawRule) cout << "readraw ";
-   cout << "\n";
+   std::cout << "Schema Evolution Rule: ";
+   if (fRuleType==kReadRule) std::cout <<  "read ";
+   else if (fRuleType==kReadRawRule) std::cout << "readraw ";
+   std::cout << "\n";
    TROOT::IncreaseDirLevel();
    TROOT::IndentLevel();
-   cout << "sourceClass=\"" << fSourceClass << "\" ";
-   if (fVersion.Length())  cout << "version=\"" << fVersion << "\" ";
-   if (fChecksum.Length()) cout << "checksum=\"" << fChecksum << "\" ";
-   if (targetname && targetname[0]) cout << "targetClass=\"" << targetname << "\" ";
-   else cout << "targetClass\"" << fTargetClass << "\" ";
-   cout << "\n";
+   std::cout << "sourceClass=\"" << fSourceClass << "\" ";
+   if (fVersion.Length())  std::cout << "version=\"" << fVersion << "\" ";
+   if (fChecksum.Length()) std::cout << "checksum=\"" << fChecksum << "\" ";
+   if (targetname && targetname[0]) std::cout << "targetClass=\"" << targetname << "\" ";
+   else std::cout << "targetClass\"" << fTargetClass << "\" ";
+   std::cout << "\n";
    TROOT::IndentLevel();
-   cout << "source=\"" << fSource << "\" ";
-   cout << "target=\"" << fTarget << "\" ";
-   cout << "\n";
+   std::cout << "source=\"" << fSource << "\" ";
+   std::cout << "target=\"" << fTarget << "\" ";
+   std::cout << "\n";
    if (fInclude.Length()) {
       TROOT::IndentLevel();
-      cout << "include=\"" << fInclude << "\" " << "\n";
+      std::cout << "include=\"" << fInclude << "\" " << "\n";
    }
    if (fAttributes.Length()) {
       TROOT::IndentLevel();
-      cout << "attributes=\"" << fAttributes << "\"" << "\n";
+      std::cout << "attributes=\"" << fAttributes << "\"" << "\n";
    }
    if (fCode.Length()) {
       TROOT::IndentLevel();
-      cout << "code=\"{" << fCode << "}\" "
+      std::cout << "code=\"{" << fCode << "}\" "
       << "\n";
    }
    TROOT::DecreaseDirLevel();
diff --git a/core/meta/src/TSchemaRuleSet.cxx b/core/meta/src/TSchemaRuleSet.cxx
index fcf002210f6..eabb3a575b0 100644
--- a/core/meta/src/TSchemaRuleSet.cxx
+++ b/core/meta/src/TSchemaRuleSet.cxx
@@ -42,7 +42,7 @@ void TSchemaRuleSet::ls(Option_t *) const
    // is typically much less verbose then Dump().
    
    TROOT::IndentLevel();
-   cout << "TSchemaRuleSet for " << fClassName << ":\n";
+   std::cout << "TSchemaRuleSet for " << fClassName << ":\n";
    TROOT::IncreaseDirLevel();
    TObject *object = 0;
    TIter next(fPersistentRules);
diff --git a/core/pcre/src/win32/pcre_stringpiece.h b/core/pcre/src/win32/pcre_stringpiece.h
index 599a3516088..b49b4d2651b 100644
--- a/core/pcre/src/win32/pcre_stringpiece.h
+++ b/core/pcre/src/win32/pcre_stringpiece.h
@@ -40,7 +40,7 @@
 
 #include <string.h>
 #include <string>
-#include <iosfwd>    // for ostream forward-declaration
+#include <iosfwd>    // for std::ostream forward-declaration
 
 #if 0
 #define HAVE_TYPE_TRAITS
@@ -72,7 +72,7 @@ class PCRECPP_EXP_DEFN StringPiece {
   StringPiece(const unsigned char* str)
     : ptr_(reinterpret_cast<const char*>(str)),
       length_(static_cast<int>(strlen(ptr_))) { }
-  StringPiece(const string& str)
+  StringPiece(const std::string& str)
     : ptr_(str.data()), length_(static_cast<int>(str.size())) { }
   StringPiece(const char* offset, int len)
     : ptr_(offset), length_(len) { }
@@ -161,7 +161,7 @@ class PCRECPP_EXP_DEFN StringPiece {
 // ------------------------------------------------------------------
 
 #ifdef HAVE_TYPE_TRAITS
-// This makes vector<StringPiece> really fast for some STL implementations
+// This makes std::vector<StringPiece> really fast for some STL implementations
 template<> struct __type_traits<pcrecpp::StringPiece> {
   typedef __true_type    has_trivial_default_constructor;
   typedef __true_type    has_trivial_copy_constructor;
diff --git a/core/rint/inc/TRint.h b/core/rint/inc/TRint.h
index 9003335ddbe..6be2fb22b24 100644
--- a/core/rint/inc/TRint.h
+++ b/core/rint/inc/TRint.h
@@ -60,7 +60,7 @@ public:
    virtual void        Run(Bool_t retrn = kFALSE);
    virtual void        Terminate(int status);
            void        Interrupt() { fInterrupt = kTRUE; }
-   virtual Int_t       TabCompletionHook(char *buf, int *pLoc, ostream& out);
+   virtual Int_t       TabCompletionHook(char *buf, int *pLoc, std::ostream& out);
 
    ClassDef(TRint,0);  //ROOT Interactive Application Interface
 };
diff --git a/core/rint/inc/TTabCom.h b/core/rint/inc/TTabCom.h
index da8a62d5a57..674423f323c 100644
--- a/core/rint/inc/TTabCom.h
+++ b/core/rint/inc/TTabCom.h
@@ -68,7 +68,7 @@ public: // typedefs
    typedef TListIter TContIter;
 
 public: // member functions
-   Int_t Hook(char *buf, int *pLoc, ostream& out);
+   Int_t Hook(char *buf, int *pLoc, std::ostream& out);
 
    const TSeqCollection* GetListOfClasses();
    const TSeqCollection* GetListOfCppDirectives();
@@ -199,7 +199,7 @@ private: // member functions
    TTabCom& operator=(const TTabCom&); //private and not implemented
 
    Int_t      Complete(const TRegexp& re, const TSeqCollection* pListOfCandidates,
-                       const char appendage[], ostream& out, TString::ECaseCompare cmp = TString::kExact);
+                       const char appendage[], std::ostream& out, TString::ECaseCompare cmp = TString::kExact);
    void       CopyMatch( char dest[], const char localName[], const char appendage[]=0, const char fullName[]=0 ) const;
    EContext_t DetermineContext() const;
    TString    DeterminePath( const TString& fileName, const char defaultPath[] ) const;
diff --git a/core/rint/src/TRint.cxx b/core/rint/src/TRint.cxx
index b8c1947cf70..4f9b97a20e2 100644
--- a/core/rint/src/TRint.cxx
+++ b/core/rint/src/TRint.cxx
@@ -169,7 +169,7 @@ TRint::TRint(const char *appClassName, Int_t *argc, char **argv, void *options,
    // and you execute your scripts multiple times.
    if (includes > 0) {
       ProcessLine("#include <iostream>", kTRUE);
-      ProcessLine("#include <string>", kTRUE); // for std::string iostream.
+      ProcessLine("#include <string>", kTRUE); // for std::string std::iostream.
       ProcessLine("#include <DllImport.h>", kTRUE);// Defined R__EXTERN
       if (includes > 1) {
          ProcessLine("#include <vector>", kTRUE);  // Needed because std::vector and std::pair are
@@ -698,7 +698,7 @@ Long_t TRint::ProcessRemote(const char *line, Int_t *)
 
 
 //______________________________________________________________________________
-Int_t TRint::TabCompletionHook(char *buf, int *pLoc, ostream& out)
+Int_t TRint::TabCompletionHook(char *buf, int *pLoc, std::ostream& out)
 {
    // Forward tab completion request to our TTabCom::Hook().
    if (gTabCom)
diff --git a/core/rint/src/TTabCom.cxx b/core/rint/src/TTabCom.cxx
index 66034cf395a..042c1369ba0 100644
--- a/core/rint/src/TTabCom.cxx
+++ b/core/rint/src/TTabCom.cxx
@@ -436,7 +436,7 @@ const TSeqCollection *TTabCom::GetListOfClasses()
       fclose(fout);
 
       // open the file
-      ifstream file1(tmpfilename);
+      std::ifstream file1(tmpfilename);
       if (!file1) {
          Error("TTabCom::GetListOfClasses", "could not open file \"%s\"",
                tmpfilename);
@@ -569,7 +569,7 @@ const TSeqCollection *TTabCom::GetListOfEnvVars()
       gSystem->Exec(cmd.Data());
 
       // open the file
-      ifstream file1(tmpfilename);
+      std::ifstream file1(tmpfilename);
       if (!file1) {
          Error("TTabCom::GetListOfEnvVars", "could not open file \"%s\"",
                tmpfilename);
@@ -720,7 +720,7 @@ const TSeqCollection *TTabCom::GetListOfUsers()
    if (!fpUsers) {
       fpUsers = new TContainer;
 
-      ifstream passwd;
+      std::ifstream passwd;
       TString user;
 
       passwd.open("/etc/passwd");
@@ -891,7 +891,7 @@ TString TTabCom::DetermineClass(const char varName[])
    ///////////////////////////////////
 
    assert(varName != 0);
-   IfDebug(cerr << "DetermineClass(\"" << varName << "\");" << endl);
+   IfDebug(std::cerr << "DetermineClass(\"" << varName << "\");" << std::endl);
 
    const char *tmpfile = tmpnam(0);
    if (!tmpfile) return "";
@@ -910,7 +910,7 @@ TString TTabCom::DetermineClass(const char varName[])
    int c;
 
    // open the file
-   ifstream file1(tmpfile);
+   std::ifstream file1(tmpfile);
    if (!file1) {
       Error("TTabCom::DetermineClass", "could not open file \"%s\"",
             tmpfile);
@@ -923,7 +923,7 @@ TString TTabCom::DetermineClass(const char varName[])
             varName);
       goto cleanup;
    }
-   IfDebug(cerr << (char) c << flush);
+   IfDebug(std::cerr << (char) c << std::flush);
 
    // in case of success, "class TClassName*)0x12345" remains,
    // since the opening '(' was removed.
@@ -939,11 +939,11 @@ TString TTabCom::DetermineClass(const char varName[])
    }
    // ignore ' '
    c = file1.get();
-   IfDebug(cerr << (char) c << flush);
+   IfDebug(std::cerr << (char) c << std::flush);
 
    // this is what we want
    type.ReadToDelim(file1, ')');
-   IfDebug(cerr << type << endl);
+   IfDebug(std::cerr << type << std::endl);
 
    // new version of CINT returns: "class TClassName*const)0x12345"
    // so we have to strip off "const"
@@ -974,9 +974,9 @@ Bool_t TTabCom::ExcludedByFignore(TString s)
       return kFALSE;
    } else {
 #ifdef R__SSTREAM
-      istringstream endings((char *) fignore);
+      std::istringstream endings((char *) fignore);
 #else
-      istrstream endings((char *) fignore);  // do i need to make a copy first?
+      std::istrstream endings((char *) fignore);  // do i need to make a copy first?
 #endif
       TString ending;
 
@@ -1052,7 +1052,7 @@ TString TTabCom::GetSysIncludePath()
    fclose(fout);
 
    // open the tmp file
-   ifstream file1(tmpfilename);
+   std::ifstream file1(tmpfilename);
    if (!file1) {                // error
       Error("TTabCom::GetSysIncludePath", "could not open file \"%s\"",
             tmpfilename);
@@ -1132,9 +1132,9 @@ TSeqCollection *TTabCom::NewListOfFilesInPath(const char path1[])
 
    TContainer *pList = new TContainer;  // maybe use RTTI here? (since its a static function)
 #ifdef R__SSTREAM
-   istringstream path((char *) path1);
+   std::istringstream path((char *) path1);
 #else
-   istrstream path((char *) path1);
+   std::istrstream path((char *) path1);
 #endif
 
    while (path.good())
@@ -1144,8 +1144,8 @@ TSeqCollection *TTabCom::NewListOfFilesInPath(const char path1[])
       if (dirName.IsNull())
          continue;
 
-      IfDebug(cerr << "NewListOfFilesInPath(): dirName = " << dirName <<
-              endl);
+      IfDebug(std::cerr << "NewListOfFilesInPath(): dirName = " << dirName <<
+              std::endl);
 
       AppendListOfFilesInDirectory(dirName, pList);
    }
@@ -1205,7 +1205,7 @@ void TTabCom::NoMsg(Int_t errorLevel)
    if (errorLevel < 0)          // reset
    {
       if (old_level == kNotDefined) {
-         cerr << "NoMsg(): ERROR 1. old_level==" << old_level << endl;
+         std::cerr << "NoMsg(): ERROR 1. old_level==" << old_level << std::endl;
          return;
       }
 
@@ -1214,7 +1214,7 @@ void TTabCom::NoMsg(Int_t errorLevel)
    } else                       // set
    {
       if (old_level != kNotDefined) {
-         cerr << "NoMsg(): ERROR 2. old_level==" << old_level << endl;
+         std::cerr << "NoMsg(): ERROR 2. old_level==" << old_level << std::endl;
          return;
       }
 
@@ -1240,7 +1240,7 @@ void TTabCom::NoMsg(Int_t errorLevel)
 Int_t TTabCom::Complete(const TRegexp & re,
                         const TSeqCollection * pListOfCandidates,
                         const char appendage[],
-                        ostream& out,
+                        std::ostream& out,
                         TString::ECaseCompare cmp)
 {
    // [private]
@@ -1253,7 +1253,7 @@ Int_t TTabCom::Complete(const TRegexp & re,
    //  1 ==> after 1st char
    //  n ==> after nth char
 
-   IfDebug(cerr << "TTabCom::Complete() ..." << endl);
+   IfDebug(std::cerr << "TTabCom::Complete() ..." << std::endl);
    assert(fpLoc != 0);
    assert(pListOfCandidates != 0);
 
@@ -1276,11 +1276,11 @@ Int_t TTabCom::Complete(const TRegexp & re,
 
    int start = s2.Index(re);
 
-   IfDebug(cerr << "   s1: " << s1 << endl);
-   IfDebug(cerr << "   s2: " << s2 << endl);
-   IfDebug(cerr << "   s3: " << s3 << endl);
-   IfDebug(cerr << "start: " << start << endl);
-   IfDebug(cerr << endl);
+   IfDebug(std::cerr << "   s1: " << s1 << std::endl);
+   IfDebug(std::cerr << "   s2: " << s2 << std::endl);
+   IfDebug(std::cerr << "   s3: " << s3 << std::endl);
+   IfDebug(std::cerr << "start: " << start << std::endl);
+   IfDebug(std::cerr << std::endl);
 
    // -----------------------------------------
    // 2. go through each possible completion,
@@ -1317,7 +1317,7 @@ Int_t TTabCom::Complete(const TRegexp & re,
          nMatches += 1;
          listOfMatches.Add(new TObjString(s5));
          listOfFullPaths.Add(new TObjString(s4));
-         IfDebug(cerr << "adding " << s5 << '\t' << s4 << endl);
+         IfDebug(std::cerr << "adding " << s5 << '\t' << s4 << std::endl);
       } else if (cmp == TString::kIgnoreCase) {
          TString ts5(s5);
          if (ts5.BeginsWith(s3, cmp))
@@ -1325,10 +1325,10 @@ Int_t TTabCom::Complete(const TRegexp & re,
             nMatches += 1;
             listOfMatches.Add(new TObjString(s5));
             listOfFullPaths.Add(new TObjString(s4));
-            IfDebug(cerr << "adding " << s5 << '\t' << s4 << endl);
+            IfDebug(std::cerr << "adding " << s5 << '\t' << s4 << std::endl);
          }
       } else {
-//rdm         IfDebug(cerr << "considered " << s5 << '\t' << s4 << endl);
+//rdm         IfDebug(std::cerr << "considered " << s5 << '\t' << s4 << std::endl);
       }
 
    }
@@ -1357,7 +1357,7 @@ Int_t TTabCom::Complete(const TRegexp & re,
 
       pObj = pListOfCandidates->FindObject(short_name);
       if (pObj) {
-         IfDebug(cerr << endl << "class: " << pObj->ClassName() << endl);
+         IfDebug(std::cerr << std::endl << "class: " << pObj->ClassName() << std::endl);
          TString className = pObj->ClassName();
          if (0);
          else if (className == "TMethod" || className == "TFunction") {
@@ -1380,7 +1380,7 @@ Int_t TTabCom::Complete(const TRegexp & re,
       for (int i = 0;
            (ch = AllAgreeOnChar(i, &listOfMatches, nGoodStrings));
            i += 1) {
-         IfDebug(cerr << " i=" << i << " ch=" << ch << endl);
+         IfDebug(std::cerr << " i=" << i << " ch=" << ch << std::endl);
          partialMatch.Append(ch);
       }
 
@@ -1400,7 +1400,7 @@ Int_t TTabCom::Complete(const TRegexp & re,
          // and use it.
          CopyMatch(match, s, appendage, s0);
       } else {
-         IfDebug(cerr << "more than 1 GoodString" << endl);
+         IfDebug(std::cerr << "more than 1 GoodString" << std::endl);
 
          if (partialMatch.Length() > s3.Length())
             // this partial match is our (partial) completion.
@@ -1411,16 +1411,16 @@ Int_t TTabCom::Complete(const TRegexp & re,
             // print a list of all the ambiguous matches
             // (except for those excluded by "FileIgnore")
          {
-            IfDebug(cerr << "printing ambiguous matches" << endl);
-            out << endl;
+            IfDebug(std::cerr << "printing ambiguous matches" << std::endl);
+            out << std::endl;
             while ((pObj = next_match())) {
                s = pObj->GetName();
                s0 = next_fullpath()->GetName();
                if (!ExcludedByFignore(s) || nGoodStrings == 0) {
                   if (IsDirectory(s0))
-                     out << s << "/" << endl;
+                     out << s << "/" << std::endl;
                   else
-                     out << s << endl;
+                     out << s << std::endl;
                }
             }
             pos = -2;
@@ -1450,9 +1450,9 @@ Int_t TTabCom::Complete(const TRegexp & re,
          goto done;             /* RETURN */
       }
       // debugging output
-      IfDebug(cerr << "  i=" << i << endl);
-      IfDebug(cerr << "  L=" << l << endl);
-      IfDebug(cerr << "loc=" << loc << endl);
+      IfDebug(std::cerr << "  i=" << i << std::endl);
+      IfDebug(std::cerr << "  L=" << l << std::endl);
+      IfDebug(std::cerr << "loc=" << loc << std::endl);
 
       // slide everything (including the null terminator) over to make space
       for (; i >= loc; i -= 1) {
@@ -1509,20 +1509,20 @@ void TTabCom::CopyMatch(char dest[], const char localName[],
    const char *key = "filename";
    const int key_len = strlen(key);
 
-   IfDebug(cerr << "CopyMatch()." << endl);
-   IfDebug(cerr << "localName: " << (localName ? localName : "0") <<
-           endl);
-   IfDebug(cerr << "appendage: " << (appendage ? appendage : "0") <<
-           endl);
-   IfDebug(cerr << " fullName: " << (fullName ? fullName : "0") <<
-           endl);
+   IfDebug(std::cerr << "CopyMatch()." << std::endl);
+   IfDebug(std::cerr << "localName: " << (localName ? localName : "0") <<
+           std::endl);
+   IfDebug(std::cerr << "appendage: " << (appendage ? appendage : "0") <<
+           std::endl);
+   IfDebug(std::cerr << " fullName: " << (fullName ? fullName : "0") <<
+           std::endl);
 
 
    // check to see if "appendage" starts with "key"
    if (appendage && strncmp(appendage, key, key_len) == 0) {
       // filenames get special treatment
       appendage += key_len;
-      IfDebug(cerr << "new appendage: " << appendage << endl);
+      IfDebug(std::cerr << "new appendage: " << appendage << std::endl);
       if (IsDirectory(fullName)) {
          if (fullName)
             strcpy(dest + strlen(localName), "/");
@@ -1549,10 +1549,10 @@ TTabCom::EContext_t TTabCom::DetermineContext() const
    for (int context = 0; context < kNUM_PAT; ++context) {
       pEnd = Matchs(fBuf, *fpLoc, fPat[context], &pStart);
       if (pEnd) {
-         IfDebug(cerr << endl
+         IfDebug(std::cerr << std::endl
                  << "context=" << context << " "
                  << "RegExp=" << fRegExp[context]
-                 << endl);
+                 << std::endl);
          return EContext_t(context);  //* RETURN *//
       }
    }
@@ -1589,16 +1589,16 @@ TString TTabCom::DeterminePath(const TString & fileName,
          newBase = "";
          extendedPath = defaultPath;
       }
-      IfDebug(cerr << endl);
-      IfDebug(cerr << "    fileName: " << fileName << endl);
-      IfDebug(cerr << "    pathBase: " << newBase << endl);
+      IfDebug(std::cerr << std::endl);
+      IfDebug(std::cerr << "    fileName: " << fileName << std::endl);
+      IfDebug(std::cerr << "    pathBase: " << newBase << std::endl);
       if (defaultPath) {
-         IfDebug(cerr << " defaultPath: " << defaultPath << endl);
+         IfDebug(std::cerr << " defaultPath: " << defaultPath << std::endl);
       } else {
-         IfDebug(cerr << " defaultPath: " << endl);
+         IfDebug(std::cerr << " defaultPath: " << std::endl);
       }         
-      IfDebug(cerr << "extendedPath: " << extendedPath << endl);
-      IfDebug(cerr << endl);
+      IfDebug(std::cerr << "extendedPath: " << extendedPath << std::endl);
+      IfDebug(std::cerr << std::endl);
 
       return extendedPath;
    }
@@ -1612,9 +1612,9 @@ TString TTabCom::ExtendPath(const char originalPath[], TString newBase) const
    if (newBase.BeginsWith("/"))
       newBase.Remove(TString::kLeading, '/');
 #ifdef R__SSTREAM
-   stringstream str;
+   std::stringstream str;
 #else
-   strstream str;
+   std::strstream str;
 #endif
    TString dir;
    TString newPath;
@@ -1637,7 +1637,7 @@ TString TTabCom::ExtendPath(const char originalPath[], TString newBase) const
 }
 
 //______________________________________________________________________________
-Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
+Int_t TTabCom::Hook(char *buf, int *pLoc, std::ostream& out)
 {
    // [private]
 
@@ -1663,8 +1663,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
 
    switch (context) {
    case kUNKNOWN_CONTEXT:
-      cerr << endl << "tab completion not implemented for this context" <<
-          endl;
+      std::cerr << std::endl << "tab completion not implemented for this context" <<
+          std::endl;
       pos = -2;
       break;
 
@@ -1784,8 +1784,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          // may be a namespace, class, object, or pointer
          TString name = s3("^[_a-zA-Z][_a-zA-Z0-9]*");
 
-         IfDebug(cerr << endl);
-         IfDebug(cerr << "name: " << '"' << name << '"' << endl);
+         IfDebug(std::cerr << std::endl);
+         IfDebug(std::cerr << "name: " << '"' << name << '"' << std::endl);
 
          // We need to decompose s3 a little more:
          // The part name is the partial symbol at the end of ::
@@ -1814,13 +1814,13 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          TString sym = prefix("[_a-zA-Z][_a-zA-Z0-9]*::$");
          preprefix.Remove(preprefix.Length() - sym.Length(), sym.Length());
 
-         IfDebug(cerr << "prefix: " << '"' << prefix << '"' << endl);
-         IfDebug(cerr << "preprefix: " << '"' << preprefix << '"' << endl);
+         IfDebug(std::cerr << "prefix: " << '"' << prefix << '"' << std::endl);
+         IfDebug(std::cerr << "preprefix: " << '"' << preprefix << '"' << std::endl);
 
          TString namesp = prefix;
          if (namesp.Length() >= 2)
             namesp.Remove(namesp.Length() - 2, 2);  // Remove the '::' at the end of the string.
-         IfDebug(cerr << "namesp: " << '"' << namesp << '"' << endl);
+         IfDebug(std::cerr << "namesp: " << '"' << namesp << '"' << std::endl);
 
          // Make sure autoloading happens (if it can).
          delete TryMakeClassFromClassName(namesp);
@@ -1929,8 +1929,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          //        to do it
          TString name = s1("[_a-zA-Z][-_a-zA-Z0-9<>():.]*$");
 
-         IfDebug(cerr << endl);
-         IfDebug(cerr << "name: " << '"' << name << '"' << endl);
+         IfDebug(std::cerr << std::endl);
+         IfDebug(std::cerr << "name: " << '"' << name << '"' << std::endl);
 
          switch (context) {
          case kCXX_DirectMember:
@@ -1991,8 +1991,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          TString name = s3("^[_a-zA-Z][_a-zA-Z0-9]*");
          // "name" may now be the name of a class, object, or pointer
 
-         IfDebug(cerr << endl);
-         IfDebug(cerr << "name: " << '"' << name << '"' << endl);
+         IfDebug(std::cerr << std::endl);
+         IfDebug(std::cerr << "name: " << '"' << name << '"' << std::endl);
 
          // We need to decompose s3 a little more:
          // The partname is the method symbol and a bracket at the end of ::
@@ -2021,8 +2021,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          TString sym = prefix("[_a-zA-Z][_a-zA-Z0-9]*::$");
          preprefix.Remove(preprefix.Length() - sym.Length(), sym.Length());
 
-         IfDebug(cerr << "prefix: " << '"' << prefix << '"' << endl);
-         IfDebug(cerr << "preprefix: " << '"' << preprefix << '"' << endl);
+         IfDebug(std::cerr << "prefix: " << '"' << prefix << '"' << std::endl);
+         IfDebug(std::cerr << "preprefix: " << '"' << preprefix << '"' << std::endl);
 
          pClass = MakeClassFromClassName(preprefix + name);
          if (!pClass) {
@@ -2037,7 +2037,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          methodName.Chop();
          methodName.Remove(TString::kTrailing, ' ');
 
-         IfDebug(cerr << methodName << endl);
+         IfDebug(std::cerr << methodName << std::endl);
 
          // get methods
          TContainer *pList = new TContainer;
@@ -2050,7 +2050,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          while ((pMethod = (TMethod *) nextMethod())) {
             if (methodName == pMethod->GetName()) {
                foundOne = kTRUE;
-               out << endl << pMethod->GetReturnTypeName()
+               out << std::endl << pMethod->GetReturnTypeName()
                    << " " << pMethod->GetName()
                    << pMethod->GetSignature();
                const char *comment = pMethod->GetCommentString();
@@ -2062,7 +2062,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
 
          // done
          if (foundOne) {
-            out << endl;
+            out << std::endl;
             pos = -2;
          } else {
             gSystem->Beep();
@@ -2097,8 +2097,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
             name = s3("^[_a-zA-Z][_a-zA-Z0-9:]*");
             // "name" may now be the name of a class, object, or pointer
          }
-         IfDebug(cerr << endl);
-         IfDebug(cerr << "name: " << '"' << name << '"' << endl);
+         IfDebug(std::cerr << std::endl);
+         IfDebug(std::cerr << "name: " << '"' << name << '"' << std::endl);
 
          // frodo: Again, passing the all string
          TString namerec = s1;
@@ -2138,7 +2138,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
             methodName.Chop();
             methodName.Remove(TString::kTrailing, ' ');
          }
-         IfDebug(cerr << methodName << endl);
+         IfDebug(std::cerr << methodName << std::endl);
 
          // get methods
          TContainer *pList = new TContainer;
@@ -2151,7 +2151,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          while ((pMethod = (TMethod *) nextMethod())) {
             if (methodName == pMethod->GetName()) {
                foundOne = kTRUE;
-               out << endl << pMethod->GetReturnTypeName()
+               out << std::endl << pMethod->GetReturnTypeName()
                    << " " << pMethod->GetName()
                    << pMethod->GetSignature();
                const char *comment = pMethod->GetCommentString();
@@ -2163,7 +2163,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
 
          // done
          if (foundOne) {
-            out << endl;
+            out << std::endl;
             pos = -2;
          } else {
             gSystem->Beep();
@@ -2186,14 +2186,14 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
 
          // "abc().whatever[TAB]"
          if (l2 > l3 && s2[l2 - l3 - 1] == '.') {
-            cerr << endl <<
-                "tab completion not implemented for this context" << endl;
+            std::cerr << std::endl <<
+                "tab completion not implemented for this context" << std::endl;
             break;              // veto
          }
          // "abc()->whatever[TAB]"
          if (l2 > l3 + 1 && s2(l2 - l3 - 2, 2) == "->") {
-            cerr << endl <<
-                "tab completion not implemented for this context" << endl;
+            std::cerr << std::endl <<
+                "tab completion not implemented for this context" << std::endl;
             break;              // veto
          }
 
@@ -2220,7 +2220,7 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
       {
          // get function name
          TString functionName = s3("[_a-zA-Z][_a-zA-Z0-9]*");
-         IfDebug(cerr << functionName << endl);
+         IfDebug(std::cerr << functionName << std::endl);
 
          TContainer listOfMatchingGlobalFuncs;
          TIter nextGlobalFunc(GetListOfGlobalFunctions());
@@ -2232,17 +2232,17 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, ostream& out)
          }
 
          if (listOfMatchingGlobalFuncs.IsEmpty()) {
-            cerr << endl << "no such function: " << dblquote(functionName)
-                << endl;
+            std::cerr << std::endl << "no such function: " << dblquote(functionName)
+                << std::endl;
          } else {
-            out << endl;
+            out << std::endl;
             TIter next(&listOfMatchingGlobalFuncs);
             TFunction *pFunction;
             while ((pFunction = (TFunction *) next())) {
                out << pFunction->GetReturnTypeName()
                    << " " << pFunction->GetName()
                    << pFunction->GetSignature()
-                   << endl;
+                   << std::endl;
             }
          }
 
@@ -2346,8 +2346,8 @@ TClass *TTabCom::MakeClassFromClassName(const char className[]) const
        pClass->GetListOfAllPublicDataMembers()->GetSize() == 0) {
       // i'm assuming this happens iff there was some error.
       // (misspelled the class name, for example)
-      cerr << endl << "class " << dblquote(className) << " not defined." <<
-          endl;
+      std::cerr << std::endl << "class " << dblquote(className) << " not defined." <<
+          std::endl;
       return 0;
    }
 
@@ -2540,8 +2540,8 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[],
 
    // not found...
    if (!varName_exists) {
-      cerr << endl << "variable " << dblquote(varName) << " not defined."
-         << endl;
+      std::cerr << std::endl << "variable " << dblquote(varName) << " not defined."
+         << std::endl;
       return 0;                 //* RETURN *//
    }
 
@@ -2560,8 +2560,8 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[],
       // this will happen if "varName" is a fundamental type (as opposed to class type).
       // or a pointer to a pointer.
       // or a function pointer.
-      cerr << endl << "problem determining class of " << dblquote(varName)
-         << endl;
+      std::cerr << std::endl << "problem determining class of " << dblquote(varName)
+         << std::endl;
       return 0;                 //* RETURN *//
    }
 
@@ -2616,8 +2616,8 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[],
          *fpLoc += 1;
 
          // 3. inform the user.
-         cerr << endl << dblquote(varName) <<
-            " is of pointer type. Use this operator: ->" << endl;
+         std::cerr << std::endl << dblquote(varName) <<
+            " is of pointer type. Use this operator: ->" << std::endl;
    }
 
    if (context == kCXX_IndirectMember || context == kCXX_IndirectProto) {
@@ -2626,7 +2626,7 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[],
          className.Chop();      // remove the '*'
 
          if (className[className.Length() - 1] == '*') {
-            cerr << endl << "can't handle pointers to pointers." << endl;
+            std::cerr << std::endl << "can't handle pointers to pointers." << std::endl;
             return 0;           // RETURN
          }
       } else {
@@ -2661,8 +2661,8 @@ TClass *TTabCom::MakeClassFromVarName(const char varName[],
          *fpLoc -= 1;
 
          // 3. inform the user.
-         cerr << endl << dblquote(varName) <<
-             " is not of pointer type. Use this operator: ." << endl;
+         std::cerr << std::endl << dblquote(varName) <<
+             " is not of pointer type. Use this operator: ." << std::endl;
       }
    }
 
@@ -2676,9 +2676,9 @@ void TTabCom::SetPattern(EContext_t handle, const char regexp[])
 
    // prevent overflow
    if (handle >= kNUM_PAT) {
-      cerr << endl
+      std::cerr << std::endl
           << "ERROR: handle="
-          << (int) handle << " >= kNUM_PAT=" << (int) kNUM_PAT << endl;
+          << (int) handle << " >= kNUM_PAT=" << (int) kNUM_PAT << std::endl;
       return;
    }
 
diff --git a/core/unix/src/TUnixSystem.cxx b/core/unix/src/TUnixSystem.cxx
index af921849216..7ba49220cc7 100644
--- a/core/unix/src/TUnixSystem.cxx
+++ b/core/unix/src/TUnixSystem.cxx
@@ -2170,10 +2170,10 @@ void TUnixSystem::StackTrace()
    TString gdbmess = gEnv->GetValue("Root.StacktraceMessage", "");
    gdbmess = gdbmess.Strip();
 
-   cout.flush();
+   std::cout.flush();
    fflush(stdout);
 
-   cerr.flush();
+   std::cerr.flush();
    fflush(stderr);
 
    int fd = STDERR_FILENO;
@@ -2347,7 +2347,7 @@ void TUnixSystem::StackTrace()
 
       // open tmp file for demangled stack trace
       TString tmpf1 = "gdb-backtrace";
-      ofstream file1;
+      std::ofstream file1;
       if (demangle) {
          FILE *f = TempFileName(tmpf1);
          if (f) fclose(f);
@@ -2439,7 +2439,7 @@ void TUnixSystem::StackTrace()
          file1.close();
          snprintf(buffer, sizeof(buffer), "%s %s < %s > %s", filter, cppfiltarg, tmpf1.Data(), tmpf2.Data());
          Exec(buffer);
-         ifstream file2(tmpf2);
+         std::ifstream file2(tmpf2);
          TString line;
          while (file2) {
             line = "";
diff --git a/geom/geom/inc/TGeoArb8.h b/geom/geom/inc/TGeoArb8.h
index e87deb10cee..38eb9b79349 100644
--- a/geom/geom/inc/TGeoArb8.h
+++ b/geom/geom/inc/TGeoArb8.h
@@ -96,7 +96,7 @@ public:
    Bool_t                IsTwisted() const {return (fTwist==0)?kFALSE:kTRUE;}
    Double_t              SafetyToFace(Double_t *point, Int_t iseg, Bool_t in) const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetPlaneVertices(Double_t zpl, Double_t *vertices) const;
    virtual void          SetVertex(Int_t vnum, Double_t x, Double_t y);
    virtual void          SetDimensions(Double_t *param);
@@ -169,7 +169,7 @@ public:
    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
    virtual void          SetDimensions(Double_t *param);
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGeoTrap, 1)         // G3 TRAP shape
 };
@@ -213,7 +213,7 @@ public:
    Double_t              GetTwistAngle() const {return fTwistAngle;}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    virtual void          SetDimensions(Double_t *param);
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
  
    ClassDef(TGeoGtra, 1)         // G3 GTRA shape
 };
diff --git a/geom/geom/inc/TGeoBBox.h b/geom/geom/inc/TGeoBBox.h
index 4e57ed6d4a1..d98529d9a5d 100644
--- a/geom/geom/inc/TGeoBBox.h
+++ b/geom/geom/inc/TGeoBBox.h
@@ -85,7 +85,7 @@ public:
    virtual Bool_t        IsNullBox() const {return ((fDX<1.E-16)&&(fDY<1.E-16)&&(fDZ<1.E-16))?kTRUE:kFALSE;}
    virtual TBuffer3D    *MakeBuffer3D() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
    virtual void          SetDimensions(Double_t *param);
    void                  SetBoxPoints(Double_t *points) const;
diff --git a/geom/geom/inc/TGeoBoolNode.h b/geom/geom/inc/TGeoBoolNode.h
index ca5f1d56b8f..6328de16335 100644
--- a/geom/geom/inc/TGeoBoolNode.h
+++ b/geom/geom/inc/TGeoBoolNode.h
@@ -90,7 +90,7 @@ public:
    virtual void      Paint(Option_t *option);
    void              RegisterMatrices();
    virtual Double_t  Safety(Double_t *point, Bool_t in=kTRUE) const = 0;
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      SetPoints(Double_t *points) const;
    virtual void      SetPoints(Float_t *points)  const;
    void              SetSelected(Int_t sel);
@@ -127,7 +127,7 @@ public:
    virtual EGeoBoolType GetBooleanOperator() const {return kGeoUnion;}
    virtual Int_t     GetNpoints();
    virtual Double_t  Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      Sizeof3D() const;
 
    //CS specific
@@ -165,7 +165,7 @@ public:
    virtual EGeoBoolType GetBooleanOperator() const {return kGeoIntersection;}
    virtual Int_t     GetNpoints();
    virtual Double_t  Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      Sizeof3D() const;
 
    //CS specific
@@ -202,7 +202,7 @@ public:
    virtual EGeoBoolType GetBooleanOperator() const {return kGeoSubtraction;}
    virtual Int_t     GetNpoints();
    virtual Double_t  Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      Sizeof3D() const;
 
    //CS specific
diff --git a/geom/geom/inc/TGeoCompositeShape.h b/geom/geom/inc/TGeoCompositeShape.h
index 86db1c9db07..6c2b55a5370 100644
--- a/geom/geom/inc/TGeoCompositeShape.h
+++ b/geom/geom/inc/TGeoCompositeShape.h
@@ -73,7 +73,7 @@ public:
    virtual Bool_t        PaintComposite(Option_t *option = "") const;
    void                  RegisterYourself();
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t * /*param*/) {;}
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
diff --git a/geom/geom/inc/TGeoCone.h b/geom/geom/inc/TGeoCone.h
index 37829e35d6c..c85e3907917 100644
--- a/geom/geom/inc/TGeoCone.h
+++ b/geom/geom/inc/TGeoCone.h
@@ -91,7 +91,7 @@ public:
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    static  Double_t      SafetyS(Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
                                  Double_t rmin2, Double_t rmax2, Int_t skipz=0);
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetConeDimensions(Double_t dz, Double_t rmin1, Double_t rmax1,
                                        Double_t rmin2, Double_t rmax2);
    virtual void          SetDimensions(Double_t *param);
@@ -168,7 +168,7 @@ public:
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    static  Double_t      SafetyS(Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
                                  Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz=0);
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetConsDimensions(Double_t dz, Double_t rmin1, Double_t rmax1,
                                        Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
    virtual void          SetDimensions(Double_t *param);
diff --git a/geom/geom/inc/TGeoElement.h b/geom/geom/inc/TGeoElement.h
index d9b4afd1120..ea9d9358a98 100644
--- a/geom/geom/inc/TGeoElement.h
+++ b/geom/geom/inc/TGeoElement.h
@@ -200,7 +200,7 @@ public:
    void                     FillPopulation(TObjArray *population, Double_t precision=0.001, Double_t factor=1.);
    virtual void             Print(Option_t *option = "") const;
    static TGeoElementRN    *ReadElementRN(const char *record, Int_t &ndecays);
-   virtual void             SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void             SavePrimitive(std::ostream &out, Option_t *option = "");
   
    ClassDef(TGeoElementRN, 2)           // radionuclides class
 };
@@ -264,7 +264,7 @@ public:
    // Services
    virtual void             Print(Option_t *opt = " ") const;
    static TGeoDecayChannel *ReadDecay(const char *record);
-   virtual void             SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void             SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void             DecayShift(Int_t &dA, Int_t &dZ, Int_t &dI) const ;
 
    ClassDef(TGeoDecayChannel,1)    // Decay channel for Elements
diff --git a/geom/geom/inc/TGeoEltu.h b/geom/geom/inc/TGeoEltu.h
index 9f0da734006..e6539c2ff44 100644
--- a/geom/geom/inc/TGeoEltu.h
+++ b/geom/geom/inc/TGeoEltu.h
@@ -58,7 +58,7 @@ public:
    virtual void          InspectShape() const;
    virtual Bool_t        IsCylType() const {return kTRUE;}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetEltuDimensions(Double_t a, Double_t b, Double_t dz);
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
diff --git a/geom/geom/inc/TGeoHalfSpace.h b/geom/geom/inc/TGeoHalfSpace.h
index c3f05d703d4..7738baf6856 100644
--- a/geom/geom/inc/TGeoHalfSpace.h
+++ b/geom/geom/inc/TGeoHalfSpace.h
@@ -60,7 +60,7 @@ public:
    virtual void          InspectShape() const;
    virtual Bool_t        IsCylType() const {return kFALSE;}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t * /*points*/) const {;}
    virtual void          SetPoints(Float_t * /*points*/) const {;}
diff --git a/geom/geom/inc/TGeoHype.h b/geom/geom/inc/TGeoHype.h
index 79ee50757c5..b6c9b9e6965 100644
--- a/geom/geom/inc/TGeoHype.h
+++ b/geom/geom/inc/TGeoHype.h
@@ -102,7 +102,7 @@ public:
    //virtual void          Paint(Option_t *option);
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    Double_t              SafetyToHype(Double_t *point, Bool_t inner, Bool_t in) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
diff --git a/geom/geom/inc/TGeoMaterial.h b/geom/geom/inc/TGeoMaterial.h
index b7ca18e1966..973b9416b32 100644
--- a/geom/geom/inc/TGeoMaterial.h
+++ b/geom/geom/inc/TGeoMaterial.h
@@ -120,7 +120,7 @@ public:
    Bool_t                   IsUsed() const {return TObject::TestBit(kMatUsed);}
    virtual Bool_t           IsMixture() const {return kFALSE;}
    virtual void             Print(const Option_t *option="") const;
-   virtual void             SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void             SavePrimitive(std::ostream &out, Option_t *option = "");
    void                     SetA(Double_t a) {fA = a; SetRadLen(0);}
    void                     SetZ(Double_t z) {fZ = z; SetRadLen(0);}
    void                     SetDensity(Double_t density) {fDensity = density; SetRadLen(0);}
@@ -194,7 +194,7 @@ public:
    virtual Bool_t           IsEq(const TGeoMaterial *other) const;
    virtual Bool_t           IsMixture() const {return kTRUE;}
    virtual void             Print(const Option_t *option="") const;
-   virtual void             SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void             SavePrimitive(std::ostream &out, Option_t *option = "");
    void                     SetA(Double_t a) {fA = a;}
    void                     SetZ(Double_t z) {fZ = z;}
 
diff --git a/geom/geom/inc/TGeoMatrix.h b/geom/geom/inc/TGeoMatrix.h
index 01e50e4b166..793a2709a5f 100644
--- a/geom/geom/inc/TGeoMatrix.h
+++ b/geom/geom/inc/TGeoMatrix.h
@@ -154,7 +154,7 @@ public :
    virtual void         RotateX(Double_t angle);
    virtual void         RotateY(Double_t angle);
    virtual void         RotateZ(Double_t angle);
-   virtual void         SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void         SavePrimitive(std::ostream &out, Option_t *option = "");
    void                 Subtract(const TGeoTranslation *other);
    void                 SetTranslation(Double_t dx, Double_t dy, Double_t dz);
    void                 SetTranslation(const TGeoMatrix &other);
@@ -216,7 +216,7 @@ public :
    virtual void         RotateX(Double_t angle);
    virtual void         RotateY(Double_t angle);
    virtual void         RotateZ(Double_t angle);
-   virtual void         SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void         SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void         ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
    virtual void         ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
    virtual void         ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
@@ -309,7 +309,7 @@ public :
    virtual void         ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
    virtual void         ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
    virtual void         ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
-   virtual void         SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void         SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void         SetDx(Double_t dx) {SetTranslation(dx, fTranslation[1], fTranslation[2]);}
    virtual void         SetDy(Double_t dy) {SetTranslation(fTranslation[0], dy, fTranslation[2]);}
    virtual void         SetDz(Double_t dz) {SetTranslation(fTranslation[0], fTranslation[1], dz);}
@@ -389,7 +389,7 @@ public :
    virtual const Double_t    *GetTranslation() const {return &kNullVector[0];}
    virtual const Double_t    *GetRotationMatrix() const {return &kIdentityMatrix[0];}
    virtual const Double_t    *GetScale()       const {return &kUnitScale[0];}
-   virtual void         SavePrimitive(ostream &, Option_t * = "") {;}
+   virtual void         SavePrimitive(std::ostream &, Option_t * = "") {;}
 
    ClassDef(TGeoIdentity, 1)                 // identity transformation class
 };
@@ -439,7 +439,7 @@ public :
    virtual void         ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE);
    virtual void         ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE);
    virtual void         ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE);
-   virtual void         SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void         SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void         SetDx(Double_t dx) {fTranslation[0] = dx; SetBit(kGeoTranslation);}
    virtual void         SetDy(Double_t dy) {fTranslation[1] = dy; SetBit(kGeoTranslation);}
    virtual void         SetDz(Double_t dz) {fTranslation[2] = dz; SetBit(kGeoTranslation);}
diff --git a/geom/geom/inc/TGeoMedium.h b/geom/geom/inc/TGeoMedium.h
index 4f1080271aa..03d54e4ee81 100644
--- a/geom/geom/inc/TGeoMedium.h
+++ b/geom/geom/inc/TGeoMedium.h
@@ -52,7 +52,7 @@ public:
    void                     SetParam(Int_t i, Double_t val)   {fParams[i] = val;}
    char                    *GetPointerName() const;
    TGeoMaterial            *GetMaterial() const {return fMaterial;}
-   virtual void             SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void             SavePrimitive(std::ostream &out, Option_t *option = "");
    void                     SetId(Int_t id)     {fId = id;}
    void                     SetMaterial(TGeoMaterial *mat) {fMaterial = mat;}
    virtual void             SetCerenkovProperties(TObject* cerenkov) {fMaterial->SetCerenkovProperties(cerenkov);}   
diff --git a/geom/geom/inc/TGeoNode.h b/geom/geom/inc/TGeoNode.h
index 9af3d739d0a..0733870cd46 100644
--- a/geom/geom/inc/TGeoNode.h
+++ b/geom/geom/inc/TGeoNode.h
@@ -114,7 +114,7 @@ public:
 
    virtual TGeoNode *MakeCopyNode() const {return 0;}
    Double_t          Safety(Double_t *point, Bool_t in=kTRUE) const;
-   void              SaveAttributes(ostream &out);
+   void              SaveAttributes(std::ostream &out);
    void              SetCurrentPoint(Double_t x, Double_t y, Double_t z) {fVolume->SetCurrentPoint(x,y,z);}// *MENU*
    void              SetVolume(TGeoVolume *volume)       {fVolume = volume;}
    void              SetNumber(Int_t number)             {fNumber=number;}
diff --git a/geom/geom/inc/TGeoPara.h b/geom/geom/inc/TGeoPara.h
index 7a2a3501c7f..033708e02a3 100644
--- a/geom/geom/inc/TGeoPara.h
+++ b/geom/geom/inc/TGeoPara.h
@@ -79,7 +79,7 @@ public:
    virtual void          InspectShape() const;
    virtual Bool_t        IsCylType() const {return kFALSE;}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
diff --git a/geom/geom/inc/TGeoParaboloid.h b/geom/geom/inc/TGeoParaboloid.h
index ee9a2a64df5..da1e43b4c57 100644
--- a/geom/geom/inc/TGeoParaboloid.h
+++ b/geom/geom/inc/TGeoParaboloid.h
@@ -77,7 +77,7 @@ public:
    virtual Bool_t        IsCylType() const {return kTRUE;}
    virtual TBuffer3D    *MakeBuffer3D() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetParaboloidDimensions(Double_t rlo, Double_t rhi, Double_t dz);
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
diff --git a/geom/geom/inc/TGeoPatternFinder.h b/geom/geom/inc/TGeoPatternFinder.h
index b214b2d4908..4f6af3ea0e3 100644
--- a/geom/geom/inc/TGeoPatternFinder.h
+++ b/geom/geom/inc/TGeoPatternFinder.h
@@ -134,7 +134,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternX, 1)              // X division pattern
@@ -167,7 +167,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternY, 1)              // Y division pattern
@@ -200,7 +200,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternZ, 1)              // Z division pattern
@@ -233,7 +233,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternParaX, 1)              // Para X division pattern
@@ -269,7 +269,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternParaY, 1)              // Para Y division pattern
@@ -306,7 +306,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternParaZ, 1)              // Para Z division pattern
@@ -345,7 +345,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternTrapZ, 1)              // Trap od Gtra Z division pattern
@@ -378,7 +378,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternCylR, 1)              // Cylindrical R division pattern
@@ -419,7 +419,7 @@ public:
    virtual Bool_t      IsOnBoundary(const Double_t *point) const;
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternCylPhi, 1)              // Cylindrical phi division pattern
@@ -450,7 +450,7 @@ public:
    virtual Int_t       GetDivAxis()      {return 1;}
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternSphR, 1)              // spherical R division pattern
@@ -481,7 +481,7 @@ public:
    virtual Int_t       GetDivAxis()      {return 2;}
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternSphTheta, 1)              // spherical theta division pattern
@@ -512,7 +512,7 @@ public:
    virtual Int_t       GetDivAxis()      {return 3;}
    virtual 
    TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
 
    ClassDef(TGeoPatternSphPhi, 1)              // Spherical phi division pattern
diff --git a/geom/geom/inc/TGeoPcon.h b/geom/geom/inc/TGeoPcon.h
index 868f827adb7..ef3e39ed562 100644
--- a/geom/geom/inc/TGeoPcon.h
+++ b/geom/geom/inc/TGeoPcon.h
@@ -95,7 +95,7 @@ public:
    Double_t             &Z(Int_t ipl) {return fZ[ipl];}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    Double_t              SafetyToSegment(Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
diff --git a/geom/geom/inc/TGeoPgon.h b/geom/geom/inc/TGeoPgon.h
index d5789c4db56..1ea75362a79 100644
--- a/geom/geom/inc/TGeoPgon.h
+++ b/geom/geom/inc/TGeoPgon.h
@@ -80,7 +80,7 @@ public:
    virtual TBuffer3D    *MakeBuffer3D() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    Double_t              SafetyToSegment(Double_t *point, Int_t ipl, Int_t iphi, Bool_t in, Double_t safphi, Double_t safmin=TGeoShape::Big()) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t *param);
    void                  SetNedges(Int_t ne) {if (ne>2) fNedges=ne;}
    virtual void          SetPoints(Double_t *points) const;
diff --git a/geom/geom/inc/TGeoScaledShape.h b/geom/geom/inc/TGeoScaledShape.h
index afb477de99b..1b59e85e200 100644
--- a/geom/geom/inc/TGeoScaledShape.h
+++ b/geom/geom/inc/TGeoScaledShape.h
@@ -65,7 +65,7 @@ public:
    virtual TBuffer3D    *MakeBuffer3D() const;
    static  TGeoShape    *MakeScaledShape(const char *name, TGeoShape *shape, TGeoScale *scale);
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetScale(TGeoScale *scale) {fScale = scale;}
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
diff --git a/geom/geom/inc/TGeoShapeAssembly.h b/geom/geom/inc/TGeoShapeAssembly.h
index c16965e6295..18eaf27b9c9 100644
--- a/geom/geom/inc/TGeoShapeAssembly.h
+++ b/geom/geom/inc/TGeoShapeAssembly.h
@@ -59,7 +59,7 @@ public:
    void                  NeedsBBoxRecompute() {fBBoxOK = kFALSE;}
    void                  RecomputeBoxLast();
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
    virtual void          SetSegsAndPols(TBuffer3D &buff) const;
diff --git a/geom/geom/inc/TGeoSphere.h b/geom/geom/inc/TGeoSphere.h
index 67c3fd8f172..2f86a0f8c89 100644
--- a/geom/geom/inc/TGeoSphere.h
+++ b/geom/geom/inc/TGeoSphere.h
@@ -86,7 +86,7 @@ public:
    Bool_t                IsPointInside(Double_t *point, Bool_t checkR=kTRUE, Bool_t checkTh=kTRUE, Bool_t checkPh=kTRUE) const;
    virtual TBuffer3D    *MakeBuffer3D() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetSphDimensions(Double_t rmin, Double_t rmax, Double_t theta1,
                                        Double_t theta2, Double_t phi1, Double_t phi2);
    virtual void          SetNumberOfDivisions(Int_t p);
diff --git a/geom/geom/inc/TGeoTorus.h b/geom/geom/inc/TGeoTorus.h
index 57d862c07b9..eb5e1098405 100644
--- a/geom/geom/inc/TGeoTorus.h
+++ b/geom/geom/inc/TGeoTorus.h
@@ -84,7 +84,7 @@ public:
    virtual Bool_t        IsCylType() const {return kTRUE;}
    virtual TBuffer3D    *MakeBuffer3D() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetTorusDimensions(Double_t r, Double_t rmin, Double_t rmax, Double_t phi1, Double_t dphi);
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
diff --git a/geom/geom/inc/TGeoTrd1.h b/geom/geom/inc/TGeoTrd1.h
index b17f3c201d0..c333f38d314 100644
--- a/geom/geom/inc/TGeoTrd1.h
+++ b/geom/geom/inc/TGeoTrd1.h
@@ -70,7 +70,7 @@ public:
    virtual void          InspectShape() const;
    virtual Bool_t        IsCylType() const {return kFALSE;}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
diff --git a/geom/geom/inc/TGeoTrd2.h b/geom/geom/inc/TGeoTrd2.h
index f99b7f63b22..1f5ae904246 100644
--- a/geom/geom/inc/TGeoTrd2.h
+++ b/geom/geom/inc/TGeoTrd2.h
@@ -72,7 +72,7 @@ public:
    virtual void          InspectShape() const;
    virtual Bool_t        IsCylType() const {return kFALSE;}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
    virtual void          SetPoints(Float_t *points) const;
diff --git a/geom/geom/inc/TGeoTube.h b/geom/geom/inc/TGeoTube.h
index 61c5a67ef87..a49a95af01a 100644
--- a/geom/geom/inc/TGeoTube.h
+++ b/geom/geom/inc/TGeoTube.h
@@ -79,7 +79,7 @@ public:
    virtual TBuffer3D    *MakeBuffer3D() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    static  Double_t      SafetyS(Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Int_t skipz=0);
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetTubeDimensions(Double_t rmin, Double_t rmax, Double_t dz);
    virtual void          SetDimensions(Double_t *param);
    virtual void          SetPoints(Double_t *points) const;
@@ -152,7 +152,7 @@ public:
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
    static  Double_t      SafetyS(Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, 
                                  Double_t phi1, Double_t phi2, Int_t skipz=0);
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetTubsDimensions(Double_t rmin, Double_t rmax, Double_t dz,
                                        Double_t phi1, Double_t phi2);
    virtual void          SetDimensions(Double_t *param);
@@ -215,7 +215,7 @@ public:
    Double_t              GetZcoord(Double_t xc, Double_t yc, Double_t zc) const;
    virtual void          InspectShape() const;
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetCtubDimensions(Double_t rmin, Double_t rmax, Double_t dz,
                                        Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz,
                                        Double_t tx, Double_t ty, Double_t tz);
diff --git a/geom/geom/inc/TGeoVolume.h b/geom/geom/inc/TGeoVolume.h
index 6c757846396..3bc19cc3326 100644
--- a/geom/geom/inc/TGeoVolume.h
+++ b/geom/geom/inc/TGeoVolume.h
@@ -199,7 +199,7 @@ public:
    void            RemoveNode(TGeoNode *node);
    TGeoNode       *ReplaceNode(TGeoNode *nodeorig, TGeoShape *newshape=0, TGeoMatrix *newpos=0, TGeoMedium *newmed=0);
    void            SaveAs(const char *filename,Option_t *option="") const; // *MENU*
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    void            SelectVolume(Bool_t clear = kFALSE);
    void            SetActivity(Bool_t flag=kTRUE) {TGeoAtt::SetActivity(flag);}
    void            SetActiveDaughters(Bool_t flag=kTRUE) {TGeoAtt::SetActiveDaughters(flag);}
diff --git a/geom/geom/inc/TGeoXtru.h b/geom/geom/inc/TGeoXtru.h
index e88e6688c3c..9bac2d36a55 100644
--- a/geom/geom/inc/TGeoXtru.h
+++ b/geom/geom/inc/TGeoXtru.h
@@ -109,7 +109,7 @@ public:
    virtual TBuffer3D    *MakeBuffer3D() const;
    Double_t             &Z(Int_t ipl) {return fZ[ipl];}
    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    void                  SetCurrentZ(Double_t z, Int_t iz);
    void                  SetCurrentVertices(Double_t x0, Double_t y0, Double_t scale);
    virtual void          SetDimensions(Double_t *param);
diff --git a/geom/geom/src/TGeoArb8.cxx b/geom/geom/src/TGeoArb8.cxx
index 7ba71a7ea70..36812294ddd 100644
--- a/geom/geom/src/TGeoArb8.cxx
+++ b/geom/geom/src/TGeoArb8.cxx
@@ -1092,29 +1092,29 @@ Double_t TGeoArb8::SafetyToFace(Double_t *point, Int_t iseg, Bool_t in) const
 }
    
 //_____________________________________________________________________________
-void TGeoArb8::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoArb8::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dz       = " << fDz << ";" << endl;
-   out << "   vert[0]  = " << fXY[0][0] << ";" << endl;
-   out << "   vert[1]  = " << fXY[0][1] << ";" << endl;
-   out << "   vert[2]  = " << fXY[1][0] << ";" << endl;
-   out << "   vert[3]  = " << fXY[1][1] << ";" << endl;
-   out << "   vert[4]  = " << fXY[2][0] << ";" << endl;
-   out << "   vert[5]  = " << fXY[2][1] << ";" << endl;
-   out << "   vert[6]  = " << fXY[3][0] << ";" << endl;
-   out << "   vert[7]  = " << fXY[3][1] << ";" << endl;
-   out << "   vert[8]  = " << fXY[4][0] << ";" << endl;
-   out << "   vert[9]  = " << fXY[4][1] << ";" << endl;
-   out << "   vert[10] = " << fXY[5][0] << ";" << endl;
-   out << "   vert[11] = " << fXY[5][1] << ";" << endl;
-   out << "   vert[12] = " << fXY[6][0] << ";" << endl;
-   out << "   vert[13] = " << fXY[6][1] << ";" << endl;
-   out << "   vert[14] = " << fXY[7][0] << ";" << endl;
-   out << "   vert[15] = " << fXY[7][1] << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoArb8(\"" << GetName() << "\", dz,vert);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dz       = " << fDz << ";" << std::endl;
+   out << "   vert[0]  = " << fXY[0][0] << ";" << std::endl;
+   out << "   vert[1]  = " << fXY[0][1] << ";" << std::endl;
+   out << "   vert[2]  = " << fXY[1][0] << ";" << std::endl;
+   out << "   vert[3]  = " << fXY[1][1] << ";" << std::endl;
+   out << "   vert[4]  = " << fXY[2][0] << ";" << std::endl;
+   out << "   vert[5]  = " << fXY[2][1] << ";" << std::endl;
+   out << "   vert[6]  = " << fXY[3][0] << ";" << std::endl;
+   out << "   vert[7]  = " << fXY[3][1] << ";" << std::endl;
+   out << "   vert[8]  = " << fXY[4][0] << ";" << std::endl;
+   out << "   vert[9]  = " << fXY[4][1] << ";" << std::endl;
+   out << "   vert[10] = " << fXY[5][0] << ";" << std::endl;
+   out << "   vert[11] = " << fXY[5][1] << ";" << std::endl;
+   out << "   vert[12] = " << fXY[6][0] << ";" << std::endl;
+   out << "   vert[13] = " << fXY[6][1] << ";" << std::endl;
+   out << "   vert[14] = " << fXY[7][0] << ";" << std::endl;
+   out << "   vert[15] = " << fXY[7][1] << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoArb8(\"" << GetName() << "\", dz,vert);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
@@ -1623,23 +1623,23 @@ Double_t TGeoTrap::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoTrap::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTrap::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dz     = " << fDz << ";" << endl;
-   out << "   theta  = " << fTheta << ";" << endl;
-   out << "   phi    = " << fPhi << ";" << endl;
-   out << "   h1     = " << fH1<< ";" << endl;
-   out << "   bl1    = " << fBl1<< ";" << endl;
-   out << "   tl1    = " << fTl1<< ";" << endl;
-   out << "   alpha1 = " << fAlpha1 << ";" << endl;
-   out << "   h2     = " << fH2 << ";" << endl;
-   out << "   bl2    = " << fBl2<< ";" << endl;
-   out << "   tl2    = " << fTl2<< ";" << endl;
-   out << "   alpha2 = " << fAlpha2 << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTrap(\"" << GetName() << "\", dz,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dz     = " << fDz << ";" << std::endl;
+   out << "   theta  = " << fTheta << ";" << std::endl;
+   out << "   phi    = " << fPhi << ";" << std::endl;
+   out << "   h1     = " << fH1<< ";" << std::endl;
+   out << "   bl1    = " << fBl1<< ";" << std::endl;
+   out << "   tl1    = " << fTl1<< ";" << std::endl;
+   out << "   alpha1 = " << fAlpha1 << ";" << std::endl;
+   out << "   h2     = " << fH2 << ";" << std::endl;
+   out << "   bl2    = " << fBl2<< ";" << std::endl;
+   out << "   tl2    = " << fTl2<< ";" << std::endl;
+   out << "   alpha2 = " << fAlpha2 << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTrap(\"" << GetName() << "\", dz,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
@@ -1857,24 +1857,24 @@ Double_t TGeoGtra::Safety(Double_t *point, Bool_t in) const
 }   
 
 //_____________________________________________________________________________
-void TGeoGtra::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoGtra::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;  
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dz     = " << fDz << ";" << endl;
-   out << "   theta  = " << fTheta << ";" << endl;
-   out << "   phi    = " << fPhi << ";" << endl;
-   out << "   twist  = " << fTwistAngle << ";" << endl;
-   out << "   h1     = " << fH1<< ";" << endl;
-   out << "   bl1    = " << fBl1<< ";" << endl;
-   out << "   tl1    = " << fTl1<< ";" << endl;
-   out << "   alpha1 = " << fAlpha1 << ";" << endl;
-   out << "   h2     = " << fH2 << ";" << endl;
-   out << "   bl2    = " << fBl2<< ";" << endl;
-   out << "   tl2    = " << fTl2<< ";" << endl;
-   out << "   alpha2 = " << fAlpha2 << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoGtra(\"" << GetName() << "\", dz,theta,phi,twist,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dz     = " << fDz << ";" << std::endl;
+   out << "   theta  = " << fTheta << ";" << std::endl;
+   out << "   phi    = " << fPhi << ";" << std::endl;
+   out << "   twist  = " << fTwistAngle << ";" << std::endl;
+   out << "   h1     = " << fH1<< ";" << std::endl;
+   out << "   bl1    = " << fBl1<< ";" << std::endl;
+   out << "   tl1    = " << fTl1<< ";" << std::endl;
+   out << "   alpha1 = " << fAlpha1 << ";" << std::endl;
+   out << "   h2     = " << fH2 << ";" << std::endl;
+   out << "   bl2    = " << fBl2<< ";" << std::endl;
+   out << "   tl2    = " << fTl2<< ";" << std::endl;
+   out << "   alpha2 = " << fAlpha2 << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoGtra(\"" << GetName() << "\", dz,theta,phi,twist,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoBBox.cxx b/geom/geom/src/TGeoBBox.cxx
index 6b85b830ae7..35f7d9c91f6 100644
--- a/geom/geom/src/TGeoBBox.cxx
+++ b/geom/geom/src/TGeoBBox.cxx
@@ -797,23 +797,23 @@ Double_t TGeoBBox::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoBBox::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoBBox::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dx = " << fDX << ";" << endl;
-   out << "   dy = " << fDY << ";" << endl;
-   out << "   dz = " << fDZ << ";" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dx = " << fDX << ";" << std::endl;
+   out << "   dy = " << fDY << ";" << std::endl;
+   out << "   dz = " << fDZ << ";" << std::endl;
    if (!TGeoShape::IsSameWithinTolerance(fOrigin[0],0) || 
        !TGeoShape::IsSameWithinTolerance(fOrigin[1],0) || 
        !TGeoShape::IsSameWithinTolerance(fOrigin[2],0)) { 
-      out << "   origin[0] = " << fOrigin[0] << ";" << endl;
-      out << "   origin[1] = " << fOrigin[1] << ";" << endl;
-      out << "   origin[2] = " << fOrigin[2] << ";" << endl;
-      out << "   TGeoShape *" << GetPointerName() << " = new TGeoBBox(\"" << GetName() << "\", dx,dy,dz,origin);" << endl;
+      out << "   origin[0] = " << fOrigin[0] << ";" << std::endl;
+      out << "   origin[1] = " << fOrigin[1] << ";" << std::endl;
+      out << "   origin[2] = " << fOrigin[2] << ";" << std::endl;
+      out << "   TGeoShape *" << GetPointerName() << " = new TGeoBBox(\"" << GetName() << "\", dx,dy,dz,origin);" << std::endl;
    } else {   
-      out << "   TGeoShape *" << GetPointerName() << " = new TGeoBBox(\"" << GetName() << "\", dx,dy,dz);" << endl;
+      out << "   TGeoShape *" << GetPointerName() << " = new TGeoBBox(\"" << GetName() << "\", dx,dy,dz);" << std::endl;
    }
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }         
diff --git a/geom/geom/src/TGeoBoolNode.cxx b/geom/geom/src/TGeoBoolNode.cxx
index 0117f7d1f3b..422f3208b14 100644
--- a/geom/geom/src/TGeoBoolNode.cxx
+++ b/geom/geom/src/TGeoBoolNode.cxx
@@ -317,7 +317,7 @@ void TGeoBoolNode::RegisterMatrices()
 }
 
 //_____________________________________________________________________________
-void TGeoBoolNode::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoBoolNode::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    fLeft->SavePrimitive(out,option);
@@ -721,7 +721,7 @@ Double_t TGeoUnion::Safety(Double_t *point, Bool_t in) const
 }   
 
 //_____________________________________________________________________________
-void TGeoUnion::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoUnion::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    TGeoBoolNode::SavePrimitive(out,option);
@@ -730,8 +730,8 @@ void TGeoUnion::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << fRight->GetPointerName() << ",";
    if (!fLeftMat->IsIdentity()) out << fLeftMat->GetPointerName() << ",";
    else                         out << "0,";
-   if (!fRightMat->IsIdentity()) out << fRightMat->GetPointerName() << ");" << endl;
-   else                         out << "0);" << endl;
+   if (!fRightMat->IsIdentity()) out << fRightMat->GetPointerName() << ");" << std::endl;
+   else                         out << "0);" << std::endl;
 }   
 
 //______________________________________________________________________________
@@ -1034,7 +1034,7 @@ Double_t TGeoSubtraction::Safety(Double_t *point, Bool_t in) const
 }   
 
 //_____________________________________________________________________________
-void TGeoSubtraction::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoSubtraction::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    TGeoBoolNode::SavePrimitive(out,option);
@@ -1043,8 +1043,8 @@ void TGeoSubtraction::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << fRight->GetPointerName() << ",";
    if (!fLeftMat->IsIdentity()) out << fLeftMat->GetPointerName() << ",";
    else                         out << "0,";
-   if (!fRightMat->IsIdentity()) out << fRightMat->GetPointerName() << ");" << endl;
-   else                         out << "0);" << endl;
+   if (!fRightMat->IsIdentity()) out << fRightMat->GetPointerName() << ");" << std::endl;
+   else                         out << "0);" << std::endl;
 }   
 
 //______________________________________________________________________________
@@ -1435,7 +1435,7 @@ Double_t TGeoIntersection::Safety(Double_t *point, Bool_t in) const
 }   
 
 //_____________________________________________________________________________
-void TGeoIntersection::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoIntersection::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    TGeoBoolNode::SavePrimitive(out,option);
@@ -1444,8 +1444,8 @@ void TGeoIntersection::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << fRight->GetPointerName() << ",";
    if (!fLeftMat->IsIdentity()) out << fLeftMat->GetPointerName() << ",";
    else                         out << "0,";
-   if (!fRightMat->IsIdentity()) out << fRightMat->GetPointerName() << ");" << endl;
-   else                         out << "0);" << endl;
+   if (!fRightMat->IsIdentity()) out << fRightMat->GetPointerName() << ");" << std::endl;
+   else                         out << "0);" << std::endl;
 }   
 
 //______________________________________________________________________________
diff --git a/geom/geom/src/TGeoCompositeShape.cxx b/geom/geom/src/TGeoCompositeShape.cxx
index e49e5635c80..cce2a4c6f5a 100644
--- a/geom/geom/src/TGeoCompositeShape.cxx
+++ b/geom/geom/src/TGeoCompositeShape.cxx
@@ -462,14 +462,14 @@ Double_t TGeoCompositeShape::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoCompositeShape::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoCompositeShape::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
    if (fNode) fNode->SavePrimitive(out,option);
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoCompositeShape(\"" << GetName() << "\", pBoolNode);" << endl;
-   if (strlen(GetTitle())) out << "   " << GetPointerName() << "->SetTitle(\"" << GetTitle() << "\");" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoCompositeShape(\"" << GetName() << "\", pBoolNode);" << std::endl;
+   if (strlen(GetTitle())) out << "   " << GetPointerName() << "->SetTitle(\"" << GetTitle() << "\");" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoCone.cxx b/geom/geom/src/TGeoCone.cxx
index 5675b3a689a..36d88c10f36 100644
--- a/geom/geom/src/TGeoCone.cxx
+++ b/geom/geom/src/TGeoCone.cxx
@@ -907,17 +907,17 @@ Double_t TGeoCone::SafetyS(Double_t *point, Bool_t in, Double_t dz, Double_t rmi
 }
 
 //_____________________________________________________________________________
-void TGeoCone::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoCone::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dz    = " << fDz << ";" << endl;
-   out << "   rmin1 = " << fRmin1 << ";" << endl;
-   out << "   rmax1 = " << fRmax1 << ";" << endl;
-   out << "   rmin2 = " << fRmin2 << ";" << endl;
-   out << "   rmax2 = " << fRmax2 << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoCone(\"" << GetName() << "\", dz,rmin1,rmax1,rmin2,rmax2);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dz    = " << fDz << ";" << std::endl;
+   out << "   rmin1 = " << fRmin1 << ";" << std::endl;
+   out << "   rmax1 = " << fRmax1 << ";" << std::endl;
+   out << "   rmin2 = " << fRmin2 << ";" << std::endl;
+   out << "   rmax2 = " << fRmax2 << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoCone(\"" << GetName() << "\", dz,rmin1,rmax1,rmin2,rmax2);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);   
 }
          
@@ -2162,19 +2162,19 @@ Double_t TGeoConeSeg::SafetyS(Double_t *point, Bool_t in, Double_t dz, Double_t
 }
 
 //_____________________________________________________________________________
-void TGeoConeSeg::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoConeSeg::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dz    = " << fDz << ";" << endl;
-   out << "   rmin1 = " << fRmin1 << ";" << endl;
-   out << "   rmax1 = " << fRmax1 << ";" << endl;
-   out << "   rmin2 = " << fRmin2 << ";" << endl;
-   out << "   rmax2 = " << fRmax2 << ";" << endl;
-   out << "   phi1  = " << fPhi1 << ";" << endl;
-   out << "   phi2  = " << fPhi2 << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoConeSeg(\"" << GetName() << "\", dz,rmin1,rmax1,rmin2,rmax2,phi1,phi2);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dz    = " << fDz << ";" << std::endl;
+   out << "   rmin1 = " << fRmin1 << ";" << std::endl;
+   out << "   rmax1 = " << fRmax1 << ";" << std::endl;
+   out << "   rmin2 = " << fRmin2 << ";" << std::endl;
+   out << "   rmax2 = " << fRmax2 << ";" << std::endl;
+   out << "   phi1  = " << fPhi1 << ";" << std::endl;
+   out << "   phi2  = " << fPhi2 << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoConeSeg(\"" << GetName() << "\", dz,rmin1,rmax1,rmin2,rmax2,phi1,phi2);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);  
 }
 
diff --git a/geom/geom/src/TGeoElement.cxx b/geom/geom/src/TGeoElement.cxx
index 605457e7ab4..51f68af5014 100644
--- a/geom/geom/src/TGeoElement.cxx
+++ b/geom/geom/src/TGeoElement.cxx
@@ -505,33 +505,33 @@ TGeoElementRN *TGeoElementRN::ReadElementRN(const char *line, Int_t &ndecays)
 }
 
 //______________________________________________________________________________
-void TGeoElementRN::SavePrimitive(ostream &out, Option_t *option)
+void TGeoElementRN::SavePrimitive(std::ostream &out, Option_t *option)
 {
 // Save primitive for RN elements.
    if (!strcmp(option,"h")) {
       // print a header if requested
-      out << "#====================================================================================================================================" << endl;
-      out << "#   Name      A    Z   ISO    LEV[MeV]  DM[MeV]   T1/2[s]        J/P     ABUND[%]    HTOX      ITOX      HTOX      ITOX    STAT NDCY" << endl;
-      out << "#====================================================================================================================================" << endl;
+      out << "#====================================================================================================================================" << std::endl;
+      out << "#   Name      A    Z   ISO    LEV[MeV]  DM[MeV]   T1/2[s]        J/P     ABUND[%]    HTOX      ITOX      HTOX      ITOX    STAT NDCY" << std::endl;
+      out << "#====================================================================================================================================" << std::endl;
    }
-   out << setw(11) << fName.Data();
-   out << setw(5) << (Int_t)fA;
-   out << setw(5) << fZ;
-   out << setw(5) << fIso;
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fLevel;
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fDeltaM;
-   out << setw(10) << setiosflags(ios::scientific) << setprecision(3) << fHalfLife;
-   out << setw(13) << fTitle.Data();
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fNatAbun;
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fTH_F;
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fTG_F;
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fTH_S;
-   out << setw(10) << setiosflags(ios::fixed) << setprecision(5) << fTG_S;
-   out << setw(5) << fStatus;
+   out << std::setw(11) << fName.Data();
+   out << std::setw(5) << (Int_t)fA;
+   out << std::setw(5) << fZ;
+   out << std::setw(5) << fIso;
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fLevel;
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fDeltaM;
+   out << std::setw(10) << setiosflags(std::ios::scientific) << std::setprecision(3) << fHalfLife;
+   out << std::setw(13) << fTitle.Data();
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fNatAbun;
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fTH_F;
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fTG_F;
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fTH_S;
+   out << std::setw(10) << setiosflags(std::ios::fixed) << std::setprecision(5) << fTG_S;
+   out << std::setw(5) << fStatus;
    Int_t ndecays = 0;
    if (fDecays) ndecays = fDecays->GetEntries();
-   out << setw(5) << ndecays;
-   out << endl;
+   out << std::setw(5) << ndecays;
+   out << std::endl;
    if (fDecays) {
       TIter next(fDecays);
       TGeoDecayChannel *dc;
@@ -638,17 +638,17 @@ TGeoDecayChannel *TGeoDecayChannel::ReadDecay(const char *line)
 }
 
 //______________________________________________________________________________
-void TGeoDecayChannel::SavePrimitive(ostream &out, Option_t *)
+void TGeoDecayChannel::SavePrimitive(std::ostream &out, Option_t *)
 {
 // Save primitive for decays.
    TString decayName;
    DecayName(fDecay, decayName);
-   out << setw(50) << decayName.Data();
-   out << setw(10) << fDecay;
-   out << setw(10) << fDiso;
-   out << setw(12) << setiosflags(ios::fixed) << setprecision(6) << fBranchingRatio;
-   out << setw(12) << setiosflags(ios::fixed) << setprecision(6) << fQvalue;
-   out << endl;
+   out << std::setw(50) << decayName.Data();
+   out << std::setw(10) << fDecay;
+   out << std::setw(10) << fDiso;
+   out << std::setw(12) << setiosflags(std::ios::fixed) << std::setprecision(6) << fBranchingRatio;
+   out << std::setw(12) << setiosflags(std::ios::fixed) << std::setprecision(6) << fQvalue;
+   out << std::endl;
 }
 
 //______________________________________________________________________________
@@ -1094,8 +1094,8 @@ void TGeoElementTable::ExportElementsRN(const char *filename)
    if (!HasRNElements()) return;
    TString sname = filename;
    if (!sname.Length()) sname = "RadioNuclides.txt";
-   ofstream out;
-   out.open(sname.Data(), ios::out);
+   std::ofstream out;
+   out.open(sname.Data(), std::ios::out);
    if (!out.good()) {
       Error("ExportElementsRN", "Cannot open file %s", sname.Data());
       return;
diff --git a/geom/geom/src/TGeoEltu.cxx b/geom/geom/src/TGeoEltu.cxx
index a09a5da4e9e..b1d9f6d9000 100644
--- a/geom/geom/src/TGeoEltu.cxx
+++ b/geom/geom/src/TGeoEltu.cxx
@@ -392,15 +392,15 @@ Double_t TGeoEltu::Safety(Double_t *point, Bool_t /*in*/) const
 }
 
 //_____________________________________________________________________________
-void TGeoEltu::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoEltu::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   a  = " << fRmin << ";" << endl;
-   out << "   b  = " << fRmax << ";" << endl;
-   out << "   dz = " << fDz << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoEltu(\"" << GetName() << "\",a,b,dz);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   a  = " << fRmin << ";" << std::endl;
+   out << "   b  = " << fRmax << ";" << std::endl;
+   out << "   dz = " << fDz << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoEltu(\"" << GetName() << "\",a,b,dz);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoHalfSpace.cxx b/geom/geom/src/TGeoHalfSpace.cxx
index 98dcd91acd3..bee5b83e07b 100644
--- a/geom/geom/src/TGeoHalfSpace.cxx
+++ b/geom/geom/src/TGeoHalfSpace.cxx
@@ -181,18 +181,18 @@ Double_t TGeoHalfSpace::Safety(Double_t *point, Bool_t /*in*/) const
 }
 
 //_____________________________________________________________________________
-void TGeoHalfSpace::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoHalfSpace::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   point[0] = " << fP[0] << ";" << endl;
-   out << "   point[1] = " << fP[1] << ";" << endl;
-   out << "   point[2] = " << fP[2] << ";" << endl;
-   out << "   norm[0]  = " << fN[0] << ";" << endl;
-   out << "   norm[1]  = " << fN[1] << ";" << endl;
-   out << "   norm[2]  = " << fN[2] << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoHalfSpace(\"" << GetName() << "\", point,norm);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   point[0] = " << fP[0] << ";" << std::endl;
+   out << "   point[1] = " << fP[1] << ";" << std::endl;
+   out << "   point[2] = " << fP[2] << ";" << std::endl;
+   out << "   norm[0]  = " << fN[0] << ";" << std::endl;
+   out << "   norm[1]  = " << fN[1] << ";" << std::endl;
+   out << "   norm[2]  = " << fN[2] << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoHalfSpace(\"" << GetName() << "\", point,norm);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }         
 
diff --git a/geom/geom/src/TGeoHype.cxx b/geom/geom/src/TGeoHype.cxx
index da62c19c7dd..e11507af132 100644
--- a/geom/geom/src/TGeoHype.cxx
+++ b/geom/geom/src/TGeoHype.cxx
@@ -742,17 +742,17 @@ Double_t TGeoHype::SafetyToHype(Double_t *point, Bool_t inner, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoHype::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoHype::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   rin   = " << fRmin << ";" << endl;
-   out << "   stin  = " << fStIn << ";" << endl;
-   out << "   rout  = " << fRmax << ";" << endl;
-   out << "   stout = " << fStOut << ";" << endl;
-   out << "   dz    = " << fDz << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoHype(\"" << GetName() << "\",rin,stin,rout,stout,dz);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   rin   = " << fRmin << ";" << std::endl;
+   out << "   stin  = " << fStIn << ";" << std::endl;
+   out << "   rout  = " << fRmax << ";" << std::endl;
+   out << "   stout = " << fStOut << ";" << std::endl;
+   out << "   dz    = " << fDz << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoHype(\"" << GetName() << "\",rin,stin,rout,stout,dz);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);  
 }
 
diff --git a/geom/geom/src/TGeoManager.cxx b/geom/geom/src/TGeoManager.cxx
index a3e4bc738e8..aaccd553160 100644
--- a/geom/geom/src/TGeoManager.cxx
+++ b/geom/geom/src/TGeoManager.cxx
@@ -2158,10 +2158,10 @@ void TGeoManager::OptimizeVoxels(const char *filename)
       Error("OptimizeVoxels","Geometry must be closed first");
       return;
    }
-   ofstream out;
+   std::ofstream out;
    TString fname = filename;
    if (fname.IsNull()) fname = "tgeovox.C";
-   out.open(fname, ios::out);
+   out.open(fname, std::ios::out);
    if (!out.good()) {
       Error("OptimizeVoxels", "cannot open file");
       return;
@@ -2170,27 +2170,27 @@ void TGeoManager::OptimizeVoxels(const char *filename)
    TDatime t;
    TString sname(fname);
    sname.ReplaceAll(".C", "");
-   out << sname.Data()<<"()"<<endl;
-   out << "{" << endl;
-   out << "//=== Macro generated by ROOT version "<< gROOT->GetVersion()<<" : "<<t.AsString()<<endl;
-   out << "//=== Voxel optimization for " << GetTitle() << " geometry"<<endl;
-   out << "//===== <run this macro JUST BEFORE closing the geometry>"<<endl;
-   out << "   TGeoVolume *vol = 0;"<<endl;
-   out << "   // parse all voxelized volumes"<<endl;
+   out << sname.Data()<<"()"<<std::endl;
+   out << "{" << std::endl;
+   out << "//=== Macro generated by ROOT version "<< gROOT->GetVersion()<<" : "<<t.AsString()<<std::endl;
+   out << "//=== Voxel optimization for " << GetTitle() << " geometry"<<std::endl;
+   out << "//===== <run this macro JUST BEFORE closing the geometry>"<<std::endl;
+   out << "   TGeoVolume *vol = 0;"<<std::endl;
+   out << "   // parse all voxelized volumes"<<std::endl;
    TGeoVolume *vol = 0;
    Bool_t cyltype;
    TIter next(fVolumes);
    while ((vol=(TGeoVolume*)next())) {
       if (!vol->GetVoxels()) continue;
-      out<<"   vol = gGeoManager->GetVolume(\""<<vol->GetName()<<"\");"<<endl;
+      out<<"   vol = gGeoManager->GetVolume(\""<<vol->GetName()<<"\");"<<std::endl;
       cyltype = vol->OptimizeVoxels();
       if (cyltype) {
-         out<<"   vol->SetCylVoxels();"<<endl;
+         out<<"   vol->SetCylVoxels();"<<std::endl;
       } else {
-         out<<"   vol->SetCylVoxels(kFALSE);"<<endl;
+         out<<"   vol->SetCylVoxels(kFALSE);"<<std::endl;
       }
    }
-   out << "}" << endl;
+   out << "}" << std::endl;
    out.close();
 }
 //_____________________________________________________________________________
@@ -2323,10 +2323,10 @@ void TGeoManager::SaveAttributes(const char *filename)
       Error("SaveAttributes","geometry must be closed first\n");
       return;
    }
-   ofstream out;
+   std::ofstream out;
    TString fname(filename);
    if (fname.IsNull()) fname = "tgeoatt.C";
-   out.open(fname, ios::out);
+   out.open(fname, std::ios::out);
    if (!out.good()) {
       Error("SaveAttributes", "cannot open file");
       return;
@@ -2335,27 +2335,27 @@ void TGeoManager::SaveAttributes(const char *filename)
    TDatime t;
    TString sname(fname);
    sname.ReplaceAll(".C", "");
-   out << sname.Data()<<"()"<<endl;
-   out << "{" << endl;
-   out << "//=== Macro generated by ROOT version "<< gROOT->GetVersion()<<" : "<<t.AsString()<<endl;
-   out << "//=== Attributes for " << GetTitle() << " geometry"<<endl;
-   out << "//===== <run this macro AFTER loading the geometry in memory>"<<endl;
+   out << sname.Data()<<"()"<<std::endl;
+   out << "{" << std::endl;
+   out << "//=== Macro generated by ROOT version "<< gROOT->GetVersion()<<" : "<<t.AsString()<<std::endl;
+   out << "//=== Attributes for " << GetTitle() << " geometry"<<std::endl;
+   out << "//===== <run this macro AFTER loading the geometry in memory>"<<std::endl;
    // save current top volume
-   out << "   TGeoVolume *top = gGeoManager->GetVolume(\""<<fTopVolume->GetName()<<"\");"<<endl;
-   out << "   TGeoVolume *vol = 0;"<<endl;
-   out << "   TGeoNode *node = 0;"<<endl;
-   out << "   // clear all volume attributes and get painter"<<endl;
-   out << "   gGeoManager->ClearAttributes();"<<endl;
-   out << "   gGeoManager->GetGeomPainter();"<<endl;
-   out << "   // set visualization modes and bomb factors"<<endl;
-   out << "   gGeoManager->SetVisOption("<<GetVisOption()<<");"<<endl;
-   out << "   gGeoManager->SetVisLevel("<<GetVisLevel()<<");"<<endl;
-   out << "   gGeoManager->SetExplodedView("<<GetBombMode()<<");"<<endl;
+   out << "   TGeoVolume *top = gGeoManager->GetVolume(\""<<fTopVolume->GetName()<<"\");"<<std::endl;
+   out << "   TGeoVolume *vol = 0;"<<std::endl;
+   out << "   TGeoNode *node = 0;"<<std::endl;
+   out << "   // clear all volume attributes and get painter"<<std::endl;
+   out << "   gGeoManager->ClearAttributes();"<<std::endl;
+   out << "   gGeoManager->GetGeomPainter();"<<std::endl;
+   out << "   // set visualization modes and bomb factors"<<std::endl;
+   out << "   gGeoManager->SetVisOption("<<GetVisOption()<<");"<<std::endl;
+   out << "   gGeoManager->SetVisLevel("<<GetVisLevel()<<");"<<std::endl;
+   out << "   gGeoManager->SetExplodedView("<<GetBombMode()<<");"<<std::endl;
    Double_t bombx, bomby, bombz, bombr;
    GetBombFactors(bombx, bomby, bombz, bombr);
-   out << "   gGeoManager->SetBombFactors("<<bombx<<","<<bomby<<","<<bombz<<","<<bombr<<");"<<endl;
-   out << "   // iterate volumes coontainer and set new attributes"<<endl;
-//   out << "   TIter next(gGeoManager->GetListOfVolumes());"<<endl;
+   out << "   gGeoManager->SetBombFactors("<<bombx<<","<<bomby<<","<<bombz<<","<<bombr<<");"<<std::endl;
+   out << "   // iterate volumes coontainer and set new attributes"<<std::endl;
+//   out << "   TIter next(gGeoManager->GetListOfVolumes());"<<std::endl;
    TGeoVolume *vol = 0;
    fTopNode->SaveAttributes(out);
 
@@ -2363,10 +2363,10 @@ void TGeoManager::SaveAttributes(const char *filename)
    while ((vol=(TGeoVolume*)next())) {
       vol->SetVisStreamed(kFALSE);
    }
-   out << "   // draw top volume with new settings"<<endl;
-   out << "   top->Draw();"<<endl;
-   out << "   gPad->x3d();"<<endl;
-   out << "}" << endl;
+   out << "   // draw top volume with new settings"<<std::endl;
+   out << "   top->Draw();"<<std::endl;
+   out << "   gPad->x3d();"<<std::endl;
+   out << "}" << std::endl;
    out.close();
 }
 //_____________________________________________________________________________
diff --git a/geom/geom/src/TGeoMaterial.cxx b/geom/geom/src/TGeoMaterial.cxx
index b5ecb0d296d..af424be31ce 100644
--- a/geom/geom/src/TGeoMaterial.cxx
+++ b/geom/geom/src/TGeoMaterial.cxx
@@ -325,20 +325,20 @@ void TGeoMaterial::Print(const Option_t * /*option*/) const
 }
 
 //_____________________________________________________________________________
-void TGeoMaterial::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoMaterial::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(TGeoMaterial::kMatSavePrimitive)) return;
    char *name = GetPointerName();
-   out << "// Material: " << GetName() << endl;
-   out << "   a       = " << fA << ";" << endl;
-   out << "   z       = " << fZ << ";" << endl;
-   out << "   density = " << fDensity << ";" << endl;
-   out << "   radl    = " << fRadLen << ";" << endl;
-   out << "   absl    = " << fIntLen << ";" << endl;
+   out << "// Material: " << GetName() << std::endl;
+   out << "   a       = " << fA << ";" << std::endl;
+   out << "   z       = " << fZ << ";" << std::endl;
+   out << "   density = " << fDensity << ";" << std::endl;
+   out << "   radl    = " << fRadLen << ";" << std::endl;
+   out << "   absl    = " << fIntLen << ";" << std::endl;
    
-   out << "   " << name << " = new TGeoMaterial(\"" << GetName() << "\", a,z,density,radl,absl);" << endl;
-   out << "   " << name << "->SetIndex(" << GetIndex() << ");" << endl;
+   out << "   " << name << " = new TGeoMaterial(\"" << GetName() << "\", a,z,density,radl,absl);" << std::endl;
+   out << "   " << name << "->SetIndex(" << GetIndex() << ");" << std::endl;
    SetBit(TGeoMaterial::kMatSavePrimitive);
 }
 
@@ -835,21 +835,21 @@ void TGeoMixture::Print(const Option_t * /*option*/) const
 }
 
 //_____________________________________________________________________________
-void TGeoMixture::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoMixture::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(TGeoMaterial::kMatSavePrimitive)) return;
    char *name = GetPointerName();
-   out << "// Mixture: " << GetName() << endl;
-   out << "   nel     = " << fNelements << ";" << endl;
-   out << "   density = " << fDensity << ";" << endl;
-   out << "   " << name << " = new TGeoMixture(\"" << GetName() << "\", nel,density);" << endl;
+   out << "// Mixture: " << GetName() << std::endl;
+   out << "   nel     = " << fNelements << ";" << std::endl;
+   out << "   density = " << fDensity << ";" << std::endl;
+   out << "   " << name << " = new TGeoMixture(\"" << GetName() << "\", nel,density);" << std::endl;
    for (Int_t i=0; i<fNelements; i++) {
       TGeoElement *el = GetElement(i);
-      out << "      a = " << fAmixture[i] << ";   z = "<< fZmixture[i] << ";   w = " << fWeights[i] << ";  // " << el->GetName() << endl;
-      out << "   " << name << "->DefineElement(" << i << ",a,z,w);" << endl;
+      out << "      a = " << fAmixture[i] << ";   z = "<< fZmixture[i] << ";   w = " << fWeights[i] << ";  // " << el->GetName() << std::endl;
+      out << "   " << name << "->DefineElement(" << i << ",a,z,w);" << std::endl;
    }         
-   out << "   " << name << "->SetIndex(" << GetIndex() << ");" << endl;
+   out << "   " << name << "->SetIndex(" << GetIndex() << ");" << std::endl;
    SetBit(TGeoMaterial::kMatSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoMatrix.cxx b/geom/geom/src/TGeoMatrix.cxx
index a7ebc21eb97..f1db28c91d6 100644
--- a/geom/geom/src/TGeoMatrix.cxx
+++ b/geom/geom/src/TGeoMatrix.cxx
@@ -734,15 +734,15 @@ void TGeoTranslation::MasterToLocalBomb(const Double_t *master, Double_t *local)
 }
 
 //_____________________________________________________________________________
-void TGeoTranslation::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTranslation::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(kGeoSavePrimitive)) return;
-   out << "   // Translation: " << GetName() << endl;
-   out << "   dx = " << fTranslation[0] << ";" << endl;
-   out << "   dy = " << fTranslation[1] << ";" << endl;
-   out << "   dz = " << fTranslation[2] << ";" << endl;
-   out << "   TGeoTranslation *" << GetPointerName() << " = new TGeoTranslation(\"" << GetName() << "\",dx,dy,dz);" << endl;
+   out << "   // Translation: " << GetName() << std::endl;
+   out << "   dx = " << fTranslation[0] << ";" << std::endl;
+   out << "   dy = " << fTranslation[1] << ";" << std::endl;
+   out << "   dz = " << fTranslation[2] << ";" << std::endl;
+   out << "   TGeoTranslation *" << GetPointerName() << " = new TGeoTranslation(\"" << GetName() << "\",dx,dy,dz);" << std::endl;
    TObject::SetBit(kGeoSavePrimitive);
 }
 
@@ -1043,17 +1043,17 @@ void TGeoRotation::ReflectZ(Bool_t leftside, Bool_t)
 }      
 
 //_____________________________________________________________________________
-void TGeoRotation::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoRotation::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(kGeoSavePrimitive)) return;
-   out << "   // Rotation: " << GetName() << endl;
+   out << "   // Rotation: " << GetName() << std::endl;
    Double_t th1,ph1,th2,ph2,th3,ph3;
    GetAngles(th1,ph1,th2,ph2,th3,ph3);
-   out << "   thx = " << th1 << ";    phx = " << ph1 << ";" << endl;
-   out << "   thy = " << th2 << ";    phy = " << ph2 << ";" << endl;
-   out << "   thz = " << th3 << ";    phz = " << ph3 << ";" << endl;
-   out << "   TGeoRotation *" << GetPointerName() << " = new TGeoRotation(\"" << GetName() << "\",thx,phx,thy,phy,thz,phz);" << endl;
+   out << "   thx = " << th1 << ";    phx = " << ph1 << ";" << std::endl;
+   out << "   thy = " << th2 << ";    phy = " << ph2 << ";" << std::endl;
+   out << "   thz = " << th3 << ";    phz = " << ph3 << ";" << std::endl;
+   out << "   TGeoRotation *" << GetPointerName() << " = new TGeoRotation(\"" << GetName() << "\",thx,phx,thy,phy,thz,phz);" << std::endl;
    TObject::SetBit(kGeoSavePrimitive);
 }
 
@@ -1720,21 +1720,21 @@ void TGeoCombiTrans::ReflectZ(Bool_t leftside, Bool_t rotonly)
 }      
 
 //_____________________________________________________________________________
-void TGeoCombiTrans::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoCombiTrans::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(kGeoSavePrimitive)) return;
-   out << "   // Combi transformation: " << GetName() << endl;
-   out << "   dx = " << fTranslation[0] << ";" << endl;
-   out << "   dy = " << fTranslation[1] << ";" << endl;
-   out << "   dz = " << fTranslation[2] << ";" << endl;
+   out << "   // Combi transformation: " << GetName() << std::endl;
+   out << "   dx = " << fTranslation[0] << ";" << std::endl;
+   out << "   dy = " << fTranslation[1] << ";" << std::endl;
+   out << "   dz = " << fTranslation[2] << ";" << std::endl;
    if (fRotation && fRotation->IsRotation()) {
       fRotation->SavePrimitive(out,option);
       out << "   " << GetPointerName() << " = new TGeoCombiTrans(\"" << GetName() << "\", dx,dy,dz,";
-      out << fRotation->GetPointerName() << ");" << endl;
+      out << fRotation->GetPointerName() << ");" << std::endl;
    } else {   
-      out << "   " << GetPointerName() << " = new TGeoCombiTrans(\"" << GetName() << "\");" << endl;
-      out << "   " << GetPointerName() << "->SetTranslation(dx,dy,dz);" << endl;
+      out << "   " << GetPointerName() << " = new TGeoCombiTrans(\"" << GetName() << "\");" << std::endl;
+      out << "   " << GetPointerName() << "->SetTranslation(dx,dy,dz);" << std::endl;
    }   
    TObject::SetBit(kGeoSavePrimitive);
 }
@@ -2415,23 +2415,23 @@ void TGeoHMatrix::ReflectZ(Bool_t leftside, Bool_t rotonly)
 }      
 
 //_____________________________________________________________________________
-void TGeoHMatrix::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoHMatrix::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(kGeoSavePrimitive)) return;
    const Double_t *tr = fTranslation;
    const Double_t *rot = fRotationMatrix;
-   out << "   // HMatrix: " << GetName() << endl;
-   out << "   tr[0]  = " << tr[0] << ";    " << "tr[1] = " << tr[1] << ";    " << "tr[2] = " << tr[2] << ";" << endl;
-   out << "   rot[0] =" << rot[0] << ";    " << "rot[1] = " << rot[1] << ";    " << "rot[2] = " << rot[2] << ";" << endl; 
-   out << "   rot[3] =" << rot[3] << ";    " << "rot[4] = " << rot[4] << ";    " << "rot[5] = " << rot[5] << ";" << endl; 
-   out << "   rot[6] =" << rot[6] << ";    " << "rot[7] = " << rot[7] << ";    " << "rot[8] = " << rot[8] << ";" << endl; 
+   out << "   // HMatrix: " << GetName() << std::endl;
+   out << "   tr[0]  = " << tr[0] << ";    " << "tr[1] = " << tr[1] << ";    " << "tr[2] = " << tr[2] << ";" << std::endl;
+   out << "   rot[0] =" << rot[0] << ";    " << "rot[1] = " << rot[1] << ";    " << "rot[2] = " << rot[2] << ";" << std::endl; 
+   out << "   rot[3] =" << rot[3] << ";    " << "rot[4] = " << rot[4] << ";    " << "rot[5] = " << rot[5] << ";" << std::endl; 
+   out << "   rot[6] =" << rot[6] << ";    " << "rot[7] = " << rot[7] << ";    " << "rot[8] = " << rot[8] << ";" << std::endl; 
    char *name = GetPointerName();
-   out << "   TGeoHMatrix *" << name << " = new TGeoHMatrix(\"" << GetName() << "\");" << endl;
-   out << "   " << name << "->SetTranslation(tr);" << endl;
-   out << "   " << name << "->SetRotation(rot);" << endl;
-   if (IsTranslation()) out << "   " << name << "->SetBit(TGeoMatrix::kGeoTranslation);" << endl;
-   if (IsRotation()) out << "   " << name << "->SetBit(TGeoMatrix::kGeoRotation);" << endl;
-   if (IsReflection()) out << "   " << name << "->SetBit(TGeoMatrix::kGeoReflection);" << endl;
+   out << "   TGeoHMatrix *" << name << " = new TGeoHMatrix(\"" << GetName() << "\");" << std::endl;
+   out << "   " << name << "->SetTranslation(tr);" << std::endl;
+   out << "   " << name << "->SetRotation(rot);" << std::endl;
+   if (IsTranslation()) out << "   " << name << "->SetBit(TGeoMatrix::kGeoTranslation);" << std::endl;
+   if (IsRotation()) out << "   " << name << "->SetBit(TGeoMatrix::kGeoRotation);" << std::endl;
+   if (IsReflection()) out << "   " << name << "->SetBit(TGeoMatrix::kGeoReflection);" << std::endl;
    TObject::SetBit(kGeoSavePrimitive);
 }
diff --git a/geom/geom/src/TGeoMedium.cxx b/geom/geom/src/TGeoMedium.cxx
index 75b8337cc92..c647686e6e9 100644
--- a/geom/geom/src/TGeoMedium.cxx
+++ b/geom/geom/src/TGeoMedium.cxx
@@ -122,22 +122,22 @@ char *TGeoMedium::GetPointerName() const
 }    
 
 //_____________________________________________________________________________
-void TGeoMedium::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoMedium::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TestBit(TGeoMedium::kMedSavePrimitive)) return;
    fMaterial->SavePrimitive(out,option);
-   out << "// Medium: " << GetName() << endl;
-   out << "   numed   = " << fId << ";  // medium number" << endl;
-   out << "   par[0]  = " << fParams[0] << "; // isvol" << endl;
-   out << "   par[1]  = " << fParams[1] << "; // ifield" << endl;
-   out << "   par[2]  = " << fParams[2] << "; // fieldm" << endl;
-   out << "   par[3]  = " << fParams[3] << "; // tmaxfd" << endl;
-   out << "   par[4]  = " << fParams[4] << "; // stemax" << endl;
-   out << "   par[5]  = " << fParams[5] << "; // deemax" << endl;
-   out << "   par[6]  = " << fParams[6] << "; // epsil" << endl;
-   out << "   par[7]  = " << fParams[7] << "; // stmin" << endl;
+   out << "// Medium: " << GetName() << std::endl;
+   out << "   numed   = " << fId << ";  // medium number" << std::endl;
+   out << "   par[0]  = " << fParams[0] << "; // isvol" << std::endl;
+   out << "   par[1]  = " << fParams[1] << "; // ifield" << std::endl;
+   out << "   par[2]  = " << fParams[2] << "; // fieldm" << std::endl;
+   out << "   par[3]  = " << fParams[3] << "; // tmaxfd" << std::endl;
+   out << "   par[4]  = " << fParams[4] << "; // stemax" << std::endl;
+   out << "   par[5]  = " << fParams[5] << "; // deemax" << std::endl;
+   out << "   par[6]  = " << fParams[6] << "; // epsil" << std::endl;
+   out << "   par[7]  = " << fParams[7] << "; // stmin" << std::endl;
    
-   out << "   " << GetPointerName() << " = new TGeoMedium(\"" << GetName() << "\", numed," << fMaterial->GetPointerName() << ", par);" << endl;
+   out << "   " << GetPointerName() << " = new TGeoMedium(\"" << GetName() << "\", numed," << fMaterial->GetPointerName() << ", par);" << std::endl;
    SetBit(TGeoMedium::kMedSavePrimitive);
 }
diff --git a/geom/geom/src/TGeoNode.cxx b/geom/geom/src/TGeoNode.cxx
index a0e95f03065..8cba09011ad 100644
--- a/geom/geom/src/TGeoNode.cxx
+++ b/geom/geom/src/TGeoNode.cxx
@@ -398,7 +398,7 @@ Int_t TGeoNode::FindNode(const TGeoNode *node, Int_t level)
 }
 
 //_____________________________________________________________________________
-void TGeoNode::SaveAttributes(ostream &out)
+void TGeoNode::SaveAttributes(std::ostream &out)
 {
 // save attributes for this node
    if (IsVisStreamed()) return;
@@ -407,21 +407,21 @@ void TGeoNode::SaveAttributes(ostream &out)
    Bool_t voldef = kFALSE;
    if ((fVolume->IsVisTouched()) && (!fVolume->IsVisStreamed())) {
       fVolume->SetVisStreamed(kTRUE);
-      out << "   vol = gGeoManager->GetVolume("<<quote<<fVolume->GetName()<<quote<<");"<<endl;
+      out << "   vol = gGeoManager->GetVolume("<<quote<<fVolume->GetName()<<quote<<");"<<std::endl;
       voldef = kTRUE;
       if (!fVolume->IsVisDaughters())
-         out << "   vol->SetVisDaughters(kFALSE);"<<endl;
+         out << "   vol->SetVisDaughters(kFALSE);"<<std::endl;
       if (fVolume->IsVisible()) {
 /*
          if (fVolume->GetLineColor() != gStyle->GetLineColor())
-            out<<"   vol->SetLineColor("<<fVolume->GetLineColor()<<");"<<endl;
+            out<<"   vol->SetLineColor("<<fVolume->GetLineColor()<<");"<<std::endl;
          if (fVolume->GetLineStyle() != gStyle->GetLineStyle())
-            out<<"   vol->SetLineStyle("<<fVolume->GetLineStyle()<<");"<<endl;
+            out<<"   vol->SetLineStyle("<<fVolume->GetLineStyle()<<");"<<std::endl;
          if (fVolume->GetLineWidth() != gStyle->GetLineWidth())
-            out<<"   vol->SetLineWidth("<<fVolume->GetLineWidth()<<");"<<endl;
+            out<<"   vol->SetLineWidth("<<fVolume->GetLineWidth()<<");"<<std::endl;
 */
       } else {
-         out <<"   vol->SetVisibility(kFALSE);"<<endl;
+         out <<"   vol->SetVisibility(kFALSE);"<<std::endl;
       }
    }
    if (!IsVisDaughters()) return;
@@ -433,15 +433,15 @@ void TGeoNode::SaveAttributes(ostream &out)
       if (node->IsVisStreamed()) continue;
       if (node->IsVisTouched()) {
          if (!voldef)
-            out << "   vol = gGeoManager->GetVolume("<<quote<<fVolume->GetName()<<quote<<");"<<endl;
-         out<<"   node = vol->GetNode("<<i<<");"<<endl;
+            out << "   vol = gGeoManager->GetVolume("<<quote<<fVolume->GetName()<<quote<<");"<<std::endl;
+         out<<"   node = vol->GetNode("<<i<<");"<<std::endl;
          if (!node->IsVisDaughters()) {
-            out<<"   node->VisibleDaughters(kFALSE);"<<endl;
+            out<<"   node->VisibleDaughters(kFALSE);"<<std::endl;
             node->SetVisStreamed(kTRUE);
             continue;
          }
          if (!node->IsVisible()) 
-            out<<"   node->SetVisibility(kFALSE);"<<endl;
+            out<<"   node->SetVisibility(kFALSE);"<<std::endl;
       }         
       node->SaveAttributes(out);
       node->SetVisStreamed(kTRUE);
diff --git a/geom/geom/src/TGeoPara.cxx b/geom/geom/src/TGeoPara.cxx
index 8ae7cec54aa..436dc7bd29b 100644
--- a/geom/geom/src/TGeoPara.cxx
+++ b/geom/geom/src/TGeoPara.cxx
@@ -552,18 +552,18 @@ Double_t TGeoPara::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoPara::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPara::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dx    = " << fX << ";" << endl;
-   out << "   dy    = " << fY << ";" << endl;
-   out << "   dz    = " << fZ << ";" << endl;
-   out << "   alpha = " << fAlpha<< ";" << endl;
-   out << "   theta = " << fTheta << ";" << endl;
-   out << "   phi   = " << fPhi << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoPara(\"" << GetName() << "\",dx,dy,dz,alpha,theta,phi);" << endl;  
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dx    = " << fX << ";" << std::endl;
+   out << "   dy    = " << fY << ";" << std::endl;
+   out << "   dz    = " << fZ << ";" << std::endl;
+   out << "   alpha = " << fAlpha<< ";" << std::endl;
+   out << "   theta = " << fTheta << ";" << std::endl;
+   out << "   phi   = " << fPhi << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoPara(\"" << GetName() << "\",dx,dy,dz,alpha,theta,phi);" << std::endl;  
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoParaboloid.cxx b/geom/geom/src/TGeoParaboloid.cxx
index a7cfb33f0e5..c9826b874b3 100644
--- a/geom/geom/src/TGeoParaboloid.cxx
+++ b/geom/geom/src/TGeoParaboloid.cxx
@@ -532,15 +532,15 @@ Int_t TGeoParaboloid::GetNmeshVertices() const
 }   
    
 //_____________________________________________________________________________
-void TGeoParaboloid::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoParaboloid::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   rlo = " << fRlo << ";" << endl;
-   out << "   rhi = " << fRhi << ";" << endl;
-   out << "   dz  = " << fDZ << ";" << endl;  
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoParaboloid(\"" << GetName() << "\", rlo,rhi,dz);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   rlo = " << fRlo << ";" << std::endl;
+   out << "   rhi = " << fRhi << ";" << std::endl;
+   out << "   dz  = " << fDZ << ";" << std::endl;  
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoParaboloid(\"" << GetName() << "\", rlo,rhi,dz);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }         
 
diff --git a/geom/geom/src/TGeoPatternFinder.cxx b/geom/geom/src/TGeoPatternFinder.cxx
index 48436cb209f..1c2bee493ec 100644
--- a/geom/geom/src/TGeoPatternFinder.cxx
+++ b/geom/geom/src/TGeoPatternFinder.cxx
@@ -395,7 +395,7 @@ TGeoPatternFinder *TGeoPatternX::MakeCopy(Bool_t reflect)
 }
    
 //______________________________________________________________________________
-void TGeoPatternX::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternX::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 1;
@@ -565,7 +565,7 @@ TGeoPatternFinder *TGeoPatternY::MakeCopy(Bool_t reflect)
 }
    
 //______________________________________________________________________________
-void TGeoPatternY::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternY::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 2;
@@ -731,7 +731,7 @@ TGeoPatternFinder *TGeoPatternZ::MakeCopy(Bool_t reflect)
 }
    
 //______________________________________________________________________________
-void TGeoPatternZ::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 3;
@@ -868,7 +868,7 @@ TGeoPatternFinder *TGeoPatternParaX::MakeCopy(Bool_t reflect)
 }
       
 //______________________________________________________________________________
-void TGeoPatternParaX::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternParaX::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 1;
@@ -1024,7 +1024,7 @@ TGeoPatternFinder *TGeoPatternParaY::MakeCopy(Bool_t reflect)
 }
          
 //______________________________________________________________________________
-void TGeoPatternParaY::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternParaY::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 2;
@@ -1184,7 +1184,7 @@ TGeoPatternFinder *TGeoPatternParaZ::MakeCopy(Bool_t reflect)
 }
          
 //______________________________________________________________________________
-void TGeoPatternParaZ::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternParaZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 3;
@@ -1353,7 +1353,7 @@ TGeoPatternFinder *TGeoPatternTrapZ::MakeCopy(Bool_t reflect)
 }
    
 //______________________________________________________________________________
-void TGeoPatternTrapZ::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternTrapZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 3;
@@ -1497,7 +1497,7 @@ TGeoPatternFinder *TGeoPatternCylR::MakeCopy(Bool_t reflect)
 }
       
 //______________________________________________________________________________
-void TGeoPatternCylR::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternCylR::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 1;
@@ -1647,7 +1647,7 @@ TGeoPatternFinder *TGeoPatternCylPhi::MakeCopy(Bool_t reflect)
 }
    
 //______________________________________________________________________________
-void TGeoPatternCylPhi::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternCylPhi::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 2;
@@ -1776,7 +1776,7 @@ TGeoPatternFinder *TGeoPatternSphR::MakeCopy(Bool_t)
 }
    
 //______________________________________________________________________________
-void TGeoPatternSphR::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternSphR::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 1;
@@ -1880,7 +1880,7 @@ TGeoPatternFinder *TGeoPatternSphTheta::MakeCopy(Bool_t)
 }
    
 //______________________________________________________________________________
-void TGeoPatternSphTheta::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternSphTheta::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 2;
@@ -1984,7 +1984,7 @@ TGeoPatternFinder *TGeoPatternSphPhi::MakeCopy(Bool_t)
 }
    
 //______________________________________________________________________________
-void TGeoPatternSphPhi::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPatternSphPhi::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    Int_t iaxis = 3;
diff --git a/geom/geom/src/TGeoPcon.cxx b/geom/geom/src/TGeoPcon.cxx
index 56ff4dd22b3..1edc5238271 100644
--- a/geom/geom/src/TGeoPcon.cxx
+++ b/geom/geom/src/TGeoPcon.cxx
@@ -1119,22 +1119,22 @@ Double_t TGeoPcon::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoPcon::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPcon::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   phi1  = " << fPhi1 << ";" << endl;
-   out << "   dphi  = " << fDphi << ";" << endl;
-   out << "   nz    = " << fNz << ";" << endl;
-   out << "   TGeoPcon *pcon = new TGeoPcon(\"" << GetName() << "\",phi1,dphi,nz);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   phi1  = " << fPhi1 << ";" << std::endl;
+   out << "   dphi  = " << fDphi << ";" << std::endl;
+   out << "   nz    = " << fNz << ";" << std::endl;
+   out << "   TGeoPcon *pcon = new TGeoPcon(\"" << GetName() << "\",phi1,dphi,nz);" << std::endl;
    for (Int_t i=0; i<fNz; i++) {
-      out << "      z     = " << fZ[i] << ";" << endl;
-      out << "      rmin  = " << fRmin[i] << ";" << endl;
-      out << "      rmax  = " << fRmax[i] << ";" << endl;
-      out << "   pcon->DefineSection(" << i << ", z,rmin,rmax);" << endl;
+      out << "      z     = " << fZ[i] << ";" << std::endl;
+      out << "      rmin  = " << fRmin[i] << ";" << std::endl;
+      out << "      rmax  = " << fRmax[i] << ";" << std::endl;
+      out << "   pcon->DefineSection(" << i << ", z,rmin,rmax);" << std::endl;
    }
-   out << "   TGeoShape *" << GetPointerName() << " = pcon;" << endl;
+   out << "   TGeoShape *" << GetPointerName() << " = pcon;" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
          
diff --git a/geom/geom/src/TGeoPgon.cxx b/geom/geom/src/TGeoPgon.cxx
index eb72cb555b4..2dfb73308bf 100644
--- a/geom/geom/src/TGeoPgon.cxx
+++ b/geom/geom/src/TGeoPgon.cxx
@@ -1702,23 +1702,23 @@ Double_t TGeoPgon::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoPgon::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoPgon::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   phi1    = " << fPhi1 << ";" << endl;
-   out << "   dphi    = " << fDphi << ";" << endl;
-   out << "   nedges = " << fNedges << ";" << endl;
-   out << "   nz      = " << fNz << ";" << endl;
-   out << "   TGeoPgon *pgon = new TGeoPgon(\"" << GetName() << "\",phi1,dphi,nedges,nz);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   phi1    = " << fPhi1 << ";" << std::endl;
+   out << "   dphi    = " << fDphi << ";" << std::endl;
+   out << "   nedges = " << fNedges << ";" << std::endl;
+   out << "   nz      = " << fNz << ";" << std::endl;
+   out << "   TGeoPgon *pgon = new TGeoPgon(\"" << GetName() << "\",phi1,dphi,nedges,nz);" << std::endl;
    for (Int_t i=0; i<fNz; i++) {
-      out << "      z     = " << fZ[i] << ";" << endl;
-      out << "      rmin  = " << fRmin[i] << ";" << endl;
-      out << "      rmax  = " << fRmax[i] << ";" << endl;
-      out << "   pgon->DefineSection(" << i << ", z,rmin,rmax);" << endl;
+      out << "      z     = " << fZ[i] << ";" << std::endl;
+      out << "      rmin  = " << fRmin[i] << ";" << std::endl;
+      out << "      rmax  = " << fRmax[i] << ";" << std::endl;
+      out << "   pgon->DefineSection(" << i << ", z,rmin,rmax);" << std::endl;
    }
-   out << "   TGeoShape *" << GetPointerName() << " = pgon;" << endl;
+   out << "   TGeoShape *" << GetPointerName() << " = pgon;" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoScaledShape.cxx b/geom/geom/src/TGeoScaledShape.cxx
index 0d24ae7bbfb..3bb40cfda87 100644
--- a/geom/geom/src/TGeoScaledShape.cxx
+++ b/geom/geom/src/TGeoScaledShape.cxx
@@ -293,23 +293,23 @@ Double_t TGeoScaledShape::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoScaledShape::SavePrimitive(ostream &out, Option_t *option)
+void TGeoScaledShape::SavePrimitive(std::ostream &out, Option_t *option)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
    if (!fShape || !fScale) {
-      out << "##### Invalid shape or scale !. Aborting. #####" << endl;
+      out << "##### Invalid shape or scale !. Aborting. #####" << std::endl;
       return;
    }
    fShape->SavePrimitive(out, option);
    TString sname = fShape->GetPointerName();
    const Double_t *sc = fScale->GetScale();
-   out << "   // Scale factor:" << endl;
+   out << "   // Scale factor:" << std::endl;
    out << "   TGeoScale *pScale = new TGeoScale(\"" << fScale->GetName() 
-       << "\"," << sc[0] << "," << sc[1] << "," << sc[2] << ");" << endl;
+       << "\"," << sc[0] << "," << sc[1] << "," << sc[2] << ");" << std::endl;
    out << "   TGeoScaledShape *" << GetPointerName() << " = new TGeoScaledShape(\"" 
-       << GetName() << "\"," << sname << ", pScale);" << endl;
+       << GetName() << "\"," << sname << ", pScale);" << std::endl;
 }
 
 //_____________________________________________________________________________
diff --git a/geom/geom/src/TGeoShapeAssembly.cxx b/geom/geom/src/TGeoShapeAssembly.cxx
index 5afd0de51ef..f59b10d81de 100644
--- a/geom/geom/src/TGeoShapeAssembly.cxx
+++ b/geom/geom/src/TGeoShapeAssembly.cxx
@@ -405,7 +405,7 @@ Double_t TGeoShapeAssembly::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoShapeAssembly::SavePrimitive(ostream & /*out*/, Option_t * /*option*/ /*= ""*/)
+void TGeoShapeAssembly::SavePrimitive(std::ostream & /*out*/, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
 }
diff --git a/geom/geom/src/TGeoSphere.cxx b/geom/geom/src/TGeoSphere.cxx
index 928edaa3e36..a8c720dbaf6 100644
--- a/geom/geom/src/TGeoSphere.cxx
+++ b/geom/geom/src/TGeoSphere.cxx
@@ -1451,18 +1451,18 @@ Double_t TGeoSphere::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoSphere::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoSphere::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   rmin   = " << fRmin << ";" << endl;
-   out << "   rmax   = " << fRmax << ";" << endl;
-   out << "   theta1 = " << fTheta1<< ";" << endl;
-   out << "   theta2 = " << fTheta2 << ";" << endl;
-   out << "   phi1   = " << fPhi1 << ";" << endl;
-   out << "   phi2   = " << fPhi2 << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoSphere(\"" << GetName() << "\",rmin,rmax,theta1, theta2,phi1,phi2);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   rmin   = " << fRmin << ";" << std::endl;
+   out << "   rmax   = " << fRmax << ";" << std::endl;
+   out << "   theta1 = " << fTheta1<< ";" << std::endl;
+   out << "   theta2 = " << fTheta2 << ";" << std::endl;
+   out << "   phi1   = " << fPhi1 << ";" << std::endl;
+   out << "   phi2   = " << fPhi2 << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoSphere(\"" << GetName() << "\",rmin,rmax,theta1, theta2,phi1,phi2);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);   
 }
 
diff --git a/geom/geom/src/TGeoTorus.cxx b/geom/geom/src/TGeoTorus.cxx
index 49689317957..653e5d55a9c 100644
--- a/geom/geom/src/TGeoTorus.cxx
+++ b/geom/geom/src/TGeoTorus.cxx
@@ -714,17 +714,17 @@ Double_t TGeoTorus::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoTorus::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTorus::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;  
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   r    = " << fR << ";" << endl;
-   out << "   rmin = " << fRmin << ";" << endl;
-   out << "   rmax = " << fRmax << ";" << endl;
-   out << "   phi1 = " << fPhi1 << ";" << endl;
-   out << "   dphi = " << fDphi << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTorus(\"" << GetName() << "\",r,rmin,rmax,phi1,dphi);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   r    = " << fR << ";" << std::endl;
+   out << "   rmin = " << fRmin << ";" << std::endl;
+   out << "   rmax = " << fRmax << ";" << std::endl;
+   out << "   phi1 = " << fPhi1 << ";" << std::endl;
+   out << "   dphi = " << fDphi << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTorus(\"" << GetName() << "\",r,rmin,rmax,phi1,dphi);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
diff --git a/geom/geom/src/TGeoTrd1.cxx b/geom/geom/src/TGeoTrd1.cxx
index 856f316d6a6..f5cd90f95a5 100644
--- a/geom/geom/src/TGeoTrd1.cxx
+++ b/geom/geom/src/TGeoTrd1.cxx
@@ -619,16 +619,16 @@ Double_t TGeoTrd1::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoTrd1::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTrd1::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dx1 = " << fDx1 << ";" << endl;
-   out << "   dx2 = " << fDx2 << ";" << endl;
-   out << "   dy  = " << fDy  << ";" << endl;
-   out << "   dz  = " << fDZ  << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTrd1(\"" << GetName() << "\", dx1,dx2,dy,dz);" << endl;  
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dx1 = " << fDx1 << ";" << std::endl;
+   out << "   dx2 = " << fDx2 << ";" << std::endl;
+   out << "   dy  = " << fDy  << ";" << std::endl;
+   out << "   dz  = " << fDZ  << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTrd1(\"" << GetName() << "\", dx1,dx2,dy,dz);" << std::endl;  
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }         
 
diff --git a/geom/geom/src/TGeoTrd2.cxx b/geom/geom/src/TGeoTrd2.cxx
index c6f1d797eca..b97aea747d8 100644
--- a/geom/geom/src/TGeoTrd2.cxx
+++ b/geom/geom/src/TGeoTrd2.cxx
@@ -645,17 +645,17 @@ Double_t TGeoTrd2::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoTrd2::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTrd2::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   dx1 = " << fDx1 << ";" << endl;
-   out << "   dx2 = " << fDx2 << ";" << endl;
-   out << "   dy1 = " << fDy1 << ";" << endl;
-   out << "   dy2 = " << fDy2 << ";" << endl;
-   out << "   dz  = " << fDZ  << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTrd2(\"" << GetName() << "\", dx1,dx2,dy1,dy2,dz);" << endl;  
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   dx1 = " << fDx1 << ";" << std::endl;
+   out << "   dx2 = " << fDx2 << ";" << std::endl;
+   out << "   dy1 = " << fDy1 << ";" << std::endl;
+   out << "   dy2 = " << fDy2 << ";" << std::endl;
+   out << "   dz  = " << fDZ  << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTrd2(\"" << GetName() << "\", dx1,dx2,dy1,dy2,dz);" << std::endl;  
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 } 
         
diff --git a/geom/geom/src/TGeoTube.cxx b/geom/geom/src/TGeoTube.cxx
index e930aa6488d..fe2c559dad5 100644
--- a/geom/geom/src/TGeoTube.cxx
+++ b/geom/geom/src/TGeoTube.cxx
@@ -849,15 +849,15 @@ Double_t TGeoTube::SafetyS(Double_t *point, Bool_t in, Double_t rmin, Double_t r
 }
 
 //_____________________________________________________________________________
-void TGeoTube::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTube::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   rmin = " << fRmin << ";" << endl;
-   out << "   rmax = " << fRmax << ";" << endl;
-   out << "   dz   = " << fDz << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTube(\"" << GetName() << "\",rmin,rmax,dz);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   rmin = " << fRmin << ";" << std::endl;
+   out << "   rmax = " << fRmax << ";" << std::endl;
+   out << "   dz   = " << fDz << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTube(\"" << GetName() << "\",rmin,rmax,dz);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
@@ -2001,17 +2001,17 @@ Double_t TGeoTubeSeg::SafetyS(Double_t *point, Bool_t in, Double_t rmin, Double_
 }
 
 //_____________________________________________________________________________
-void TGeoTubeSeg::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoTubeSeg::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   rmin = " << fRmin << ";" << endl;
-   out << "   rmax = " << fRmax << ";" << endl;
-   out << "   dz   = " << fDz << ";" << endl;
-   out << "   phi1 = " << fPhi1 << ";" << endl;
-   out << "   phi2 = " << fPhi2 << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTubeSeg(\"" << GetName() << "\",rmin,rmax,dz,phi1,phi2);" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   rmin = " << fRmin << ";" << std::endl;
+   out << "   rmax = " << fRmax << ";" << std::endl;
+   out << "   dz   = " << fDz << ";" << std::endl;
+   out << "   phi1 = " << fPhi1 << ";" << std::endl;
+   out << "   phi2 = " << fPhi2 << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoTubeSeg(\"" << GetName() << "\",rmin,rmax,dz,phi1,phi2);" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
@@ -2834,23 +2834,23 @@ void TGeoCtub::SetCtubDimensions(Double_t rmin, Double_t rmax, Double_t dz, Doub
 }
 
 //_____________________________________________________________________________
-void TGeoCtub::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoCtub::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   rmin = " << fRmin << ";" << endl;
-   out << "   rmax = " << fRmax << ";" << endl;
-   out << "   dz   = " << fDz << ";" << endl;
-   out << "   phi1 = " << fPhi1 << ";" << endl;
-   out << "   phi2 = " << fPhi2 << ";" << endl;
-   out << "   lx   = " << fNlow[0] << ";" << endl;
-   out << "   ly   = " << fNlow[1] << ";" << endl;
-   out << "   lz   = " << fNlow[2] << ";" << endl;
-   out << "   tx   = " << fNhigh[0] << ";" << endl;
-   out << "   ty   = " << fNhigh[1] << ";" << endl;
-   out << "   tz   = " << fNhigh[2] << ";" << endl;
-   out << "   TGeoShape *" << GetPointerName() << " = new TGeoCtub(\"" << GetName() << "\",rmin,rmax,dz,phi1,phi2,lx,ly,lz,tx,ty,tz);" << endl;   TObject::SetBit(TGeoShape::kGeoSavePrimitive);
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   rmin = " << fRmin << ";" << std::endl;
+   out << "   rmax = " << fRmax << ";" << std::endl;
+   out << "   dz   = " << fDz << ";" << std::endl;
+   out << "   phi1 = " << fPhi1 << ";" << std::endl;
+   out << "   phi2 = " << fPhi2 << ";" << std::endl;
+   out << "   lx   = " << fNlow[0] << ";" << std::endl;
+   out << "   ly   = " << fNlow[1] << ";" << std::endl;
+   out << "   lz   = " << fNlow[2] << ";" << std::endl;
+   out << "   tx   = " << fNhigh[0] << ";" << std::endl;
+   out << "   ty   = " << fNhigh[1] << ";" << std::endl;
+   out << "   tz   = " << fNhigh[2] << ";" << std::endl;
+   out << "   TGeoShape *" << GetPointerName() << " = new TGeoCtub(\"" << GetName() << "\",rmin,rmax,dz,phi1,phi2,lx,ly,lz,tx,ty,tz);" << std::endl;   TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }
 
 //_____________________________________________________________________________
diff --git a/geom/geom/src/TGeoVolume.cxx b/geom/geom/src/TGeoVolume.cxx
index a73ab344e8d..b1153ede517 100644
--- a/geom/geom/src/TGeoVolume.cxx
+++ b/geom/geom/src/TGeoVolume.cxx
@@ -1277,8 +1277,8 @@ void TGeoVolume::SaveAs(const char *filename, Option_t *option) const
 {
 //  Save geometry having this as top volume as a C++ macro.
    if (!filename) return;
-   ofstream out;
-   out.open(filename, ios::out);
+   std::ofstream out;
+   out.open(filename, std::ios::out);
    if (out.bad()) {
       Error("SavePrimitive", "Bad file name: %s", filename);
       return;
@@ -1288,18 +1288,18 @@ void TGeoVolume::SaveAs(const char *filename, Option_t *option) const
    TString fname(filename);
    Int_t ind = fname.Index(".");
    if (ind>0) fname.Remove(ind);
-   out << "void "<<fname<<"() {" << endl;
-   out << "   gSystem->Load(\"libGeom\");" << endl;
+   out << "void "<<fname<<"() {" << std::endl;
+   out << "   gSystem->Load(\"libGeom\");" << std::endl;
    ((TGeoVolume*)this)->SavePrimitive(out,option);
-   out << "}" << endl;
+   out << "}" << std::endl;
 }   
 
 //______________________________________________________________________________
-void TGeoVolume::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGeoVolume::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a primitive as a C++ statement(s) on output stream "out".
    out.precision(6);
-   out.setf(ios::fixed);
+   out.setf(std::ios::fixed);
    Int_t i,icopy;
    Int_t nd = GetNdaughters();
    TGeoVolume *dvol;
@@ -1311,48 +1311,48 @@ void TGeoVolume::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (fGeoManager->GetGeomPainter()->GetTopVolume()==this) mustDraw = kTRUE;
    if (!strlen(option)) {
       fGeoManager->SetAllIndex();
-      out << "   new TGeoManager(\"" << fGeoManager->GetName() << "\", \"" << fGeoManager->GetTitle() << "\");" << endl << endl;
-//      if (mustDraw) out << "   Bool_t mustDraw = kTRUE;" << endl;
-//      else          out << "   Bool_t mustDraw = kFALSE;" << endl;
-      out << "   Double_t dx,dy,dz;" << endl;
-      out << "   Double_t dx1, dx2, dy1, dy2;" << endl;
-      out << "   Double_t vert[20], par[20];" << endl;
-      out << "   Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;" << endl;
-      out << "   Double_t twist;" << endl;
-      out << "   Double_t origin[3];" << endl;
-      out << "   Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;" << endl;
-      out << "   Double_t r, rlo, rhi;" << endl;
-      out << "   Double_t phi1, phi2;" << endl;
-      out << "   Double_t a,b;" << endl;
-      out << "   Double_t point[3], norm[3];" << endl;
-      out << "   Double_t rin, stin, rout, stout;" << endl;
-      out << "   Double_t thx, phx, thy, phy, thz, phz;" << endl;
-      out << "   Double_t alpha, theta1, theta2, phi1, phi2, dphi;" << endl;
-      out << "   Double_t tr[3], rot[9];" << endl;
-      out << "   Double_t z, density, radl, absl, w;" << endl;
-      out << "   Double_t lx,ly,lz,tx,ty,tz;" << endl;
-      out << "   Double_t xvert[50], yvert[50];" << endl;
-      out << "   Double_t zsect,x0,y0,scale0;" << endl;
-      out << "   Int_t nel, numed, nz, nedges, nvert;" << endl;
-      out << "   TGeoBoolNode *pBoolNode = 0;" << endl << endl;
+      out << "   new TGeoManager(\"" << fGeoManager->GetName() << "\", \"" << fGeoManager->GetTitle() << "\");" << std::endl << std::endl;
+//      if (mustDraw) out << "   Bool_t mustDraw = kTRUE;" << std::endl;
+//      else          out << "   Bool_t mustDraw = kFALSE;" << std::endl;
+      out << "   Double_t dx,dy,dz;" << std::endl;
+      out << "   Double_t dx1, dx2, dy1, dy2;" << std::endl;
+      out << "   Double_t vert[20], par[20];" << std::endl;
+      out << "   Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;" << std::endl;
+      out << "   Double_t twist;" << std::endl;
+      out << "   Double_t origin[3];" << std::endl;
+      out << "   Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;" << std::endl;
+      out << "   Double_t r, rlo, rhi;" << std::endl;
+      out << "   Double_t phi1, phi2;" << std::endl;
+      out << "   Double_t a,b;" << std::endl;
+      out << "   Double_t point[3], norm[3];" << std::endl;
+      out << "   Double_t rin, stin, rout, stout;" << std::endl;
+      out << "   Double_t thx, phx, thy, phy, thz, phz;" << std::endl;
+      out << "   Double_t alpha, theta1, theta2, phi1, phi2, dphi;" << std::endl;
+      out << "   Double_t tr[3], rot[9];" << std::endl;
+      out << "   Double_t z, density, radl, absl, w;" << std::endl;
+      out << "   Double_t lx,ly,lz,tx,ty,tz;" << std::endl;
+      out << "   Double_t xvert[50], yvert[50];" << std::endl;
+      out << "   Double_t zsect,x0,y0,scale0;" << std::endl;
+      out << "   Int_t nel, numed, nz, nedges, nvert;" << std::endl;
+      out << "   TGeoBoolNode *pBoolNode = 0;" << std::endl << std::endl;
       // first save materials/media
-      out << "   // MATERIALS, MIXTURES AND TRACKING MEDIA" << endl;
+      out << "   // MATERIALS, MIXTURES AND TRACKING MEDIA" << std::endl;
       SavePrimitive(out, "m");
       // then, save matrices
-      out << endl << "   // TRANSFORMATION MATRICES" << endl;
+      out << std::endl << "   // TRANSFORMATION MATRICES" << std::endl;
       SavePrimitive(out, "x");
       // save this volume and shape
       SavePrimitive(out, "s");
-      out << endl << "   // SET TOP VOLUME OF GEOMETRY" << endl;
-      out << "   gGeoManager->SetTopVolume(" << GetPointerName() << ");" << endl;
+      out << std::endl << "   // SET TOP VOLUME OF GEOMETRY" << std::endl;
+      out << "   gGeoManager->SetTopVolume(" << GetPointerName() << ");" << std::endl;
       // save daughters
-      out << endl << "   // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY" << endl;
+      out << std::endl << "   // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY" << std::endl;
       SavePrimitive(out, "d");
-      out << endl << "   // CLOSE GEOMETRY" << endl;
-      out << "   gGeoManager->CloseGeometry();" << endl;
+      out << std::endl << "   // CLOSE GEOMETRY" << std::endl;
+      out << "   gGeoManager->CloseGeometry();" << std::endl;
       if (mustDraw) {
-         if (!IsRaytracing()) out << "   gGeoManager->GetTopVolume()->Draw();" << endl;
-         else                 out << "   gGeoManager->GetTopVolume()->Raytrace();" << endl;
+         if (!IsRaytracing()) out << "   gGeoManager->GetTopVolume()->Draw();" << std::endl;
+         else                 out << "   gGeoManager->GetTopVolume()->Raytrace();" << std::endl;
       }
       return;
    }
@@ -1362,19 +1362,19 @@ void TGeoVolume::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (TestAttBit(TGeoAtt::kSavePrimitiveAtt)) return;
       if (!IsAssembly()) {
          fShape->SavePrimitive(out,option);      
-         out << "   // Volume: " << GetName() << endl;
-         out << "   " << GetPointerName() << " = new TGeoVolume(\"" << GetName() << "\"," << fShape->GetPointerName() << ", "<< fMedium->GetPointerName() << ");" << endl;
+         out << "   // Volume: " << GetName() << std::endl;
+         out << "   " << GetPointerName() << " = new TGeoVolume(\"" << GetName() << "\"," << fShape->GetPointerName() << ", "<< fMedium->GetPointerName() << ");" << std::endl;
       } else {
-         out << "   // Assembly: " << GetName() << endl;
-         out << "   " << GetPointerName() << " = new TGeoVolumeAssembly(\"" << GetName() << "\"" << ");" << endl;
+         out << "   // Assembly: " << GetName() << std::endl;
+         out << "   " << GetPointerName() << " = new TGeoVolumeAssembly(\"" << GetName() << "\"" << ");" << std::endl;
       }           
-      if (fLineColor != 1) out << "   " << GetPointerName() << "->SetLineColor(" << fLineColor << ");" << endl;
-      if (fLineWidth != 1) out << "   " << GetPointerName() << "->SetLineWidth(" << fLineWidth << ");" << endl;
-      if (fLineStyle != 1) out << "   " << GetPointerName() << "->SetLineStyle(" << fLineStyle << ");" << endl;
-      if (!IsVisible() && !IsAssembly()) out << "   " << GetPointerName() << "->SetVisibility(kFALSE);" << endl;
-      if (!IsVisibleDaughters()) out << "   " << GetPointerName() << "->VisibleDaughters(kFALSE);" << endl;
-      if (IsVisContainers()) out << "   " << GetPointerName() << "->SetVisContainers(kTRUE);" << endl;
-      if (IsVisLeaves()) out << "   " << GetPointerName() << "->SetVisLeaves(kTRUE);" << endl;
+      if (fLineColor != 1) out << "   " << GetPointerName() << "->SetLineColor(" << fLineColor << ");" << std::endl;
+      if (fLineWidth != 1) out << "   " << GetPointerName() << "->SetLineWidth(" << fLineWidth << ");" << std::endl;
+      if (fLineStyle != 1) out << "   " << GetPointerName() << "->SetLineStyle(" << fLineStyle << ");" << std::endl;
+      if (!IsVisible() && !IsAssembly()) out << "   " << GetPointerName() << "->SetVisibility(kFALSE);" << std::endl;
+      if (!IsVisibleDaughters()) out << "   " << GetPointerName() << "->VisibleDaughters(kFALSE);" << std::endl;
+      if (IsVisContainers()) out << "   " << GetPointerName() << "->SetVisContainers(kTRUE);" << std::endl;
+      if (IsVisLeaves()) out << "   " << GetPointerName() << "->SetVisLeaves(kTRUE);" << std::endl;
       SetAttBit(TGeoAtt::kSavePrimitiveAtt);
    }   
    // check if we need to save the media
@@ -1416,7 +1416,7 @@ void TGeoVolume::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          if (fMedium != dvol->GetMedium()) {
             out << ", " << dvol->GetMedium()->GetId();
          }
-         out << ");" << endl;   
+         out << ");" << std::endl;   
          dvol->SavePrimitive(out,"d");   
          return;
       }
@@ -1431,7 +1431,7 @@ void TGeoVolume::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          if (dnode->IsOverlapping()) out << "Overlap";
          out << "(" << dvol->GetPointerName() << ", " << icopy;
          if (!matrix->IsIdentity()) out << ", " << matrix->GetPointerName();
-         out << ");" << endl;
+         out << ");" << std::endl;
       }
       // Recursive loop to daughters
       for (i=0; i<nd; i++) {
diff --git a/geom/geom/src/TGeoXtru.cxx b/geom/geom/src/TGeoXtru.cxx
index 1660476bc71..33c026a3dc2 100644
--- a/geom/geom/src/TGeoXtru.cxx
+++ b/geom/geom/src/TGeoXtru.cxx
@@ -1062,28 +1062,28 @@ Double_t TGeoXtru::Safety(Double_t *point, Bool_t in) const
 }
 
 //_____________________________________________________________________________
-void TGeoXtru::SavePrimitive(ostream &out, Option_t * /*option*/ /*= ""*/)
+void TGeoXtru::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
 {
 // Save a primitive as a C++ statement(s) on output stream "out".
    if (TObject::TestBit(kGeoSavePrimitive)) return;   
-   out << "   // Shape: " << GetName() << " type: " << ClassName() << endl;
-   out << "   nz       = " << fNz << ";" << endl;
-   out << "   nvert    = " << fNvert << ";" << endl;
-   out << "   TGeoXtru *xtru = new TGeoXtru(nz);" << endl;
-   out << "   xtru->SetName(\"" << GetName() << "\");" << endl;
+   out << "   // Shape: " << GetName() << " type: " << ClassName() << std::endl;
+   out << "   nz       = " << fNz << ";" << std::endl;
+   out << "   nvert    = " << fNvert << ";" << std::endl;
+   out << "   TGeoXtru *xtru = new TGeoXtru(nz);" << std::endl;
+   out << "   xtru->SetName(\"" << GetName() << "\");" << std::endl;
    Int_t i;
    for (i=0; i<fNvert; i++) {
-      out << "   xvert[" << i << "] = " << fX[i] << ";   yvert[" << i << "] = " << fY[i] << ";" << endl;
+      out << "   xvert[" << i << "] = " << fX[i] << ";   yvert[" << i << "] = " << fY[i] << ";" << std::endl;
    }
-   out << "   xtru->DefinePolygon(nvert,xvert,yvert);" << endl;
+   out << "   xtru->DefinePolygon(nvert,xvert,yvert);" << std::endl;
    for (i=0; i<fNz; i++) {
-      out << "   zsect  = " << fZ[i] << ";" << endl; 
-      out << "   x0     = " << fX0[i] << ";" << endl; 
-      out << "   y0     = " << fY0[i] << ";" << endl; 
-      out << "   scale0 = " << fScale[i] << ";" << endl; 
-      out << "   xtru->DefineSection(" << i << ",zsect,x0,y0,scale0);" << endl;
+      out << "   zsect  = " << fZ[i] << ";" << std::endl; 
+      out << "   x0     = " << fX0[i] << ";" << std::endl; 
+      out << "   y0     = " << fY0[i] << ";" << std::endl; 
+      out << "   scale0 = " << fScale[i] << ";" << std::endl; 
+      out << "   xtru->DefineSection(" << i << ",zsect,x0,y0,scale0);" << std::endl;
    }
-   out << "   TGeoShape *" << GetPointerName() << " = xtru;" << endl;
+   out << "   TGeoShape *" << GetPointerName() << " = xtru;" << std::endl;
    TObject::SetBit(TGeoShape::kGeoSavePrimitive);
 }         
 
diff --git a/graf2d/asimage/inc/TASImage.h b/graf2d/asimage/inc/TASImage.h
index ba3c08164ac..84ae7ccf04e 100644
--- a/graf2d/asimage/inc/TASImage.h
+++ b/graf2d/asimage/inc/TASImage.h
@@ -200,7 +200,7 @@ public:
    Bool_t     SetImageBuffer(char **buffer, EImageFileTypes type = TImage::kPng);
    void       PaintImage(Drawable_t wid, Int_t x, Int_t y, Int_t xsrc = 0, Int_t ysrc = 0, UInt_t wsrc = 0, UInt_t hsrc = 0, Option_t *opt = "");
    void       SetPaletteEnabled(Bool_t on = kTRUE);  // *TOGGLE*
-   void       SavePrimitive(ostream &out, Option_t *option = "");
+   void       SavePrimitive(std::ostream &out, Option_t *option = "");
 
    static const ASVisual *GetVisual();
    static UInt_t AlphaBlend(UInt_t bot, UInt_t top);
diff --git a/graf2d/asimage/src/TASImage.cxx b/graf2d/asimage/src/TASImage.cxx
index 32860cd62f7..43ac8d1e4f0 100644
--- a/graf2d/asimage/src/TASImage.cxx
+++ b/graf2d/asimage/src/TASImage.cxx
@@ -6642,7 +6642,7 @@ void TASImage::SetPaletteEnabled(Bool_t on)
 
 
 //______________________________________________________________________________
-void TASImage::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TASImage::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
     // Save a primitive as a C++ statement(s) on output stream "out".
 
@@ -6672,11 +6672,11 @@ void TASImage::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    xpm += name;
    xpm += ii;
    str.ReplaceAll("asxpm", xpm.Data());
-   out << endl << str << endl << endl;
+   out << std::endl << str << std::endl << std::endl;
    out << "   TImage *";
-   out << name << " = TImage::Create();" << endl;
-   out << "   " << name << "->SetImageBuffer(" << xpm << ", TImage::kXpm);" << endl;
-   out << "   " << name << "->Draw();" << endl;
+   out << name << " = TImage::Create();" << std::endl;
+   out << "   " << name << "->SetImageBuffer(" << xpm << ", TImage::kXpm);" << std::endl;
+   out << "   " << name << "->Draw();" << std::endl;
 }
 
 
diff --git a/graf2d/gpad/inc/TButton.h b/graf2d/gpad/inc/TButton.h
index e8e580c88a9..29126c396ad 100644
--- a/graf2d/gpad/inc/TButton.h
+++ b/graf2d/gpad/inc/TButton.h
@@ -52,7 +52,7 @@ public:
    virtual void  Paint(Option_t *option="");
    virtual void  PaintModified();
    virtual void  Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetBorderMode(Short_t bordermode) { fBorderMode = bordermode; }
    virtual void  SetFraming(Bool_t f=1);
    virtual Bool_t GetFraming() { return fFraming; };
diff --git a/graf2d/gpad/inc/TCanvas.h b/graf2d/gpad/inc/TCanvas.h
index b0f5dc7398f..590f5d76e8d 100644
--- a/graf2d/gpad/inc/TCanvas.h
+++ b/graf2d/gpad/inc/TCanvas.h
@@ -209,7 +209,7 @@ public:
    virtual void      Resize(Option_t *option="");
    void              ResizeOpaque(Int_t set=1);
    void              SaveSource(const char *filename="", Option_t *option="");
-   void              SavePrimitive(ostream &out, Option_t *option = "");
+   void              SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      SetCursor(ECursor cursor);
    virtual void      SetDoubleBuffer(Int_t mode=1);
    virtual void      SetFixedAspectRatio(Bool_t fixed = kTRUE);  // *TOGGLE*
diff --git a/graf2d/gpad/inc/TGroupButton.h b/graf2d/gpad/inc/TGroupButton.h
index 7342ca271a3..06ee2c52980 100644
--- a/graf2d/gpad/inc/TGroupButton.h
+++ b/graf2d/gpad/inc/TGroupButton.h
@@ -44,7 +44,7 @@ public:
    virtual void  DisplayColorTable(const char *action, Double_t x0, Double_t y0, Double_t wc, Double_t hc);
    virtual void  ExecuteAction();
    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    ClassDef(TGroupButton,0)  //A user interface button in a group of buttons.
 };
 
diff --git a/graf2d/gpad/inc/TPad.h b/graf2d/gpad/inc/TPad.h
index d288550f97b..69387b0efc4 100644
--- a/graf2d/gpad/inc/TPad.h
+++ b/graf2d/gpad/inc/TPad.h
@@ -127,7 +127,7 @@ protected:
    void          PaintBorder(Color_t color, Bool_t tops);
    virtual void  PaintBorderPS(Double_t xl,Double_t yl,Double_t xt,Double_t yt,Int_t bmode,Int_t bsize,Int_t dark,Int_t light);
    void          PaintDate();
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetBatch(Bool_t batch=kTRUE);
 
 private:
diff --git a/graf2d/gpad/inc/TPaveClass.h b/graf2d/gpad/inc/TPaveClass.h
index 17a23d6dfa1..c06734490aa 100644
--- a/graf2d/gpad/inc/TPaveClass.h
+++ b/graf2d/gpad/inc/TPaveClass.h
@@ -43,7 +43,7 @@ public:
    virtual void  DrawClasses(const char *classes="this");   // *MENU*
    TClassTree   *GetClassTree() const {return fClassTree;}
    virtual void  SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetClasses(const char *classes="this", Option_t *option="ID");   // *MENU*
    virtual void  ShowClassesUsedBy(const char *classes="this");  // *MENU*
    virtual void  ShowClassesUsing(const char *classes="this");   // *MENU*
diff --git a/graf2d/gpad/inc/TSlider.h b/graf2d/gpad/inc/TSlider.h
index 95efcc2b054..68bdb13fd29 100644
--- a/graf2d/gpad/inc/TSlider.h
+++ b/graf2d/gpad/inc/TSlider.h
@@ -49,7 +49,7 @@ public:
    Double_t      GetMaximum() const {return fMaximum;}
    virtual const char *GetMethod() const { return fMethod.Data(); }
    virtual void  Paint(Option_t *option="");
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetMethod(const char *method) { fMethod=method; } // *MENU*
    void          SetObject(TObject *obj=0) {fObject=obj;}
    virtual void  SetMinimum(Double_t min=0) {fMinimum=min;}
diff --git a/graf2d/gpad/inc/TSliderBox.h b/graf2d/gpad/inc/TSliderBox.h
index 018b54ccfb2..f5c547b3f21 100644
--- a/graf2d/gpad/inc/TSliderBox.h
+++ b/graf2d/gpad/inc/TSliderBox.h
@@ -45,7 +45,7 @@ public:
               Color_t color=18, Short_t bordersize=2 ,Short_t bordermode=-1);
    virtual ~TSliderBox();
    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    void          SetSlider(TSlider*slider) {fSlider=slider;}
 
    ClassDef(TSliderBox,1)  //The moving box of a TSlider
diff --git a/graf2d/gpad/src/TButton.cxx b/graf2d/gpad/src/TButton.cxx
index d77671a0b8a..0472b5da16e 100644
--- a/graf2d/gpad/src/TButton.cxx
+++ b/graf2d/gpad/src/TButton.cxx
@@ -255,7 +255,7 @@ void TButton::Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 
 
 //______________________________________________________________________________
-void TButton::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TButton::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -286,7 +286,7 @@ void TButton::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       <<","<<fYlowNDC
       <<","<<fXlowNDC+fWNDC
       <<","<<fYlowNDC+fHNDC
-      <<");"<<endl;
+      <<");"<<std::endl;
    delete [] cmethod;
 
    SaveFillAttributes(out,"button",0,1001);
@@ -294,28 +294,28 @@ void TButton::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    SaveTextAttributes(out,"button",22,0,1,61,.65);
 
    if (GetBorderSize() != 2) {
-      out<<"   button->SetBorderSize("<<GetBorderSize()<<");"<<endl;
+      out<<"   button->SetBorderSize("<<GetBorderSize()<<");"<<std::endl;
    }
    if (GetBorderMode() != 1) {
-      out<<"   button->SetBorderMode("<<GetBorderMode()<<");"<<endl;
+      out<<"   button->SetBorderMode("<<GetBorderMode()<<");"<<std::endl;
    }
 
-   if (GetFraming()) out<<"button->SetFraming();"<<endl;
-   if (IsEditable()) out<<"button->SetEditable(kTRUE);"<<endl;
+   if (GetFraming()) out<<"button->SetFraming();"<<std::endl;
+   if (IsEditable()) out<<"button->SetEditable(kTRUE);"<<std::endl;
 
-   out<<"   button->Draw();"<<endl;
+   out<<"   button->Draw();"<<std::endl;
 
    TIter next(GetListOfPrimitives());
    TObject *obj = next();  //do not save first primitive
 
    Int_t nprim = 0;
    while ((obj = next())) {
-      if (!nprim) out<<"   button->cd();"<<endl;
+      if (!nprim) out<<"   button->cd();"<<std::endl;
       nprim++;
       obj->SavePrimitive(out, (Option_t *)next.GetOption());
    }
 
-   if (nprim) out<<"   "<<padsav->GetName()<<"->cd();"<<endl;
+   if (nprim) out<<"   "<<padsav->GetName()<<"->cd();"<<std::endl;
    padsav->cd();
 }
 
diff --git a/graf2d/gpad/src/TCanvas.cxx b/graf2d/gpad/src/TCanvas.cxx
index 338e9dee193..ec01fce0124 100644
--- a/graf2d/gpad/src/TCanvas.cxx
+++ b/graf2d/gpad/src/TCanvas.cxx
@@ -1371,7 +1371,7 @@ void TCanvas::ls(Option_t *option) const
    // List all pads.
 
    TROOT::IndentLevel();
-   cout <<"Canvas Name=" <<GetName()<<" Title="<<GetTitle()<<" Option="<<option<<endl;
+   std::cout <<"Canvas Name=" <<GetName()<<" Title="<<GetTitle()<<" Option="<<option<<std::endl;
    TROOT::IncreaseDirLevel();
    TPad::ls(option);
    TROOT::DecreaseDirLevel();
@@ -1608,38 +1608,38 @@ void TCanvas::RunAutoExec()
 
 
 //______________________________________________________________________________
-void TCanvas::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitives in this canvas in C++ macro file with GUI.
 
    // Write canvas options (in $TROOT or $TStyle)
    if (gStyle->GetOptFit()) {
-      out<<"   gStyle->SetOptFit(1);"<<endl;
+      out<<"   gStyle->SetOptFit(1);"<<std::endl;
    }
    if (!gStyle->GetOptStat()) {
-      out<<"   gStyle->SetOptStat(0);"<<endl;
+      out<<"   gStyle->SetOptStat(0);"<<std::endl;
    }
    if (!gStyle->GetOptTitle()) {
-      out<<"   gStyle->SetOptTitle(0);"<<endl;
+      out<<"   gStyle->SetOptTitle(0);"<<std::endl;
    }
    if (gROOT->GetEditHistograms()) {
-      out<<"   gROOT->SetEditHistograms();"<<endl;
+      out<<"   gROOT->SetEditHistograms();"<<std::endl;
    }
    if (GetShowEventStatus()) {
-      out<<"   "<<GetName()<<"->ToggleEventStatus();"<<endl;
+      out<<"   "<<GetName()<<"->ToggleEventStatus();"<<std::endl;
    }
    if (GetShowToolTips()) {
-      out<<"   "<<GetName()<<"->ToggleToolTips();"<<endl;
+      out<<"   "<<GetName()<<"->ToggleToolTips();"<<std::endl;
    }
    if (GetShowToolBar()) {
-      out<<"   "<<GetName()<<"->ToggleToolBar();"<<endl;
+      out<<"   "<<GetName()<<"->ToggleToolBar();"<<std::endl;
    }
    if (GetHighLightColor() != 5) {
       if (GetHighLightColor() > 228) {
          TColor::SaveColor(out, GetHighLightColor());
-         out<<"   "<<GetName()<<"->SetHighLightColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetHighLightColor(ci);" << std::endl;
       } else
-         out<<"   "<<GetName()<<"->SetHighLightColor("<<GetHighLightColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetHighLightColor("<<GetHighLightColor()<<");"<<std::endl;
    }
 
    // Now recursively scan all pads of this canvas
@@ -1665,7 +1665,7 @@ void TCanvas::SaveSource(const char *filename, Option_t *option)
    }
 
    char quote = '"';
-   ofstream out;
+   std::ofstream out;
    Int_t lenfile = strlen(filename);
    char * fname;
    char lcname[10];
@@ -1675,7 +1675,7 @@ void TCanvas::SaveSource(const char *filename, Option_t *option)
    //    with a name equal to the canvasname.C
    if (lenfile) {
       fname = (char*)filename;
-      out.open(fname, ios::out);
+      out.open(fname, std::ios::out);
    } else {
       Int_t nch = strlen(cname);
       if (nch < 10) {
@@ -1687,7 +1687,7 @@ void TCanvas::SaveSource(const char *filename, Option_t *option)
       fname = new char[nch+3];
       strlcpy(fname,cname,nch+3);
       strncat(fname,".C",2);
-      out.open(fname, ios::out);
+      out.open(fname, std::ios::out);
    }
    if (!out.good ()) {
       Printf("SaveSource cannot open file: %s",fname);
@@ -1715,51 +1715,51 @@ void TCanvas::SaveSource(const char *filename, Option_t *option)
       topx = 1;    topy = 1;
    }
 
-   out <<"{"<<endl;
-   out <<"//=========Macro generated from canvas: "<<GetName()<<"/"<<GetTitle()<<endl;
-   out <<"//=========  ("<<t.AsString()<<") by ROOT version"<<gROOT->GetVersion()<<endl;
+   out <<"{"<<std::endl;
+   out <<"//=========Macro generated from canvas: "<<GetName()<<"/"<<GetTitle()<<std::endl;
+   out <<"//=========  ("<<t.AsString()<<") by ROOT version"<<gROOT->GetVersion()<<std::endl;
 
    if (gStyle->GetCanvasPreferGL())
-      out <<endl<<"   gStyle->SetCanvasPreferGL(kTRUE);"<<endl<<endl;
+      out <<std::endl<<"   gStyle->SetCanvasPreferGL(kTRUE);"<<std::endl<<std::endl;
 
    //   Write canvas parameters (TDialogCanvas case)
    if (InheritsFrom(TDialogCanvas::Class())) {
       out<<"   "<<ClassName()<<" *"<<cname<<" = new "<<ClassName()<<"("<<quote<<GetName()
-         <<quote<<", "<<quote<<GetTitle()<<quote<<","<<w<<","<<h<<");"<<endl;
+         <<quote<<", "<<quote<<GetTitle()<<quote<<","<<w<<","<<h<<");"<<std::endl;
    } else {
    //   Write canvas parameters (TCanvas case)
       out<<"   TCanvas *"<<cname<<" = new TCanvas("<<quote<<GetName()<<quote<<", "<<quote<<GetTitle()
          <<quote;
       if (!HasMenuBar())
-         out<<",-"<<topx<<","<<topy<<","<<w<<","<<h<<");"<<endl;
+         out<<",-"<<topx<<","<<topy<<","<<w<<","<<h<<");"<<std::endl;
       else
-         out<<","<<topx<<","<<topy<<","<<w<<","<<h<<");"<<endl;
+         out<<","<<topx<<","<<topy<<","<<w<<","<<h<<");"<<std::endl;
    }
    //   Write canvas options (in $TROOT or $TStyle)
    if (gStyle->GetOptFit()) {
-      out<<"   gStyle->SetOptFit(1);"<<endl;
+      out<<"   gStyle->SetOptFit(1);"<<std::endl;
    }
    if (!gStyle->GetOptStat()) {
-      out<<"   gStyle->SetOptStat(0);"<<endl;
+      out<<"   gStyle->SetOptStat(0);"<<std::endl;
    }
    if (!gStyle->GetOptTitle()) {
-      out<<"   gStyle->SetOptTitle(0);"<<endl;
+      out<<"   gStyle->SetOptTitle(0);"<<std::endl;
    }
    if (gROOT->GetEditHistograms()) {
-      out<<"   gROOT->SetEditHistograms();"<<endl;
+      out<<"   gROOT->SetEditHistograms();"<<std::endl;
    }
    if (GetShowEventStatus()) {
-      out<<"   "<<GetName()<<"->ToggleEventStatus();"<<endl;
+      out<<"   "<<GetName()<<"->ToggleEventStatus();"<<std::endl;
    }
    if (GetShowToolTips()) {
-      out<<"   "<<GetName()<<"->ToggleToolTips();"<<endl;
+      out<<"   "<<GetName()<<"->ToggleToolTips();"<<std::endl;
    }
    if (GetHighLightColor() != 5) {
       if (GetHighLightColor() > 228) {
          TColor::SaveColor(out, GetHighLightColor());
-         out<<"   "<<GetName()<<"->SetHighLightColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetHighLightColor(ci);" << std::endl;
       } else
-         out<<"   "<<GetName()<<"->SetHighLightColor("<<GetHighLightColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetHighLightColor("<<GetHighLightColor()<<");"<<std::endl;
    }
 
    //   Now recursively scan all pads of this canvas
@@ -1767,13 +1767,13 @@ void TCanvas::SaveSource(const char *filename, Option_t *option)
    if (invalid) SetName("c1");
    TPad::SavePrimitive(out,option);
    //   Write canvas options related to pad editor
-   out<<"   "<<GetName()<<"->SetSelected("<<GetName()<<");"<<endl;
+   out<<"   "<<GetName()<<"->SetSelected("<<GetName()<<");"<<std::endl;
    if (GetShowToolBar()) {
-      out<<"   "<<GetName()<<"->ToggleToolBar();"<<endl;
+      out<<"   "<<GetName()<<"->ToggleToolBar();"<<std::endl;
    }
    if (invalid) SetName(" ");
 
-   out <<"}"<<endl;
+   out <<"}"<<std::endl;
    out.close();
    Info("SaveSource","C++ Macro file: %s has been generated", fname);
 
diff --git a/graf2d/gpad/src/TClassTree.cxx b/graf2d/gpad/src/TClassTree.cxx
index 3b287718b6b..769bbffcaac 100644
--- a/graf2d/gpad/src/TClassTree.cxx
+++ b/graf2d/gpad/src/TClassTree.cxx
@@ -815,8 +815,8 @@ void TClassTree::ScanClasses(Int_t iclass)
    char *cname = new char[ncn+1];
    snprintf(cname,ncn,"%s::",fCnames[iclass]->Data());
        // open source file
-   ifstream sourceFile;
-   sourceFile.open( sourceName, ios::in );
+   std::ifstream sourceFile;
+   sourceFile.open( sourceName, std::ios::in );
    Int_t nlines = 0;
    if( sourceFile.good() ) {
       const Int_t kMAXLEN=1500;
diff --git a/graf2d/gpad/src/TGroupButton.cxx b/graf2d/gpad/src/TGroupButton.cxx
index 656cedc932d..faa839c41a9 100644
--- a/graf2d/gpad/src/TGroupButton.cxx
+++ b/graf2d/gpad/src/TGroupButton.cxx
@@ -216,7 +216,7 @@ void TGroupButton::ExecuteEvent(Int_t event, Int_t px, Int_t py)
 
 
 //______________________________________________________________________________
-void TGroupButton::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGroupButton::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -233,21 +233,21 @@ void TGroupButton::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       <<","<<fYlowNDC
       <<","<<fXlowNDC+fWNDC
       <<","<<fYlowNDC+fHNDC
-      <<");"<<endl;
+      <<");"<<std::endl;
 
    SaveFillAttributes(out,"button",0,1001);
    SaveLineAttributes(out,"button",1,1,1);
    SaveTextAttributes(out,"button",22,0,1,62,.75);
 
    if (GetBorderSize() != 2) {
-      out<<"   button->SetBorderSize("<<GetBorderSize()<<");"<<endl;
+      out<<"   button->SetBorderSize("<<GetBorderSize()<<");"<<std::endl;
    }
    if (GetBorderMode() != 1) {
-      out<<"   button->SetBorderMode("<<GetBorderMode()<<");"<<endl;
+      out<<"   button->SetBorderMode("<<GetBorderMode()<<");"<<std::endl;
    }
 
-   out<<"   button->Draw();"<<endl;
-   out<<"   button->cd();"<<endl;
+   out<<"   button->Draw();"<<std::endl;
+   out<<"   button->cd();"<<std::endl;
 
    TIter next(GetListOfPrimitives());
    TObject *obj = next();  //do not save first primitive
@@ -255,6 +255,6 @@ void TGroupButton::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    while ((obj = next()))
          obj->SavePrimitive(out, (Option_t *)next.GetOption());
 
-   out<<"   "<<padsav->GetName()<<"->cd();"<<endl;
+   out<<"   "<<padsav->GetName()<<"->cd();"<<std::endl;
    padsav->cd();
 }
diff --git a/graf2d/gpad/src/TPad.cxx b/graf2d/gpad/src/TPad.cxx
index 801e98c40d8..5744046000c 100644
--- a/graf2d/gpad/src/TPad.cxx
+++ b/graf2d/gpad/src/TPad.cxx
@@ -2777,8 +2777,8 @@ void TPad::ls(Option_t *option) const
    // List all primitives in pad.
 
    TROOT::IndentLevel();
-   cout <<IsA()->GetName()<<" fXlowNDC=" <<fXlowNDC<<" fYlowNDC="<<fYlowNDC<<" fWNDC="<<GetWNDC()<<" fHNDC="<<GetHNDC()
-        <<" Name= "<<GetName()<<" Title= "<<GetTitle()<<" Option="<<option<<endl;
+   std::cout <<IsA()->GetName()<<" fXlowNDC=" <<fXlowNDC<<" fYlowNDC="<<fYlowNDC<<" fWNDC="<<GetWNDC()<<" fHNDC="<<GetHNDC()
+        <<" Name= "<<GetName()<<" Title= "<<GetTitle()<<" Option="<<option<<std::endl;
    TROOT::IncreaseDirLevel();
    if (!fPrimitives) return;
    fPrimitives->ls(option);
@@ -4957,7 +4957,7 @@ void TPad::SaveAs(const char *filename, Option_t * /*option*/) const
 
 
 //______________________________________________________________________________
-void TPad::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPad::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitives in this pad on the C++ source file out.
 
@@ -4979,8 +4979,8 @@ void TPad::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 
    //   Write pad parameters
    if (this != gPad->GetCanvas()) {
-      out <<"  "<<endl;
-      out <<"// ------------>Primitives in pad: "<<GetName()<<endl;
+      out <<"  "<<std::endl;
+      out <<"// ------------>Primitives in pad: "<<GetName()<<std::endl;
 
       if (gROOT->ClassSaved(TPad::Class())) {
          out<<"   ";
@@ -4993,103 +4993,103 @@ void TPad::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       <<","<<fYlowNDC
       <<","<<fXlowNDC+fWNDC
       <<","<<fYlowNDC+fHNDC
-      <<");"<<endl;
-      out<<"   "<<cname<<"->Draw();"<<endl;
-      out<<"   "<<cname<<"->cd();"<<endl;
+      <<");"<<std::endl;
+      out<<"   "<<cname<<"->Draw();"<<std::endl;
+      out<<"   "<<cname<<"->cd();"<<std::endl;
    }
-   out<<"   "<<cname<<"->Range("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<endl;
+   out<<"   "<<cname<<"->Range("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<std::endl;
    TView *view = GetView();
    Double_t rmin[3], rmax[3];
    if (view) {
       view->GetRange(rmin, rmax);
-      out<<"   TView *view = TView::CreateView(1);"<<endl;
+      out<<"   TView *view = TView::CreateView(1);"<<std::endl;
       out<<"   view->SetRange("<<rmin[0]<<","<<rmin[1]<<","<<rmin[2]<<","
-                               <<rmax[0]<<","<<rmax[1]<<","<<rmax[2]<<");"<<endl;
+                               <<rmax[0]<<","<<rmax[1]<<","<<rmax[2]<<");"<<std::endl;
    }
    if (GetFillColor() != 19) {
       if (GetFillColor() > 228) {
          TColor::SaveColor(out, GetFillColor());
-         out<<"   "<<cname<<"->SetFillColor(ci);" << endl;
+         out<<"   "<<cname<<"->SetFillColor(ci);" << std::endl;
       } else
-         out<<"   "<<cname<<"->SetFillColor("<<GetFillColor()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFillColor("<<GetFillColor()<<");"<<std::endl;
    }
    if (GetFillStyle() != 1001) {
-      out<<"   "<<cname<<"->SetFillStyle("<<GetFillStyle()<<");"<<endl;
+      out<<"   "<<cname<<"->SetFillStyle("<<GetFillStyle()<<");"<<std::endl;
    }
    if (GetBorderMode() != 1) {
-      out<<"   "<<cname<<"->SetBorderMode("<<GetBorderMode()<<");"<<endl;
+      out<<"   "<<cname<<"->SetBorderMode("<<GetBorderMode()<<");"<<std::endl;
    }
    if (GetBorderSize() != 4) {
-      out<<"   "<<cname<<"->SetBorderSize("<<GetBorderSize()<<");"<<endl;
+      out<<"   "<<cname<<"->SetBorderSize("<<GetBorderSize()<<");"<<std::endl;
    }
    if (GetLogx()) {
-      out<<"   "<<cname<<"->SetLogx();"<<endl;
+      out<<"   "<<cname<<"->SetLogx();"<<std::endl;
    }
    if (GetLogy()) {
-      out<<"   "<<cname<<"->SetLogy();"<<endl;
+      out<<"   "<<cname<<"->SetLogy();"<<std::endl;
    }
    if (GetLogz()) {
-      out<<"   "<<cname<<"->SetLogz();"<<endl;
+      out<<"   "<<cname<<"->SetLogz();"<<std::endl;
    }
    if (GetGridx()) {
-      out<<"   "<<cname<<"->SetGridx();"<<endl;
+      out<<"   "<<cname<<"->SetGridx();"<<std::endl;
    }
    if (GetGridy()) {
-      out<<"   "<<cname<<"->SetGridy();"<<endl;
+      out<<"   "<<cname<<"->SetGridy();"<<std::endl;
    }
    if (GetTickx()) {
-      out<<"   "<<cname<<"->SetTickx("<<GetTickx()<<");"<<endl;
+      out<<"   "<<cname<<"->SetTickx("<<GetTickx()<<");"<<std::endl;
    }
    if (GetTicky()) {
-      out<<"   "<<cname<<"->SetTicky("<<GetTicky()<<");"<<endl;
+      out<<"   "<<cname<<"->SetTicky("<<GetTicky()<<");"<<std::endl;
    }
    if (GetTheta() != 30) {
-      out<<"   "<<cname<<"->SetTheta("<<GetTheta()<<");"<<endl;
+      out<<"   "<<cname<<"->SetTheta("<<GetTheta()<<");"<<std::endl;
    }
    if (GetPhi() != 30) {
-      out<<"   "<<cname<<"->SetPhi("<<GetPhi()<<");"<<endl;
+      out<<"   "<<cname<<"->SetPhi("<<GetPhi()<<");"<<std::endl;
    }
    if (TMath::Abs(fLeftMargin-0.1) > 0.01) {
-      out<<"   "<<cname<<"->SetLeftMargin("<<GetLeftMargin()<<");"<<endl;
+      out<<"   "<<cname<<"->SetLeftMargin("<<GetLeftMargin()<<");"<<std::endl;
    }
    if (TMath::Abs(fRightMargin-0.1) > 0.01) {
-      out<<"   "<<cname<<"->SetRightMargin("<<GetRightMargin()<<");"<<endl;
+      out<<"   "<<cname<<"->SetRightMargin("<<GetRightMargin()<<");"<<std::endl;
    }
    if (TMath::Abs(fTopMargin-0.1) > 0.01) {
-      out<<"   "<<cname<<"->SetTopMargin("<<GetTopMargin()<<");"<<endl;
+      out<<"   "<<cname<<"->SetTopMargin("<<GetTopMargin()<<");"<<std::endl;
    }
    if (TMath::Abs(fBottomMargin-0.1) > 0.01) {
-      out<<"   "<<cname<<"->SetBottomMargin("<<GetBottomMargin()<<");"<<endl;
+      out<<"   "<<cname<<"->SetBottomMargin("<<GetBottomMargin()<<");"<<std::endl;
    }
 
    if (GetFrameFillColor() != GetFillColor()) {
       if (GetFrameFillColor() > 228) {
          TColor::SaveColor(out, GetFrameFillColor());
-         out<<"   "<<cname<<"->SetFrameFillColor(ci);" << endl;
+         out<<"   "<<cname<<"->SetFrameFillColor(ci);" << std::endl;
       } else
-         out<<"   "<<cname<<"->SetFrameFillColor("<<GetFrameFillColor()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameFillColor("<<GetFrameFillColor()<<");"<<std::endl;
    }
    if (GetFrameFillStyle() != 1001) {
-      out<<"   "<<cname<<"->SetFrameFillStyle("<<GetFrameFillStyle()<<");"<<endl;
+      out<<"   "<<cname<<"->SetFrameFillStyle("<<GetFrameFillStyle()<<");"<<std::endl;
    }
    if (GetFrameLineStyle() != 1) {
-      out<<"   "<<cname<<"->SetFrameLineStyle("<<GetFrameLineStyle()<<");"<<endl;
+      out<<"   "<<cname<<"->SetFrameLineStyle("<<GetFrameLineStyle()<<");"<<std::endl;
    }
    if (GetFrameLineColor() != 1) {
       if (GetFrameLineColor() > 228) {
          TColor::SaveColor(out, GetFrameLineColor());
-         out<<"   "<<cname<<"->SetFrameLineColor(ci);" << endl;
+         out<<"   "<<cname<<"->SetFrameLineColor(ci);" << std::endl;
       } else
-         out<<"   "<<cname<<"->SetFrameLineColor("<<GetFrameLineColor()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameLineColor("<<GetFrameLineColor()<<");"<<std::endl;
    }
    if (GetFrameLineWidth() != 1) {
-      out<<"   "<<cname<<"->SetFrameLineWidth("<<GetFrameLineWidth()<<");"<<endl;
+      out<<"   "<<cname<<"->SetFrameLineWidth("<<GetFrameLineWidth()<<");"<<std::endl;
    }
    if (GetFrameBorderMode() != 1) {
-      out<<"   "<<cname<<"->SetFrameBorderMode("<<GetFrameBorderMode()<<");"<<endl;
+      out<<"   "<<cname<<"->SetFrameBorderMode("<<GetFrameBorderMode()<<");"<<std::endl;
    }
    if (GetFrameBorderSize() != 1) {
-         out<<"   "<<cname<<"->SetFrameBorderSize("<<GetFrameBorderSize()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameBorderSize("<<GetFrameBorderSize()<<");"<<std::endl;
    }
 
    TFrame *frame = fFrame;
@@ -5098,31 +5098,31 @@ void TPad::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       if (frame->GetFillColor() != GetFillColor()) {
          if (frame->GetFillColor() > 228) {
             TColor::SaveColor(out, frame->GetFillColor());
-            out<<"   "<<cname<<"->SetFrameFillColor(ci);" << endl;
+            out<<"   "<<cname<<"->SetFrameFillColor(ci);" << std::endl;
          } else
-            out<<"   "<<cname<<"->SetFrameFillColor("<<frame->GetFillColor()<<");"<<endl;
+            out<<"   "<<cname<<"->SetFrameFillColor("<<frame->GetFillColor()<<");"<<std::endl;
       }
       if (frame->GetFillStyle() != 1001) {
-         out<<"   "<<cname<<"->SetFrameFillStyle("<<frame->GetFillStyle()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameFillStyle("<<frame->GetFillStyle()<<");"<<std::endl;
       }
       if (frame->GetLineStyle() != 1) {
-         out<<"   "<<cname<<"->SetFrameLineStyle("<<frame->GetLineStyle()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameLineStyle("<<frame->GetLineStyle()<<");"<<std::endl;
       }
       if (frame->GetLineColor() != 1) {
          if (frame->GetLineColor() > 228) {
             TColor::SaveColor(out, frame->GetLineColor());
-            out<<"   "<<cname<<"->SetFrameLineColor(ci);" << endl;
+            out<<"   "<<cname<<"->SetFrameLineColor(ci);" << std::endl;
          } else
-            out<<"   "<<cname<<"->SetFrameLineColor("<<frame->GetLineColor()<<");"<<endl;
+            out<<"   "<<cname<<"->SetFrameLineColor("<<frame->GetLineColor()<<");"<<std::endl;
       }
       if (frame->GetLineWidth() != 1) {
-         out<<"   "<<cname<<"->SetFrameLineWidth("<<frame->GetLineWidth()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameLineWidth("<<frame->GetLineWidth()<<");"<<std::endl;
       }
       if (frame->GetBorderMode() != 1) {
-         out<<"   "<<cname<<"->SetFrameBorderMode("<<frame->GetBorderMode()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameBorderMode("<<frame->GetBorderMode()<<");"<<std::endl;
       }
       if (frame->GetBorderSize() != 1) {
-         out<<"   "<<cname<<"->SetFrameBorderSize("<<frame->GetBorderSize()<<");"<<endl;
+         out<<"   "<<cname<<"->SetFrameBorderSize("<<frame->GetBorderSize()<<");"<<std::endl;
       }
    }
 
@@ -5131,8 +5131,8 @@ void TPad::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 
    while ((obj = next()))
          obj->SavePrimitive(out, (Option_t *)next.GetOption());
-   out<<"   "<<cname<<"->Modified();"<<endl;
-   out<<"   "<<GetMother()->GetName()<<"->cd();"<<endl;
+   out<<"   "<<cname<<"->Modified();"<<std::endl;
+   out<<"   "<<GetMother()->GetName()<<"->cd();"<<std::endl;
    if (padsav) padsav->cd();
 }
 
diff --git a/graf2d/gpad/src/TPaveClass.cxx b/graf2d/gpad/src/TPaveClass.cxx
index d10d64ee99d..45630bd6a41 100644
--- a/graf2d/gpad/src/TPaveClass.cxx
+++ b/graf2d/gpad/src/TPaveClass.cxx
@@ -143,23 +143,23 @@ void TPaveClass::ShowClassesUsing(const char *classes)
 
 
 //______________________________________________________________________________
-void TPaveClass::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPaveClass::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPaveClass::Class())) {
       out<<"   ";
    } else {
       out<<"   TPaveClass *";
    }
    out<<"pclass = new TPaveClass("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-      <<","<<quote<<fLabel<<quote<<","<<quote<<fOption<<quote<<");"<<endl;
+      <<","<<quote<<fLabel<<quote<<","<<quote<<fOption<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"pclass",0,1001);
    SaveLineAttributes(out,"pclass",1,1,1);
    SaveTextAttributes(out,"pclass",22,0,1,62,0);
 
-   out<<"   pclass->Draw();"<<endl;
+   out<<"   pclass->Draw();"<<std::endl;
 }
diff --git a/graf2d/gpad/src/TSlider.cxx b/graf2d/gpad/src/TSlider.cxx
index 6b49669a214..a4a27cb085c 100644
--- a/graf2d/gpad/src/TSlider.cxx
+++ b/graf2d/gpad/src/TSlider.cxx
@@ -162,7 +162,7 @@ void TSlider::Paint(Option_t *option)
 
 
 //______________________________________________________________________________
-void TSlider::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TSlider::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -179,23 +179,23 @@ void TSlider::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       <<","<<fYlowNDC
       <<","<<fXlowNDC+fWNDC
       <<","<<fYlowNDC+fHNDC
-      <<");"<<endl;
+      <<");"<<std::endl;
 
    SaveFillAttributes(out,"slider",0,1001);
    SaveLineAttributes(out,"slider",1,1,1);
 
    if (GetBorderSize() != 2) {
-      out<<"   slider->SetBorderSize("<<GetBorderSize()<<");"<<endl;
+      out<<"   slider->SetBorderSize("<<GetBorderSize()<<");"<<std::endl;
    }
    if (GetBorderMode() != -1) {
-      out<<"   slider->SetBorderMode("<<GetBorderMode()<<");"<<endl;
+      out<<"   slider->SetBorderMode("<<GetBorderMode()<<");"<<std::endl;
    }
    Int_t lenMethod = strlen(GetMethod());
    if (lenMethod > 0) {
-      out<<"   slider->SetMethod("<<quote<<GetMethod()<<quote<<");"<<endl;
+      out<<"   slider->SetMethod("<<quote<<GetMethod()<<quote<<");"<<std::endl;
    }
 
-   out<<"   "<<padsav->GetName()<<"->cd();"<<endl;
+   out<<"   "<<padsav->GetName()<<"->cd();"<<std::endl;
    padsav->cd();
 }
 
diff --git a/graf2d/gpad/src/TSliderBox.cxx b/graf2d/gpad/src/TSliderBox.cxx
index 2d7dd4671b3..65a22979278 100644
--- a/graf2d/gpad/src/TSliderBox.cxx
+++ b/graf2d/gpad/src/TSliderBox.cxx
@@ -290,7 +290,7 @@ again:
 
 
 //______________________________________________________________________________
-void TSliderBox::SavePrimitive(ostream &, Option_t * /*= ""*/)
+void TSliderBox::SavePrimitive(std::ostream &, Option_t * /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 }
diff --git a/graf2d/graf/inc/TArc.h b/graf2d/graf/inc/TArc.h
index 63169a8e488..e26c9ca9409 100644
--- a/graf2d/graf/inc/TArc.h
+++ b/graf2d/graf/inc/TArc.h
@@ -37,7 +37,7 @@ public:
    void Copy(TObject &arc) const;
    virtual void DrawArc(Double_t x1, Double_t y1, Double_t radius
                        ,Double_t  phimin=0, Double_t  phimax=360, Option_t *option="");
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TArc,1)  //Arc of a circle
 };
diff --git a/graf2d/graf/inc/TArrow.h b/graf2d/graf/inc/TArrow.h
index b7956874a7f..1427f56ee36 100644
--- a/graf2d/graf/inc/TArrow.h
+++ b/graf2d/graf/inc/TArrow.h
@@ -60,7 +60,7 @@ public:
    virtual void   Paint(Option_t *option="");
    virtual void   PaintArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2
                                  ,Float_t arrowsize=0.05 ,Option_t *option=">");
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void   SetAngle(Float_t angle=60) {fAngle=angle;} // *MENU*
    virtual void   SetArrowSize(Float_t arrowsize=0.05) {fArrowSize=arrowsize;} // *MENU*
    virtual void   SetOption(Option_t *option=">"){ fOption = option;}
diff --git a/graf2d/graf/inc/TAttImage.h b/graf2d/graf/inc/TAttImage.h
index 81f6b4ef93f..e7850974293 100644
--- a/graf2d/graf/inc/TAttImage.h
+++ b/graf2d/graf/inc/TAttImage.h
@@ -137,7 +137,7 @@ public:
    virtual const TImagePalette &GetPalette() const { return fPalette; }
 
    virtual void     ResetAttImage(Option_t *option="");
-   virtual void     SaveImageAttributes(ostream &out, const char *name,
+   virtual void     SaveImageAttributes(std::ostream &out, const char *name,
                                         EImageQuality qualdef = kImgDefault,
                                         UInt_t comprdef = 0,
                                         Bool_t constRatiodef = kTRUE);
diff --git a/graf2d/graf/inc/TBox.h b/graf2d/graf/inc/TBox.h
index b6be7bc8ed3..08614066349 100644
--- a/graf2d/graf/inc/TBox.h
+++ b/graf2d/graf/inc/TBox.h
@@ -69,7 +69,7 @@ public:
    virtual void  Paint(Option_t *option="");
    virtual void  PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="");
    virtual void  Print(Option_t *option="") const;
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetX1(Double_t x1) {fX1=x1;}
    virtual void  SetX2(Double_t x2) {fX2=x2;}
    virtual void  SetY1(Double_t y1) {fY1=y1;}
diff --git a/graf2d/graf/inc/TCrown.h b/graf2d/graf/inc/TCrown.h
index 6615dcdae3a..cb9cfc2cf44 100644
--- a/graf2d/graf/inc/TCrown.h
+++ b/graf2d/graf/inc/TCrown.h
@@ -41,7 +41,7 @@ public:
                             Double_t  phimin=0, Double_t  phimax=360, Option_t *option="");
    virtual void   ExecuteEvent(Int_t event, Int_t px, Int_t py);
    virtual void   Paint(Option_t *option="");
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TCrown,1)  //A crown or segment of crown
 };
diff --git a/graf2d/graf/inc/TCurlyArc.h b/graf2d/graf/inc/TCurlyArc.h
index a3370641bb8..3b4e2ad5653 100644
--- a/graf2d/graf/inc/TCurlyArc.h
+++ b/graf2d/graf/inc/TCurlyArc.h
@@ -45,7 +45,7 @@ public:
    virtual void SetRadius(Double_t radius);          // *MENU* *ARGS={radius=>fR1}
    virtual void SetPhimin(Double_t phimin);          // *MENU* *ARGS={phimin=>fPhimin}
    virtual void SetPhimax(Double_t phimax);          // *MENU* *ARGS={phimax=>fPhimax}
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    static void     SetDefaultWaveLength(Double_t WaveLength); 
    static void     SetDefaultAmplitude (Double_t Amplitude );    
diff --git a/graf2d/graf/inc/TCurlyLine.h b/graf2d/graf/inc/TCurlyLine.h
index ca900f79d5c..bdaaf94c978 100644
--- a/graf2d/graf/inc/TCurlyLine.h
+++ b/graf2d/graf/inc/TCurlyLine.h
@@ -64,7 +64,7 @@ public:
    virtual void SetAmplitude(Double_t x);               // *MENU* *ARGS={x=>fAmplitude}
    virtual void SetStartPoint(Double_t x1, Double_t y1);
    virtual void SetEndPoint  (Double_t x2, Double_t y2);
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    static void     SetDefaultWaveLength(Double_t WaveLength);
    static void     SetDefaultAmplitude (Double_t Amplitude );
diff --git a/graf2d/graf/inc/TCutG.h b/graf2d/graf/inc/TCutG.h
index acdb3565d10..15bbf815f73 100644
--- a/graf2d/graf/inc/TCutG.h
+++ b/graf2d/graf/inc/TCutG.h
@@ -50,7 +50,7 @@ public:
    const char      *GetVarX() const {return fVarX.Data();}
    const char      *GetVarY() const {return fVarY.Data();}
    virtual Double_t IntegralHist(TH2 *h, Option_t *option="") const;
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetObjectX(TObject *obj);
    virtual void     SetObjectY(TObject *obj);
    virtual void     SetVarX(const char *varx); // *MENU*
diff --git a/graf2d/graf/inc/TDiamond.h b/graf2d/graf/inc/TDiamond.h
index e5653b54329..3bdf56c204a 100644
--- a/graf2d/graf/inc/TDiamond.h
+++ b/graf2d/graf/inc/TDiamond.h
@@ -43,7 +43,7 @@ public:
    virtual void  Draw(Option_t *option="");
    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
    virtual void  Paint(Option_t *option="");
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TDiamond,1)  //Diamond class
 };
diff --git a/graf2d/graf/inc/TEllipse.h b/graf2d/graf/inc/TEllipse.h
index 5b1ea9d7432..a4770cc5037 100644
--- a/graf2d/graf/inc/TEllipse.h
+++ b/graf2d/graf/inc/TEllipse.h
@@ -69,7 +69,7 @@ public:
    virtual void   Paint(Option_t *option="");
    virtual void   PaintEllipse(Double_t x1, Double_t y1, Double_t r1,Double_t r2,Double_t phimin, Double_t phimax,Double_t theta,Option_t *option="");
    virtual void   Print(Option_t *option="") const;
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void   SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges
    virtual void   SetPhimin(Double_t phi=0)   {fPhimin=phi;} // *MENU*
    virtual void   SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU*
diff --git a/graf2d/graf/inc/TFrame.h b/graf2d/graf/inc/TFrame.h
index a17fe703a62..91e237847b7 100644
--- a/graf2d/graf/inc/TFrame.h
+++ b/graf2d/graf/inc/TFrame.h
@@ -39,7 +39,7 @@ public:
    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
    virtual void  Paint(Option_t *option="");
    virtual void  Pop();
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  UseCurrentStyle();  // *MENU*
 
    ClassDef(TFrame,1)  //Pad graphics frame
diff --git a/graf2d/graf/inc/TGaxis.h b/graf2d/graf/inc/TGaxis.h
index 43211b6edc6..f4f122ec7a5 100644
--- a/graf2d/graf/inc/TGaxis.h
+++ b/graf2d/graf/inc/TGaxis.h
@@ -105,7 +105,7 @@ public:
                                  Double_t gridlength = 0, Bool_t drawGridOnly = kFALSE);
    virtual void        Rotate(Double_t X,  Double_t Y,  Double_t CFI, Double_t SFI
                              ,Double_t XT, Double_t YT, Double_t &U,   Double_t &V);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    void                SetFunction(const char *funcname="");
    void                SetOption(Option_t *option="");
    void                SetLabelColor(Int_t labelcolor) {fLabelColor = labelcolor;} // *MENU*
diff --git a/graf2d/graf/inc/TLatex.h b/graf2d/graf/inc/TLatex.h
index 5af09cd7f59..05bbc245034 100644
--- a/graf2d/graf/inc/TLatex.h
+++ b/graf2d/graf/inc/TLatex.h
@@ -120,7 +120,7 @@ public:
       virtual void     Paint(Option_t *option="");
       virtual void     PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text);
 
-      virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+      virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
       virtual void     SetIndiceSize(Double_t factorSize);
       virtual void     SetLimitIndiceSize(Int_t limitFactorSize);
 
diff --git a/graf2d/graf/inc/TLegend.h b/graf2d/graf/inc/TLegend.h
index afe510f6dc4..2cfd9bc0646 100644
--- a/graf2d/graf/inc/TLegend.h
+++ b/graf2d/graf/inc/TLegend.h
@@ -68,7 +68,7 @@ public:
    virtual void    PaintPrimitives();
    virtual void    Print( Option_t* option = "" ) const;
    virtual void    RecursiveRemove(TObject *obj);
-   virtual void    SavePrimitive(ostream &out, Option_t *option  = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option  = "");
    void            SetDefaults() { fEntrySeparation = 0.1f; fMargin = 0.25f; fNColumns = 1; fColumnSeparation = 0.0f; }
    void            SetColumnSeparation( Float_t columnSeparation )
                      { fColumnSeparation = columnSeparation; } // *MENU*
diff --git a/graf2d/graf/inc/TLegendEntry.h b/graf2d/graf/inc/TLegendEntry.h
index 934dd0cf47f..cf7972d2f3d 100644
--- a/graf2d/graf/inc/TLegendEntry.h
+++ b/graf2d/graf/inc/TLegendEntry.h
@@ -53,7 +53,7 @@ public:
    virtual TObject      *GetObject() const { return fObject; }
    virtual Option_t     *GetOption() const { return fOption.Data(); }
    virtual void          Print( Option_t *option = "" ) const;
-   virtual void          SaveEntry( ostream &out, const char *name );
+   virtual void          SaveEntry( std::ostream &out, const char *name );
    virtual void          SetLabel( const char *label = "" ) { fLabel = label; } // *MENU*
    virtual void          SetObject(TObject* obj );
    virtual void          SetObject( const char *objectName );  // *MENU*
diff --git a/graf2d/graf/inc/TLine.h b/graf2d/graf/inc/TLine.h
index c6ccdf02d94..f4f94389904 100644
--- a/graf2d/graf/inc/TLine.h
+++ b/graf2d/graf/inc/TLine.h
@@ -67,7 +67,7 @@ public:
    virtual void   PaintLine(Double_t x1, Double_t y1,Double_t x2, Double_t  y2);
    virtual void   PaintLineNDC(Double_t u1, Double_t v1,Double_t u2, Double_t  v2);
    virtual void   Print(Option_t *option="") const;
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
    void           SetHorizontal(Bool_t set = kTRUE); // *TOGGLE* *GETTER=IsHorizontal
    void           SetVertical(Bool_t set = kTRUE); // *TOGGLE* *GETTER=IsVertical
    virtual void   SetX1(Double_t x1) {fX1=x1;}
diff --git a/graf2d/graf/inc/TMarker.h b/graf2d/graf/inc/TMarker.h
index da032e75688..6123c523052 100644
--- a/graf2d/graf/inc/TMarker.h
+++ b/graf2d/graf/inc/TMarker.h
@@ -58,7 +58,7 @@ public:
    virtual void     PaintMarker(Double_t x, Double_t y);
    virtual void     PaintMarkerNDC(Double_t u, Double_t v);
    virtual void     Print(Option_t *option="") const;
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetNDC(Bool_t isNDC=kTRUE);
    virtual void     SetX(Double_t x) { fX = x;} // *MENU*
    virtual void     SetY(Double_t y) { fY = y;} // *MENU*
diff --git a/graf2d/graf/inc/TPave.h b/graf2d/graf/inc/TPave.h
index 0aa355161f4..99489a84108 100644
--- a/graf2d/graf/inc/TPave.h
+++ b/graf2d/graf/inc/TPave.h
@@ -78,7 +78,7 @@ public:
    virtual void  PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
                               Int_t bordersize=4 ,Option_t *option="br");
    virtual void  Print(Option_t *option="") const;
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;} // *MENU*
    virtual void  SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;} // *MENU*
    virtual void  SetName(const char *name="") {fName = name;} // *MENU*
diff --git a/graf2d/graf/inc/TPaveLabel.h b/graf2d/graf/inc/TPaveLabel.h
index a81edf6f169..513ff73a89a 100644
--- a/graf2d/graf/inc/TPaveLabel.h
+++ b/graf2d/graf/inc/TPaveLabel.h
@@ -49,7 +49,7 @@ public:
    virtual void  Paint(Option_t *option="");
    virtual void  PaintPaveLabel(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
                       const char *label, Option_t *option="");
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetLabel(const char *label) {fLabel = label;} // *MENU*
 
    ClassDef(TPaveLabel,1)  //PaveLabel. A Pave with a label
diff --git a/graf2d/graf/inc/TPaveStats.h b/graf2d/graf/inc/TPaveStats.h
index 861fc6a1c47..128d85a4391 100644
--- a/graf2d/graf/inc/TPaveStats.h
+++ b/graf2d/graf/inc/TPaveStats.h
@@ -51,7 +51,7 @@ public:
    virtual void     InsertText(const char *) { }
    virtual void     InsertLine() { }
    virtual void     ReadFile(const char *, Option_t *, Int_t, Int_t) { }
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SaveStyle(); // *MENU*
    virtual void     SetAllWith(const char *, Option_t *, Double_t) { }
    virtual void     SetMargin(Float_t) { }
diff --git a/graf2d/graf/inc/TPaveText.h b/graf2d/graf/inc/TPaveText.h
index e37dfe4bf1b..e53d656f10a 100644
--- a/graf2d/graf/inc/TPaveText.h
+++ b/graf2d/graf/inc/TPaveText.h
@@ -70,8 +70,8 @@ public:
    virtual void     PaintPrimitives(Int_t mode);
    virtual void     Print(Option_t *option="") const;
    virtual void     ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0); // *MENU*
-   virtual void     SaveLines(ostream &out, const char *name);
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SaveLines(std::ostream &out, const char *name);
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetAllWith(const char *text, Option_t *option, Double_t value); // *MENU*
    virtual void     SetLabel(const char *label) {fLabel = label;} // *MENU*
    virtual void     SetMargin(Float_t margin=0.05) {fMargin=margin;} // *MENU*
diff --git a/graf2d/graf/inc/TPavesText.h b/graf2d/graf/inc/TPavesText.h
index c0b8235fb69..7bbecad8aa8 100644
--- a/graf2d/graf/inc/TPavesText.h
+++ b/graf2d/graf/inc/TPavesText.h
@@ -39,7 +39,7 @@ public:
    virtual void  Draw(Option_t *option="");
    virtual Int_t GetNpaves() {return fNpaves;}
    virtual void  Paint(Option_t *option="");
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetNpaves(Int_t npaves=5) {fNpaves=npaves;} // *MENU*
 
    ClassDef(TPavesText,1)  //Stacked Paves with text strings
diff --git a/graf2d/graf/inc/TPie.h b/graf2d/graf/inc/TPie.h
index 2f047ba7f94..7375021fb9b 100644
--- a/graf2d/graf/inc/TPie.h
+++ b/graf2d/graf/inc/TPie.h
@@ -91,7 +91,7 @@ public:
    TLegend       *MakeLegend(Double_t x1=.65,Double_t y1=.65,Double_t x2=.95, Double_t y2=.95, const char *leg_header="");
    void           MakeSlices(Bool_t force=kFALSE);
    virtual void   Paint(Option_t *);
-   void           SavePrimitive(ostream &out, Option_t *opts="");
+   void           SavePrimitive(std::ostream &out, Option_t *opts="");
    void           SetAngle3D(Float_t val = 30.); // *MENU*
    void           SetAngularOffset(Double_t);
    void           SetCircle(Double_t x=.5, Double_t y=.5, Double_t rad=.4);
diff --git a/graf2d/graf/inc/TPieSlice.h b/graf2d/graf/inc/TPieSlice.h
index b0a3a495a1e..ebb143320f9 100644
--- a/graf2d/graf/inc/TPieSlice.h
+++ b/graf2d/graf/inc/TPieSlice.h
@@ -45,7 +45,7 @@ public:
    virtual Int_t  DistancetoPrimitive(Int_t,Int_t);
    Double_t       GetRadiusOffset();
    Double_t       GetValue();
-   void           SavePrimitive(ostream &out, Option_t *opts="");
+   void           SavePrimitive(std::ostream &out, Option_t *opts="");
    void           SetIsActive(Bool_t is) { fIsActive = is; }
    void           SetRadiusOffset(Double_t);  // *MENU*
    void           SetValue(Double_t);         // *MENU*
diff --git a/graf2d/graf/inc/TPolyLine.h b/graf2d/graf/inc/TPolyLine.h
index 382e23eaccf..14b9ca6e1b2 100644
--- a/graf2d/graf/inc/TPolyLine.h
+++ b/graf2d/graf/inc/TPolyLine.h
@@ -75,7 +75,7 @@ public:
    virtual void    PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
    virtual void    PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
    virtual void    Print(Option_t *option="") const;
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SetNDC(Bool_t isNDC=kTRUE);
    virtual Int_t   SetNextPoint(Double_t x, Double_t y); // *MENU*
    virtual void    SetOption(Option_t *option="") {fOption = option;}
diff --git a/graf2d/graf/inc/TText.h b/graf2d/graf/inc/TText.h
index 43b0a142a3e..defa4a18351 100644
--- a/graf2d/graf/inc/TText.h
+++ b/graf2d/graf/inc/TText.h
@@ -66,7 +66,7 @@ public:
    virtual void     PaintText(Double_t x, Double_t y, const char *text);
    virtual void     PaintTextNDC(Double_t u, Double_t v, const char *text);
    virtual void     Print(Option_t *option="") const;
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetNDC(Bool_t isNDC=kTRUE);
    virtual void     SetText(Double_t x, Double_t y, const char *text) {fX=x; fY=y; SetTitle(text);} // *MENU* *ARGS={x=>fX,y=>fY,text=>fTitle}
    virtual void     SetX(Double_t x) { fX = x; } // *MENU*
diff --git a/graf2d/graf/inc/TWbox.h b/graf2d/graf/inc/TWbox.h
index 8645d5b5087..34f215be0e9 100644
--- a/graf2d/graf/inc/TWbox.h
+++ b/graf2d/graf/inc/TWbox.h
@@ -58,7 +58,7 @@ public:
                             Bool_t tops);
    virtual void  PaintWbox(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
                  Color_t color=33, Short_t bordersize=5, Short_t bordermode=-1);
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetBorderMode(Short_t bordermode) {fBorderMode = bordermode;} // *MENU*
    virtual void  SetBorderSize(Short_t bordersize) {fBorderSize = bordersize;} // *MENU*
 
diff --git a/graf2d/graf/src/TArc.cxx b/graf2d/graf/src/TArc.cxx
index 74932e82d24..795bf8950c3 100644
--- a/graf2d/graf/src/TArc.cxx
+++ b/graf2d/graf/src/TArc.cxx
@@ -88,23 +88,23 @@ void TArc::DrawArc(Double_t x1, Double_t y1,Double_t r1,Double_t phimin,Double_t
 
 
 //______________________________________________________________________________
-void TArc::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TArc::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TArc::Class())) {
       out<<"   ";
    } else {
       out<<"   TArc *";
    }
    out<<"arc = new TArc("<<fX1<<","<<fY1<<","<<fR1
-      <<","<<fPhimin<<","<<fPhimax<<");"<<endl;
+      <<","<<fPhimin<<","<<fPhimax<<");"<<std::endl;
 
    SaveFillAttributes(out,"arc",0,1001);
    SaveLineAttributes(out,"arc",1,1,1);
 
-   if (GetNoEdges()) out<<"   arc->SetNoEdges();"<<endl;
+   if (GetNoEdges()) out<<"   arc->SetNoEdges();"<<std::endl;
 
-   out<<"   arc->Draw();"<<endl;
+   out<<"   arc->Draw();"<<std::endl;
 }
diff --git a/graf2d/graf/src/TArrow.cxx b/graf2d/graf/src/TArrow.cxx
index f88fc858427..2254eb1d14e 100644
--- a/graf2d/graf/src/TArrow.cxx
+++ b/graf2d/graf/src/TArrow.cxx
@@ -345,7 +345,7 @@ void TArrow::PaintArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
 }
 
 //______________________________________________________________________________
-void TArrow::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TArrow::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
@@ -356,16 +356,16 @@ void TArrow::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       out<<"   TArrow *";
    }
    out<<"arrow = new TArrow("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-      <<","<<fArrowSize<<","<<quote<<GetDrawOption()<<quote<<");"<<endl;
+      <<","<<fArrowSize<<","<<quote<<GetDrawOption()<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"arrow",0,1);
    SaveLineAttributes(out,"arrow",1,1,1);
 
    if (fAngle !=60) {
-      out << "   arrow->SetAngle(" << GetAngle() << ");" << endl;
+      out << "   arrow->SetAngle(" << GetAngle() << ");" << std::endl;
    }
 
-   out<<"   arrow->Draw();"<<endl;
+   out<<"   arrow->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TAttImage.cxx b/graf2d/graf/src/TAttImage.cxx
index f6cee91a7b1..95965280cb8 100644
--- a/graf2d/graf/src/TAttImage.cxx
+++ b/graf2d/graf/src/TAttImage.cxx
@@ -611,7 +611,7 @@ void TAttImage::ResetAttImage(Option_t *)
 }
 
 //______________________________________________________________________________
-void TAttImage::SaveImageAttributes(ostream &out, const char *name,
+void TAttImage::SaveImageAttributes(std::ostream &out, const char *name,
                                     EImageQuality qualdef,
                                     UInt_t comprdef, Bool_t constRatiodef)
 {
@@ -619,13 +619,13 @@ void TAttImage::SaveImageAttributes(ostream &out, const char *name,
    // not the palette.
 
    if (fImageQuality != qualdef) {
-      out<<"   "<<name<<"->SetImageQuality("<<fImageQuality<<");"<<endl;
+      out<<"   "<<name<<"->SetImageQuality("<<fImageQuality<<");"<<std::endl;
    }
    if (fImageCompression != comprdef) {
-      out<<"   "<<name<<"->SetImageCompression("<<fImageCompression<<");"<<endl;
+      out<<"   "<<name<<"->SetImageCompression("<<fImageCompression<<");"<<std::endl;
    }
    if (fConstRatio != constRatiodef) {
-      out<<"   "<<name<<"->SetConstRatio("<<fConstRatio<<");"<<endl;
+      out<<"   "<<name<<"->SetConstRatio("<<fConstRatio<<");"<<std::endl;
    }
 }
 
diff --git a/graf2d/graf/src/TBox.cxx b/graf2d/graf/src/TBox.cxx
index 5dd37f13e9e..f8e2b8f4de3 100644
--- a/graf2d/graf/src/TBox.cxx
+++ b/graf2d/graf/src/TBox.cxx
@@ -626,7 +626,7 @@ void TBox::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TBox::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TBox::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -635,12 +635,12 @@ void TBox::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    } else {
       out<<"   TBox *";
    }
-   out<<"box = new TBox("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<endl;
+   out<<"box = new TBox("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<std::endl;
 
    SaveFillAttributes(out,"box",0,1001);
    SaveLineAttributes(out,"box",1,1,1);
 
-   out<<"   box->Draw();"<<endl;
+   out<<"   box->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TCrown.cxx b/graf2d/graf/src/TCrown.cxx
index 21662a78312..4d8d54404da 100644
--- a/graf2d/graf/src/TCrown.cxx
+++ b/graf2d/graf/src/TCrown.cxx
@@ -246,25 +246,25 @@ void TCrown::Paint(Option_t *)
 
 
 //______________________________________________________________________________
-void TCrown::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TCrown::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    /* Begin_Html
    Save primitive as a C++ statement(s) on output stream out.
    End_Html */
 
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TCrown::Class())) {
       out<<"   ";
    } else {
       out<<"   TCrown *";
    }
    out<<"crown = new TCrown("<<fX1<<","<<fY1<<","<<fR1<<","<<fR2
-      <<","<<fPhimin<<","<<fPhimax<<");"<<endl;
+      <<","<<fPhimin<<","<<fPhimax<<");"<<std::endl;
 
    SaveFillAttributes(out,"crown",0,1001);
    SaveLineAttributes(out,"crown",1,1,1);
 
-   if (GetNoEdges()) out<<"   crown->SetNoEdges();"<<endl;
+   if (GetNoEdges()) out<<"   crown->SetNoEdges();"<<std::endl;
 
-   out<<"   crown->Draw();"<<endl;
+   out<<"   crown->Draw();"<<std::endl;
 }
diff --git a/graf2d/graf/src/TCurlyArc.cxx b/graf2d/graf/src/TCurlyArc.cxx
index a7718d72b71..ae83e881cc9 100644
--- a/graf2d/graf/src/TCurlyArc.cxx
+++ b/graf2d/graf/src/TCurlyArc.cxx
@@ -377,7 +377,7 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py)
 
 
 //______________________________________________________________________________
-void TCurlyArc::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TCurlyArc::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -388,12 +388,12 @@ void TCurlyArc::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    out<<"curlyarc = new TCurlyArc("
      <<fX1<<","<<fY1<<","<<fR1<<","<<fPhimin<<","<<fPhimax<<","
-      <<fWaveLength<<","<<fAmplitude<<");"<<endl;
+      <<fWaveLength<<","<<fAmplitude<<");"<<std::endl;
    if (!fIsCurly) {
-      out<<"   curlyarc->SetWavy();"<<endl;
+      out<<"   curlyarc->SetWavy();"<<std::endl;
    }
    SaveLineAttributes(out,"curlyarc",1,1,1);
-   out<<"   curlyarc->Draw();"<<endl;
+   out<<"   curlyarc->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TCurlyLine.cxx b/graf2d/graf/src/TCurlyLine.cxx
index 90048843854..5e41db1667d 100644
--- a/graf2d/graf/src/TCurlyLine.cxx
+++ b/graf2d/graf/src/TCurlyLine.cxx
@@ -285,7 +285,7 @@ void TCurlyLine::ExecuteEvent(Int_t event, Int_t px, Int_t py)
 
 
 //______________________________________________________________________________
-void TCurlyLine::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TCurlyLine::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -296,12 +296,12 @@ void TCurlyLine::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    out<<"curlyline = new TCurlyLine("
      <<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<","
-     <<fWaveLength<<","<<fAmplitude<<");"<<endl;
+     <<fWaveLength<<","<<fAmplitude<<");"<<std::endl;
    if (!fIsCurly) {
-      out<<"   curlyline->SetWavy();"<<endl;
+      out<<"   curlyline->SetWavy();"<<std::endl;
    }
    SaveLineAttributes(out,"curlyline",1,1,1);
-   out<<"   curlyline->Draw();"<<endl;
+   out<<"   curlyline->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TCutG.cxx b/graf2d/graf/src/TCutG.cxx
index 60709adc7c7..da2776be1e9 100644
--- a/graf2d/graf/src/TCutG.cxx
+++ b/graf2d/graf/src/TCutG.cxx
@@ -357,31 +357,31 @@ Double_t TCutG::IntegralHist(TH2 *h, Option_t *option) const
 
 
 //______________________________________________________________________________
-void TCutG::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TCutG::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out.
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TCutG::Class())) {
       out<<"   ";
    } else {
       out<<"   TCutG *";
    }
-   out<<"cutg = new TCutG("<<quote<<GetName()<<quote<<","<<fNpoints<<");"<<endl;
-   out<<"   cutg->SetVarX("<<quote<<GetVarX()<<quote<<");"<<endl;
-   out<<"   cutg->SetVarY("<<quote<<GetVarY()<<quote<<");"<<endl;
-   out<<"   cutg->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<"cutg = new TCutG("<<quote<<GetName()<<quote<<","<<fNpoints<<");"<<std::endl;
+   out<<"   cutg->SetVarX("<<quote<<GetVarX()<<quote<<");"<<std::endl;
+   out<<"   cutg->SetVarY("<<quote<<GetVarY()<<quote<<");"<<std::endl;
+   out<<"   cutg->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"cutg",0,1001);
    SaveLineAttributes(out,"cutg",1,1,1);
    SaveMarkerAttributes(out,"cutg",1,1,1);
 
    for (Int_t i=0;i<fNpoints;i++) {
-      out<<"   cutg->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<endl;
+      out<<"   cutg->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<std::endl;
    }
    out<<"   cutg->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/graf2d/graf/src/TDiamond.cxx b/graf2d/graf/src/TDiamond.cxx
index e7b3119c5af..e9f32640c7c 100644
--- a/graf2d/graf/src/TDiamond.cxx
+++ b/graf2d/graf/src/TDiamond.cxx
@@ -420,7 +420,7 @@ void TDiamond::Paint(Option_t *)
 }
 
 //______________________________________________________________________________
-void TDiamond::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TDiamond::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out.
 
@@ -429,12 +429,12 @@ void TDiamond::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    } else {
       out<<"   TDiamond *";
    }
-   out<<"diamond = new TDiamond("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<endl;
+   out<<"diamond = new TDiamond("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<std::endl;
 
    SaveFillAttributes(out,"diamond",0,1001);
    SaveLineAttributes(out,"diamond",1,1,1);
    SaveTextAttributes(out,"diamond",11,0,1,62,0.05);
 
    SaveLines(out,"diamond");
-   out<<"   diamond->Draw();"<<endl;
+   out<<"   diamond->Draw();"<<std::endl;
 }
diff --git a/graf2d/graf/src/TEllipse.cxx b/graf2d/graf/src/TEllipse.cxx
index ee1d3889532..e104255653e 100644
--- a/graf2d/graf/src/TEllipse.cxx
+++ b/graf2d/graf/src/TEllipse.cxx
@@ -533,25 +533,25 @@ void TEllipse::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TEllipse::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TEllipse::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TEllipse::Class())) {
       out<<"   ";
    } else {
       out<<"   TEllipse *";
    }
    out<<"ellipse = new TEllipse("<<fX1<<","<<fY1<<","<<fR1<<","<<fR2
-      <<","<<fPhimin<<","<<fPhimax<<","<<fTheta<<");"<<endl;
+      <<","<<fPhimin<<","<<fPhimax<<","<<fTheta<<");"<<std::endl;
 
    SaveFillAttributes(out,"ellipse",0,1001);
    SaveLineAttributes(out,"ellipse",1,1,1);
 
-   if (GetNoEdges()) out<<"   ellipse->SetNoEdges();"<<endl;
+   if (GetNoEdges()) out<<"   ellipse->SetNoEdges();"<<std::endl;
 
-   out<<"   ellipse->Draw();"<<endl;
+   out<<"   ellipse->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TFrame.cxx b/graf2d/graf/src/TFrame.cxx
index 6ce97ddbcb8..741d07ac48f 100644
--- a/graf2d/graf/src/TFrame.cxx
+++ b/graf2d/graf/src/TFrame.cxx
@@ -137,7 +137,7 @@ void TFrame::Pop()
 }
 
 //______________________________________________________________________________
-void TFrame::SavePrimitive(ostream &, Option_t * /*= ""*/)
+void TFrame::SavePrimitive(std::ostream &, Option_t * /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
diff --git a/graf2d/graf/src/TGaxis.cxx b/graf2d/graf/src/TGaxis.cxx
index 231ff41e8d0..83704af3dac 100644
--- a/graf2d/graf/src/TGaxis.cxx
+++ b/graf2d/graf/src/TGaxis.cxx
@@ -1960,7 +1960,7 @@ void TGaxis::Rotate(Double_t X,  Double_t Y,  Double_t CFI, Double_t SFI
 
 
 //______________________________________________________________________________
-void TGaxis::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGaxis::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
@@ -1971,54 +1971,54 @@ void TGaxis::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       out<<"   TGaxis *";
    }
    out<<"gaxis = new TGaxis("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-      <<","<<fWmin<<","<<fWmax<<","<<fNdiv<<","<<quote<<fChopt.Data()<<quote<<");"<<endl;
-   out<<"   gaxis->SetLabelOffset("<<GetLabelOffset()<<");"<<endl;
-   out<<"   gaxis->SetLabelSize("<<GetLabelSize()<<");"<<endl;
-   out<<"   gaxis->SetTickSize("<<GetTickSize()<<");"<<endl;
-   out<<"   gaxis->SetGridLength("<<GetGridLength()<<");"<<endl;
-   out<<"   gaxis->SetTitleOffset("<<GetTitleOffset()<<");"<<endl;
-   out<<"   gaxis->SetTitleSize("<<GetTitleSize()<<");"<<endl;
-   out<<"   gaxis->SetTitleColor("<<GetTextColor()<<");"<<endl;
-   out<<"   gaxis->SetTitleFont("<<GetTextFont()<<");"<<endl;
+      <<","<<fWmin<<","<<fWmax<<","<<fNdiv<<","<<quote<<fChopt.Data()<<quote<<");"<<std::endl;
+   out<<"   gaxis->SetLabelOffset("<<GetLabelOffset()<<");"<<std::endl;
+   out<<"   gaxis->SetLabelSize("<<GetLabelSize()<<");"<<std::endl;
+   out<<"   gaxis->SetTickSize("<<GetTickSize()<<");"<<std::endl;
+   out<<"   gaxis->SetGridLength("<<GetGridLength()<<");"<<std::endl;
+   out<<"   gaxis->SetTitleOffset("<<GetTitleOffset()<<");"<<std::endl;
+   out<<"   gaxis->SetTitleSize("<<GetTitleSize()<<");"<<std::endl;
+   out<<"   gaxis->SetTitleColor("<<GetTextColor()<<");"<<std::endl;
+   out<<"   gaxis->SetTitleFont("<<GetTextFont()<<");"<<std::endl;
 
    if (strlen(GetName())) {
-      out<<"   gaxis->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      out<<"   gaxis->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
    }
    if (strlen(GetTitle())) {
-      out<<"   gaxis->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+      out<<"   gaxis->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
    }
 
    if (fLabelColor != 1) {
       if (fLabelColor > 228) {
          TColor::SaveColor(out, fLabelColor);
-         out<<"   gaxis->SetLabelColor(ci);" << endl;
+         out<<"   gaxis->SetLabelColor(ci);" << std::endl;
       } else
-         out<<"   gaxis->SetLabelColor("<<GetLabelColor()<<");"<<endl;
+         out<<"   gaxis->SetLabelColor("<<GetLabelColor()<<");"<<std::endl;
    }
    if (fLineColor != 1) {
       if (fLineColor > 228) {
          TColor::SaveColor(out, fLineColor);
-         out<<"   gaxis->SetLineColor(ci);" << endl;
+         out<<"   gaxis->SetLineColor(ci);" << std::endl;
       } else
-         out<<"   gaxis->SetLineColor("<<GetLineColor()<<");"<<endl;
+         out<<"   gaxis->SetLineColor("<<GetLineColor()<<");"<<std::endl;
    }
    if (fLineStyle != 1) {
-      out<<"   gaxis->SetLineStyle("<<GetLineStyle()<<");"<<endl;
+      out<<"   gaxis->SetLineStyle("<<GetLineStyle()<<");"<<std::endl;
    }
    if (fLineWidth != 1) {
-      out<<"   gaxis->SetLineWidth("<<GetLineWidth()<<");"<<endl;
+      out<<"   gaxis->SetLineWidth("<<GetLineWidth()<<");"<<std::endl;
    }
    if (fLabelFont != 62) {
-      out<<"   gaxis->SetLabelFont("<<GetLabelFont()<<");"<<endl;
+      out<<"   gaxis->SetLabelFont("<<GetLabelFont()<<");"<<std::endl;
    }
    if (TestBit(TAxis::kMoreLogLabels)) {
-      out<<"   gaxis->SetMoreLogLabels();"<<endl;
+      out<<"   gaxis->SetMoreLogLabels();"<<std::endl;
    }
    if (TestBit(TAxis::kNoExponent)) {
-      out<<"   gaxis->SetNoExponent();"<<endl;
+      out<<"   gaxis->SetNoExponent();"<<std::endl;
    }
 
-   out<<"   gaxis->Draw();"<<endl;
+   out<<"   gaxis->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TLatex.cxx b/graf2d/graf/src/TLatex.cxx
index 640f43e9062..f38e18ddd8f 100644
--- a/graf2d/graf/src/TLatex.cxx
+++ b/graf2d/graf/src/TLatex.cxx
@@ -1864,8 +1864,8 @@ void TLatex::PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, c
 
    fError = 0 ;
    if (CheckLatexSyntax(newText)) {
-      cout<<"\n*ERROR<TLatex>: "<<fError<<endl;
-      cout<<"==> "<<text1<<endl;
+      std::cout<<"\n*ERROR<TLatex>: "<<fError<<std::endl;
+      std::cout<<"==> "<<text1<<std::endl;
       return ;
    }
    fError = 0 ;
@@ -1895,8 +1895,8 @@ void TLatex::PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, c
    Short_t valign = fTextAlign - 10*halign;
    TextSpec_t newSpec = spec;
    if (fError != 0) {
-      cout<<"*ERROR<TLatex>: "<<fError<<endl;
-      cout<<"==> "<<text<<endl;
+      std::cout<<"*ERROR<TLatex>: "<<fError<<std::endl;
+      std::cout<<"==> "<<text<<std::endl;
    } else {
       fShow = kTRUE;
       newSpec.fSize = size;
@@ -2201,8 +2201,8 @@ Double_t TLatex::GetXsize()
    if( newText.Length() == 0) return 0;
    fError = 0 ;
    if (CheckLatexSyntax(newText)) {
-      cout<<"\n*ERROR<TLatex>: "<<fError<<endl;
-      cout<<"==> "<<GetTitle()<<endl;
+      std::cout<<"\n*ERROR<TLatex>: "<<fError<<std::endl;
+      std::cout<<"==> "<<GetTitle()<<std::endl;
       return 0;
    }
    fError = 0 ;
@@ -2226,8 +2226,8 @@ void TLatex::GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle)
    if( newText.Length() == 0) return;
    fError = 0 ;
    if (CheckLatexSyntax(newText)) {
-      cout<<"\n*ERROR<TLatex>: "<<fError<<endl;
-      cout<<"==> "<<GetTitle()<<endl;
+      std::cout<<"\n*ERROR<TLatex>: "<<fError<<std::endl;
+      std::cout<<"==> "<<GetTitle()<<std::endl;
       return;
    }
    fError = 0 ;
@@ -2275,8 +2275,8 @@ Double_t TLatex::GetYsize()
    if( newText.Length() == 0) return 0;
    fError = 0 ;
    if (CheckLatexSyntax(newText)) {
-      cout<<"\n*ERROR<TLatex>: "<<fError<<endl;
-      cout<<"==> "<<GetTitle()<<endl;
+      std::cout<<"\n*ERROR<TLatex>: "<<fError<<std::endl;
+      std::cout<<"==> "<<GetTitle()<<std::endl;
       return 0;
    }
    fError = 0 ;
@@ -2323,7 +2323,7 @@ void TLatex::Savefs(TLatexFormSize *fs)
 
 
 //______________________________________________________________________________
-void TLatex::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TLatex::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -2335,13 +2335,13 @@ void TLatex::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    TString s = GetTitle();
    s.ReplaceAll("\"","\\\"");
-   out<<"   tex = new TLatex("<<fX<<","<<fY<<","<<quote<<s.Data()<<quote<<");"<<endl;
-   if (TestBit(kTextNDC)) out<<"tex->SetNDC();"<<endl;
+   out<<"   tex = new TLatex("<<fX<<","<<fY<<","<<quote<<s.Data()<<quote<<");"<<std::endl;
+   if (TestBit(kTextNDC)) out<<"tex->SetNDC();"<<std::endl;
 
    SaveTextAttributes(out,"tex",11,0,1,62,0.05);
    SaveLineAttributes(out,"tex",1,1,1);
 
-   out<<"   tex->Draw();"<<endl;
+   out<<"   tex->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TLegend.cxx b/graf2d/graf/src/TLegend.cxx
index 95161dee0ff..f4f84762a14 100644
--- a/graf2d/graf/src/TLegend.cxx
+++ b/graf2d/graf/src/TLegend.cxx
@@ -855,14 +855,14 @@ void TLegend::RecursiveRemove(TObject *obj)
 
 
 //______________________________________________________________________________
-void TLegend::SavePrimitive(ostream &out, Option_t* )
+void TLegend::SavePrimitive(std::ostream &out, Option_t* )
 {
    /* Begin_Html
    Save this legend as C++ statements on output stream out
    to be used with the SaveAs .C option.
    End_Html */
 
-   out << "   " << endl;
+   out << "   " << std::endl;
    char quote = '"';
    if ( gROOT->ClassSaved( TLegend::Class() ) ) {
       out << "   ";
@@ -872,9 +872,9 @@ void TLegend::SavePrimitive(ostream &out, Option_t* )
    // note, we can always use NULL header, since its included in primitives
    out << "leg = new TLegend("<<GetX1NDC()<<","<<GetY1NDC()<<","
        <<GetX2NDC()<<","<<GetY2NDC()<<","
-       << "NULL" << "," <<quote<< fOption <<quote<<");" << endl;
+       << "NULL" << "," <<quote<< fOption <<quote<<");" << std::endl;
    if (fBorderSize != 4) {
-      out<<"   leg->SetBorderSize("<<fBorderSize<<");"<<endl;
+      out<<"   leg->SetBorderSize("<<fBorderSize<<");"<<std::endl;
    }
    SaveTextAttributes(out,"leg",12,0,1,42,0);
    SaveLineAttributes(out,"leg",-1,-1,-1);
@@ -884,7 +884,7 @@ void TLegend::SavePrimitive(ostream &out, Option_t* )
       TLegendEntry *entry;
       while (( entry = (TLegendEntry *)next() )) entry->SaveEntry(out,"leg");
    }
-   out << "   leg->Draw();"<<endl;
+   out << "   leg->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TLegendEntry.cxx b/graf2d/graf/src/TLegendEntry.cxx
index 1f55926b197..0cf26234285 100644
--- a/graf2d/graf/src/TLegendEntry.cxx
+++ b/graf2d/graf/src/TLegendEntry.cxx
@@ -96,24 +96,24 @@ void TLegendEntry::Copy( TObject &obj ) const
 //____________________________________________________________________________
 void TLegendEntry::Print( Option_t *) const
 {
-   // dump this TLegendEntry to cout
+   // dump this TLegendEntry to std::cout
 
    TString output;
-   cout << "TLegendEntry: Object ";
+   std::cout << "TLegendEntry: Object ";
    if ( fObject ) output = fObject->GetName();
    else output = "NULL";
-   cout << output << " Label ";
+   std::cout << output << " Label ";
    if ( fLabel ) output = fLabel.Data();
    else output = "NULL";
-   cout << output << " Option ";
+   std::cout << output << " Option ";
    if (fOption ) output = fOption.Data();
    else output = "NULL";
-   cout << output << endl;
+   std::cout << output << std::endl;
 }
 
 
 //____________________________________________________________________________
-void TLegendEntry::SaveEntry(ostream &out, const char* name )
+void TLegendEntry::SaveEntry(std::ostream &out, const char* name )
 {
    // Save this TLegendEntry as C++ statements on output stream out
    //  to be used with the SaveAs .C option
@@ -127,7 +127,7 @@ void TLegendEntry::SaveEntry(ostream &out, const char* name )
    TString objname = "NULL";
    if ( fObject ) objname = fObject->GetName();
    out << name << "->AddEntry("<<quote<<objname<<quote<<","<<quote<<
-      fLabel.Data()<<quote<<","<<quote<<fOption.Data()<<quote<<");"<<endl;
+      fLabel.Data()<<quote<<","<<quote<<fOption.Data()<<quote<<");"<<std::endl;
    SaveFillAttributes(out,"entry",0,0);
    SaveLineAttributes(out,"entry",0,0,0);
    SaveMarkerAttributes(out,"entry",0,0,0);
diff --git a/graf2d/graf/src/TLine.cxx b/graf2d/graf/src/TLine.cxx
index 49e6b37aec2..741d2ee26bb 100644
--- a/graf2d/graf/src/TLine.cxx
+++ b/graf2d/graf/src/TLine.cxx
@@ -332,7 +332,7 @@ void TLine::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TLine::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TLine::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
@@ -342,11 +342,11 @@ void TLine::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       out<<"   TLine *";
    }
    out<<"line = new TLine("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-      <<");"<<endl;
+      <<");"<<std::endl;
 
    SaveLineAttributes(out,"line",1,1,1);
 
-   out<<"   line->Draw();"<<endl;
+   out<<"   line->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TMarker.cxx b/graf2d/graf/src/TMarker.cxx
index 9a2c528ab12..da119cc1008 100644
--- a/graf2d/graf/src/TMarker.cxx
+++ b/graf2d/graf/src/TMarker.cxx
@@ -279,7 +279,7 @@ void TMarker::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TMarker::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TMarker::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -288,11 +288,11 @@ void TMarker::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    } else {
       out<<"   TMarker *";
    }
-   out<<"marker = new TMarker("<<fX<<","<<fY<<","<<fMarkerStyle<<");"<<endl;
+   out<<"marker = new TMarker("<<fX<<","<<fY<<","<<fMarkerStyle<<");"<<std::endl;
 
    SaveMarkerAttributes(out,"marker",1,1,1);
 
-   out<<"   marker->Draw();"<<endl;
+   out<<"   marker->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TPave.cxx b/graf2d/graf/src/TPave.cxx
index 6bca8fdda41..ffe456930c7 100644
--- a/graf2d/graf/src/TPave.cxx
+++ b/graf2d/graf/src/TPave.cxx
@@ -608,7 +608,7 @@ void TPave::Print(Option_t *option) const
 
 
 //______________________________________________________________________________
-void TPave::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPave::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -620,20 +620,20 @@ void TPave::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    if (fOption.Contains("NDC")) {
       out<<"pave = new TPave("<<fX1NDC<<","<<fY1NDC<<","<<fX2NDC<<","<<fY2NDC
-         <<","<<fBorderSize<<","<<quote<<fOption<<quote<<");"<<endl;
+         <<","<<fBorderSize<<","<<quote<<fOption<<quote<<");"<<std::endl;
    } else {
       out<<"pave = new TPave("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-         <<","<<fBorderSize<<","<<quote<<fOption<<quote<<");"<<endl;
+         <<","<<fBorderSize<<","<<quote<<fOption<<quote<<");"<<std::endl;
    }
    if (strcmp(GetName(),"TPave")) {
-      out<<"   pave->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      out<<"   pave->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
    }
    if (fCornerRadius) {
-      out<<"   pave->SetCornerRadius("<<fCornerRadius<<");"<<endl;
+      out<<"   pave->SetCornerRadius("<<fCornerRadius<<");"<<std::endl;
    }
    SaveFillAttributes(out,"pave",19,1001);
    SaveLineAttributes(out,"pave",1,1,1);
-   out<<"   pave->Draw();"<<endl;
+   out<<"   pave->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TPaveLabel.cxx b/graf2d/graf/src/TPaveLabel.cxx
index 201f870cbcb..c3ccb8d40ed 100644
--- a/graf2d/graf/src/TPaveLabel.cxx
+++ b/graf2d/graf/src/TPaveLabel.cxx
@@ -198,12 +198,12 @@ void TPaveLabel::PaintPaveLabel(Double_t x1, Double_t y1,Double_t x2, Double_t
 
 
 //______________________________________________________________________________
-void TPaveLabel::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPaveLabel::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPaveLabel::Class())) {
       out<<"   ";
    } else {
@@ -213,17 +213,17 @@ void TPaveLabel::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    s.ReplaceAll("\"","\\\"");
    if (fOption.Contains("NDC")) {
       out<<"pl = new TPaveLabel("<<fX1NDC<<","<<fY1NDC<<","<<fX2NDC<<","<<fY2NDC
-         <<","<<quote<<s.Data()<<quote<<","<<quote<<fOption<<quote<<");"<<endl;
+         <<","<<quote<<s.Data()<<quote<<","<<quote<<fOption<<quote<<");"<<std::endl;
    } else {
       out<<"pl = new TPaveLabel("<<gPad->PadtoX(fX1)<<","<<gPad->PadtoY(fY1)<<","<<gPad->PadtoX(fX2)<<","<<gPad->PadtoY(fY2)
-         <<","<<quote<<s.Data()<<quote<<","<<quote<<fOption<<quote<<");"<<endl;
+         <<","<<quote<<s.Data()<<quote<<","<<quote<<fOption<<quote<<");"<<std::endl;
    }
    if (fBorderSize != 3) {
-      out<<"   pl->SetBorderSize("<<fBorderSize<<");"<<endl;
+      out<<"   pl->SetBorderSize("<<fBorderSize<<");"<<std::endl;
    }
    SaveFillAttributes(out,"pl",19,1001);
    SaveLineAttributes(out,"pl",1,1,1);
    SaveTextAttributes(out,"pl",22,0,1,62,0);
 
-   out<<"   pl->Draw();"<<endl;
+   out<<"   pl->Draw();"<<std::endl;
 }
diff --git a/graf2d/graf/src/TPaveStats.cxx b/graf2d/graf/src/TPaveStats.cxx
index e50d4bfc984..5cc12d88cdc 100644
--- a/graf2d/graf/src/TPaveStats.cxx
+++ b/graf2d/graf/src/TPaveStats.cxx
@@ -513,14 +513,14 @@ void TPaveStats::Paint(Option_t *option)
 
 
 //______________________________________________________________________________
-void TPaveStats::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPaveStats::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    /* Begin_Html
    Save primitive as a C++ statement(s) on output stream out.
    End_Html */
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPaveStats::Class())) {
       out<<"   ";
    } else {
@@ -528,24 +528,24 @@ void TPaveStats::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    if (fOption.Contains("NDC")) {
       out<<"ptstats = new "<<ClassName()<<"("<<fX1NDC<<","<<fY1NDC<<","<<fX2NDC<<","<<fY2NDC
-      <<","<<quote<<fOption<<quote<<");"<<endl;
+      <<","<<quote<<fOption<<quote<<");"<<std::endl;
    } else {
       out<<"ptstats = new "<<ClassName()<<"("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-      <<","<<quote<<fOption<<quote<<");"<<endl;
+      <<","<<quote<<fOption<<quote<<");"<<std::endl;
    }
    if (strcmp(GetName(),"TPave")) {
-      out<<"   ptstats->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      out<<"   ptstats->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
    }
    if (fBorderSize != 4) {
-      out<<"   ptstats->SetBorderSize("<<fBorderSize<<");"<<endl;
+      out<<"   ptstats->SetBorderSize("<<fBorderSize<<");"<<std::endl;
    }
    SaveFillAttributes(out,"ptstats",19,1001);
    SaveLineAttributes(out,"ptstats",1,1,1);
    SaveTextAttributes(out,"ptstats",22,0,1,62,0);
    SaveLines(out,"ptstats");
-   out<<"   ptstats->SetOptStat("<<GetOptStat()<<");"<<endl;
-   out<<"   ptstats->SetOptFit("<<GetOptFit()<<");"<<endl;
-   out<<"   ptstats->Draw();"<<endl;
+   out<<"   ptstats->SetOptStat("<<GetOptStat()<<");"<<std::endl;
+   out<<"   ptstats->SetOptFit("<<GetOptFit()<<");"<<std::endl;
+   out<<"   ptstats->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TPaveText.cxx b/graf2d/graf/src/TPaveText.cxx
index 4b628982cd7..73153905dd1 100644
--- a/graf2d/graf/src/TPaveText.cxx
+++ b/graf2d/graf/src/TPaveText.cxx
@@ -607,7 +607,7 @@ void TPaveText::ReadFile(const char *filename, Option_t *option, Int_t nlines, I
    char *fname = StrDup(filename);
    if (fname[nch-1] == ';') { nch--; fname[nch]=0;}
 
-   ifstream file(fname,ios::in);
+   std::ifstream file(fname,std::ios::in);
    if (!file.good()) {
       Error("ReadFile", "illegal file name");
       delete [] fname;
@@ -667,7 +667,7 @@ void TPaveText::ReadFile(const char *filename, Option_t *option, Int_t nlines, I
 
 
 //______________________________________________________________________________
-void TPaveText::SaveLines(ostream &out, const char *name)
+void TPaveText::SaveLines(std::ostream &out, const char *name)
 {
    // Save lines of this pavetext as C++ statements on output stream out
 
@@ -693,19 +693,19 @@ void TPaveText::SaveLines(ostream &out, const char *name)
             out<<"   TLine *";
          }
          out<<"line = "<<name<<"->AddLine("
-            <<linel->GetX1()<<","<<linel->GetY1()<<","<<linel->GetX2()<<","<<linel->GetY2()<<");"<<endl;
+            <<linel->GetX1()<<","<<linel->GetY1()<<","<<linel->GetX2()<<","<<linel->GetY2()<<");"<<std::endl;
          if (linel->GetLineColor() != 1) {
             if (linel->GetLineColor() > 228) {
                TColor::SaveColor(out, linel->GetLineColor());
-               out<<"   line->SetLineColor(ci);" << endl;
+               out<<"   line->SetLineColor(ci);" << std::endl;
             } else
-               out<<"   line->SetLineColor("<<linel->GetLineColor()<<");"<<endl;
+               out<<"   line->SetLineColor("<<linel->GetLineColor()<<");"<<std::endl;
          }
          if (linel->GetLineStyle() != 1) {
-            out<<"   line->SetLineStyle("<<linel->GetLineStyle()<<");"<<endl;
+            out<<"   line->SetLineStyle("<<linel->GetLineStyle()<<");"<<std::endl;
          }
          if (linel->GetLineWidth() != 1) {
-            out<<"   line->SetLineWidth("<<linel->GetLineWidth()<<");"<<endl;
+            out<<"   line->SetLineWidth("<<linel->GetLineWidth()<<");"<<std::endl;
          }
          continue;
       }
@@ -718,29 +718,29 @@ void TPaveText::SaveLines(ostream &out, const char *name)
             out<<"   TBox *";
          }
          out<<"box = "<<name<<"->AddBox("
-            <<lineb->GetX1()<<","<<lineb->GetY1()<<","<<lineb->GetX2()<<","<<lineb->GetY2()<<");"<<endl;
+            <<lineb->GetX1()<<","<<lineb->GetY1()<<","<<lineb->GetX2()<<","<<lineb->GetY2()<<");"<<std::endl;
          if (lineb->GetFillColor() != 18) {
             if (lineb->GetFillColor() > 228) {
                TColor::SaveColor(out, lineb->GetFillColor());
-               out<<"   box->SetFillColor(ci);" << endl;
+               out<<"   box->SetFillColor(ci);" << std::endl;
             } else
-               out<<"   box->SetFillColor("<<lineb->GetFillColor()<<");"<<endl;
+               out<<"   box->SetFillColor("<<lineb->GetFillColor()<<");"<<std::endl;
          }
          if (lineb->GetFillStyle() != 1001) {
-            out<<"   box->SetFillStyle("<<lineb->GetFillStyle()<<");"<<endl;
+            out<<"   box->SetFillStyle("<<lineb->GetFillStyle()<<");"<<std::endl;
          }
          if (lineb->GetLineColor() != 1) {
             if (lineb->GetLineColor() > 228) {
                TColor::SaveColor(out, lineb->GetLineColor());
-               out<<"   box->SetLineColor(ci);" << endl;
+               out<<"   box->SetLineColor(ci);" << std::endl;
             } else
-               out<<"   box->SetLineColor("<<lineb->GetLineColor()<<");"<<endl;
+               out<<"   box->SetLineColor("<<lineb->GetLineColor()<<");"<<std::endl;
          }
          if (lineb->GetLineStyle() != 1) {
-            out<<"   box->SetLineStyle("<<lineb->GetLineStyle()<<");"<<endl;
+            out<<"   box->SetLineStyle("<<lineb->GetLineStyle()<<");"<<std::endl;
          }
          if (lineb->GetLineWidth() != 1) {
-            out<<"   box->SetLineWidth("<<lineb->GetLineWidth()<<");"<<endl;
+            out<<"   box->SetLineWidth("<<lineb->GetLineWidth()<<");"<<std::endl;
          }
          continue;
       }
@@ -756,29 +756,29 @@ void TPaveText::SaveLines(ostream &out, const char *name)
             TString s = linet->GetTitle();
             s.ReplaceAll("\"","\\\"");
             out<<"text = "<<name<<"->AddText("
-               <<quote<<s.Data()<<quote<<");"<<endl;
+               <<quote<<s.Data()<<quote<<");"<<std::endl;
          } else {
             out<<"text = "<<name<<"->AddText("
-               <<linet->GetX()<<","<<linet->GetY()<<","<<quote<<linet->GetTitle()<<quote<<");"<<endl;
+               <<linet->GetX()<<","<<linet->GetY()<<","<<quote<<linet->GetTitle()<<quote<<");"<<std::endl;
          }
          if (linet->GetTextColor()) {
             if (linet->GetTextColor() > 228) {
                TColor::SaveColor(out, linet->GetTextColor());
-               out<<"   text->SetTextColor(ci);" << endl;
+               out<<"   text->SetTextColor(ci);" << std::endl;
             } else
-               out<<"   text->SetTextColor("<<linet->GetTextColor()<<");"<<endl;
+               out<<"   text->SetTextColor("<<linet->GetTextColor()<<");"<<std::endl;
          }
          if (linet->GetTextFont()) {
-            out<<"   text->SetTextFont("<<linet->GetTextFont()<<");"<<endl;
+            out<<"   text->SetTextFont("<<linet->GetTextFont()<<");"<<std::endl;
          }
          if (linet->GetTextSize()) {
-            out<<"   text->SetTextSize("<<linet->GetTextSize()<<");"<<endl;
+            out<<"   text->SetTextSize("<<linet->GetTextSize()<<");"<<std::endl;
          }
          if (linet->GetTextAngle() != GetTextAngle()) {
-            out<<"   text->SetTextAngle("<<linet->GetTextAngle()<<");"<<endl;
+            out<<"   text->SetTextAngle("<<linet->GetTextAngle()<<");"<<std::endl;
          }
          if (linet->GetTextAlign()) {
-            out<<"   text->SetTextAlign("<<linet->GetTextAlign()<<");"<<endl;
+            out<<"   text->SetTextAlign("<<linet->GetTextAlign()<<");"<<std::endl;
          }
       }
    // Next primitive is a Latex text
@@ -793,29 +793,29 @@ void TPaveText::SaveLines(ostream &out, const char *name)
             TString sl = latex->GetTitle();
             sl.ReplaceAll("\"","\\\"");
             out<<"text = "<<name<<"->AddText("
-               <<quote<<sl.Data()<<quote<<");"<<endl;
+               <<quote<<sl.Data()<<quote<<");"<<std::endl;
          } else {
             out<<"text = "<<name<<"->AddText("
-               <<latex->GetX()<<","<<latex->GetY()<<","<<quote<<latex->GetTitle()<<quote<<");"<<endl;
+               <<latex->GetX()<<","<<latex->GetY()<<","<<quote<<latex->GetTitle()<<quote<<");"<<std::endl;
          }
          if (latex->GetTextColor()) {
             if (latex->GetTextColor() > 228) {
                TColor::SaveColor(out, latex->GetTextColor());
-               out<<"   text->SetTextColor(ci);" << endl;
+               out<<"   text->SetTextColor(ci);" << std::endl;
             } else
-               out<<"   text->SetTextColor("<<latex->GetTextColor()<<");"<<endl;
+               out<<"   text->SetTextColor("<<latex->GetTextColor()<<");"<<std::endl;
          }
          if (latex->GetTextFont()) {
-            out<<"   text->SetTextFont("<<latex->GetTextFont()<<");"<<endl;
+            out<<"   text->SetTextFont("<<latex->GetTextFont()<<");"<<std::endl;
          }
          if (latex->GetTextSize()) {
-            out<<"   text->SetTextSize("<<latex->GetTextSize()<<");"<<endl;
+            out<<"   text->SetTextSize("<<latex->GetTextSize()<<");"<<std::endl;
          }
          if (latex->GetTextAngle() != GetTextAngle()) {
-            out<<"   text->SetTextAngle("<<latex->GetTextAngle()<<");"<<endl;
+            out<<"   text->SetTextAngle("<<latex->GetTextAngle()<<");"<<std::endl;
          }
          if (latex->GetTextAlign()) {
-            out<<"   text->SetTextAlign("<<latex->GetTextAlign()<<");"<<endl;
+            out<<"   text->SetTextAlign("<<latex->GetTextAlign()<<");"<<std::endl;
          }
       }
    }
@@ -823,12 +823,12 @@ void TPaveText::SaveLines(ostream &out, const char *name)
 
 
 //______________________________________________________________________________
-void TPaveText::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPaveText::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPaveText::Class())) {
       out<<"   ";
    } else {
@@ -836,25 +836,25 @@ void TPaveText::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    if (fOption.Contains("NDC")) {
       out<<"pt = new "<<ClassName()<<"("<<fX1NDC<<","<<fY1NDC<<","<<fX2NDC<<","<<fY2NDC
-      <<","<<quote<<fOption<<quote<<");"<<endl;
+      <<","<<quote<<fOption<<quote<<");"<<std::endl;
    } else {
       out<<"pt = new "<<ClassName()<<"("<<gPad->PadtoX(fX1)<<","<<gPad->PadtoY(fY1)<<","<<gPad->PadtoX(fX2)<<","<<gPad->PadtoY(fY2)
-      <<","<<quote<<fOption<<quote<<");"<<endl;
+      <<","<<quote<<fOption<<quote<<");"<<std::endl;
    }
    if (strcmp(GetName(),"TPave")) {
-      out<<"   pt->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      out<<"   pt->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
    }
    if (fLabel.Length() > 0) {
-      out<<"   pt->SetLabel("<<quote<<fLabel<<quote<<");"<<endl;
+      out<<"   pt->SetLabel("<<quote<<fLabel<<quote<<");"<<std::endl;
    }
    if (fBorderSize != 4) {
-      out<<"   pt->SetBorderSize("<<fBorderSize<<");"<<endl;
+      out<<"   pt->SetBorderSize("<<fBorderSize<<");"<<std::endl;
    }
    SaveFillAttributes(out,"pt",19,1001);
    SaveLineAttributes(out,"pt",1,1,1);
    SaveTextAttributes(out,"pt",22,0,1,62,0);
    SaveLines(out,"pt");
-   out<<"   pt->Draw();"<<endl;
+   out<<"   pt->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TPavesText.cxx b/graf2d/graf/src/TPavesText.cxx
index a4bec415224..e04d988bdf7 100644
--- a/graf2d/graf/src/TPavesText.cxx
+++ b/graf2d/graf/src/TPavesText.cxx
@@ -126,34 +126,34 @@ void TPavesText::Paint(Option_t *option)
 
 
 //______________________________________________________________________________
-void TPavesText::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPavesText::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    if (!strcmp(GetName(),"stats")) return;
    if (!strcmp(GetName(),"title")) return;
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPavesText::Class())) {
       out<<"   ";
    } else {
       out<<"   TPavesText *";
    }
    out<<"pst = new TPavesText("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
-      <<","<<fNpaves<<","<<quote<<fOption<<quote<<");"<<endl;
+      <<","<<fNpaves<<","<<quote<<fOption<<quote<<");"<<std::endl;
 
    if (strcmp(GetName(),"TPave")) {
-      out<<"   pst->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      out<<"   pst->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
    }
    if (fLabel.Length() > 0) {
-      out<<"   pst->SetLabel("<<quote<<fLabel<<quote<<");"<<endl;
+      out<<"   pst->SetLabel("<<quote<<fLabel<<quote<<");"<<std::endl;
    }
    if (fBorderSize != 4) {
-      out<<"   pst->SetBorderSize("<<fBorderSize<<");"<<endl;
+      out<<"   pst->SetBorderSize("<<fBorderSize<<");"<<std::endl;
    }
    SaveFillAttributes(out,"pst",0,1001);
    SaveLineAttributes(out,"pst",1,1,1);
    SaveTextAttributes(out,"pst",22,0,1,62,0);
    TPaveText::SaveLines(out,"pst");
-   out<<"   pst->Draw();"<<endl;
+   out<<"   pst->Draw();"<<std::endl;
 }
diff --git a/graf2d/graf/src/TPie.cxx b/graf2d/graf/src/TPie.cxx
index a2a73823218..92e055dfc64 100644
--- a/graf2d/graf/src/TPie.cxx
+++ b/graf2d/graf/src/TPie.cxx
@@ -1131,57 +1131,57 @@ void TPie::Paint(Option_t *option)
 
 
 //______________________________________________________________________________
-void TPie::SavePrimitive(ostream &out, Option_t *option)
+void TPie::SavePrimitive(std::ostream &out, Option_t *option)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
-   out << "   " << endl;
+   out << "   " << std::endl;
    if (gROOT->ClassSaved(TPie::Class())) {
       out << "   ";
    } else {
       out << "   TPie *";
    }
    out << GetName() << " = new TPie(\"" << GetName() << "\", \"" << GetTitle()
-       << "\", " << fNvals << ");" << endl;
+       << "\", " << fNvals << ");" << std::endl;
    out << "   " << GetName() << "->SetCircle(" << fX << ", " << fY << ", "
-       << fRadius << ");" << endl;
+       << fRadius << ");" << std::endl;
    out << "   " << GetName() << "->SetValueFormat(\"" << GetValueFormat()
-       << "\");" << endl;
+       << "\");" << std::endl;
    out << "   " << GetName() << "->SetLabelFormat(\"" << GetLabelFormat()
-       << "\");" << endl;
+       << "\");" << std::endl;
    out << "   " << GetName() << "->SetPercentFormat(\"" << GetPercentFormat()
-       << "\");" << endl;
+       << "\");" << std::endl;
    out << "   " << GetName() << "->SetLabelsOffset(" << GetLabelsOffset()
-       << ");" << endl;
+       << ");" << std::endl;
    out << "   " << GetName() << "->SetAngularOffset(" << GetAngularOffset()
-       << ");" << endl;
-   out << "   " << GetName() << "->SetTextAngle(" << GetTextAngle() << ");" << endl;
-   out << "   " << GetName() << "->SetTextColor(" << GetTextColor() << ");" << endl;
-   out << "   " << GetName() << "->SetTextFont(" << GetTextFont() << ");" << endl;
-   out << "   " << GetName() << "->SetTextSize(" << GetTextSize() << ");" << endl;
+       << ");" << std::endl;
+   out << "   " << GetName() << "->SetTextAngle(" << GetTextAngle() << ");" << std::endl;
+   out << "   " << GetName() << "->SetTextColor(" << GetTextColor() << ");" << std::endl;
+   out << "   " << GetName() << "->SetTextFont(" << GetTextFont() << ");" << std::endl;
+   out << "   " << GetName() << "->SetTextSize(" << GetTextSize() << ");" << std::endl;
 
 
    // Save the values for the slices
    for (Int_t i=0;i<fNvals;++i) {
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetTitle(\""
-          << fPieSlices[i]->GetTitle() << "\");" << endl;
+          << fPieSlices[i]->GetTitle() << "\");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetValue("
-          << fPieSlices[i]->GetValue() << ");" << endl;
+          << fPieSlices[i]->GetValue() << ");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetRadiusOffset("
-          << fPieSlices[i]->GetRadiusOffset() << ");" << endl;
+          << fPieSlices[i]->GetRadiusOffset() << ");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetFillColor("
-          << fPieSlices[i]->GetFillColor() << ");" << endl;
+          << fPieSlices[i]->GetFillColor() << ");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetFillStyle("
-          << fPieSlices[i]->GetFillStyle() << ");" << endl;
+          << fPieSlices[i]->GetFillStyle() << ");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetLineColor("
-          << fPieSlices[i]->GetLineColor() << ");" << endl;
+          << fPieSlices[i]->GetLineColor() << ");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetLineStyle("
-          << fPieSlices[i]->GetLineStyle() << ");" << endl;
+          << fPieSlices[i]->GetLineStyle() << ");" << std::endl;
       out << "   " << GetName() << "->GetSlice(" << i << ")->SetLineWidth("
-          << fPieSlices[i]->GetLineWidth() << ");" << endl;
+          << fPieSlices[i]->GetLineWidth() << ");" << std::endl;
    }
 
-   out << "   " << GetName() << "->Draw(\"" << option << "\");" << endl;
+   out << "   " << GetName() << "->Draw(\"" << option << "\");" << std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TPieSlice.cxx b/graf2d/graf/src/TPieSlice.cxx
index 310287a28e6..e69a4143102 100644
--- a/graf2d/graf/src/TPieSlice.cxx
+++ b/graf2d/graf/src/TPieSlice.cxx
@@ -92,7 +92,7 @@ Double_t TPieSlice::GetValue()
 
 
 //______________________________________________________________________________
-void TPieSlice::SavePrimitive(ostream &/*out*/, Option_t * /*opts*/)
+void TPieSlice::SavePrimitive(std::ostream &/*out*/, Option_t * /*opts*/)
 {
    // Do nothing.
 }
diff --git a/graf2d/graf/src/TPolyLine.cxx b/graf2d/graf/src/TPolyLine.cxx
index 21cb87b1a07..db3607a1c07 100644
--- a/graf2d/graf/src/TPolyLine.cxx
+++ b/graf2d/graf/src/TPolyLine.cxx
@@ -560,28 +560,28 @@ void TPolyLine::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TPolyLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TPolyLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
-   out<<"   Double_t *dum = 0;"<<endl;
+   out<<"   "<<std::endl;
+   out<<"   Double_t *dum = 0;"<<std::endl;
    if (gROOT->ClassSaved(TPolyLine::Class())) {
       out<<"   ";
    } else {
       out<<"   TPolyLine *";
    }
-   out<<"pline = new TPolyLine("<<fN<<",dum,dum,"<<quote<<fOption<<quote<<");"<<endl;
+   out<<"pline = new TPolyLine("<<fN<<",dum,dum,"<<quote<<fOption<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"pline",0,1001);
    SaveLineAttributes(out,"pline",1,1,1);
 
    for (Int_t i=0;i<Size();i++) {
-      out<<"   pline->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<endl;
+      out<<"   pline->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<std::endl;
    }
    out<<"   pline->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TText.cxx b/graf2d/graf/src/TText.cxx
index af20d3e32a9..246a86f048e 100644
--- a/graf2d/graf/src/TText.cxx
+++ b/graf2d/graf/src/TText.cxx
@@ -608,7 +608,7 @@ void TText::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TText::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TText::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -620,12 +620,12 @@ void TText::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    TString s = GetTitle();
    s.ReplaceAll("\"","\\\"");
-   out<<"text = new TText("<<fX<<","<<fY<<","<<quote<<s.Data()<<quote<<");"<<endl;
-   if (TestBit(kTextNDC)) out<<"   text->SetNDC();"<<endl;
+   out<<"text = new TText("<<fX<<","<<fY<<","<<quote<<s.Data()<<quote<<");"<<std::endl;
+   if (TestBit(kTextNDC)) out<<"   text->SetNDC();"<<std::endl;
 
    SaveTextAttributes(out,"text",11,0,1,62,0.05);
 
-   out<<"   text->Draw();"<<endl;
+   out<<"   text->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/graf/src/TWbox.cxx b/graf2d/graf/src/TWbox.cxx
index 1c416b8ed8d..0095d57f987 100644
--- a/graf2d/graf/src/TWbox.cxx
+++ b/graf2d/graf/src/TWbox.cxx
@@ -219,7 +219,7 @@ void TWbox::PaintFrame(Double_t x1, Double_t y1,Double_t x2, Double_t  y2,
 
 
 //______________________________________________________________________________
-void TWbox::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TWbox::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -228,10 +228,10 @@ void TWbox::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    } else {
       out<<"   TWbox *";
    }
-   out<<"wbox = new TWbox("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<endl;
+   out<<"wbox = new TWbox("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<std::endl;
 
    SaveFillAttributes(out,"wbox",0,1001);
    SaveLineAttributes(out,"wbox",1,1,1);
 
-   out<<"   wbox->Draw();"<<endl;
+   out<<"   wbox->Draw();"<<std::endl;
 }
diff --git a/graf2d/gviz/inc/TGraphEdge.h b/graf2d/gviz/inc/TGraphEdge.h
index 26764f3450f..0253ebdc9d7 100644
--- a/graf2d/gviz/inc/TGraphEdge.h
+++ b/graf2d/gviz/inc/TGraphEdge.h
@@ -63,8 +63,8 @@ public:
    TGraphNode    *GetNode2() {return fNode2;}
    void           Layout();            
    virtual void   Paint(Option_t *option="");
-   virtual void   SavePrimitive(ostream &, Option_t *);
-   void           SaveAttributes(ostream &, const char*);                  
+   virtual void   SavePrimitive(std::ostream &, Option_t *);
+   void           SaveAttributes(std::ostream &, const char*);                  
 
 
    ClassDef(TGraphEdge,1)  //Graph edge class
diff --git a/graf2d/gviz/inc/TGraphNode.h b/graf2d/gviz/inc/TGraphNode.h
index def3d9bb837..1d9691e46dd 100644
--- a/graf2d/gviz/inc/TGraphNode.h
+++ b/graf2d/gviz/inc/TGraphNode.h
@@ -65,8 +65,8 @@ public:
    Agnode_t      *GetGVNode() {return fGVNode;}
    void           Layout();
    virtual void   Paint(Option_t *option="");   
-   virtual void   SavePrimitive(ostream &, Option_t *);                 
-   void           SaveAttributes(ostream &);                 
+   virtual void   SavePrimitive(std::ostream &, Option_t *);                 
+   void           SaveAttributes(std::ostream &);                 
 
    ClassDef(TGraphNode,1)  //Graph node class
 };
diff --git a/graf2d/gviz/inc/TGraphStruct.h b/graf2d/gviz/inc/TGraphStruct.h
index e3da3256f20..bddc09939e9 100644
--- a/graf2d/gviz/inc/TGraphStruct.h
+++ b/graf2d/gviz/inc/TGraphStruct.h
@@ -61,7 +61,7 @@ public:
    TList       *GetListOfNodes() const { return fNodes; }
    TList       *GetListOfEdges() const { return fEdges; }
    Int_t        Layout();
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
    void         SetMargin(Double_t m=10) {fMargin = m;}
 
    ClassDef(TGraphStruct,1)  //Graph structure class
diff --git a/graf2d/gviz/src/TGraphEdge.cxx b/graf2d/gviz/src/TGraphEdge.cxx
index 4b0ee16cda6..0c309213c45 100644
--- a/graf2d/gviz/src/TGraphEdge.cxx
+++ b/graf2d/gviz/src/TGraphEdge.cxx
@@ -206,13 +206,13 @@ void TGraphEdge::Paint(Option_t *)
 
 
 //______________________________________________________________________________
-void TGraphEdge::SavePrimitive(ostream &, Option_t *)
+void TGraphEdge::SavePrimitive(std::ostream &, Option_t *)
 {
    // Save primitive as a C++ statement(s) on output stream out   
 }
 
 //______________________________________________________________________________
-void TGraphEdge::SaveAttributes(ostream &out, const char* name)
+void TGraphEdge::SaveAttributes(std::ostream &out, const char* name)
 {
    // Save attributes as a C++ statement(s) on output stream out
    // called by TGraphStruct::SavePrimitive.
diff --git a/graf2d/gviz/src/TGraphNode.cxx b/graf2d/gviz/src/TGraphNode.cxx
index 7717b3451da..a7f93756709 100644
--- a/graf2d/gviz/src/TGraphNode.cxx
+++ b/graf2d/gviz/src/TGraphNode.cxx
@@ -147,14 +147,14 @@ void TGraphNode::Paint(Option_t *)
 
 
 //______________________________________________________________________________
-void TGraphNode::SavePrimitive(ostream &, Option_t *)
+void TGraphNode::SavePrimitive(std::ostream &, Option_t *)
 {
    // Save primitive as a C++ statement(s) on output stream out
 }
 
 
 //______________________________________________________________________________
-void TGraphNode::SaveAttributes(ostream &out)
+void TGraphNode::SaveAttributes(std::ostream &out)
 {
    // Save attributes as a C++ statement(s) on output stream out
    // called by TGraphStruct::SavePrimitive.
diff --git a/graf2d/gviz/src/TGraphStruct.cxx b/graf2d/gviz/src/TGraphStruct.cxx
index 047d5dbbddd..f7d35ca959a 100644
--- a/graf2d/gviz/src/TGraphStruct.cxx
+++ b/graf2d/gviz/src/TGraphStruct.cxx
@@ -277,11 +277,11 @@ Int_t TGraphStruct::Layout()
 
 
 //______________________________________________________________________________
-void TGraphStruct::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGraphStruct::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
-   out<<"   TGraphStruct *graphstruct = new  TGraphStruct();"<<endl;
+   out<<"   TGraphStruct *graphstruct = new  TGraphStruct();"<<std::endl;
 
    // Save the nodes
    if (fNodes) {
@@ -289,14 +289,14 @@ void TGraphStruct::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       node = (TGraphNode*) fNodes->First();
       out<<"   TGraphNode *"<<node->GetName()<<" = graphstruct->AddNode(\""<<
                             node->GetName()<<"\",\""<<
-                            node->GetTitle()<<"\");"<<endl;
+                            node->GetTitle()<<"\");"<<std::endl;
       node->SaveAttributes(out);
       for(Int_t i = 1; i < fNodes->GetSize(); i++){
          node = (TGraphNode*)fNodes->After(node);
          if (node) {
             out<<"   TGraphNode *"<<node->GetName()<<" = graphstruct->AddNode(\""<<
                                   node->GetName()<<"\",\""<<
-                                  node->GetTitle()<<"\");"<<endl;
+                                  node->GetTitle()<<"\");"<<std::endl;
             node->SaveAttributes(out);
          }
       }
@@ -310,8 +310,8 @@ void TGraphStruct::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       out<<"   TGraphEdge *"<<"e"<<en<<
                             " = new TGraphEdge("<<
                             edge->GetNode1()->GetName()<<","<<
-                            edge->GetNode2()->GetName()<<");"<<endl;
-      out<<"   graphstruct->AddEdge("<<"e"<<en<<");"<<endl;
+                            edge->GetNode2()->GetName()<<");"<<std::endl;
+      out<<"   graphstruct->AddEdge("<<"e"<<en<<");"<<std::endl;
       edge->SaveAttributes(out,Form("e%d",en));
       for(Int_t i = 1; i < fEdges->GetSize(); i++){
          en++;
@@ -320,14 +320,14 @@ void TGraphStruct::SavePrimitive(ostream &out, Option_t * /*= ""*/)
             out<<"   TGraphEdge *"<<"e"<<en<<
                                   " = new TGraphEdge("<<
                                   edge->GetNode1()->GetName()<<","<<
-                                  edge->GetNode2()->GetName()<<");"<<endl;
-            out<<"   graphstruct->AddEdge("<<"e"<<en<<");"<<endl;
+                                  edge->GetNode2()->GetName()<<");"<<std::endl;
+            out<<"   graphstruct->AddEdge("<<"e"<<en<<");"<<std::endl;
             edge->SaveAttributes(out,Form("e%d",en));
          }
       }
    }
 
-   out<<"   graphstruct->Draw();"<<endl;
+   out<<"   graphstruct->Draw();"<<std::endl;
 }
 
 
diff --git a/graf2d/postscript/src/TPDF.cxx b/graf2d/postscript/src/TPDF.cxx
index 4b9ba3a4875..8f1d77a6d45 100644
--- a/graf2d/postscript/src/TPDF.cxx
+++ b/graf2d/postscript/src/TPDF.cxx
@@ -1345,11 +1345,11 @@ void TPDF::Open(const char *fname, Int_t wtype)
    }
 
    // Open OS file
-   fStream = new ofstream();
+   fStream = new std::ofstream();
 #ifdef R__WIN32
-      fStream->open(fname, ofstream::out | ofstream::binary);
+      fStream->open(fname, std::ofstream::out | std::ofstream::binary);
 #else
-      fStream->open(fname, ofstream::out);
+      fStream->open(fname, std::ofstream::out);
 #endif
    if (fStream == 0 || !fStream->good()) {
       printf("ERROR in TPDF::Open: Cannot open file:%s\n",fname);
diff --git a/graf2d/postscript/src/TPostScript.cxx b/graf2d/postscript/src/TPostScript.cxx
index 6406c86efcf..9ee88c556d5 100644
--- a/graf2d/postscript/src/TPostScript.cxx
+++ b/graf2d/postscript/src/TPostScript.cxx
@@ -387,7 +387,7 @@ void TPostScript::Open(const char *fname, Int_t wtype)
    }
 
    // open OS file
-   fStream = new ofstream(fname,ios::out);
+   fStream = new std::ofstream(fname,std::ios::out);
    if (fStream == 0 || gSystem->AccessPathName(fname,kWritePermission)) {
       printf("ERROR in TPostScript::Open: Cannot open file:%s\n",fname);
       return;
diff --git a/graf2d/postscript/src/TSVG.cxx b/graf2d/postscript/src/TSVG.cxx
index 9b8ba616367..4f6c2448472 100644
--- a/graf2d/postscript/src/TSVG.cxx
+++ b/graf2d/postscript/src/TSVG.cxx
@@ -132,7 +132,7 @@ void TSVG::Open(const char *fname, Int_t wtype)
    }
 
    // Open OS file
-   fStream   = new ofstream(fname,ios::out);
+   fStream   = new std::ofstream(fname,std::ios::out);
    if (fStream == 0 || !fStream->good()) {
       printf("ERROR in TSVG::Open: Cannot open file:%s\n",fname);
       if (fStream == 0) return;
diff --git a/graf3d/eve/inc/TEveElement.h b/graf3d/eve/inc/TEveElement.h
index eedb09bded5..1b0760f0c18 100644
--- a/graf3d/eve/inc/TEveElement.h
+++ b/graf3d/eve/inc/TEveElement.h
@@ -139,8 +139,8 @@ public:
    virtual void PropagateVizParamsToElements(TEveElement* el=0);
    virtual void CopyVizParams(const TEveElement* el);
    virtual void CopyVizParamsFromDB();
-   void         SaveVizParams (ostream& out, const TString& tag, const TString& var);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   void         SaveVizParams (std::ostream& out, const TString& tag, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    TEveElement*  GetMaster();
    TEveCompound* GetCompound()                { return fCompound; }
diff --git a/graf3d/eve/inc/TEveLine.h b/graf3d/eve/inc/TEveLine.h
index 177a8b79a00..6c80ab4cc95 100644
--- a/graf3d/eve/inc/TEveLine.h
+++ b/graf3d/eve/inc/TEveLine.h
@@ -64,7 +64,7 @@ public:
    virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
 
    virtual void CopyVizParams(const TEveElement* el);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    virtual TClass* ProjectedClass(const TEveProjection* p) const;
 
diff --git a/graf3d/eve/inc/TEvePointSet.h b/graf3d/eve/inc/TEvePointSet.h
index 3a6629ef823..bbe69d52e0c 100644
--- a/graf3d/eve/inc/TEvePointSet.h
+++ b/graf3d/eve/inc/TEvePointSet.h
@@ -92,7 +92,7 @@ public:
    virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
 
    virtual void CopyVizParams(const TEveElement* el);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    virtual TClass* ProjectedClass(const TEveProjection* p) const;
 
diff --git a/graf3d/eve/inc/TEveShape.h b/graf3d/eve/inc/TEveShape.h
index e0079048fef..33f51213fbd 100644
--- a/graf3d/eve/inc/TEveShape.h
+++ b/graf3d/eve/inc/TEveShape.h
@@ -66,7 +66,7 @@ public:
    // ----------------------------------------------------------------
 
    virtual void CopyVizParams(const TEveElement* el);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    // ----------------------------------------------------------------
 
diff --git a/graf3d/eve/inc/TEveStraightLineSet.h b/graf3d/eve/inc/TEveStraightLineSet.h
index 26d71758496..103b9d4e273 100644
--- a/graf3d/eve/inc/TEveStraightLineSet.h
+++ b/graf3d/eve/inc/TEveStraightLineSet.h
@@ -112,7 +112,7 @@ public:
    virtual void SetDepthTest(Bool_t x)  { fDepthTest   = x; }
    
    virtual void CopyVizParams(const TEveElement* el);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    virtual TClass* ProjectedClass(const TEveProjection* p) const;
 
diff --git a/graf3d/eve/inc/TEveTrack.h b/graf3d/eve/inc/TEveTrack.h
index 10cb4770b01..c9af024c8eb 100644
--- a/graf3d/eve/inc/TEveTrack.h
+++ b/graf3d/eve/inc/TEveTrack.h
@@ -119,7 +119,7 @@ public:
    virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
 
    virtual void CopyVizParams(const TEveElement* el);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    virtual TClass* ProjectedClass(const TEveProjection* p) const;
 
@@ -224,7 +224,7 @@ public:
    TEveTrack* FindTrackByIndex(Int_t index); // *MENU*
 
    virtual void CopyVizParams(const TEveElement* el);
-   virtual void WriteVizParams(ostream& out, const TString& var);
+   virtual void WriteVizParams(std::ostream& out, const TString& var);
 
    virtual TClass* ProjectedClass(const TEveProjection* p) const;
 
diff --git a/graf3d/eve/inc/TEveTrans.h b/graf3d/eve/inc/TEveTrans.h
index 9c8e0238acb..b48828bb208 100644
--- a/graf3d/eve/inc/TEveTrans.h
+++ b/graf3d/eve/inc/TEveTrans.h
@@ -181,6 +181,6 @@ public:
    ClassDef(TEveTrans, 1); // Column-major 4x4 transforamtion matrix for homogeneous coordinates.
 };
 
-ostream& operator<<(ostream& s, const TEveTrans& t);
+std::ostream& operator<<(std::ostream& s, const TEveTrans& t);
 
 #endif
diff --git a/graf3d/eve/src/TEveElement.cxx b/graf3d/eve/src/TEveElement.cxx
index 180de126094..d34433aa226 100644
--- a/graf3d/eve/src/TEveElement.cxx
+++ b/graf3d/eve/src/TEveElement.cxx
@@ -490,7 +490,7 @@ void TEveElement::CopyVizParamsFromDB()
 }
 
 //______________________________________________________________________________
-void TEveElement::SaveVizParams(ostream& out, const TString& tag, const TString& var)
+void TEveElement::SaveVizParams(std::ostream& out, const TString& tag, const TString& var)
 {
    // Save visualization parameters for this element with given tag.
    //
@@ -516,7 +516,7 @@ void TEveElement::SaveVizParams(ostream& out, const TString& tag, const TString&
 }
 
 //______________________________________________________________________________
-void TEveElement::WriteVizParams(ostream& out, const TString& var)
+void TEveElement::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write-out visual parameters for this object.
    // This is a virtual function and all sub-classes are required to
diff --git a/graf3d/eve/src/TEveLine.cxx b/graf3d/eve/src/TEveLine.cxx
index 86d647a74b9..8a11c230b38 100644
--- a/graf3d/eve/src/TEveLine.cxx
+++ b/graf3d/eve/src/TEveLine.cxx
@@ -259,7 +259,7 @@ void TEveLine::CopyVizParams(const TEveElement* el)
 }
 
 //______________________________________________________________________________
-void TEveLine::WriteVizParams(ostream& out, const TString& var)
+void TEveLine::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write visualization parameters.
 
diff --git a/graf3d/eve/src/TEveManager.cxx b/graf3d/eve/src/TEveManager.cxx
index 0b435eac5d0..15a264378cc 100644
--- a/graf3d/eve/src/TEveManager.cxx
+++ b/graf3d/eve/src/TEveManager.cxx
@@ -763,7 +763,7 @@ void TEveManager::SaveVizDB(const TString& filename)
    TString exp_filename(filename);
    gSystem->ExpandPathName(exp_filename);
 
-   ofstream out(exp_filename, ios::out | ios::trunc);
+   std::ofstream out(exp_filename, std::ios::out | std::ios::trunc);
    out << "void " << re[1] << "()\n";
    out << "{\n";
    out << "   TEveManager::Create();\n";
diff --git a/graf3d/eve/src/TEvePointSet.cxx b/graf3d/eve/src/TEvePointSet.cxx
index e9c2c9ae971..28d38e51de3 100644
--- a/graf3d/eve/src/TEvePointSet.cxx
+++ b/graf3d/eve/src/TEvePointSet.cxx
@@ -398,7 +398,7 @@ void TEvePointSet::CopyVizParams(const TEveElement* el)
 }
 
 //______________________________________________________________________________
-void TEvePointSet::WriteVizParams(ostream& out, const TString& var)
+void TEvePointSet::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write visualization parameters.
 
diff --git a/graf3d/eve/src/TEveShape.cxx b/graf3d/eve/src/TEveShape.cxx
index 973bd182a90..f726b55cea8 100644
--- a/graf3d/eve/src/TEveShape.cxx
+++ b/graf3d/eve/src/TEveShape.cxx
@@ -81,7 +81,7 @@ void TEveShape::CopyVizParams(const TEveElement* el)
 }
 
 //______________________________________________________________________________
-void TEveShape::WriteVizParams(ostream& out, const TString& var)
+void TEveShape::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write visualization parameters.
 
diff --git a/graf3d/eve/src/TEveStraightLineSet.cxx b/graf3d/eve/src/TEveStraightLineSet.cxx
index 672db5b6ebb..e9ecc643ffe 100644
--- a/graf3d/eve/src/TEveStraightLineSet.cxx
+++ b/graf3d/eve/src/TEveStraightLineSet.cxx
@@ -150,7 +150,7 @@ void TEveStraightLineSet::CopyVizParams(const TEveElement* el)
 }
 
 //______________________________________________________________________________
-void TEveStraightLineSet::WriteVizParams(ostream& out, const TString& var)
+void TEveStraightLineSet::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write visualization parameters.
 
diff --git a/graf3d/eve/src/TEveTrack.cxx b/graf3d/eve/src/TEveTrack.cxx
index 1a744cdb46e..2f0a6c488eb 100644
--- a/graf3d/eve/src/TEveTrack.cxx
+++ b/graf3d/eve/src/TEveTrack.cxx
@@ -455,7 +455,7 @@ void TEveTrack::CopyVizParams(const TEveElement* el)
 }
 
 //______________________________________________________________________________
-void TEveTrack::WriteVizParams(ostream& out, const TString& var)
+void TEveTrack::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write visualization parameters.
 
@@ -1199,7 +1199,7 @@ void TEveTrackList::CopyVizParams(const TEveElement* el)
 }
 
 //______________________________________________________________________________
-void TEveTrackList::WriteVizParams(ostream& out, const TString& var)
+void TEveTrackList::WriteVizParams(std::ostream& out, const TString& var)
 {
    // Write visualization parameters.
 
diff --git a/graf3d/eve/src/TEveTrans.cxx b/graf3d/eve/src/TEveTrans.cxx
index 196f9abc895..34447b277de 100644
--- a/graf3d/eve/src/TEveTrans.cxx
+++ b/graf3d/eve/src/TEveTrans.cxx
@@ -1010,9 +1010,9 @@ void TEveTrans::Print(Option_t* /*option*/) const
 #include <iomanip>
 
 //______________________________________________________________________________
-ostream& operator<<(ostream& s, const TEveTrans& t)
+std::ostream& operator<<(std::ostream& s, const TEveTrans& t)
 {
-   // Print to ostream.
+   // Print to std::ostream.
 
    s.setf(std::ios::fixed, std::ios::floatfield);
    s.precision(3);
diff --git a/graf3d/ftgl/inc/FTCharToGlyphIndexMap.h b/graf3d/ftgl/inc/FTCharToGlyphIndexMap.h
index 2693bd6337a..3ea6574257e 100644
--- a/graf3d/ftgl/inc/FTCharToGlyphIndexMap.h
+++ b/graf3d/ftgl/inc/FTCharToGlyphIndexMap.h
@@ -6,7 +6,7 @@
 #include "FTGL.h"
 
 /**
- * Provides a non-STL alternative to the STL map<unsigned long, unsigned long>
+ * Provides a non-STL alternative to the STL std::map<unsigned long, unsigned long>
  * which maps character codes to glyph indices inside FTCharmap.
  * 
  * Implementation:
diff --git a/graf3d/g3d/inc/TAxis3D.h b/graf3d/g3d/inc/TAxis3D.h
index 2c85f1c6ea4..f0042cc29c9 100644
--- a/graf3d/g3d/inc/TAxis3D.h
+++ b/graf3d/g3d/inc/TAxis3D.h
@@ -87,7 +87,7 @@ public:
    virtual void     Paint(Option_t *option="");
    void             PaintAxis(TGaxis *axis, Float_t ang);
    static Double_t *PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view =0);
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual void     SetAxisColor(Color_t color=1, Option_t *axis="*"); // *MENU*
    virtual void     SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*");
diff --git a/graf3d/g3d/inc/THelix.h b/graf3d/g3d/inc/THelix.h
index 6f9aa93b6dd..028f139649d 100644
--- a/graf3d/g3d/inc/THelix.h
+++ b/graf3d/g3d/inc/THelix.h
@@ -73,7 +73,7 @@ public:
    virtual void    Draw(Option_t *option="");
    Option_t       *GetOption() const {return fOption.Data();}
    virtual void    Print(Option_t *option="") const;
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SetOption(Option_t *option="") {fOption = option;}
    virtual void    SetAxis(Double_t * axis);       //Define new axis
    virtual void    SetAxis(Double_t x, Double_t y, Double_t z);
diff --git a/graf3d/g3d/inc/TMarker3DBox.h b/graf3d/g3d/inc/TMarker3DBox.h
index bde46a1a602..48ef51889ba 100644
--- a/graf3d/g3d/inc/TMarker3DBox.h
+++ b/graf3d/g3d/inc/TMarker3DBox.h
@@ -77,7 +77,7 @@ public:
 
    virtual void    Paint(Option_t *option);
    static  void    PaintH3(TH1 *h, Option_t *option);
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SetPoints(Double_t *buff) const;
    virtual void    SetDirection(Float_t theta, Float_t phi);
    virtual void    SetPosition(Float_t x, Float_t y, Float_t z);
diff --git a/graf3d/g3d/inc/TPolyLine3D.h b/graf3d/g3d/inc/TPolyLine3D.h
index a0a385c3862..c262f64eae1 100644
--- a/graf3d/g3d/inc/TPolyLine3D.h
+++ b/graf3d/g3d/inc/TPolyLine3D.h
@@ -70,7 +70,7 @@ public:
    virtual Int_t     Merge(TCollection *list);
    virtual void      Paint(Option_t *option="");
    virtual void      Print(Option_t *option="") const;
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual Int_t     SetNextPoint(Double_t x, Double_t y, Double_t z); // *MENU*
    virtual void      SetOption(Option_t *option="") {fOption = option;}
    virtual void      SetPoint(Int_t point, Double_t x, Double_t y, Double_t z); // *MENU*
diff --git a/graf3d/g3d/inc/TPolyMarker3D.h b/graf3d/g3d/inc/TPolyMarker3D.h
index 2f3d326322d..6dfc4d15621 100644
--- a/graf3d/g3d/inc/TPolyMarker3D.h
+++ b/graf3d/g3d/inc/TPolyMarker3D.h
@@ -72,7 +72,7 @@ public:
    virtual Int_t     Merge(TCollection *list);
    virtual void      Paint(Option_t *option="");
    virtual void      Print(Option_t *option="") const;
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      SetName(const char *name); // *MENU*
    void              SetPoint(Int_t n, Double_t x, Double_t y, Double_t z); // *MENU*
    virtual void      SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
diff --git a/graf3d/g3d/src/TAxis3D.cxx b/graf3d/g3d/src/TAxis3D.cxx
index 4f962247f5c..61ca58c4aec 100644
--- a/graf3d/g3d/src/TAxis3D.cxx
+++ b/graf3d/g3d/src/TAxis3D.cxx
@@ -475,7 +475,7 @@ Double_t *TAxis3D::PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView
 
 
 //______________________________________________________________________________
-void TAxis3D::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TAxis3D::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
diff --git a/graf3d/g3d/src/THelix.cxx b/graf3d/g3d/src/THelix.cxx
index a43226a7056..512532c6102 100644
--- a/graf3d/g3d/src/THelix.cxx
+++ b/graf3d/g3d/src/THelix.cxx
@@ -286,17 +286,17 @@ void THelix::Print(Option_t *option) const
 {
    // Dump this helix with its attributes.
 
-   cout <<"    THelix Printing N=" <<fN<<" Option="<<option<<endl;
+   std::cout <<"    THelix Printing N=" <<fN<<" Option="<<option<<std::endl;
 }
 
 
 //______________________________________________________________________________
-void THelix::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void THelix::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out.
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(THelix::Class())) {
       out<<"   ";
    } else {
@@ -306,11 +306,11 @@ void THelix::SavePrimitive(ostream &out, Option_t * /*= ""*/)
       <<fVt*TMath::Cos(fPhi0)<<","<<fVt*TMath::Sin(fPhi0)<<","<<fVz<<","
       <<fW<<","<<fRange[0]<<","<<fRange[1]<<","<<(Int_t)kHelixT<<","
       <<fAxis[0]<<","<<fAxis[1]<<","<<fAxis[2]<<","
-      <<quote<<fOption<<quote<<");"<<endl;
+      <<quote<<fOption<<quote<<");"<<std::endl;
 
    SaveLineAttributes(out,"helix",1,1,1);
 
-   out<<"   helix->Draw();"<<endl;
+   out<<"   helix->Draw();"<<std::endl;
 }
 
 
diff --git a/graf3d/g3d/src/TMarker3DBox.cxx b/graf3d/g3d/src/TMarker3DBox.cxx
index 358bd4aae77..2f40fcbbcf2 100644
--- a/graf3d/g3d/src/TMarker3DBox.cxx
+++ b/graf3d/g3d/src/TMarker3DBox.cxx
@@ -357,11 +357,11 @@ void TMarker3DBox::PaintH3(TH1 *h, Option_t *option)
 
 
 //______________________________________________________________________________
-void TMarker3DBox::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TMarker3DBox::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TMarker3DBox::Class())) {
       out<<"   ";
    } else {
@@ -374,12 +374,12 @@ void TMarker3DBox::SavePrimitive(ostream &out, Option_t * /*= ""*/)
                                          <<fDy<<","
                                          <<fDz<<","
                                          <<fTheta<<","
-                                         <<fPhi<<");"<<endl;
+                                         <<fPhi<<");"<<std::endl;
 
    SaveLineAttributes(out,"marker3DBox",1,1,1);
    SaveFillAttributes(out,"marker3DBox",1,0);
 
-   out<<"   marker3DBox->Draw();"<<endl;
+   out<<"   marker3DBox->Draw();"<<std::endl;
 }
 
 
diff --git a/graf3d/g3d/src/TNode.cxx b/graf3d/g3d/src/TNode.cxx
index 77b6f4fb679..a9a4ccd7570 100644
--- a/graf3d/g3d/src/TNode.cxx
+++ b/graf3d/g3d/src/TNode.cxx
@@ -543,23 +543,23 @@ void TNode::ls(Option_t *option) const
    const char *shapename, *matrixname;
    if (fShape) shapename = fShape->IsA()->GetName();
    else        shapename = "????";
-   cout<<GetName()<<":"<<GetTitle()<<" is a "<<shapename;
+   std::cout<<GetName()<<":"<<GetTitle()<<" is a "<<shapename;
    if (sizeX3D) {
       gSize3D.numPoints = 0;
       gSize3D.numSegs   = 0;
       gSize3D.numPolys  = 0;
       Sizeof3D();
-      cout<<" NumPoints="<<gSize3D.numPoints;
-      cout<<" NumSegs  ="<<gSize3D.numSegs;
-      cout<<" NumPolys ="<<gSize3D.numPolys;
+      std::cout<<" NumPoints="<<gSize3D.numPoints;
+      std::cout<<" NumSegs  ="<<gSize3D.numSegs;
+      std::cout<<" NumPolys ="<<gSize3D.numPolys;
    } else {
-      cout<<" X="<<fX<<" Y="<<fY<<" Z="<<fZ;
-      if (nsons) cout<<" Sons="<<nsons;
+      std::cout<<" X="<<fX<<" Y="<<fY<<" Z="<<fZ;
+      if (nsons) std::cout<<" Sons="<<nsons;
       if (fMatrix) matrixname   = fMatrix->GetName();
       else         matrixname   = "Identity";
-      if(strcmp(matrixname,"Identity")) cout<<" Rot="<<matrixname;
+      if(strcmp(matrixname,"Identity")) std::cout<<" Rot="<<matrixname;
    }
-   cout<<endl;
+   std::cout<<std::endl;
    if(!nsons) return;
    if (gGeomLevel >= maxlevel) return;
 
diff --git a/graf3d/g3d/src/TPolyLine3D.cxx b/graf3d/g3d/src/TPolyLine3D.cxx
index 930862ad4c9..e73a6bfc332 100644
--- a/graf3d/g3d/src/TPolyLine3D.cxx
+++ b/graf3d/g3d/src/TPolyLine3D.cxx
@@ -440,7 +440,7 @@ void TPolyLine3D::ls(Option_t *option) const
    // List this 3-D polyline.
 
    TROOT::IndentLevel();
-   cout <<"PolyLine3D  N=" <<fN<<" Option="<<option<<endl;
+   std::cout <<"PolyLine3D  N=" <<fN<<" Option="<<option<<std::endl;
 }
 
 
@@ -579,27 +579,27 @@ void TPolyLine3D::Print(Option_t *option) const
 
 
 //______________________________________________________________________________
-void TPolyLine3D::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPolyLine3D::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream.
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPolyLine3D::Class())) {
       out<<"   ";
    } else {
       out<<"   TPolyLine3D *";
    }
    Int_t size=Size();
-   out<<"pline3D = new TPolyLine3D("<<fN<<","<<quote<<fOption<<quote<<");"<<endl;
+   out<<"pline3D = new TPolyLine3D("<<fN<<","<<quote<<fOption<<quote<<");"<<std::endl;
 
    SaveLineAttributes(out,"pline3D",1,1,1);
 
    if (size > 0) {
       for (Int_t i=0;i<size;i++)
-         out<<"   pline3D->SetPoint("<<i<<","<<fP[3*i]<<","<<fP[3*i+1]<<","<<fP[3*i+2]<<");"<<endl;
+         out<<"   pline3D->SetPoint("<<i<<","<<fP[3*i]<<","<<fP[3*i+1]<<","<<fP[3*i+2]<<");"<<std::endl;
    }
-   out<<"   pline3D->Draw();"<<endl;
+   out<<"   pline3D->Draw();"<<std::endl;
 }
 
 
diff --git a/graf3d/g3d/src/TPolyMarker3D.cxx b/graf3d/g3d/src/TPolyMarker3D.cxx
index 1de468fd4a4..770b002f8e4 100644
--- a/graf3d/g3d/src/TPolyMarker3D.cxx
+++ b/graf3d/g3d/src/TPolyMarker3D.cxx
@@ -289,7 +289,7 @@ void TPolyMarker3D::ls(Option_t *option) const
    // List this 3-D polymarker.
 
    TROOT::IndentLevel();
-   cout << "    TPolyMarker3D  N=" << Size() <<" Option="<<option<<endl;
+   std::cout << "    TPolyMarker3D  N=" << Size() <<" Option="<<option<<std::endl;
 }
 
 //______________________________________________________________________________
@@ -494,26 +494,26 @@ void TPolyMarker3D::Print(Option_t *option) const
 }
 
 //______________________________________________________________________________
-void TPolyMarker3D::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPolyMarker3D::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream.
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TPolyMarker3D::Class())) {
       out<<"   ";
    } else {
       out<<"   TPolyMarker3D *";
    }
-   out<<"pmarker3D = new TPolyMarker3D("<<fN<<","<<GetMarkerStyle()<<","<<quote<<fOption<<quote<<");"<<endl;
-   out<<"   pmarker3D->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+   out<<"pmarker3D = new TPolyMarker3D("<<fN<<","<<GetMarkerStyle()<<","<<quote<<fOption<<quote<<");"<<std::endl;
+   out<<"   pmarker3D->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
 
    SaveMarkerAttributes(out,"pmarker3D",1,1,1);
 
    for (Int_t i=0;i<Size();i++) {
-      out<<"   pmarker3D->SetPoint("<<i<<","<<fP[3*i]<<","<<fP[3*i+1]<<","<<fP[3*i+2]<<");"<<endl;
+      out<<"   pmarker3D->SetPoint("<<i<<","<<fP[3*i]<<","<<fP[3*i+1]<<","<<fP[3*i+2]<<");"<<std::endl;
    }
-   out<<"   pmarker3D->Draw();"<<endl;
+   out<<"   pmarker3D->Draw();"<<std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/graf3d/g3d/src/TXTRU.cxx b/graf3d/g3d/src/TXTRU.cxx
index 7d5be90dc4a..151466102f0 100644
--- a/graf3d/g3d/src/TXTRU.cxx
+++ b/graf3d/g3d/src/TXTRU.cxx
@@ -573,8 +573,8 @@ void TXTRU::SplitConcavePolygon(Bool_t split)
    // Not implemented yet
    if (split) {
       fSplitConcave = kFALSE;
-      cout << TNamed::GetName()
-           << " TXTRU::SplitConcavePolygon is not yet implemented" << endl;
+      std::cout << TNamed::GetName()
+           << " TXTRU::SplitConcavePolygon is not yet implemented" << std::endl;
    }
 
 }
@@ -732,7 +732,7 @@ void TXTRU::DumpPoints(int npoints, float *pointbuff) const
 {
    // Dump the vertex points for visual inspection
 
-   cout << "TXTRU::DumpPoints - " << npoints << " points" << endl;
+   std::cout << "TXTRU::DumpPoints - " << npoints << " points" << std::endl;
    int ioff = 0;
    float x,y,z;
    int ipt=0;
@@ -750,7 +750,7 @@ void TXTRU::DumpSegments(int nsegments, int *segbuff) const
 {
    // Dump the segment info for visual inspection
 
-   cout << "TXTRU::DumpSegments - " << nsegments << " segments" << endl;
+   std::cout << "TXTRU::DumpSegments - " << nsegments << " segments" << std::endl;
    int ioff = 0;
    int icol, p1, p2;
    int iseg=0;
@@ -768,7 +768,7 @@ void TXTRU::DumpPolygons(int npolygons, int *polybuff, int buffsize) const
 {
    // Dump the derived polygon info for visual inspection
 
-   cout << "TXTRU::DumpPolygons - " << npolygons << " polygons" << endl;
+   std::cout << "TXTRU::DumpPolygons - " << npolygons << " polygons" << std::endl;
    int ioff = 0;
    int icol, nseg, iseg;
    int ipoly=0;
@@ -776,17 +776,17 @@ void TXTRU::DumpPolygons(int npolygons, int *polybuff, int buffsize) const
       icol = polybuff[ioff++];
       nseg = polybuff[ioff++];
 #ifndef R__MACOSX
-      cout << "  [" << setw(4) << ipoly << "] icol " << setw(3) << icol
-           << " nseg " << setw(3) << nseg << "  (";
+      std::cout << "  [" << std::setw(4) << ipoly << "] icol " << std::setw(3) << icol
+           << " nseg " << std::setw(3) << nseg << "  (";
 #else
       printf(" [%d4] icol %d3 nseg %d3  (", ipoly, icol, nseg);
 #endif
       for (iseg=0; iseg<nseg-1; iseg++) {
-         cout << polybuff[ioff++] << ",";
+         std::cout << polybuff[ioff++] << ",";
       }
-      cout << polybuff[ioff++] << ")" << endl;
+      std::cout << polybuff[ioff++] << ")" << std::endl;
    }
-   cout << " buffer size " << buffsize << " last used " << --ioff << endl;
+   std::cout << " buffer size " << buffsize << " last used " << --ioff << std::endl;
 }
 
 
diff --git a/graf3d/gl/src/TGLOutput.cxx b/graf3d/gl/src/TGLOutput.cxx
index ba6b323ad64..57327e3307c 100644
--- a/graf3d/gl/src/TGLOutput.cxx
+++ b/graf3d/gl/src/TGLOutput.cxx
@@ -174,7 +174,7 @@ void TGLOutput::StartEmbeddedPS()
    gVirtualPS->PrintStr("/showpage {} def@");
 
    // Close the gVirtualPS output stream
-   ofstream *fs = (ofstream*)gVirtualPS->GetStream();
+   std::ofstream *fs = (std::ofstream*)gVirtualPS->GetStream();
    fs->close();
 
 }
@@ -184,7 +184,7 @@ void TGLOutput::CloseEmbeddedPS()
 {
    //this function used by gl-in-pad
    // Restore the gVirtualPS output stream
-   ofstream *fs = new ofstream(gVirtualPS->GetName(),ios::app);
+   std::ofstream *fs = new std::ofstream(gVirtualPS->GetName(),std::ios::app);
    gVirtualPS->SetStream(fs);
    gVirtualPS->PrintStr("@");
    gVirtualPS->PrintStr("cleartomark@");
diff --git a/gui/fitpanel/src/TFitEditor.cxx b/gui/fitpanel/src/TFitEditor.cxx
index b6c3c24de9a..ed8d59036b6 100644
--- a/gui/fitpanel/src/TFitEditor.cxx
+++ b/gui/fitpanel/src/TFitEditor.cxx
@@ -175,7 +175,7 @@ using std::make_pair;
 // using std::cout;
 // using std::endl;
 
-void SearchCanvases(TSeqCollection* canvases, vector<TObject*>& objects);
+void SearchCanvases(TSeqCollection* canvases, std::vector<TObject*>& objects);
 
 typedef std::multimap<TObject*, TF1*> FitFuncMap_t;
 
@@ -205,7 +205,7 @@ TF1* TFitEditor::FindFunction()
    // If we are looking for previously fitted functions, look in the
    // fPrevFit data structure.
    } else if ( fTypeFit->GetSelected() == kFP_PREVFIT ) {
-      pair<fPrevFitIter, fPrevFitIter> look = fPrevFit.equal_range(fFitObject);
+      std::pair<fPrevFitIter, fPrevFitIter> look = fPrevFit.equal_range(fFitObject);
       for ( fPrevFitIter it = look.first; it != look.second; ++it ) {
          TF1* f = it->second;
          if ( strcmp( f->GetName(), name ) == 0 )
@@ -454,7 +454,7 @@ TFitEditor::TFitEditor(TVirtualPad* pad, TObject *obj) :
    if (!obj) {
       TList* l = new TList();
       l->Add(pad);
-      vector<TObject*> v;
+      std::vector<TObject*> v;
       SearchCanvases(l, v);
       if ( v.size() ) 
          obj = v[0];
@@ -1667,7 +1667,7 @@ void TFitEditor::FillFunctionList(Int_t)
       Int_t newid = kFP_ALTFUNC;
       
       // Look only for those functions used in the selected object
-      pair<fPrevFitIter, fPrevFitIter> look = fPrevFit.equal_range(fFitObject);
+      std::pair<fPrevFitIter, fPrevFitIter> look = fPrevFit.equal_range(fFitObject);
       // Then go over all those functions and add them to the list
       for ( fPrevFitIter it = look.first; it != look.second; ++it ) {
          fFuncList->AddEntry(it->second->GetName(), newid++);
@@ -1746,7 +1746,7 @@ void TFitEditor::FillMinMethodList(Int_t)
    }
 }
 
-void SearchCanvases(TSeqCollection* canvases, vector<TObject*>& objects)
+void SearchCanvases(TSeqCollection* canvases, std::vector<TObject*>& objects)
 {
    // Auxiliary function to recursively search for objects inside the
    // current canvases.
@@ -1767,7 +1767,7 @@ void SearchCanvases(TSeqCollection* canvases, vector<TObject*>& objects)
                 || dynamic_cast<TTree*>(obj) ) {
          bool insertNew = true;
          // Be careful no to insert the same element twice.
-         for ( vector<TObject*>::iterator i = objects.begin(); i != objects.end(); ++i )
+         for ( std::vector<TObject*>::iterator i = objects.begin(); i != objects.end(); ++i )
             if ( (*i) == obj ) {
                insertNew = false;
                break;
@@ -1794,7 +1794,7 @@ void TFitEditor::FillDataSetList()
 
    // Remove all the elements
    fDataSet->RemoveAll();
-   vector<TObject*> objects;
+   std::vector<TObject*> objects;
 
    // Get all the objects registered in gDirectory
    TIter next(gDirectory->GetList());
@@ -1817,7 +1817,7 @@ void TFitEditor::FillDataSetList()
    // Add the No selection.
    Int_t newid = kFP_NOSEL;
    fDataSet->AddEntry("No Selection", newid++);
-   for ( vector<TObject*>::iterator i = objects.begin(); i != objects.end(); ++i ) {
+   for ( std::vector<TObject*>::iterator i = objects.begin(); i != objects.end(); ++i ) {
       // Insert the name as the class name followed by the name of the
       // object.
       TString name = (*i)->ClassName(); name.Append("::"); name.Append((*i)->GetName());
@@ -2248,16 +2248,16 @@ void TFitEditor::DoDataSet(Int_t selected)
          lookStr = name;
       else 
          lookStr = name(0, name.First(' '));
-      //cout << "\t1 SITREE: '" << lookStr << "'" << endl;
+      //std::cout << "\t1 SITREE: '" << lookStr << "'" << std::endl;
       objSelected = gROOT->FindObject(lookStr);
    } else {
       // It's not a tree, so the name is the complete string
-      //cout << "\t1 NOTREE: '" << name << "'" << endl;
+      //std::cout << "\t1 NOTREE: '" << name << "'" << std::endl;
       objSelected = gROOT->FindObject(name);
    }
    if ( !objSelected ) 
    {
-      //cerr << "Object not found! Please report the error! " << endl;
+      //std::cerr << "Object not found! Please report the error! " << std::endl;
       return;
    }
 
@@ -3392,7 +3392,7 @@ TList* TFitEditor::GetListOfFittingFunctions(TObject* obj)
 
    TList *retList = new TList();
 
-   pair<fPrevFitIter, fPrevFitIter> look = fPrevFit.equal_range(obj);
+   std::pair<fPrevFitIter, fPrevFitIter> look = fPrevFit.equal_range(obj);
    for ( fPrevFitIter it = look.first; it != look.second; ++it ) {
       retList->Add(it->second);
    }
diff --git a/gui/ged/inc/TGedMarkerSelect.h b/gui/ged/inc/TGedMarkerSelect.h
index dfe057f82fd..e0191f87648 100644
--- a/gui/ged/inc/TGedMarkerSelect.h
+++ b/gui/ged/inc/TGedMarkerSelect.h
@@ -69,7 +69,7 @@ public:
    Style_t        GetMarkerStyle() const { return fMarkerStyle; }
    void           SetMarkerStyle(Style_t pattern);
    virtual void   MarkerSelected(Style_t marker = 0) { Emit("MarkerSelected(Style_t)", marker ? marker : GetMarkerStyle()); }  // *SIGNAL*
-   virtual void   SavePrimitive(ostream &out, Option_t * = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t * = "");
    virtual TGDimension GetDefaultSize() const { return TGDimension(38, 21); }
 
    ClassDef(TGedMarkerSelect,0)  // Marker selection button
diff --git a/gui/ged/inc/TGedPatternSelect.h b/gui/ged/inc/TGedPatternSelect.h
index 5773c68e877..fe75ae956ca 100644
--- a/gui/ged/inc/TGedPatternSelect.h
+++ b/gui/ged/inc/TGedPatternSelect.h
@@ -165,7 +165,7 @@ public:
    virtual void   PatternSelected(Style_t pattern = 0) 
                   { Emit("PatternSelected(Style_t)", pattern ? pattern : GetPattern()); }  // *SIGNAL*
    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-   virtual void   SavePrimitive(ostream &out, Option_t * = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGedPatternSelect,0)  //pattern selection check-button
 };
diff --git a/gui/ged/src/TCurlyArcEditor.cxx b/gui/ged/src/TCurlyArcEditor.cxx
index 99513210b66..eb280b69385 100644
--- a/gui/ged/src/TCurlyArcEditor.cxx
+++ b/gui/ged/src/TCurlyArcEditor.cxx
@@ -27,7 +27,7 @@
 #include "TGLabel.h"
 #include "TGNumberEntry.h"
 #include "TCurlyArc.h"
-#include "iostream"
+#include <iostream>
 
 ClassImp(TCurlyArcEditor)
 
diff --git a/gui/ged/src/TCurlyLineEditor.cxx b/gui/ged/src/TCurlyLineEditor.cxx
index 35b56acd996..1b44d56307c 100644
--- a/gui/ged/src/TCurlyLineEditor.cxx
+++ b/gui/ged/src/TCurlyLineEditor.cxx
@@ -29,7 +29,7 @@
 #include "TGNumberEntry.h"
 #include "TGButton.h"
 #include "TCurlyLine.h"
-#include "iostream"
+#include <iostream>
 
 ClassImp(TCurlyLineEditor)
 
diff --git a/gui/ged/src/TGedMarkerSelect.cxx b/gui/ged/src/TGedMarkerSelect.cxx
index 4f7f3b1dc8a..4898cfdfb85 100644
--- a/gui/ged/src/TGedMarkerSelect.cxx
+++ b/gui/ged/src/TGedMarkerSelect.cxx
@@ -214,11 +214,11 @@ void TGedMarkerSelect::SetMarkerStyle(Style_t markerStyle)
 }
 
 //______________________________________________________________________________
-void TGedMarkerSelect::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGedMarkerSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save the pattern select widget as a C++ statement(s) on output stream out
 
    out <<"   TGedMarkerSelect *";
    out << GetName() << " = new TGedMarkerSelect(" << fParent->GetName()
-       << "," << fMarkerStyle << "," << WidgetId() << ");" << endl;
+       << "," << fMarkerStyle << "," << WidgetId() << ");" << std::endl;
 }
diff --git a/gui/ged/src/TGedPatternSelect.cxx b/gui/ged/src/TGedPatternSelect.cxx
index 9814039cad4..e76c6147a57 100644
--- a/gui/ged/src/TGedPatternSelect.cxx
+++ b/gui/ged/src/TGedPatternSelect.cxx
@@ -641,11 +641,11 @@ void TGedPatternSelect::SetPattern(Style_t pattern, Bool_t emit)
 }
 
 //______________________________________________________________________________
-void TGedPatternSelect::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save the pattern select widget as a C++ statement(s) on output stream out
 
    out <<"   TGedPatternSelect *";
    out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
-       << "," << fPattern << "," << WidgetId() << ");" << endl;
+       << "," << fPattern << "," << WidgetId() << ");" << std::endl;
 }
diff --git a/gui/gui/inc/TG3DLine.h b/gui/gui/inc/TG3DLine.h
index 2f6260195b3..dace031cd55 100644
--- a/gui/gui/inc/TG3DLine.h
+++ b/gui/gui/inc/TG3DLine.h
@@ -41,7 +41,7 @@ public:
       gVirtualX->DrawLine(fId, GetHilightGC()(), 0, 1, fWidth-1, 1);
       gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, 0, fWidth-1, 1);
    }
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGHorizontal3DLine,0)  //A horizontal 3D separator line
 };
@@ -59,7 +59,7 @@ public:
       gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 0, 1, fHeight-1);
       gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, 1, fHeight-1);
    }
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGVertical3DLine,0)  //A vertical 3D separator line
 };
diff --git a/gui/gui/inc/TGButton.h b/gui/gui/inc/TGButton.h
index eb714483061..862ef68aeb7 100644
--- a/gui/gui/inc/TGButton.h
+++ b/gui/gui/inc/TGButton.h
@@ -130,7 +130,7 @@ public:
    virtual void         SetStyle(UInt_t newstyle);
    virtual void         SetStyle(const char *style);
 
-   virtual void         SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void         SavePrimitive(std::ostream &out, Option_t *option = "");
 
    GContext_t GetNormGC() const { return fNormGC; }
 
@@ -223,7 +223,7 @@ public:
    FontStruct_t GetFontStruct() const { return fFontStruct; }
 
    virtual void       Layout();
-   virtual void       SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void       SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGTextButton,0)  // A text button widget
 };
@@ -259,7 +259,7 @@ public:
    virtual void     SetDisabledPicture(const TGPicture *pic);
    const TGPicture *GetPicture() const { return fPic; };
    const TGPicture *GetDisabledPicture() const { return fPicD; };
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGPictureButton,0)  // A picture button widget
 };
@@ -317,7 +317,7 @@ public:
    virtual Bool_t IsDisabledAndSelected() const { return kButtonDisabled && fStateOn; }
    virtual void   SetDisabledAndSelected(Bool_t);
    virtual void   SetState(EButtonState state, Bool_t emit = kFALSE);
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGCheckButton,0)  // A check button widget
 };
@@ -374,7 +374,7 @@ public:
    virtual Bool_t IsOn() const { return fStateOn; }
    virtual Bool_t IsDown() const { return fStateOn; }
    virtual Bool_t IsDisabledAndSelected() const { return kButtonDisabled && fStateOn; }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGRadioButton,0)  // A radio button widget
 };
diff --git a/gui/gui/inc/TGButtonGroup.h b/gui/gui/inc/TGButtonGroup.h
index 0b9d1cd4cd9..0e3fd86a42b 100644
--- a/gui/gui/inc/TGButtonGroup.h
+++ b/gui/gui/inc/TGButtonGroup.h
@@ -99,7 +99,7 @@ public:
    virtual void      Hide();
    virtual void      DrawBorder();
    virtual void      SetLayoutHints(TGLayoutHints *l, TGButton *button = 0);
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGButtonGroup,0)  // Organizes TGButtons in a group
 };
@@ -117,7 +117,7 @@ public:
                     norm, font, back) { }
 
    virtual ~TGVButtonGroup() { }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGVButtonGroup,0)  // A button group with one vertical column
 };
@@ -135,7 +135,7 @@ public:
                     norm, font, back) { }
 
    virtual ~TGHButtonGroup() { }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGHButtonGroup,0)  // A button group with one horizontal row
 };
diff --git a/gui/gui/inc/TGCanvas.h b/gui/gui/inc/TGCanvas.h
index a01dfd65e86..4e496f211ba 100644
--- a/gui/gui/inc/TGCanvas.h
+++ b/gui/gui/inc/TGCanvas.h
@@ -137,7 +137,7 @@ public:
 
    virtual const TGFrame *GetNextSelected(void **current);
    virtual TGFrame *GetLastActive() const { return fLastActiveEl ? fLastActiveEl->fFrame : 0; }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual Bool_t HandleDNDFinished() { fBdown = kFALSE; return kTRUE; }
    virtual Bool_t HandleExpose(Event_t *event);
@@ -246,7 +246,7 @@ public:
    virtual TGDimension GetDefaultSize() const { return TGDimension(fWidth, fHeight); }
    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGCanvas,0)  // A canvas with two scrollbars and a viewport
 };
diff --git a/gui/gui/inc/TGColorSelect.h b/gui/gui/inc/TGColorSelect.h
index 35866a8a5d2..7668710a687 100644
--- a/gui/gui/inc/TGColorSelect.h
+++ b/gui/gui/inc/TGColorSelect.h
@@ -162,7 +162,7 @@ public:
    void SetEnabled(Bool_t e = kTRUE) {TGButton::SetEnabled(e); }
 
    virtual TGDimension GetDefaultSize() const { return TGDimension(43, 21); }
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    virtual void ColorSelected(Pixel_t color = 0)
             { Emit("ColorSelected(Pixel_t)", color ? color : GetColor()); }  //*SIGNAL*
diff --git a/gui/gui/inc/TGComboBox.h b/gui/gui/inc/TGComboBox.h
index 61e5b463c82..237354484e2 100644
--- a/gui/gui/inc/TGComboBox.h
+++ b/gui/gui/inc/TGComboBox.h
@@ -146,7 +146,7 @@ public:
    virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); }  // *SIGNAL*
    virtual void Selected(const char *txt) { Emit("Selected(char*)", txt); } // *SIGNAL*
    virtual void ReturnPressed();                                     // *SIGNAL*
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGComboBox,0)  // Combo box widget
 };
@@ -166,7 +166,7 @@ public:
               UInt_t options = kHorizontalFrame | kSunkenFrame | kDoubleBorder,
               Pixel_t back = GetWhitePixel());
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
       
    ClassDef(TGLineStyleComboBox, 0)  // Line style combobox widget
     
@@ -188,7 +188,7 @@ public:
               UInt_t options = kHorizontalFrame | kSunkenFrame | kDoubleBorder,
               Pixel_t back = GetWhitePixel(), Bool_t none=kFALSE);
    
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGLineWidthComboBox, 0)  // Line width combobox widget
 
diff --git a/gui/gui/inc/TGDockableFrame.h b/gui/gui/inc/TGDockableFrame.h
index a58ac0295c9..8128a7d6df9 100644
--- a/gui/gui/inc/TGDockableFrame.h
+++ b/gui/gui/inc/TGDockableFrame.h
@@ -153,7 +153,7 @@ public:
    TGCompositeFrame *GetContainer() const { return fContainer; }
    TGUndockedFrame  *GetUndocked() const { return fFrame; }
 
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGDockableFrame,0)  // Dockable widget
 };
diff --git a/gui/gui/inc/TGDoubleSlider.h b/gui/gui/inc/TGDoubleSlider.h
index c43b6cfd6a5..904edcc14e5 100644
--- a/gui/gui/inc/TGDoubleSlider.h
+++ b/gui/gui/inc/TGDoubleSlider.h
@@ -175,7 +175,7 @@ public:
    virtual Bool_t HandleMotion(Event_t *event);
    virtual TGDimension GetDefaultSize() const
                      { return TGDimension(kDoubleSliderWidth, fHeight); }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGDoubleVSlider,0)  // Vertical double slider widget
 };
@@ -201,7 +201,7 @@ public:
    virtual Bool_t HandleMotion(Event_t *event);
    virtual TGDimension GetDefaultSize() const
                      { return TGDimension(fWidth, kDoubleSliderHeight); }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGDoubleHSlider,0)  // Horizontal double slider widget
 };
diff --git a/gui/gui/inc/TGFSComboBox.h b/gui/gui/inc/TGFSComboBox.h
index 2e0452eb853..23c2c534dd4 100644
--- a/gui/gui/inc/TGFSComboBox.h
+++ b/gui/gui/inc/TGFSComboBox.h
@@ -82,7 +82,7 @@ public:
                 kDoubleBorder, Pixel_t back = GetWhitePixel());
 
    virtual void Update(const char *path);
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGFSComboBox,0)  // Combo box widget for file system path
 };
diff --git a/gui/gui/inc/TGFSContainer.h b/gui/gui/inc/TGFSContainer.h
index 0babfdbc4a7..8d9acfcb7f5 100644
--- a/gui/gui/inc/TGFSContainer.h
+++ b/gui/gui/inc/TGFSContainer.h
@@ -199,7 +199,7 @@ public:
                                 Int_t file_type, Bool_t is_link, const char *ext,
                                 Bool_t small);
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGFileContainer,0)  // Container containing file system objects
 };
diff --git a/gui/gui/inc/TGFont.h b/gui/gui/inc/TGFont.h
index 0a1d806f8b6..9f93cbfe712 100644
--- a/gui/gui/inc/TGFont.h
+++ b/gui/gui/inc/TGFont.h
@@ -219,7 +219,7 @@ public:
                    Int_t numChars, Int_t x, Int_t y) const;
 
    void  Print(Option_t *option="") const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGFont,0)   // GUI font description
 };
diff --git a/gui/gui/inc/TGFrame.h b/gui/gui/inc/TGFrame.h
index b20dd9b15f1..83d719f0e3d 100644
--- a/gui/gui/inc/TGFrame.h
+++ b/gui/gui/inc/TGFrame.h
@@ -316,8 +316,8 @@ public:
 
    // Printing and saving
    virtual void Print(Option_t *option="") const;
-   void SaveUserColor(ostream &out, Option_t *);
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   void SaveUserColor(std::ostream &out, Option_t *);
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    // dummy to remove from context menu
    virtual void        Delete(Option_t * /*option*/ ="") { }
@@ -440,8 +440,8 @@ public:
 
    virtual void   Print(Option_t *option="") const;
    virtual void   ChangeSubframesBackground(Pixel_t back);
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
-   virtual void   SavePrimitiveSubframes(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
+   virtual void   SavePrimitiveSubframes(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGCompositeFrame,0)  // Base class for composite widgets (menubars, etc.)
 };
@@ -453,7 +453,7 @@ public:
                    UInt_t options = kChildFrame,
                    Pixel_t back = GetDefaultFrameBackground()) :
       TGCompositeFrame(p, w, h, options | kVerticalFrame, back) { SetWindowName(); }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGVerticalFrame,0)  // Composite frame with vertical child layout
 };
@@ -464,7 +464,7 @@ public:
                      UInt_t options = kChildFrame,
                      Pixel_t back = GetDefaultFrameBackground()) :
       TGCompositeFrame(p, w, h, options | kHorizontalFrame, back) { SetWindowName(); }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGHorizontalFrame,0)  // Composite frame with horizontal child layout
 };
@@ -572,7 +572,7 @@ public:
         hmax = fWMMaxHeight; winc = fWMWidthInc; hinc = fWMHeightInc; }
    EInitialState GetWMState() const { return fWMInitState; }
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void SaveSource(const char *filename = "Rootappl.C", Option_t *option = ""); // *MENU*icon=bld_save.png*
 
    ClassDef(TGMainFrame,0)  // Top level window frame
@@ -605,7 +605,7 @@ public:
                      kBottomLeft, kBottomRight };
    virtual void    CenterOnParent(Bool_t croot = kTRUE, EPlacement pos = kCenter);
    const TGWindow *GetMain() const { return fMain; }
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SaveSource(const char *filename = "Rootdlog.C", Option_t *option = ""); // *MENU*icon=bld_save.png*
 
    ClassDef(TGTransientFrame,0)  // Frame for dialog (transient) windows
@@ -674,7 +674,7 @@ public:
    virtual const char *GetTitle() const { return fText->GetString(); }
    Bool_t HasOwnFont() const;
 
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGGroupFrame,0)  // A composite frame with border and title
 };
diff --git a/gui/gui/inc/TGGC.h b/gui/gui/inc/TGGC.h
index a7d04bcc4db..c21267f7087 100644
--- a/gui/gui/inc/TGGC.h
+++ b/gui/gui/inc/TGGC.h
@@ -107,7 +107,7 @@ public:
    Int_t             GetArcMode() const { return fValues.fArcMode; }
 
    void Print(Option_t *option="") const;
-   void SavePrimitive(ostream &out, Option_t *option = "");
+   void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGGC,0)  // Graphics context
 };
diff --git a/gui/gui/inc/TGIcon.h b/gui/gui/inc/TGIcon.h
index 1ed2f9f9536..83af9882d1a 100644
--- a/gui/gui/inc/TGIcon.h
+++ b/gui/gui/inc/TGIcon.h
@@ -67,7 +67,7 @@ public:
    virtual void ChangeBackgroundColor() { }
 
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGIcon,0)  // Icon GUI class
 };
diff --git a/gui/gui/inc/TGLabel.h b/gui/gui/inc/TGLabel.h
index 2673fdc4986..16cdde9e367 100644
--- a/gui/gui/inc/TGLabel.h
+++ b/gui/gui/inc/TGLabel.h
@@ -124,7 +124,7 @@ public:
    TGFont      *GetFont() const  { return fFont; }
 
    virtual void Layout();
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGLabel,0)  // A label GUI element
 };
diff --git a/gui/gui/inc/TGLayout.h b/gui/gui/inc/TGLayout.h
index 1d53d6044e0..93b15480e5b 100644
--- a/gui/gui/inc/TGLayout.h
+++ b/gui/gui/inc/TGLayout.h
@@ -107,7 +107,7 @@ public:
    void Print(Option_t* option = "") const;
    void ls(Option_t* option = "") const { Print(option); }
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGLayoutHints,0)  // Class describing GUI layout hints
 };
@@ -186,7 +186,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGVerticalLayout,0)  // Vertical layout manager
 };
@@ -197,7 +197,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGHorizontalLayout,0)  // Horizontal layout manager
 };
@@ -220,7 +220,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGRowLayout,0)  // Row layout manager
 };
@@ -231,7 +231,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGColumnLayout,0)  // Column layout manager
 };
@@ -265,7 +265,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGMatrixLayout,0)  // Matrix layout manager
 };
@@ -298,7 +298,7 @@ public:
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
    virtual Bool_t IsModified() const { return fModified; }
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGTileLayout,0)  // Tile layout manager
 };
@@ -310,7 +310,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGListLayout,0)  // Layout manager for TGListView widget
 };
@@ -326,7 +326,7 @@ public:
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
    virtual void SetDefaultWidth(UInt_t w) { fWidth = w; }
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGListDetailsLayout,0)  // Layout manager for TGListView details
 };
diff --git a/gui/gui/inc/TGListBox.h b/gui/gui/inc/TGListBox.h
index fb7245c8676..b362667f62a 100644
--- a/gui/gui/inc/TGListBox.h
+++ b/gui/gui/inc/TGListBox.h
@@ -132,7 +132,7 @@ public:
    GContext_t     GetNormGC() const { return fNormGC; }
    FontStruct_t   GetFontStruct() const { return fFontStruct; }
 
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGTextLBEntry,0)  // Text listbox entry
 };
@@ -365,7 +365,7 @@ public:
    virtual void GetSelectedEntries(TList *selected);
    UInt_t  GetItemVsize() const { return fItemVsize; }
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual void Selected(Int_t widgetId, Int_t id);   //*SIGNAL*
    virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); } //*SIGNAL*
diff --git a/gui/gui/inc/TGListTree.h b/gui/gui/inc/TGListTree.h
index aa4b68745ef..ffa738be0de 100644
--- a/gui/gui/inc/TGListTree.h
+++ b/gui/gui/inc/TGListTree.h
@@ -138,7 +138,7 @@ public:
    virtual void    HandleDrag() {}
    virtual void    HandleDrop() {}
 
-   virtual void    SavePrimitive(ostream&, Option_t*, Int_t) {}
+   virtual void    SavePrimitive(std::ostream&, Option_t*, Int_t) {}
 
    ClassDef(TGListTreeItem,0)  // Abstract base-class for items that go into a TGListTree container.
 };
@@ -207,7 +207,7 @@ public:
    virtual void            SetColor(Color_t color) { fHasColor = true;fColor = color; }
    virtual void            ClearColor() { fHasColor = false; }
 
-   virtual void            SavePrimitive(ostream &out, Option_t *option, Int_t n);
+   virtual void            SavePrimitive(std::ostream &out, Option_t *option, Int_t n);
 
    ClassDef(TGListTreeItemStd,0)  //Item that goes into a TGListTree container
 };
@@ -293,7 +293,7 @@ protected:
    void  DrawNode(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y);
    virtual void UpdateChecked(TGListTreeItem *item, Bool_t redraw = kFALSE);
 
-   void  SaveChildren(ostream &out, TGListTreeItem *item, Int_t &n);
+   void  SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n);
    void  RemoveReference(TGListTreeItem *item);
    void  PDeleteItem(TGListTreeItem *item);
    void  PDeleteChildren(TGListTreeItem *item);
@@ -459,7 +459,7 @@ public:
    ECheckMode GetCheckMode() const { return fCheckMode; }
    void SetCheckMode(ECheckMode mode) { fCheckMode = mode; }
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGListTree,0)  //Show items in a tree structured list
 };
diff --git a/gui/gui/inc/TGListView.h b/gui/gui/inc/TGListView.h
index 1c04e9b7790..c928917242c 100644
--- a/gui/gui/inc/TGListView.h
+++ b/gui/gui/inc/TGListView.h
@@ -182,7 +182,7 @@ public:
    UInt_t         GetNumColumns() { return fNColumns; }
    EListViewMode  GetViewMode() const { return fViewMode; }
    virtual const char *GetHeader(Int_t idx) const;
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void   SetIncrements(Int_t hInc, Int_t vInc);
    virtual void   SetDefaultColumnWidth(TGVFileSplitter* splitter);
    TGDimension    GetMaxItemSize() const { return fMaxSize; }
@@ -256,7 +256,7 @@ public:
                               { fListView->SetHeader(s,hmode,cmode,idx); }
    void   SetDefaultHeaders() { fListView->SetDefaultHeaders(); }
    const char *GetHeader(Int_t idx) const { return fListView->GetHeader(idx); }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGLVContainer,0)  // Listview container
 };
diff --git a/gui/gui/inc/TGMdiFrame.h b/gui/gui/inc/TGMdiFrame.h
index 8580ca4eb3f..9abba5436d7 100644
--- a/gui/gui/inc/TGMdiFrame.h
+++ b/gui/gui/inc/TGMdiFrame.h
@@ -82,7 +82,7 @@ public:
    const char       *GetWindowName();
    const TGPicture  *GetWindowIcon();
 
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGMdiFrame, 0) // MDI Frame
 };
diff --git a/gui/gui/inc/TGMdiMainFrame.h b/gui/gui/inc/TGMdiMainFrame.h
index 7ad9eabbbd1..39d051405df 100644
--- a/gui/gui/inc/TGMdiMainFrame.h
+++ b/gui/gui/inc/TGMdiMainFrame.h
@@ -237,7 +237,7 @@ public:
    virtual void     FrameRestored(Int_t id) { Emit("FrameRestored(Int_t)", id); } //*SIGNAL*
    virtual void     FramesArranged(Int_t mode) { Emit("FramesArranged(Int_t)", mode); } //*SIGNAL*
 
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGMdiMainFrame, 0) // MDI main frame
 };
diff --git a/gui/gui/inc/TGMdiMenu.h b/gui/gui/inc/TGMdiMenu.h
index 40c4c54edc0..49536417967 100644
--- a/gui/gui/inc/TGMdiMenu.h
+++ b/gui/gui/inc/TGMdiMenu.h
@@ -75,7 +75,7 @@ public:
 
    void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l);
    TGMenuBar *GetMenuBar() const { return fBar;}
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGMdiMenuBar, 0) // MDI menu bar
 };
diff --git a/gui/gui/inc/TGMenu.h b/gui/gui/inc/TGMenu.h
index 4a95a7b6f90..cfbe7a099b9 100644
--- a/gui/gui/inc/TGMenu.h
+++ b/gui/gui/inc/TGMenu.h
@@ -229,7 +229,7 @@ public:
    TGMenuBar      *GetMenuBar() const { return fMenuBar; }
    virtual void    Activate(Bool_t) { }
    virtual void    Activate(TGMenuEntry *entry);
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
 
    UInt_t GetEntrySep()  const { return fEntrySep; }
    virtual void SetEntrySep(UInt_t sep)  { fEntrySep = sep; }
@@ -295,7 +295,7 @@ public:
    TGPopupMenu *GetMenu() const { return fMenu; }
    const char  *GetName() const { return fLabel ? fLabel->GetString() : 0; }
    virtual void DoSendMessage();
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGMenuTitle,0)  // Menu title class
 };
@@ -358,7 +358,7 @@ public:
    virtual Bool_t  HandleButton(Event_t *event);
    virtual Bool_t  HandleMotion(Event_t *event);
    virtual Bool_t  HandleKey(Event_t *event);
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    Layout();
            void    PopupConnection();
    TGFrameElement* GetLastOnLeft();
diff --git a/gui/gui/inc/TGNumberEntry.h b/gui/gui/inc/TGNumberEntry.h
index bfe0586196d..31434232b50 100644
--- a/gui/gui/inc/TGNumberEntry.h
+++ b/gui/gui/inc/TGNumberEntry.h
@@ -152,7 +152,7 @@ public:
    virtual void   Layout();
    virtual Bool_t IsEditable() const { return kFALSE; }
    virtual void   InvalidInput(const char *instr) { Emit("InvalidInput(char*)", instr); }   //*SIGNAL*
-   virtual void   SavePrimitive(ostream &out, Option_t * = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGNumberEntryField,0)  // A text entry field used by a TGNumberEntry
 };
@@ -284,7 +284,7 @@ public:
    virtual Bool_t IsEditable() const { return kFALSE; }
 
    UInt_t GetDefaultHeight() const { return fNumericEntry->GetDefaultHeight(); }
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
    virtual TGLayoutManager *GetLayoutManager() const;
 
    ClassDef(TGNumberEntry,0)  // Entry field widget for several numeric formats
diff --git a/gui/gui/inc/TGProgressBar.h b/gui/gui/inc/TGProgressBar.h
index 88a71a513db..8b1237c3297 100644
--- a/gui/gui/inc/TGProgressBar.h
+++ b/gui/gui/inc/TGProgressBar.h
@@ -99,7 +99,7 @@ public:
    virtual void Reset();                                 //*MENU*
    virtual void SetForegroundColor(Pixel_t pixel);
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGProgressBar,0)  // Progress bar abstract base class
 };
@@ -127,7 +127,7 @@ public:
    void ShowPosition(Bool_t set = kTRUE, Bool_t percent = kTRUE,
                      const char *format = "%.2f");
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGHProgressBar,0)  // Horizontal progress bar widget
 };
@@ -151,7 +151,7 @@ public:
 
    virtual TGDimension GetDefaultSize() const
                      { return TGDimension(fBarWidth, fHeight); }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
    void ShowPos(Bool_t) { }
    void Percent(Bool_t) { }
 
diff --git a/gui/gui/inc/TGScrollBar.h b/gui/gui/inc/TGScrollBar.h
index 7e9ca6ba6ec..be57e7b69ae 100644
--- a/gui/gui/inc/TGScrollBar.h
+++ b/gui/gui/inc/TGScrollBar.h
@@ -175,7 +175,7 @@ public:
 
    virtual void SetRange(Int_t range, Int_t page_size);  //*MENU*
    virtual void SetPosition(Int_t pos);                  //*MENU* *GETTER=GetPosition
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGHScrollBar,0)  // Horizontal scrollbar widget
 };
@@ -198,7 +198,7 @@ public:
 
    virtual void SetRange(Int_t range, Int_t page_size);  //*MENU*
    virtual void SetPosition(Int_t pos);                  //*MENU*  *GETTER=GetPosition
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGVScrollBar,0)  // Vertical scrollbar widget
 };
diff --git a/gui/gui/inc/TGShapedFrame.h b/gui/gui/inc/TGShapedFrame.h
index a775a094bb2..ed16a8e773c 100644
--- a/gui/gui/inc/TGShapedFrame.h
+++ b/gui/gui/inc/TGShapedFrame.h
@@ -46,7 +46,7 @@ public:
    const TGPicture   GetPicture() const { return *fBgnd; }
    TImage            GetImage() const { return *fImage; }
 
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGShapedFrame, 0) // Shaped composite frame
 };
diff --git a/gui/gui/inc/TGShutter.h b/gui/gui/inc/TGShutter.h
index 9a0442083da..4f64b82b948 100644
--- a/gui/gui/inc/TGShutter.h
+++ b/gui/gui/inc/TGShutter.h
@@ -65,7 +65,7 @@ public:
    TGFrame  *GetContainer() const { return fCanvas->GetContainer(); }
    virtual void Selected()  { Emit(" Selected()"); } //*SIGNAL*
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGShutterItem,0)  // Shutter widget item
 };
@@ -110,7 +110,7 @@ public:
    virtual TGDimension GetDefaultSize() const;
    virtual void        SetDefaultSize(UInt_t w, UInt_t h);
 
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual Bool_t ProcessMessage(Long_t cmd, Long_t parm1, Long_t parm2);
    virtual void   Selected(TGShutterItem *item) { Emit(" Selected(TGShutterItem*)", item); } //*SIGNAL*
diff --git a/gui/gui/inc/TGSlider.h b/gui/gui/inc/TGSlider.h
index 393233b3449..3d7b8aeeb4e 100644
--- a/gui/gui/inc/TGSlider.h
+++ b/gui/gui/inc/TGSlider.h
@@ -143,7 +143,7 @@ public:
                      { return TGDimension(kSliderWidth, fHeight); }
    virtual void   Resize(UInt_t w, UInt_t h) { TGFrame::Resize(w, h ? h+16 : fHeight + 16); }
    virtual void   Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGVSlider,0)  // Vertical slider widget
 };
@@ -170,7 +170,7 @@ public:
                      { return TGDimension(fWidth, kSliderHeight); }
    virtual void   Resize(UInt_t w, UInt_t h) { TGFrame::Resize(w ? w+16 : fWidth + 16, h); }
    virtual void   Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGHSlider,0)  // Horizontal slider widget
 };
diff --git a/gui/gui/inc/TGSplitFrame.h b/gui/gui/inc/TGSplitFrame.h
index defdf3d2033..86c7d48f836 100644
--- a/gui/gui/inc/TGSplitFrame.h
+++ b/gui/gui/inc/TGSplitFrame.h
@@ -138,7 +138,7 @@ public:
 
    static  void   SwitchFrames(TGFrame *frame, TGCompositeFrame *dest,
                                TGFrame *prev);
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGSplitFrame, 0) // Splittable composite frame
 };
diff --git a/gui/gui/inc/TGSplitter.h b/gui/gui/inc/TGSplitter.h
index 740ded85e30..0f409e2d8bf 100644
--- a/gui/gui/inc/TGSplitter.h
+++ b/gui/gui/inc/TGSplitter.h
@@ -89,7 +89,7 @@ public:
    const TGFrame *GetFrame() const { return fFrame; }
    Bool_t         GetLeft() const { return fLeft; }
    Bool_t         IsLeft() const { return fLeft; }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual Bool_t HandleButton(Event_t *event);
    virtual Bool_t HandleMotion(Event_t *event);
@@ -126,7 +126,7 @@ public:
    const TGFrame *GetFrame() const { return fFrame; }
    Bool_t         GetAbove() const { return fAbove; }
    Bool_t         IsAbove() const { return fAbove; }
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual Bool_t HandleButton(Event_t *event);
    virtual Bool_t HandleMotion(Event_t *event);
@@ -146,7 +146,7 @@ public:
    virtual Bool_t HandleDoubleClick(Event_t *);
    virtual Bool_t HandleButton(Event_t *event);
    virtual Bool_t HandleMotion(Event_t *event);
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    void LayoutHeader(TGFrame *f);  //*SIGNAL*
    void LayoutListView();  //*SIGNAL*
diff --git a/gui/gui/inc/TGStatusBar.h b/gui/gui/inc/TGStatusBar.h
index 9536561280b..518ddf66f5d 100644
--- a/gui/gui/inc/TGStatusBar.h
+++ b/gui/gui/inc/TGStatusBar.h
@@ -70,7 +70,7 @@ public:
    TGCompositeFrame *GetBarPart(Int_t npart) const;
    TGDimension GetDefaultSize() const;
 
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGStatusBar,0)  // Status bar widget
 };
diff --git a/gui/gui/inc/TGTab.h b/gui/gui/inc/TGTab.h
index 9c7f3dfe02f..f898a79f0ad 100644
--- a/gui/gui/inc/TGTab.h
+++ b/gui/gui/inc/TGTab.h
@@ -56,7 +56,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGTabLayout,0)  // Layout manager for TGTab widget
 };
@@ -119,7 +119,7 @@ public:
    virtual void      SetText(const char *text = "tab");              //*MENU*icon=bld_rename.png*
    Bool_t            IsEnabled(Int_t tabIndex) const;
 
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual void CloseTab(Int_t id) { Emit("CloseTab(Int_t)", id); }  //*SIGNAL*
    virtual void Removed(Int_t id) { Emit("Removed(Int_t)", id); }    //*SIGNAL*
diff --git a/gui/gui/inc/TGTableLayout.h b/gui/gui/inc/TGTableLayout.h
index ce6ca199b9f..739bd6df8c7 100644
--- a/gui/gui/inc/TGTableLayout.h
+++ b/gui/gui/inc/TGTableLayout.h
@@ -63,7 +63,7 @@ public:
    UInt_t GetAttachRight() const { return fAttachRight; }
    UInt_t GetAttachTop() const { return fAttachTop; }
    UInt_t GetAttachBottom() const { return fAttachBottom; }
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGTableLayoutHints,0)  // Class describing GUI table layout hints
 };
@@ -133,7 +133,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const; // return sum of all child sizes
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGTableLayout,0)  // Table layout manager
 };
diff --git a/gui/gui/inc/TGTextEdit.h b/gui/gui/inc/TGTextEdit.h
index c81c07421d9..27ee4f02737 100644
--- a/gui/gui/inc/TGTextEdit.h
+++ b/gui/gui/inc/TGTextEdit.h
@@ -140,7 +140,7 @@ public:
    virtual void   Saved() { Emit("Saved()"); }          //*SIGNAL*
    virtual void   SavedAs() { Emit("SavedAs()"); }      //*SIGNAL*
 
-   virtual void   SavePrimitive(ostream &out, Option_t * = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGTextEdit,0)  // Text edit widget
 };
diff --git a/gui/gui/inc/TGTextEntry.h b/gui/gui/inc/TGTextEntry.h
index 93bb09d45d3..c0e3de50c64 100644
--- a/gui/gui/inc/TGTextEntry.h
+++ b/gui/gui/inc/TGTextEntry.h
@@ -178,7 +178,7 @@ public:
    Pixel_t              GetForeground() const { return fNormGC.GetForeground(); }
    Bool_t               HasOwnFont() const { return fHasOwnFont; }
 
-   virtual  void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual  void        SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual  Bool_t      HandleButton(Event_t *event);
    virtual  Bool_t      HandleDoubleClick(Event_t *event);
diff --git a/gui/gui/inc/TGTextView.h b/gui/gui/inc/TGTextView.h
index c117354b131..3fca42b636b 100644
--- a/gui/gui/inc/TGTextView.h
+++ b/gui/gui/inc/TGTextView.h
@@ -114,7 +114,7 @@ public:
    virtual void   ShowBottom();
    virtual void   ShowTop();
 
-   virtual void   SavePrimitive(ostream &out, Option_t * = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t * = "");
    virtual void   SetText(TGText *text);
    virtual void   AddText(TGText *text);
    virtual void   AddLine(const char *string);
diff --git a/gui/gui/inc/TGToolBar.h b/gui/gui/inc/TGToolBar.h
index 1f4a3f89208..e555036c36f 100644
--- a/gui/gui/inc/TGToolBar.h
+++ b/gui/gui/inc/TGToolBar.h
@@ -75,7 +75,7 @@ public:
    virtual void Released(Int_t id) { Emit("Released(Int_t)",id);}   //*SIGNAL*
    virtual void Clicked(Int_t id)  { Emit("Clicked(Int_t)",id); }   //*SIGNAL*
 
-   virtual void   SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void   SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGToolBar,0)  //A bar containing picture buttons
 };
diff --git a/gui/gui/inc/TGTripleSlider.h b/gui/gui/inc/TGTripleSlider.h
index 36e44f2eb93..b32fe0b4630 100644
--- a/gui/gui/inc/TGTripleSlider.h
+++ b/gui/gui/inc/TGTripleSlider.h
@@ -98,7 +98,7 @@ public:
    virtual void      SetConstrained(Bool_t on = kTRUE);
    virtual void      SetPointerPosition(Float_t pos);
    virtual void      SetRelative(Bool_t rel = kTRUE) { fRelative = rel; }
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGTripleVSlider,0)  // Vertical triple slider widget
 };
@@ -139,7 +139,7 @@ public:
    virtual void      SetConstrained(Bool_t on = kTRUE);
    virtual void      SetPointerPosition(Float_t pos);
    virtual void      SetRelative(Bool_t rel = kTRUE) { fRelative = rel; }
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    ClassDef(TGTripleHSlider,0)  // Horizontal triple slider widget
 };
diff --git a/gui/gui/inc/TGXYLayout.h b/gui/gui/inc/TGXYLayout.h
index f4d1848896d..01df6244895 100644
--- a/gui/gui/inc/TGXYLayout.h
+++ b/gui/gui/inc/TGXYLayout.h
@@ -127,7 +127,7 @@ public:
    void      SetH(Double_t h) { fH = h; }
    void      SetFlag(UInt_t flag) { fFlag = flag; }
 
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    ClassDef(TGXYLayoutHints,0)  // Hits for the X / Y - layout manager
 };
@@ -154,7 +154,7 @@ public:
 
    virtual void Layout();
    virtual TGDimension GetDefaultSize() const;
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
    void NewSize() { fFirst = kTRUE; }
 
diff --git a/gui/gui/inc/TRootEmbeddedCanvas.h b/gui/gui/inc/TRootEmbeddedCanvas.h
index 1df677fcef2..1f9de87594c 100644
--- a/gui/gui/inc/TRootEmbeddedCanvas.h
+++ b/gui/gui/inc/TRootEmbeddedCanvas.h
@@ -66,7 +66,7 @@ public:
    Int_t      GetCanvasWindowId() const { return fCWinId; }
    Bool_t     GetAutoFit() const { return fAutoFit; }
    void       SetAutoFit(Bool_t fit = kTRUE) { fAutoFit = fit; }
-   virtual void SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
 
    virtual Bool_t HandleDNDDrop(TDNDData *data);
    virtual Atom_t HandleDNDPosition(Int_t /*x*/, Int_t /*y*/, Atom_t action,
diff --git a/gui/gui/src/TG3DLine.cxx b/gui/gui/src/TG3DLine.cxx
index ad2b258204b..133882ac104 100644
--- a/gui/gui/src/TG3DLine.cxx
+++ b/gui/gui/src/TG3DLine.cxx
@@ -50,7 +50,7 @@ TGVertical3DLine::TGVertical3DLine(const TGWindow *p, UInt_t w, UInt_t h,
 }
 
 //______________________________________________________________________________
-void TGHorizontal3DLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHorizontal3DLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an vertical 3D line as a C++ statement(s) on output stream out.
 
@@ -62,19 +62,19 @@ void TGHorizontal3DLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() << ");" << endl;
+         out << "," << GetOptionString() << ");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGVertical3DLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVertical3DLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an vertical 3D line as a C++ statement(s) on output stream out.
 
@@ -86,13 +86,13 @@ void TGVertical3DLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 }
diff --git a/gui/gui/src/TGButton.cxx b/gui/gui/src/TGButton.cxx
index 4dd678f178f..ee86415852b 100644
--- a/gui/gui/src/TGButton.cxx
+++ b/gui/gui/src/TGButton.cxx
@@ -1822,27 +1822,27 @@ const TGGC &TGRadioButton::GetDefaultGC()
 }
 
 //______________________________________________________________________________
-void TGButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGButton::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a button widget as a C++ statement(s) on output stream out.
 
    char quote = '"';
 
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    
    if (fState == kButtonDown) {
-      out << "   " << GetName() << "->SetState(kButtonDown);"  << endl;
+      out << "   " << GetName() << "->SetState(kButtonDown);"  << std::endl;
    }
    if (fState == kButtonDisabled) {
-      out << "   " << GetName() << "->SetState(kButtonDisabled);"  << endl;
+      out << "   " << GetName() << "->SetState(kButtonDisabled);"  << std::endl;
    }
    if (fState == kButtonEngaged) {
-      out << "   " << GetName() << "->SetState(kButtonEngaged);"  << endl;
+      out << "   " << GetName() << "->SetState(kButtonEngaged);"  << std::endl;
    }
    if (fBackground != fgDefaultFrameBackground) {
       SaveUserColor(out, option);
-      out << "   " << GetName() << "->ChangeBackground(ucolor);" << endl;
+      out << "   " << GetName() << "->ChangeBackground(ucolor);" << std::endl;
    }
 
    if (fTip) {
@@ -1850,16 +1850,16 @@ void TGButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       tiptext.ReplaceAll("\n", "\\n");
       out << "   ";
       out << GetName() << "->SetToolTipText(" << quote
-          << tiptext << quote << ");"  << endl;
+          << tiptext << quote << ");"  << std::endl;
    }
    if (strlen(fCommand)) {
       out << "   " << GetName() << "->SetCommand(" << quote << fCommand
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGTextButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTextButton::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a text button widget as a C++ statement(s) on output stream out.
 
@@ -1900,33 +1900,33 @@ void TGTextButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (fFontStruct == GetDefaultFontStruct()) {
          if (fNormGC == GetDefaultGC()()) {
             if (fWidgetId == -1) {
-               out << ");" << endl;
+               out << ");" << std::endl;
             } else {
-               out << "," << fWidgetId <<");" << endl;
+               out << "," << fWidgetId <<");" << std::endl;
             }
          } else {
-            out << "," << fWidgetId << "," << parGC << ");" << endl;
+            out << "," << fWidgetId << "," << parGC << ");" << std::endl;
          }
       } else {
-         out << "," << fWidgetId << "," << parGC << "," << parFont << ");" << endl;
+         out << "," << fWidgetId << "," << parGC << "," << parFont << ");" << std::endl;
       }
    } else {
-      out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << endl;
+      out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << std::endl;
    }
 
-   out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << endl;
+   out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << std::endl;
    out << "   " << GetName() << "->SetMargins(" << fMLeft << "," << fMRight << ",";
-   out << fMTop << "," << fMBottom << ");" << endl;
-   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << endl;
+   out << fMTop << "," << fMBottom << ");" << std::endl;
+   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << std::endl;
 
    out << "   " << GetName() << "->Resize(" << GetWidth() << "," << GetHeight()
-       << ");" << endl;
+       << ");" << std::endl;
 
    TGButton::SavePrimitive(out,option);
 }
 
 //______________________________________________________________________________
-void TGPictureButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGPictureButton::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a picture button widget as a C++ statement(s) on output stream out.
 
@@ -1960,23 +1960,23 @@ void TGPictureButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (GetOptions() == (kRaisedFrame | kDoubleBorder)) {
       if (fNormGC == GetDefaultGC()()) {
          if (fWidgetId == -1) {
-            out << ");" << endl;
+            out << ");" << std::endl;
          } else {
-            out << "," << fWidgetId << ");" << endl;
+            out << "," << fWidgetId << ");" << std::endl;
          }
       } else {
-         out << "," << fWidgetId << "," << parGC.Data() << ");" << endl;
+         out << "," << fWidgetId << "," << parGC.Data() << ");" << std::endl;
       }
    } else {
       out << "," << fWidgetId << "," << parGC.Data() << "," << GetOptionString()
-          << ");" << endl;
+          << ");" << std::endl;
    }
 
    TGButton::SavePrimitive(out,option);
 }
 
 //______________________________________________________________________________
-void TGCheckButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGCheckButton::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a check button widget as a C++ statement(s) on output stream out.
 
@@ -2016,35 +2016,35 @@ void TGCheckButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (fFontStruct == GetDefaultFontStruct()) {
          if (fNormGC == GetDefaultGC()()) {
             if (fWidgetId == -1) {
-               out << ");" << endl;
+               out << ");" << std::endl;
             } else {
-               out << "," << fWidgetId << ");" << endl;
+               out << "," << fWidgetId << ");" << std::endl;
             }
          } else {
-            out << "," << fWidgetId << "," << parGC << ");" << endl;
+            out << "," << fWidgetId << "," << parGC << ");" << std::endl;
          }
       } else {
-         out << "," << fWidgetId << "," << parGC << "," << parFont << ");" << endl;
+         out << "," << fWidgetId << "," << parGC << "," << parFont << ");" << std::endl;
       }
    } else {
-      out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << endl;
+      out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << std::endl;
    }
 
    TGButton::SavePrimitive(out,option);
    if (fState == kButtonDisabled) {
       if (IsDisabledAndSelected())
-         out << "   " << GetName() << "->SetDisabledAndSelected(kTRUE);" << endl;
+         out << "   " << GetName() << "->SetDisabledAndSelected(kTRUE);" << std::endl;
       else
-         out << "   " << GetName() << "->SetDisabledAndSelected(kFALSE);" << endl;
+         out << "   " << GetName() << "->SetDisabledAndSelected(kFALSE);" << std::endl;
    }
-   out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << endl;
+   out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << std::endl;
    out << "   " << GetName() << "->SetMargins(" << fMLeft << "," << fMRight << ",";
-   out << fMTop << "," << fMBottom << ");" << endl;
-   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << endl;
+   out << fMTop << "," << fMBottom << ");" << std::endl;
+   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGRadioButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGRadioButton::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a radio button widget as a C++ statement(s) on output stream out.
 
@@ -2084,31 +2084,31 @@ void TGRadioButton::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (fFontStruct == GetDefaultFontStruct()) {
          if (fNormGC == GetDefaultGC()()) {
             if (fWidgetId == -1) {
-               out <<");" << endl;
+               out <<");" << std::endl;
             } else {
-               out << "," << fWidgetId << ");" << endl;
+               out << "," << fWidgetId << ");" << std::endl;
             }
          } else {
-            out << "," << fWidgetId << "," << parGC << ");" << endl;
+            out << "," << fWidgetId << "," << parGC << ");" << std::endl;
          }
       } else {
-         out << "," << fWidgetId << "," << parGC << "," << parFont << ");" << endl;
+         out << "," << fWidgetId << "," << parGC << "," << parFont << ");" << std::endl;
       }
    } else {
-      out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << endl;
+      out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << std::endl;
    }
 
    TGButton::SavePrimitive(out,option);
    if (fState == kButtonDisabled) {
       if (IsDisabledAndSelected())
-         out << "   " << GetName() << "->SetDisabledAndSelected(kTRUE);" << endl;
+         out << "   " << GetName() << "->SetDisabledAndSelected(kTRUE);" << std::endl;
       else
-         out << "   " << GetName() << "->SetDisabledAndSelected(kFALSE);" << endl;
+         out << "   " << GetName() << "->SetDisabledAndSelected(kFALSE);" << std::endl;
    }
-   out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << endl;
+   out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << std::endl;
    out << "   " << GetName() << "->SetMargins(" << fMLeft << "," << fMRight << ",";
-   out << fMTop << "," << fMBottom << ");" << endl;
-   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << endl;
+   out << fMTop << "," << fMBottom << ");" << std::endl;
+   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/gui/gui/src/TGButtonGroup.cxx b/gui/gui/src/TGButtonGroup.cxx
index d29671b8ea9..f7b647cb13a 100644
--- a/gui/gui/src/TGButtonGroup.cxx
+++ b/gui/gui/src/TGButtonGroup.cxx
@@ -594,7 +594,7 @@ void TGButtonGroup::SetLayoutHints(TGLayoutHints *l, TGButton *button)
 }
 
 //______________________________________________________________________________
-void TGButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGButtonGroup::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a button group widget as a C++ statement(s) on output stream out.
 
@@ -626,7 +626,7 @@ void TGButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // buttongroup frame" << endl;
+   out << std::endl << "   // buttongroup frame" << std::endl;
 
    out << "   TGButtonGroup *";
    out << GetName() << " = new TGButtonGroup(" << fParent->GetName()
@@ -636,28 +636,28 @@ void TGButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (fFontStruct == GetDefaultFontStruct()) {
          if (fNormGC == GetDefaultGC()()) {
             if (!GetOptions()) {
-               out <<");" << endl;
+               out <<");" << std::endl;
             } else {
-               out << "," << GetOptionString() <<");" << endl;
+               out << "," << GetOptionString() <<");" << std::endl;
             }
          } else {
-            out << "," << GetOptionString() << "," << parGC.Data() <<");" << endl;
+            out << "," << GetOptionString() << "," << parGC.Data() <<");" << std::endl;
          }
       } else {
-         out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
+         out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager
    out << "   " << GetName() <<"->SetLayoutManager(";
    // coverity[returned_null]
    // coverity[dereference]
    GetLayoutManager()->SavePrimitive(out, option);
-   out << ");"<< endl;
+   out << ");"<< std::endl;
 
    TGFrameElement *f;
    TIter next(GetList());
@@ -667,31 +667,31 @@ void TGButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       else {
          out << "   " << GetName() << "->AddFrame(" << f->fFrame->GetName();
          f->fLayout->SavePrimitive(out, option);
-         out << ");"<< endl;
+         out << ");"<< std::endl;
       }
    }
 
    if (IsExclusive())
-      out << "   " << GetName() <<"->SetExclusive(kTRUE);" << endl;
+      out << "   " << GetName() <<"->SetExclusive(kTRUE);" << std::endl;
 
    if (IsRadioButtonExclusive())
-      out << "   " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << endl;
+      out << "   " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << std::endl;
 
    if (!IsBorderDrawn())
-      out << "   " << GetName() <<"->SetBorderDrawn(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetBorderDrawn(kFALSE);" << std::endl;
 
 
    out << "   " << GetName() << "->Resize(" << GetWidth()
-       << "," << GetHeight() << ");" << endl;
+       << "," << GetHeight() << ");" << std::endl;
 
    if (!IsEnabled())
-      out << "   " << GetName() <<"->SetState(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetState(kFALSE);" << std::endl;
 
-   out << "   " << GetName() << "->Show();" << endl;
+   out << "   " << GetName() << "->Show();" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGHButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHButtonGroup::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a button group widget as a C++ statement(s) on output stream out.
 
@@ -719,7 +719,7 @@ void TGHButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // horizontal buttongroup frame" << endl;
+   out << std::endl << "   // horizontal buttongroup frame" << std::endl;
 
    out << "   TGHButtonGroup *";
    out << GetName() << " = new TGHButtonGroup(" << fParent->GetName()
@@ -729,18 +729,18 @@ void TGHButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (fFontStruct == GetDefaultFontStruct()) {
 
          if (fNormGC == GetDefaultGC()()) {
-            out << ");" << endl;
+            out << ");" << std::endl;
          } else {
-            out << "," << parGC.Data() <<");" << endl;
+            out << "," << parGC.Data() <<");" << std::endl;
          }
       } else {
-         out << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
+         out << "," << parGC.Data() << "," << parFont.Data() <<");" << std::endl;
       }
    } else {
-      out << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << endl;
+      out << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TGFrameElement *f;
    TIter next(GetList());
@@ -750,35 +750,35 @@ void TGHButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          out << "   " << GetName() << "->SetLayoutHints(";
          f->fLayout->SavePrimitive(out, "nocoma");
          out << "," << f->fFrame->GetName();
-         out << ");"<< endl;
+         out << ");"<< std::endl;
       }
       else {
          out << "   " << GetName() << "->AddFrame(" << f->fFrame->GetName();
          f->fLayout->SavePrimitive(out, option);
-         out << ");"<< endl;
+         out << ");"<< std::endl;
       }
    }
 
    if (!IsEnabled())
-      out << "   " << GetName() <<"->SetState(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetState(kFALSE);" << std::endl;
 
    if (IsExclusive())
-      out << "   " << GetName() <<"->SetExclusive(kTRUE);" << endl;
+      out << "   " << GetName() <<"->SetExclusive(kTRUE);" << std::endl;
 
    if (IsRadioButtonExclusive())
-      out << "   " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << endl;
+      out << "   " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << std::endl;
 
    if (!IsBorderDrawn())
-      out << "   " << GetName() <<"->SetBorderDrawn(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetBorderDrawn(kFALSE);" << std::endl;
 
    out << "   " << GetName() <<"->Resize(" << GetWidth() << ","
-       << GetHeight() << ");" << endl;
+       << GetHeight() << ");" << std::endl;
 
-   out << "   " << GetName() << "->Show();" << endl;
+   out << "   " << GetName() << "->Show();" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGVButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVButtonGroup::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a button group widget as a C++ statement(s) on output stream out.
 
@@ -806,7 +806,7 @@ void TGVButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // vertical buttongroup frame" << endl;
+   out << std::endl << "   // vertical buttongroup frame" << std::endl;
 
    out << "   TGVButtonGroup *";
    out << GetName() << " = new TGVButtonGroup(" << fParent->GetName()
@@ -815,18 +815,18 @@ void TGVButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (fBackground == GetDefaultFrameBackground()) {
       if (fFontStruct == GetDefaultFontStruct()) {
          if (fNormGC == GetDefaultGC()()) {
-            out <<");" << endl;
+            out <<");" << std::endl;
          } else {
-            out << "," << parGC.Data() <<");" << endl;
+            out << "," << parGC.Data() <<");" << std::endl;
          }
       } else {
-         out << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
+         out << "," << parGC.Data() << "," << parFont.Data() <<");" << std::endl;
       }
    } else {
-      out << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << endl;
+      out << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TGFrameElement *f;
    TIter next(GetList());
@@ -836,24 +836,24 @@ void TGVButtonGroup::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       else {
          out << "   " << GetName() << "->AddFrame(" << f->fFrame->GetName();
          f->fLayout->SavePrimitive(out, option);
-         out << ");"<< endl;
+         out << ");"<< std::endl;
       }
    }
 
    if (!IsEnabled())
-      out << "   " << GetName() <<"->SetState(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetState(kFALSE);" << std::endl;
 
    if (IsExclusive())
-      out << "   " << GetName() <<"->SetExclusive(kTRUE);" << endl;
+      out << "   " << GetName() <<"->SetExclusive(kTRUE);" << std::endl;
 
    if (IsRadioButtonExclusive())
-      out << "   " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << endl;
+      out << "   " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << std::endl;
 
    if (!IsBorderDrawn())
-      out << "   " << GetName() <<"->SetBorderDrawn(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetBorderDrawn(kFALSE);" << std::endl;
 
    out << "   " << GetName() << "->Resize(" << GetWidth()
-       << "," << GetHeight() << ");"<< endl;
+       << "," << GetHeight() << ");"<< std::endl;
 
-   out << "   " << GetName() << "->Show();" << endl;
+   out << "   " << GetName() << "->Show();" << std::endl;
 }
diff --git a/gui/gui/src/TGCanvas.cxx b/gui/gui/src/TGCanvas.cxx
index b27f2808439..84a98128e38 100644
--- a/gui/gui/src/TGCanvas.cxx
+++ b/gui/gui/src/TGCanvas.cxx
@@ -2434,13 +2434,13 @@ void TGCanvas::ClearViewPort()
 }
 
 //______________________________________________________________________________
-void TGCanvas::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a canvas widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // canvas widget" << endl;
+   out << std::endl << "   // canvas widget" << std::endl;
 
    out << "   TGCanvas *";
    out << GetName() << " = new TGCanvas("<< fParent->GetName()
@@ -2448,57 +2448,57 @@ void TGCanvas::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() << ");" << endl;
+         out << "," << GetOptionString() << ");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TGViewPort *vp = GetViewPort();
-   out << endl << "   // canvas viewport" << endl;
+   out << std::endl << "   // canvas viewport" << std::endl;
    out << "   TGViewPort *" << vp->GetName() << " = " << GetName()
-       << "->GetViewPort();" << endl;
+       << "->GetViewPort();" << std::endl;
 
    TGContainer *cont = (TGContainer*)GetContainer();
    cont->SavePrimitive(out, option);
 
    out << "   " << vp->GetName() << "->AddFrame(" << cont->GetName()
-       << ");" << endl;
+       << ");" << std::endl;
 
    out << "   " << cont->GetName() << "->SetLayoutManager(";
    cont->GetLayoutManager()->SavePrimitive(out, option);
-   out << ");"<< endl;
+   out << ");"<< std::endl;
 
-   out << "   " << cont->GetName() << "->MapSubwindows();" << endl;
+   out << "   " << cont->GetName() << "->MapSubwindows();" << std::endl;
 
    out << "   " << GetName() << "->SetContainer(" << cont->GetName()
-       << ");" << endl;
+       << ");" << std::endl;
 
-   out << "   " << GetName() << "->MapSubwindows();" << endl;
+   out << "   " << GetName() << "->MapSubwindows();" << std::endl;
 
    if (fHScrollbar && fHScrollbar->IsMapped())
       out << "   " << GetName() << "->SetHsbPosition(" << GetHsbPosition()
-          << ");" << endl;
+          << ");" << std::endl;
 
 
    if (fVScrollbar && fVScrollbar->IsMapped())
       out << "   " << GetName() << "->SetVsbPosition(" << GetVsbPosition()
-          << ");" << endl;
+          << ");" << std::endl;
 
 }
 
 //______________________________________________________________________________
-void TGContainer::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a canvas container as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // canvas container" << endl;
+   out << std::endl << "   // canvas container" << std::endl;
 
    if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class())) {
       out << GetName() << " = new TGContainer(" << GetCanvas()->GetName();
@@ -2509,13 +2509,13 @@ void TGContainer::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 }
diff --git a/gui/gui/src/TGColorSelect.cxx b/gui/gui/src/TGColorSelect.cxx
index 19ba7f84604..ee7c4538816 100644
--- a/gui/gui/src/TGColorSelect.cxx
+++ b/gui/gui/src/TGColorSelect.cxx
@@ -589,7 +589,7 @@ void TGColorSelect::SetColor(ULong_t color, Bool_t emit)
 }
 
 //______________________________________________________________________________
-void TGColorSelect::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGColorSelect::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a color select widget as a C++ statement(s) on output stream out
 
@@ -601,22 +601,22 @@ void TGColorSelect::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    const char *colorname = TColor::PixelAsHexString(color);
    gClient->GetColorByName(colorname, color);
 
-   out << endl << "   // color select widget" << endl;
-   out << "   ULong_t " << cvar.Data() << ";" << endl;
+   out << std::endl << "   // color select widget" << std::endl;
+   out << "   ULong_t " << cvar.Data() << ";" << std::endl;
    out << "   gClient->GetColorByName(" << quote << colorname << quote
-       << ", " << cvar.Data() << ");" << endl;
+       << ", " << cvar.Data() << ");" << std::endl;
 
    out <<"   TGColorSelect *";
    out << GetName() << " = new TGColorSelect(" << fParent->GetName()
-       << ", " << cvar.Data() << ", " << WidgetId() << ");" << endl;
+       << ", " << cvar.Data() << ", " << WidgetId() << ");" << std::endl;
    nn++;
 
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (!IsEnabled()) {
-      out << "   " << GetName() << "->Disable();" << endl;
+      out << "   " << GetName() << "->Disable();" << std::endl;
    }
-   out << endl;
+   out << std::endl;
 }
 
diff --git a/gui/gui/src/TGComboBox.cxx b/gui/gui/src/TGComboBox.cxx
index 27c33cbd98e..68d8bb03762 100644
--- a/gui/gui/src/TGComboBox.cxx
+++ b/gui/gui/src/TGComboBox.cxx
@@ -672,13 +672,13 @@ void TGComboBox::RemoveAll()
 }
 
 //______________________________________________________________________________
-void TGComboBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a combo box widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // combo box" << endl;
+   out << std::endl << "   // combo box" << std::endl;
    out << "   TGComboBox *";
 
    if (!fTextEntry) {
@@ -690,15 +690,15 @@ void TGComboBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetWhitePixel()) {
       if (GetOptions() == (kHorizontalFrame | kSunkenFrame | kDoubleBorder)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() << ");" << endl;
+         out << "," << GetOptionString() << ");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TGTextLBEntry *b;
    TGFrameElement *el;
@@ -710,12 +710,12 @@ void TGComboBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       b = (TGTextLBEntry *) el->fFrame;
       out << "   " << GetName() << "->AddEntry(";
       b->SavePrimitive(out, option);
-      out <<  ");" << endl;
+      out <<  ");" << std::endl;
    }
 
    out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
-       << GetHeight() << ");" << endl;
-   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << endl;
+       << GetHeight() << ");" << std::endl;
+   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -740,20 +740,20 @@ TGLineStyleComboBox::TGLineStyleComboBox(const TGWindow *p, Int_t id,
 }
 
 //______________________________________________________________________________
-void TGLineStyleComboBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGLineStyleComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a line style combo box widget as a C++ statement(s).
 
-   out << endl << "   // line style combo box" << endl;
+   out << std::endl << "   // line style combo box" << std::endl;
    out << "   TGLineStyleComboBox *";
 
    out << GetName() << " = new TGLineStyleComboBox(" << fParent->GetName()
-       << "," << fWidgetId << ");" << endl;
+       << "," << fWidgetId << ");" << std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
-       << GetHeight() << ");" << endl;
-   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << endl;
+       << GetHeight() << ");" << std::endl;
+   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -782,20 +782,20 @@ TGLineWidthComboBox::TGLineWidthComboBox(const TGWindow *p, Int_t id,
 }
 
 //______________________________________________________________________________
-void TGLineWidthComboBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGLineWidthComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a line width combo box widget as a C++ statement(s).
 
-   out << endl << "   // line width combo box" << endl;
+   out << std::endl << "   // line width combo box" << std::endl;
    out << "   TGLineWidthComboBox *";
 
    out << GetName() << " = new TGLineWidthComboBox(" << fParent->GetName()
-       << "," << fWidgetId << ");" << endl;
+       << "," << fWidgetId << ");" << std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
-       << GetHeight() << ");" << endl;
-   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << endl;
+       << GetHeight() << ");" << std::endl;
+   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
 }
 
 static const char *gFonts[][2] = {    //   unix name,     name
diff --git a/gui/gui/src/TGDockableFrame.cxx b/gui/gui/src/TGDockableFrame.cxx
index 4e76e5ec959..b6697461645 100644
--- a/gui/gui/src/TGDockableFrame.cxx
+++ b/gui/gui/src/TGDockableFrame.cxx
@@ -450,31 +450,31 @@ void TGDockableFrame::SetWindowName(const char *name)
 }
 
 //______________________________________________________________________________
-void TGDockableFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGDockableFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a dockable frame widget as a C++ statement(s) on output stream out.
 
    char quote = '"';
 
-   out << endl << "   // dockable frame" << endl;
+   out << std::endl << "   // dockable frame" << std::endl;
    out << "   TGDockableFrame *";
    out << GetName()<<" = new TGDockableFrame(" << fParent->GetName();
 
    if (GetOptions() == kHorizontalFrame) {
       if (fWidgetId == -1) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << fWidgetId << ");" << endl;
+         out << "," << fWidgetId << ");" << std::endl;
       }
    } else {
-      out << "," << fWidgetId << "," << GetOptionString() << ");" << endl;
+      out << "," << fWidgetId << "," << GetOptionString() << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (GetContainer()->GetList()->First()) {
       out << "   TGCompositeFrame *" << GetContainer()->GetName() << " = "
-          << GetName() << "->GetContainer();" << endl;
+          << GetName() << "->GetContainer();" << std::endl;
 
       TGFrameElement *el;
       TIter next(GetContainer()->GetList());
@@ -483,31 +483,31 @@ void TGDockableFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          el->fFrame->SavePrimitive(out, option);
          out << "   " << GetName() << "->AddFrame(" << el->fFrame->GetName();
          el->fLayout->SavePrimitive(out, option);
-         out << ");"<< endl;
+         out << ");"<< std::endl;
       }
    }
-   out << endl << "   // next lines belong to the dockable frame widget" << endl;
+   out << std::endl << "   // next lines belong to the dockable frame widget" << std::endl;
    if (EnableUndock())
-      out << "   " << GetName() << "->EnableUndock(kTRUE);" << endl;
+      out << "   " << GetName() << "->EnableUndock(kTRUE);" << std::endl;
    else
-      out << "   " << GetName() << "->EnableUndock(kFALSE);" << endl;
+      out << "   " << GetName() << "->EnableUndock(kFALSE);" << std::endl;
 
    if (EnableHide())
-      out << "   " << GetName() << "->EnableHide(kTRUE);" << endl;
+      out << "   " << GetName() << "->EnableHide(kTRUE);" << std::endl;
    else
-      out << "   " << GetName() << "->EnableHide(kFALSE);" << endl;
+      out << "   " << GetName() << "->EnableHide(kFALSE);" << std::endl;
 
    if (fDockName != "")
       out << "   " << GetName() << "->SetWindowName(" << quote << fDockName
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
 
    if (IsUndocked())
-      out << "   " << GetName() << "->UndockContainer();" << endl;
+      out << "   " << GetName() << "->UndockContainer();" << std::endl;
    else
-      out << "   " << GetName() << "->DockContainer();" << endl;
+      out << "   " << GetName() << "->DockContainer();" << std::endl;
 
    if (IsHidden())
-      out << "   " << GetName() << "->HideContainer();" << endl;
+      out << "   " << GetName() << "->HideContainer();" << std::endl;
 
-   out << endl;
+   out << std::endl;
 }
diff --git a/gui/gui/src/TGDoubleSlider.cxx b/gui/gui/src/TGDoubleSlider.cxx
index faa81bea15c..095eaac430e 100644
--- a/gui/gui/src/TGDoubleSlider.cxx
+++ b/gui/gui/src/TGDoubleSlider.cxx
@@ -590,7 +590,7 @@ Bool_t TGDoubleHSlider::HandleMotion(Event_t *event)
 }
 
 //______________________________________________________________________________
-void TGDoubleHSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGDoubleHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal slider as a C++ statement(s) on output stream out.
 
@@ -603,32 +603,32 @@ void TGDoubleHSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << GetOptionString() << ",ucolor";
    if (fMarkEnds) {
       if (fReversedScale)
-         out << ",kTRUE,kTRUE);" << endl;
+         out << ",kTRUE,kTRUE);" << std::endl;
       else
-         out << ",kFALSE,kTRUE);" << endl;
+         out << ",kFALSE,kTRUE);" << std::endl;
    } else if (fReversedScale) {
-      out << ",kTRUE);" << endl;
+      out << ",kTRUE);" << std::endl;
    } else {
-      out << ");" << endl;
+      out << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fVmin != 0 || fVmax != (Int_t)fWidth)
       out << "   " << GetName() << "->SetRange(" << fVmin << "," << fVmax
-          << ");" << endl;
+          << ");" << std::endl;
 
    if (fSmin != fWidth/8*3 || fSmax != fWidth/8*5)
       out << "   " << GetName() << "->SetPosition(" << GetMinPosition()
-          << "," << GetMaxPosition() << ");" << endl;
+          << "," << GetMaxPosition() << ");" << std::endl;
 
    if (fScale != 10)
-      out << "   " << GetName() << "->SetScale(" << fScale << ");" << endl;
+      out << "   " << GetName() << "->SetScale(" << fScale << ");" << std::endl;
 
 }
 
 //______________________________________________________________________________
-void TGDoubleVSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGDoubleVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal slider as a C++ statement(s) on output stream out.
 
@@ -641,28 +641,28 @@ void TGDoubleVSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << GetOptionString() << ",ucolor";
    if (fMarkEnds) {
       if (fReversedScale)
-         out << ",kTRUE,kTRUE);" << endl;
+         out << ",kTRUE,kTRUE);" << std::endl;
       else
-         out << ",kFALSE,kTRUE);" << endl;
+         out << ",kFALSE,kTRUE);" << std::endl;
    } else if (fReversedScale) {
-      out << ",kTRUE);" << endl;
+      out << ",kTRUE);" << std::endl;
    } else {
-      out << ");" << endl;
+      out << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fVmin != 0 || fVmax != (Int_t)fHeight)
       out << "   " << GetName() <<"->SetRange(" << fVmin << "," << fVmax
-          << ");" << endl;
+          << ");" << std::endl;
 
 
    if (fSmin != fHeight/8*3 || fSmax != fHeight/8*5)
       out << "   " << GetName() << "->SetPosition(" << GetMinPosition()
-          << "," << GetMaxPosition() << ");" << endl;
+          << "," << GetMaxPosition() << ");" << std::endl;
 
 
    if (fScale != 10)
-      out << "   " << GetName() << "->SetScale(" << fScale << ");" << endl;
+      out << "   " << GetName() << "->SetScale(" << fScale << ");" << std::endl;
 
 }
diff --git a/gui/gui/src/TGFSComboBox.cxx b/gui/gui/src/TGFSComboBox.cxx
index 93c3d73a285..6176db0422e 100644
--- a/gui/gui/src/TGFSComboBox.cxx
+++ b/gui/gui/src/TGFSComboBox.cxx
@@ -474,30 +474,30 @@ void TGFSComboBox::Update(const char *path)
 }
 
 //______________________________________________________________________________
-void TGFSComboBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGFSComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a file system combo box as a C++ statement(s) on output stream out.
 
    if (fBackground != GetWhitePixel()) SaveUserColor(out, option);
 
-   out << endl << "   // file system combo box" << endl;
+   out << std::endl << "   // file system combo box" << std::endl;
    out << "   TGFSComboBox *";
    out << GetName() << " = new TGFSComboBox(" << fParent->GetName()
                                           << "," << fWidgetId;
    if (fBackground == GetWhitePixel()) {
       if (GetOptions() == (kHorizontalFrame | kSunkenFrame | kDoubleBorder)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
-       << GetHeight() << ");" << endl;
-   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << endl;
+       << GetHeight() << ");" << std::endl;
+   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
 
 }
diff --git a/gui/gui/src/TGFSContainer.cxx b/gui/gui/src/TGFSContainer.cxx
index 3c6d4e4390e..09fb3f44c54 100644
--- a/gui/gui/src/TGFSContainer.cxx
+++ b/gui/gui/src/TGFSContainer.cxx
@@ -841,14 +841,14 @@ void TGFileContainer::StartRefreshTimer(ULong_t msec)
 }
 
 //______________________________________________________________________________
-void TGFileContainer::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGFileContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a file container widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
    char quote = '"';
-   out << endl << "   // container frame" << endl;
+   out << std::endl << "   // container frame" << std::endl;
    out << "   TGFileContainer *";
 
    if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class())) {
@@ -860,18 +860,18 @@ void TGFileContainer::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == kSunkenFrame) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    out << "   " << GetCanvas()->GetName() << "->SetContainer("
-                << GetName() << ");" << endl;
-   out << "   " << GetName() << "->DisplayDirectory();" << endl;
-   out << "   " << GetName() << "->AddFile("<< quote << ".." << quote << ");" << endl;
-   out << "   " << GetName() << "->StopRefreshTimer();" << endl;
+                << GetName() << ");" << std::endl;
+   out << "   " << GetName() << "->DisplayDirectory();" << std::endl;
+   out << "   " << GetName() << "->AddFile("<< quote << ".." << quote << ");" << std::endl;
+   out << "   " << GetName() << "->StopRefreshTimer();" << std::endl;
 }
diff --git a/gui/gui/src/TGFont.cxx b/gui/gui/src/TGFont.cxx
index 4e1bd22a7b5..d20ca734d20 100644
--- a/gui/gui/src/TGFont.cxx
+++ b/gui/gui/src/TGFont.cxx
@@ -1862,20 +1862,20 @@ void TGFontPool::Print(Option_t *opt) const
 }
 
 //______________________________________________________________________________
-void TGFont::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGFont::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
     // Save the used font as a C++ statement(s) on output stream out.
 
    char quote = '"';
 
    if (gROOT->ClassSaved(TGFont::Class())) {
-      out << endl;
+      out << std::endl;
    } else {
       //  declare a font object to reflect required user changes
-      out << endl;
-      out << "   TGFont *ufont;         // will reflect user font changes" << endl;
+      out << std::endl;
+      out << "   TGFont *ufont;         // will reflect user font changes" << std::endl;
    }
-   out << "   ufont = gClient->GetFont(" << quote << GetName() << quote << ");" << endl;
+   out << "   ufont = gClient->GetFont(" << quote << GetName() << quote << ");" << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/gui/gui/src/TGFrame.cxx b/gui/gui/src/TGFrame.cxx
index 0f9e5cc28e1..87d43dcbdd2 100644
--- a/gui/gui/src/TGFrame.cxx
+++ b/gui/gui/src/TGFrame.cxx
@@ -762,9 +762,9 @@ void TGFrame::Print(Option_t *option) const
       return;
    }
 
-   cout <<  option << ClassName() << ":\tid=" << fId << " parent=" << fParent->GetId();
-   cout << " x=" << fX << " y=" << fY;
-   cout << " w=" << fWidth << " h=" << fHeight << endl;
+   std::cout <<  option << ClassName() << ":\tid=" << fId << " parent=" << fParent->GetId();
+   std::cout << " x=" << fX << " y=" << fY;
+   std::cout << " w=" << fWidth << " h=" << fHeight << std::endl;
 }
 
 //______________________________________________________________________________
@@ -2408,18 +2408,18 @@ Bool_t TGHeaderFrame::HandleMotion(Event_t* event)
 }
 
 //______________________________________________________________________________
-void TGFrame::SaveUserColor(ostream &out, Option_t *option)
+void TGFrame::SaveUserColor(std::ostream &out, Option_t *option)
 {
    // Save a user color in a C++ macro file - used in SavePrimitive().
 
    char quote = '"';
 
    if (gROOT->ClassSaved(TGFrame::Class())) {
-      out << endl;
+      out << std::endl;
    } else {
       //  declare a color variable to reflect required user changes
-      out << endl;
-      out << "   ULong_t ucolor;        // will reflect user color changes" << endl;
+      out << std::endl;
+      out << "   ULong_t ucolor;        // will reflect user color changes" << std::endl;
    }
    ULong_t ucolor;
    if (option && !strcmp(option, "slider"))
@@ -2429,7 +2429,7 @@ void TGFrame::SaveUserColor(ostream &out, Option_t *option)
    if ((ucolor != fgUserColor) || (ucolor == GetWhitePixel())) {
       const char *ucolorname = TColor::PixelAsHexString(ucolor);
       out << "   gClient->GetColorByName(" << quote << ucolorname << quote
-          << ",ucolor);" << endl;
+          << ",ucolor);" << std::endl;
       fgUserColor = ucolor;
    }
 }
@@ -2596,12 +2596,12 @@ TString TGMainFrame::GetMWMinpString() const
 }
 
 //______________________________________________________________________________
-void TGCompositeFrame::SavePrimitiveSubframes(ostream &out, Option_t *option /*= ""*/)
+void TGCompositeFrame::SavePrimitiveSubframes(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Auxilary protected method  used to save subframes.
 
    if (fLayoutBroken)
-      out << "   " << GetName() << "->SetLayoutBroken(kTRUE);" << endl;
+      out << "   " << GetName() << "->SetLayoutBroken(kTRUE);" << std::endl;
 
    if (!fList) return;
 
@@ -2640,12 +2640,12 @@ void TGCompositeFrame::SavePrimitiveSubframes(ostream &out, Option_t *option /*=
       el->fFrame->SavePrimitive(out, option);
       out << "   " << GetName() << "->AddFrame(" << el->fFrame->GetName();
       el->fLayout->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
       if (IsLayoutBroken()) {
          out << "   " << el->fFrame->GetName() << "->MoveResize(";
          out << el->fFrame->GetX() << "," << el->fFrame->GetY() << ",";
          out << el->fFrame->GetWidth() << ","  << el->fFrame->GetHeight();
-         out << ");" << endl;
+         out << ");" << std::endl;
       }
       // TG(H,V)Splitter->SetFrame(theframe) can only be saved _AFTER_
       // having saved "theframe", when "theframe" is either at right
@@ -2654,14 +2654,14 @@ void TGCompositeFrame::SavePrimitiveSubframes(ostream &out, Option_t *option /*=
       // (aka used before to be created)...
       if (vsplit && el->fFrame == vsplit->GetFrame()) {
          out << "   " << vsplit->GetName() << "->SetFrame(" << vsplit->GetFrame()->GetName();
-         if (vsplit->GetLeft()) out << ",kTRUE);" << endl;
-         else                 out << ",kFALSE);"<< endl;
+         if (vsplit->GetLeft()) out << ",kTRUE);" << std::endl;
+         else                 out << ",kFALSE);"<< std::endl;
          vsplit = 0;
       }
       if (hsplit && el->fFrame == hsplit->GetFrame()) {
          out << "   " << hsplit->GetName() << "->SetFrame(" << hsplit->GetFrame()->GetName();
-         if (hsplit->GetAbove()) out << ",kTRUE);" << endl;
-         else                  out << ",kFALSE);"<< endl;
+         if (hsplit->GetAbove()) out << ",kTRUE);" << std::endl;
+         else                  out << ",kFALSE);"<< std::endl;
          hsplit = 0;
       }
 
@@ -2683,7 +2683,7 @@ void TGCompositeFrame::SavePrimitiveSubframes(ostream &out, Option_t *option /*=
             if (eq != -1)
                slot_name.Remove(eq, rb-eq);
             out << "   " << el->fFrame->GetName() << "->Connect(" << quote << signal_name
-                << quote << ", 0, 0, " << quote << slot_name << quote << ");" << endl;
+                << quote << ", 0, 0, " << quote << slot_name << quote << ");" << std::endl;
 
             TList *lsl = (TList *)gROOT->GetListOfSpecials()->FindObject("ListOfSlots");
             if (lsl) {
@@ -2694,11 +2694,11 @@ void TGCompositeFrame::SavePrimitiveSubframes(ostream &out, Option_t *option /*=
          }
       }
    }
-   out << endl;
+   out << std::endl;
 }
 
 //______________________________________________________________________________
-void TGCompositeFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGCompositeFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a composite frame widget as a C++ statement(s) on output stream out.
 
@@ -2709,22 +2709,22 @@ void TGCompositeFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       fgCounter++;
    }
 
-   out << endl << "   // composite frame" << endl;
+   out << std::endl << "   // composite frame" << std::endl;
    out << "   TGCompositeFrame *";
    out << GetName() << " = new TGCompositeFrame(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from the composite frame type
    // coverity[returned_null]
@@ -2739,7 +2739,7 @@ void TGCompositeFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
@@ -2822,7 +2822,7 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
    }
 
    char quote = '"';
-   ofstream out;
+   std::ofstream out;
 
    TString ff = filename && strlen(filename) ? filename : "Rootappl.C";
 
@@ -2840,7 +2840,7 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
       ff += ".C";
    sname[i] = 0;
 
-   out.open(ff.Data(), ios::out);
+   out.open(ff.Data(), std::ios::out);
    if (!out.good()) {
       Error("SaveSource", "cannot open file: %s", ff.Data());
       delete [] sname;
@@ -2858,22 +2858,22 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
 
    // write macro header, date/time stamp as string, and the used Root version
    TDatime t;
-   out <<"// Mainframe macro generated from application: "<< gApplication->Argv(0) << endl;
-   out <<"// By ROOT version "<< gROOT->GetVersion() <<" on "<<t.AsSQLString()<< endl;
-   out << endl;
+   out <<"// Mainframe macro generated from application: "<< gApplication->Argv(0) << std::endl;
+   out <<"// By ROOT version "<< gROOT->GetVersion() <<" on "<<t.AsSQLString()<< std::endl;
+   out << std::endl;
 
    TIter nexti(ilist);
    while((inc = (TObjString *)nexti())) {
-         out << "#ifndef ROOT_" << inc->GetString() << endl;
-         out << "#include " << quote << inc->GetString() << ".h" << quote << endl;
-         out << "#endif" << endl;
+         out << "#ifndef ROOT_" << inc->GetString() << std::endl;
+         out << "#include " << quote << inc->GetString() << ".h" << quote << std::endl;
+         out << "#endif" << std::endl;
          if (strstr(inc->GetString(),"TRootEmbeddedCanvas")) {
-            out << "#ifndef ROOT_TCanvas" << endl;
-            out << "#include " << quote << "TCanvas.h" << quote << endl;
-            out << "#endif" << endl;
+            out << "#ifndef ROOT_TCanvas" << std::endl;
+            out << "#include " << quote << "TCanvas.h" << quote << std::endl;
+            out << "#endif" << std::endl;
          }
    }
-   out << endl << "#include " << quote << "Riostream.h" << quote << endl;
+   out << std::endl << "#include " << quote << "Riostream.h" << quote << std::endl;
    // deletes created ListOfIncludes
    gROOT->GetListOfSpecials()->Remove(ilist);
    ilist->Delete();
@@ -2881,9 +2881,9 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
    delete bc;
 
    // writes the macro entry point equal to the fname
-   out << endl;
-   out << "void " << sname << "()" << endl;
-   out <<"{"<< endl;
+   out << std::endl;
+   out << "void " << sname << "()" << std::endl;
+   out <<"{"<< std::endl;
    delete [] sname;
 
    gListOfHiddenFrames->Clear();
@@ -2898,27 +2898,27 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
    GetClassHints((const char *&)fClassName, (const char *&)fResourceName);
    if (strlen(fClassName) || strlen(fResourceName)) {
       out << "   " << GetName() << "->SetClassHints(" << quote << fClassName
-          << quote << "," << quote << fResourceName << quote << ");" << endl;
+          << quote << "," << quote << fResourceName << quote << ");" << std::endl;
    }
 
    GetMWMHints(fMWMValue, fMWMFuncs, fMWMInput);
    if (fMWMValue || fMWMFuncs || fMWMInput) {
       out << "   " << GetName() << "->SetMWMHints(";
-      out << GetMWMvalueString() << "," << endl;
+      out << GetMWMvalueString() << "," << std::endl;
       out << "                        ";
-      out << GetMWMfuncString() << "," << endl;
+      out << GetMWMfuncString() << "," << std::endl;
       out << "                        ";
-      out << GetMWMinpString() << ");"<< endl;
+      out << GetMWMinpString() << ");"<< std::endl;
    }
 
 ///   GetWMPosition(fWMX, fWMY);
 ///   if ((fWMX != -1) || (fWMY != -1)) {
-///      out <<"   "<<GetName()<<"->SetWMPosition("<<fWMX<<","<<fWMY<<");"<<endl;
+///      out <<"   "<<GetName()<<"->SetWMPosition("<<fWMX<<","<<fWMY<<");"<<std::endl;
 ///   }   // does not work - fixed via Move() below...
 
    GetWMSize(fWMWidth, fWMHeight);
    if (fWMWidth != UInt_t(-1) || fWMHeight != UInt_t(-1)) {
-      out <<"   "<<GetName()<<"->SetWMSize("<<fWMWidth<<","<<fWMHeight<<");"<<endl;
+      out <<"   "<<GetName()<<"->SetWMSize("<<fWMWidth<<","<<fWMHeight<<");"<<std::endl;
    }
 
    GetWMSizeHints(fWMMinWidth, fWMMinHeight, fWMMaxWidth, fWMMaxHeight, fWMWidthInc, fWMHeightInc);
@@ -2927,18 +2927,18 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
       fWMWidthInc != UInt_t(-1) || fWMHeightInc != UInt_t(-1)) {
       out <<"   "<<GetName()<<"->SetWMSizeHints("<<fWMMinWidth<<","<<fWMMinHeight
           <<","<<fWMMaxWidth<<","<<fWMMaxHeight
-          <<","<<fWMWidthInc<<","<<fWMHeightInc <<");"<<endl;
+          <<","<<fWMWidthInc<<","<<fWMHeightInc <<");"<<std::endl;
    }
 
-   out << "   " <<GetName()<< "->MapSubwindows();" << endl;
+   out << "   " <<GetName()<< "->MapSubwindows();" << std::endl;
 
    TIter nexth(gListOfHiddenFrames);
    TGFrame *fhidden;
    while ((fhidden = (TGFrame*)nexth())) {
-      out << "   " <<fhidden->GetName()<< "->UnmapWindow();" << endl;
+      out << "   " <<fhidden->GetName()<< "->UnmapWindow();" << std::endl;
    }
 
-   out << endl;
+   out << std::endl;
    gListOfHiddenFrames->Clear();
 
    Bool_t usexy = kFALSE;
@@ -2949,21 +2949,21 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
       usexy = kTRUE;
 
    if (!usexy)
-      out << "   " <<GetName()<< "->Resize("<< GetName()<< "->GetDefaultSize());" << endl;
+      out << "   " <<GetName()<< "->Resize("<< GetName()<< "->GetDefaultSize());" << std::endl;
    else
-      out << "   " <<GetName()<< "->Resize("<< GetWidth()<<","<<GetHeight()<<");"<<endl;
+      out << "   " <<GetName()<< "->Resize("<< GetWidth()<<","<<GetHeight()<<");"<<std::endl;
 
-   out << "   " <<GetName()<< "->MapWindow();" <<endl;
+   out << "   " <<GetName()<< "->MapWindow();" <<std::endl;
 
    GetWMPosition(fWMX, fWMY);
    if ((fWMX != -1) || (fWMY != -1)) {
-      out <<"   "<<GetName()<<"->Move("<<fWMX<<","<<fWMY<<");"<<endl;
+      out <<"   "<<GetName()<<"->Move("<<fWMX<<","<<fWMY<<");"<<std::endl;
    }
 
    // needed in case the frame was resized
    // otherwhice the frame became bigger showing all hidden widgets (layout algorithm)
-   if (!usexy) out << "   " <<GetName()<< "->Resize("<< GetWidth()<<","<<GetHeight()<<");"<<endl;
-   out << "}  " << endl;
+   if (!usexy) out << "   " <<GetName()<< "->Resize("<< GetWidth()<<","<<GetHeight()<<");"<<std::endl;
+   out << "}  " << std::endl;
 
    // writing slots
    TList *sl = (TList *)gROOT->GetListOfSpecials()->FindObject("ListOfSlots");
@@ -2979,34 +2979,34 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
          lb = s.First('(');
          rb = s.First(')');
          eq = s.First('=');
-         out << endl;
+         out << std::endl;
 
          if (rb - lb > 1 && eq == -1) {
             p = TString::Format(" par%d", pnumber);
             s.Insert(rb, p);
             pnumber++;
-            out << "void " << s << endl;
-            out << "{" << endl;
+            out << "void " << s << std::endl;
+            out << "{" << std::endl;
             s = slobj->GetString();
             s[rb] = ' ';
-            out << "   cout << " << quote << "Slot " << s  << quote
+            out << "   std::cout << " << quote << "Slot " << s  << quote
                 << " <<" << p << " << " << quote << ")" << quote
-                << " << endl; " << endl;
+                << " << std::endl; " << std::endl;
             } else {
                if (eq != -1) {
                   s.Remove(eq, rb-eq);
-                  out << "void " << s << endl;
-                  out << "{" << endl;
-                  out << "   cout << " << quote << "Slot " << s
-                      << quote << " << endl; " << endl;
+                  out << "void " << s << std::endl;
+                  out << "{" << std::endl;
+                  out << "   std::cout << " << quote << "Slot " << s
+                      << quote << " << std::endl; " << std::endl;
                } else {
-                  out << "void " << slobj->GetString() << endl;
-                  out << "{" << endl;
-                  out << "   cout << " << quote << "Slot " << slobj->GetString()
-                      << quote << " << endl; " << endl;
+                  out << "void " << slobj->GetString() << std::endl;
+                  out << "{" << std::endl;
+                  out << "   std::cout << " << quote << "Slot " << slobj->GetString()
+                      << quote << " << std::endl; " << std::endl;
                }
             }
-         out << "}" << endl;
+         out << "}" << std::endl;
       }
       gROOT->GetListOfSpecials()->Remove(sl);
       sl->Delete();
@@ -3025,7 +3025,7 @@ void TGMainFrame::SaveSource(const char *filename, Option_t *option)
 }
 
 //______________________________________________________________________________
-void TGMainFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGMainFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a main frame widget as a C++ statement(s) on output stream out.
 
@@ -3038,12 +3038,12 @@ void TGMainFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    char quote = '"';
 
-   out << endl << "   // main frame" << endl;
+   out << std::endl << "   // main frame" << std::endl;
    out << "   TGMainFrame *";
    out << GetName() << " = new TGMainFrame(gClient->GetRoot(),10,10,"   // layout alg.
-       << GetOptionString() << ");" <<endl;
+       << GetOptionString() << ");" <<std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from the main frame type
    // coverity[returned_null]
@@ -3058,47 +3058,47 @@ void TGMainFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
 
    if (strlen(fWindowName)) {
       out << "   " << GetName() << "->SetWindowName(" << quote << GetWindowName()
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
    if (strlen(fIconName)) {
-      out <<"   "<<GetName()<< "->SetIconName("<<quote<<GetIconName()<<quote<<");"<<endl;
+      out <<"   "<<GetName()<< "->SetIconName("<<quote<<GetIconName()<<quote<<");"<<std::endl;
    }
    if (strlen(fIconPixmap)) {
       out << "   " << GetName() << "->SetIconPixmap(" << quote << GetIconPixmap()
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGHorizontalFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHorizontalFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a horizontal frame widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // horizontal frame" << endl;
+   out << std::endl << "   // horizontal frame" << std::endl;
    out << "   TGHorizontalFrame *";
    out << GetName() << " = new TGHorizontalFrame(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from the main frame type
    // coverity[returned_null]
@@ -3113,35 +3113,35 @@ void TGHorizontalFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
 }
 
 //______________________________________________________________________________
-void TGVerticalFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVerticalFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a vertical frame widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // vertical frame" << endl;
+   out << std::endl << "   // vertical frame" << std::endl;
    out << "   TGVerticalFrame *";
    out << GetName() << " = new TGVerticalFrame(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from the main frame type
    // coverity[returned_null]
@@ -3156,14 +3156,14 @@ void TGVerticalFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
 }
 
 //______________________________________________________________________________
-void TGFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a frame widget as a C++ statement(s) on output stream out.
 
@@ -3175,19 +3175,19 @@ void TGFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGGroupFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGGroupFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a group frame widget as a C++ statement(s) on output stream out.
 
@@ -3219,7 +3219,7 @@ void TGGroupFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // " << quote << GetTitle() << quote << " group frame" << endl;
+   out << std::endl << "   // " << quote << GetTitle() << quote << " group frame" << std::endl;
    out << "   TGGroupFrame *";
    out << GetName() <<" = new TGGroupFrame("<<fParent->GetName()
        << "," << quote << GetTitle() << quote;
@@ -3228,28 +3228,28 @@ void TGGroupFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (fFontStruct == GetDefaultFontStruct()) {
          if (fNormGC == GetDefaultGC()()) {
             if (GetOptions() & kVerticalFrame) {
-               out <<");" << endl;
+               out <<");" << std::endl;
             } else {
-               out << "," << GetOptionString() <<");" << endl;
+               out << "," << GetOptionString() <<");" << std::endl;
             }
          } else {
-            out << "," << GetOptionString() << "," << parGC.Data() <<");" << endl;
+            out << "," << GetOptionString() << "," << parGC.Data() <<");" << std::endl;
          }
       } else {
-         out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ");" << endl;
+         out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);"  << endl;
+      out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);"  << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (GetTitlePos() != -1)
       out << "   " << GetName() <<"->SetTitlePos(";
    if (GetTitlePos() == 0)
-      out << "TGGroupFrame::kCenter);" << endl;
+      out << "TGGroupFrame::kCenter);" << std::endl;
    if (GetTitlePos() == 1)
-      out << "TGGroupFrame::kRight);" << endl;
+      out << "TGGroupFrame::kRight);" << std::endl;
 
    SavePrimitiveSubframes(out, option);
 
@@ -3258,10 +3258,10 @@ void TGGroupFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    // coverity[returned_null]
    // coverity[dereference]
    GetLayoutManager()->SavePrimitive(out, option);
-   out << ");"<< endl;
+   out << ");"<< std::endl;
 
    out << "   " << GetName() <<"->Resize(" << GetWidth() << ","
-       << GetHeight() << ");" << endl;
+       << GetHeight() << ");" << std::endl;
 }
 
 
@@ -3334,7 +3334,7 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
    }
 
    char quote = '"';
-   ofstream out;
+   std::ofstream out;
 
    TString ff = filename && strlen(filename) ? filename : "Rootdlog.C";
 
@@ -3352,7 +3352,7 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
       ff += ".C";
    sname[i] = 0;
 
-   out.open(ff.Data(), ios::out);
+   out.open(ff.Data(), std::ios::out);
    if (!out.good()) {
       Error("SaveSource", "cannot open file: %s", ff.Data());
       delete [] sname;
@@ -3370,25 +3370,25 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
 
    // write macro header, date/time stamp as string, and the used Root version
    TDatime t;
-   out <<"// Dialog macro generated from application: "<< gApplication->Argv(0) << endl;
-   out <<"// By ROOT version "<< gROOT->GetVersion() <<" on "<<t.AsSQLString()<< endl;
-   out << endl;
+   out <<"// Dialog macro generated from application: "<< gApplication->Argv(0) << std::endl;
+   out <<"// By ROOT version "<< gROOT->GetVersion() <<" on "<<t.AsSQLString()<< std::endl;
+   out << std::endl;
 
-   out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << endl << endl;
+   out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << std::endl << std::endl;
 
    TIter nexti(ilist);
    while((inc = (TObjString *)nexti())) {
-      out <<"#ifndef ROOT_"<< inc->GetString() << endl;
-      out <<"#include "<< quote << inc->GetString() <<".h"<< quote << endl;
-      out <<"#endif" << endl;
+      out <<"#ifndef ROOT_"<< inc->GetString() << std::endl;
+      out <<"#include "<< quote << inc->GetString() <<".h"<< quote << std::endl;
+      out <<"#endif" << std::endl;
       if (strstr(inc->GetString(),"TRootEmbeddedCanvas")) {
-         out <<"#ifndef ROOT_TCanvas"<< endl;
-         out <<"#include "<< quote <<"TCanvas.h"<< quote << endl;
-         out <<"#endif" << endl;
+         out <<"#ifndef ROOT_TCanvas"<< std::endl;
+         out <<"#include "<< quote <<"TCanvas.h"<< quote << std::endl;
+         out <<"#endif" << std::endl;
       }
    }
-   out << endl << "#include " << quote << "Riostream.h" << quote << endl;
-   out << endl << "#endif" << endl;
+   out << std::endl << "#include " << quote << "Riostream.h" << quote << std::endl;
+   out << std::endl << "#endif" << std::endl;
    // deletes created ListOfIncludes
    gROOT->GetListOfSpecials()->Remove(ilist);
    ilist->Delete();
@@ -3396,12 +3396,12 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
    delete bc;
 
    // writes the macro entry point equal to the fname
-   out << endl;
-   out << "void " << sname << "()" << endl;
+   out << std::endl;
+   out << "void " << sname << "()" << std::endl;
    delete [] sname;
 
    //  Save GUI widgets as a C++ macro in a file
-   out <<"{"<< endl;
+   out <<"{"<< std::endl;
 
    gListOfHiddenFrames->Clear();
 
@@ -3416,27 +3416,27 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
    if (strlen(fClassName) || strlen(fResourceName)) {
       out<<"   "<<GetName()<< "->SetClassHints("<<quote<<fClassName<<quote
                                             <<"," <<quote<<fResourceName<<quote
-                                            <<");"<<endl;
+                                            <<");"<<std::endl;
    }
 
    GetMWMHints(fMWMValue, fMWMFuncs, fMWMInput);
    if (fMWMValue || fMWMFuncs || fMWMInput) {
       out << "   " << GetName() << "->SetMWMHints(";
-      out << GetMWMvalueString() << "," << endl;
+      out << GetMWMvalueString() << "," << std::endl;
       out << "                        ";
-      out << GetMWMfuncString() << "," << endl;
+      out << GetMWMfuncString() << "," << std::endl;
       out << "                        ";
-      out << GetMWMinpString() << ");"<< endl;
+      out << GetMWMinpString() << ");"<< std::endl;
    }
 
    GetWMPosition(fWMX, fWMY);
    if ((fWMX != -1) || (fWMY != -1)) {
-      out <<"   "<<GetName()<<"->SetWMPosition("<<fWMX<<","<<fWMY<<");"<<endl;
+      out <<"   "<<GetName()<<"->SetWMPosition("<<fWMX<<","<<fWMY<<");"<<std::endl;
    }
 
    GetWMSize(fWMWidth, fWMHeight);
    if (fWMWidth != UInt_t(-1) || fWMHeight != UInt_t(-1)) {
-      out <<"   "<<GetName()<<"->SetWMSize("<<fWMWidth<<","<<fWMHeight<<");"<<endl;
+      out <<"   "<<GetName()<<"->SetWMSize("<<fWMWidth<<","<<fWMHeight<<");"<<std::endl;
    }
 
    GetWMSizeHints(fWMMinWidth,fWMMinHeight,fWMMaxWidth,fWMMaxHeight,fWMWidthInc,fWMHeightInc);
@@ -3446,22 +3446,22 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
 
       out <<"   "<<GetName()<<"->SetWMSizeHints("<<fWMMinWidth<<","<<fWMMinHeight
           <<","<<fWMMaxWidth<<","<<fWMMaxHeight <<","<<fWMWidthInc<<","<<fWMHeightInc
-          <<");"<<endl;
+          <<");"<<std::endl;
    }
 
    GetWMPosition(fWMX, fWMY);
    if ((fWMX != -1) || (fWMY != -1)) {
-      out <<"   "<<GetName()<<"->Move("<<fWMX<<","<<fWMY<<");"<<endl;
+      out <<"   "<<GetName()<<"->Move("<<fWMX<<","<<fWMY<<");"<<std::endl;
    }
 
-   out << "   " <<GetName()<< "->MapSubwindows();" << endl;
+   out << "   " <<GetName()<< "->MapSubwindows();" << std::endl;
 
    TIter nexth(gListOfHiddenFrames);
    TGFrame *fhidden;
    while ((fhidden = (TGFrame*)nexth())) {
-      out << "   " <<fhidden->GetName()<< "->UnmapWindow();" << endl;
+      out << "   " <<fhidden->GetName()<< "->UnmapWindow();" << std::endl;
    }
-   out << endl;
+   out << std::endl;
    gListOfHiddenFrames->Clear();
 
    Bool_t usexy = kFALSE;
@@ -3472,13 +3472,13 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
       usexy = kTRUE;
 
    if (!usexy)
-      out << "   " <<GetName()<< "->Resize("<< GetName()<< "->GetDefaultSize());" << endl;
+      out << "   " <<GetName()<< "->Resize("<< GetName()<< "->GetDefaultSize());" << std::endl;
    else
-      out << "   " <<GetName()<< "->Resize("<< GetWidth()<<","<<GetHeight()<<");"<<endl;
+      out << "   " <<GetName()<< "->Resize("<< GetWidth()<<","<<GetHeight()<<");"<<std::endl;
 
-   out << "   " <<GetName()<< "->MapWindow();" <<endl;
-   if (!usexy) out << "   " <<GetName()<< "->Resize();" << endl;
-   out << "}  " << endl;
+   out << "   " <<GetName()<< "->MapWindow();" <<std::endl;
+   if (!usexy) out << "   " <<GetName()<< "->Resize();" << std::endl;
+   out << "}  " << std::endl;
 
    // writing slots
    TList *sl = (TList *)gROOT->GetListOfSpecials()->FindObject("ListOfSlots");
@@ -3494,34 +3494,34 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
          lb = s.First('(');
          rb = s.First(')');
          eq = s.First('=');
-         out << endl;
+         out << std::endl;
 
          if (rb - lb > 1 && eq == -1) {
             p = TString::Format(" par%d", pnumber);
             s.Insert(rb, p);
             pnumber++;
-            out << "void " << s << endl;
-            out << "{" << endl;
+            out << "void " << s << std::endl;
+            out << "{" << std::endl;
             s = slobj->GetString();
             s[rb] = ' ';
-            out << "   cout << " << quote << "Slot " << s  << quote
+            out << "   std::cout << " << quote << "Slot " << s  << quote
                 << " <<" << p << " << " << quote << ")" << quote
-                << " << endl; " << endl;
+                << " << std::endl; " << std::endl;
             } else {
                if (eq != -1) {
                   s.Remove(eq, rb-eq);
-                  out << "void " << s << endl;
-                  out << "{" << endl;
-                  out << "   cout << " << quote << "Slot " << s
-                      << quote << " << endl; " << endl;
+                  out << "void " << s << std::endl;
+                  out << "{" << std::endl;
+                  out << "   std::cout << " << quote << "Slot " << s
+                      << quote << " << std::endl; " << std::endl;
                } else {
-                  out << "void " << slobj->GetString() << endl;
-                  out << "{" << endl;
-                  out << "   cout << " << quote << "Slot " << slobj->GetString()
-                      << quote << " << endl; " << endl;
+                  out << "void " << slobj->GetString() << std::endl;
+                  out << "{" << std::endl;
+                  out << "   std::cout << " << quote << "Slot " << slobj->GetString()
+                      << quote << " << std::endl; " << std::endl;
                }
             }
-         out << "}" << endl;
+         out << "}" << std::endl;
       }
       gROOT->GetListOfSpecials()->Remove(sl);
       sl->Delete();
@@ -3541,19 +3541,19 @@ void TGTransientFrame::SaveSource(const char *filename, Option_t *option)
 }
 
 //______________________________________________________________________________
-void TGTransientFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTransientFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a transient frame widget as a C++ statement(s) on output stream out.
 
    char quote = '"';
 
-   out << endl << "   // transient frame" << endl;
+   out << std::endl << "   // transient frame" << std::endl;
    out << "   TGTransientFrame *";
    out << GetName()<<" = new TGTransientFrame(gClient->GetRoot(),0"
-       << "," << GetWidth() << "," << GetHeight() << "," << GetOptionString() <<");" << endl;
+       << "," << GetWidth() << "," << GetHeight() << "," << GetOptionString() <<");" << std::endl;
 
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from transient frame type
    // coverity[returned_null]
@@ -3568,20 +3568,20 @@ void TGTransientFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
 
    if (strlen(fWindowName)) {
       out << "   " << GetName() << "->SetWindowName(" << quote << GetWindowName()
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
    if (strlen(fIconName)) {
-      out <<"   "<<GetName()<< "->SetIconName("<<quote<<GetIconName()<<quote<<");"<<endl;
+      out <<"   "<<GetName()<< "->SetIconName("<<quote<<GetIconName()<<quote<<");"<<std::endl;
    }
    if (strlen(fIconPixmap)) {
       out << "   " << GetName() << "->SetIconPixmap(" << quote << GetIconPixmap()
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
 }
diff --git a/gui/gui/src/TGGC.cxx b/gui/gui/src/TGGC.cxx
index fb8c82fd45e..cc86a784a68 100644
--- a/gui/gui/src/TGGC.cxx
+++ b/gui/gui/src/TGGC.cxx
@@ -620,16 +620,16 @@ TString TGGC::GetMaskString() const
 }
 
 //______________________________________________________________________________
-void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGGC::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save graphics context info as a C++ statement(s) on output stream out
 
    if (gROOT->ClassSaved(TGGC::Class())) {
-      out << endl;
+      out << std::endl;
    } else {
       //  declare graphics context object to reflect required user changes
-      out << endl;
-      out << "   TGGC   *uGC;           // will reflect user GC changes" << endl;
+      out << std::endl;
+      out << "   TGGC   *uGC;           // will reflect user GC changes" << std::endl;
    }
 
    Mask_t fmask = GetMask();
@@ -641,10 +641,10 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    valname = TString::Format("val%s", option);
 
-   out << "   // graphics context changes" << endl;
-   //out << "   TGGC *uGC" << option << ";" << endl;
-   out << "   GCValues_t " << valname.Data() << ";" << endl;
-   out << "   " << valname.Data() << ".fMask = " << GetMaskString() << ";" << endl;
+   out << "   // graphics context changes" << std::endl;
+   //out << "   TGGC *uGC" << option << ";" << std::endl;
+   out << "   GCValues_t " << valname.Data() << ";" << std::endl;
+   out << "   " << valname.Data() << ".fMask = " << GetMaskString() << ";" << std::endl;
 
    for (Mask_t bit = 1; bit <= fmask; bit <<= 1) {
       switch (bit & fmask) {
@@ -703,25 +703,25 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kGXset";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCPlaneMask:
-            out << "   " << valname.Data() << ".fPlaneMask = " << GetPlaneMask() << ";" << endl;
+            out << "   " << valname.Data() << ".fPlaneMask = " << GetPlaneMask() << ";" << std::endl;
             break;
          case kGCForeground:
             color = GetForeground();
             colorname = TColor::PixelAsHexString(color);
             out << "   gClient->GetColorByName(" << quote << colorname << quote
-                << "," << valname.Data() << ".fForeground);" << endl;
+                << "," << valname.Data() << ".fForeground);" << std::endl;
             break;
          case kGCBackground:
             color = GetBackground();
             colorname = TColor::PixelAsHexString(color);
             out << "   gClient->GetColorByName(" << quote << colorname << quote
-                << "," << valname.Data() << ".fBackground);" << endl;
+                << "," << valname.Data() << ".fBackground);" << std::endl;
             break;
          case kGCLineWidth:
-            out << "   " << valname.Data() << ".fLineWidth = " << GetLineWidth() << ";" << endl;
+            out << "   " << valname.Data() << ".fLineWidth = " << GetLineWidth() << ";" << std::endl;
             break;
          case kGCLineStyle:
             out << "   " << valname.Data() << ".fLineStyle = ";
@@ -736,7 +736,7 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kLineDoubleDash";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCCapStyle:
             out << "   " << valname.Data() << ".fCapStyle = ";
@@ -754,7 +754,7 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kCapProjecting";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCJoinStyle:
             out << "   " << valname.Data() << ".fJoinStyle = ";
@@ -769,7 +769,7 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kJoinBevel";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCFillStyle:
             out << "   " << valname.Data() << ".fFillStyle = ";
@@ -787,7 +787,7 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kFillOpaqueStippled";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCFillRule:
             out << "   " << valname.Data() << ".fFillRule = ";
@@ -799,22 +799,22 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kWindingRule";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCTile:
-            out << "   " << valname.Data() << ".fTile = " << GetTile() << ";" << endl;
+            out << "   " << valname.Data() << ".fTile = " << GetTile() << ";" << std::endl;
             break;
          case kGCStipple:
-            out << "   " << valname.Data() << ".fStipple = " << GetStipple() << ";" << endl;
+            out << "   " << valname.Data() << ".fStipple = " << GetStipple() << ";" << std::endl;
             break;
          case kGCTileStipXOrigin:
-            out << "   " << valname.Data() << ".fTsXOrigin = " << GetTileStipXOrigin() << ";" << endl;
+            out << "   " << valname.Data() << ".fTsXOrigin = " << GetTileStipXOrigin() << ";" << std::endl;
             break;
          case kGCTileStipYOrigin:
-            out << "   " << valname.Data() << ".fTsYOrigin = " << GetTileStipYOrigin() << ";" << endl;
+            out << "   " << valname.Data() << ".fTsYOrigin = " << GetTileStipYOrigin() << ";" << std::endl;
             break;
          case kGCFont:
-            out << "   " << valname.Data() << ".fFont = ufont->GetFontHandle();" << endl;
+            out << "   " << valname.Data() << ".fFont = ufont->GetFontHandle();" << std::endl;
             break;
          case kGCSubwindowMode:
             out << "   " << valname.Data() << ".fSubwindowMode = ";
@@ -826,7 +826,7 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kIncludeInferiors";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCGraphicsExposures:
             out << "   " << valname.Data() << ".fGraphicsExposures = ";
@@ -834,28 +834,28 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                out << "kTRUE";
             else
                out << "kFALSE";
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
          case kGCClipXOrigin:
-            out << "   " << valname.Data() << ".fClipXOrigin = " << GetClipXOrigin() << ";" << endl;
+            out << "   " << valname.Data() << ".fClipXOrigin = " << GetClipXOrigin() << ";" << std::endl;
             break;
          case kGCClipYOrigin:
-            out << "   " << valname.Data() << ".fClipYOrigin = " << GetClipYOrigin() << ";" << endl;
+            out << "   " << valname.Data() << ".fClipYOrigin = " << GetClipYOrigin() << ";" << std::endl;
             break;
          case kGCClipMask:
-            out << "   " << valname.Data() << ".fClipMask = " << GetClipMask() << ";" << endl;
+            out << "   " << valname.Data() << ".fClipMask = " << GetClipMask() << ";" << std::endl;
             break;
          case kGCDashOffset:
-            out << "   " << valname.Data() << ".fDashOffset = " << GetDashOffset() << ";" << endl;
+            out << "   " << valname.Data() << ".fDashOffset = " << GetDashOffset() << ";" << std::endl;
             break;
          case kGCDashList:
             if (GetDashLen() > (Int_t)sizeof(GetDashes()))
                Warning("TGGC::SavePrimitive", "dash list can have only up to %ld elements",
                        (Long_t)sizeof(GetDashes()));
             out << "   " << valname.Data() << ".fDashLen = "
-                << TMath::Min(GetDashLen(),(Int_t)sizeof(GetDashes())) << ";" << endl;
+                << TMath::Min(GetDashLen(),(Int_t)sizeof(GetDashes())) << ";" << std::endl;
             out << "   memcpy(GetDashes()," << valname.Data() << ".fDashes,"
-                                            << valname.Data() << ".fDashLen);" << endl;
+                                            << valname.Data() << ".fDashLen);" << std::endl;
             break;
          case kGCArcMode:
             out << "   " << valname.Data() << ".fArcMode = ";
@@ -867,11 +867,11 @@ void TGGC::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                   out << "kArcPieSlice";
                   break;
             }
-            out << ";" << endl;
+            out << ";" << std::endl;
             break;
       }
    }
-   out << "   uGC = gClient->GetGC(&" << valname.Data() << ", kTRUE);" << endl;
+   out << "   uGC = gClient->GetGC(&" << valname.Data() << ", kTRUE);" << std::endl;
 }
 
 
diff --git a/gui/gui/src/TGIcon.cxx b/gui/gui/src/TGIcon.cxx
index 813765700da..52fb82d34dd 100644
--- a/gui/gui/src/TGIcon.cxx
+++ b/gui/gui/src/TGIcon.cxx
@@ -197,7 +197,7 @@ void TGIcon::SetImagePath(const char *path)
 }
 
 //______________________________________________________________________________
-void TGIcon::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGIcon::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an icon widget as a C++ statement(s) on output stream out.
 
@@ -220,12 +220,12 @@ void TGIcon::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          << quote << ")" << "," << GetWidth() << "," << GetHeight();
       if (fBackground == GetDefaultFrameBackground()) {
          if (!GetOptions()) {
-            out <<");" << endl;
+            out <<");" << std::endl;
          } else {
-            out << "," << GetOptionString() <<");" << endl;
+            out << "," << GetOptionString() <<");" << std::endl;
          }
       } else {
-         out << "," << GetOptionString() << ",ucolor);" << endl;
+         out << "," << GetOptionString() << ",ucolor);" << std::endl;
       }
    } else {
       TString name = fPath;
@@ -233,8 +233,8 @@ void TGIcon::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       name += fImage->GetName();
       name.Chop();
       out << GetName() << " = new TGIcon(" << fParent->GetName()  << ","
-          << quote << name.Data() << quote << ");" << endl;
+          << quote << name.Data() << quote << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 }
diff --git a/gui/gui/src/TGLabel.cxx b/gui/gui/src/TGLabel.cxx
index b7752230ac9..2a84781baf2 100644
--- a/gui/gui/src/TGLabel.cxx
+++ b/gui/gui/src/TGLabel.cxx
@@ -451,7 +451,7 @@ Bool_t TGLabel::HasOwnFont() const
 }
 
 //______________________________________________________________________________
-void TGLabel::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGLabel::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a label widget as a C++ statement(s) on output stream out.
 
@@ -490,29 +490,29 @@ void TGLabel::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (!GetOptions()) {
          if (fFont->GetFontStruct() == GetDefaultFontStruct()) {
             if (fNormGC == GetDefaultGC()()) {
-               out <<");" << endl;
+               out <<");" << std::endl;
             } else {
-               out << "," << parGC.Data() << ");" << endl;
+               out << "," << parGC.Data() << ");" << std::endl;
             }
          } else {
-            out << "," << parGC.Data() << "," << parFont.Data() << ");" << endl;
+            out << "," << parGC.Data() << "," << parFont.Data() << ");" << std::endl;
          }
       } else {
-         out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() <<");" << endl;
+         out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fDisabled)
-      out << "   " << GetName() << "->Disable();" << endl;
+      out << "   " << GetName() << "->Disable();" << std::endl;
 
-   out << "   " << GetName() << "->SetTextJustify(" <<  GetTextJustify() << ");" << endl;
+   out << "   " << GetName() << "->SetTextJustify(" <<  GetTextJustify() << ");" << std::endl;
    out << "   " << GetName() << "->SetMargins(" << fMLeft << "," << fMRight << ",";
-   out << fMTop << "," << fMBottom << ");" << endl;
-   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << endl;
+   out << fMTop << "," << fMBottom << ");" << std::endl;
+   out << "   " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << std::endl;
 
 }
 
diff --git a/gui/gui/src/TGLayout.cxx b/gui/gui/src/TGLayout.cxx
index ab17602fd93..56f9c3db7ac 100644
--- a/gui/gui/src/TGLayout.cxx
+++ b/gui/gui/src/TGLayout.cxx
@@ -100,14 +100,14 @@ void TGFrameElement::Print(Option_t *option) const
 
    TObject::Print(option);
 
-   cout << "\t";
+   std::cout << "\t";
    if (fFrame) {
-      cout << fFrame->ClassName() << "::" << fFrame->GetName();
+      std::cout << fFrame->ClassName() << "::" << fFrame->GetName();
    }
    if (fLayout) {
       fLayout->Print(option);
    }
-   cout << endl;
+   std::cout << std::endl;
 }
 
 //______________________________________________________________________________
@@ -153,53 +153,53 @@ void TGLayoutHints::Print(Option_t *) const
    Bool_t bor = kFALSE;
 
    if (fLayoutHints & kLHintsLeft) {
-      cout << "kLHintsLeft";
+      std::cout << "kLHintsLeft";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsCenterX) {
-      if (bor) cout << " | ";
-      cout << "kLHintsCenterX";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsCenterX";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsRight) {
-      if (bor) cout << " | ";
-      cout << "kLHintsRight";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsRight";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsTop) {
-      if (bor) cout << " | ";
-      cout << "kLHintsTop";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsTop";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsCenterY) {
-      if (bor) cout << " | ";
-      cout << "kLHintsCenterY";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsCenterY";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsBottom) {
-      if (bor) cout << " | ";
-      cout << "kLHintsBottom";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsBottom";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsExpandX) {
-      if (bor) cout << " | ";
-      cout << "kLHintsExpandX";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsExpandX";
       bor = kTRUE;
    }
    if (fLayoutHints & kLHintsExpandY) {
-      if (bor) cout << " | ";
-      cout << "kLHintsExpandY";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsExpandY";
       bor = kTRUE;
    }
    if (fLayoutHints == kLHintsNoHints) {
-      if (bor) cout << " | ";
-      cout << "kLHintsNoHints";
+      if (bor) std::cout << " | ";
+      std::cout << "kLHintsNoHints";
    }
-   cout << ", fPadtop="    << fPadtop;
-   cout << ", fPadbottom=" << fPadbottom;
-   cout << ", fPadleft="   << fPadleft;
-   cout << ", fPadright="  << fPadright;
-   cout << endl;
+   std::cout << ", fPadtop="    << fPadtop;
+   std::cout << ", fPadbottom=" << fPadbottom;
+   std::cout << ", fPadleft="   << fPadleft;
+   std::cout << ", fPadright="  << fPadright;
+   std::cout << std::endl;
 }
 
 //______________________________________________________________________________
@@ -1000,7 +1000,7 @@ TGDimension TGListDetailsLayout::GetDefaultSize() const
 }
 
 // ________________________________________________________________________
-void TGLayoutHints::SavePrimitive(ostream &out, Option_t * option/*= ""*/)
+void TGLayoutHints::SavePrimitive(std::ostream &out, Option_t * option/*= ""*/)
 {
 
    // Save layout hints as a C++ statement(s) on output stream out
@@ -1060,7 +1060,7 @@ void TGLayoutHints::SavePrimitive(ostream &out, Option_t * option/*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGVerticalLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGVerticalLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save vertical layout manager as a C++ statement(s) on output stream
@@ -1070,7 +1070,7 @@ void TGVerticalLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGHorizontalLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGHorizontalLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save horizontal layout manager as a C++ statement(s) on output stream
@@ -1079,7 +1079,7 @@ void TGHorizontalLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGRowLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGRowLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save row layout manager as a C++ statement(s) on output stream
@@ -1089,7 +1089,7 @@ void TGRowLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGColumnLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGColumnLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save column layout manager as a C++ statement(s) on output stream
@@ -1100,7 +1100,7 @@ void TGColumnLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGMatrixLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGMatrixLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save matrix layout manager as a C++ statement(s) on output stream
@@ -1114,7 +1114,7 @@ void TGMatrixLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGTileLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGTileLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save tile layout manager as a C++ statement(s) on output stream
@@ -1125,7 +1125,7 @@ void TGTileLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGListLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGListLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save list layout manager as a C++ statement(s) on output stream
@@ -1136,7 +1136,7 @@ void TGListLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGListDetailsLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGListDetailsLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save list details layout manager as a C++ statement(s) on out stream
diff --git a/gui/gui/src/TGListBox.cxx b/gui/gui/src/TGListBox.cxx
index 33d730c9ec8..3e0737bfee1 100644
--- a/gui/gui/src/TGListBox.cxx
+++ b/gui/gui/src/TGListBox.cxx
@@ -1648,13 +1648,13 @@ TGLBEntry *TGListBox::FindEntry(const char *name) const
 }
 
 //______________________________________________________________________________
-void TGListBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGListBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a list box widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetWhitePixel()) SaveUserColor(out, option);
 
-   out << endl << "   // list box" << endl;
+   out << std::endl << "   // list box" << std::endl;
 
    out<<"   TGListBox *";
    out << GetName() << " = new TGListBox(" << fParent->GetName();
@@ -1662,18 +1662,18 @@ void TGListBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (fBackground == GetWhitePixel()) {
       if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
          if (fWidgetId == -1) {
-            out <<");" << endl;
+            out <<");" << std::endl;
          } else {
-            out << "," << fWidgetId << ");" << endl;
+            out << "," << fWidgetId << ");" << std::endl;
          }
       } else {
-         out << "," << fWidgetId << "," << GetOptionString() <<");" << endl;
+         out << "," << fWidgetId << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << fWidgetId << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << fWidgetId << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (!fLbc->GetList()) return;
 
@@ -1683,14 +1683,14 @@ void TGListBox::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    while ((el = (TGFrameElement *) next())) {
       out << "   " << GetName() << "->AddEntry(";
       el->fFrame->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
    out << "   " << GetName() << "->Resize(" << GetWidth() << "," << GetHeight()
-       << ");" << endl;
+       << ");" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGTextLBEntry::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGTextLBEntry::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save a list box entry widget as a C++ statement(s) on output stream out.
 
diff --git a/gui/gui/src/TGListTree.cxx b/gui/gui/src/TGListTree.cxx
index 8f0f1faf5f0..f7ca47f8f47 100644
--- a/gui/gui/src/TGListTree.cxx
+++ b/gui/gui/src/TGListTree.cxx
@@ -2578,13 +2578,13 @@ const TGPicture *TGListTree::GetUncheckedPic()
 }
 
 //______________________________________________________________________________
-void TGListTree::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGListTree::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a list tree widget as a C++ statements on output stream out.
 
    if (fBackground != GetWhitePixel()) SaveUserColor(out, option);
 
-   out << endl << "   // list tree" << endl;
+   out << std::endl << "   // list tree" << std::endl;
    out << "   TGListTree *";
 
    if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class())) {
@@ -2596,37 +2596,37 @@ void TGListTree::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetWhitePixel()) {
       if (GetOptions() == kSunkenFrame) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
-   out << endl;
+   out << std::endl;
 
    static Int_t n = 0;
 
    TGListTreeItem *current;
    current = GetFirstItem();
 
-   out << "   const TGPicture *popen;       //used for list tree items" << endl;
-   out << "   const TGPicture *pclose;      //used for list tree items" << endl;
-   out << endl;
+   out << "   const TGPicture *popen;       //used for list tree items" << std::endl;
+   out << "   const TGPicture *pclose;      //used for list tree items" << std::endl;
+   out << std::endl;
 
    while (current) {
       out << "   TGListTreeItem *item" << n << " = " << GetName() << "->AddItem(";
       current->SavePrimitive(out, TString::Format("%d",n), n);
       if (current->IsOpen())
-         out << "   " << GetName() << "->OpenItem(item" << n << ");" << endl;
+         out << "   " << GetName() << "->OpenItem(item" << n << ");" << std::endl;
       else
-         out << "   " << GetName() << "->CloseItem(item" << n << ");" << endl;
+         out << "   " << GetName() << "->CloseItem(item" << n << ");" << std::endl;
 
       if (current == fSelected)
-         out << "   " << GetName() << "->SetSelected(item" << n << ");" << endl;
+         out << "   " << GetName() << "->SetSelected(item" << n << ");" << std::endl;
 
       n++;
       if (current->fFirstchild) {
@@ -2635,11 +2635,11 @@ void TGListTree::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       current = current->fNextsibling;
    }
 
-   out << endl;
+   out << std::endl;
 }
 
 //______________________________________________________________________________
-void TGListTree::SaveChildren(ostream &out, TGListTreeItem *item, Int_t &n)
+void TGListTree::SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n)
 {
    // Save child items as a C++ statements on output stream out.
 
@@ -2656,7 +2656,7 @@ void TGListTree::SaveChildren(ostream &out, TGListTreeItem *item, Int_t &n)
 }
 
 //______________________________________________________________________________
-void TGListTreeItemStd::SavePrimitive(ostream &out, Option_t *option, Int_t n)
+void TGListTreeItemStd::SavePrimitive(std::ostream &out, Option_t *option, Int_t n)
 {
    // Save a list tree item attributes as a C++ statements on output stream.
 
@@ -2679,50 +2679,50 @@ void TGListTreeItemStd::SavePrimitive(ostream &out, Option_t *option, Int_t n)
    text.ReplaceAll('\\', "\\\\");
    text.ReplaceAll("\"", "\\\"");
    out << quote << text << quote;
-   out << ");" << endl;
+   out << ");" << std::endl;
 
    if (oldopen != fOpenPic) {
       oldopen = fOpenPic;
       out << "   popen = gClient->GetPicture(" << quote
           << gSystem->ExpandPathName(gSystem->UnixPathName(fOpenPic->GetName()))
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
    if (oldclose != fClosedPic) {
       oldclose = fClosedPic;
       out << "   pclose = gClient->GetPicture(" << quote
           << gSystem->ExpandPathName(gSystem->UnixPathName(fClosedPic->GetName()))
-          << quote << ");" << endl;
+          << quote << ");" << std::endl;
    }
-   out << "   item" << s.Data() << "->SetPictures(popen, pclose);" << endl;
+   out << "   item" << s.Data() << "->SetPictures(popen, pclose);" << std::endl;
    if (HasCheckBox()) {
       if (fCheckedPic && makecheck) {
-         out << "   const TGPicture *pcheck;        //used for checked items" << endl;
+         out << "   const TGPicture *pcheck;        //used for checked items" << std::endl;
          makecheck = kFALSE;
       }
       if (fUncheckedPic && makeuncheck) {
-         out << "   const TGPicture *puncheck;      //used for unchecked items" << endl;
+         out << "   const TGPicture *puncheck;      //used for unchecked items" << std::endl;
          makeuncheck = kFALSE;
       }
-      out << "   item" << s.Data() << "->CheckItem();" << endl;
+      out << "   item" << s.Data() << "->CheckItem();" << std::endl;
       if (fCheckedPic && oldcheck != fCheckedPic) {
          oldcheck = fCheckedPic;
          out << "   pcheck = gClient->GetPicture(" << quote
              << gSystem->ExpandPathName(gSystem->UnixPathName(fCheckedPic->GetName()))
-             << quote << ");" << endl;
+             << quote << ");" << std::endl;
       }
       if (fUncheckedPic && olduncheck != fUncheckedPic) {
          olduncheck = fUncheckedPic;
          out << "   puncheck = gClient->GetPicture(" << quote
              << gSystem->ExpandPathName(gSystem->UnixPathName(fUncheckedPic->GetName()))
-             << quote << ");" << endl;
+             << quote << ");" << std::endl;
       }
-      out << "   item" << s.Data() << "->SetCheckBoxPictures(pcheck, puncheck);" << endl;
-      out << "   item" << s.Data() << "->SetCheckBox(kTRUE);" << endl;
+      out << "   item" << s.Data() << "->SetCheckBoxPictures(pcheck, puncheck);" << std::endl;
+      out << "   item" << s.Data() << "->SetCheckBox(kTRUE);" << std::endl;
    }
    if (fHasColor) {
       if (oldcolor != fColor) {
          oldcolor = fColor;
-         out << "   item" << s.Data() << "->SetColor(" << fColor << ");" << endl;
+         out << "   item" << s.Data() << "->SetColor(" << fColor << ");" << std::endl;
       }
    }
    if (fTipText.Length() > 0) {
@@ -2731,7 +2731,7 @@ void TGListTreeItemStd::SavePrimitive(ostream &out, Option_t *option, Int_t n)
       tiptext.ReplaceAll("\n", "\\n");
       tiptext.ReplaceAll("\"", "\\\"");
       out << "   item" << s.Data() << "->SetTipText(" << quote
-          << tiptext << quote << ");" << endl;
+          << tiptext << quote << ");" << std::endl;
    }
 
 }
diff --git a/gui/gui/src/TGListView.cxx b/gui/gui/src/TGListView.cxx
index e8dafbf3f32..576a0923744 100644
--- a/gui/gui/src/TGListView.cxx
+++ b/gui/gui/src/TGListView.cxx
@@ -1677,34 +1677,34 @@ const TGGC &TGListView::GetDefaultGC()
 }
 
 //______________________________________________________________________________
-void TGListView::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGListView::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a list view widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // list view" << endl;
+   out << std::endl << "   // list view" << std::endl;
    out <<"   TGListView *";
    out << GetName() << " = new TGListView(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    GetContainer()->SavePrimitive(out, option);
 
-   out << endl;
+   out << std::endl;
    out << "   " << GetName() << "->SetContainer(" << GetContainer()->GetName()
-                << ");" << endl;
+                << ");" << std::endl;
    out << "   " << GetName() << "->SetViewMode(";
    switch (fViewMode) {
       case kLVLargeIcons:
@@ -1720,29 +1720,29 @@ void TGListView::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          out << "kLVDetails";
          break;
    }
-   out << ");" << endl;
+   out << ");" << std::endl;
 
-   out << "   " << GetContainer()->GetName() << "->Resize();" << endl;
+   out << "   " << GetContainer()->GetName() << "->Resize();" << std::endl;
 
    if (fHScrollbar && fHScrollbar->IsMapped()) {
    out << "   " << GetName() << "->SetHsbPosition(" << GetHsbPosition()
-       << ");" << endl;
+       << ");" << std::endl;
    }
 
    if (fVScrollbar && fVScrollbar->IsMapped()) {
    out << "   " << GetName() << "->SetVsbPosition(" << GetVsbPosition()
-       << ");" << endl;
+       << ");" << std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGLVContainer::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGLVContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a list view container as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // list view container" << endl;
+   out << std::endl << "   // list view container" << std::endl;
    out << "   TGLVContainer *";
 
    if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class())) {
@@ -1753,13 +1753,13 @@ void TGLVContainer::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 }
diff --git a/gui/gui/src/TGMdiFrame.cxx b/gui/gui/src/TGMdiFrame.cxx
index 6fef0cd9a04..4c32cfeee15 100644
--- a/gui/gui/src/TGMdiFrame.cxx
+++ b/gui/gui/src/TGMdiFrame.cxx
@@ -185,7 +185,7 @@ TString TGMdiFrame::GetMdiHintsString() const
 }
 
 //______________________________________________________________________________
-void TGMdiFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGMdiFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a MDIframe as a C++ statement(s) on output stream out
 
@@ -195,7 +195,7 @@ void TGMdiFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    
    TGMdiTitleBar *tb = fMain->GetWindowList()->GetDecorFrame()->GetTitleBar();
    
-   out << endl <<"   // MDI frame "<< quote << GetWindowName() << quote << endl;
+   out << std::endl <<"   // MDI frame "<< quote << GetWindowName() << quote << std::endl;
    out << "   TGMdiFrame *";
    out << GetName() << " = new TGMdiFrame(" << fMain->GetName()
        << "," << GetWidth() + GetBorderWidth()*2 
@@ -203,26 +203,26 @@ void TGMdiFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    SavePrimitiveSubframes(out, option);
    
    out << "   " << GetName() << "->SetWindowName(" << quote << GetWindowName()
-       << quote << ");" << endl;
+       << quote << ");" << std::endl;
    out << "   " << GetName() << "->SetMdiHints(" << GetMdiHintsString()
-       << ");" << endl;
+       << ");" << std::endl;
    if ((GetX() != 5) && (GetY() != 23))
       out << "   " << GetName() << "->Move(" << GetX() << "," << GetY() 
-          << ");" << endl;
+          << ");" << std::endl;
           
-   out << "   " << GetName() << "->MapSubwindows();" << endl;
-   out << "   " << GetName() << "->Layout();" << endl;
+   out << "   " << GetName() << "->MapSubwindows();" << std::endl;
+   out << "   " << GetName() << "->Layout();" << std::endl;
 }
diff --git a/gui/gui/src/TGMdiMainFrame.cxx b/gui/gui/src/TGMdiMainFrame.cxx
index faf7fe90b74..6f19fe79203 100644
--- a/gui/gui/src/TGMdiMainFrame.cxx
+++ b/gui/gui/src/TGMdiMainFrame.cxx
@@ -1213,28 +1213,28 @@ Bool_t TGMdiContainer::HandleConfigureNotify(Event_t *event)
 }
 
 //______________________________________________________________________________
-void TGMdiMainFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGMdiMainFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a MDI main frame as a C++ statement(s) on output stream out
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // MDI main frame" << endl;
+   out << std::endl << "   // MDI main frame" << std::endl;
    out << "   TGMdiMainFrame *";
    out << GetName() << " = new TGMdiMainFrame(" << fParent->GetName()
        << "," << GetMenu()->GetName() << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TGMdiFrameList *travel=fChildren;
    travel->SetCycleNext(travel);
@@ -1247,24 +1247,24 @@ void TGMdiMainFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       switch (fArrangementMode) {
       
          case kMdiTileHorizontal:
-            out << "kMdiTileHorizontal);" << endl;
+            out << "kMdiTileHorizontal);" << std::endl;
          break;
 
          case kMdiTileVertical:
-            out << "kMdiTileVertical);" << endl;
+            out << "kMdiTileVertical);" << std::endl;
          break;
 
          case kMdiCascade:
-            out << "kMdiCascade);" << endl;
+            out << "kMdiCascade);" << std::endl;
          break;
       }
    }
    if (fResizeMode != kMdiOpaque)
-      out << "   " << GetName() << "->SetResizeMode(kMdiNonOpaque);" << endl;
+      out << "   " << GetName() << "->SetResizeMode(kMdiNonOpaque);" << std::endl;
 
    if (fCurrent)
       out << "   " << GetName() << "->SetCurrent(" << GetCurrent()->GetName() 
-          << ");" << endl;
+          << ");" << std::endl;
 }
 
 
diff --git a/gui/gui/src/TGMdiMenu.cxx b/gui/gui/src/TGMdiMenu.cxx
index 94ebed5bf87..dd1a6362f78 100644
--- a/gui/gui/src/TGMdiMenu.cxx
+++ b/gui/gui/src/TGMdiMenu.cxx
@@ -168,23 +168,23 @@ void TGMdiMenuBar::HideFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
 }
 
 //______________________________________________________________________________
-void TGMdiMenuBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGMdiMenuBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a MDI menu as a C++ statement(s) on output stream out
 
-   out << endl;
-   out << "   // MDI menu bar" << endl;
+   out << std::endl;
+   out << "   // MDI menu bar" << std::endl;
 
    out << "   TGMdiMenuBar *";
    out << GetName() << " = new TGMdiMenuBar(" << fParent->GetName()
-       << "," << GetWidth() << "," << GetHeight() << ");" << endl;
+       << "," << GetWidth() << "," << GetHeight() << ");" << std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (!fList) return;
 
    out << "   TGMenuBar *" << fBar->GetName() << " = " << GetName()
-       << "->GetMenuBar();" << endl;
+       << "->GetMenuBar();" << std::endl;
 
    TGFrameElement *el;
    TIter next(fBar->GetList());
@@ -192,6 +192,6 @@ void TGMdiMenuBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    while ((el = (TGFrameElement *)next())) {
       el->fFrame->SavePrimitive(out, option);
       el->fLayout->SavePrimitive(out, option);
-      out << ");" << endl;
+      out << ");" << std::endl;
    }
 }
diff --git a/gui/gui/src/TGMenu.cxx b/gui/gui/src/TGMenu.cxx
index 586413c2197..123ad12fec7 100644
--- a/gui/gui/src/TGMenu.cxx
+++ b/gui/gui/src/TGMenu.cxx
@@ -2126,7 +2126,7 @@ const TGGC &TGMenuTitle::GetDefaultSelectedGC()
 }
 
 //______________________________________________________________________________
-void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGPopupMenu::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a popup menu widget as a C++ statement(s) on output stream out.
 
@@ -2134,7 +2134,7 @@ void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    out << "   TGPopupMenu *";
    out << GetName() << " = new TGPopupMenu(gClient->GetDefaultRoot()"
-       << "," << GetWidth() << "," << GetHeight() << "," << GetOptionString() << ");" << endl;
+       << "," << GetWidth() << "," << GetHeight() << "," << GetOptionString() << ");" << std::endl;
 
    Bool_t hasradio = kFALSE;
    Int_t r_first, r_last, r_active;
@@ -2184,12 +2184,12 @@ void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                    << gSystem->ExpandPathName(gSystem->UnixPathName(mentry->fPic->GetName()))
                    << quote << ")";
             }
-            out << ");" << endl;
+            out << ");" << std::endl;
             delete [] outext;
             break;
          case kMenuPopup:
-            out << endl;
-            out << "   // cascaded menu " << quote << mentry->GetName() << quote <<endl;
+            out << std::endl;
+            out << "   // cascaded menu " << quote << mentry->GetName() << quote <<std::endl;
             mentry->fPopup->SavePrimitive(out, option);
             text = mentry->GetName();
             lentext = mentry->fLabel->GetLength();
@@ -2208,7 +2208,7 @@ void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
             out << "   " << GetName() << "->AddPopup(" << quote
                 << outext << quote << "," << mentry->fPopup->GetName()
-                << ");" << endl;
+                << ");" << std::endl;
             delete [] outext;
             break;
          case kMenuLabel:
@@ -2219,28 +2219,28 @@ void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                    << mentry->fPic->GetName()
                    << quote << ")";
             }
-            out << ");" << endl;
+            out << ");" << std::endl;
             break;
          case kMenuSeparator:
-            out << "   " << GetName() << "->AddSeparator();" << endl;
+            out << "   " << GetName() << "->AddSeparator();" << std::endl;
             break;
       }
 
       if (!(mentry->GetStatus() & kMenuEnableMask)) {
          out<< "   " << GetName() << "->DisableEntry(" << mentry->GetEntryId()
-            << ");" << endl;
+            << ");" << std::endl;
       }
       if (mentry->GetStatus() & kMenuHideMask) {
          out<< "   " << GetName() << "->HideEntry(" << mentry->GetEntryId()
-            << ");" << endl;
+            << ");" << std::endl;
       }
       if (mentry->GetStatus() & kMenuCheckedMask) {
          out<< "   " << GetName() << "->CheckEntry(" << mentry->GetEntryId()
-            << ");" << endl;
+            << ");" << std::endl;
       }
       if (mentry->GetStatus() & kMenuDefaultMask) {
          out<< "   "<< GetName() << "->DefaultEntry(" << mentry->GetEntryId()
-            << ");" << endl;
+            << ");" << std::endl;
       }
       if (mentry->GetStatus() & kMenuRadioEntryMask) {
          if (hasradio) {
@@ -2254,7 +2254,7 @@ void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          }
       } else if (hasradio) {
          out << "   " << GetName() << "->RCheckEntry(" << r_active << "," << r_first
-             << "," << r_last << ");" << endl;
+             << "," << r_last << ");" << std::endl;
          hasradio = kFALSE;
          r_active = r_first = r_last = -1;
       }
@@ -2262,14 +2262,14 @@ void TGPopupMenu::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 }
 
 //______________________________________________________________________________
-void TGMenuTitle::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGMenuTitle::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a title menu widget as a C++ statement(s) on output stream out.
 
    char quote = '"';
 
-   out << endl;
-   out << "   // " << quote << fLabel->GetString() << quote <<" menu" << endl;
+   out << std::endl;
+   out << "   // " << quote << fLabel->GetString() << quote <<" menu" << std::endl;
 
    fMenu->SavePrimitive(out, option);
 
@@ -2294,18 +2294,18 @@ void TGMenuTitle::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 }
 
 //______________________________________________________________________________
-void TGMenuBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGMenuBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a menu bar widget as a C++ statement(s) on output stream out.
 
-   out << endl;
-   out << "   // menu bar" << endl;
+   out << std::endl;
+   out << "   // menu bar" << std::endl;
 
    out << "   TGMenuBar *";
    out << GetName() << " = new TGMenuBar(" << fParent->GetName()
-       << "," << GetWidth() << "," << GetHeight() << "," << GetOptionString() << ");" << endl;
+       << "," << GetWidth() << "," << GetHeight() << "," << GetOptionString() << ");" << std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (!fList) return;
 
@@ -2315,6 +2315,6 @@ void TGMenuBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    while ((el = (TGFrameElement *)next())) {
       el->fFrame->SavePrimitive(out, option);
       el->fLayout->SavePrimitive(out, option);
-      out << ");" << endl;
+      out << ");" << std::endl;
    }
 }
diff --git a/gui/gui/src/TGNumberEntry.cxx b/gui/gui/src/TGNumberEntry.cxx
index d0f6bf4bfcb..3c1ac1aef8f 100644
--- a/gui/gui/src/TGNumberEntry.cxx
+++ b/gui/gui/src/TGNumberEntry.cxx
@@ -2096,7 +2096,7 @@ void TGNumberEntry::ValueSet(Long_t val)
 }
 
 //______________________________________________________________________________
-void TGNumberEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGNumberEntry::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a number entry widget as a C++ statement(s) on output stream out.
 
@@ -2171,7 +2171,7 @@ void TGNumberEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       {  char hex[256];
          ULong_t l = GetHexNumber();
          IntToHexStr(hex, l);
-         out << "0x" << hex << "U," << digits << "," << WidgetId()
+         out << "0x" << std::hex << "U," << digits << "," << WidgetId()
              << ",(TGNumberFormat::EStyle) " << GetNumStyle();
          break;
       }
@@ -2180,28 +2180,28 @@ void TGNumberEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (GetNumMin() == 0) {
          if (GetNumLimits() == kNELNoLimits) {
             if (GetNumAttr() == kNEAAnyNumber) {
-               out << ");" << endl;
+               out << ");" << std::endl;
             } else {
-               out << ",(TGNumberFormat::EAttribute) " << GetNumAttr() << ");" << endl;
+               out << ",(TGNumberFormat::EAttribute) " << GetNumAttr() << ");" << std::endl;
             }
          } else {
             out << ",(TGNumberFormat::EAttribute) " << GetNumAttr()
-                << ",(TGNumberFormat::ELimit) " << GetNumLimits() << ");" << endl;
+                << ",(TGNumberFormat::ELimit) " << GetNumLimits() << ");" << std::endl;
          }
       } else {
          out << ",(TGNumberFormat::EAttribute) " << GetNumAttr()
              << ",(TGNumberFormat::ELimit) " << GetNumLimits()
-             << "," << GetNumMin() << ");" << endl;
+             << "," << GetNumMin() << ");" << std::endl;
       }
    } else {
          out << ",(TGNumberFormat::EAttribute) " << GetNumAttr()
              << ",(TGNumberFormat::ELimit) " << GetNumLimits()
-             << "," << GetNumMin() << "," << GetNumMax() << ");" << endl;
+             << "," << GetNumMin() << "," << GetNumMax() << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    if (fButtonDown->GetState() == kButtonDisabled)
-      out << "   " << GetName() << "->SetState(kFALSE);" << endl;
+      out << "   " << GetName() << "->SetState(kFALSE);" << std::endl;
 
    TGToolTip *tip = GetNumberEntry()->GetToolTip();
    if (tip) {
@@ -2209,12 +2209,12 @@ void TGNumberEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       tiptext.ReplaceAll("\n", "\\n");
       out << "   ";
       out << GetName() << "->GetNumberEntry()->SetToolTipText(" << quote
-          << tiptext << quote << ");"  << endl;
+          << tiptext << quote << ");"  << std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGNumberEntryField::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGNumberEntryField::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a number entry widget as a C++ statement(s) on output stream out.
 
@@ -2284,7 +2284,7 @@ void TGNumberEntryField::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       {  char hex[256];
          ULong_t l = GetHexNumber();
          IntToHexStr(hex, l);
-         out << "0x" << hex << "U"
+         out << "0x" << std::hex << "U"
              << ",(TGNumberFormat::EStyle) " << GetNumStyle();
          break;
       }
@@ -2293,31 +2293,31 @@ void TGNumberEntryField::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (GetNumMin() == 0) {
          if (GetNumLimits() == kNELNoLimits) {
             if (GetNumAttr() == kNEAAnyNumber) {
-               out << ");" << endl;
+               out << ");" << std::endl;
             } else {
-               out << ",(TGNumberFormat::EAttribute) " << GetNumAttr() << ");" << endl;
+               out << ",(TGNumberFormat::EAttribute) " << GetNumAttr() << ");" << std::endl;
             }
          } else {
             out << ",(TGNumberFormat::EAttribute) " << GetNumAttr()
-                << ",(TGNumberFormat::ELimit) " << GetNumLimits() << ");" << endl;
+                << ",(TGNumberFormat::ELimit) " << GetNumLimits() << ");" << std::endl;
          }
       } else {
          out << ",(TGNumberFormat::EAttribute) " << GetNumAttr()
              << ",(TGNumberFormat::ELimit) " << GetNumLimits()
-             << "," << GetNumMin() << ");" << endl;
+             << "," << GetNumMin() << ");" << std::endl;
       }
    } else {
          out << ",(TGNumberFormat::EAttribute) " << GetNumAttr()
              << ",(TGNumberFormat::ELimit) " << GetNumLimits()
-             << "," << GetNumMin() << "," << GetNumMax() << ");" << endl;
+             << "," << GetNumMin() << "," << GetNumMax() << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    if (!IsEnabled())
-      out << "   " << GetName() << "->SetState(kFALSE);" << endl;
+      out << "   " << GetName() << "->SetState(kFALSE);" << std::endl;
 
    out << "   " << GetName() << "->Resize("<< GetWidth() << "," << GetName()
-       << "->GetDefaultHeight());" << endl;
+       << "->GetDefaultHeight());" << std::endl;
 
    TGToolTip *tip = GetToolTip();
    if (tip) {
@@ -2325,6 +2325,6 @@ void TGNumberEntryField::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       tiptext.ReplaceAll("\n", "\\n");
       out << "   ";
       out << GetName() << "->SetToolTipText(" << quote
-          << tiptext << quote << ");"  << endl;
+          << tiptext << quote << ");"  << std::endl;
    }
 }
diff --git a/gui/gui/src/TGProgressBar.cxx b/gui/gui/src/TGProgressBar.cxx
index c0c43a545c6..acda5abbc87 100644
--- a/gui/gui/src/TGProgressBar.cxx
+++ b/gui/gui/src/TGProgressBar.cxx
@@ -395,7 +395,7 @@ void TGVProgressBar::DoRedraw()
 }
 
 //______________________________________________________________________________
-void TGProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save progress bar parameters as a C++ statement(s) on output stream out.
 
@@ -405,20 +405,20 @@ void TGProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       case kFancy:
          if (GetOptions() != (kSunkenFrame | kDoubleBorder | kOwnBackground))
             out << "   " << GetName() << "->ChangeOptions(" << GetOptionString()
-                << ");" << endl;
+                << ");" << std::endl;
          if (GetBackground() != GetWhitePixel()) {
             SaveUserColor(out, option);
-            out << "   " << GetName() << "->SetBackgroundColor(ucolor);" << endl;
+            out << "   " << GetName() << "->SetBackgroundColor(ucolor);" << std::endl;
          }
          break;
 
       case kStandard:
          if (GetOptions() != (kSunkenFrame | kOwnBackground))
             out << "   " << GetName() << "->ChangeOptions(" << GetOptionString()
-                << ");" << endl;
+                << ");" << std::endl;
          if (GetBackground() != GetDefaultFrameBackground()) {
             SaveUserColor(out, option);
-            out << "   " << GetName() << "->SetBackgroundColor(ucolor);" << endl;
+            out << "   " << GetName() << "->SetBackgroundColor(ucolor);" << std::endl;
          }
          break;
    }
@@ -426,18 +426,18 @@ void TGProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (fBarColorGC.GetForeground() != GetDefaultSelectedBackground()) {
       barcolor = TColor::PixelAsHexString(fBarColorGC.GetForeground());
       out << "   " << GetName() <<"->SetBarColor(" << quote << barcolor << quote
-          << ");"  << endl;
+          << ");"  << std::endl;
    }
 
    if (fMin != 0 && fMax != 100)
-      out << "   " << GetName() << "->SetRange(" << fMin << "," << fMax << ");" << endl;
+      out << "   " << GetName() << "->SetRange(" << fMin << "," << fMax << ");" << std::endl;
 
-   out <<"   "<< GetName() <<"->SetPosition("<< fPos <<");"<< endl;
+   out <<"   "<< GetName() <<"->SetPosition("<< fPos <<");"<< std::endl;
 
 }
 
 //______________________________________________________________________________
-void TGVProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a vertical progress bar as a C++ statement(s) on output stream out.
 
@@ -451,19 +451,19 @@ void TGVProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       out << ",TGProgressBar::kStandard";
    }
 
-   out << "," << GetHeight() <<");" << endl;
+   out << "," << GetHeight() <<");" << std::endl;
 
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (GetFillType() == kBlockFill)
-      out << "   " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< endl;
+      out << "   " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
 
    TGProgressBar::SavePrimitive(out, option);
 }
 
 //______________________________________________________________________________
-void TGHProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a horizontal progress bar as a C++ statement(s) on output stream out
 
@@ -479,12 +479,12 @@ void TGHProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
 
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
-   out << "," << GetWidth() << ");" << endl;
+   out << "," << GetWidth() << ");" << std::endl;
 
    if (GetFillType() == kBlockFill)
-      out << "   " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< endl;
+      out << "   " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
 
    if (GetShowPos()) {
       out << "   " << GetName() <<"->ShowPosition(kTRUE,";
@@ -493,10 +493,10 @@ void TGHProgressBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       } else {
          out << "kFALSE,";
       }
-      out << quote << GetFormat() << quote << ");"<< endl;
+      out << quote << GetFormat() << quote << ");"<< std::endl;
 
    } else if (UsePercent() && !GetFillType()) {
-      out << "   " << GetName() <<"->ShowPosition();" << endl;
+      out << "   " << GetName() <<"->ShowPosition();" << std::endl;
    }
    TGProgressBar::SavePrimitive(out, option);
 }
diff --git a/gui/gui/src/TGScrollBar.cxx b/gui/gui/src/TGScrollBar.cxx
index 0986c0645a0..adb6c86c007 100644
--- a/gui/gui/src/TGScrollBar.cxx
+++ b/gui/gui/src/TGScrollBar.cxx
@@ -932,7 +932,7 @@ void TGVScrollBar::SetPosition(Int_t pos)
 }
 
 //______________________________________________________________________________
-void TGHScrollBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHScrollBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal scrollbar as a C++ statement(s) on output stream out.
 
@@ -944,22 +944,22 @@ void TGHScrollBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
-   out << "   " << GetName() <<"->SetRange(" << GetRange() << "," << GetPageSize() << ");" << endl;
-   out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << endl;
+   out << "   " << GetName() <<"->SetRange(" << GetRange() << "," << GetPageSize() << ");" << std::endl;
+   out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGVScrollBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVScrollBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an vertical scrollbar as a C++ statement(s) on output stream out.
 
@@ -972,16 +972,16 @@ void TGVScrollBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (fBackground == GetDefaultFrameBackground()) {
 
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
-   out << "   " << GetName() <<"->SetRange(" << GetRange() << "," << GetPageSize() << ");" << endl;
-   out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << endl;
+   out << "   " << GetName() <<"->SetRange(" << GetRange() << "," << GetPageSize() << ");" << std::endl;
+   out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
 }
diff --git a/gui/gui/src/TGShapedFrame.cxx b/gui/gui/src/TGShapedFrame.cxx
index 8e1ec78d31e..6a5e5e7d848 100644
--- a/gui/gui/src/TGShapedFrame.cxx
+++ b/gui/gui/src/TGShapedFrame.cxx
@@ -65,13 +65,13 @@ TGShapedFrame::~TGShapedFrame()
 }
 
 //______________________________________________________________________________
-void TGShapedFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGShapedFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a shaped frame as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // shaped frame" << endl;
+   out << std::endl << "   // shaped frame" << std::endl;
    out << "   TGShapedFrame *";
    out << GetName() << " = new TGShapedFrame(" << fImage->GetName()
        << "," << fParent->GetName() << "," << GetWidth() << ","
@@ -79,15 +79,15 @@ void TGShapedFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from the main frame type
    // coverity[returned_null]
@@ -102,7 +102,7 @@ void TGShapedFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
diff --git a/gui/gui/src/TGShutter.cxx b/gui/gui/src/TGShutter.cxx
index dde8567ee12..9ef47087c8e 100644
--- a/gui/gui/src/TGShutter.cxx
+++ b/gui/gui/src/TGShutter.cxx
@@ -378,7 +378,7 @@ TGShutterItem::~TGShutterItem()
 }
 
 //______________________________________________________________________________
-void TGShutterItem::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGShutterItem::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a shutter item widget as a C++ statement(s) on output stream out
 
@@ -402,23 +402,23 @@ void TGShutterItem::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
    outext[i]=0;
 
-   out << endl;
-   out << "   // " << quote << outext << quote << " shutter item " << endl;
+   out << std::endl;
+   out << "   // " << quote << outext << quote << " shutter item " << std::endl;
    out << "   TGShutterItem *";
    out << GetName() << " = new TGShutterItem(" << fParent->GetName()
        << ", new TGHotString(" << quote << outext << quote << "),"
-       << fButton->WidgetId() << "," << GetOptionString() << ");" << endl;
+       << fButton->WidgetId() << "," << GetOptionString() << ");" << std::endl;
 
    delete [] outext;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TList *list = ((TGCompositeFrame *)GetContainer())->GetList();
 
    if (!list) return;
 
    out << "   TGCompositeFrame *" << GetContainer()->GetName()
-       << " = (TGCompositeFrame *)" << GetName() << "->GetContainer();" << endl;
+       << " = (TGCompositeFrame *)" << GetName() << "->GetContainer();" << std::endl;
 
    TGFrameElement *el;
    TIter next(list);
@@ -427,28 +427,28 @@ void TGShutterItem::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       el->fFrame->SavePrimitive(out, option);
       out << "   " << GetContainer()->GetName() <<"->AddFrame(" << el->fFrame->GetName();
       el->fLayout->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGShutter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGShutter::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a shutter widget as a C++ statement(s) on output stream out.
 
-   out << endl;
-   out << "   // shutter" << endl;
+   out << std::endl;
+   out << "   // shutter" << std::endl;
 
    out << "   TGShutter *";
    out << GetName() << " = new TGShutter(" << fParent->GetName() << ","
-       << GetOptionString() << ");" << endl;
+       << GetOptionString() << ");" << std::endl;
 
    if ((fDefWidth > 0) || (fDefHeight > 0)) {
       out << "   " << GetName() << "->SetDefaultSize(";
-      out << fDefWidth << "," << fDefHeight << ");" << endl;
+      out << fDefWidth << "," << fDefHeight << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (!fList) return;
 
@@ -459,11 +459,11 @@ void TGShutter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       el->fFrame->SavePrimitive(out, option);
       out << "   " << GetName() <<"->AddItem(" << el->fFrame->GetName();
       //el->fLayout->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    out << "   " << GetName() << "->SetSelectedItem("
-       << GetSelectedItem()->GetName() << ");" << endl;
-   out << "   " <<GetName()<< "->Resize("<<GetWidth()<<","<<GetHeight()<<");"<<endl;
+       << GetSelectedItem()->GetName() << ");" << std::endl;
+   out << "   " <<GetName()<< "->Resize("<<GetWidth()<<","<<GetHeight()<<");"<<std::endl;
 }
 
diff --git a/gui/gui/src/TGSlider.cxx b/gui/gui/src/TGSlider.cxx
index 3f3c3440aa9..81a7f6f1dbd 100644
--- a/gui/gui/src/TGSlider.cxx
+++ b/gui/gui/src/TGSlider.cxx
@@ -537,7 +537,7 @@ TString TGSlider::GetTypeString() const
 }
 
 //______________________________________________________________________________
-void TGHSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal slider as a C++ statement(s) on output stream out.
 
@@ -550,31 +550,31 @@ void TGHSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fVmin != 0 || fVmax != (Int_t)fWidth)
-      out << "   " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << endl;
+      out << "   " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
 
    if (fPos != (Int_t)fWidth/2)
-      out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << endl;
+      out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
 
    if (fScale != 10)
-      out << "   " << GetName() <<"->SetScale(" << fScale << ");" << endl;
+      out << "   " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
 
    if (!IsEnabled())
-      out << "   " << GetName() <<"->SetState(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetState(kFALSE);" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGVSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal slider as a C++ statement(s) on output stream out.
 
@@ -588,25 +588,25 @@ void TGVSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    if (fBackground == GetDefaultFrameBackground()) {
 
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fVmin != 0 || fVmax != (Int_t)fHeight)
-      out << "   " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << endl;
+      out << "   " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
 
    if (fPos != (Int_t)fHeight/2)
-      out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << endl;
+      out << "   " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
 
    if (fScale != 10)
-      out << "   " << GetName() <<"->SetScale(" << fScale << ");" << endl;
+      out << "   " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
 
    if (!IsEnabled())
-      out << "   " << GetName() <<"->SetState(kFALSE);" << endl;
+      out << "   " << GetName() <<"->SetState(kFALSE);" << std::endl;
 }
diff --git a/gui/gui/src/TGSplitFrame.cxx b/gui/gui/src/TGSplitFrame.cxx
index ec8f7e2f59c..142529f3859 100644
--- a/gui/gui/src/TGSplitFrame.cxx
+++ b/gui/gui/src/TGSplitFrame.cxx
@@ -732,28 +732,28 @@ void TGSplitFrame::UnSplit(const char *which)
 }
 
 //______________________________________________________________________________
-void TGSplitFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGSplitFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a splittable frame as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // splittable frame" << endl;
+   out << std::endl << "   // splittable frame" << std::endl;
    out << "   TGSplitFrame *";
    out << GetName() << " = new TGSplitFrame(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out << ");" << endl;
+         out << ");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    // setting layout manager if it differs from the main frame type
    // coverity[returned_null]
@@ -768,7 +768,7 @@ void TGSplitFrame::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    } else {
       out << "   " << GetName() <<"->SetLayoutManager(";
       lm->SavePrimitive(out, option);
-      out << ");"<< endl;
+      out << ");"<< std::endl;
    }
 
    SavePrimitiveSubframes(out, option);
diff --git a/gui/gui/src/TGSplitter.cxx b/gui/gui/src/TGSplitter.cxx
index c29a781cca8..bc4fb6c8611 100644
--- a/gui/gui/src/TGSplitter.cxx
+++ b/gui/gui/src/TGSplitter.cxx
@@ -572,7 +572,7 @@ Bool_t TGVFileSplitter::HandleDoubleClick(Event_t *)
 }
 
 //______________________________________________________________________________
-void TGVSplitter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVSplitter::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a splitter widget as a C++ statement(s) on output stream out.
 
@@ -584,28 +584,28 @@ void TGVSplitter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    // TGVSplitter->SetFrame( theframe ) can only be saved here
    // if fFrame is the frame on the left (since the frame on the
    // right will only be saved afterwards)... The other case is
    // handled in TGCompositeFrame::SavePrimitiveSubframes()
    if (GetLeft()) {
       out << "   " << GetName() << "->SetFrame(" << GetFrame()->GetName();
-      if (GetLeft()) out << ",kTRUE);" << endl;
-      else           out << ",kFALSE);"<< endl;
+      if (GetLeft()) out << ",kTRUE);" << std::endl;
+      else           out << ",kFALSE);"<< std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGHSplitter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHSplitter::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a splitter widget as a C++ statement(s) on output stream out.
 
@@ -617,28 +617,28 @@ void TGHSplitter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
    // TGHSplitter->SetFrame( theframe ) can only be saved here
    // if fFrame is the frame above (since the frame below will
    // only be saved afterwards)... The other case is handled in
    // TGCompositeFrame::SavePrimitiveSubframes()
    if (GetAbove()) {
       out << "   " << GetName() << "->SetFrame(" << GetFrame()->GetName();
-      if (GetAbove()) out << ",kTRUE);" << endl;
-      else            out << ",kFALSE);"<< endl;
+      if (GetAbove()) out << ",kTRUE);" << std::endl;
+      else            out << ",kFALSE);"<< std::endl;
    }
 }
 
 //______________________________________________________________________________
-void TGVFileSplitter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGVFileSplitter::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a splitter widget as a C++ statement(s) on output stream out.
 
@@ -650,18 +650,18 @@ void TGVFileSplitter::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    out << "   " << GetName() << "->SetFrame(" << GetFrame()->GetName();
-   if (GetLeft()) out << ",kTRUE);" << endl;
-   else           out << ",kFALSE);"<< endl;
+   if (GetLeft()) out << ",kTRUE);" << std::endl;
+   else           out << ",kFALSE);"<< std::endl;
 }
 
diff --git a/gui/gui/src/TGStatusBar.cxx b/gui/gui/src/TGStatusBar.cxx
index aa0282e2954..1e2005602d4 100644
--- a/gui/gui/src/TGStatusBar.cxx
+++ b/gui/gui/src/TGStatusBar.cxx
@@ -369,14 +369,14 @@ TGDimension TGStatusBar::GetDefaultSize() const
 }
 
 //______________________________________________________________________________
-void TGStatusBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGStatusBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save a status bar widget as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl;
-   out << "   // status bar" << endl;
+   out << std::endl;
+   out << "   // status bar" << std::endl;
 
    out << "   TGStatusBar *";
    out << GetName() <<" = new TGStatusBar("<< fParent->GetName()
@@ -384,15 +384,15 @@ void TGStatusBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == (kSunkenFrame | kHorizontalFrame)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    int i; char quote = '"';
 
@@ -402,20 +402,20 @@ void TGStatusBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       for (i=1; i<fNpart; i++) {
          out  << "," << fParts[i];
       }
-      out << "};" << endl;
+      out << "};" << std::endl;
 
       out << "   " << GetName() << "->SetParts(parts" << GetName()+5
-          << "," << fNpart << ");" <<endl;
+          << "," << fNpart << ");" <<std::endl;
    }
    for (i=0; i<fNpart; i++) {
       if (fStatusPart[i]->GetText()) {
          out << "   " << GetName() << "->SetText(" << quote
              << fStatusPart[i]->GetText()->GetString()
-             << quote << "," << i << ");" << endl;
+             << quote << "," << i << ");" << std::endl;
       } else {
          if (!fStatusPart[i]->GetList()->First()) continue;
          out << "   TGCompositeFrame *" << fStatusPart[i]->GetName()
-             << " = " << GetName() << "->GetBarPart(" << i << ");" << endl;
+             << " = " << GetName() << "->GetBarPart(" << i << ");" << std::endl;
 
          TGFrameElement *el;
          TIter next(fStatusPart[i]->GetList());
@@ -425,7 +425,7 @@ void TGStatusBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
             out << "   " << fStatusPart[i]->GetName() << "->AddFrame("
                 << el->fFrame->GetName();
             el->fLayout->SavePrimitive(out, option);
-            out << ");" << endl;
+            out << ");" << std::endl;
          }
       }
    }
diff --git a/gui/gui/src/TGTab.cxx b/gui/gui/src/TGTab.cxx
index dbb5bf9ef10..1c5342b058e 100644
--- a/gui/gui/src/TGTab.cxx
+++ b/gui/gui/src/TGTab.cxx
@@ -726,7 +726,7 @@ TGLayoutManager *TGTab::GetLayoutManager() const
 }
 
 //______________________________________________________________________________
-void TGTab::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTab::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a tab widget as a C++ statement(s) on output stream out.
 
@@ -754,7 +754,7 @@ void TGTab::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl << "   // tab widget" << endl;
+   out << std::endl << "   // tab widget" << std::endl;
 
    out << "   TGTab *";
    out << GetName() << " = new TGTab(" << fParent->GetName()
@@ -764,33 +764,33 @@ void TGTab::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (GetOptions() == kChildFrame) {
          if (fFontStruct == GetDefaultFontStruct()) {
             if (fNormGC == GetDefaultGC()()) {
-               out <<");" << endl;
+               out <<");" << std::endl;
             } else {
-               out << "," << parGC.Data() <<");" << endl;
+               out << "," << parGC.Data() <<");" << std::endl;
             }
          } else {
-            out << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
+            out << "," << parGC.Data() << "," << parFont.Data() <<");" << std::endl;
          }
       } else {
-         out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() <<");" << endl;
+         out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString()  << ",ucolor);" << endl;
+      out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString()  << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    TGCompositeFrame *cf;
    TGLayoutManager * lm;
    for (Int_t i=0; i<GetNumberOfTabs(); i++) {
       cf = GetTabContainer(i);
       if (!cf || !GetTabTab(i)) continue;
-      out << endl << "   // container of " << quote
-          << GetTabTab(i)->GetString() << quote << endl;
-      out << "   TGCompositeFrame *" << cf->GetName() << ";" << endl;
+      out << std::endl << "   // container of " << quote
+          << GetTabTab(i)->GetString() << quote << std::endl;
+      out << "   TGCompositeFrame *" << cf->GetName() << ";" << std::endl;
       out << "   " << cf->GetName() << " = " << GetName()
                    << "->AddTab(" << quote << GetTabTab(i)->GetString()
-                   << quote << ");" << endl;
+                   << quote << ");" << std::endl;
       lm = cf->GetLayoutManager();
       if (lm) {
          if ((cf->GetOptions() & kHorizontalFrame) &&
@@ -802,34 +802,34 @@ void TGTab::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          } else {
             out << "   " << cf->GetName() <<"->SetLayoutManager(";
             lm->SavePrimitive(out, option);
-            out << ");" << endl;
+            out << ");" << std::endl;
          }
          if (!IsEnabled(i)) {
-            out << "   " << GetName() << "->SetEnabled(" << i << ", kFALSE);" << endl;
+            out << "   " << GetName() << "->SetEnabled(" << i << ", kFALSE);" << std::endl;
          }
       }
       cf->SavePrimitiveSubframes(out, option);
 
       if (GetTabTab(i)->IsCloseShown()) {
          out << "   TGTabElement *tab" << i << " = "
-             << GetName() << "->GetTabTab(" << i << ");" << endl;
-         out << "   tab" << i << "->ShowClose(kTRUE);" << endl;
+             << GetName() << "->GetTabTab(" << i << ");" << std::endl;
+         out << "   tab" << i << "->ShowClose(kTRUE);" << std::endl;
       }
       if (GetTabTab(i)->GetBackground() != GetTabTab(i)->GetDefaultFrameBackground()) {
          GetTabTab(i)->SaveUserColor(out, option);
          out << "   TGTabElement *tab" << i << " = "
-             << GetName() << "->GetTabTab(" << i << ");" << endl;
-         out << "   tab" << i << "->ChangeBackground(ucolor);" << endl;
+             << GetName() << "->GetTabTab(" << i << ");" << std::endl;
+         out << "   tab" << i << "->ChangeBackground(ucolor);" << std::endl;
       }
 
    }
-   out << endl << "   " << GetName() << "->SetTab(" << GetCurrent() << ");" << endl;
-   out << endl << "   " << GetName() << "->Resize(" << GetName()
-       << "->GetDefaultSize());" << endl;
+   out << std::endl << "   " << GetName() << "->SetTab(" << GetCurrent() << ");" << std::endl;
+   out << std::endl << "   " << GetName() << "->Resize(" << GetName()
+       << "->GetDefaultSize());" << std::endl;
 }
 
 // __________________________________________________________________________
-void TGTabLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGTabLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save tab layout manager as a C++ statement(s) on out stream.
 
diff --git a/gui/gui/src/TGTable.cxx b/gui/gui/src/TGTable.cxx
index 6c50e51edf1..228afd32ad9 100644
--- a/gui/gui/src/TGTable.cxx
+++ b/gui/gui/src/TGTable.cxx
@@ -955,11 +955,11 @@ void TGTable::Show()
    for (j = 0; j < ncolumns + 1; j++) {
       if (j == 0) {
          hdr = fTableHeader;
-         if (hdr) std::cout << " " << setw(12) << right 
+         if (hdr) std::cout << " " << std::setw(12) << std::right 
                             << hdr->GetLabel()->GetString() << " ";
       } else {
          hdr = GetColumnHeader(j - 1);
-         if (hdr) std::cout << " " << setw(12) << right 
+         if (hdr) std::cout << " " << std::setw(12) << std::right 
                             << hdr->GetLabel()->GetString() << " ";
       }
    }
@@ -969,11 +969,11 @@ void TGTable::Show()
       for (j = 0; j < ncolumns + 1; j++) {
          if (j == 0) {
             hdr = GetRowHeader(i);
-            if (hdr) std::cout << " " << setw(12) << right 
+            if (hdr) std::cout << " " << std::setw(12) << std::right 
                                << hdr->GetLabel()->GetString() << " ";
          } else {
             cell = GetCell(i, j - 1);
-            if (cell) std::cout << " " << setw(12) << right 
+            if (cell) std::cout << " " << std::setw(12) << std::right 
                                 << cell->GetLabel()->GetString() << " ";
          }
       }
diff --git a/gui/gui/src/TGTableLayout.cxx b/gui/gui/src/TGTableLayout.cxx
index 7c9a4da4a8a..90269d9dce9 100644
--- a/gui/gui/src/TGTableLayout.cxx
+++ b/gui/gui/src/TGTableLayout.cxx
@@ -662,7 +662,7 @@ TGDimension TGTableLayout::GetDefaultSize() const
 }
 
 // ________________________________________________________________________
-void TGTableLayoutHints::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGTableLayoutHints::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save table layout hints as a C++ statement(s) on output stream out.
@@ -734,7 +734,7 @@ void TGTableLayoutHints::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 }
 
 // __________________________________________________________________________
-void TGTableLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TGTableLayout::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 
    // Save table layout as a C++ statement(s) on output stream.
diff --git a/gui/gui/src/TGTextEdit.cxx b/gui/gui/src/TGTextEdit.cxx
index ed92f4958d9..d383c64b966 100644
--- a/gui/gui/src/TGTextEdit.cxx
+++ b/gui/gui/src/TGTextEdit.cxx
@@ -2171,7 +2171,7 @@ const TGGC &TGTextEdit::GetCursor1GC()
 }
 
 //______________________________________________________________________________
-void TGTextEdit::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTextEdit::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a text edit widget as a C++ statement(s) on output stream out
 
@@ -2179,20 +2179,20 @@ void TGTextEdit::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << "   TGTextEdit *";
    out << GetName() << " = new TGTextEdit(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight()
-       << ");"<< endl;
+       << ");"<< std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (IsReadOnly()) {
-      out << "   " << GetName() << "->SetReadOnly(kTRUE);" << endl;
+      out << "   " << GetName() << "->SetReadOnly(kTRUE);" << std::endl;
    }
 
    if (!IsMenuEnabled()) {
-      out << "   " << GetName() << "->EnableMenu(kFALSE);" << endl;
+      out << "   " << GetName() << "->EnableMenu(kFALSE);" << std::endl;
    }
 
    if (fCanvas->GetBackground() != TGFrame::fgWhitePixel) {
-      out << "   " << GetName() << "->ChangeBackground(" << fCanvas->GetBackground() << ");" << endl;
+      out << "   " << GetName() << "->ChangeBackground(" << fCanvas->GetBackground() << ");" << std::endl;
    }
 
    TGText *txt = GetText();
@@ -2206,5 +2206,5 @@ void TGTextEdit::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       fn = TString::Format("Txt%s", GetName()+5);
       txt->Save(fn.Data());
    }
-   out << "   " << GetName() << "->LoadFile(" << quote << fn.Data() << quote << ");" << endl;
+   out << "   " << GetName() << "->LoadFile(" << quote << fn.Data() << quote << ");" << std::endl;
 }
diff --git a/gui/gui/src/TGTextEntry.cxx b/gui/gui/src/TGTextEntry.cxx
index c652cddd26e..7fa8dd50840 100644
--- a/gui/gui/src/TGTextEntry.cxx
+++ b/gui/gui/src/TGTextEntry.cxx
@@ -1826,7 +1826,7 @@ const TGGC &TGTextEntry::GetDefaultSelectedBackgroundGC()
 }
 
 //______________________________________________________________________________
-void TGTextEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTextEntry::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a text entry widget as a C++ statement(s) on output stream out.
 
@@ -1867,50 +1867,50 @@ void TGTextEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          if (fFontStruct == GetDefaultFontStruct()) {
             if (fNormGC() == GetDefaultGC()()) {
                if (fWidgetId == -1) {
-                  out <<");" << endl;
+                  out <<");" << std::endl;
                } else {
-                  out << "," << fWidgetId << ");" << endl;
+                  out << "," << fWidgetId << ");" << std::endl;
                }
             } else {
-               out << "," << fWidgetId << "," << parGC.Data() << ");" << endl;
+               out << "," << fWidgetId << "," << parGC.Data() << ");" << std::endl;
             }
          } else {
             out << "," << fWidgetId << "," << parGC.Data() << "," << parFont.Data()
-                <<");" << endl;
+                <<");" << std::endl;
          }
       } else {
          out << "," << fWidgetId << "," << parGC.Data() << "," << parFont.Data()
-             << "," << GetOptionString() << ");" << endl;
+             << "," << GetOptionString() << ");" << std::endl;
       }
    } else {
       out << "," << fWidgetId << "," << parGC.Data() << "," << parFont.Data()
-          << "," << GetOptionString() << ",ucolor);" << endl;
+          << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
-   out << "   " << GetName() << "->SetMaxLength(" << GetMaxLength() << ");" << endl;
+   out << "   " << GetName() << "->SetMaxLength(" << GetMaxLength() << ");" << std::endl;
 
    out << "   " << GetName() << "->SetAlignment(";
 
    if (fAlignment == kTextLeft)
-      out << "kTextLeft);"    << endl;
+      out << "kTextLeft);"    << std::endl;
 
    if (fAlignment == kTextRight)
-      out << "kTextRight);"   << endl;
+      out << "kTextRight);"   << std::endl;
 
    if (fAlignment == kTextCenterX)
-      out << "kTextCenterX);" << endl;
+      out << "kTextCenterX);" << std::endl;
 
    out << "   " << GetName() << "->SetText(" << quote << GetText() << quote
-       << ");" << endl;
+       << ");" << std::endl;
 
    out << "   " << GetName() << "->Resize("<< GetWidth() << "," << GetName()
-       << "->GetDefaultHeight());" << endl;
+       << "->GetDefaultHeight());" << std::endl;
 
    if ((fDefWidth > 0) || (fDefHeight > 0)) {
       out << "   " << GetName() << "->SetDefaultSize(";
-      out << fDefWidth << "," << fDefHeight << ");" << endl;
+      out << fDefWidth << "," << fDefHeight << ");" << std::endl;
    }
 
    if (fTip) {
@@ -1918,6 +1918,6 @@ void TGTextEntry::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       tiptext.ReplaceAll("\n", "\\n");
       out << "   ";
       out << GetName() << "->SetToolTipText(" << quote
-          << tiptext << quote << ");"  << endl;
+          << tiptext << quote << ");"  << std::endl;
    }
 }
diff --git a/gui/gui/src/TGTextView.cxx b/gui/gui/src/TGTextView.cxx
index d610f947b3a..1f399bfa44c 100644
--- a/gui/gui/src/TGTextView.cxx
+++ b/gui/gui/src/TGTextView.cxx
@@ -1557,7 +1557,7 @@ const TGGC &TGTextView::GetDefaultSelectedBackgroundGC()
 }
 
 //______________________________________________________________________________
-void TGTextView::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTextView::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a text edit widget as a C++ statement(s) on output stream out
 
@@ -1565,13 +1565,13 @@ void TGTextView::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << "   TGTextView *";
    out << GetName() << " = new TGTextView(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight()
-       << ");"<< endl;
+       << ");"<< std::endl;
 
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fCanvas->GetBackground() != TGFrame::fgWhitePixel) {
-      out << "   " << GetName() << "->ChangeBackground(" << fCanvas->GetBackground() << ");" << endl;
+      out << "   " << GetName() << "->ChangeBackground(" << fCanvas->GetBackground() << ");" << std::endl;
    }
 
    TGText *txt = GetText();
@@ -1585,5 +1585,5 @@ void TGTextView::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       fn = TString::Format("Txt%s", GetName()+5);
       txt->Save(fn.Data());
    }
-   out << "   " << GetName() << "->LoadFile(" << quote << fn.Data() << quote << ");" << endl;
+   out << "   " << GetName() << "->LoadFile(" << quote << fn.Data() << quote << ");" << std::endl;
 }
diff --git a/gui/gui/src/TGToolBar.cxx b/gui/gui/src/TGToolBar.cxx
index 918695913a5..337348f6dc2 100644
--- a/gui/gui/src/TGToolBar.cxx
+++ b/gui/gui/src/TGToolBar.cxx
@@ -264,14 +264,14 @@ void TGToolBar::ButtonClicked()
 }
 
 //______________________________________________________________________________
-void TGToolBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGToolBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save an horizontal slider as a C++ statement(s) on output stream out.
 
    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
 
-   out << endl;
-   out << "   // tool bar" << endl;
+   out << std::endl;
+   out << "   // tool bar" << std::endl;
 
    out << "   TGToolBar *";
    out << GetName() << " = new TGToolBar(" << fParent->GetName()
@@ -279,15 +279,15 @@ void TGToolBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (!GetOptions()) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    char quote = '"';
 
@@ -301,7 +301,7 @@ void TGToolBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       if (f->fFrame->InheritsFrom(TGPictureButton::Class())) {
          if (!gROOT->ClassSaved(TGPictureButton::Class())) {
             //  declare a structure used for pictute buttons
-            out << endl << "   ToolBarData_t t;" << endl;
+            out << std::endl << "   ToolBarData_t t;" << std::endl;
          }
 
          TGPictureButton *pb = (TGPictureButton *)f->fFrame;
@@ -309,36 +309,36 @@ void TGToolBar::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
          out << "   t.fPixmap = " << quote
              << gSystem->ExpandPathName(gSystem->UnixPathName(picname))
-             << quote << ";" << endl;
+             << quote << ";" << std::endl;
          out << "   t.fTipText = " << quote
-             << pb->GetToolTip()->GetText()->GetString() << quote << ";" << endl;
+             << pb->GetToolTip()->GetText()->GetString() << quote << ";" << std::endl;
          if (pb->GetState() == kButtonDown) {
-            out << "   t.fStayDown = kTRUE;" << endl;
+            out << "   t.fStayDown = kTRUE;" << std::endl;
          } else {
-            out << "   t.fStayDown = kFALSE;" << endl;
+            out << "   t.fStayDown = kFALSE;" << std::endl;
          }
-         out << "   t.fId = " << i+1 << ";" << endl;
-         out << "   t.fButton = 0;" << endl;
+         out << "   t.fId = " << i+1 << ";" << std::endl;
+         out << "   t.fButton = 0;" << std::endl;
          out << "   " << GetName() << "->AddButton(" << GetParent()->GetName()
-             << ",&t," << f->fLayout->GetPadLeft() << ");" << endl;
+             << ",&t," << f->fLayout->GetPadLeft() << ");" << std::endl;
          if (pb->GetState() == kButtonDown) {
-            out << "   TGButton *" << pb->GetName() <<  " = t.fButton;" << endl;
-            out << "   " << pb->GetName() << "->SetState(kButtonDown);"  << endl;
+            out << "   TGButton *" << pb->GetName() <<  " = t.fButton;" << std::endl;
+            out << "   " << pb->GetName() << "->SetState(kButtonDown);"  << std::endl;
          }
          if (pb->GetState() == kButtonDisabled) {
-            out << "   TGButton *" << pb->GetName() <<  " = t.fButton;" << endl;
-            out << "   " << pb->GetName() << "->SetState(kButtonDisabled);" << endl;
+            out << "   TGButton *" << pb->GetName() <<  " = t.fButton;" << std::endl;
+            out << "   " << pb->GetName() << "->SetState(kButtonDisabled);" << std::endl;
          }
          if (pb->GetState() == kButtonEngaged) {
-            out << "   TGButton *" << pb->GetName() <<  " = t.fButton;" << endl;
-            out << "   " << pb->GetName() << "->SetState(kButtonEngaged);"  << endl;
+            out << "   TGButton *" << pb->GetName() <<  " = t.fButton;" << std::endl;
+            out << "   " << pb->GetName() << "->SetState(kButtonEngaged);"  << std::endl;
          }
          i++;
       } else {
          f->fFrame->SavePrimitive(out, option);
          out << "   " << GetName()<<"->AddFrame(" << f->fFrame->GetName();
          f->fLayout->SavePrimitive(out, option);
-         out << ");"<< endl;
+         out << ");"<< std::endl;
       }
    }
 }
diff --git a/gui/gui/src/TGTripleSlider.cxx b/gui/gui/src/TGTripleSlider.cxx
index 3f72f5b58e2..6c4a51a1e95 100644
--- a/gui/gui/src/TGTripleSlider.cxx
+++ b/gui/gui/src/TGTripleSlider.cxx
@@ -618,7 +618,7 @@ void TGTripleHSlider::SetPointerPosition(Float_t pos)
 }
 
 //______________________________________________________________________________
-void TGTripleHSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTripleHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal slider as a C++ statement(s) on output stream out.
 
@@ -641,35 +641,35 @@ void TGTripleHSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
    if (!fConstrained) {
       if (fRelative)
-         out << ",kFALSE,kTRUE);" << endl;
+         out << ",kFALSE,kTRUE);" << std::endl;
       else
-         out << ",kFALSE,kFALSE);" << endl;
+         out << ",kFALSE,kFALSE);" << std::endl;
    }
    else if (fRelative) {
-      out << ",kTRUE);" << endl;
+      out << ",kTRUE);" << std::endl;
    }
    else {
-      out << ");" << endl;
+      out << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fVmin != 0 || fVmax != (Int_t)fWidth)
       out << "   " << GetName() << "->SetRange(" << fVmin << "," << fVmax
-          << ");" << endl;
+          << ");" << std::endl;
 
    if (fSmin != fWidth/8*3 || fSmax != fWidth/8*5)
       out << "   " << GetName() << "->SetPosition(" << GetMinPosition()
-          << "," << GetMaxPosition() << ");" << endl;
+          << "," << GetMaxPosition() << ");" << std::endl;
 
    if (fScale != 10)
-      out << "   " << GetName() << "->SetScale(" << fScale << ");" << endl;
+      out << "   " << GetName() << "->SetScale(" << fScale << ");" << std::endl;
 
-   out << "   " << GetName() << "->SetPointerPosition(" << fSCz << ");" << endl;
+   out << "   " << GetName() << "->SetPointerPosition(" << fSCz << ");" << std::endl;
 }
 
 //______________________________________________________________________________
-void TGTripleVSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGTripleVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save an horizontal slider as a C++ statement(s) on output stream out.
 
@@ -692,29 +692,29 @@ void TGTripleVSlider::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
    if (!fConstrained) {
       if (fRelative)
-         out << ",kFALSE,kTRUE);" << endl;
+         out << ",kFALSE,kTRUE);" << std::endl;
       else
-         out << ",kFALSE,kFALSE);" << endl;
+         out << ",kFALSE,kFALSE);" << std::endl;
    }
    else if (fRelative) {
-      out << ",kTRUE);" << endl;
+      out << ",kTRUE);" << std::endl;
    }
    else {
-      out << ");" << endl;
+      out << ");" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fVmin != 0 || fVmax != (Int_t)fHeight)
       out << "   " << GetName() <<"->SetRange(" << fVmin << "," << fVmax
-          << ");" << endl;
+          << ");" << std::endl;
 
    if (fSmin != fHeight/8*3 || fSmax != fHeight/8*5)
       out << "   " << GetName() << "->SetPosition(" << GetMinPosition()
-          << "," << GetMaxPosition() << ");" << endl;
+          << "," << GetMaxPosition() << ");" << std::endl;
 
    if (fScale != 10)
-      out << "   " << GetName() << "->SetScale(" << fScale << ");" << endl;
+      out << "   " << GetName() << "->SetScale(" << fScale << ");" << std::endl;
 
-   out << "   " << GetName() << "->SetPointerPosition(" << fSCz << ");" << endl;
+   out << "   " << GetName() << "->SetPointerPosition(" << fSCz << ");" << std::endl;
 }
diff --git a/gui/gui/src/TGWindow.cxx b/gui/gui/src/TGWindow.cxx
index 3231f9c9bd5..17e88b0ac55 100644
--- a/gui/gui/src/TGWindow.cxx
+++ b/gui/gui/src/TGWindow.cxx
@@ -194,14 +194,14 @@ void TGWindow::Print(Option_t *option) const
    if (opt.Contains("tree")) {
 
       const TGWindow *parent = fParent;
-      cout << ClassName() << ":\t" << fId << endl;
+      std::cout << ClassName() << ":\t" << fId << std::endl;
 
       while (parent && (parent != fClient->GetDefaultRoot())) {
-         cout << "\t" << parent->ClassName() << ":\t" << parent->GetId() << endl;
+         std::cout << "\t" << parent->ClassName() << ":\t" << parent->GetId() << std::endl;
          parent = parent->GetParent();
       }
    } else {
-      cout << ClassName() << ":\t" << fId << endl;
+      std::cout << ClassName() << ":\t" << fId << std::endl;
    }
 }
 
diff --git a/gui/gui/src/TGXYLayout.cxx b/gui/gui/src/TGXYLayout.cxx
index 8b1bf3f53b7..4ed875b5fe2 100644
--- a/gui/gui/src/TGXYLayout.cxx
+++ b/gui/gui/src/TGXYLayout.cxx
@@ -124,7 +124,7 @@ TGXYLayoutHints::TGXYLayoutHints(Double_t x, Double_t y, Double_t w, Double_t h,
 }
 
 //______________________________________________________________________________
-void TGXYLayoutHints::SavePrimitive(ostream &out, Option_t * /*option = ""*/)
+void TGXYLayoutHints::SavePrimitive(std::ostream &out, Option_t * /*option = ""*/)
 {
    // Save XY layout hints as a C++ statement(s) on output stream.
    
@@ -289,7 +289,7 @@ TGDimension TGXYLayout::GetDefaultSize() const
 }
 
 //______________________________________________________________________________
-void TGXYLayout::SavePrimitive(ostream &out, Option_t * /*option = ""*/)
+void TGXYLayout::SavePrimitive(std::ostream &out, Option_t * /*option = ""*/)
 {
    // Save XY layout manager as a C++ statement(s) on output stream.
    
diff --git a/gui/gui/src/TRootCanvas.cxx b/gui/gui/src/TRootCanvas.cxx
index e2b9d691da5..da1235067df 100644
--- a/gui/gui/src/TRootCanvas.cxx
+++ b/gui/gui/src/TRootCanvas.cxx
@@ -242,7 +242,7 @@ public:
                { return fCanvas->HandleContainerExpose(ev); }
    Bool_t  HandleCrossing(Event_t *ev)
                { return fCanvas->HandleContainerCrossing(ev); }
-   void    SavePrimitive(ostream &out, Option_t * = "");
+   void    SavePrimitive(std::ostream &out, Option_t * = "");
    void    SetEditable(Bool_t) { }
 };
 
@@ -1906,15 +1906,15 @@ Bool_t TRootCanvas::HandleDNDLeave()
 }
 
 //______________________________________________________________________________
-void TRootContainer::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TRootContainer::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save a canvas container as a C++ statement(s) on output stream out.
 
-   out << endl << "   // canvas container" << endl;
+   out << std::endl << "   // canvas container" << std::endl;
    out << "   Int_t canvasID = gVirtualX->InitWindow((ULong_t)"
-       << GetParent()->GetParent()->GetName() << "->GetId());" << endl;
-   out << "   Window_t winC = gVirtualX->GetWindowID(canvasID);" << endl;
+       << GetParent()->GetParent()->GetName() << "->GetId());" << std::endl;
+   out << "   Window_t winC = gVirtualX->GetWindowID(canvasID);" << std::endl;
    out << "   TGCompositeFrame *";
    out << GetName() << " = new TGCompositeFrame(gClient,winC"
-       << "," << GetParent()->GetName() << ");" << endl;
+       << "," << GetParent()->GetName() << ");" << std::endl;
 }
diff --git a/gui/gui/src/TRootEmbeddedCanvas.cxx b/gui/gui/src/TRootEmbeddedCanvas.cxx
index 1623656c479..0dd7f5e8e68 100644
--- a/gui/gui/src/TRootEmbeddedCanvas.cxx
+++ b/gui/gui/src/TRootEmbeddedCanvas.cxx
@@ -447,7 +447,7 @@ Bool_t TRootEmbeddedCanvas::HandleDNDLeave()
 }
 
 //______________________________________________________________________________
-void TRootEmbeddedCanvas::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TRootEmbeddedCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save an embedded canvas as a C++ statement(s) on output stream out.
 
@@ -457,25 +457,25 @@ void TRootEmbeddedCanvas::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    char quote ='"';
 
-   out << endl << "   // embedded canvas" << endl;
+   out << std::endl << "   // embedded canvas" << std::endl;
    out << "   TRootEmbeddedCanvas *";
    out << GetName() << " = new TRootEmbeddedCanvas(0" << "," << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight();
 
    if (fBackground == GetDefaultFrameBackground()) {
       if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
-         out <<");" << endl;
+         out <<");" << std::endl;
       } else {
-         out << "," << GetOptionString() <<");" << endl;
+         out << "," << GetOptionString() <<");" << std::endl;
       }
    } else {
-      out << "," << GetOptionString() << ",ucolor);" << endl;
+      out << "," << GetOptionString() << ",ucolor);" << std::endl;
    }
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    out << "   Int_t w" << GetName() << " = " << GetName()
-       << "->GetCanvasWindowId();" << endl;
+       << "->GetCanvasWindowId();" << std::endl;
 
    static int n = 123;
    TString cname = TString::Format("c%d", n);
@@ -483,9 +483,9 @@ void TRootEmbeddedCanvas::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    out << "   TCanvas *";
    out <<  cname << " = new TCanvas(";
    out << quote << cname.Data() << quote << ", 10, 10, w"
-       << GetName() << ");" << endl;
+       << GetName() << ");" << std::endl;
    out << "   " << GetName() << "->AdoptCanvas(" << cname
-       << ");" << endl;
+       << ");" << std::endl;
 
    n++;
    //Next line is a connection to TCanvas::SavePrimitives()
diff --git a/gui/guihtml/inc/TGHtml.h b/gui/guihtml/inc/TGHtml.h
index d7af1353a1e..b2d0ac93444 100755
--- a/gui/guihtml/inc/TGHtml.h
+++ b/gui/guihtml/inc/TGHtml.h
@@ -1123,7 +1123,7 @@ public:
    virtual void CheckToggled(const char *name, Bool_t on, const char *val); // *SIGNAL*
    virtual void RadioChanged(const char *name, const char *val); // *SIGNAL*
    virtual void InputSelected(const char *name, const char *val);   //*SIGNAL*
-   virtual void SavePrimitive(ostream &out, Option_t * = "");
+   virtual void SavePrimitive(std::ostream &out, Option_t * = "");
 
 protected:
    virtual void UpdateBackgroundStart();
diff --git a/gui/guihtml/src/TGHtml.cxx b/gui/guihtml/src/TGHtml.cxx
index 19aeca940b8..b0493f92bcc 100755
--- a/gui/guihtml/src/TGHtml.cxx
+++ b/gui/guihtml/src/TGHtml.cxx
@@ -2056,36 +2056,36 @@ int TGHtml::SetInsert(const char *insIx)
 }
 
 //______________________________________________________________________________
-void TGHtml::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGHtml::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save a html widget as a C++ statement(s) on output stream out.
 
    out << "   TGHtml *";
    out << GetName() << " = new TGHtml(" << fParent->GetName()
        << "," << GetWidth() << "," << GetHeight()
-       << ");"<< endl;
+       << ");"<< std::endl;
    if (option && strstr(option, "keep_names"))
-      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
+      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
 
    if (fCanvas->GetBackground() != TGFrame::GetWhitePixel()) {
-      out << "   " << GetName() << "->ChangeBackground(" << fCanvas->GetBackground() << ");" << endl;
+      out << "   " << GetName() << "->ChangeBackground(" << fCanvas->GetBackground() << ");" << std::endl;
    }
 
    TString fn;
    TGText txt(GetText());
    fn.Form("Html%s.htm", GetName()+5);
    txt.Save(fn.Data());
-   out << "   " << "FILE *f = fopen(\"" << fn.Data() << "\", \"r\");" << endl;
-   out << "   " << "if (f) {" << endl;
-   out << "      " << GetName() << "->Clear();" << endl;
-   out << "      " << GetName() << "->Layout();" << endl;
-   out << "      " << GetName() << "->SetBaseUri(\"\");" << endl;
-   out << "      " << "char *buf = (char *)calloc(4096, sizeof(char));" << endl;
-   out << "      " << "while (fgets(buf, 4096, f)) {" << endl;
-   out << "         " << GetName() << "->ParseText(buf);" << endl;
-   out << "      " << "}" << endl;
-   out << "      " << "free(buf);" << endl;
-   out << "      " << "fclose(f);" << endl;
-   out << "   " << "}" << endl;
-   out << "   " << GetName() << "->Layout();" << endl;
+   out << "   " << "FILE *f = fopen(\"" << fn.Data() << "\", \"r\");" << std::endl;
+   out << "   " << "if (f) {" << std::endl;
+   out << "      " << GetName() << "->Clear();" << std::endl;
+   out << "      " << GetName() << "->Layout();" << std::endl;
+   out << "      " << GetName() << "->SetBaseUri(\"\");" << std::endl;
+   out << "      " << "char *buf = (char *)calloc(4096, sizeof(char));" << std::endl;
+   out << "      " << "while (fgets(buf, 4096, f)) {" << std::endl;
+   out << "         " << GetName() << "->ParseText(buf);" << std::endl;
+   out << "      " << "}" << std::endl;
+   out << "      " << "free(buf);" << std::endl;
+   out << "      " << "fclose(f);" << std::endl;
+   out << "   " << "}" << std::endl;
+   out << "   " << GetName() << "->Layout();" << std::endl;
 }
diff --git a/gui/qtgsi/src/TQCanvasMenu.cxx b/gui/qtgsi/src/TQCanvasMenu.cxx
index 143ba7793eb..6dac09eab66 100644
--- a/gui/qtgsi/src/TQCanvasMenu.cxx
+++ b/gui/qtgsi/src/TQCanvasMenu.cxx
@@ -200,7 +200,7 @@ void TQCanvasMenu::Dialog(TObject* object, TMethod* method)
       }
       else {
          if (strncmp(type, "enum", 4) != 0)
-         cout << "*** Warning in Dialog(): data type is not basic type, assuming (int)\n";
+         std::cout << "*** Warning in Dialog(): data type is not basic type, assuming (int)\n";
          strcpy(basictype, "int");
       }
 
@@ -239,7 +239,7 @@ void TQCanvasMenu::Dialog(TObject* object, TMethod* method)
          // Find out whether we have options ...
          TList *opt;
          if ((opt = m->GetOptions())) {
-            cout << "*** Warning in Dialog(): option menu not yet implemented " << opt << endl;
+            std::cout << "*** Warning in Dialog(): option menu not yet implemented " << opt << std::endl;
             // should stop dialog
             return;
          }
diff --git a/gui/qtgsi/src/TQRootCanvas.cxx b/gui/qtgsi/src/TQRootCanvas.cxx
index a023928fb84..db7168d588b 100644
--- a/gui/qtgsi/src/TQRootCanvas.cxx
+++ b/gui/qtgsi/src/TQRootCanvas.cxx
@@ -320,13 +320,13 @@ void TQRootCanvas::dropEvent( QDropEvent *Event )
          }
       }
       else
-	cout << "object " << 
+	std::cout << "object " << 
 #if  (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
 	  str.data() 
 #else 
 	  str
 #endif
-	     <<  " not found by ROOT" << endl;
+	     <<  " not found by ROOT" << std::endl;
    }
 }
 
diff --git a/gui/recorder/inc/TRecorder.h b/gui/recorder/inc/TRecorder.h
index d47e3ef0a73..6251fa9247d 100644
--- a/gui/recorder/inc/TRecorder.h
+++ b/gui/recorder/inc/TRecorder.h
@@ -234,7 +234,7 @@ public:
 
    virtual void ReplayEvent(Bool_t) {
       // Stored command is executed again
-      cout << GetText() << endl;
+      std::cout << GetText() << std::endl;
       gApplication->ProcessLine(GetText());
    }
 
diff --git a/gui/recorder/src/TRecorder.cxx b/gui/recorder/src/TRecorder.cxx
index 04226e29939..7ec0a7e79c3 100644
--- a/gui/recorder/src/TRecorder.cxx
+++ b/gui/recorder/src/TRecorder.cxx
@@ -561,8 +561,8 @@ void TRecorderReplaying::RegisterWindow(Window_t w)
    }
 
    if ((gDebug > 0) && (fWaitingForWindow)) {
-      cout << " Window registered: new ID: " << hex << w <<
-              "  previous ID: " << fWin << dec << endl;
+      std::cout << " Window registered: new ID: " << std::hex << w <<
+              "  previous ID: " << fWin << std::dec << std::endl;
    }
 
    // Lock mutex for guarding access to fWindowList
@@ -581,8 +581,8 @@ void TRecorderReplaying::RegisterWindow(Window_t w)
    if (fWaitingForWindow && fGuiEvent->fWindow == fWin) {
 
       if (gDebug > 0)
-         cout << " Window " << hex << fGuiEvent->fWindow <<
-                 " registered." << dec << endl;
+         std::cout << " Window " << std::hex << fGuiEvent->fWindow <<
+                 " registered." << std::dec << std::endl;
 
       fNextEvent = fGuiEvent;
       // Sets that we do not wait for this window anymore
@@ -640,12 +640,12 @@ Bool_t TRecorderReplaying::RemapWindowReferences()
 
    if (gDebug > 0) {
       // save actual formatting flags
-      ios_base::fmtflags org_flags = cout.flags();
-      cout << "fGuiTreeCounter = " << dec << fGuiTreeCounter <<
-              " No mapping found for ID " << hex << fGuiEvent->fWindow << endl;
+      std::ios_base::fmtflags org_flags = std::cout.flags();
+      std::cout << "fGuiTreeCounter = " << std::dec << fGuiTreeCounter <<
+              " No mapping found for ID " << std::hex << fGuiEvent->fWindow << std::endl;
       TRecorderInactive::DumpRootEvent(fGuiEvent,0);
       // restore original formatting flags
-      cout.flags(org_flags);
+      std::cout.flags(org_flags);
    }
 
    // Stopps timer and waits for the appropriate window to be registered
@@ -831,8 +831,8 @@ Bool_t TRecorderReplaying::CanOverlap()
 
 
    if (gDebug > 0) {
-      cout << "Event overlapping " <<
-              kRecEventNames[((TRecGuiEvent*)fNextEvent)->fType] << endl;
+      std::cout << "Event overlapping " <<
+              kRecEventNames[((TRecGuiEvent*)fNextEvent)->fType] << std::endl;
       TRecorderInactive::DumpRootEvent(((TRecGuiEvent*)fNextEvent), 0);
    }
 
@@ -1048,11 +1048,11 @@ void TRecorderInactive::ListCmd(const char *filename)
    Int_t entries = t1->GetEntries();
    for (Int_t i = 0; i < entries; ++i) {
       t1->GetEntry(i);
-      cout << "[" << i << "] " << "fTime=" <<
+      std::cout << "[" << i << "] " << "fTime=" <<
              (ULong64_t) fCmdEvent->GetTime() << " fText=" <<
-             fCmdEvent->GetText() << endl;
+             fCmdEvent->GetText() << std::endl;
    }
-   cout << endl;
+   std::cout << std::endl;
 
    delete fCmdEvent;
    delete file;
@@ -1105,10 +1105,10 @@ void TRecorderInactive::DumpRootEvent(TRecGuiEvent *e, Int_t n)
    // Prints out attributes of one GUI event TRecGuiEvent *e
    // Int_n n is number of event if called in cycle
 
-   cout << "[" << n << "] " << dec <<  setw(10)
-      << e->GetTime().AsString() << setw(15) << kRecEventNames[e->fType]
-      << " fW:"   << hex << e->fWindow
-      << " t:"    << dec << e->fTime
+   std::cout << "[" << n << "] " << std::dec <<  std::setw(10)
+      << e->GetTime().AsString() << std::setw(15) << kRecEventNames[e->fType]
+      << " fW:"   << std::hex << e->fWindow
+      << " t:"    << std::dec << e->fTime
       << " x:"    << DisplayValid(e->fX)
       << " y:"    << DisplayValid(e->fY)
       << " fXR:"  << DisplayValid(e->fXRoot)
@@ -1125,12 +1125,12 @@ void TRecorderInactive::DumpRootEvent(TRecGuiEvent *e, Int_t n)
 
    for (Int_t i=0; i<5; ++i)
       if (DisplayValid(e->fUser[i]) != -1)
-         cout << "[" << i << "]=" << DisplayValid(e->fUser[i]);
+         std::cout << "[" << i << "]=" << DisplayValid(e->fUser[i]);
 
    if (e->fMasked)
-      cout << " | fM:" << hex << e->fMasked;
+      std::cout << " | fM:" << std::hex << e->fMasked;
 
-   cout << endl;
+   std::cout << std::endl;
 }
 
 //______________________________________________________________________________
@@ -1325,7 +1325,7 @@ Bool_t TRecorderRecording::StartRecording()
          twin2 = (Window_t) twin->GetId();
          if (IsFiltered(twin2)) {
             if (gDebug > 0) {
-               cout << "WindowID "<< twin2 << " filtered" << endl;
+               std::cout << "WindowID "<< twin2 << " filtered" << std::endl;
             }
          }
          else if (twin != gClient->GetRoot()) {
diff --git a/hist/hist/inc/TAxis.h b/hist/hist/inc/TAxis.h
index b90cd8a5fc4..9cad5ed8e77 100644
--- a/hist/hist/inc/TAxis.h
+++ b/hist/hist/inc/TAxis.h
@@ -118,7 +118,7 @@ public:
                       }
    virtual void       LabelsOption(Option_t *option="h");  // *MENU*
    virtual void       RotateTitle(Bool_t rotate=kTRUE); // *TOGGLE* *GETTER=GetRotateTitle
-   virtual void       SaveAttributes(ostream &out, const char *name, const char *subname);
+   virtual void       SaveAttributes(std::ostream &out, const char *name, const char *subname);
    virtual void       Set(Int_t nbins, Double_t xmin, Double_t xmax);
    virtual void       Set(Int_t nbins, const Float_t *xbins);
    virtual void       Set(Int_t nbins, const Double_t *xbins);
diff --git a/hist/hist/inc/TEfficiency.h b/hist/hist/inc/TEfficiency.h
index 599d615a625..fb750207be2 100644
--- a/hist/hist/inc/TEfficiency.h
+++ b/hist/hist/inc/TEfficiency.h
@@ -127,7 +127,7 @@ public:
       TEfficiency&  operator+=(const TEfficiency& rhs);
       TEfficiency&  operator=(const TEfficiency& rhs);
       void          Paint(Option_t* opt);
-      void          SavePrimitive(ostream& out,Option_t* opt="");
+      void          SavePrimitive(std::ostream& out,Option_t* opt="");
       void          SetBetaAlpha(Double_t alpha);
       void          SetBetaBeta(Double_t beta);    
       void          SetBetaBinParameters(Int_t bin, Double_t alpha, Double_t beta);
diff --git a/hist/hist/inc/TF1.h b/hist/hist/inc/TF1.h
index 568bd0931de..ce1cffb1f85 100644
--- a/hist/hist/inc/TF1.h
+++ b/hist/hist/inc/TF1.h
@@ -259,7 +259,7 @@ public:
    virtual void     Print(Option_t *option="") const;
    virtual void     ReleaseParameter(Int_t ipar);
    virtual void     Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetChisquare(Double_t chi2) {fChisquare = chi2;}
    virtual void     SetFitResult(const ROOT::Fit::FitResult & result, const Int_t * indpar = 0);
    template <class PtrObj, typename MemFn> 
diff --git a/hist/hist/inc/TF12.h b/hist/hist/inc/TF12.h
index eedfe2be8ea..86e3eb993eb 100644
--- a/hist/hist/inc/TF12.h
+++ b/hist/hist/inc/TF12.h
@@ -44,7 +44,7 @@ public:
    virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const;
    virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0);
    virtual Double_t GetXY() const {return fXY;}
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetXY(Double_t xy);  // *MENU*
 
    ClassDef(TF12,1)  //Projection of a TF2 along x or y
diff --git a/hist/hist/inc/TF2.h b/hist/hist/inc/TF2.h
index 65693d03860..3c7a3d15a24 100644
--- a/hist/hist/inc/TF2.h
+++ b/hist/hist/inc/TF2.h
@@ -108,7 +108,7 @@ public:
    virtual TH1     *CreateHistogram();
    virtual void     Paint(Option_t *option="");
    virtual void     Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetNpy(Int_t npy=100); // *MENU*
    virtual void     SetContour(Int_t nlevels=20, const Double_t *levels=0);
    virtual void     SetContourLevel(Int_t level, Double_t value);
diff --git a/hist/hist/inc/TF3.h b/hist/hist/inc/TF3.h
index 862f33ae8c7..32c7eda23a8 100644
--- a/hist/hist/inc/TF3.h
+++ b/hist/hist/inc/TF3.h
@@ -98,7 +98,7 @@ public:
    virtual TH1     *CreateHistogram();
    virtual void     Paint(Option_t *option="");
    virtual void     Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetClippingBoxOff(); // *MENU*
    virtual void     SetClippingBoxOn(Double_t xclip=0, Double_t yclip=0, Double_t zclip=0); // *MENU*
    virtual void     SetNpz(Int_t npz=30);
diff --git a/hist/hist/inc/TGraph.h b/hist/hist/inc/TGraph.h
index fa2840909c0..b91db54afe4 100644
--- a/hist/hist/inc/TGraph.h
+++ b/hist/hist/inc/TGraph.h
@@ -171,7 +171,7 @@ public:
    virtual void          RecursiveRemove(TObject *obj);
    virtual Int_t         RemovePoint(); // *MENU*
    virtual Int_t         RemovePoint(Int_t ipoint);
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          SetEditable(Bool_t editable=kTRUE); // *TOGGLE* *GETTER=GetEditable
    virtual void          SetHistogram(TH1F *h) {fHistogram = h;}
    virtual void          SetMaximum(Double_t maximum=-1111); // *MENU*
diff --git a/hist/hist/inc/TGraph2D.h b/hist/hist/inc/TGraph2D.h
index 86900d655b8..35661f72c63 100644
--- a/hist/hist/inc/TGraph2D.h
+++ b/hist/hist/inc/TGraph2D.h
@@ -138,7 +138,7 @@ public:
    void                  Paint(Option_t *option="");
    TH1                  *Project(Option_t *option="x") const; // *MENU*
    Int_t                 RemovePoint(Int_t ipoint); // *MENU*
-   virtual void          SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void          SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void          Set(Int_t n);
    virtual void          SetDirectory(TDirectory *dir);
    virtual void          SetHistogram(TH2 *h);
diff --git a/hist/hist/inc/TGraphAsymmErrors.h b/hist/hist/inc/TGraphAsymmErrors.h
index 878d72c4063..62c82cdfd2e 100644
--- a/hist/hist/inc/TGraphAsymmErrors.h
+++ b/hist/hist/inc/TGraphAsymmErrors.h
@@ -73,7 +73,7 @@ public:
    Double_t       *GetEYhigh() const {return fEYhigh;}
 
    virtual void    Print(Option_t *chopt="") const;
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh); // *MENU*
    virtual void    SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh);
    virtual void    SetPointEXlow(Int_t i, Double_t exl);
diff --git a/hist/hist/inc/TGraphBentErrors.h b/hist/hist/inc/TGraphBentErrors.h
index 67d43f26f40..56de7f0a7d5 100644
--- a/hist/hist/inc/TGraphBentErrors.h
+++ b/hist/hist/inc/TGraphBentErrors.h
@@ -83,7 +83,7 @@ public:
    Double_t       *GetEYlowd()  const {return fEYlowd;}
    Double_t       *GetEYhighd() const {return fEYhighd;}
    virtual void    Print(Option_t *chopt="") const;
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SetPointError(Double_t exl, Double_t exh,
                                  Double_t eyl, Double_t eyh,
                                  Double_t exld=0, Double_t exhd=0,  
diff --git a/hist/hist/inc/TGraphErrors.h b/hist/hist/inc/TGraphErrors.h
index 4880087b826..4351e79d593 100644
--- a/hist/hist/inc/TGraphErrors.h
+++ b/hist/hist/inc/TGraphErrors.h
@@ -66,7 +66,7 @@ public:
    Double_t       *GetEX() const {return fEX;}
    Double_t       *GetEY() const {return fEY;}
    virtual void    Print(Option_t *chopt="") const;
-   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void    SetPointError(Double_t ex, Double_t ey);  // *MENU
    virtual void    SetPointError(Int_t i, Double_t ex, Double_t ey);
 
diff --git a/hist/hist/inc/TH1.h b/hist/hist/inc/TH1.h
index f72d2751fba..2202ed5e8d5 100644
--- a/hist/hist/inc/TH1.h
+++ b/hist/hist/inc/TH1.h
@@ -134,7 +134,7 @@ protected:
    virtual void     Copy(TObject &hnew) const;
    virtual Int_t    BufferFill(Double_t x, Double_t w);
    virtual Bool_t   FindNewAxisLimits(const TAxis* axis, const Double_t point, Double_t& newMin, Double_t &newMax);
-   virtual void     SavePrimitiveHelp(ostream &out, const char *hname, Option_t *option = "");
+   virtual void     SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option = "");
    static Bool_t    RecomputeAxisLimits(TAxis& destAxis, const TAxis& anAxis);
    static Bool_t    SameLimitsAndNBins(const TAxis& axis1, const TAxis& axis2);
 
@@ -325,7 +325,7 @@ public:
    virtual void     RecursiveRemove(TObject *obj);
    virtual void     Reset(Option_t *option="");
    virtual void     ResetStats();
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     Scale(Double_t c1=1, Option_t *option="");
    virtual void     SetAxisColor(Color_t color=1, Option_t *axis="X");
    virtual void     SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X");
diff --git a/hist/hist/inc/TH1K.h b/hist/hist/inc/TH1K.h
index 21d5f4ba8ad..d43464ff9d7 100644
--- a/hist/hist/inc/TH1K.h
+++ b/hist/hist/inc/TH1K.h
@@ -51,7 +51,7 @@ public:
     
     
    virtual void      Reset(Option_t *option="");
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
 
    void    SetKOrd(Int_t k){fKOrd=k;}
    
diff --git a/hist/hist/inc/TH2Poly.h b/hist/hist/inc/TH2Poly.h
index 7f19b2ee30d..cfb040fcdf6 100644
--- a/hist/hist/inc/TH2Poly.h
+++ b/hist/hist/inc/TH2Poly.h
@@ -117,7 +117,7 @@ public:
    Double_t     Integral(Int_t, Int_t, Int_t, Int_t, const Option_t*) const{return 0;}               //MayNotUse
    Double_t     Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, const Option_t*) const{return 0;} //MayNotUse
    void         Reset(Option_t *option);
-   void         SavePrimitive(ostream& out, Option_t* option = "");
+   void         SavePrimitive(std::ostream& out, Option_t* option = "");
    void         SetBinContent(Int_t bin, Double_t content);
    void         SetBinContent(Int_t, Int_t, Double_t){return;}           //MayNotUse
    void         SetBinContent(Int_t, Int_t, Int_t, Double_t){return;}    //MayNotUse
diff --git a/hist/hist/inc/THStack.h b/hist/hist/inc/THStack.h
index 0d0e26ef61c..fb8a703b208 100644
--- a/hist/hist/inc/THStack.h
+++ b/hist/hist/inc/THStack.h
@@ -73,7 +73,7 @@ public:
    virtual void     Paint(Option_t *chopt="");
    virtual void     Print(Option_t *chopt="") const;
    virtual void     RecursiveRemove(TObject *obj);
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetHistogram(TH1 *h) {fHistogram = h;}
    virtual void     SetMaximum(Double_t maximum=-1111); // *MENU*
    virtual void     SetMinimum(Double_t minimum=-1111); // *MENU*
diff --git a/hist/hist/inc/TMultiGraph.h b/hist/hist/inc/TMultiGraph.h
index 8fd26283083..cf9dd99e26f 100644
--- a/hist/hist/inc/TMultiGraph.h
+++ b/hist/hist/inc/TMultiGraph.h
@@ -77,7 +77,7 @@ public:
    void              PaintPolyLine3D(Option_t *chopt="");
    virtual void      Print(Option_t *chopt="") const;
    virtual void      RecursiveRemove(TObject *obj);
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      SetMaximum(Double_t maximum=-1111);
    virtual void      SetMinimum(Double_t minimum=-1111);
   
diff --git a/hist/hist/inc/TPolyMarker.h b/hist/hist/inc/TPolyMarker.h
index 2fb29791b47..14b374ceb5d 100644
--- a/hist/hist/inc/TPolyMarker.h
+++ b/hist/hist/inc/TPolyMarker.h
@@ -66,7 +66,7 @@ public:
    virtual void     Paint(Option_t *option="");
    virtual void     PaintPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
    virtual void     Print(Option_t *option="") const;
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual Int_t    SetNextPoint(Double_t x, Double_t y); // *MENU*
    virtual void     SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
    virtual void     SetPolyMarker(Int_t n);
diff --git a/hist/hist/inc/TProfile.h b/hist/hist/inc/TProfile.h
index 5326734b88f..eebde1b6cfa 100644
--- a/hist/hist/inc/TProfile.h
+++ b/hist/hist/inc/TProfile.h
@@ -123,7 +123,7 @@ public:
            TH1     *Rebin(Int_t ngroup=2, const char*newname="", const Double_t *xbins=0);
    virtual void     RebinAxis(Double_t x, TAxis *axis);
    virtual void     Reset(Option_t *option="");
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     Scale(Double_t c1=1, Option_t *option="");
    virtual void     SetBinEntries(Int_t bin, Double_t w);
    virtual void     SetBins(Int_t nbins, Double_t xmin, Double_t xmax);
diff --git a/hist/hist/inc/TProfile2D.h b/hist/hist/inc/TProfile2D.h
index a881f2176be..afb1164da9e 100644
--- a/hist/hist/inc/TProfile2D.h
+++ b/hist/hist/inc/TProfile2D.h
@@ -129,7 +129,7 @@ public:
    virtual TProfile2D *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="");
    virtual TProfile2D *RebinX(Int_t ngroup=2, const char *newname="");
    virtual TProfile2D *RebinY(Int_t ngroup=2, const char *newname="");     
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      Scale(Double_t c1=1, Option_t *option="");
    virtual void      SetBinEntries(Int_t bin, Double_t w);
    virtual void      SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, Int_t nbinsy, Double_t ymin, Double_t ymax);
diff --git a/hist/hist/inc/TProfile3D.h b/hist/hist/inc/TProfile3D.h
index 2e652a1373b..9ac6867bd25 100644
--- a/hist/hist/inc/TProfile3D.h
+++ b/hist/hist/inc/TProfile3D.h
@@ -126,7 +126,7 @@ public:
    virtual void      PutStats(Double_t *stats);
    virtual void      Reset(Option_t *option="");
    virtual void      RebinAxis(Double_t x, TAxis *axis);
-   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void      Scale(Double_t c1=1, Option_t *option="");
    virtual void      SetBinEntries(Int_t bin, Double_t w);
    virtual void      SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, 
diff --git a/hist/hist/inc/TSpline.h b/hist/hist/inc/TSpline.h
index 7a8b6586620..85629bebacd 100644
--- a/hist/hist/inc/TSpline.h
+++ b/hist/hist/inc/TSpline.h
@@ -236,7 +236,7 @@ public:
    void GetKnot(Int_t i, Double_t &x, Double_t &y) const
       {x=fPoly[i].X(); y=fPoly[i].Y();}
    virtual  void     SaveAs(const char *filename,Option_t *option="") const;
-   virtual  void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual  void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual  void     SetPoint(Int_t i, Double_t x, Double_t y);
    virtual  void     SetPointCoeff(Int_t i, Double_t b, Double_t c, Double_t d);
    static void Test();
@@ -299,7 +299,7 @@ public:
    void GetKnot(Int_t i, Double_t &x, Double_t &y) const
       {x=fPoly[i].X(); y=fPoly[i].Y();}
    virtual  void     SaveAs(const char *filename,Option_t *option="") const;
-   virtual  void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual  void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual  void     SetPoint(Int_t i, Double_t x, Double_t y);
    virtual  void     SetPointCoeff(Int_t i, Double_t b, Double_t c, Double_t d,
 				   Double_t e, Double_t f);
diff --git a/hist/hist/src/HFitInterface.cxx b/hist/hist/src/HFitInterface.cxx
index c11d8069d06..8cbbe4a04c3 100644
--- a/hist/hist/src/HFitInterface.cxx
+++ b/hist/hist/src/HFitInterface.cxx
@@ -675,14 +675,14 @@ void FillData(SparseData & dv, const TH1 * h1, TF1 * /*func*/)
          int x,y,z;
          h1->GetBinXYZ(i, x, y, z);
          
-//          cout << "FILLDATA: h1(" << i << ")"
+//          std::cout << "FILLDATA: h1(" << i << ")"
 //               << "[" << h1->GetXaxis()->GetBinLowEdge(x) << "-" << h1->GetXaxis()->GetBinUpEdge(x) << "]";
 //          if ( dim >= 2 )
-//             cout   << "[" << h1->GetYaxis()->GetBinLowEdge(y) << "-" << h1->GetYaxis()->GetBinUpEdge(y) << "]";
+//             std::cout   << "[" << h1->GetYaxis()->GetBinLowEdge(y) << "-" << h1->GetYaxis()->GetBinUpEdge(y) << "]";
 //          if ( dim >= 3 )
-//             cout   << "[" << h1->GetZaxis()->GetBinLowEdge(z) << "-" << h1->GetZaxis()->GetBinUpEdge(z) << "]";
+//             std::cout   << "[" << h1->GetZaxis()->GetBinLowEdge(z) << "-" << h1->GetZaxis()->GetBinUpEdge(z) << "]";
 
-//          cout << h1->GetBinContent(i) << endl;
+//          std::cout << h1->GetBinContent(i) << std::endl;
          
          min[0] = h1->GetXaxis()->GetBinLowEdge(x);
          max[0] = h1->GetXaxis()->GetBinUpEdge(x);
@@ -714,7 +714,7 @@ void FillData(SparseData & dv, const THnBase * h1, TF1 * /*func*/)
       double value = h1->GetBinContent( i, &coord[0] );
       if ( !value ) continue;
 
-//       cout << "FILLDATA(SparseData): h1(" << i << ")";
+//       std::cout << "FILLDATA(SparseData): h1(" << i << ")";
 
       // Exclude underflows and oveflows! (defect behaviour with the TH1*)
       bool insertBox = true;
@@ -729,16 +729,16 @@ void FillData(SparseData & dv, const THnBase * h1, TF1 * /*func*/)
          max[j] = h1->GetAxis(j)->GetBinUpEdge(coord[j]);
       }
       if ( !insertBox ) { 
-//          cout << "NOT INSERTED!"<< endl; 
+//          std::cout << "NOT INSERTED!"<< std::endl; 
          continue; 
       }
 
 //       for ( int j = 0; j < dim; ++j )
 //       {
-//          cout << "[" << h1->GetAxis(j)->GetBinLowEdge(coord[j]) 
+//          std::cout << "[" << h1->GetAxis(j)->GetBinLowEdge(coord[j]) 
 //               << "-" << h1->GetAxis(j)->GetBinUpEdge(coord[j]) << "]";
 //       }
-//       cout << h1->GetBinContent(i) << endl;
+//       std::cout << h1->GetBinContent(i) << std::endl;
 
       dv.Add(min, max, value, h1->GetBinError(i));
    }
@@ -768,7 +768,7 @@ void FillData(BinData & dv, const THnBase * s1, TF1 * func)
    ROOT::Fit::SparseData d(ndim, &xmin[0], &xmax[0]);
    ROOT::Fit::FillData(d, s1, func);
 
-//    cout << "FillData(BinData & dv, const THnBase * s1, TF1 * func) (1)" << endl;
+//    std::cout << "FillData(BinData & dv, const THnBase * s1, TF1 * func) (1)" << std::endl;
 
    // Create the bin data from the sparse data
    d.GetBinDataIntegral(dv);
diff --git a/hist/hist/src/TAxis.cxx b/hist/hist/src/TAxis.cxx
index 01ccd8124c8..f8036d0c2ab 100644
--- a/hist/hist/src/TAxis.cxx
+++ b/hist/hist/src/TAxis.cxx
@@ -620,60 +620,60 @@ void TAxis::RotateTitle(Bool_t rotate)
 }
 
 //______________________________________________________________________________
-void TAxis::SaveAttributes(ostream &out, const char *name, const char *subname)
+void TAxis::SaveAttributes(std::ostream &out, const char *name, const char *subname)
 {
     // Save axis attributes as C++ statement(s) on output stream out
 
    char quote = '"';
    if (strlen(GetTitle())) {
-      out<<"   "<<name<<subname<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
    }
    if (fTimeDisplay) {
-      out<<"   "<<name<<subname<<"->SetTimeDisplay(1);"<<endl;
-      out<<"   "<<name<<subname<<"->SetTimeFormat("<<quote<<GetTimeFormat()<<quote<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetTimeDisplay(1);"<<std::endl;
+      out<<"   "<<name<<subname<<"->SetTimeFormat("<<quote<<GetTimeFormat()<<quote<<");"<<std::endl;
    }
    if (fLabels) {
       TIter next(fLabels);
       TObjString *obj;
       while ((obj=(TObjString*)next())) {
-         out<<"   "<<name<<subname<<"->SetBinLabel("<<obj->GetUniqueID()<<","<<quote<<obj->GetName()<<quote<<");"<<endl;
+         out<<"   "<<name<<subname<<"->SetBinLabel("<<obj->GetUniqueID()<<","<<quote<<obj->GetName()<<quote<<");"<<std::endl;
       }
    }
 
    if (fFirst || fLast) {
-      out<<"   "<<name<<subname<<"->SetRange("<<fFirst<<","<<fLast<<");"<<endl;
+      out<<"   "<<name<<subname<<"->SetRange("<<fFirst<<","<<fLast<<");"<<std::endl;
    }
 
    if (TestBit(kLabelsHori)) {
-      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsHori);"<<endl;
+      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsHori);"<<std::endl;
    }
 
    if (TestBit(kLabelsVert)) {
-      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsVert);"<<endl;
+      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsVert);"<<std::endl;
    }
 
    if (TestBit(kLabelsDown)) {
-      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsDown);"<<endl;
+      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsDown);"<<std::endl;
    }
 
    if (TestBit(kLabelsUp)) {
-      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsUp);"<<endl;
+      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsUp);"<<std::endl;
    }
 
    if (TestBit(kCenterTitle)) {
-      out<<"   "<<name<<subname<<"->CenterTitle(true);"<<endl;
+      out<<"   "<<name<<subname<<"->CenterTitle(true);"<<std::endl;
    }
 
    if (TestBit(kRotateTitle)) {
-      out<<"   "<<name<<subname<<"->RotateTitle(true);"<<endl;
+      out<<"   "<<name<<subname<<"->RotateTitle(true);"<<std::endl;
    }
 
    if (TestBit(kMoreLogLabels)) {
-      out<<"   "<<name<<subname<<"->SetMoreLogLabels();"<<endl;
+      out<<"   "<<name<<subname<<"->SetMoreLogLabels();"<<std::endl;
    }
 
    if (TestBit(kNoExponent)) {
-      out<<"   "<<name<<subname<<"->SetNoExponent();"<<endl;
+      out<<"   "<<name<<subname<<"->SetNoExponent();"<<std::endl;
    }
 
    TAttAxis::SaveAttributes(out,name,subname);
diff --git a/hist/hist/src/TConfidenceLevel.cxx b/hist/hist/src/TConfidenceLevel.cxx
index 504acffafc0..90412bd027d 100644
--- a/hist/hist/src/TConfidenceLevel.cxx
+++ b/hist/hist/src/TConfidenceLevel.cxx
@@ -191,7 +191,7 @@ Double_t TConfidenceLevel::CLs(bool use_sMC) const
 
    Double_t clb = CLb(kFALSE);
    Double_t clsb = CLsb(use_sMC);
-   if(clb==0) { cout << "Warning: clb = 0 !" << endl; return 0;}
+   if(clb==0) { std::cout << "Warning: clb = 0 !" << std::endl; return 0;}
    else return clsb/clb;
 }
 
diff --git a/hist/hist/src/TEfficiency.cxx b/hist/hist/src/TEfficiency.cxx
index c663c2810b1..cdc90d672a9 100644
--- a/hist/hist/src/TEfficiency.cxx
+++ b/hist/hist/src/TEfficiency.cxx
@@ -2801,7 +2801,7 @@ void TEfficiency::Paint(const Option_t* opt)
 }
 
 //______________________________________________________________________________
-void TEfficiency::SavePrimitive(ostream& out,Option_t* opt)
+void TEfficiency::SavePrimitive(std::ostream& out,Option_t* opt)
 {
    //have histograms fixed bins along each axis?
    Bool_t equi_bins = true;
diff --git a/hist/hist/src/TF1.cxx b/hist/hist/src/TF1.cxx
index 2668909b7e9..3b55d32ff2d 100644
--- a/hist/hist/src/TF1.cxx
+++ b/hist/hist/src/TF1.cxx
@@ -2981,28 +2981,28 @@ void TF1::Save(Double_t xmin, Double_t xmax, Double_t, Double_t, Double_t, Doubl
 
 
 //______________________________________________________________________________
-void TF1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TF1::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    Int_t i;
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    //if (!fMethodCall) {
    if (!fType) {
-      out<<"   TF1 *"<<GetName()<<" = new TF1("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<","<<fXmin<<","<<fXmax<<");"<<endl;
+      out<<"   TF1 *"<<GetName()<<" = new TF1("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<","<<fXmin<<","<<fXmax<<");"<<std::endl;
       if (fNpx != 100) {
-         out<<"   "<<GetName()<<"->SetNpx("<<fNpx<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetNpx("<<fNpx<<");"<<std::endl;
       }
    } else {
-      out<<"   TF1 *"<<GetName()<<" = new TF1("<<quote<<"*"<<GetName()<<quote<<","<<fXmin<<","<<fXmax<<","<<GetNpar()<<");"<<endl;
-      out<<"    //The original function : "<<GetTitle()<<" had originally been created by:" <<endl;
-      out<<"    //TF1 *"<<GetName()<<" = new TF1("<<quote<<GetName()<<quote<<","<<GetTitle()<<","<<fXmin<<","<<fXmax<<","<<GetNpar()<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetRange("<<fXmin<<","<<fXmax<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetName("<<quote<<GetName()<<quote<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+      out<<"   TF1 *"<<GetName()<<" = new TF1("<<quote<<"*"<<GetName()<<quote<<","<<fXmin<<","<<fXmax<<","<<GetNpar()<<");"<<std::endl;
+      out<<"    //The original function : "<<GetTitle()<<" had originally been created by:" <<std::endl;
+      out<<"    //TF1 *"<<GetName()<<" = new TF1("<<quote<<GetName()<<quote<<","<<GetTitle()<<","<<fXmin<<","<<fXmax<<","<<GetNpar()<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetRange("<<fXmin<<","<<fXmax<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
       if (fNpx != 100) {
-         out<<"   "<<GetName()<<"->SetNpx("<<fNpx<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetNpx("<<fNpx<<");"<<std::endl;
       }
       Double_t dx = (fXmax-fXmin)/fNpx;
       Double_t xv[1];
@@ -3010,54 +3010,54 @@ void TF1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       for (i=0;i<=fNpx;i++) {
          xv[0]    = fXmin + dx*i;
          Double_t save = EvalPar(xv,fParams);
-         out<<"   "<<GetName()<<"->SetSavedPoint("<<i<<","<<save<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetSavedPoint("<<i<<","<<save<<");"<<std::endl;
       }
-      out<<"   "<<GetName()<<"->SetSavedPoint("<<fNpx+1<<","<<fXmin<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetSavedPoint("<<fNpx+2<<","<<fXmax<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetSavedPoint("<<fNpx+1<<","<<fXmin<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetSavedPoint("<<fNpx+2<<","<<fXmax<<");"<<std::endl;
    }
 
    if (TestBit(kNotDraw)) {
-      out<<"   "<<GetName()<<"->SetBit(TF1::kNotDraw);"<<endl;
+      out<<"   "<<GetName()<<"->SetBit(TF1::kNotDraw);"<<std::endl;
    }
    if (GetFillColor() != 0) {
       if (GetFillColor() > 228) {
          TColor::SaveColor(out, GetFillColor());
-         out<<"   "<<GetName()<<"->SetFillColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetFillColor(ci);" << std::endl;
       } else
-         out<<"   "<<GetName()<<"->SetFillColor("<<GetFillColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetFillColor("<<GetFillColor()<<");"<<std::endl;
    }
    if (GetFillStyle() != 1001) {
-      out<<"   "<<GetName()<<"->SetFillStyle("<<GetFillStyle()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetFillStyle("<<GetFillStyle()<<");"<<std::endl;
    }
    if (GetMarkerColor() != 1) {
       if (GetMarkerColor() > 228) {
          TColor::SaveColor(out, GetMarkerColor());
-         out<<"   "<<GetName()<<"->SetMarkerColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetMarkerColor(ci);" << std::endl;
       } else
-         out<<"   "<<GetName()<<"->SetMarkerColor("<<GetMarkerColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetMarkerColor("<<GetMarkerColor()<<");"<<std::endl;
    }
    if (GetMarkerStyle() != 1) {
-      out<<"   "<<GetName()<<"->SetMarkerStyle("<<GetMarkerStyle()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetMarkerStyle("<<GetMarkerStyle()<<");"<<std::endl;
    }
    if (GetMarkerSize() != 1) {
-      out<<"   "<<GetName()<<"->SetMarkerSize("<<GetMarkerSize()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetMarkerSize("<<GetMarkerSize()<<");"<<std::endl;
    }
    if (GetLineColor() != 1) {
       if (GetLineColor() > 228) {
          TColor::SaveColor(out, GetLineColor());
-         out<<"   "<<GetName()<<"->SetLineColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetLineColor(ci);" << std::endl;
       } else
-         out<<"   "<<GetName()<<"->SetLineColor("<<GetLineColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetLineColor("<<GetLineColor()<<");"<<std::endl;
    }
    if (GetLineWidth() != 4) {
-      out<<"   "<<GetName()<<"->SetLineWidth("<<GetLineWidth()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetLineWidth("<<GetLineWidth()<<");"<<std::endl;
    }
    if (GetLineStyle() != 1) {
-      out<<"   "<<GetName()<<"->SetLineStyle("<<GetLineStyle()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetLineStyle("<<GetLineStyle()<<");"<<std::endl;
    }
    if (GetChisquare() != 0) {
-      out<<"   "<<GetName()<<"->SetChisquare("<<GetChisquare()<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetNDF("<<GetNDF()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetChisquare("<<GetChisquare()<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetNDF("<<GetNDF()<<");"<<std::endl;
    }
 
    if (GetXaxis()) GetXaxis()->SaveAttributes(out,GetName(),"->GetXaxis()");
@@ -3065,14 +3065,14 @@ void TF1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
    Double_t parmin, parmax;
    for (i=0;i<fNpar;i++) {
-      out<<"   "<<GetName()<<"->SetParameter("<<i<<","<<GetParameter(i)<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetParError("<<i<<","<<GetParError(i)<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetParameter("<<i<<","<<GetParameter(i)<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetParError("<<i<<","<<GetParError(i)<<");"<<std::endl;
       GetParLimits(i,parmin,parmax);
-      out<<"   "<<GetName()<<"->SetParLimits("<<i<<","<<parmin<<","<<parmax<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetParLimits("<<i<<","<<parmin<<","<<parmax<<");"<<std::endl;
    }
    if (!strstr(option,"nodraw")) {
       out<<"   "<<GetName()<<"->Draw("
-         <<quote<<option<<quote<<");"<<endl;
+         <<quote<<option<<quote<<");"<<std::endl;
    }
 }
 
diff --git a/hist/hist/src/TF12.cxx b/hist/hist/src/TF12.cxx
index 6b382b2de53..052415004d6 100644
--- a/hist/hist/src/TF12.cxx
+++ b/hist/hist/src/TF12.cxx
@@ -159,7 +159,7 @@ Double_t TF12::EvalPar(const Double_t *x, const Double_t *params)
 
 
 //______________________________________________________________________________
-void TF12::SavePrimitive(ostream & /*out*/, Option_t * /*option*/ /*= ""*/)
+void TF12::SavePrimitive(std::ostream & /*out*/, Option_t * /*option*/ /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
diff --git a/hist/hist/src/TF2.cxx b/hist/hist/src/TF2.cxx
index c98f404949d..5f21639fa69 100644
--- a/hist/hist/src/TF2.cxx
+++ b/hist/hist/src/TF2.cxx
@@ -830,74 +830,74 @@ void TF2::Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Doubl
 }
 
 //______________________________________________________________________________
-void TF2::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TF2::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TF2::Class())) {
       out<<"   ";
    } else {
       out<<"   TF2 *";
    }
    if (!fMethodCall) {
-      out<<GetName()<<" = new TF2("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<");"<<endl;
+      out<<GetName()<<" = new TF2("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<");"<<std::endl;
    } else {
-      out<<GetName()<<" = new TF2("<<quote<<GetName()<<quote<<","<<GetTitle()<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<","<<GetNpar()<<");"<<endl;
+      out<<GetName()<<" = new TF2("<<quote<<GetName()<<quote<<","<<GetTitle()<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<","<<GetNpar()<<");"<<std::endl;
    }
 
    if (GetFillColor() != 0) {
       if (GetFillColor() > 228) {
          TColor::SaveColor(out, GetFillColor());
-         out<<"   "<<GetName()<<"->SetFillColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetFillColor(ci);" << std::endl;
       } else 
-         out<<"   "<<GetName()<<"->SetFillColor("<<GetFillColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetFillColor("<<GetFillColor()<<");"<<std::endl;
    }
    if (GetFillStyle() != 1001) {
-      out<<"   "<<GetName()<<"->SetFillStyle("<<GetFillStyle()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetFillStyle("<<GetFillStyle()<<");"<<std::endl;
    }
    if (GetMarkerColor() != 1) {
       if (GetMarkerColor() > 228) {
          TColor::SaveColor(out, GetMarkerColor());
-         out<<"   "<<GetName()<<"->SetMarkerColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetMarkerColor(ci);" << std::endl;
       } else 
-         out<<"   "<<GetName()<<"->SetMarkerColor("<<GetMarkerColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetMarkerColor("<<GetMarkerColor()<<");"<<std::endl;
    }
    if (GetMarkerStyle() != 1) {
-      out<<"   "<<GetName()<<"->SetMarkerStyle("<<GetMarkerStyle()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetMarkerStyle("<<GetMarkerStyle()<<");"<<std::endl;
    }
    if (GetMarkerSize() != 1) {
-      out<<"   "<<GetName()<<"->SetMarkerSize("<<GetMarkerSize()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetMarkerSize("<<GetMarkerSize()<<");"<<std::endl;
    }
    if (GetLineColor() != 1) {
       if (GetLineColor() > 228) {
          TColor::SaveColor(out, GetLineColor());
-         out<<"   "<<GetName()<<"->SetLineColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetLineColor(ci);" << std::endl;
       } else 
-         out<<"   "<<GetName()<<"->SetLineColor("<<GetLineColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetLineColor("<<GetLineColor()<<");"<<std::endl;
    }
    if (GetLineWidth() != 4) {
-      out<<"   "<<GetName()<<"->SetLineWidth("<<GetLineWidth()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetLineWidth("<<GetLineWidth()<<");"<<std::endl;
    }
    if (GetLineStyle() != 1) {
-      out<<"   "<<GetName()<<"->SetLineStyle("<<GetLineStyle()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetLineStyle("<<GetLineStyle()<<");"<<std::endl;
    }
    if (GetNpx() != 100) {
-      out<<"   "<<GetName()<<"->SetNpx("<<GetNpx()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetNpx("<<GetNpx()<<");"<<std::endl;
    }
    if (GetChisquare() != 0) {
-      out<<"   "<<GetName()<<"->SetChisquare("<<GetChisquare()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetChisquare("<<GetChisquare()<<");"<<std::endl;
    }
    Double_t parmin, parmax;
    for (Int_t i=0;i<fNpar;i++) {
-      out<<"   "<<GetName()<<"->SetParameter("<<i<<","<<GetParameter(i)<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetParError("<<i<<","<<GetParError(i)<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetParameter("<<i<<","<<GetParameter(i)<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetParError("<<i<<","<<GetParError(i)<<");"<<std::endl;
       GetParLimits(i,parmin,parmax);
-      out<<"   "<<GetName()<<"->SetParLimits("<<i<<","<<parmin<<","<<parmax<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetParLimits("<<i<<","<<parmin<<","<<parmax<<");"<<std::endl;
    }
    out<<"   "<<GetName()<<"->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
 }
 
 
diff --git a/hist/hist/src/TF3.cxx b/hist/hist/src/TF3.cxx
index b480bb8a0e2..c65f25d409b 100644
--- a/hist/hist/src/TF3.cxx
+++ b/hist/hist/src/TF3.cxx
@@ -652,52 +652,52 @@ void TF3::Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Doubl
 }
 
 //______________________________________________________________________________
-void TF3::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TF3::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TF3::Class())) {
       out<<"   ";
    } else {
       out<<"   TF3 *";
    }
    if (!fMethodCall) {
-      out<<GetName()<<" = new TF3("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<","<<fZmin<<","<<fZmax<<");"<<endl;
+      out<<GetName()<<" = new TF3("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<","<<fZmin<<","<<fZmax<<");"<<std::endl;
    } else {
-      out<<GetName()<<" = new TF3("<<quote<<GetName()<<quote<<","<<GetTitle()<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<","<<fZmin<<","<<fZmax<<","<<GetNpar()<<");"<<endl;
+      out<<GetName()<<" = new TF3("<<quote<<GetName()<<quote<<","<<GetTitle()<<","<<fXmin<<","<<fXmax<<","<<fYmin<<","<<fYmax<<","<<fZmin<<","<<fZmax<<","<<GetNpar()<<");"<<std::endl;
    }
 
    if (GetFillColor() != 0) {
       if (GetFillColor() > 228) {
          TColor::SaveColor(out, GetFillColor());
-         out<<"   "<<GetName()<<"->SetFillColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetFillColor(ci);" << std::endl;
       } else 
-         out<<"   "<<GetName()<<"->SetFillColor("<<GetFillColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetFillColor("<<GetFillColor()<<");"<<std::endl;
    }
    if (GetLineColor() != 1) {
       if (GetLineColor() > 228) {
          TColor::SaveColor(out, GetLineColor());
-         out<<"   "<<GetName()<<"->SetLineColor(ci);" << endl;
+         out<<"   "<<GetName()<<"->SetLineColor(ci);" << std::endl;
       } else 
-         out<<"   "<<GetName()<<"->SetLineColor("<<GetLineColor()<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetLineColor("<<GetLineColor()<<");"<<std::endl;
    }
    if (GetNpz() != 100) {
-      out<<"   "<<GetName()<<"->SetNpz("<<GetNpz()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetNpz("<<GetNpz()<<");"<<std::endl;
    }
    if (GetChisquare() != 0) {
-      out<<"   "<<GetName()<<"->SetChisquare("<<GetChisquare()<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetChisquare("<<GetChisquare()<<");"<<std::endl;
    }
    Double_t parmin, parmax;
    for (Int_t i=0;i<fNpar;i++) {
-      out<<"   "<<GetName()<<"->SetParameter("<<i<<","<<GetParameter(i)<<");"<<endl;
-      out<<"   "<<GetName()<<"->SetParError("<<i<<","<<GetParError(i)<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetParameter("<<i<<","<<GetParameter(i)<<");"<<std::endl;
+      out<<"   "<<GetName()<<"->SetParError("<<i<<","<<GetParError(i)<<");"<<std::endl;
       GetParLimits(i,parmin,parmax);
-      out<<"   "<<GetName()<<"->SetParLimits("<<i<<","<<parmin<<","<<parmax<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetParLimits("<<i<<","<<parmin<<","<<parmax<<");"<<std::endl;
    }
    out<<"   "<<GetName()<<"->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/hist/hist/src/TFractionFitter.cxx b/hist/hist/src/TFractionFitter.cxx
index 57ff5c04142..33da0c61cf9 100644
--- a/hist/hist/src/TFractionFitter.cxx
+++ b/hist/hist/src/TFractionFitter.cxx
@@ -34,7 +34,7 @@
 //   fit->Constrain(1,0.0,1.0);               // constrain fraction 1 to be between 0 and 1
 //   fit->SetRangeX(1,15);                    // use only the first 15 bins in the fit
 //   Int_t status = fit->Fit();               // perform the fit
-//   cout << "fit status: " << status << endl;
+//   std::cout << "fit status: " << status << std::endl;
 //   if (status == 0) {                       // check on fit status
 //     TH1F* result = (TH1F*) fit->GetPlot();
 //     data->Draw("Ep");
diff --git a/hist/hist/src/TGraph.cxx b/hist/hist/src/TGraph.cxx
index 6fa6d771b18..c5e62a98042 100644
--- a/hist/hist/src/TGraph.cxx
+++ b/hist/hist/src/TGraph.cxx
@@ -376,7 +376,7 @@ TGraph::TGraph(const char *filename, const char *format, Option_t *option)
    TString fname = filename;
    gSystem->ExpandPathName(fname);
 
-   ifstream infile(fname.Data());
+   std::ifstream infile(fname.Data());
    if (!infile.good()) {
       MakeZombie();
       Error("TGraph", "Cannot open file: %s, TGraph is Zombie", filename);
@@ -2065,30 +2065,30 @@ Int_t TGraph::RemovePoint(Int_t ipoint)
 
 
 //______________________________________________________________________________
-void TGraph::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGraph::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out << "   " << endl;
+   out << "   " << std::endl;
    if (gROOT->ClassSaved(TGraph::Class())) {
       out << "   ";
    } else {
       out << "   TGraph *";
    }
-   out << "graph = new TGraph(" << fNpoints << ");" << endl;
-   out << "   graph->SetName(" << quote << GetName() << quote << ");" << endl;
-   out << "   graph->SetTitle(" << quote << GetTitle() << quote << ");" << endl;
+   out << "graph = new TGraph(" << fNpoints << ");" << std::endl;
+   out << "   graph->SetName(" << quote << GetName() << quote << ");" << std::endl;
+   out << "   graph->SetTitle(" << quote << GetTitle() << quote << ");" << std::endl;
 
    SaveFillAttributes(out, "graph", 0, 1001);
    SaveLineAttributes(out, "graph", 1, 1, 1);
    SaveMarkerAttributes(out, "graph", 1, 1, 1);
 
    if (fNpoints >= 1) {
-      streamsize prec = out.precision();
+      std::streamsize prec = out.precision();
       out.precision(10);
       for (Int_t i = 0; i < fNpoints; i++) {
-         out << "   graph->SetPoint(" << i << "," << fX[i] << "," << fY[i] << ");" << endl;
+         out << "   graph->SetPoint(" << i << "," << fX[i] << "," << fY[i] << ");" << std::endl;
       }
       out.precision(prec);
    }
@@ -2100,8 +2100,8 @@ void TGraph::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       hname += frameNumber;
       fHistogram->SetName(Form("Graph_%s", hname.Data()));
       fHistogram->SavePrimitive(out, "nodraw");
-      out << "   graph->SetHistogram(" << fHistogram->GetName() << ");" << endl;
-      out << "   " << endl;
+      out << "   graph->SetHistogram(" << fHistogram->GetName() << ");" << std::endl;
+      out << "   " << std::endl;
    }
 
    // save list of functions
@@ -2110,25 +2110,25 @@ void TGraph::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    while ((obj = next())) {
       obj->SavePrimitive(out, "nodraw");
       if (obj->InheritsFrom("TPaveStats")) {
-         out << "   graph->GetListOfFunctions()->Add(ptstats);" << endl;
-         out << "   ptstats->SetParent(graph->GetListOfFunctions());" << endl;
+         out << "   graph->GetListOfFunctions()->Add(ptstats);" << std::endl;
+         out << "   ptstats->SetParent(graph->GetListOfFunctions());" << std::endl;
       } else {
-         out << "   graph->GetListOfFunctions()->Add(" << obj->GetName() << ");" << endl;
+         out << "   graph->GetListOfFunctions()->Add(" << obj->GetName() << ");" << std::endl;
       }
    }
 
    const char *l;
    l = strstr(option, "multigraph");
    if (l) {
-      out << "   multigraph->Add(graph," << quote << l + 10 << quote << ");" << endl;
+      out << "   multigraph->Add(graph," << quote << l + 10 << quote << ");" << std::endl;
       return;
    }
    l = strstr(option, "th2poly");
    if (l) {
-      out << "   " << l + 7 << "->AddBin(graph);" << endl;
+      out << "   " << l + 7 << "->AddBin(graph);" << std::endl;
       return;
    }
-   out << "   graph->Draw(" << quote << option << quote << ");" << endl;
+   out << "   graph->Draw(" << quote << option << quote << ");" << std::endl;
 }
 
 
diff --git a/hist/hist/src/TGraph2D.cxx b/hist/hist/src/TGraph2D.cxx
index a4f124ffdf2..37686355116 100644
--- a/hist/hist/src/TGraph2D.cxx
+++ b/hist/hist/src/TGraph2D.cxx
@@ -402,7 +402,7 @@ TGraph2D::TGraph2D(const char *filename, const char *format, Option_t *option)
    TString fname = filename;
    gSystem->ExpandPathName(fname);
 
-   ifstream infile(fname.Data());
+   std::ifstream infile(fname.Data());
    if (!infile.good()) {
       MakeZombie();
       Error("TGraph2D", "Cannot open file: %s, TGraph2D is Zombie", filename);
@@ -1362,24 +1362,24 @@ Int_t TGraph2D::RemovePoint(Int_t ipoint)
 
 
 //______________________________________________________________________________
-void TGraph2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGraph2D::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Saves primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out << "   " << endl;
+   out << "   " << std::endl;
    if (gROOT->ClassSaved(TGraph2D::Class())) {
       out << "   ";
    } else {
       out << "   TGraph2D *";
    }
 
-   out << "graph2d = new TGraph2D(" << fNpoints << ");" << endl;
-   out << "   graph2d->SetName(" << quote << GetName() << quote << ");" << endl;
-   out << "   graph2d->SetTitle(" << quote << GetTitle() << quote << ");" << endl;
+   out << "graph2d = new TGraph2D(" << fNpoints << ");" << std::endl;
+   out << "   graph2d->SetName(" << quote << GetName() << quote << ");" << std::endl;
+   out << "   graph2d->SetTitle(" << quote << GetTitle() << quote << ");" << std::endl;
 
    if (fDirectory == 0) {
-      out << "   " << GetName() << "->SetDirectory(0);" << endl;
+      out << "   " << GetName() << "->SetDirectory(0);" << std::endl;
    }
 
    SaveFillAttributes(out, "graph2d", 0, 1001);
@@ -1387,7 +1387,7 @@ void TGraph2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    SaveMarkerAttributes(out, "graph2d", 1, 1, 1);
 
    for (Int_t i = 0; i < fNpoints; i++) {
-      out << "   graph2d->SetPoint(" << i << "," << fX[i] << "," << fY[i] << "," << fZ[i] << ");" << endl;
+      out << "   graph2d->SetPoint(" << i << "," << fX[i] << "," << fY[i] << "," << fZ[i] << ");" << std::endl;
    }
 
    // save list of functions
@@ -1395,13 +1395,13 @@ void TGraph2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    TObject *obj;
    while ((obj = next())) {
       obj->SavePrimitive(out, "nodraw");
-      out << "   graph2d->GetListOfFunctions()->Add(" << obj->GetName() << ");" << endl;
+      out << "   graph2d->GetListOfFunctions()->Add(" << obj->GetName() << ");" << std::endl;
       if (obj->InheritsFrom("TPaveStats")) {
-         out << "   ptstats->SetParent(graph2d->GetListOfFunctions());" << endl;
+         out << "   ptstats->SetParent(graph2d->GetListOfFunctions());" << std::endl;
       }
    }
 
-   out << "   graph2d->Draw(" << quote << option << quote << ");" << endl;
+   out << "   graph2d->Draw(" << quote << option << quote << ");" << std::endl;
 }
 
 
diff --git a/hist/hist/src/TGraphAsymmErrors.cxx b/hist/hist/src/TGraphAsymmErrors.cxx
index a8ac7f37d0d..5627cf470fd 100644
--- a/hist/hist/src/TGraphAsymmErrors.cxx
+++ b/hist/hist/src/TGraphAsymmErrors.cxx
@@ -926,28 +926,28 @@ void TGraphAsymmErrors::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TGraphAsymmErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGraphAsymmErrors::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TGraphAsymmErrors::Class())) {
       out<<"   ";
    } else {
       out<<"   TGraphAsymmErrors *";
    }
-   out<<"grae = new TGraphAsymmErrors("<<fNpoints<<");"<<endl;
-   out<<"   grae->SetName("<<quote<<GetName()<<quote<<");"<<endl;
-   out<<"   grae->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<"grae = new TGraphAsymmErrors("<<fNpoints<<");"<<std::endl;
+   out<<"   grae->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
+   out<<"   grae->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"grae",0,1001);
    SaveLineAttributes(out,"grae",1,1,1);
    SaveMarkerAttributes(out,"grae",1,1,1);
 
    for (Int_t i=0;i<fNpoints;i++) {
-      out<<"   grae->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<endl;
-      out<<"   grae->SetPointError("<<i<<","<<fEXlow[i]<<","<<fEXhigh[i]<<","<<fEYlow[i]<<","<<fEYhigh[i]<<");"<<endl;
+      out<<"   grae->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<std::endl;
+      out<<"   grae->SetPointError("<<i<<","<<fEXlow[i]<<","<<fEXhigh[i]<<","<<fEYlow[i]<<","<<fEYhigh[i]<<");"<<std::endl;
    }
 
    static Int_t frameNumber = 0;
@@ -957,8 +957,8 @@ void TGraphAsymmErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       hname += frameNumber;
       fHistogram->SetName(Form("Graph_%s",hname.Data()));
       fHistogram->SavePrimitive(out,"nodraw");
-      out<<"   grae->SetHistogram("<<fHistogram->GetName()<<");"<<endl;
-      out<<"   "<<endl;
+      out<<"   grae->SetHistogram("<<fHistogram->GetName()<<");"<<std::endl;
+      out<<"   "<<std::endl;
    }
 
    // save list of functions
@@ -967,18 +967,18 @@ void TGraphAsymmErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    while ((obj=next())) {
       obj->SavePrimitive(out,"nodraw");
       if (obj->InheritsFrom("TPaveStats")) {
-         out<<"   grae->GetListOfFunctions()->Add(ptstats);"<<endl;
-         out<<"   ptstats->SetParent(grae->GetListOfFunctions());"<<endl;
+         out<<"   grae->GetListOfFunctions()->Add(ptstats);"<<std::endl;
+         out<<"   ptstats->SetParent(grae->GetListOfFunctions());"<<std::endl;
       } else {
-         out<<"   grae->GetListOfFunctions()->Add("<<obj->GetName()<<");"<<endl;
+         out<<"   grae->GetListOfFunctions()->Add("<<obj->GetName()<<");"<<std::endl;
       }
    }
 
    const char *l = strstr(option,"multigraph");
    if (l) {
-      out<<"   multigraph->Add(grae,"<<quote<<l+10<<quote<<");"<<endl;
+      out<<"   multigraph->Add(grae,"<<quote<<l+10<<quote<<");"<<std::endl;
    } else {
-      out<<"   grae->Draw("<<quote<<option<<quote<<");"<<endl;
+      out<<"   grae->Draw("<<quote<<option<<quote<<");"<<std::endl;
    }
 }
 
diff --git a/hist/hist/src/TGraphBentErrors.cxx b/hist/hist/src/TGraphBentErrors.cxx
index a19feff0adc..d03090dd9dc 100644
--- a/hist/hist/src/TGraphBentErrors.cxx
+++ b/hist/hist/src/TGraphBentErrors.cxx
@@ -467,32 +467,32 @@ void TGraphBentErrors::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TGraphBentErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGraphBentErrors::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TGraphBentErrors::Class())) {
       out<<"   ";
    } else {
       out<<"   TGraphBentErrors *";
    }
-   out<<"grbe = new TGraphBentErrors("<<fNpoints<<");"<<endl;
-   out<<"   grbe->SetName("<<quote<<GetName()<<quote<<");"<<endl;
-   out<<"   grbe->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<"grbe = new TGraphBentErrors("<<fNpoints<<");"<<std::endl;
+   out<<"   grbe->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
+   out<<"   grbe->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"grbe",0,1001);
    SaveLineAttributes(out,"grbe",1,1,1);
    SaveMarkerAttributes(out,"grbe",1,1,1);
 
    for (Int_t i=0;i<fNpoints;i++) {
-      out<<"   grbe->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<endl;
+      out<<"   grbe->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<std::endl;
       out<<"   grbe->SetPointError("<<i<<","<<fEXlow[i]<<","<<fEXhigh[i]
                                        <<","<<fEYlow[i]<<","<<fEYhigh[i]
                                        <<","<<fEXlowd[i]<<","<<fEXhighd[i]
                                        <<","<<fEYlowd[i]<<","<<fEYhighd[i]
-                                       <<");"<<endl;
+                                       <<");"<<std::endl;
    }
 
    static Int_t frameNumber = 0;
@@ -502,8 +502,8 @@ void TGraphBentErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       hname += frameNumber;
       fHistogram->SetName(Form("Graph_%s",hname.Data()));
       fHistogram->SavePrimitive(out,"nodraw");
-      out<<"   grbe->SetHistogram("<<fHistogram->GetName()<<");"<<endl;
-      out<<"   "<<endl;
+      out<<"   grbe->SetHistogram("<<fHistogram->GetName()<<");"<<std::endl;
+      out<<"   "<<std::endl;
    }
 
    // save list of functions
@@ -511,17 +511,17 @@ void TGraphBentErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    TObject *obj;
    while ((obj=next())) {
       obj->SavePrimitive(out,"nodraw");
-      out<<"   grbe->GetListOfFunctions()->Add("<<obj->GetName()<<");"<<endl;
+      out<<"   grbe->GetListOfFunctions()->Add("<<obj->GetName()<<");"<<std::endl;
       if (obj->InheritsFrom("TPaveStats")) {
-         out<<"   ptstats->SetParent(grbe->GetListOfFunctions());"<<endl;
+         out<<"   ptstats->SetParent(grbe->GetListOfFunctions());"<<std::endl;
       }
    }
 
    const char *l = strstr(option,"multigraph");
    if (l) {
-      out<<"   multigraph->Add(grbe,"<<quote<<l+10<<quote<<");"<<endl;
+      out<<"   multigraph->Add(grbe,"<<quote<<l+10<<quote<<");"<<std::endl;
    } else {
-      out<<"   grbe->Draw("<<quote<<option<<quote<<");"<<endl;
+      out<<"   grbe->Draw("<<quote<<option<<quote<<");"<<std::endl;
    }
 }
 
diff --git a/hist/hist/src/TGraphErrors.cxx b/hist/hist/src/TGraphErrors.cxx
index b24af575019..525a081f745 100644
--- a/hist/hist/src/TGraphErrors.cxx
+++ b/hist/hist/src/TGraphErrors.cxx
@@ -245,7 +245,7 @@ TGraphErrors::TGraphErrors(const char *filename, const char *format, Option_t *o
    Double_t x, y, ex, ey;
    TString fname = filename;
    gSystem->ExpandPathName(fname);
-   ifstream infile(fname.Data());
+   std::ifstream infile(fname.Data());
    if (!infile.good()) {
       MakeZombie();
       Error("TGraphErrors", "Cannot open file: %s, TGraphErrors is Zombie", filename);
@@ -634,28 +634,28 @@ void TGraphErrors::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TGraphErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TGraphErrors::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out << "   " << endl;
+   out << "   " << std::endl;
    if (gROOT->ClassSaved(TGraphErrors::Class())) {
       out << "   ";
    } else {
       out << "   TGraphErrors *";
    }
-   out << "gre = new TGraphErrors(" << fNpoints << ");" << endl;
-   out << "   gre->SetName(" << quote << GetName() << quote << ");" << endl;
-   out << "   gre->SetTitle(" << quote << GetTitle() << quote << ");" << endl;
+   out << "gre = new TGraphErrors(" << fNpoints << ");" << std::endl;
+   out << "   gre->SetName(" << quote << GetName() << quote << ");" << std::endl;
+   out << "   gre->SetTitle(" << quote << GetTitle() << quote << ");" << std::endl;
 
    SaveFillAttributes(out, "gre", 0, 1001);
    SaveLineAttributes(out, "gre", 1, 1, 1);
    SaveMarkerAttributes(out, "gre", 1, 1, 1);
 
    for (Int_t i = 0; i < fNpoints; i++) {
-      out << "   gre->SetPoint(" << i << "," << fX[i] << "," << fY[i] << ");" << endl;
-      out << "   gre->SetPointError(" << i << "," << fEX[i] << "," << fEY[i] << ");" << endl;
+      out << "   gre->SetPoint(" << i << "," << fX[i] << "," << fY[i] << ");" << std::endl;
+      out << "   gre->SetPointError(" << i << "," << fEX[i] << "," << fEY[i] << ");" << std::endl;
    }
 
    static Int_t frameNumber = 0;
@@ -665,8 +665,8 @@ void TGraphErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       hname += frameNumber;
       fHistogram->SetName(Form("Graph_%s", hname.Data()));
       fHistogram->SavePrimitive(out, "nodraw");
-      out << "   gre->SetHistogram(" << fHistogram->GetName() << ");" << endl;
-      out << "   " << endl;
+      out << "   gre->SetHistogram(" << fHistogram->GetName() << ");" << std::endl;
+      out << "   " << std::endl;
    }
 
    // save list of functions
@@ -675,18 +675,18 @@ void TGraphErrors::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    while ((obj = next())) {
       obj->SavePrimitive(out, "nodraw");
       if (obj->InheritsFrom("TPaveStats")) {
-         out << "   gre->GetListOfFunctions()->Add(ptstats);" << endl;
-         out << "   ptstats->SetParent(gre->GetListOfFunctions());" << endl;
+         out << "   gre->GetListOfFunctions()->Add(ptstats);" << std::endl;
+         out << "   ptstats->SetParent(gre->GetListOfFunctions());" << std::endl;
       } else {
-         out << "   gre->GetListOfFunctions()->Add(" << obj->GetName() << ");" << endl;
+         out << "   gre->GetListOfFunctions()->Add(" << obj->GetName() << ");" << std::endl;
       }
    }
 
    const char *l = strstr(option, "multigraph");
    if (l) {
-      out << "   multigraph->Add(gre," << quote << l + 10 << quote << ");" << endl;
+      out << "   multigraph->Add(gre," << quote << l + 10 << quote << ");" << std::endl;
    } else {
-      out << "   gre->Draw(" << quote << option << quote << ");" << endl;
+      out << "   gre->Draw(" << quote << option << quote << ");" << std::endl;
    }
 }
 
diff --git a/hist/hist/src/TGraphSmooth.cxx b/hist/hist/src/TGraphSmooth.cxx
index e9ca437771c..ff443a96dbc 100644
--- a/hist/hist/src/TGraphSmooth.cxx
+++ b/hist/hist/src/TGraphSmooth.cxx
@@ -514,7 +514,7 @@ TGraph *TGraphSmooth::SmoothSuper(TGraph *grin, Option_t *,
 //                 ==================
 
    if (span < 0 || span > 1) {
-      cout << "Error: Span must be between 0 and 1" << endl;
+      std::cout << "Error: Span must be between 0 and 1" << std::endl;
       return 0;
    }
 
@@ -524,7 +524,7 @@ TGraph *TGraphSmooth::SmoothSuper(TGraph *grin, Option_t *,
    if (isPeriodic) {
       iper = 2;
       if (fMinX < 0 || fMaxX > 1) {
-         cout << "Error: x must be between 0 and 1 for periodic smooth" << endl;
+         std::cout << "Error: x must be between 0 and 1 for periodic smooth" << std::endl;
          return 0;
       }
    }
@@ -1051,7 +1051,7 @@ TGraph *TGraphSmooth::Approx(TGraph *grin, Option_t *option, Int_t nout, Double_
    else if (opt.Contains("constant")) iKind = 2;
 
    if (f < 0 || f > 1) {
-      cout << "Error: Invalid f value" << endl;
+      std::cout << "Error: Invalid f value" << std::endl;
       return 0;
    }
 
@@ -1067,7 +1067,7 @@ TGraph *TGraphSmooth::Approx(TGraph *grin, Option_t *option, Int_t nout, Double_
    } else if (opt.Contains("max")) {
       iTies = 3;
    } else {
-      cout << "Error: Method not known: " << ties << endl;
+      std::cout << "Error: Method not known: " << ties << std::endl;
       return 0;
    }
 
diff --git a/hist/hist/src/TH1.cxx b/hist/hist/src/TH1.cxx
index 929375440df..1d4ed7908a1 100644
--- a/hist/hist/src/TH1.cxx
+++ b/hist/hist/src/TH1.cxx
@@ -6562,7 +6562,7 @@ void TH1::Reset(Option_t *option)
 }
 
 //______________________________________________________________________________
-void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TH1::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -6587,7 +6587,7 @@ void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          if (i != 0) out << ", ";
          out << GetXaxis()->GetXbins()->fArray[i];
       }
-      out << "}; " << endl;
+      out << "}; " << std::endl;
    }
    // If the histogram is 2 or 3 dimensional, check if the histogram
    // has equidistant Y bins or not.  If not, we create an array
@@ -6603,7 +6603,7 @@ void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
             if (i != 0) out << ", ";
             out << GetYaxis()->GetXbins()->fArray[i];
          }
-         out << "}; " << endl;
+         out << "}; " << std::endl;
    }
    // IF the histogram is 3 dimensional, check if the histogram
    // has equidistant Z bins or not.  If not, we create an array
@@ -6619,11 +6619,11 @@ void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
             if (i != 0) out << ", ";
             out << GetZaxis()->GetXbins()->fArray[i];
          }
-         out << "}; " << endl;
+         out << "}; " << std::endl;
    }
 
    char quote = '"';
-   out <<"   "<<endl;
+   out <<"   "<<std::endl;
    out <<"   "<< ClassName() <<" *";
 
    // Histogram pointer has by default the histogram name.
@@ -6670,14 +6670,14 @@ void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          out << "," << GetZaxis()->GetXmin()
          << "," << GetZaxis()->GetXmax();
    }
-   out << ");" << endl;
+   out << ");" << std::endl;
 
    // save bin contents
    Int_t bin;
    for (bin=0;bin<fNcells;bin++) {
       Double_t bc = GetBinContent(bin);
       if (bc) {
-         out<<"   "<<hname<<"->SetBinContent("<<bin<<","<<bc<<");"<<endl;
+         out<<"   "<<hname<<"->SetBinContent("<<bin<<","<<bc<<");"<<std::endl;
       }
    }
 
@@ -6686,7 +6686,7 @@ void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       for (bin=0;bin<fNcells;bin++) {
          Double_t be = GetBinError(bin);
          if (be) {
-            out<<"   "<<hname<<"->SetBinError("<<bin<<","<<be<<");"<<endl;
+            out<<"   "<<hname<<"->SetBinError("<<bin<<","<<be<<");"<<std::endl;
          }
       }
    }
@@ -6695,44 +6695,44 @@ void TH1::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 }
 
 //______________________________________________________________________________
-void TH1::SavePrimitiveHelp(ostream &out, const char *hname, Option_t *option /*= ""*/)
+void TH1::SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option /*= ""*/)
 {
    // helper function for the SavePrimitive functions from TH1
    // or classes derived from TH1, eg TProfile, TProfile2D.
 
    char quote = '"';
    if (TMath::Abs(GetBarOffset()) > 1e-5) {
-      out<<"   "<<hname<<"->SetBarOffset("<<GetBarOffset()<<");"<<endl;
+      out<<"   "<<hname<<"->SetBarOffset("<<GetBarOffset()<<");"<<std::endl;
    }
    if (TMath::Abs(GetBarWidth()-1) > 1e-5) {
-      out<<"   "<<hname<<"->SetBarWidth("<<GetBarWidth()<<");"<<endl;
+      out<<"   "<<hname<<"->SetBarWidth("<<GetBarWidth()<<");"<<std::endl;
    }
    if (fMinimum != -1111) {
-      out<<"   "<<hname<<"->SetMinimum("<<fMinimum<<");"<<endl;
+      out<<"   "<<hname<<"->SetMinimum("<<fMinimum<<");"<<std::endl;
    }
    if (fMaximum != -1111) {
-      out<<"   "<<hname<<"->SetMaximum("<<fMaximum<<");"<<endl;
+      out<<"   "<<hname<<"->SetMaximum("<<fMaximum<<");"<<std::endl;
    }
    if (fNormFactor != 0) {
-      out<<"   "<<hname<<"->SetNormFactor("<<fNormFactor<<");"<<endl;
+      out<<"   "<<hname<<"->SetNormFactor("<<fNormFactor<<");"<<std::endl;
    }
    if (fEntries != 0) {
-      out<<"   "<<hname<<"->SetEntries("<<fEntries<<");"<<endl;
+      out<<"   "<<hname<<"->SetEntries("<<fEntries<<");"<<std::endl;
    }
    if (fDirectory == 0) {
-      out<<"   "<<hname<<"->SetDirectory(0);"<<endl;
+      out<<"   "<<hname<<"->SetDirectory(0);"<<std::endl;
    }
    if (TestBit(kNoStats)) {
-      out<<"   "<<hname<<"->SetStats(0);"<<endl;
+      out<<"   "<<hname<<"->SetStats(0);"<<std::endl;
    }
    if (fOption.Length() != 0) {
-      out<<"   "<<hname<<"->SetOption("<<quote<<fOption.Data()<<quote<<");"<<endl;
+      out<<"   "<<hname<<"->SetOption("<<quote<<fOption.Data()<<quote<<");"<<std::endl;
    }
 
    // save contour levels
    Int_t ncontours = GetContour();
    if (ncontours > 0) {
-      out<<"   "<<hname<<"->SetContour("<<ncontours<<");"<<endl;
+      out<<"   "<<hname<<"->SetContour("<<ncontours<<");"<<std::endl;
       Double_t zlevel;
       for (Int_t bin=0;bin<ncontours;bin++) {
          if (gPad->GetLogz()) {
@@ -6740,7 +6740,7 @@ void TH1::SavePrimitiveHelp(ostream &out, const char *hname, Option_t *option /*
          } else {
             zlevel = GetContourLevel(bin);
          }
-         out<<"   "<<hname<<"->SetContourLevel("<<bin<<","<<zlevel<<");"<<endl;
+         out<<"   "<<hname<<"->SetContourLevel("<<bin<<","<<zlevel<<");"<<std::endl;
       }
    }
 
@@ -6751,12 +6751,12 @@ void TH1::SavePrimitiveHelp(ostream &out, const char *hname, Option_t *option /*
       obj = lnk->GetObject();
       obj->SavePrimitive(out,"nodraw");
       if (obj->InheritsFrom(TF1::Class())) {
-         out<<"   "<<hname<<"->GetListOfFunctions()->Add("<<obj->GetName()<<");"<<endl;
+         out<<"   "<<hname<<"->GetListOfFunctions()->Add("<<obj->GetName()<<");"<<std::endl;
       } else if (obj->InheritsFrom("TPaveStats")) {
-         out<<"   "<<hname<<"->GetListOfFunctions()->Add(ptstats);"<<endl;
-         out<<"   ptstats->SetParent("<<hname<<");"<<endl;
+         out<<"   "<<hname<<"->GetListOfFunctions()->Add(ptstats);"<<std::endl;
+         out<<"   ptstats->SetParent("<<hname<<");"<<std::endl;
       } else {
-         out<<"   "<<hname<<"->GetListOfFunctions()->Add("<<obj->GetName()<<","<<quote<<lnk->GetOption()<<quote<<");"<<endl;
+         out<<"   "<<hname<<"->GetListOfFunctions()->Add("<<obj->GetName()<<","<<quote<<lnk->GetOption()<<quote<<");"<<std::endl;
       }
       lnk = (TObjOptLink*)lnk->Next();
    }
@@ -6772,7 +6772,7 @@ void TH1::SavePrimitiveHelp(ostream &out, const char *hname, Option_t *option /*
    opt.ToLower();
    if (!opt.Contains("nodraw")) {
       out<<"   "<<hname<<"->Draw("
-         <<quote<<option<<quote<<");"<<endl;
+         <<quote<<option<<quote<<");"<<std::endl;
    }
 }
 
diff --git a/hist/hist/src/TH1K.cxx b/hist/hist/src/TH1K.cxx
index 816d146438c..aea4b6f7b37 100644
--- a/hist/hist/src/TH1K.cxx
+++ b/hist/hist/src/TH1K.cxx
@@ -150,7 +150,7 @@ void   TH1K::Reset(Option_t *option)
 
 
 //______________________________________________________________________________
-void TH1K::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TH1K::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
    // Note the following restrictions in the code generated:
@@ -159,7 +159,7 @@ void TH1K::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    //  - Contours not saved
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    out<<"   "<<"TH1 *";
 
    out<<GetName()<<" = new "<<ClassName()<<"("<<quote<<GetName()<<quote<<","<<quote<<GetTitle()<<quote
@@ -167,28 +167,28 @@ void TH1K::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
                  <<","<<GetXaxis()->GetXmin()
                  <<","<<GetXaxis()->GetXmax()
                  <<","<<fKOrd;
-   out <<");"<<endl;
+   out <<");"<<std::endl;
 
    if (fDirectory == 0) {
-      out<<"   "<<GetName()<<"->SetDirectory(0);"<<endl;
+      out<<"   "<<GetName()<<"->SetDirectory(0);"<<std::endl;
    }
    if (TestBit(kNoStats)) {
-      out<<"   "<<GetName()<<"->SetStats(0);"<<endl;
+      out<<"   "<<GetName()<<"->SetStats(0);"<<std::endl;
    }
    if (fOption.Length() != 0) {
-      out<<"   "<<GetName()<<"->SetOption("<<quote<<fOption.Data()<<quote<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetOption("<<quote<<fOption.Data()<<quote<<");"<<std::endl;
    }
 
    if (fNIn) {
-      out<<"   Float_t Arr[]={"<<endl;
+      out<<"   Float_t Arr[]={"<<std::endl;
       for (int i=0; i<fNIn; i++) {
          out<< fArray[i];
          if (i != fNIn-1) {out<< ",";} else { out<< "};";}
-         if (i%10 == 9)   {out<< endl;}
+         if (i%10 == 9)   {out<< std::endl;}
       }
-      out<< endl;
+      out<< std::endl;
       out<<"   for(int i=0;i<" << fNIn << ";i++)"<<GetName()<<"->Fill(Arr[i]);";
-      out<< endl;
+      out<< std::endl;
    }
    SaveFillAttributes(out,GetName(),0,1001);
    SaveLineAttributes(out,GetName(),1,1,1);
@@ -200,7 +200,7 @@ void TH1K::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    opt.ToLower();
    if (!opt.Contains("nodraw")) {
       out<<"   "<<GetName()<<"->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
    }
 }
 
diff --git a/hist/hist/src/TH2Poly.cxx b/hist/hist/src/TH2Poly.cxx
index b2fa854a897..42bf5b6696a 100644
--- a/hist/hist/src/TH2Poly.cxx
+++ b/hist/hist/src/TH2Poly.cxx
@@ -1134,11 +1134,11 @@ Bool_t TH2Poly::IsIntersectingPolygon(Int_t bn, Double_t *x, Double_t *y,
 
 
 //______________________________________________________________________________
-void TH2Poly::SavePrimitive(ostream &out, Option_t *option)
+void TH2Poly::SavePrimitive(std::ostream &out, Option_t *option)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
-   out <<"   "<<endl;
+   out <<"   "<<std::endl;
    out <<"   "<< ClassName() <<" *";
 
    //histogram pointer has by default the histogram name.
@@ -1158,7 +1158,7 @@ void TH2Poly::SavePrimitive(ostream &out, Option_t *option)
        << GetTitle() << "\", " << fCellX << ", " << fXaxis.GetXmin()
        << ", " << fXaxis.GetXmax()
        << ", " << fCellY << ", " << fYaxis.GetXmin() << ", "
-       << fYaxis.GetXmax() << ");" << endl;
+       << fYaxis.GetXmax() << ");" << std::endl;
 
    // Save Bins
    TIter       next(fBins);
@@ -1172,12 +1172,12 @@ void TH2Poly::SavePrimitive(ostream &out, Option_t *option)
    }
 
    // save bin contents
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    Int_t bin;
    for (bin=1;bin<=fNcells;bin++) {
       Double_t bc = GetBinContent(bin);
       if (bc) {
-         out<<"   "<<hname<<"->SetBinContent("<<bin<<","<<bc<<");"<<endl;
+         out<<"   "<<hname<<"->SetBinContent("<<bin<<","<<bc<<");"<<std::endl;
       }
    }
 
@@ -1186,7 +1186,7 @@ void TH2Poly::SavePrimitive(ostream &out, Option_t *option)
       for (bin=1;bin<=fNcells;bin++) {
          Double_t be = GetBinError(bin);
          if (be) {
-            out<<"   "<<hname<<"->SetBinError("<<bin<<","<<be<<");"<<endl;
+            out<<"   "<<hname<<"->SetBinError("<<bin<<","<<be<<");"<<std::endl;
          }
       }
    }
diff --git a/hist/hist/src/THStack.cxx b/hist/hist/src/THStack.cxx
index 57f89da160f..347e7a36be5 100644
--- a/hist/hist/src/THStack.cxx
+++ b/hist/hist/src/THStack.cxx
@@ -556,8 +556,8 @@ void THStack::ls(Option_t *option) const
    // List histograms in the stack
 
    TROOT::IndentLevel();
-   cout <<IsA()->GetName()
-      <<" Name= "<<GetName()<<" Title= "<<GetTitle()<<" Option="<<option<<endl;
+   std::cout <<IsA()->GetName()
+      <<" Name= "<<GetName()<<" Title= "<<GetTitle()<<" Option="<<option<<std::endl;
    TROOT::IncreaseDirLevel();
    if (fHists) fHists->ls(option);
    TROOT::DecreaseDirLevel();
@@ -841,26 +841,26 @@ void THStack::RecursiveRemove(TObject *obj)
 }
 
 //______________________________________________________________________________
-void THStack::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void THStack::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(THStack::Class())) {
       out<<"   ";
    } else {
       out<<"   THStack *";
    }
-   out<<GetName()<<" = new THStack();"<<endl;
-   out<<"   "<<GetName()<<"->SetName("<<quote<<GetName()<<quote<<");"<<endl;
-   out<<"   "<<GetName()<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<GetName()<<" = new THStack();"<<std::endl;
+   out<<"   "<<GetName()<<"->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
+   out<<"   "<<GetName()<<"->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
 
    if (fMinimum != -1111) {
-      out<<"   "<<GetName()<<"->SetMinimum("<<fMinimum<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetMinimum("<<fMinimum<<");"<<std::endl;
    }
    if (fMaximum != -1111) {
-      out<<"   "<<GetName()<<"->SetMaximum("<<fMaximum<<");"<<endl;
+      out<<"   "<<GetName()<<"->SetMaximum("<<fMaximum<<");"<<std::endl;
    }
 
    static Int_t frameNumber = 0;
@@ -871,8 +871,8 @@ void THStack::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       hname += frameNumber;
       fHistogram->SetName(hname.Data());
       fHistogram->SavePrimitive(out,"nodraw");
-      out<<"   "<<GetName()<<"->SetHistogram("<<fHistogram->GetName()<<");"<<endl;
-      out<<"   "<<endl;
+      out<<"   "<<GetName()<<"->SetHistogram("<<fHistogram->GetName()<<");"<<std::endl;
+      out<<"   "<<std::endl;
    }
 
    TH1 *h;
@@ -881,12 +881,12 @@ void THStack::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       while (lnk) {
          h = (TH1*)lnk->GetObject();
          h->SavePrimitive(out,"nodraw");
-         out<<"   "<<GetName()<<"->Add("<<h->GetName()<<","<<quote<<lnk->GetOption()<<quote<<");"<<endl;
+         out<<"   "<<GetName()<<"->Add("<<h->GetName()<<","<<quote<<lnk->GetOption()<<quote<<");"<<std::endl;
          lnk = (TObjOptLink*)lnk->Next();
       }
    }
    out<<"   "<<GetName()<<"->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/hist/hist/src/THnSparse.cxx b/hist/hist/src/THnSparse.cxx
index a71eafc518a..c133b16aaf7 100644
--- a/hist/hist/src/THnSparse.cxx
+++ b/hist/hist/src/THnSparse.cxx
@@ -529,9 +529,9 @@ void THnSparseArrayChunk::Sumw2()
 // be retrieved by THnSparse::GetBinContent(linidx, (Int_t*)coord).
 // After the call, coord will contain the bin coordinate of each axis for the bin
 // with linear index linidx. A possible call would be
-//   cout << hs.GetBinContent(0, coord);
-//   cout <<" is the content of bin [x = " << coord[0] "
-//        << " | y = " << coord[1] << "]" << endl;
+//   std::cout << hs.GetBinContent(0, coord);
+//   std::cout <<" is the content of bin [x = " << coord[0] "
+//        << " | y = " << coord[1] << "]" << std::endl;
 //
 // * Efficiency
 // TH1 and TH2 are generally faster than THnSparse for one and two dimensional
diff --git a/hist/hist/src/TLimit.cxx b/hist/hist/src/TLimit.cxx
index d3d60246dad..faa270146ed 100644
--- a/hist/hist/src/TLimit.cxx
+++ b/hist/hist/src/TLimit.cxx
@@ -94,12 +94,12 @@ TConfidenceLevel *TLimit::ComputeLimit(TLimitDataSource * data,
     TH1* dh=(TH1*)infile->Get("data");
     TLimitDataSource* mydatasource = new TLimitDataSource(sh,bh,dh);
     TConfidenceLevel *myconfidence = TLimit::ComputeLimit(mydatasource,50000);
-    cout &lt&lt "  CLs    : " &lt&lt myconfidence->CLs()  &lt&lt endl;
-    cout &lt&lt "  CLsb   : " &lt&lt myconfidence->CLsb() &lt&lt endl;
-    cout &lt&lt "  CLb    : " &lt&lt myconfidence->CLb()  &lt&lt endl;
-    cout &lt&lt "&lt CLs &gt  : " &lt&lt myconfidence->GetExpectedCLs_b()  &lt&lt endl;
-    cout &lt&lt "&lt CLsb &gt : " &lt&lt myconfidence->GetExpectedCLsb_b() &lt&lt endl;
-    cout &lt&lt "&lt CLb &gt  : " &lt&lt myconfidence->GetExpectedCLb_b()  &lt&lt endl;
+    std::cout &lt&lt "  CLs    : " &lt&lt myconfidence->CLs()  &lt&lt std::endl;
+    std::cout &lt&lt "  CLsb   : " &lt&lt myconfidence->CLsb() &lt&lt std::endl;
+    std::cout &lt&lt "  CLb    : " &lt&lt myconfidence->CLb()  &lt&lt std::endl;
+    std::cout &lt&lt "&lt CLs &gt  : " &lt&lt myconfidence->GetExpectedCLs_b()  &lt&lt std::endl;
+    std::cout &lt&lt "&lt CLsb &gt : " &lt&lt myconfidence->GetExpectedCLsb_b() &lt&lt std::endl;
+    std::cout &lt&lt "&lt CLb &gt  : " &lt&lt myconfidence->GetExpectedCLb_b()  &lt&lt std::endl;
     delete myconfidence;
     delete mydatasource;
     infile->Close();
@@ -142,9 +142,9 @@ TConfidenceLevel *TLimit::ComputeLimit(TLimitDataSource * data,
          Double_t d = (Double_t) ((TH1 *) (data->GetCandidates()->At(channel)))->GetBinContent(bin);
          // Compute the value of the "-2lnQ" for the actual data
          if ((b == 0) && (s > 0)) {
-            cout << "WARNING: Ignoring bin " << bin << " of channel "
-                 << channel << " which has s=" << s << " but b=" << b << endl;
-            cout << "         Maybe the MC statistic has to be improved..." << endl;
+            std::cout << "WARNING: Ignoring bin " << bin << " of channel "
+                 << channel << " which has s=" << s << " but b=" << b << std::endl;
+            std::cout << "         Maybe the MC statistic has to be improved..." << std::endl;
          }
          if ((s > 0) && (b > 0))
             buffer += LogLikelihood(s, b, b, d);
diff --git a/hist/hist/src/TMultiDimFit.cxx b/hist/hist/src/TMultiDimFit.cxx
index 9999a208de9..15931da7cc6 100644
--- a/hist/hist/src/TMultiDimFit.cxx
+++ b/hist/hist/src/TMultiDimFit.cxx
@@ -2245,7 +2245,7 @@ Double_t TMultiDimFit::EvalError(const Double_t *x, const Double_t* coeff) const
    Int_t    i, j;
 
    for (i = 0; i < fNCoefficients; i++) {
-     //     cout << "Error coef " << i << " -> " << fCoefficientsRMS(i) << endl;
+     //     std::cout << "Error coef " << i << " -> " << fCoefficientsRMS(i) << std::endl;
    }
    for (i = 0; i < fNCoefficients; i++) {
       // Evaluate the ith term in the expansion
@@ -2256,11 +2256,11 @@ Double_t TMultiDimFit::EvalError(const Double_t *x, const Double_t* coeff) const
          Double_t y  =  1 + 2. / (fMaxVariables(j) - fMinVariables(j))
             * (x[j] - fMaxVariables(j));
          term        *= EvalFactor(p,y);
-	 //	 cout << "i,j " << i << ", " << j << "  "  << p << "  " << y << "  " << EvalFactor(p,y) << "  " << term << endl;
+	 //	 std::cout << "i,j " << i << ", " << j << "  "  << p << "  " << y << "  " << EvalFactor(p,y) << "  " << term << std::endl;
       }
       // Add this term to the final result
       returnValue += term*term;
-      //      cout << " i = " << i << " value = " << returnValue << endl;
+      //      std::cout << " i = " << i << " value = " << returnValue << std::endl;
    }
    returnValue = sqrt(returnValue);
    return returnValue;
@@ -3193,8 +3193,8 @@ void TMultiDimFit::MakeParameterization()
 
       // Print a happy message
       if (fIsVerbose && studied == 1)
-         cout << "Coeff   SumSqRes    Contrib   Angle      QM   Func"
-         << "     Value        W^2  Powers" << endl;
+         std::cout << "Coeff   SumSqRes    Contrib   Angle      QM   Func"
+         << "     Value        W^2  Powers" << std::endl;
 
       // Make the Gram-Schmidt
       Double_t dResidur = MakeGramSchmidt(i);
@@ -3241,20 +3241,20 @@ void TMultiDimFit::MakeParameterization()
 
       // Print the statistics about this function
       if (fIsVerbose) {
-         cout << setw(5)  << fNCoefficients << " "
-            << setw(10) << setprecision(4) << squareResidual << " "
-            << setw(10) << setprecision(4) << dResidur << " "
-            << setw(7)  << setprecision(3) << fMaxAngle << " "
-            << setw(7)  << setprecision(3) << s << " "
-            << setw(5)  << i << " "
-            << setw(10) << setprecision(4)
+         std::cout << std::setw(5)  << fNCoefficients << " "
+            << std::setw(10) << std::setprecision(4) << squareResidual << " "
+            << std::setw(10) << std::setprecision(4) << dResidur << " "
+            << std::setw(7)  << std::setprecision(3) << fMaxAngle << " "
+            << std::setw(7)  << std::setprecision(3) << s << " "
+            << std::setw(5)  << i << " "
+            << std::setw(10) << std::setprecision(4)
             << fOrthCoefficients(fNCoefficients-1) << " "
-            << setw(10) << setprecision(4)
+            << std::setw(10) << std::setprecision(4)
             << fOrthFunctionNorms(fNCoefficients-1) << " "
-            << flush;
+            << std::flush;
          for (j = 0; j < fNVariables; j++)
-            cout << " " << fPowers[i * fNVariables + j] - 1 << flush;
-         cout << endl;
+            std::cout << " " << fPowers[i * fNVariables + j] - 1 << std::flush;
+         std::cout << std::endl;
       }
 
       if (fNCoefficients >= fMaxTerms /* && fIsVerbose */) {
@@ -3294,174 +3294,174 @@ void TMultiDimFit::MakeRealCode(const char *filename,
    const char *prefix   = (isMethod ? Form("%s::", classname) : "");
    const char *cv_qual  = (isMethod ? "" : "static ");
 
-   ofstream outFile(filename,ios::out|ios::trunc);
+   std::ofstream outFile(filename,std::ios::out|std::ios::trunc);
    if (!outFile) {
       Error("MakeRealCode","couldn't open output file '%s'",filename);
       return;
    }
 
    if (fIsVerbose)
-      cout << "Writing on file \"" << filename << "\" ... " << flush;
+      std::cout << "Writing on file \"" << filename << "\" ... " << std::flush;
    //
    // Write header of file
    //
    // Emacs mode line ;-)
-   outFile << "// -*- mode: c++ -*-" << endl;
+   outFile << "// -*- mode: c++ -*-" << std::endl;
    // Info about creator
-   outFile << "// " << endl
+   outFile << "// " << std::endl
       << "// File " << filename
-      << " generated by TMultiDimFit::MakeRealCode" << endl;
+      << " generated by TMultiDimFit::MakeRealCode" << std::endl;
    // Time stamp
    TDatime date;
-   outFile << "// on " << date.AsString() << endl;
+   outFile << "// on " << date.AsString() << std::endl;
    // ROOT version info
    outFile << "// ROOT version " << gROOT->GetVersion()
-      << endl << "//" << endl;
+      << std::endl << "//" << std::endl;
    // General information on the code
-   outFile << "// This file contains the function " << endl
-      << "//" << endl
-      << "//    double  " << prefix << "MDF(double *x); " << endl
-      << "//" << endl
-      << "// For evaluating the parameterization obtained" << endl
-      << "// from TMultiDimFit and the point x" << endl
-      << "// " << endl
+   outFile << "// This file contains the function " << std::endl
+      << "//" << std::endl
+      << "//    double  " << prefix << "MDF(double *x); " << std::endl
+      << "//" << std::endl
+      << "// For evaluating the parameterization obtained" << std::endl
+      << "// from TMultiDimFit and the point x" << std::endl
+      << "// " << std::endl
       << "// See TMultiDimFit class documentation for more "
-      << "information " << endl << "// " << endl;
+      << "information " << std::endl << "// " << std::endl;
    // Header files
    if (isMethod)
       // If these are methods, we need the class header
-      outFile << "#include \"" << classname << ".h\"" << endl;
+      outFile << "#include \"" << classname << ".h\"" << std::endl;
 
    //
    // Now for the data
    //
-   outFile << "//" << endl
-      << "// Static data variables"  << endl
-      << "//" << endl;
+   outFile << "//" << std::endl
+      << "// Static data variables"  << std::endl
+      << "//" << std::endl;
    outFile << cv_qual << "int    " << prefix << "gNVariables    = "
-      << fNVariables << ";" << endl;
+      << fNVariables << ";" << std::endl;
    outFile << cv_qual << "int    " << prefix << "gNCoefficients = "
-      << fNCoefficients << ";" << endl;
+      << fNCoefficients << ";" << std::endl;
    outFile << cv_qual << "double " << prefix << "gDMean         = "
-      << fMeanQuantity << ";" << endl;
+      << fMeanQuantity << ";" << std::endl;
 
    // Assignment to mean vector.
-   outFile << "// Assignment to mean vector." << endl;
+   outFile << "// Assignment to mean vector." << std::endl;
    outFile << cv_qual << "double " << prefix
-      << "gXMean[] = {" << endl;
+      << "gXMean[] = {" << std::endl;
    for (i = 0; i < fNVariables; i++)
-      outFile << (i != 0 ? ", " : "  ") << fMeanVariables(i) << flush;
-   outFile << " };" << endl << endl;
+      outFile << (i != 0 ? ", " : "  ") << fMeanVariables(i) << std::flush;
+   outFile << " };" << std::endl << std::endl;
 
    // Assignment to minimum vector.
-   outFile << "// Assignment to minimum vector." << endl;
+   outFile << "// Assignment to minimum vector." << std::endl;
    outFile << cv_qual << "double " << prefix
-      << "gXMin[] = {" << endl;
+      << "gXMin[] = {" << std::endl;
    for (i = 0; i < fNVariables; i++)
-      outFile << (i != 0 ? ", " : "  ") << fMinVariables(i) << flush;
-   outFile << " };" << endl << endl;
+      outFile << (i != 0 ? ", " : "  ") << fMinVariables(i) << std::flush;
+   outFile << " };" << std::endl << std::endl;
 
    // Assignment to maximum vector.
-   outFile << "// Assignment to maximum vector." << endl;
+   outFile << "// Assignment to maximum vector." << std::endl;
    outFile << cv_qual << "double " << prefix
-      << "gXMax[] = {" << endl;
+      << "gXMax[] = {" << std::endl;
    for (i = 0; i < fNVariables; i++)
-      outFile << (i != 0 ? ", " : "  ") << fMaxVariables(i) << flush;
-   outFile << " };" << endl << endl;
+      outFile << (i != 0 ? ", " : "  ") << fMaxVariables(i) << std::flush;
+   outFile << " };" << std::endl << std::endl;
 
    // Assignment to coefficients vector.
-   outFile << "// Assignment to coefficients vector." << endl;
+   outFile << "// Assignment to coefficients vector." << std::endl;
    outFile << cv_qual << "double " << prefix
-      << "gCoefficient[] = {" << flush;
+      << "gCoefficient[] = {" << std::flush;
    for (i = 0; i < fNCoefficients; i++)
-      outFile << (i != 0 ? "," : "") << endl
-      << "  " << fCoefficients(i) << flush;
-   outFile << endl << " };" << endl << endl;
+      outFile << (i != 0 ? "," : "") << std::endl
+      << "  " << fCoefficients(i) << std::flush;
+   outFile << std::endl << " };" << std::endl << std::endl;
 
    // Assignment to error coefficients vector.
-   outFile << "// Assignment to error coefficients vector." << endl;
+   outFile << "// Assignment to error coefficients vector." << std::endl;
    outFile << cv_qual << "double " << prefix
-      << "gCoefficientRMS[] = {" << flush;
+      << "gCoefficientRMS[] = {" << std::flush;
    for (i = 0; i < fNCoefficients; i++)
-      outFile << (i != 0 ? "," : "") << endl
-      << "  " << fCoefficientsRMS(i) << flush;
-   outFile << endl << " };" << endl << endl;
+      outFile << (i != 0 ? "," : "") << std::endl
+      << "  " << fCoefficientsRMS(i) << std::flush;
+   outFile << std::endl << " };" << std::endl << std::endl;
 
    // Assignment to powers vector.
-   outFile << "// Assignment to powers vector." << endl
-      << "// The powers are stored row-wise, that is" << endl
+   outFile << "// Assignment to powers vector." << std::endl
+      << "// The powers are stored row-wise, that is" << std::endl
       << "//  p_ij = " << prefix
-      << "gPower[i * NVariables + j];" << endl;
+      << "gPower[i * NVariables + j];" << std::endl;
    outFile << cv_qual << "int    " << prefix
-      << "gPower[] = {" << flush;
+      << "gPower[] = {" << std::flush;
    for (i = 0; i < fNCoefficients; i++) {
       for (j = 0; j < fNVariables; j++) {
-         if (j != 0) outFile << flush << "  ";
-         else        outFile << endl << "  ";
+         if (j != 0) outFile << std::flush << "  ";
+         else        outFile << std::endl << "  ";
          outFile << fPowers[fPowerIndex[i] * fNVariables + j]
          << (i == fNCoefficients - 1 && j == fNVariables - 1 ? "" : ",")
-            << flush;
+            << std::flush;
       }
    }
-   outFile << endl << "};" << endl << endl;
+   outFile << std::endl << "};" << std::endl << std::endl;
 
 
    //
    // Finally we reach the function itself
    //
-   outFile << "// " << endl
+   outFile << "// " << std::endl
       << "// The "
       << (isMethod ? "method " : "function ")
       << "  double " << prefix
       << "MDF(double *x)"
-      << endl << "// " << endl;
+      << std::endl << "// " << std::endl;
    outFile << "double " << prefix
-      << "MDF(double *x) {" << endl
-      << "  double returnValue = " << prefix << "gDMean;" << endl
-      << "  int    i = 0, j = 0, k = 0;" << endl
+      << "MDF(double *x) {" << std::endl
+      << "  double returnValue = " << prefix << "gDMean;" << std::endl
+      << "  int    i = 0, j = 0, k = 0;" << std::endl
       << "  for (i = 0; i < " << prefix << "gNCoefficients ; i++) {"
-      << endl
-      << "    // Evaluate the ith term in the expansion" << endl
+      << std::endl
+      << "    // Evaluate the ith term in the expansion" << std::endl
       << "    double term = " << prefix << "gCoefficient[i];"
-      << endl
+      << std::endl
       << "    for (j = 0; j < " << prefix << "gNVariables; j++) {"
-      << endl
-      << "      // Evaluate the polynomial in the jth variable." << endl
+      << std::endl
+      << "      // Evaluate the polynomial in the jth variable." << std::endl
       << "      int power = "<< prefix << "gPower["
-      << prefix << "gNVariables * i + j]; " << endl
-      << "      double p1 = 1, p2 = 0, p3 = 0, r = 0;" << endl
+      << prefix << "gNVariables * i + j]; " << std::endl
+      << "      double p1 = 1, p2 = 0, p3 = 0, r = 0;" << std::endl
       << "      double v =  1 + 2. / ("
       << prefix << "gXMax[j] - " << prefix
-      << "gXMin[j]) * (x[j] - " << prefix << "gXMax[j]);" << endl
-      << "      // what is the power to use!" << endl
-      << "      switch(power) {" << endl
-      << "      case 1: r = 1; break; " << endl
-      << "      case 2: r = v; break; " << endl
-      << "      default: " << endl
-      << "        p2 = v; " << endl
-      << "        for (k = 3; k <= power; k++) { " << endl
-      << "          p3 = p2 * v;" << endl;
+      << "gXMin[j]) * (x[j] - " << prefix << "gXMax[j]);" << std::endl
+      << "      // what is the power to use!" << std::endl
+      << "      switch(power) {" << std::endl
+      << "      case 1: r = 1; break; " << std::endl
+      << "      case 2: r = v; break; " << std::endl
+      << "      default: " << std::endl
+      << "        p2 = v; " << std::endl
+      << "        for (k = 3; k <= power; k++) { " << std::endl
+      << "          p3 = p2 * v;" << std::endl;
    if (fPolyType == kLegendre)
       outFile << "          p3 = ((2 * i - 3) * p2 * v - (i - 2) * p1)"
-      << " / (i - 1);" << endl;
+      << " / (i - 1);" << std::endl;
    if (fPolyType == kChebyshev)
-      outFile << "          p3 = 2 * v * p2 - p1; " << endl;
-   outFile << "          p1 = p2; p2 = p3; " << endl << "        }" << endl
-      << "        r = p3;" << endl << "      }" << endl
-      << "      // multiply this term by the poly in the jth var" << endl
-      << "      term *= r; " << endl << "    }" << endl
-      << "    // Add this term to the final result" << endl
-      << "    returnValue += term;" << endl << "  }" << endl
-      << "  return returnValue;" << endl << "}" << endl << endl;
+      outFile << "          p3 = 2 * v * p2 - p1; " << std::endl;
+   outFile << "          p1 = p2; p2 = p3; " << std::endl << "        }" << std::endl
+      << "        r = p3;" << std::endl << "      }" << std::endl
+      << "      // multiply this term by the poly in the jth var" << std::endl
+      << "      term *= r; " << std::endl << "    }" << std::endl
+      << "    // Add this term to the final result" << std::endl
+      << "    returnValue += term;" << std::endl << "  }" << std::endl
+      << "  return returnValue;" << std::endl << "}" << std::endl << std::endl;
 
    // EOF
-   outFile << "// EOF for " << filename << endl;
+   outFile << "// EOF for " << filename << std::endl;
 
    // Close the file
    outFile.close();
 
    if (fIsVerbose)
-      cout << "done" << endl;
+      std::cout << "done" << std::endl;
 }
 
 
@@ -3486,188 +3486,188 @@ void TMultiDimFit::Print(Option_t *option) const
 
    if (opt.Contains("p")) {
       // Print basic parameters for this object
-      cout << "User parameters:" << endl
-         << "----------------" << endl
-         << " Variables:                    " << fNVariables << endl
-         << " Data points:                  " << fSampleSize << endl
-         << " Max Terms:                    " << fMaxTerms << endl
-         << " Power Limit Parameter:        " << fPowerLimit << endl
-         << " Max functions:                " << fMaxFunctions << endl
-         << " Max functions to study:       " << fMaxStudy << endl
-         << " Max angle (optional):         " << fMaxAngle << endl
-         << " Min angle:                    " << fMinAngle << endl
-         << " Relative Error accepted:      " << fMinRelativeError << endl
-         << " Maximum Powers:               " << flush;
+      std::cout << "User parameters:" << std::endl
+         << "----------------" << std::endl
+         << " Variables:                    " << fNVariables << std::endl
+         << " Data points:                  " << fSampleSize << std::endl
+         << " Max Terms:                    " << fMaxTerms << std::endl
+         << " Power Limit Parameter:        " << fPowerLimit << std::endl
+         << " Max functions:                " << fMaxFunctions << std::endl
+         << " Max functions to study:       " << fMaxStudy << std::endl
+         << " Max angle (optional):         " << fMaxAngle << std::endl
+         << " Min angle:                    " << fMinAngle << std::endl
+         << " Relative Error accepted:      " << fMinRelativeError << std::endl
+         << " Maximum Powers:               " << std::flush;
       for (i = 0; i < fNVariables; i++)
-         cout << " " << fMaxPowers[i] - 1 << flush;
-      cout << endl << endl
-         << " Parameterisation will be done using " << flush;
+         std::cout << " " << fMaxPowers[i] - 1 << std::flush;
+      std::cout << std::endl << std::endl
+         << " Parameterisation will be done using " << std::flush;
       if (fPolyType == kChebyshev)
-         cout << "Chebyshev polynomials" << endl;
+         std::cout << "Chebyshev polynomials" << std::endl;
       else if (fPolyType == kLegendre)
-         cout << "Legendre polynomials" << endl;
+         std::cout << "Legendre polynomials" << std::endl;
       else
-         cout << "Monomials" << endl;
-      cout << endl;
+         std::cout << "Monomials" << std::endl;
+      std::cout << std::endl;
    }
 
    if (opt.Contains("s")) {
       // Print statistics for read data
-      cout << "Sample statistics:" << endl
-         << "------------------" << endl
-         << "                 D"  << flush;
+      std::cout << "Sample statistics:" << std::endl
+         << "------------------" << std::endl
+         << "                 D"  << std::flush;
       for (i = 0; i < fNVariables; i++)
-         cout << " " << setw(10) << i+1 << flush;
-      cout << endl << " Max:   " << setw(10) << setprecision(7)
-         << fMaxQuantity << flush;
+         std::cout << " " << std::setw(10) << i+1 << std::flush;
+      std::cout << std::endl << " Max:   " << std::setw(10) << std::setprecision(7)
+         << fMaxQuantity << std::flush;
       for (i = 0; i < fNVariables; i++)
-         cout << " " << setw(10) << setprecision(4)
-         << fMaxVariables(i) << flush;
-      cout << endl << " Min:   " << setw(10) << setprecision(7)
-         << fMinQuantity << flush;
+         std::cout << " " << std::setw(10) << std::setprecision(4)
+         << fMaxVariables(i) << std::flush;
+      std::cout << std::endl << " Min:   " << std::setw(10) << std::setprecision(7)
+         << fMinQuantity << std::flush;
       for (i = 0; i < fNVariables; i++)
-         cout << " " << setw(10) << setprecision(4)
-         << fMinVariables(i) << flush;
-      cout << endl << " Mean:  " << setw(10) << setprecision(7)
-         << fMeanQuantity << flush;
+         std::cout << " " << std::setw(10) << std::setprecision(4)
+         << fMinVariables(i) << std::flush;
+      std::cout << std::endl << " Mean:  " << std::setw(10) << std::setprecision(7)
+         << fMeanQuantity << std::flush;
       for (i = 0; i < fNVariables; i++)
-         cout << " " << setw(10) << setprecision(4)
-         << fMeanVariables(i) << flush;
-      cout << endl << " Function Sum Squares:         " << fSumSqQuantity
-         << endl << endl;
+         std::cout << " " << std::setw(10) << std::setprecision(4)
+         << fMeanVariables(i) << std::flush;
+      std::cout << std::endl << " Function Sum Squares:         " << fSumSqQuantity
+         << std::endl << std::endl;
    }
 
    if (opt.Contains("r")) {
-      cout << "Results of Parameterisation:" << endl
-         << "----------------------------" << endl
+      std::cout << "Results of Parameterisation:" << std::endl
+         << "----------------------------" << std::endl
          << " Total reduction of square residuals    "
-         << fSumSqResidual << endl
+         << fSumSqResidual << std::endl
          << " Relative precision obtained:           "
-         << fPrecision   << endl
+         << fPrecision   << std::endl
          << " Error obtained:                        "
-         << fError << endl
+         << fError << std::endl
          << " Multiple correlation coefficient:      "
-         << fCorrelationCoeff   << endl
+         << fCorrelationCoeff   << std::endl
          << " Reduced Chi square over sample:        "
-         << fChi2 / (fSampleSize - fNCoefficients) << endl
+         << fChi2 / (fSampleSize - fNCoefficients) << std::endl
          << " Maximum residual value:                "
-         << fMaxResidual << endl
+         << fMaxResidual << std::endl
          << " Minimum residual value:                "
-         << fMinResidual << endl
+         << fMinResidual << std::endl
          << " Estimated root mean square:            "
-         << fRMS << endl
-         << " Maximum powers used:                   " << flush;
+         << fRMS << std::endl
+         << " Maximum powers used:                   " << std::flush;
       for (j = 0; j < fNVariables; j++)
-         cout << fMaxPowersFinal[j] << " " << flush;
-      cout << endl
-         << " Function codes of candidate functions." << endl
+         std::cout << fMaxPowersFinal[j] << " " << std::flush;
+      std::cout << std::endl
+         << " Function codes of candidate functions." << std::endl
          << "  1: considered,"
          << "  2: too little contribution,"
-         << "  3: accepted." << flush;
+         << "  3: accepted." << std::flush;
       for (i = 0; i < fMaxFunctions; i++) {
          if (i % 60 == 0)
-            cout << endl << " " << flush;
+            std::cout << std::endl << " " << std::flush;
          else if (i % 10 == 0)
-            cout << " " << flush;
-         cout << fFunctionCodes[i];
+            std::cout << " " << std::flush;
+         std::cout << fFunctionCodes[i];
       }
-      cout << endl << " Loop over candidates stopped because " << flush;
+      std::cout << std::endl << " Loop over candidates stopped because " << std::flush;
       switch(fParameterisationCode){
          case PARAM_MAXSTUDY:
-            cout << "max allowed studies reached" << endl; break;
+            std::cout << "max allowed studies reached" << std::endl; break;
          case PARAM_SEVERAL:
-            cout << "all candidates considered several times" << endl; break;
+            std::cout << "all candidates considered several times" << std::endl; break;
          case PARAM_RELERR:
-            cout << "wanted relative error obtained" << endl; break;
+            std::cout << "wanted relative error obtained" << std::endl; break;
          case PARAM_MAXTERMS:
-            cout << "max number of terms reached" << endl; break;
+            std::cout << "max number of terms reached" << std::endl; break;
          default:
-            cout << "some unknown reason" << endl;
+            std::cout << "some unknown reason" << std::endl;
             break;
       }
-      cout << endl;
+      std::cout << std::endl;
    }
 
    if (opt.Contains("f")) {
-      cout << "Results of Fit:" << endl
-         << "---------------" << endl
+      std::cout << "Results of Fit:" << std::endl
+         << "---------------" << std::endl
          << " Test sample size:                      "
-         << fTestSampleSize << endl
+         << fTestSampleSize << std::endl
          << " Multiple correlation coefficient:      "
-         << fTestCorrelationCoeff << endl
+         << fTestCorrelationCoeff << std::endl
          << " Relative precision obtained:           "
-         << fTestPrecision   << endl
+         << fTestPrecision   << std::endl
          << " Error obtained:                        "
-         << fTestError << endl
+         << fTestError << std::endl
          << " Reduced Chi square over sample:        "
-         << fChi2 / (fSampleSize - fNCoefficients) << endl
-         << endl;
+         << fChi2 / (fSampleSize - fNCoefficients) << std::endl
+         << std::endl;
       if (fFitter) {
          fFitter->PrintResults(1,1);
-         cout << endl;
+         std::cout << std::endl;
       }
    }
 
    if (opt.Contains("c")){
-      cout << "Coefficients:" << endl
-         << "-------------" << endl
-         << "   #         Value        Error   Powers" << endl
-         << " ---------------------------------------" << endl;
+      std::cout << "Coefficients:" << std::endl
+         << "-------------" << std::endl
+         << "   #         Value        Error   Powers" << std::endl
+         << " ---------------------------------------" << std::endl;
       for (i = 0; i < fNCoefficients; i++) {
-         cout << " " << setw(3) << i << "  "
-            << setw(12) << fCoefficients(i) << "  "
-            << setw(12) << fCoefficientsRMS(i) << "  " << flush;
+         std::cout << " " << std::setw(3) << i << "  "
+            << std::setw(12) << fCoefficients(i) << "  "
+            << std::setw(12) << fCoefficientsRMS(i) << "  " << std::flush;
          for (j = 0; j < fNVariables; j++)
-            cout << " " << setw(3)
-            << fPowers[fPowerIndex[i] * fNVariables + j] - 1 << flush;
-         cout << endl;
+            std::cout << " " << std::setw(3)
+            << fPowers[fPowerIndex[i] * fNVariables + j] - 1 << std::flush;
+         std::cout << std::endl;
       }
-      cout << endl;
+      std::cout << std::endl;
    }
    if (opt.Contains("k") && fCorrelationMatrix.IsValid()) {
-      cout << "Correlation Matrix:" << endl
+      std::cout << "Correlation Matrix:" << std::endl
          << "-------------------";
       fCorrelationMatrix.Print();
    }
 
    if (opt.Contains("m")) {
-      cout << "Parameterization:" << endl
-         << "-----------------" << endl
-         << "  Normalised variables: " << endl;
+      std::cout << "Parameterization:" << std::endl
+         << "-----------------" << std::endl
+         << "  Normalised variables: " << std::endl;
       for (i = 0; i < fNVariables; i++) 
-         cout << "\ty_" << i << "\t= 1 + 2 * (x_" << i << " - " 
+         std::cout << "\ty_" << i << "\t= 1 + 2 * (x_" << i << " - " 
          << fMaxVariables(i) << ") / (" 
          << fMaxVariables(i) << " - " << fMinVariables(i) << ")" 
-         << endl;
-      cout << endl
+         << std::endl;
+      std::cout << std::endl
          << "  f(";
       for (i = 0; i < fNVariables; i++) {
-         cout << "y_" << i;
-         if (i != fNVariables-1) cout << ", ";
+         std::cout << "y_" << i;
+         if (i != fNVariables-1) std::cout << ", ";
       }
-      cout << ") = ";
+      std::cout << ") = ";
       for (i = 0; i < fNCoefficients; i++) {
          if (i != 0)
-            cout << endl << "\t" << (fCoefficients(i) < 0 ? "- " : "+ ") 
+            std::cout << std::endl << "\t" << (fCoefficients(i) < 0 ? "- " : "+ ") 
             << TMath::Abs(fCoefficients(i));
          else 
-            cout << fCoefficients(i);
+            std::cout << fCoefficients(i);
          for (j = 0; j < fNVariables; j++) {
             Int_t p = fPowers[fPowerIndex[i] * fNVariables + j];
             switch (p) { 
                case 1: break;
-               case 2: cout << " * y_" << j; break;
+               case 2: std::cout << " * y_" << j; break;
                default:
                   switch(fPolyType) {
-                     case kLegendre:  cout << " * L_" << p-1 << "(y_" << j << ")"; break;
-                     case kChebyshev: cout << " * C_" << p-1 << "(y_" << j << ")"; break;
-                     default:         cout << " * y_" << j << "^" << p-1; break;
+                     case kLegendre:  std::cout << " * L_" << p-1 << "(y_" << j << ")"; break;
+                     case kChebyshev: std::cout << " * C_" << p-1 << "(y_" << j << ")"; break;
+                     default:         std::cout << " * y_" << j << "^" << p-1; break;
                   }
             }
 
          }
       }
-      cout << endl;
+      std::cout << std::endl;
    }
 }
 
diff --git a/hist/hist/src/TMultiGraph.cxx b/hist/hist/src/TMultiGraph.cxx
index ddcee067703..a940ef3ed74 100644
--- a/hist/hist/src/TMultiGraph.cxx
+++ b/hist/hist/src/TMultiGraph.cxx
@@ -1283,20 +1283,20 @@ void TMultiGraph::RecursiveRemove(TObject *obj)
 
 
 //______________________________________________________________________________
-void TMultiGraph::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TMultiGraph::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TMultiGraph::Class())) {
       out<<"   ";
    } else {
       out<<"   TMultiGraph *";
    }
-   out<<"multigraph = new TMultiGraph();"<<endl;
-   out<<"   multigraph->SetName("<<quote<<GetName()<<quote<<");"<<endl;
-   out<<"   multigraph->SetTitle("<<quote<<GetTitle()<<quote<<");"<<endl;
+   out<<"multigraph = new TMultiGraph();"<<std::endl;
+   out<<"   multigraph->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
+   out<<"   multigraph->SetTitle("<<quote<<GetTitle()<<quote<<");"<<std::endl;
 
    if (fGraphs) {
       TObjOptLink *lnk = (TObjOptLink*)fGraphs->FirstLink();
@@ -1310,9 +1310,9 @@ void TMultiGraph::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
    const char *l = strstr(option,"th2poly");
    if (l) {
-      out<<"   "<<l+7<<"->AddBin(multigraph);"<<endl;
+      out<<"   "<<l+7<<"->AddBin(multigraph);"<<std::endl;
    } else {
-      out<<"   multigraph->Draw(" <<quote<<option<<quote<<");"<<endl;
+      out<<"   multigraph->Draw(" <<quote<<option<<quote<<");"<<std::endl;
    }
    TAxis *xaxis = GetXaxis();
    TAxis *yaxis = GetYaxis();
diff --git a/hist/hist/src/TPolyMarker.cxx b/hist/hist/src/TPolyMarker.cxx
index 5b1095f627b..d6829721807 100644
--- a/hist/hist/src/TPolyMarker.cxx
+++ b/hist/hist/src/TPolyMarker.cxx
@@ -321,27 +321,27 @@ void TPolyMarker::Print(Option_t *) const
 
 
 //______________________________________________________________________________
-void TPolyMarker::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TPolyMarker::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out.
 
    char quote = '"';
-   out<<"   "<<endl;
-   out<<"   Double_t *dum = 0;"<<endl;
+   out<<"   "<<std::endl;
+   out<<"   Double_t *dum = 0;"<<std::endl;
    if (gROOT->ClassSaved(TPolyMarker::Class())) {
       out<<"   ";
    } else {
       out<<"   TPolyMarker *";
    }
-   out<<"pmarker = new TPolyMarker("<<fN<<",dum,dum,"<<quote<<fOption<<quote<<");"<<endl;
+   out<<"pmarker = new TPolyMarker("<<fN<<",dum,dum,"<<quote<<fOption<<quote<<");"<<std::endl;
 
    SaveMarkerAttributes(out,"pmarker",1,1,1);
 
    for (Int_t i=0;i<Size();i++) {
-      out<<"   pmarker->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<endl;
+      out<<"   pmarker->SetPoint("<<i<<","<<fX[i]<<","<<fY[i]<<");"<<std::endl;
    }
    out<<"   pmarker->Draw("
-      <<quote<<option<<quote<<");"<<endl;
+      <<quote<<option<<quote<<");"<<std::endl;
 }
 
 
diff --git a/hist/hist/src/TPrincipal.cxx b/hist/hist/src/TPrincipal.cxx
index 72b400d674f..ac82ffc8cfc 100644
--- a/hist/hist/src/TPrincipal.cxx
+++ b/hist/hist/src/TPrincipal.cxx
@@ -1425,54 +1425,54 @@ void TPrincipal::MakeRealCode(const char *filename, const char *classname,
    const char *prefix   = (isMethod ? Form("%s::", classname) : "");
    const char *cv_qual  = (isMethod ? "" : "static ");
 
-   ofstream outFile(filename,ios::out|ios::trunc);
+   std::ofstream outFile(filename,std::ios::out|std::ios::trunc);
    if (!outFile) {
       Error("MakeRealCode","couldn't open output file '%s'",filename);
       return;
    }
 
-   cout << "Writing on file \"" << filename << "\" ... " << flush;
+   std::cout << "Writing on file \"" << filename << "\" ... " << std::flush;
    //
    // Write header of file
    //
    // Emacs mode line ;-)
-   outFile << "// -*- mode: c++ -*-" << endl;
+   outFile << "// -*- mode: c++ -*-" << std::endl;
    // Info about creator
-   outFile << "// " << endl
+   outFile << "// " << std::endl
       << "// File " << filename
-      << " generated by TPrincipal::MakeCode" << endl;
+      << " generated by TPrincipal::MakeCode" << std::endl;
    // Time stamp
    TDatime date;
-   outFile << "// on " << date.AsString() << endl;
+   outFile << "// on " << date.AsString() << std::endl;
    // ROOT version info
    outFile << "// ROOT version " << gROOT->GetVersion()
-      << endl << "//" << endl;
+      << std::endl << "//" << std::endl;
    // General information on the code
-   outFile << "// This file contains the functions " << endl
-      << "//" << endl
+   outFile << "// This file contains the functions " << std::endl
+      << "//" << std::endl
       << "//    void  " << prefix
-      << "X2P(Double_t *x, Double_t *p); " << endl
+      << "X2P(Double_t *x, Double_t *p); " << std::endl
       << "//    void  " << prefix
       << "P2X(Double_t *p, Double_t *x, Int_t nTest);"
-      << endl << "//" << endl
-      << "// The first for transforming original data x in " << endl
-      << "// pattern space, to principal components p in " << endl
-      << "// feature space. The second function is for the" << endl
-      << "// inverse transformation, but using only nTest" << endl
-      << "// of the principal components in the expansion" << endl
-      << "// " << endl
+      << std::endl << "//" << std::endl
+      << "// The first for transforming original data x in " << std::endl
+      << "// pattern space, to principal components p in " << std::endl
+      << "// feature space. The second function is for the" << std::endl
+      << "// inverse transformation, but using only nTest" << std::endl
+      << "// of the principal components in the expansion" << std::endl
+      << "// " << std::endl
       << "// See TPrincipal class documentation for more "
-      << "information " << endl << "// " << endl;
+      << "information " << std::endl << "// " << std::endl;
    // Header files
-   outFile << "#ifndef __CINT__" << endl;
+   outFile << "#ifndef __CINT__" << std::endl;
    if (isMethod)
       // If these are methods, we need the class header
-      outFile << "#include \"" << classname << ".h\"" << endl;
+      outFile << "#include \"" << classname << ".h\"" << std::endl;
    else
       // otherwise, we need the typedefs of Int_t and Double_t
-      outFile << "#include <Rtypes.h> // needed for Double_t etc" << endl;
+      outFile << "#include <Rtypes.h> // needed for Double_t etc" << std::endl;
    // Finish the preprocessor block
-   outFile << "#endif" << endl << endl;
+   outFile << "#endif" << std::endl << std::endl;
 
    //
    // Now for the data
@@ -1481,104 +1481,104 @@ void TPrincipal::MakeRealCode(const char *filename, const char *classname,
    // and Mean value vector static, since all are needed in both
    // functions. Also ,the number of variables are stored in a static
    // variable.
-   outFile << "//" << endl
-      << "// Static data variables"  << endl
-      << "//" << endl;
+   outFile << "//" << std::endl
+      << "// Static data variables"  << std::endl
+      << "//" << std::endl;
    outFile << cv_qual << "Int_t    " << prefix << "gNVariables = "
-      << fNumberOfVariables << ";" << endl;
+      << fNumberOfVariables << ";" << std::endl;
 
    // Assign the values to the Eigenvector matrix. The elements are
    // stored row-wise, that is element
    //    M[i][j] = e[i * nVariables + j]
    // where i and j are zero-based.
-   outFile << endl << "// Assignment of eigenvector matrix." << endl
-      << "// Elements are stored row-wise, that is" << endl
-      << "//    M[i][j] = e[i * nVariables + j] " << endl
-      << "// where i and j are zero-based" << endl;
+   outFile << std::endl << "// Assignment of eigenvector matrix." << std::endl
+      << "// Elements are stored row-wise, that is" << std::endl
+      << "//    M[i][j] = e[i * nVariables + j] " << std::endl
+      << "// where i and j are zero-based" << std::endl;
    outFile << cv_qual << "Double_t " << prefix
-      << "gEigenVectors[] = {" << flush;
+      << "gEigenVectors[] = {" << std::flush;
    Int_t i,j;
    for (i = 0; i < fNumberOfVariables; i++) {
       for (j = 0; j < fNumberOfVariables; j++) {
          Int_t index = i * fNumberOfVariables + j;
-         outFile << (index != 0 ? "," : "" ) << endl
-            << "  "  << fEigenVectors(i,j) << flush;
+         outFile << (index != 0 ? "," : "" ) << std::endl
+            << "  "  << fEigenVectors(i,j) << std::flush;
       }
    }
-   outFile << "};" << endl << endl;
+   outFile << "};" << std::endl << std::endl;
 
    // Assignment to eigenvalue vector. Zero-based.
-   outFile << "// Assignment to eigen value vector. Zero-based." << endl;
+   outFile << "// Assignment to eigen value vector. Zero-based." << std::endl;
    outFile << cv_qual << "Double_t " << prefix
-      << "gEigenValues[] = {" << flush;
+      << "gEigenValues[] = {" << std::flush;
    for (i = 0; i < fNumberOfVariables; i++)
-      outFile << (i != 0 ? "," : "") << endl
-      << "  " << fEigenValues(i) << flush;
-   outFile << endl << "};" << endl << endl;
+      outFile << (i != 0 ? "," : "") << std::endl
+      << "  " << fEigenValues(i) << std::flush;
+   outFile << std::endl << "};" << std::endl << std::endl;
 
    // Assignment to mean Values vector. Zero-based.
-   outFile << "// Assignment to mean value vector. Zero-based." << endl;
+   outFile << "// Assignment to mean value vector. Zero-based." << std::endl;
    outFile << cv_qual << "Double_t " << prefix
-      << "gMeanValues[] = {" << flush;
+      << "gMeanValues[] = {" << std::flush;
    for (i = 0; i < fNumberOfVariables; i++)
-      outFile << (i != 0 ? "," : "") << endl
-      << "  " << fMeanValues(i) << flush;
-   outFile << endl << "};" << endl << endl;
+      outFile << (i != 0 ? "," : "") << std::endl
+      << "  " << fMeanValues(i) << std::flush;
+   outFile << std::endl << "};" << std::endl << std::endl;
 
    // Assignment to mean Values vector. Zero-based.
-   outFile << "// Assignment to sigma value vector. Zero-based." << endl;
+   outFile << "// Assignment to sigma value vector. Zero-based." << std::endl;
    outFile << cv_qual << "Double_t " << prefix
-      << "gSigmaValues[] = {" << flush;
+      << "gSigmaValues[] = {" << std::flush;
    for (i = 0; i < fNumberOfVariables; i++)
-      outFile << (i != 0 ? "," : "") << endl
-      << "  " << (fIsNormalised ? fSigmas(i) : 1) << flush;
-   //    << "  " << fSigmas(i) << flush;
-   outFile << endl << "};" << endl << endl;
+      outFile << (i != 0 ? "," : "") << std::endl
+      << "  " << (fIsNormalised ? fSigmas(i) : 1) << std::flush;
+   //    << "  " << fSigmas(i) << std::flush;
+   outFile << std::endl << "};" << std::endl << std::endl;
 
    //
    // Finally we reach the functions themselves
    //
    // First: void x2p(Double_t *x, Double_t *p);
    //
-   outFile << "// " << endl
+   outFile << "// " << std::endl
       << "// The "
       << (isMethod ? "method " : "function ")
       << "  void " << prefix
       << "X2P(Double_t *x, Double_t *p)"
-      << endl << "// " << endl;
+      << std::endl << "// " << std::endl;
    outFile << "void " << prefix
-      << "X2P(Double_t *x, Double_t *p) {" << endl
-      << "  for (Int_t i = 0; i < gNVariables; i++) {" << endl
-      << "    p[i] = 0;" << endl
-      << "    for (Int_t j = 0; j < gNVariables; j++)" << endl
-      << "      p[i] += (x[j] - gMeanValues[j]) " << endl
+      << "X2P(Double_t *x, Double_t *p) {" << std::endl
+      << "  for (Int_t i = 0; i < gNVariables; i++) {" << std::endl
+      << "    p[i] = 0;" << std::endl
+      << "    for (Int_t j = 0; j < gNVariables; j++)" << std::endl
+      << "      p[i] += (x[j] - gMeanValues[j]) " << std::endl
       << "        * gEigenVectors[j *  gNVariables + i] "
-      << "/ gSigmaValues[j];" << endl << endl << "  }"
-      << endl << "}" << endl << endl;
+      << "/ gSigmaValues[j];" << std::endl << std::endl << "  }"
+      << std::endl << "}" << std::endl << std::endl;
    //
    // Now: void p2x(Double_t *p, Double_t *x, Int_t nTest);
    //
-   outFile << "// " << endl << "// The "
+   outFile << "// " << std::endl << "// The "
       << (isMethod ? "method " : "function ")
       << "  void " << prefix
       << "P2X(Double_t *p, Double_t *x, Int_t nTest)"
-      << endl << "// " << endl;
+      << std::endl << "// " << std::endl;
    outFile << "void " << prefix
-      << "P2X(Double_t *p, Double_t *x, Int_t nTest) {" << endl
-      << "  for (Int_t i = 0; i < gNVariables; i++) {" << endl
-      << "    x[i] = gMeanValues[i];" << endl
-      << "    for (Int_t j = 0; j < nTest; j++)" << endl
-      << "      x[i] += p[j] * gSigmaValues[i] " << endl
-      << "        * gEigenVectors[i *  gNVariables + j];" << endl
-      << "  }" << endl << "}" << endl << endl;
+      << "P2X(Double_t *p, Double_t *x, Int_t nTest) {" << std::endl
+      << "  for (Int_t i = 0; i < gNVariables; i++) {" << std::endl
+      << "    x[i] = gMeanValues[i];" << std::endl
+      << "    for (Int_t j = 0; j < nTest; j++)" << std::endl
+      << "      x[i] += p[j] * gSigmaValues[i] " << std::endl
+      << "        * gEigenVectors[i *  gNVariables + j];" << std::endl
+      << "  }" << std::endl << "}" << std::endl << std::endl;
 
    // EOF
-   outFile << "// EOF for " << filename << endl;
+   outFile << "// EOF for " << filename << std::endl;
 
    // Close the file
    outFile.close();
 
-   cout << "done" << endl;
+   std::cout << "done" << std::endl;
 }
 
 //____________________________________________________________________
@@ -1640,43 +1640,43 @@ void TPrincipal::Print(Option_t *opt) const
    }
 
    if (printM||printS||printE) {
-      cout << " Variable #  " << flush;
+      std::cout << " Variable #  " << std::flush;
       if (printM)
-         cout << "| Mean Value " << flush;
+         std::cout << "| Mean Value " << std::flush;
       if (printS)
-         cout << "|   Sigma    " << flush;
+         std::cout << "|   Sigma    " << std::flush;
       if (printE)
-         cout << "| Eigenvalue" << flush;
-      cout << endl;
+         std::cout << "| Eigenvalue" << std::flush;
+      std::cout << std::endl;
 
-      cout << "-------------" << flush;
+      std::cout << "-------------" << std::flush;
       if (printM)
-         cout << "+------------" << flush;
+         std::cout << "+------------" << std::flush;
       if (printS)
-         cout << "+------------" << flush;
+         std::cout << "+------------" << std::flush;
       if (printE)
-         cout << "+------------" << flush;
-      cout << endl;
+         std::cout << "+------------" << std::flush;
+      std::cout << std::endl;
 
       for (Int_t i = 0; i < fNumberOfVariables; i++) {
-         cout << setw(12) << i << " " << flush;
+         std::cout << std::setw(12) << i << " " << std::flush;
          if (printM)
-            cout << "| " << setw(10) << setprecision(4)
-            << fMeanValues(i) << " " << flush;
+            std::cout << "| " << std::setw(10) << std::setprecision(4)
+            << fMeanValues(i) << " " << std::flush;
          if (printS)
-            cout << "| " << setw(10) << setprecision(4)
-            << fSigmas(i) << " " << flush;
+            std::cout << "| " << std::setw(10) << std::setprecision(4)
+            << fSigmas(i) << " " << std::flush;
          if (printE)
-            cout << "| " << setw(10) << setprecision(4)
-            << fEigenValues(i) << " " << flush;
-         cout << endl;
+            std::cout << "| " << std::setw(10) << std::setprecision(4)
+            << fEigenValues(i) << " " << std::flush;
+         std::cout << std::endl;
       }
-      cout << endl;
+      std::cout << std::endl;
    }
 
    if(printV) {
       for (Int_t i = 0; i < fNumberOfVariables; i++) {
-         cout << "Eigenvector # " << i << flush;
+         std::cout << "Eigenvector # " << i << std::flush;
          TVectorD v(fNumberOfVariables);
          v = TMatrixDColumn_const(fEigenVectors,i);
          v.Print();
diff --git a/hist/hist/src/TProfile.cxx b/hist/hist/src/TProfile.cxx
index 6eb1ea31a60..ad56fd2b16e 100644
--- a/hist/hist/src/TProfile.cxx
+++ b/hist/hist/src/TProfile.cxx
@@ -1559,7 +1559,7 @@ void TProfile::Reset(Option_t *option)
 }
 
 //______________________________________________________________________________
-void TProfile::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TProfile::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
@@ -1579,11 +1579,11 @@ void TProfile::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
          if (i != 0) out << ", ";
          out << GetXaxis()->GetXbins()->fArray[i];
       }
-      out << "}; " << endl;
+      out << "}; " << std::endl;
    }
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    out<<"   "<<ClassName()<<" *";
 
    //histogram pointer has by default teh histogram name.
@@ -1604,21 +1604,21 @@ void TProfile::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    else
       out << "," << GetXaxis()->GetXmin()
           << "," << GetXaxis()->GetXmax()
-          <<","<<quote<<GetErrorOption()<<quote<<");"<<endl;
+          <<","<<quote<<GetErrorOption()<<quote<<");"<<std::endl;
 
    // save bin entries
    Int_t bin;
    for (bin=0;bin<fNcells;bin++) {
       Double_t bi = GetBinEntries(bin);
       if (bi) {
-         out<<"   "<<hname<<"->SetBinEntries("<<bin<<","<<bi<<");"<<endl;
+         out<<"   "<<hname<<"->SetBinEntries("<<bin<<","<<bi<<");"<<std::endl;
       }
    }
    //save bin contents
    for (bin=0;bin<fNcells;bin++) {
       Double_t bc = fArray[bin];
       if (bc) {
-         out<<"   "<<hname<<"->SetBinContent("<<bin<<","<<bc<<");"<<endl;
+         out<<"   "<<hname<<"->SetBinContent("<<bin<<","<<bc<<");"<<std::endl;
       }
    }
    // save bin errors
@@ -1626,7 +1626,7 @@ void TProfile::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       for (bin=0;bin<fNcells;bin++) {
          Double_t be = TMath::Sqrt(fSumw2.fArray[bin]);
          if (be) {
-            out<<"   "<<hname<<"->SetBinError("<<bin<<","<<be<<");"<<endl;
+            out<<"   "<<hname<<"->SetBinError("<<bin<<","<<be<<");"<<std::endl;
          }
       }
    }
diff --git a/hist/hist/src/TProfile2D.cxx b/hist/hist/src/TProfile2D.cxx
index 7c8d9ae4b50..886c912eec5 100644
--- a/hist/hist/src/TProfile2D.cxx
+++ b/hist/hist/src/TProfile2D.cxx
@@ -1649,7 +1649,7 @@ TProfile2D * TProfile2D::RebinY(Int_t ngroup,const char * newname ) {
 }
 
 //______________________________________________________________________________
-void TProfile2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TProfile2D::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -1659,7 +1659,7 @@ void TProfile2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
 
    char quote = '"';
-   out <<"   "<<endl;
+   out <<"   "<<std::endl;
    out <<"   "<<ClassName()<<" *";
 
    out << GetName() << " = new " << ClassName() << "(" << quote
@@ -1672,7 +1672,7 @@ void TProfile2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
        << "," << GetYaxis()->GetXmax();
    out << "," << fZmin
        << "," << fZmax;
-   out << ");" << endl;
+   out << ");" << std::endl;
 
 
    // save bin entries
@@ -1680,14 +1680,14 @@ void TProfile2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    for (bin=0;bin<fNcells;bin++) {
       Double_t bi = GetBinEntries(bin);
       if (bi) {
-         out<<"   "<<GetName()<<"->SetBinEntries("<<bin<<","<<bi<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetBinEntries("<<bin<<","<<bi<<");"<<std::endl;
       }
    }
    //save bin contents
    for (bin=0;bin<fNcells;bin++) {
       Double_t bc = fArray[bin];
       if (bc) {
-         out<<"   "<<GetName()<<"->SetBinContent("<<bin<<","<<bc<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetBinContent("<<bin<<","<<bc<<");"<<std::endl;
       }
    }
    // save bin errors
@@ -1695,7 +1695,7 @@ void TProfile2D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       for (bin=0;bin<fNcells;bin++) {
          Double_t be = TMath::Sqrt(fSumw2.fArray[bin]);
          if (be) {
-            out<<"   "<<GetName()<<"->SetBinError("<<bin<<","<<be<<");"<<endl;
+            out<<"   "<<GetName()<<"->SetBinError("<<bin<<","<<be<<");"<<std::endl;
          }
       }
    }
diff --git a/hist/hist/src/TProfile3D.cxx b/hist/hist/src/TProfile3D.cxx
index 3f917e5a1db..65b0510f56e 100644
--- a/hist/hist/src/TProfile3D.cxx
+++ b/hist/hist/src/TProfile3D.cxx
@@ -1162,7 +1162,7 @@ void TProfile3D::RebinAxis(Double_t x, TAxis *axis)
 }
 
 //______________________________________________________________________________
-void TProfile3D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TProfile3D::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out
 
@@ -1172,7 +1172,7 @@ void TProfile3D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
 
 
    char quote = '"';
-   out <<"   "<<endl;
+   out <<"   "<<std::endl;
    out <<"   "<<ClassName()<<" *";
 
    out << GetName() << " = new " << ClassName() << "(" << quote
@@ -1188,7 +1188,7 @@ void TProfile3D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
        << "," << GetZaxis()->GetXmax();
    out << "," << fTmin
        << "," << fTmax;
-   out << ");" << endl;
+   out << ");" << std::endl;
 
 
    // save bin entries
@@ -1196,14 +1196,14 @@ void TProfile3D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    for (bin=0;bin<fNcells;bin++) {
       Double_t bi = GetBinEntries(bin);
       if (bi) {
-         out<<"   "<<GetName()<<"->SetBinEntries("<<bin<<","<<bi<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetBinEntries("<<bin<<","<<bi<<");"<<std::endl;
       }
    }
    //save bin contents
    for (bin=0;bin<fNcells;bin++) {
       Double_t bc = fArray[bin];
       if (bc) {
-         out<<"   "<<GetName()<<"->SetBinContent("<<bin<<","<<bc<<");"<<endl;
+         out<<"   "<<GetName()<<"->SetBinContent("<<bin<<","<<bc<<");"<<std::endl;
       }
    }
    // save bin errors
@@ -1211,7 +1211,7 @@ void TProfile3D::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
       for (bin=0;bin<fNcells;bin++) {
          Double_t be = TMath::Sqrt(fSumw2.fArray[bin]);
          if (be) {
-            out<<"   "<<GetName()<<"->SetBinError("<<bin<<","<<be<<");"<<endl;
+            out<<"   "<<GetName()<<"->SetBinError("<<bin<<","<<be<<");"<<std::endl;
          }
       }
    }
diff --git a/hist/hist/src/TSpline.cxx b/hist/hist/src/TSpline.cxx
index 5632a380f7c..ffd7c60ea34 100644
--- a/hist/hist/src/TSpline.cxx
+++ b/hist/hist/src/TSpline.cxx
@@ -834,7 +834,7 @@ void TSpline3::SaveAs(const char *filename, Option_t * /*option*/) const
    // the name of the function is the name of the file up to the "." if any
 
    //open the file
-   ofstream *f = new ofstream(filename,ios::out);
+   std::ofstream *f = new std::ofstream(filename,std::ios::out);
    if (f == 0 || gSystem->AccessPathName(filename,kWritePermission)) {
       Error("SaveAs","Cannot open file:%s\n",filename);
       return;
@@ -989,12 +989,12 @@ void TSpline3::SaveAs(const char *filename, Option_t * /*option*/) const
 
 
 //______________________________________________________________________________
-void TSpline3::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TSpline3::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TSpline3::Class())) {
       out<<"   ";
    } else {
@@ -1002,19 +1002,19 @@ void TSpline3::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    }
    out<<"spline3 = new TSpline3("<<quote<<GetTitle()<<quote<<","
       <<fXmin<<","<<fXmax<<",(TF1*)0,"<<fNp<<","<<quote<<quote<<","
-      <<fValBeg<<","<<fValEnd<<");"<<endl;
-   out<<"   spline3->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      <<fValBeg<<","<<fValEnd<<");"<<std::endl;
+   out<<"   spline3->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"spline3",0,1001);
    SaveLineAttributes(out,"spline3",1,1,1);
    SaveMarkerAttributes(out,"spline3",1,1,1);
-   if (fNpx != 100) out<<"   spline3->SetNpx("<<fNpx<<");"<<endl;
+   if (fNpx != 100) out<<"   spline3->SetNpx("<<fNpx<<");"<<std::endl;
 
    for (Int_t i=0;i<fNp;i++) {
-      out<<"   spline3->SetPoint("<<i<<","<<fPoly[i].X()<<","<<fPoly[i].Y()<<");"<<endl;
-      out<<"   spline3->SetPointCoeff("<<i<<","<<fPoly[i].B()<<","<<fPoly[i].C()<<","<<fPoly[i].D()<<");"<<endl;
+      out<<"   spline3->SetPoint("<<i<<","<<fPoly[i].X()<<","<<fPoly[i].Y()<<");"<<std::endl;
+      out<<"   spline3->SetPointCoeff("<<i<<","<<fPoly[i].B()<<","<<fPoly[i].C()<<","<<fPoly[i].D()<<");"<<std::endl;
    }
-   out<<"   spline3->Draw("<<quote<<option<<quote<<");"<<endl;
+   out<<"   spline3->Draw("<<quote<<option<<quote<<");"<<std::endl;
 }
 
 
@@ -1623,7 +1623,7 @@ void TSpline5::SaveAs(const char *filename, Option_t * /*option*/) const
    // the name of the function is the name of the file up to the "." if any
 
    //open the file
-   ofstream *f = new ofstream(filename,ios::out);
+   std::ofstream *f = new std::ofstream(filename,std::ios::out);
    if (f == 0 || gSystem->AccessPathName(filename,kWritePermission)) {
       Error("SaveAs","Cannot open file:%s\n",filename);
       return;
@@ -1810,12 +1810,12 @@ void TSpline5::SaveAs(const char *filename, Option_t * /*option*/) const
 
 
 //______________________________________________________________________________
-void TSpline5::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TSpline5::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TSpline5::Class())) {
       out<<"   ";
    } else {
@@ -1827,19 +1827,19 @@ void TSpline5::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
    Double_t e2 = fPoly[fNp-1].Y();
    out<<"spline5 = new TSpline5("<<quote<<GetTitle()<<quote<<","
       <<fXmin<<","<<fXmax<<",(TF1*)0,"<<fNp<<","<<quote<<quote<<","
-      <<b1<<","<<e1<<","<<b2<<","<<e2<<");"<<endl;
-   out<<"   spline5->SetName("<<quote<<GetName()<<quote<<");"<<endl;
+      <<b1<<","<<e1<<","<<b2<<","<<e2<<");"<<std::endl;
+   out<<"   spline5->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
 
    SaveFillAttributes(out,"spline5",0,1001);
    SaveLineAttributes(out,"spline5",1,1,1);
    SaveMarkerAttributes(out,"spline5",1,1,1);
-   if (fNpx != 100) out<<"   spline5->SetNpx("<<fNpx<<");"<<endl;
+   if (fNpx != 100) out<<"   spline5->SetNpx("<<fNpx<<");"<<std::endl;
 
    for (Int_t i=0;i<fNp;i++) {
-      out<<"   spline5->SetPoint("<<i<<","<<fPoly[i].X()<<","<<fPoly[i].Y()<<");"<<endl;
-      out<<"   spline5->SetPointCoeff("<<i<<","<<fPoly[i].B()<<","<<fPoly[i].C()<<","<<fPoly[i].D()<<","<<fPoly[i].E()<<","<<fPoly[i].F()<<");"<<endl;
+      out<<"   spline5->SetPoint("<<i<<","<<fPoly[i].X()<<","<<fPoly[i].Y()<<");"<<std::endl;
+      out<<"   spline5->SetPointCoeff("<<i<<","<<fPoly[i].B()<<","<<fPoly[i].C()<<","<<fPoly[i].D()<<","<<fPoly[i].E()<<","<<fPoly[i].F()<<");"<<std::endl;
    }
-   out<<"   spline5->Draw("<<quote<<option<<quote<<");"<<endl;
+   out<<"   spline5->Draw("<<quote<<option<<quote<<");"<<std::endl;
 }
 
 
diff --git a/hist/histpainter/inc/TPaletteAxis.h b/hist/histpainter/inc/TPaletteAxis.h
index 257f46cef95..75f51332913 100644
--- a/hist/histpainter/inc/TPaletteAxis.h
+++ b/hist/histpainter/inc/TPaletteAxis.h
@@ -55,7 +55,7 @@ public:
    virtual char *GetObjectInfo(Int_t px, Int_t py) const;
    Int_t         GetValueColor(Double_t zc);
    virtual void  Paint(Option_t *option="");
-   virtual void  SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void  SetName(const char *name="") {fName = name;} // *MENU*
    virtual void  SetLabelColor(Int_t labelcolor) {fAxis.SetLabelColor(labelcolor);} // *MENU*
    virtual void  SetLabelFont(Int_t labelfont) {fAxis.SetLabelFont(labelfont);} // *MENU*
diff --git a/hist/histpainter/src/TPaletteAxis.cxx b/hist/histpainter/src/TPaletteAxis.cxx
index 8b3208605e4..a962f11a6c7 100644
--- a/hist/histpainter/src/TPaletteAxis.cxx
+++ b/hist/histpainter/src/TPaletteAxis.cxx
@@ -434,12 +434,12 @@ void TPaletteAxis::Paint(Option_t *)
 
 
 //______________________________________________________________________________
-void TPaletteAxis::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TPaletteAxis::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    // Save primitive as a C++ statement(s) on output stream out.
 
    //char quote = '"';
-   out << "   " << endl;
+   out << "   " << std::endl;
    if (gROOT->ClassSaved(TPaletteAxis::Class())) {
       out << "   ";
    } else {
@@ -447,17 +447,17 @@ void TPaletteAxis::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    if (fOption.Contains("NDC")) {
       out << "palette = new " << ClassName() << "(" << fX1NDC << "," << fY1NDC << "," << fX2NDC << "," << fY2NDC
-          << "," << fH->GetName() << ");" << endl;
+          << "," << fH->GetName() << ");" << std::endl;
    } else {
       out << "palette = new " << ClassName() << "(" << fX1 << "," << fY1 << "," << fX2 << "," << fY2
-          << "," << fH->GetName() << ");" << endl;
+          << "," << fH->GetName() << ");" << std::endl;
    }
-   out << "palette->SetLabelColor(" << fAxis.GetLabelColor() << ");" << endl;
-   out << "palette->SetLabelFont("  << fAxis.GetLabelFont() << ");" << endl;
-   out << "palette->SetLabelOffset(" << fAxis.GetLabelOffset() << ");" << endl;
-   out << "palette->SetLabelSize("  << fAxis.GetLabelSize() << ");" << endl;
-   out << "palette->SetTitleOffset(" << fAxis.GetTitleOffset() << ");" << endl;
-   out << "palette->SetTitleSize("  << fAxis.GetTitleSize() << ");" << endl;
+   out << "palette->SetLabelColor(" << fAxis.GetLabelColor() << ");" << std::endl;
+   out << "palette->SetLabelFont("  << fAxis.GetLabelFont() << ");" << std::endl;
+   out << "palette->SetLabelOffset(" << fAxis.GetLabelOffset() << ");" << std::endl;
+   out << "palette->SetLabelSize("  << fAxis.GetLabelSize() << ");" << std::endl;
+   out << "palette->SetTitleOffset(" << fAxis.GetTitleOffset() << ");" << std::endl;
+   out << "palette->SetTitleSize("  << fAxis.GetTitleSize() << ");" << std::endl;
    SaveFillAttributes(out, "palette", -1, -1);
    SaveLineAttributes(out, "palette", 1, 1, 1);
 }
diff --git a/html/src/TClassDocOutput.cxx b/html/src/TClassDocOutput.cxx
index fc668e136c4..0e685d46f42 100644
--- a/html/src/TClassDocOutput.cxx
+++ b/html/src/TClassDocOutput.cxx
@@ -121,21 +121,21 @@ void TClassDocOutput::ListFunctions(std::ostream& classFile)
 
    // loop to get a pointers to method names
 
-   classFile << endl << "<div id=\"functions\">" << endl;
+   classFile << std::endl << "<div id=\"functions\">" << std::endl;
    TString mangled(fCurrentClass->GetName());
    NameSpace2FileName(mangled);
    classFile << "<h2><a id=\"" << mangled
-      << ":Function_Members\"></a>Function Members (Methods)</h2>" << endl;
+      << ":Function_Members\"></a>Function Members (Methods)</h2>" << std::endl;
 
    const char* tab4nbsp="&nbsp;&nbsp;&nbsp;&nbsp;";
    TString declFile;
    fHtml->GetDeclFileName(fCurrentClass, kFALSE, declFile);
    if (fCurrentClass->Property() & kIsAbstract)
       classFile << "&nbsp;<br /><b>"
-                << tab4nbsp << "This is an abstract class, constructors will not be documented.<br />" << endl
+                << tab4nbsp << "This is an abstract class, constructors will not be documented.<br />" << std::endl
                 << tab4nbsp << "Look at the <a href=\""
                 << gSystem->BaseName(declFile)
-                << "\">header</a> to check for available constructors.</b><br />" << endl;
+                << "\">header</a> to check for available constructors.</b><br />" << std::endl;
 
    Int_t minAccess = 0;
    if (fHtml->IsNamespace(fCurrentClass))
@@ -151,8 +151,8 @@ void TClassDocOutput::ListFunctions(std::ostream& classFile)
       const char* accesstxt[] = {"private", "protected", "public"};
 
       classFile << "id=\"func" << accessID[access] << "\"><b>" 
-         << accesstxt[access] << ":</b>" << endl
-         << "<table class=\"func\" id=\"tabfunc" << accessID[access] << "\" cellspacing=\"0\">" << endl;
+         << accesstxt[access] << ":</b>" << std::endl
+         << "<table class=\"func\" id=\"tabfunc" << accessID[access] << "\" cellspacing=\"0\">" << std::endl;
 
       TIter iMethWrap(methods);
       TDocMethodWrapper *methWrap = 0;
@@ -231,12 +231,12 @@ void TClassDocOutput::ListFunctions(std::ostream& classFile)
                classFile << "</span>";
             }
          }
-         classFile << "</td></tr>" << endl;
+         classFile << "</td></tr>" << std::endl;
       }
-      classFile << endl << "</table></div>" << endl;
+      classFile << std::endl << "</table></div>" << std::endl;
    }
 
-   classFile << "</div>" << endl; // class="functions"
+   classFile << "</div>" << std::endl; // class="functions"
 }
 
 //______________________________________________________________________________
@@ -254,11 +254,11 @@ void  TClassDocOutput::ListDataMembers(std::ostream& classFile)
 
    if (!haveDataMembers) return;
 
-   classFile << endl << "<div id=\"datamembers\">" << endl;
+   classFile << std::endl << "<div id=\"datamembers\">" << std::endl;
    TString mangled(fCurrentClass->GetName());
    NameSpace2FileName(mangled);
    classFile << "<h2><a name=\"" << mangled
-      << ":Data_Members\"></a>Data Members</h2>" << endl;
+      << ":Data_Members\"></a>Data Members</h2>" << std::endl;
 
    for (Int_t access = 5; access >= 0 && !fHtml->IsNamespace(fCurrentClass); --access) {
       const TList* datamembers = 0;
@@ -274,8 +274,8 @@ void  TClassDocOutput::ListDataMembers(std::ostream& classFile)
       const char* accesstxt[] = {"private", "protected", "public"};
 
       classFile << "id=\"" << what << accessID[access%3] << "\"><b>" 
-         << accesstxt[access%3] << ":</b>" << endl
-         << "<table class=\"data\" id=\"tab" << what << accessID[access%3] << "\" cellspacing=\"0\">" << endl;
+         << accesstxt[access%3] << ":</b>" << std::endl
+         << "<table class=\"data\" id=\"tab" << what << accessID[access%3] << "\" cellspacing=\"0\">" << std::endl;
 
       TIter iDM(datamembers);
       TDataMember *member = 0;
@@ -289,7 +289,7 @@ void  TClassDocOutput::ListDataMembers(std::ostream& classFile)
                classFile << "<tr class=\"data";
                if (prevIsInh)
                   classFile << "inh";
-               classFile << "\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << endl;
+               classFile << "\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << std::endl;
             }
             prevEnumName = member->GetTypeName();
          }
@@ -368,19 +368,19 @@ void  TClassDocOutput::ListDataMembers(std::ostream& classFile)
             classFile << "<td class=\"datadesc\">";
             ReplaceSpecialChars(classFile, member->GetTitle());
          } else classFile << "<td>";
-         classFile << "</td></tr>" << endl;
+         classFile << "</td></tr>" << std::endl;
       } // for members
 
       if (prevEnumName.Length()) {
          classFile << "<tr class=\"data";
          if (prevIsInh)
             classFile << "inh";
-         classFile << "\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << endl;
+         classFile << "\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << std::endl;
       }
-      classFile << endl << "</table></div>" << endl;
+      classFile << std::endl << "</table></div>" << std::endl;
    } // for access
 
-   classFile << "</div>" << endl; // datamembers
+   classFile << "</div>" << std::endl; // datamembers
 }
 
 //______________________________________________________________________________
@@ -443,13 +443,13 @@ Bool_t TClassDocOutput::ClassDotCharts(std::ostream& out)
    if (CreateDotClassChartLib(filenameLib + ".dot"))
       RunDot(filenameLib, &out);
 
-   out << "<div class=\"tabs\">" << endl
-       << "<a id=\"img" << title << "_Inh\" class=\"tabsel\" href=\"inh/" << title << "_Inh.png\" onclick=\"javascript:return SetImg('Charts','inh/" << title << "_Inh.png');\">Inheritance</a>" << endl
-       << "<a id=\"img" << title << "_InhMem\" class=\"tab\" href=\"inhmem/" << title << "_InhMem.png\" onclick=\"javascript:return SetImg('Charts','inhmem/" << title << "_InhMem.png');\">Inherited Members</a>" << endl
-       << "<a id=\"img" << title << "_Incl\" class=\"tab\" href=\"incl/" << title << "_Incl.png\" onclick=\"javascript:return SetImg('Charts','incl/" << title << "_Incl.png');\">Includes</a>" << endl
-       << "<a id=\"img" << title << "_Lib\" class=\"tab\" href=\"lib/" << title << "_Lib.png\" onclick=\"javascript:return SetImg('Charts','lib/" << title << "_Lib.png');\">Libraries</a><br/>" << endl
-       << "</div><div class=\"classcharts\"><div class=\"classchartswidth\"></div>" << endl
-       << "<img id=\"Charts\" alt=\"Class Charts\" class=\"classcharts\" usemap=\"#Map" << title << "_Inh\" src=\"inh/" << title << "_Inh.png\"/></div>" << endl;
+   out << "<div class=\"tabs\">" << std::endl
+       << "<a id=\"img" << title << "_Inh\" class=\"tabsel\" href=\"inh/" << title << "_Inh.png\" onclick=\"javascript:return SetImg('Charts','inh/" << title << "_Inh.png');\">Inheritance</a>" << std::endl
+       << "<a id=\"img" << title << "_InhMem\" class=\"tab\" href=\"inhmem/" << title << "_InhMem.png\" onclick=\"javascript:return SetImg('Charts','inhmem/" << title << "_InhMem.png');\">Inherited Members</a>" << std::endl
+       << "<a id=\"img" << title << "_Incl\" class=\"tab\" href=\"incl/" << title << "_Incl.png\" onclick=\"javascript:return SetImg('Charts','incl/" << title << "_Incl.png');\">Includes</a>" << std::endl
+       << "<a id=\"img" << title << "_Lib\" class=\"tab\" href=\"lib/" << title << "_Lib.png\" onclick=\"javascript:return SetImg('Charts','lib/" << title << "_Lib.png');\">Libraries</a><br/>" << std::endl
+       << "</div><div class=\"classcharts\"><div class=\"classchartswidth\"></div>" << std::endl
+       << "<img id=\"Charts\" alt=\"Class Charts\" class=\"classcharts\" usemap=\"#Map" << title << "_Inh\" src=\"inh/" << title << "_Inh.png\"/></div>" << std::endl;
 
    return kTRUE;
 }
@@ -468,16 +468,16 @@ void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
 //
 
    if (dir == kBoth) {
-      out << "<!--INHERITANCE TREE-->" << endl;
+      out << "<!--INHERITANCE TREE-->" << std::endl;
 
       // draw class tree into nested tables recursively
       out << "<table><tr><td width=\"10%\"></td><td width=\"70%\">"
           << "<a href=\"ClassHierarchy.html\">Inheritance Chart</a>:</td></tr>";
       out << "<tr class=\"inhtree\"><td width=\"10%\"></td><td width=\"70%\">";
 
-      out << "<table class=\"inhtree\"><tr><td>" << endl;
+      out << "<table class=\"inhtree\"><tr><td>" << std::endl;
       out << "<table width=\"100%\" border=\"0\" ";
-      out << "cellpadding =\"0\" cellspacing=\"2\"><tr>" << endl;
+      out << "cellpadding =\"0\" cellspacing=\"2\"><tr>" << std::endl;
    } else {
       out << "<table><tr>";
    }
@@ -495,13 +495,13 @@ void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
       while ((inheritFrom = (TBaseClass *) nextBase())) {
 
          if (first) {
-            out << "<td><table><tr>" << endl;
+            out << "<td><table><tr>" << std::endl;
             first = kFALSE;
          } else
-            out << "</tr><tr>" << endl;
+            out << "</tr><tr>" << std::endl;
          out << "<td bgcolor=\""
             << Form("#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
-            << "\" align=\"right\">" << endl;
+            << "\" align=\"right\">" << std::endl;
          // get a class
          TClass *classInh = fHtml->GetClass((const char *) inheritFrom->GetName());
          if (classInh)
@@ -510,15 +510,15 @@ void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
             out << "<tt>"
                 << (const char *) inheritFrom->GetName()
                 << "</tt>";
-         out << "</td>"<< endl;
+         out << "</td>"<< std::endl;
       }
       if (!first) {
-         out << "</tr></table></td>" << endl; // put it in additional row in table
+         out << "</tr></table></td>" << std::endl; // put it in additional row in table
          out << "<td>&larr;</td>";
       }
    }
 
-   out << "<td>" << endl; // put it in additional row in table
+   out << "<td>" << std::endl; // put it in additional row in table
    ////////////////////////////////////////////////////////
    // Output Class Name
 
@@ -533,7 +533,7 @@ void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
          out << "<center><tt><a name=\"" << anchor;
          out << "\" href=\"" << htmlFile << "\">";
          ReplaceSpecialChars(out, className);
-         out << "</a></tt></center>" << endl;
+         out << "</a></tt></center>" << std::endl;
       } else
          ReplaceSpecialChars(out, className);
    }
@@ -543,12 +543,12 @@ void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
          out << "<center><big><b><tt><a name=\"" << anchor;
          out << "\" href=\"" << htmlFile << "\">";
          ReplaceSpecialChars(out, className);
-         out << "</a></tt></b></big></center>" << endl;
+         out << "</a></tt></b></big></center>" << std::endl;
       } else
          ReplaceSpecialChars(out, className);
    }
 
-   out << "</td>" << endl; // put it in additional row in table
+   out << "</td>" << std::endl; // put it in additional row in table
 
    ////////////////////////////////////////////////////////
    // Loop down to child classes
@@ -558,21 +558,21 @@ void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
       // 1. make a list of class names
       // 2. use DescendHierarchy
 
-      out << "<td><table><tr>" << endl;
+      out << "<td><table><tr>" << std::endl;
       fHierarchyLines = 0;
       DescendHierarchy(out,classPtr,10);
 
       out << "</tr></table>";
       if (dir==kBoth && fHierarchyLines>=10)
          out << "</td><td align=\"left\">&nbsp;<a href=\"ClassHierarchy.html\">[more...]</a>";
-      out<<"</td>" << endl;
+      out<<"</td>" << std::endl;
 
       // free allocated memory
    }
 
-   out << "</tr></table>" << endl;
+   out << "</tr></table>" << std::endl;
    if (dir == kBoth)
-      out << "</td></tr></table></td></tr></table>"<<endl;
+      out << "</td></tr></table></td></tr></table>"<<std::endl;
 }
 
 
@@ -618,15 +618,15 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
 // Input: filename - output dot file incl. path
 
    std::ofstream outdot(filename);
-   outdot << "strict digraph G {" << endl
-      << "rankdir=RL;" << endl
-      << "ranksep=2;" << endl
-      << "nodesep=0;" << endl
-      << "size=\"8,10\";" << endl
-      << "ratio=auto;" << endl
-      << "margin=0;" << endl
-      << "node [shape=plaintext,fontsize=40,width=4,height=0.75];" << endl
-      << "\"" << fCurrentClass->GetName() << "\" [shape=ellipse];" << endl;
+   outdot << "strict digraph G {" << std::endl
+      << "rankdir=RL;" << std::endl
+      << "ranksep=2;" << std::endl
+      << "nodesep=0;" << std::endl
+      << "size=\"8,10\";" << std::endl
+      << "ratio=auto;" << std::endl
+      << "margin=0;" << std::endl
+      << "node [shape=plaintext,fontsize=40,width=4,height=0.75];" << std::endl
+      << "\"" << fCurrentClass->GetName() << "\" [shape=ellipse];" << std::endl;
 
    std::stringstream ssDep;
    std::list<TClass*> writeBasesFor;
@@ -634,7 +634,7 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
    Bool_t haveBases = fCurrentClass->GetListOfBases() && 
       fCurrentClass->GetListOfBases()->GetSize();
    if (haveBases) {
-      outdot << "{" << endl;
+      outdot << "{" << std::endl;
       while (!writeBasesFor.empty()) {
          TClass* cl = writeBasesFor.front();
          writeBasesFor.pop_front();
@@ -643,7 +643,7 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
             const char* htmlFileName = fHtml->GetHtmlFileName(cl->GetName());
             if (htmlFileName)
                outdot << " [URL=\"" << htmlFileName << "\"]";
-            outdot << ";" << endl;
+            outdot << ";" << std::endl;
          }
          if (cl->GetListOfBases() && cl->GetListOfBases()->GetSize()) {
             ssDep << "  \"" << cl->GetName() << "\" -> {";
@@ -653,10 +653,10 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
                ssDep << " \"" << base->GetName() << "\";";
                writeBasesFor.push_back(base->GetClassPointer());
             }
-            ssDep << "}" << endl;
+            ssDep << "}" << std::endl;
          }
       }
-      outdot << "}" << endl; // cluster
+      outdot << "}" << std::endl; // cluster
    }
 
    std::map<TClass*, Int_t> derivesFromMe;
@@ -665,7 +665,7 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
    wroteNode.insert(fCurrentClass);
    static const unsigned int maxClassesPerDerived = 20;
    fHtml->GetDerivedClasses(fCurrentClass, derivesFromMe);
-   outdot << "{" << endl;
+   outdot << "{" << std::endl;
    for (Int_t level = 1; kTRUE; ++level) {
       Bool_t levelExists = kFALSE;
       for (std::map<TClass*, Int_t>::iterator iDerived = derivesFromMe.begin();
@@ -684,12 +684,12 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
                if (count < maxClassesPerDerived) {
                   writeNode = kTRUE;
                   ssDep << "\"" << iDerived->first->GetName() << "\" -> \""
-                     << clBaseDerived->GetName() << "\";" << endl;
+                     << clBaseDerived->GetName() << "\";" << std::endl;
                   ++count;
                } else if (count == maxClassesPerDerived) {
                   writeAndMoreFor = clBaseDerived;
                   ssDep << "\"...andmore" << clBaseDerived->GetName() << "\"-> \"" 
-                     << clBaseDerived->GetName() << "\";" << endl;
+                     << clBaseDerived->GetName() << "\";" << std::endl;
                   ++count;
                }
             }
@@ -701,19 +701,19 @@ Bool_t TClassDocOutput::CreateDotClassChartInh(const char* filename)
             const char* htmlFileName = fHtml->GetHtmlFileName(iDerived->first->GetName());
             if (htmlFileName)
                outdot << " [URL=\"" << htmlFileName << "\"]";
-            outdot << ";" << endl;
+            outdot << ";" << std::endl;
          } else if (writeAndMoreFor) {
                outdot << "  \"...andmore" << writeAndMoreFor->GetName()
-                      << "\" [label=\"...and more\",fontname=\"Times-Italic\",fillcolor=lightgrey,style=filled];" << endl;
+                      << "\" [label=\"...and more\",fontname=\"Times-Italic\",fillcolor=lightgrey,style=filled];" << std::endl;
          }
       }
       if (!levelExists) break;
    }
-   outdot << "}" << endl; // cluster
+   outdot << "}" << std::endl; // cluster
 
    outdot << ssDep.str();
 
-   outdot << "}" << endl; // digraph
+   outdot << "}" << std::endl; // digraph
 
    return kTRUE;
 }
@@ -725,15 +725,15 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
 // Input: filename - output dot file incl. path
 
    std::ofstream outdot(filename);
-   outdot << "strict digraph G {" << endl
-      << "ratio=auto;" << endl
-      << "rankdir=RL;" << endl
-      << "compound=true;" << endl
-      << "constraint=false;" << endl
-      << "ranksep=0.1;" << endl
-      << "nodesep=0;" << endl
-      << "margin=0;" << endl;
-   outdot << "  node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10];" << endl;
+   outdot << "strict digraph G {" << std::endl
+      << "ratio=auto;" << std::endl
+      << "rankdir=RL;" << std::endl
+      << "compound=true;" << std::endl
+      << "constraint=false;" << std::endl
+      << "ranksep=0.1;" << std::endl
+      << "nodesep=0;" << std::endl
+      << "margin=0;" << std::endl;
+   outdot << "  node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10];" << std::endl;
 
    std::stringstream ssDep;
    const int numColumns = 3;
@@ -746,11 +746,11 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
 
       const char* htmlFileName = fHtml->GetHtmlFileName(cl->GetName());
 
-      outdot << "subgraph \"cluster" << cl->GetName() << "\" {" << endl
-             << "  color=lightgray;" << endl
-             << "  label=\"" << cl->GetName() << "\";" << endl;
+      outdot << "subgraph \"cluster" << cl->GetName() << "\" {" << std::endl
+             << "  color=lightgray;" << std::endl
+             << "  label=\"" << cl->GetName() << "\";" << std::endl;
       if (cl != fCurrentClass && htmlFileName)
-         outdot << "  URL=\"" << htmlFileName << "\"" << endl;
+         outdot << "  URL=\"" << htmlFileName << "\"" << std::endl;
 
       //Bool_t haveMembers = (cl->GetListOfDataMembers() && cl->GetListOfDataMembers()->GetSize());
       Bool_t haveFuncs = cl->GetListOfMethods() && cl->GetListOfMethods()->GetSize();
@@ -768,10 +768,10 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
                dmMap[dm->GetName()] = dm;
          }
 
-         outdot << "subgraph \"clusterData0" << cl->GetName() << "\" {" << endl
-                << "  color=white;" << endl
-                << "  label=\"\";" << endl
-                << "  \"clusterNode0" << cl->GetName() << "\" [height=0,width=0,style=invis];" << endl;
+         outdot << "subgraph \"clusterData0" << cl->GetName() << "\" {" << std::endl
+                << "  color=white;" << std::endl
+                << "  label=\"\";" << std::endl
+                << "  \"clusterNode0" << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
          TString prevColumnNode;
          Int_t pos = dmMap.size();
          Int_t column = 0;
@@ -793,27 +793,27 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
                outdot << ",color=\"#FFFF77\"";
             else
                outdot << ",color=\"#CCFFCC\"";
-            outdot << "];" << endl;
+            outdot << "];" << std::endl;
             if (pos % newColumnEvery == 1) {
                ++column;
-               outdot << "};" << endl // end dataR
-                      << "subgraph \"clusterData" << column << cl->GetName() << "\" {" << endl
-                      << "  color=white;" << endl
-                      << "  label=\"\";" << endl
-                      << "  \"clusterNode" << column << cl->GetName() << "\" [height=0,width=0,style=invis];" << endl;
+               outdot << "};" << std::endl // end dataR
+                      << "subgraph \"clusterData" << column << cl->GetName() << "\" {" << std::endl
+                      << "  color=white;" << std::endl
+                      << "  label=\"\";" << std::endl
+                      << "  \"clusterNode" << column << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
             } else if (iDM != dmMap.begin() && pos % newColumnEvery == 0) {
                ssDep << "\"" << prevColumnNode
-                     << "\" -> \"" << nodeName << "\""<< " [style=invis,weight=100];" << endl;
+                     << "\" -> \"" << nodeName << "\""<< " [style=invis,weight=100];" << std::endl;
                prevColumnNode = nodeName;
             }
          }
 
          while (column < numColumns - 1) {
             ++column;
-            outdot << "  \"clusterNode" << column << cl->GetName() << "\" [height=0,width=0,style=invis];" << endl;
+            outdot << "  \"clusterNode" << column << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
          }
 
-         outdot << "};" << endl; // subgraph dataL/R
+         outdot << "};" << std::endl; // subgraph dataL/R
       } // DATA MEMBERS
 
       // FUNCTION MEMBERS
@@ -828,10 +828,10 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
                methMap[meth->GetName()] = meth;
          }
 
-         outdot << "subgraph \"clusterFunc0" << cl->GetName() << "\" {" << endl
-                << "  color=white;" << endl
-                << "  label=\"\";" << endl
-                << "  \"clusterNode0" << cl->GetName() << "\" [height=0,width=0,style=invis];" << endl;
+         outdot << "subgraph \"clusterFunc0" << cl->GetName() << "\" {" << std::endl
+                << "  color=white;" << std::endl
+                << "  label=\"\";" << std::endl
+                << "  \"clusterNode0" << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
 
          TString prevColumnNodeFunc;
          Int_t pos = methMap.size();
@@ -856,26 +856,26 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
                outdot << ",color=\"#FFFF77\"";
             else
                outdot << ",color=\"#CCFFCC\"";
-            outdot << "];" << endl;
+            outdot << "];" << std::endl;
             if (pos % newColumnEvery == 1) {
                ++column;
-               outdot << "};" << endl // end funcR
-                      << "subgraph \"clusterFunc" << column << cl->GetName() << "\" {" << endl
-                      << "  color=white;" << endl
-                      << "  label=\"\";" << endl;
+               outdot << "};" << std::endl // end funcR
+                      << "subgraph \"clusterFunc" << column << cl->GetName() << "\" {" << std::endl
+                      << "  color=white;" << std::endl
+                      << "  label=\"\";" << std::endl;
             } else if (iMeth != methMap.begin() && pos % newColumnEvery == 0) {
                ssDep << "\"" << prevColumnNodeFunc
-                     << "\" -> \"" << nodeName << "\""<< " [style=invis,weight=100];" << endl;
+                     << "\" -> \"" << nodeName << "\""<< " [style=invis,weight=100];" << std::endl;
                prevColumnNodeFunc = nodeName;
             }
          }
-         outdot << "};" << endl; // subgraph funcL/R
+         outdot << "};" << std::endl; // subgraph funcL/R
       }
 
-      outdot << "}" << endl; // cluster class
+      outdot << "}" << std::endl; // cluster class
 
       for (Int_t pos = 0; pos < numColumns - 1; ++pos)
-         ssDep << "\"clusterNode" << pos << cl->GetName() << "\" -> \"clusterNode" << pos + 1 << cl->GetName() << "\" [style=invis];" << endl;
+         ssDep << "\"clusterNode" << pos << cl->GetName() << "\" -> \"clusterNode" << pos + 1 << cl->GetName() << "\" [style=invis];" << std::endl;
 
       if (cl->GetListOfBases() && cl->GetListOfBases()->GetSize()) {
          TIter iBase(cl->GetListOfBases());
@@ -886,7 +886,7 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
                   << "\",lhead=\"cluster" << base->GetName() << "\"";
             if (base != cl->GetListOfBases()->First())
                ssDep << ",weight=0";
-            ssDep << "];" << endl;
+            ssDep << "];" << std::endl;
             writeBasesFor.push_back(base->GetClassPointer());
          }
       }
@@ -894,7 +894,7 @@ Bool_t TClassDocOutput::CreateDotClassChartInhMem(const char* filename) {
 
    outdot << ssDep.str();
 
-   outdot << "}" << endl; // digraph
+   outdot << "}" << std::endl; // digraph
 
    return kTRUE;
 }
@@ -932,18 +932,18 @@ Bool_t TClassDocOutput::CreateDotClassChartIncl(const char* filename) {
    */
 
    std::ofstream outdot(filename);
-   outdot << "strict digraph G {" << endl
-      << "ratio=compress;" << endl
-      << "rankdir=TB;" << endl
-      << "concentrate=true;" << endl
-      << "ranksep=0;" << endl
-      << "nodesep=0;" << endl
-      << "size=\"8,10\";" << endl
-      << "node [fontsize=20,shape=plaintext];" << endl;
+   outdot << "strict digraph G {" << std::endl
+      << "ratio=compress;" << std::endl
+      << "rankdir=TB;" << std::endl
+      << "concentrate=true;" << std::endl
+      << "ranksep=0;" << std::endl
+      << "nodesep=0;" << std::endl
+      << "size=\"8,10\";" << std::endl
+      << "node [fontsize=20,shape=plaintext];" << std::endl;
 
    for (std::list<std::string>::iterator iFile = listFilesToParse.begin();
       iFile != listFilesToParse.end(); ++iFile) {
-      ifstream in(filesToParse[*iFile].c_str());
+      std::ifstream in(filesToParse[*iFile].c_str());
       std::string line;
       while (in && !in.eof()) {
          std::getline(in, line);
@@ -972,13 +972,13 @@ Bool_t TClassDocOutput::CreateDotClassChartIncl(const char* filename) {
             listFilesToParse.push_back(line);
             filesToParse[line] = sysfilename;
             if (*iFile == implFileName.Data() || *iFile == declFileName.Data())
-               outdot << "\"" << *iFile << "\" [style=filled,fillcolor=lightgray];" << endl;
+               outdot << "\"" << *iFile << "\" [style=filled,fillcolor=lightgray];" << std::endl;
          }
-         outdot << "\"" << *iFile << "\" -> \"" << line << "\";" << endl;
+         outdot << "\"" << *iFile << "\" -> \"" << line << "\";" << std::endl;
       }
    }
 
-   outdot << "}" << endl; // digraph
+   outdot << "}" << std::endl; // digraph
 
    return kTRUE;
 }
@@ -991,18 +991,18 @@ Bool_t TClassDocOutput::CreateDotClassChartLib(const char* filename) {
 // Input: filename - output dot file incl. path
 
    std::ofstream outdot(filename);
-   outdot << "strict digraph G {" << endl
-      << "ratio=auto;" << endl
-      << "rankdir=RL;" << endl
-      << "compound=true;" << endl
-      << "constraint=false;" << endl
-      << "ranksep=0.7;" << endl
-      << "nodesep=0.3;" << endl
-      << "size=\"8,8\";" << endl
-      << "ratio=compress;" << endl;
+   outdot << "strict digraph G {" << std::endl
+      << "ratio=auto;" << std::endl
+      << "rankdir=RL;" << std::endl
+      << "compound=true;" << std::endl
+      << "constraint=false;" << std::endl
+      << "ranksep=0.7;" << std::endl
+      << "nodesep=0.3;" << std::endl
+      << "size=\"8,8\";" << std::endl
+      << "ratio=compress;" << std::endl;
 
    TString libs(fCurrentClass->GetSharedLibs());
-   outdot << "\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << endl;
+   outdot << "\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << std::endl;
 
    if (libs.Length()) {
       TString firstLib(libs);
@@ -1018,8 +1018,8 @@ Bool_t TClassDocOutput::CreateDotClassChartLib(const char* filename) {
             firstLib.Remove(posExt, firstLib.Length());
       }
 
-      outdot << "\"All Libraries\" -> \"" << firstLib << "\" [style=invis];" << endl;
-      outdot << "\"" << firstLib << "\" -> {" << endl;
+      outdot << "\"All Libraries\" -> \"" << firstLib << "\" [style=invis];" << std::endl;
+      outdot << "\"" << firstLib << "\" -> {" << std::endl;
 
       if (firstLib != "libCore")
          libs += " libCore";
@@ -1044,11 +1044,11 @@ Bool_t TClassDocOutput::CreateDotClassChartLib(const char* filename) {
          outdot << " \"" << thisLib << "\";";
          thisLib = "";
       }
-      outdot << "}" << endl; // dependencies
+      outdot << "}" << std::endl; // dependencies
    } else
-      outdot << "\"No rlibmap information avaliable.\"" << endl;
+      outdot << "\"No rlibmap information avaliable.\"" << std::endl;
 
-   outdot << "}" << endl; // digraph
+   outdot << "}" << std::endl; // digraph
 
    return kTRUE;
 }
@@ -1065,7 +1065,7 @@ void TClassDocOutput::CreateClassHierarchy(std::ostream& out, const char* docFil
    if (!bases || bases->IsEmpty())
       return;
 
-   out << "<hr />" << endl;
+   out << "<hr />" << std::endl;
 
    out << "<table><tr><td><ul><li><tt>";
    if (docFileName) {
@@ -1082,7 +1082,7 @@ void TClassDocOutput::CreateClassHierarchy(std::ostream& out, const char* docFil
    fHierarchyLines = 0;
    DescendHierarchy(out, fCurrentClass);
 
-   out << "</tr></table>" << endl;
+   out << "</tr></table>" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -1107,9 +1107,9 @@ Bool_t TClassDocOutput::CreateHierarchyDot()
       return kFALSE;
    }
 
-   dotout << "digraph G {" << endl
-          << "ratio=auto;" << endl
-          << "rankdir=RL;" << endl;
+   dotout << "digraph G {" << std::endl
+          << "ratio=auto;" << std::endl
+          << "rankdir=RL;" << std::endl;
 
    // loop on all classes
    TClassDocInfo* cdi = 0;
@@ -1136,10 +1136,10 @@ Bool_t TClassDocOutput::CreateHierarchyDot()
                dotout << "; ";
             dotout << "\"" << base->GetName() << "\"";
          }
-         dotout << "};" << endl;
+         dotout << "};" << std::endl;
       } else 
          // write out current class - no bases
-         dotout << "\"" << cdi->GetName() << "\";" << endl;
+         dotout << "\"" << cdi->GetName() << "\";" << std::endl;
 
    }
 
@@ -1156,13 +1156,13 @@ Bool_t TClassDocOutput::CreateHierarchyDot()
    Printf(fHtml->GetCounterFormat(), "", fHtml->GetCounter(), (filename + ".html").Data());
    // write out header
    WriteHtmlHeader(out, "Class Hierarchy");
-   out << "<h1>Class Hierarchy</h1>" << endl;
+   out << "<h1>Class Hierarchy</h1>" << std::endl;
 
    WriteSearch(out);
 
    RunDot(filename, &out);
 
-   out << "<img usemap=\"#Map" << title << "\" src=\"" << title << ".png\"/>" << endl;
+   out << "<img usemap=\"#Map" << title << "\" src=\"" << title << ".png\"/>" << std::endl;
    // write out footer
    WriteHtmlFooter(out);
    return kTRUE;
@@ -1211,7 +1211,7 @@ void TClassDocOutput::DescendHierarchy(std::ostream& out, TClass* basePtr, Int_t
 
    if (maxLines)
       if (fHierarchyLines >= maxLines) {
-         out << "<td></td>" << endl;
+         out << "<td></td>" << std::endl;
          return;
       }
 
@@ -1232,16 +1232,16 @@ void TClassDocOutput::DescendHierarchy(std::ostream& out, TClass* basePtr, Int_t
       if (!inheritFrom) continue;
 
       if (!numClasses)
-         out << "<td>&larr;</td><td><table><tr>" << endl;
+         out << "<td>&larr;</td><td><table><tr>" << std::endl;
       else
-         out << "</tr><tr>"<<endl;
+         out << "</tr><tr>"<<std::endl;
       fHierarchyLines++;
       numClasses++;
       UInt_t bgcolor=255-depth*8;
       out << "<td bgcolor=\""
           << Form("#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
           << "\">";
-      out << "<table><tr><td>" << endl;
+      out << "<table><tr><td>" << std::endl;
 
       TString htmlFile(cdi->GetHtmlFileName());
       if (htmlFile.Length()) {
@@ -1264,18 +1264,18 @@ void TClassDocOutput::DescendHierarchy(std::ostream& out, TClass* basePtr, Int_t
         out << classPtr->GetName();
         out << "\">";
         ReplaceSpecialChars(out, classPtr->GetTitle());
-        out << "</a></tt>" << endl;
+        out << "</a></tt>" << std::endl;
       */
 
-      out << "</td>" << endl;
+      out << "</td>" << std::endl;
       DescendHierarchy(out,classPtr,maxLines, depth+1);
-      out << "</tr></table></td>" << endl;
+      out << "</tr></table></td>" << std::endl;
 
    }  // loop over all classes
    if (numClasses)
-      out << "</tr></table></td>" << endl;
+      out << "</tr></table></td>" << std::endl;
    else
-      out << "<td></td>" << endl;
+      out << "<td></td>" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -1386,9 +1386,9 @@ void TClassDocOutput::WriteClassDescription(std::ostream& out, const TString& de
       } else
          ReplaceSpecialChars(out, inheritFrom->GetName());
    }
-   out << "</h1>" << endl;
+   out << "</h1>" << std::endl;
 
-   out << "<div class=\"classdescr\">" << endl;
+   out << "<div class=\"classdescr\">" << std::endl;
 
    if (description.Length())
       out << "<pre>" << description << "</pre>";
@@ -1415,13 +1415,13 @@ void TClassDocOutput::WriteClassDescription(std::ostream& out, const TString& de
 
    // create dot class charts or an html inheritance tree
    out << "<h2><a id=\"" << anchor
-      << ":Class_Charts\"></a>Class Charts</h2>" << endl;
+      << ":Class_Charts\"></a>Class Charts</h2>" << std::endl;
    if (!fHtml->IsNamespace(fCurrentClass))
       if (!ClassDotCharts(out))
          ClassHtmlTree(out, fCurrentClass);
 
    // header for the following function docs:
-   out << "<h2>Function documentation</h2>" << endl;
+   out << "<h2>Function documentation</h2>" << std::endl;
 }
 
 
@@ -1430,7 +1430,7 @@ void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
 {
    // Write out the introduction of a class description (shortcuts and links)
 
-   classFile << "<a name=\"TopOfPage\"></a>" << endl;
+   classFile << "<a name=\"TopOfPage\"></a>" << std::endl;
 
 
    // show box with lib, include
@@ -1460,15 +1460,15 @@ void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
       delete[] libDup;
    }
    classFile << "<script type=\"text/javascript\">WriteFollowPageBox('" 
-             << sTitle << "','" << sLib << "','" << sInclude << "');</script>" << endl;
+             << sTitle << "','" << sLib << "','" << sInclude << "');</script>" << std::endl;
 
    TString modulename;
    fHtml->GetModuleNameForClass(modulename, fCurrentClass);
    TModuleDocInfo* module = (TModuleDocInfo*) fHtml->GetListOfModules()->FindObject(modulename);
    WriteTopLinks(classFile, module, fCurrentClass->GetName(), kFALSE);
 
-   classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << endl // descrhead line 3
-      << "<span class=\"descrtitle\">Source:</span>" << endl;
+   classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 3
+      << "<span class=\"descrtitle\">Source:</span>" << std::endl;
 
    // make a link to the '.cxx' file
    TString classFileName(fCurrentClass->GetName());
@@ -1480,15 +1480,15 @@ void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
    fHtml->GetImplFileName(fCurrentClass, kFALSE, sourceFileName);
    if (headerFileName.Length())
       classFile << "<a class=\"descrheadentry\" href=\"src/" << classFileName
-                << ".h.html\">header file</a>" << endl;
+                << ".h.html\">header file</a>" << std::endl;
    else
-      classFile << "<a class=\"descrheadentry\"> </a>" << endl;
+      classFile << "<a class=\"descrheadentry\"> </a>" << std::endl;
 
    if (sourceFileName.Length())
       classFile << "<a class=\"descrheadentry\" href=\"src/" << classFileName
-                << ".cxx.html\">source file</a>" << endl;
+                << ".cxx.html\">source file</a>" << std::endl;
    else
-      classFile << "<a class=\"descrheadentry\"> </a>" << endl;
+      classFile << "<a class=\"descrheadentry\"> </a>" << std::endl;
 
    if (!fHtml->IsNamespace(fCurrentClass) && !fHtml->HaveDot()) {
       // make a link to the inheritance tree (postscript)
@@ -1561,21 +1561,21 @@ void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
       classFile << "<a class=\"descrheadentry\" href=\"" << wikiLink << "\">wiki</a> ";
    }
 
-   classFile << endl << "</div></div>" << endl; // descrhead line 3
+   classFile << std::endl << "</div></div>" << std::endl; // descrhead line 3
 
-   classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << endl // descrhead line 4
-      << "<span class=\"descrtitle\">Sections:</span>" << endl
+   classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 4
+      << "<span class=\"descrtitle\">Sections:</span>" << std::endl
       << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled;
    if (fHtml->IsNamespace(fCurrentClass))
       classFile << ":description\">namespace description</a> ";
    else
       classFile << ":description\">class description</a> ";
-   classFile << endl
-      << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Function_Members\">function members</a>" << endl
-      << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Data_Members\">data members</a>" << endl
-      << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Class_Charts\">class charts</a>" << endl
-      << "</div></div>" << endl // descrhead line 4
-      << "</div>" << endl; // toplinks, from TDocOutput::WriteTopLinks
+   classFile << std::endl
+      << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Function_Members\">function members</a>" << std::endl
+      << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Data_Members\">data members</a>" << std::endl
+      << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Class_Charts\">class charts</a>" << std::endl
+      << "</div></div>" << std::endl // descrhead line 4
+      << "</div>" << std::endl; // toplinks, from TDocOutput::WriteTopLinks
 
    WriteLocation(classFile, module, fCurrentClass->GetName());
 }
diff --git a/html/src/TDocOutput.cxx b/html/src/TDocOutput.cxx
index 8ce8eda8c35..7ff9b726097 100644
--- a/html/src/TDocOutput.cxx
+++ b/html/src/TDocOutput.cxx
@@ -326,9 +326,9 @@ void TDocOutput::Convert(std::istream& in, const char* infilename,
    WriteHtmlHeader(out, title, relpath);
 
    if (context && context[0])
-      out << context << endl;
+      out << context << std::endl;
    else if (title && title[0])
-      out << "<h1 class=\"convert\">" << title << "</h1>" << endl;
+      out << "<h1 class=\"convert\">" << title << "</h1>" << std::endl;
 
    Int_t numReuseCanvases = 0;
    if (includeOutput && !(includeOutput & THtml::kForceOutput)) {
@@ -542,30 +542,30 @@ void TDocOutput::Convert(std::istream& in, const char* infilename,
             }
          } // run script in this ROOT process
       }
-      out << "<table><tr><td style=\"vertical-align:top;padding-right:2em;\">" << endl;
+      out << "<table><tr><td style=\"vertical-align:top;padding-right:2em;\">" << std::endl;
    }
-   out << "<div class=\"listing\"><pre class=\"listing\">" << endl;
+   out << "<div class=\"listing\"><pre class=\"listing\">" << std::endl;
 
    TDocParser parser(*this);
    parser.Convert(out, in, relpath, (includeOutput) /* determines whether it's code or not */,
                   kFALSE /*interpretDirectives*/);
 
-   out << "</pre></div>" << endl;
+   out << "</pre></div>" << std::endl;
 
    WriteLineNumbers(out, parser.GetLineNumber(), gSystem->BaseName(infilename));
 
    if (includeOutput) {
-      out << "</td><td style=\"vertical-align:top;\">" << endl;
-      out << "<table>" << endl;
+      out << "</td><td style=\"vertical-align:top;\">" << std::endl;
+      out << "<table>" << std::endl;
       for (UInt_t i = 0; i < nCanvases; ++i) {
          TString pngname = TString::Format("%s_%d.png", gSystem->BaseName(outfilename), i);
-         out << "<tr><td><a href=\"" << pngname << "\">" << endl
+         out << "<tr><td><a href=\"" << pngname << "\">" << std::endl
              << "<img src=\"" << pngname << "\" id=\"canv" << i << "\" alt=\"thumb\" style=\"border:none;width:22em;\" "
-            "onmouseover=\"javascript:canv" << i << ".style.width='auto';\" />" << endl
-             << "</a></td></tr>" << endl;
+            "onmouseover=\"javascript:canv" << i << ".style.width='auto';\" />" << std::endl
+             << "</a></td></tr>" << std::endl;
          }
-      out << "</table>" << endl;
-      out << "</td></tr></table>" << endl;
+      out << "</table>" << std::endl;
+      out << "</td></tr></table>" << std::endl;
    }
 
    // write a HTML footer
@@ -657,7 +657,7 @@ void TDocOutput::CreateHierarchy()
 
    WriteTopLinks(out, 0);
 
-   out << "<h1>Class Hierarchy</h1>" << endl;
+   out << "<h1>Class Hierarchy</h1>" << std::endl;
 
 
    // loop on all classes
@@ -711,7 +711,7 @@ void TDocOutput::CreateClassIndex()
 
    WriteTopLinks(indexFile, 0);
 
-   indexFile << "<h1>Class Index</h1>" << endl;
+   indexFile << "<h1>Class Index</h1>" << std::endl;
 
    WriteModuleLinks(indexFile);
 
@@ -727,19 +727,19 @@ void TDocOutput::CreateClassIndex()
       }
 
       if (classNames.size() > 10) {
-         indexFile << "<div id=\"indxShortX\"><h4>Jump to</h4>" << endl;
+         indexFile << "<div id=\"indxShortX\"><h4>Jump to</h4>" << std::endl;
          // find index chars
          GetIndexChars(classNames, 50 /*sections*/, indexChars);
          for (UInt_t iIdxEntry = 0; iIdxEntry < indexChars.size(); ++iIdxEntry) {
             indexFile << "<a href=\"#idx" << iIdxEntry << "\">";
             ReplaceSpecialChars(indexFile, indexChars[iIdxEntry].c_str());
-            indexFile << "</a>" << endl;
+            indexFile << "</a>" << std::endl;
          }
-         indexFile << "</div><br />" << endl;
+         indexFile << "</div><br />" << std::endl;
       }
    }
 
-   indexFile << "<ul id=\"indx\">" << endl;
+   indexFile << "<ul id=\"indx\">" << std::endl;
 
    // loop on all classes
    UInt_t currentIndexEntry = 0;
@@ -780,10 +780,10 @@ void TDocOutput::CreateClassIndex()
 
       // write title == short doc
       ReplaceSpecialChars(indexFile, currentClass->GetTitle());
-      indexFile << "</li>" << endl;
+      indexFile << "</li>" << std::endl;
    }
 
-   indexFile << "</ul>" << endl;
+   indexFile << "</ul>" << std::endl;
 
    // write indexFile footer
    WriteHtmlFooter(indexFile);
@@ -803,15 +803,15 @@ void TDocOutput::CreateModuleIndex()
    gSystem->PrependPathName(fHtml->GetOutputDir(), dotfilename);
 
    std::ofstream libDepDotFile(dotfilename + ".dot");
-   libDepDotFile << "digraph G {" << endl
-                 << "ratio=compress;" << endl
-                 << "node [fontsize=22,labeldistance=0.1];" << endl
-                 << "edge [len=0.01];" << endl
-                 << "fontsize=22;" << endl
-                 << "size=\"16,16\";" << endl
-                 << "overlap=false;" << endl
-                 << "splines=true;" << endl
-                 << "K=0.1;" << endl;
+   libDepDotFile << "digraph G {" << std::endl
+                 << "ratio=compress;" << std::endl
+                 << "node [fontsize=22,labeldistance=0.1];" << std::endl
+                 << "edge [len=0.01];" << std::endl
+                 << "fontsize=22;" << std::endl
+                 << "size=\"16,16\";" << std::endl
+                 << "overlap=false;" << std::endl
+                 << "splines=true;" << std::endl
+                 << "K=0.1;" << std::endl;
 
    TModuleDocInfo* module = 0;
    TIter iterModule(fHtml->GetListOfModules());
@@ -843,7 +843,7 @@ void TDocOutput::CreateModuleIndex()
 
       WriteTopLinks(outputFile, module);
 
-      outputFile << "<h2>" << htmltitle << "</h2>" << endl;
+      outputFile << "<h2>" << htmltitle << "</h2>" << std::endl;
 
       // Module doc
       if (GetHtml()->GetModuleDocPath().Length()) {
@@ -934,10 +934,10 @@ void TDocOutput::CreateModuleIndex()
          }
 
          if (!count) {
-            outputFile << "<h2>Class Index</h2>" << endl;
+            outputFile << "<h2>Class Index</h2>" << std::endl;
 
             if (classNames.size() > 10) {
-               outputFile << "<div id=\"indxShortX\"><h4>Jump to</h4>" << endl;
+               outputFile << "<div id=\"indxShortX\"><h4>Jump to</h4>" << std::endl;
                UInt_t numSections = classNames.size() / 10;
                if (numSections < 10) numSections = 10;
                if (numSections > 50) numSections = 50;
@@ -946,12 +946,12 @@ void TDocOutput::CreateModuleIndex()
                for (UInt_t iIdxEntry = 0; iIdxEntry < indexChars.size(); ++iIdxEntry) {
                   outputFile << "<a href=\"#idx" << iIdxEntry << "\">";
                   ReplaceSpecialChars(outputFile, indexChars[iIdxEntry].c_str());
-                  outputFile << "</a>" << endl;
+                  outputFile << "</a>" << std::endl;
                }
-               outputFile << "</div><br />" << endl;
+               outputFile << "</div><br />" << std::endl;
             }
 
-            outputFile << "<ul id=\"indx\">" << endl;
+            outputFile << "<ul id=\"indx\">" << std::endl;
          }
 
          // write a classname to an index file
@@ -976,12 +976,12 @@ void TDocOutput::CreateModuleIndex()
 
          // write title
          ReplaceSpecialChars(outputFile, classPtr->GetTitle());
-         outputFile << "</li>" << endl;
+         outputFile << "</li>" << std::endl;
       }
 
 
       if (count)
-         outputFile << "</ul>" << endl;
+         outputFile << "</ul>" << std::endl;
 
       // write outputFile footer
       WriteHtmlFooter(outputFile);
@@ -990,12 +990,12 @@ void TDocOutput::CreateModuleIndex()
    // libCint is missing as we don't have class doc for it
    // We need it for dependencies nevertheless, so add it by hand.
    /*
-   sstrCluster << "subgraph clusterlibCint {" << endl
-      << "style=filled;" << endl
-      << "color=lightgray;" << endl
-      << "label=\"libCint\";" << endl
-      << "\"CINT\" [style=filled,color=white,fontsize=10]" << endl
-      << "}" << endl;
+   sstrCluster << "subgraph clusterlibCint {" << std::endl
+      << "style=filled;" << std::endl
+      << "color=lightgray;" << std::endl
+      << "label=\"libCint\";" << std::endl
+      << "\"CINT\" [style=filled,color=white,fontsize=10]" << std::endl
+      << "}" << std::endl;
    */
 
    // simplify the library dependencies, by removing direct links
@@ -1034,13 +1034,13 @@ void TDocOutput::CreateModuleIndex()
 
       const std::set<std::string>& modules = libinfo->GetModules();
       if (modules.size() > 1) {
-         sstrCluster << "subgraph cluster" << libinfo->GetName() << " {" << endl
-                     << "style=filled;" << endl
-                     << "color=lightgray;" << endl
+         sstrCluster << "subgraph cluster" << libinfo->GetName() << " {" << std::endl
+                     << "style=filled;" << std::endl
+                     << "color=lightgray;" << std::endl
                      << "label=\"";
          if (!strcmp(libinfo->GetName(), "libCore"))
             sstrCluster << "Everything depends on ";
-         sstrCluster << libinfo->GetName() << "\";" << endl;
+         sstrCluster << libinfo->GetName() << "\";" << std::endl;
 
          for (std::set<std::string>::const_iterator iModule = modules.begin();
               iModule != modules.end(); ++iModule) {
@@ -1048,10 +1048,10 @@ void TDocOutput::CreateModuleIndex()
             modURL.ReplaceAll("/", "_");
             modURL.ToUpper();
             sstrCluster << "\"" << *iModule << "\" [style=filled,color=white,URL=\""
-                        << modURL << "_Index.html\"];" << endl;
+                        << modURL << "_Index.html\"];" << std::endl;
          }
-         sstrCluster << endl
-                     << "}" << endl;
+         sstrCluster << std::endl
+                     << "}" << std::endl;
       } else {
          // only one module
          TString modURL(*modules.begin());
@@ -1060,14 +1060,14 @@ void TDocOutput::CreateModuleIndex()
          sstrCluster << "\"" << *modules.begin()
                      << "\" [label=\"" << libinfo->GetName()
                      << "\",style=filled,color=lightgray,shape=box,URL=\""
-                     << modURL << "_Index.html\"];" << endl;
+                     << modURL << "_Index.html\"];" << std::endl;
       }
 
       // GetSharedLib doesn't mention libCore or libCint; add them by hand
       /*
         if (iLibDep->first != "libCore")
-        sstrDeps << "\"" << iModule->first << "\" -> \"BASE\" [lhead=clusterlibCore];" << endl;
-        sstrDeps << "\"" << iModule->first << "\" -> \"CINT\" [lhead=clusterlibCint];" << endl;
+        sstrDeps << "\"" << iModule->first << "\" -> \"BASE\" [lhead=clusterlibCore];" << std::endl;
+        sstrDeps << "\"" << iModule->first << "\" -> \"CINT\" [lhead=clusterlibCint];" << std::endl;
       */
 
       const std::string& mod = *(modules.begin());
@@ -1081,15 +1081,15 @@ void TDocOutput::CreateModuleIndex()
             continue; // ouch!
 
          const std::string& moddep = *(depLibInfo->GetModules().begin());
-         sstrDeps << "\"" << mod << "\" -> \"" << moddep << "\";" << endl;
+         sstrDeps << "\"" << mod << "\" -> \"" << moddep << "\";" << std::endl;
       }
       // make sure libCore ends up at the bottom
-      sstrDeps << "\"" << mod <<  "\" -> \"CONT\" [style=invis];" << endl;
+      sstrDeps << "\"" << mod <<  "\" -> \"CONT\" [style=invis];" << std::endl;
    } // for libs
 
-   libDepDotFile << sstrCluster.str() << endl
+   libDepDotFile << sstrCluster.str() << std::endl
       << sstrDeps.str();
-   libDepDotFile << "}" << endl;
+   libDepDotFile << "}" << std::endl;
    libDepDotFile.close();
 
    std::ofstream out(dotfilename + ".html");
@@ -1105,11 +1105,11 @@ void TDocOutput::CreateModuleIndex()
 
    WriteTopLinks(out, 0);
 
-   out << "<h1>Library Dependencies</h1>" << endl;
+   out << "<h1>Library Dependencies</h1>" << std::endl;
 
    RunDot(dotfilename, &out, kFdp);
 
-   out << "<img alt=\"Library Dependencies\" class=\"classcharts\" usemap=\"#Map" << title << "\" src=\"" << title << ".png\"/>" << endl;
+   out << "<img alt=\"Library Dependencies\" class=\"classcharts\" usemap=\"#Map" << title << "\" src=\"" << title << ".png\"/>" << std::endl;
 
    // write out footer
    WriteHtmlFooter(out);
@@ -1194,7 +1194,7 @@ void TDocOutput::CreateClassTypeDefs()
 
          WriteHtmlHeader(outfile, dt->GetName());
 
-         outfile << "<a name=\"TopOfPage\"></a>" << endl;
+         outfile << "<a name=\"TopOfPage\"></a>" << std::endl;
 
          TString dtName(dt->GetName());
          ReplaceSpecialChars(dtName);
@@ -1223,7 +1223,7 @@ void TDocOutput::CreateClassTypeDefs()
                delete[] libDup;
             }
             outfile << "<script type=\"text/javascript\">WriteFollowPageBox('"
-                    << sTitle << "','" << sLib << "','" << sInclude << "');</script>" << endl;
+                    << sTitle << "','" << sLib << "','" << sInclude << "');</script>" << std::endl;
          }
 
          TString modulename;
@@ -1232,19 +1232,19 @@ void TDocOutput::CreateClassTypeDefs()
          WriteTopLinks(outfile, module, dt->GetName());
 
          outfile << "<div class=\"dropshadow\"><div class=\"withshadow\">";
-         outfile << "<h1>" << sTitle << "</h1>" << endl
-            << "<div class=\"classdescr\">" << endl;
+         outfile << "<h1>" << sTitle << "</h1>" << std::endl
+            << "<div class=\"classdescr\">" << std::endl;
 
          outfile << dtName << " is a typedef to ";
          std::string shortClsName(fHtml->ShortType(cdi->GetName()));
          parser.DecorateKeywords(outfile, shortClsName.c_str());
-         outfile << endl
+         outfile << std::endl
             << "</div>" << std::endl
             << "</div></div><div style=\"clear:both;\"></div>" << std::endl;
 
          // the typedef isn't a data member, but the CSS is applicable nevertheless
-         outfile << endl << "<div id=\"datamembers\">" << endl
-            << "<table class=\"data\" cellspacing=\"0\">" << endl;
+         outfile << std::endl << "<div id=\"datamembers\">" << std::endl
+            << "<table class=\"data\" cellspacing=\"0\">" << std::endl;
          outfile << "<tr class=\"data";
          outfile << "\"><td class=\"datatype\">typedef ";
          parser.DecorateKeywords(outfile, dt->GetFullTypeName());
@@ -1254,8 +1254,8 @@ void TDocOutput::CreateClassTypeDefs()
             outfile << "</td><td class=\"datadesc\">";
             ReplaceSpecialChars(outfile, dt->GetTitle());
          } else outfile << "</td><td>";
-         outfile << "</td></tr>" << endl
-            << "</table></div>" << endl;
+         outfile << "</td></tr>" << std::endl
+            << "</table></div>" << std::endl;
 
          // write footer
          WriteHtmlFooter(outfile);
@@ -1283,9 +1283,9 @@ void TDocOutput::CreateTypeIndex()
 
    // write typesList header
    WriteHtmlHeader(typesList, "List of data types");
-   typesList << "<h2> List of data types </h2>" << endl;
+   typesList << "<h2> List of data types </h2>" << std::endl;
 
-   typesList << "<dl><dd>" << endl;
+   typesList << "<dl><dd>" << std::endl;
 
    // make loop on data types
    std::vector<std::string> typeNames(gROOT->GetListOfTypes()->GetSize());
@@ -1308,18 +1308,18 @@ void TDocOutput::CreateTypeIndex()
 
    std::vector<std::string> indexChars;
    if (typeNames.size() > 10) {
-      typesList << "<div id=\"indxShortX\"><h4>Jump to</h4>" << endl;
+      typesList << "<div id=\"indxShortX\"><h4>Jump to</h4>" << std::endl;
       // find index chars
       GetIndexChars(typeNames, 10 /*sections*/, indexChars);
       for (UInt_t iIdxEntry = 0; iIdxEntry < indexChars.size(); ++iIdxEntry) {
          typesList << "<a href=\"#idx" << iIdxEntry << "\">";
          ReplaceSpecialChars(typesList, indexChars[iIdxEntry].c_str());
-         typesList << "</a>" << endl;
+         typesList << "</a>" << std::endl;
       }
-      typesList << "</div><br />" << endl;
+      typesList << "</div><br />" << std::endl;
    }
 
-   typesList << "<ul id=\"indx\">" << endl;
+   typesList << "<ul id=\"indx\">" << std::endl;
 
    int idx = 0;
    UInt_t currentIndexEntry = 0;
@@ -1331,17 +1331,17 @@ void TDocOutput::CreateTypeIndex()
       if (currentIndexEntry < indexChars.size()
          && !strncmp(indexChars[currentIndexEntry].c_str(), iTypeName->c_str(),
                      indexChars[currentIndexEntry].length()))
-         typesList << "<a name=\"idx" << currentIndexEntry++ << "\"></a>" << endl;
+         typesList << "<a name=\"idx" << currentIndexEntry++ << "\"></a>" << std::endl;
       typesList << "<a name=\"";
       ReplaceSpecialChars(typesList, iTypeName->c_str());
       typesList << "\"><span class=\"typename\">";
       ReplaceSpecialChars(typesList, iTypeName->c_str());
       typesList << "</span></a> ";
       ReplaceSpecialChars(typesList, type->GetTitle());
-      typesList << "</li>" << endl;
+      typesList << "</li>" << std::endl;
       ++idx;
    }
-   typesList << "</ul>" << endl;
+   typesList << "</ul>" << std::endl;
 
    // write typesList footer
    WriteHtmlFooter(typesList);
@@ -1702,7 +1702,7 @@ void TDocOutput::ProcessDocInDir(std::ostream& out, const char* indir,
             TString line;
             while (in) {
                if (!line.ReadLine(in)) break;
-               out << line << endl;
+               out << line << std::endl;
             }
          } else
             files.push_back(filename.Data());
@@ -1753,13 +1753,13 @@ void TDocOutput::ProcessDocInDir(std::ostream& out, const char* indir,
       showname.Remove(showname.Length() - 5, 5); // .html
       showname.ReplaceAll("_", " ");
       ReplaceSpecialChars(furtherReading, showname);
-      furtherReading << "</a> " << endl;
+      furtherReading << "</a> " << std::endl;
    }
 
    gSystem->FreeDirectory(dirHandle);
    if (furtherReading.str().length())
-      out << "<h3>Further Reading</h3><div id=\"furtherreading\">" << endl
-          << furtherReading.str() << "</div><h3>List of Classes</h3>" << endl;
+      out << "<h3>Further Reading</h3><div id=\"furtherreading\">" << std::endl
+          << furtherReading.str() << "</div><h3>List of Classes</h3>" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -2059,22 +2059,22 @@ Bool_t TDocOutput::RunDot(const char* filename, std::ostream* outMap /* =0 */,
       gSystem->Unlink(Form("%s.dot", filename));
 
    if (!retDot && outMap) {
-      ifstream inmap(Form("%s.map", filename));
+      std::ifstream inmap(Form("%s.map", filename));
       std::string line;
       std::getline(inmap, line);
       if (inmap && !inmap.eof()) {
          *outMap << "<map name=\"Map" << gSystem->BaseName(filename)
-            << "\" id=\"Map" << gSystem->BaseName(filename) << "\">" << endl;
+            << "\" id=\"Map" << gSystem->BaseName(filename) << "\">" << std::endl;
          while (inmap && !inmap.eof()) {
             if (line.compare(0, 6, "<area ") == 0) {
                size_t posEndTag = line.find('>');
                if (posEndTag != std::string::npos)
                   line.replace(posEndTag, 1, "/>");
             }
-            *outMap << line << endl;
+            *outMap << line << std::endl;
             std::getline(inmap, line);
          }
-         *outMap << "</map>" << endl;
+         *outMap << "</map>" << std::endl;
       }
       inmap.close();
       if (gDebug < 7)
@@ -2100,7 +2100,7 @@ void TDocOutput::WriteHtmlHeader(std::ostream& out, const char *titleNoSpecial,
 //
 // Internal method invoked by the overload
 
-   ifstream addHeaderFile(header);
+   std::ifstream addHeaderFile(header);
 
    if (!addHeaderFile.good()) {
       Warning("THtml::WriteHtmlHeader",
@@ -2145,7 +2145,7 @@ void TDocOutput::WriteHtmlHeader(std::ostream& out, const char *titleNoSpecial,
             txt.ReplaceAll("%SRCFILE%", implFileName);
          }
 
-         out << txt << endl;
+         out << txt << std::endl;
       }
    }
 }
@@ -2220,7 +2220,7 @@ void TDocOutput::WriteHtmlFooter(std::ostream& out, const char* /*dir*/,
    }
    const char* siValues[TDocParser::kNumSourceInfos] = { lastUpdate, author, copyright, lastUpdate, today };
 
-   ifstream addFooterFile(footer);
+   std::ifstream addFooterFile(footer);
 
    if (!addFooterFile.good()) {
       Warning("THtml::WriteHtmlFooter",
@@ -2278,7 +2278,7 @@ void TDocOutput::WriteHtmlFooter(std::ostream& out, const char *dir,
 // If no author is set (author == "", e.g. for ClassIndex.html") skip the whole
 // line of the footer template containing %AUTHOR%. Accordingly for %COPYRIGHT%.
 
-   out << endl;
+   out << std::endl;
 
    TString userFooter = GetHtml()->GetFooter();
 
@@ -2302,7 +2302,7 @@ void TDocOutput::WriteModuleLinks(std::ostream& out)
    // Create a div containing links to all topmost modules
 
    if (fHtml->GetListOfModules()->GetSize()) {
-      out << "<div id=\"indxModules\"><h4>Modules</h4>" << endl;
+      out << "<div id=\"indxModules\"><h4>Modules</h4>" << std::endl;
       // find index chars
       fHtml->SortListOfModules();
       TIter iModule(fHtml->GetListOfModules());
@@ -2314,10 +2314,10 @@ void TDocOutput::WriteModuleLinks(std::ostream& out)
             TString name(module->GetName());
             name.ToUpper();
             out << "<a href=\"" << name << "_Index.html\">"
-                << name << "</a>" << endl;
+                << name << "</a>" << std::endl;
          }
       }
-      out<< "</div><br />" << endl;
+      out<< "</div><br />" << std::endl;
    }
 }
 
@@ -2348,7 +2348,7 @@ void TDocOutput::WriteModuleLinks(std::ostream& out, TModuleDocInfo* super)
    if (super->GetSub().GetSize()) {
       TString superName(super->GetName());
       superName.ToUpper();
-      out << "<div id=\"indxModules\"><h4>" << superName << " Modules</h4>" << endl;
+      out << "<div id=\"indxModules\"><h4>" << superName << " Modules</h4>" << std::endl;
       // find index chars
       super->GetSub().Sort();
       TIter iModule(&super->GetSub());
@@ -2362,10 +2362,10 @@ void TDocOutput::WriteModuleLinks(std::ostream& out, TModuleDocInfo* super)
             Ssiz_t posSlash = name.Last('/');
             if (posSlash != kNPOS)
                name.Remove(0, posSlash + 1);
-            out << "<a href=\"" << link << "_Index.html\">" << name << "</a>" << endl;
+            out << "<a href=\"" << link << "_Index.html\">" << name << "</a>" << std::endl;
          }
       }
-      out<< "</div><br />" << endl;
+      out<< "</div><br />" << std::endl;
    }
 }
 
@@ -2390,20 +2390,20 @@ void TDocOutput::WriteSearch(std::ostream& out)
          serverName += "\" ";
       }
       // create search input
-      out << "<script type=\"text/javascript\">" << endl
-          << "function onSearch() {" << endl
-          << "var s='" << searchCmd <<"';" << endl
-          << "var ref=String(document.location.href).replace(/https?:\\/\\//,'').replace(/\\/[^\\/]*$/,'').replace(/\\//g,'%2F');" << endl
-          << "window.location.href=s.replace(/%u/ig,ref).replace(/%s/ig,escape(document.searchform.t.value));" << endl
-          << "return false;}" << endl
-          << "</script>" << endl
-          << "<form id=\"searchform\" name=\"searchform\" onsubmit=\"return onSearch()\" action=\"javascript:onSearch();\" method=\"post\">" << endl
-          << "<input name=\"t\" size=\"30\" value=\"Search documentation...\" onfocus=\"if (document.searchform.t.value=='Search documentation...') document.searchform.t.value='';\"></input>" << endl
-          << "<a id=\"searchlink\" " << serverName << " href=\"javascript:onSearch();\" onclick=\"return onSearch()\">Search</a></form>" << endl;
+      out << "<script type=\"text/javascript\">" << std::endl
+          << "function onSearch() {" << std::endl
+          << "var s='" << searchCmd <<"';" << std::endl
+          << "var ref=String(document.location.href).replace(/https?:\\/\\//,'').replace(/\\/[^\\/]*$/,'').replace(/\\//g,'%2F');" << std::endl
+          << "window.location.href=s.replace(/%u/ig,ref).replace(/%s/ig,escape(document.searchform.t.value));" << std::endl
+          << "return false;}" << std::endl
+          << "</script>" << std::endl
+          << "<form id=\"searchform\" name=\"searchform\" onsubmit=\"return onSearch()\" action=\"javascript:onSearch();\" method=\"post\">" << std::endl
+          << "<input name=\"t\" size=\"30\" value=\"Search documentation...\" onfocus=\"if (document.searchform.t.value=='Search documentation...') document.searchform.t.value='';\"></input>" << std::endl
+          << "<a id=\"searchlink\" " << serverName << " href=\"javascript:onSearch();\" onclick=\"return onSearch()\">Search</a></form>" << std::endl;
    } else if (searchEngine.Length())
       // create link to search engine page
       out << "<a class=\"descrheadentry\" href=\"" << searchEngine
-          << "\">Search the Class Reference Guide</a>" << endl;
+          << "\">Search the Class Reference Guide</a>" << std::endl;
 }
 
 
@@ -2411,9 +2411,9 @@ void TDocOutput::WriteSearch(std::ostream& out)
 void TDocOutput::WriteLocation(std::ostream& out, TModuleDocInfo* module, const char* classname)
 {
    // make a link to the description
-   out << "<div class=\"location\">" << endl; // location
+   out << "<div class=\"location\">" << std::endl; // location
    const char *productName = fHtml->GetProductName();
-   out << "<a class=\"locationlevel\" href=\"index.html\">" << productName << "</a>" << endl;
+   out << "<a class=\"locationlevel\" href=\"index.html\">" << productName << "</a>" << std::endl;
 
    if (module) {
       TString modulename(module->GetName());
@@ -2427,7 +2427,7 @@ void TDocOutput::WriteLocation(std::ostream& out, TModuleDocInfo* module, const
             break;
          if (modulePath.Length()) modulePath += "_";
          modulePath += modulePart;
-         out << " &#187; <a class=\"locationlevel\" href=\"./" << modulePath << "_Index.html\">" << modulePart << "</a>" << endl;
+         out << " &#187; <a class=\"locationlevel\" href=\"./" << modulePath << "_Index.html\">" << modulePart << "</a>" << std::endl;
       }
    }
 
@@ -2443,9 +2443,9 @@ void TDocOutput::WriteLocation(std::ostream& out, TModuleDocInfo* module, const
    if (entityName.Length()) {
       out << " &#187; <a class=\"locationlevel\" href=\"#TopOfPage\">";
       ReplaceSpecialChars(out, entityName);
-      out << "</a>" << endl;
+      out << "</a>" << std::endl;
    }
-   out << "</div>" << endl; // location
+   out << "</div>" << std::endl; // location
 }
 
 
@@ -2457,10 +2457,10 @@ void TDocOutput::WriteTopLinks(std::ostream& out, TModuleDocInfo* module, const
    // one <div> has to be closed by caller so additional items can still
    // be added.
 
-   out << "<div id=\"toplinks\">" << endl;
+   out << "<div id=\"toplinks\">" << std::endl;
 
-   out << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << endl // descrhead line 1
-      << "<span class=\"descrtitle\">Quick Links:</span>" << endl;
+   out << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 1
+      << "<span class=\"descrtitle\">Quick Links:</span>" << std::endl;
 
    // link to the user home page (if exist)
    const char* userHomePage = GetHtml()->GetHomepage();
@@ -2471,20 +2471,20 @@ void TDocOutput::WriteTopLinks(std::ostream& out, TModuleDocInfo* module, const
       userHomePage = "";
    }
    if (userHomePage && *userHomePage)
-      out << "<a class=\"descrheadentry\" href=\"" << userHomePage << "\">" << productName << "</a>" << endl;
-   out << "<a class=\"descrheadentry\" href=\"http://root.cern.ch\">ROOT Homepage</a>" << endl
-      << "<a class=\"descrheadentry\" href=\"./ClassIndex.html\">Class Index</a>" << endl
-      << "<a class=\"descrheadentry\" href=\"./ClassHierarchy.html\">Class Hierarchy</a></div>" << endl;
+      out << "<a class=\"descrheadentry\" href=\"" << userHomePage << "\">" << productName << "</a>" << std::endl;
+   out << "<a class=\"descrheadentry\" href=\"http://root.cern.ch\">ROOT Homepage</a>" << std::endl
+      << "<a class=\"descrheadentry\" href=\"./ClassIndex.html\">Class Index</a>" << std::endl
+      << "<a class=\"descrheadentry\" href=\"./ClassHierarchy.html\">Class Hierarchy</a></div>" << std::endl;
    WriteSearch(out);
-   out << "</div>" << endl; // descrhead, line 1
+   out << "</div>" << std::endl; // descrhead, line 1
 
    if (withLocation) {
-      out << "</div>" << endl; //toplinks
+      out << "</div>" << std::endl; //toplinks
       WriteLocation(out, module, classname); // descrhead line 2
    }
    // else {
    //    Closed by caller!
-   //    out << "</div>" << endl; // toplinks
+   //    out << "</div>" << std::endl; // toplinks
    // }
 
 }
diff --git a/html/src/TDocParser.cxx b/html/src/TDocParser.cxx
index 0e48c612e3f..f50bb35aaec 100644
--- a/html/src/TDocParser.cxx
+++ b/html/src/TDocParser.cxx
@@ -419,16 +419,16 @@ void TDocParser::Convert(std::ostream& out, std::istream& in, const char* relpat
          // Only write the raw, uninterpreted directive code:
          if (!InContext(kDirective)) {
             GetDocOutput()->AdjustSourcePath(fLineSource, relpath);
-            out << fLineSource << endl;
+            out << fLineSource << std::endl;
          }
       } else {
          // Write source for source and interpreted directives if they exist.
          if (fLineComment.Length() ) { 	 
             GetDocOutput()->AdjustSourcePath(fLineComment, relpath); 	 
-            out << fLineComment << endl; 	 
+            out << fLineComment << std::endl; 	 
          } else if (!InContext(kDirective)) {
             GetDocOutput()->AdjustSourcePath(fLineSource, relpath);
-            out << fLineSource << endl;
+            out << fLineSource << std::endl;
          }
       }
    }
@@ -1607,7 +1607,7 @@ void TDocParser::LocateMethods(std::ostream& out, const char* filename,
          sourceFileName.Data(), fCurrentClass->GetName());
       return;
    }
-   ifstream sourceFile(sourceFileName.Data());
+   std::ifstream sourceFile(sourceFileName.Data());
    if (!sourceFile || !sourceFile.good()) {
       Error("LocateMethods", "Can't open file '%s' for reading!", sourceFileName.Data());
       return;
diff --git a/html/src/THtml.cxx b/html/src/THtml.cxx
index c7cccd10710..48472e89430 100644
--- a/html/src/THtml.cxx
+++ b/html/src/THtml.cxx
@@ -1492,8 +1492,8 @@ void THtml::Convert(const char *filename, const char *title,
    cRealFilename = 0;
 
    // open source file
-   ifstream sourceFile;
-   sourceFile.open(realFilename, ios::in);
+   std::ifstream sourceFile;
+   sourceFile.open(realFilename, std::ios::in);
 
    if (!sourceFile.good()) {
       Error("Convert", "Can't open file '%s' !", realFilename.Data());
diff --git a/io/io/src/TDirectoryFile.cxx b/io/io/src/TDirectoryFile.cxx
index efafe4df398..d102f9adceb 100644
--- a/io/io/src/TDirectoryFile.cxx
+++ b/io/io/src/TDirectoryFile.cxx
@@ -1050,7 +1050,7 @@ void TDirectoryFile::ls(Option_t *option) const
 //  By default memory and disk objects are listed.
 //
    TROOT::IndentLevel();
-   cout <<ClassName()<<"*\t\t"<<GetName()<<"\t"<<GetTitle()<<endl;
+   std::cout <<ClassName()<<"*\t\t"<<GetName()<<"\t"<<GetTitle()<<std::endl;
    TROOT::IncreaseDirLevel();
 
    TString opta = option;
diff --git a/io/io/src/TEmulatedCollectionProxy.cxx b/io/io/src/TEmulatedCollectionProxy.cxx
index 430adccf534..2ae98bf5d63 100644
--- a/io/io/src/TEmulatedCollectionProxy.cxx
+++ b/io/io/src/TEmulatedCollectionProxy.cxx
@@ -39,7 +39,7 @@
 //
 
 static TStreamerElement* R__CreateEmulatedElement(const char *dmName, const char *dmFull, Int_t offset);
-static TStreamerInfo *R__GenerateTClassForPair(const string &f, const string &s);
+static TStreamerInfo *R__GenerateTClassForPair(const std::string &f, const std::string &s);
 
 TEmulatedCollectionProxy::TEmulatedCollectionProxy(const TEmulatedCollectionProxy& copy)
    : TGenCollectionProxy(copy)
@@ -652,9 +652,9 @@ static TStreamerElement* R__CreateEmulatedElement(const char *dmName, const char
 }
 
 
-static TStreamerInfo *R__GenerateTClassForPair(const string &fname, const string &sname)
+static TStreamerInfo *R__GenerateTClassForPair(const std::string &fname, const std::string &sname)
 {
-   // Generate a TStreamerInfo for a pair<fname,sname>
+   // Generate a TStreamerInfo for a std::pair<fname,sname>
    // This TStreamerInfo is then used as if it was read from a file to generate
    // and emulated TClass.
    
diff --git a/io/io/src/TFile.cxx b/io/io/src/TFile.cxx
index e636de70930..fdc4a6cff7e 100644
--- a/io/io/src/TFile.cxx
+++ b/io/io/src/TFile.cxx
@@ -276,7 +276,7 @@ TFile::TFile(const char *fname1, Option_t *option, const char *ftitle, Int_t com
    // it is made a Zombie. One can detect this situation with a code like:
    //    TFile f("file.root");
    //    if (f.IsZombie()) {
-   //       cout << "Error opening file" << endl;
+   //       std::cout << "Error opening file" << std::endl;
    //       exit(-1);
    //    }
    //
@@ -1267,7 +1267,7 @@ void TFile::ls(Option_t *option) const
    // then objects on the file.
 
    TROOT::IndentLevel();
-   cout <<ClassName()<<"**\t\t"<<GetName()<<"\t"<<GetTitle()<<endl;
+   std::cout <<ClassName()<<"**\t\t"<<GetName()<<"\t"<<GetTitle()<<std::endl;
    TROOT::IncreaseDirLevel();
    TDirectoryFile::ls(option);
    TROOT::DecreaseDirLevel();
@@ -2340,7 +2340,7 @@ void TFile::MakeProject(const char *dirname, const char * /*classes*/,
    //    dirnameProjectSource.cxx // contains all the constructors and destructors implementation.
    // and one header per class that is not nested inside another class.
    // The header file name is the fully qualified name of the class after all the special characters
-   // "<>,:" are replaced by underscored.  For example for pair<edm::Vertex,int> the file name is
+   // "<>,:" are replaced by underscored.  For example for std::pair<edm::Vertex,int> the file name is
    // pair_edm__Vertex_int_.h
    //
    // In the generated classes, map, multimap when the first template parameter is a class
@@ -2528,6 +2528,7 @@ void TFile::MakeProject(const char *dirname, const char * /*classes*/,
       Error("MakeProject","Unable to create the source file %s.",spath.Data());
       return;
    }
+   fprintf(sfp, "namespace std {}\nusing namespace std;\n");
    fprintf(sfp, "#include \"%sProjectHeaders.h\"\n\n",subdirname.Data() );
    if (!genreflex) fprintf(sfp, "#include \"%sLinkDef.h\"\n\n",subdirname.Data() );
    fprintf(sfp, "#include \"%sProjectDict.cxx\"\n\n",subdirname.Data() );
diff --git a/io/io/src/TFree.cxx b/io/io/src/TFree.cxx
index c5b1c0efc3e..188b6d8e02e 100644
--- a/io/io/src/TFree.cxx
+++ b/io/io/src/TFree.cxx
@@ -156,7 +156,7 @@ void TFree::ls(Option_t *) const
 {
    // List free segment contents.
 
-   cout <<"Free Segment: "<<fFirst<<"\t"<<fLast<<endl;
+   std::cout <<"Free Segment: "<<fFirst<<"\t"<<fLast<<std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/io/io/src/TGenCollectionProxy.cxx b/io/io/src/TGenCollectionProxy.cxx
index 3a4e3030135..3b38a1ee76b 100644
--- a/io/io/src/TGenCollectionProxy.cxx
+++ b/io/io/src/TGenCollectionProxy.cxx
@@ -118,7 +118,7 @@ public:
    {
       // Return the address of the value at index 'idx'
       
-      // However we can 'take' the address of the content of vector<bool>.
+      // However we can 'take' the address of the content of std::vector<bool>.
       if ( fEnv && fEnv->fObject ) {
          switch( idx ) {
             case 0:
@@ -176,7 +176,7 @@ public:
    {
       // Return the address of the value at index 'idx'
       
-      // However we can 'take' the address of the content of vector<bool>.
+      // However we can 'take' the address of the content of std::vector<bool>.
       if ( fEnv && fEnv->fObject ) {
          switch( idx ) {
             case 0:
diff --git a/io/io/src/TKey.cxx b/io/io/src/TKey.cxx
index e9ba3263cdc..d334b25e055 100644
--- a/io/io/src/TKey.cxx
+++ b/io/io/src/TKey.cxx
@@ -158,7 +158,7 @@ TKey::TKey(TDirectory* motherDir, const TKey &orig, UShort_t pidOffset) : TNamed
          return;
       }
       if (gDebug) {
-         cout << "TKey Reading "<<nsize<< " bytes at address "<<fSeekKey<<endl;
+         std::cout << "TKey Reading "<<nsize<< " bytes at address "<<fSeekKey<<std::endl;
       }
    }
    fBuffer += bufferDecOffset; // Reset the buffer to be appropriate for this key.
@@ -672,7 +672,7 @@ void TKey::ls(Option_t *) const
    // List Key contents.
 
    TROOT::IndentLevel();
-   cout <<"KEY: "<<fClassName<<"\t"<<GetName()<<";"<<GetCycle()<<"\t"<<GetTitle()<<endl;
+   std::cout <<"KEY: "<<fClassName<<"\t"<<GetName()<<";"<<GetCycle()<<"\t"<<GetTitle()<<std::endl;
 }
 
 //______________________________________________________________________________
@@ -1258,7 +1258,7 @@ Bool_t TKey::ReadFile()
    }
 #endif
    if (gDebug) {
-      cout << "TKey Reading "<<nsize<< " bytes at address "<<fSeekKey<<endl;
+      std::cout << "TKey Reading "<<nsize<< " bytes at address "<<fSeekKey<<std::endl;
    }
    return kTRUE;
 }
@@ -1441,8 +1441,8 @@ Int_t TKey::WriteFile(Int_t cycle, TFile* f)
    //f->Flush(); Flushing takes too much time.
    //            Let user flush the file when he wants.
    if (gDebug) {
-      cout <<"   TKey Writing "<<nsize<< " bytes at address "<<fSeekKey
-           <<" for ID= " <<GetName()<<" Title= "<<GetTitle()<<endl;
+      std::cout <<"   TKey Writing "<<nsize<< " bytes at address "<<fSeekKey
+           <<" for ID= " <<GetName()<<" Title= "<<GetTitle()<<std::endl;
    }
 
    DeleteBuffer();
@@ -1477,8 +1477,8 @@ Int_t TKey::WriteFileKeepBuffer(TFile *f)
    //f->Flush(); Flushing takes too much time.
    //            Let user flush the file when he wants.
    if (gDebug) {
-      cout <<"   TKey Writing "<<nsize<< " bytes at address "<<fSeekKey
-      <<" for ID= " <<GetName()<<" Title= "<<GetTitle()<<endl;
+      std::cout <<"   TKey Writing "<<nsize<< " bytes at address "<<fSeekKey
+      <<" for ID= " <<GetName()<<" Title= "<<GetTitle()<<std::endl;
    }
    
    return result==kTRUE ? -1 : nsize;
diff --git a/io/sql/src/TBufferSQL2.cxx b/io/sql/src/TBufferSQL2.cxx
index b4b79a72426..e39c37027eb 100644
--- a/io/sql/src/TBufferSQL2.cxx
+++ b/io/sql/src/TBufferSQL2.cxx
@@ -185,9 +185,9 @@ TSQLStructure* TBufferSQL2::SqlWriteAny(const void* obj, const TClass* cl, Long6
 
    if (gDebug>3)
       if (fStructure!=0) {
-         cout << "==== Printout of Sql structures ===== " << endl;
+         std::cout << "==== Printout of Sql structures ===== " << std::endl;
          fStructure->Print("*");
-         cout << "=========== End printout ============ " << endl;
+         std::cout << "=========== End printout ============ " << std::endl;
       }
 
    return fStructure;
@@ -336,7 +336,7 @@ Int_t TBufferSQL2::SqlWriteObject(const void* obj, const TClass* cl, TMemberStre
    // Return id of saved object
 
    if (gDebug>1)
-      cout << " SqlWriteObject " << obj << " : cl = " << (cl ? cl->GetName() : "null") << endl;
+      std::cout << " SqlWriteObject " << obj << " : cl = " << (cl ? cl->GetName() : "null") << std::endl;
 
    PushStack();
 
@@ -355,7 +355,7 @@ Int_t TBufferSQL2::SqlWriteObject(const void* obj, const TClass* cl, TMemberStre
    }
 
    if (gDebug>1)
-      cout << "    Find objectid = " << objid << endl;
+      std::cout << "    Find objectid = " << objid << std::endl;
 
    if (objid>=0) {
       Stack()->SetObjectPointer(objid);
@@ -378,7 +378,7 @@ Int_t TBufferSQL2::SqlWriteObject(const void* obj, const TClass* cl, TMemberStre
       ((TClass*)cl)->Streamer((void*)obj, *this);
 
    if (gDebug>1)
-      cout << "Done write of " << cl->GetName() << endl;
+      std::cout << "Done write of " << cl->GetName() << std::endl;
 
    PopStack();
 
@@ -434,8 +434,8 @@ void* TBufferSQL2::SqlReadObject(void* obj, TClass** cl, TMemberStreamer *stream
    }
 
    if ((gDebug>3) && findptr)
-      cout << "    Found pointer " << (obj ? obj : 0)
-           << " class = " << ((cl && *cl) ? (*cl)->GetName() : "null") << endl;
+      std::cout << "    Found pointer " << (obj ? obj : 0)
+           << " class = " << ((cl && *cl) ? (*cl)->GetName() : "null") << std::endl;
 
    if (findptr) {
       fCurrentData->ShiftToNextValue();
@@ -452,7 +452,7 @@ void* TBufferSQL2::SqlReadObject(void* obj, TClass** cl, TMemberStreamer *stream
    fCurrentData->ShiftToNextValue();
 
    if ((gDebug>2) || (objid<0))
-      cout << "Found object reference " << objid << endl;
+      std::cout << "Found object reference " << objid << std::endl;
 
    return SqlReadObjectDirect(obj, cl, objid, streamer, streamer_index, onFileClass);
 }
@@ -531,7 +531,7 @@ void* TBufferSQL2::SqlReadObjectDirect(void* obj, TClass** cl, Long64_t objid, T
    PopStack();
 
    if (gDebug>1)
-      cout << "Read object of class " << objClass->GetName() << " done" << endl << endl;
+      std::cout << "Read object of class " << objClass->GetName() << " done" << std::endl << std::endl;
 
    if (cl!=0) *cl = objClass;
 
@@ -553,7 +553,7 @@ void  TBufferSQL2::IncrementLevel(TVirtualStreamerInfo* info)
    PushStack()->SetStreamerInfo((TStreamerInfo*)info);
 
    if (gDebug>2)
-      cout << " IncrementLevel " << info->GetName() << endl;
+      std::cout << " IncrementLevel " << info->GetName() << std::endl;
 
    WorkWithClass(info->GetName(), info->GetClassVersion());
 }
@@ -574,7 +574,7 @@ void  TBufferSQL2::DecrementLevel(TVirtualStreamerInfo* info)
    fExpectedChain = kFALSE;
 
    if (gDebug>2)
-      cout << " DecrementLevel " << info->GetClass()->GetName() << endl;
+      std::cout << " DecrementLevel " << info->GetClass()->GetName() << std::endl;
 }
 
 //______________________________________________________________________________
@@ -956,14 +956,14 @@ Version_t TBufferSQL2::ReadVersion(UInt_t *start, UInt_t *bcnt, const TClass *)
       res = fReadVersionBuffer;
       fReadVersionBuffer = -1;
       if (gDebug>3)
-         cout << "TBufferSQL2::ReadVersion from buffer = " << res << endl;
+         std::cout << "TBufferSQL2::ReadVersion from buffer = " << res << std::endl;
    } else
    if ((fCurrentData!=0) && fCurrentData->IsBlobData() &&
        fCurrentData->VerifyDataType(sqlio::Version)) {
       TString value = fCurrentData->GetValue();
       res = value.Atoi();
       if (gDebug>3)
-         cout << "TBufferSQL2::ReadVersion from blob " << fCurrentData->GetBlobPrefixName() << " = " << res << endl;
+         std::cout << "TBufferSQL2::ReadVersion from blob " << fCurrentData->GetBlobPrefixName() << " = " << res << std::endl;
       fCurrentData->ShiftToNextValue();
    } else {
       Error("ReadVersion", "No correspondent tags to read version");
@@ -981,7 +981,7 @@ UInt_t TBufferSQL2::WriteVersion(const TClass *cl, Bool_t /* useBcnt */)
    // name, which will include class version
 
    if (gDebug>2)
-      cout << "TBufferSQL2::WriteVersion " << (cl ? cl->GetName() : "null") << "   ver = " << (cl ? cl->GetClassVersion() : 0) << endl;
+      std::cout << "TBufferSQL2::WriteVersion " << (cl ? cl->GetName() : "null") << "   ver = " << (cl ? cl->GetClassVersion() : 0) << std::endl;
 
    if (cl)
       Stack()->AddVersion(cl);
@@ -1011,7 +1011,7 @@ void TBufferSQL2::WriteObjectClass(const void *actualObjStart, const TClass *act
    // Write object to buffer. Only used from TBuffer
 
    if (gDebug>2)
-      cout << "TBufferSQL2::WriteObject of class " << (actualClass ? actualClass->GetName() : " null") << endl;
+      std::cout << "TBufferSQL2::WriteObject of class " << (actualClass ? actualClass->GetName() : " null") << std::endl;
    SqlWriteObject(actualObjStart, actualClass);
 }
 
@@ -1030,7 +1030,7 @@ void TBufferSQL2::WriteObjectClass(const void *actualObjStart, const TClass *act
          if (strstr(name,sqlio::IndexSepar)==0) {                       \
             res = sscanf(name,"[%d", &first); last = first;             \
          } else res = sscanf(name,"[%d..%d", &first, &last);            \
-         if (gDebug>5) cout << name << " first = " << first << " last = " << last << " res = " << res << endl; \
+         if (gDebug>5) std::cout << name << " first = " << first << " last = " << last << " res = " << res << std::endl; \
          if ((first!=indx) || (last<first) || (last>=arrsize)) {        \
             Error("SQLReadArrayCompress","Error reading array content %s", name); \
             fErrorFlag = 1;                                             \
@@ -1046,7 +1046,7 @@ void TBufferSQL2::WriteObjectClass(const void *actualObjStart, const TClass *act
 // macro to read content of array with compression
 #define SQLReadArrayContent(vname, arrsize, withsize)                   \
    {                                                                    \
-      if (gDebug>3) cout << "SQLReadArrayContent  " << (arrsize) << endl; \
+      if (gDebug>3) std::cout << "SQLReadArrayContent  " << (arrsize) << std::endl; \
       PushStack()->SetArray(withsize ? arrsize : -1);                   \
       Int_t indx = 0;                                                   \
       if (fCurrentData->IsBlobData())                                   \
@@ -1054,7 +1054,7 @@ void TBufferSQL2::WriteObjectClass(const void *actualObjStart, const TClass *act
          else                                                           \
             SQLReadArrayUncompress(vname, arrsize)                      \
                PopStack();                                              \
-      if (gDebug>3) cout << "SQLReadArrayContent done " << endl;        \
+      if (gDebug>3) std::cout << "SQLReadArrayContent done " << std::endl;        \
    }
 
 // macro to read array, which include size attribute
@@ -1442,7 +1442,7 @@ void TBufferSQL2::ReadFastArray(Char_t    *c, Int_t n)
       if (size<n) size = n;
       memcpy(c, buf, size);
    } else {
-      //     cout << "call standard macro TBufferSQL2_ReadFastArray" << endl;
+      //     std::cout << "call standard macro TBufferSQL2_ReadFastArray" << std::endl;
       TBufferSQL2_ReadFastArray(c);
    }
 }
@@ -2048,7 +2048,7 @@ void TBufferSQL2::StreamObject(void *obj, const TClass *cl, const TClass *onFile
    // steram object to/from buffer
 
    if (gDebug>1)
-      cout << " TBufferSQL2::StreamObject class = " << (cl ? cl->GetName() : "none") << endl;
+      std::cout << " TBufferSQL2::StreamObject class = " << (cl ? cl->GetName() : "none") << std::endl;
    if (IsReading())
       SqlReadObject(obj, 0, 0, 0, onFileClass);
    else
@@ -2071,7 +2071,7 @@ void TBufferSQL2::StreamObject(void *obj, TMemberStreamer *streamer, const TClas
    if (streamer==0) return;
 
    if (gDebug>1)
-      cout << "Stream object of class = " << cl->GetName() << endl;
+      std::cout << "Stream object of class = " << cl->GetName() << std::endl;
 //   (*streamer)(*this, obj, n);
 
    if (IsReading())
@@ -2660,7 +2660,7 @@ const char* TBufferSQL2::SqlReadValue(const char* tname)
    fCurrentData->ShiftToNextValue();
 
    if (gDebug>4)
-      cout << "   SqlReadValue " << tname << " = " << fReadBuffer << endl;
+      std::cout << "   SqlReadValue " << tname << " = " << fReadBuffer << std::endl;
 
    return fReadBuffer.Data();
 }
diff --git a/io/sql/src/TSQLFile.cxx b/io/sql/src/TSQLFile.cxx
index 19ab66bba54..a71858c2b9a 100644
--- a/io/sql/src/TSQLFile.cxx
+++ b/io/sql/src/TSQLFile.cxx
@@ -974,7 +974,7 @@ Int_t TSQLFile::StreamKeysForDirectory(TDirectory* dir, Bool_t doupdate, Long64_
       const char* classname = (*row)[7];
 
       if (gDebug>4)
-        cout << "  Reading keyid = " << keyid << " name = " << keyname << endl;
+        std::cout << "  Reading keyid = " << keyid << " name = " << keyname << std::endl;
 
       if ((keyid>=sqlio::Ids_FirstKey) || (keyid==specialkeyid)) {
          if (doupdate) {
@@ -1419,7 +1419,7 @@ TSQLResult* TSQLFile::SQLQuery(const char* cmd, Int_t flag, Bool_t* ok)
    // If ok!=0, it will contains kTRUE is Query was successfull, otherwise kFALSE
 
    if (fLogFile!=0)
-      *fLogFile << cmd << endl;
+      *fLogFile << cmd << std::endl;
 
    if (ok!=0) *ok = kFALSE;
 
@@ -2397,7 +2397,7 @@ TObjArray* TSQLFile::SQLObjectsInfo(Long64_t keyid)
    TObjArray* arr = 0;
 
    if (fLogFile!=0)
-      *fLogFile << sqlcmd << endl;
+      *fLogFile << sqlcmd << std::endl;
    if (gDebug>2) Info("SQLObjectsInfo", "%s", sqlcmd.Data());
    fQuerisCounter++;
 
@@ -2502,7 +2502,7 @@ TSQLStatement* TSQLFile::GetBlobClassDataStmt(Long64_t objid, TSQLClassInfo* sql
                quote, SQLRawIdColumn(), quote);
 
    if (fLogFile!=0)
-      *fLogFile << sqlcmd << endl;
+      *fLogFile << sqlcmd << std::endl;
    if (gDebug>2) Info("BuildStatement", "%s", sqlcmd.Data());
    fQuerisCounter++;
 
diff --git a/io/sql/src/TSQLStructure.cxx b/io/sql/src/TSQLStructure.cxx
index 239d4c51f55..f49653ebadc 100644
--- a/io/sql/src/TSQLStructure.cxx
+++ b/io/sql/src/TSQLStructure.cxx
@@ -724,47 +724,47 @@ void TSQLStructure::PrintLevel(Int_t level) const
 {
    // print content of current structure
 
-   for(Int_t n=0;n<level;n++) cout << " ";
+   for(Int_t n=0;n<level;n++) std::cout << " ";
    switch (fType) {
-   case 0: cout << "Undefined type"; break;
-   case kSqlObject: cout << "Object ref = " << fValue; break;
-   case kSqlPointer: cout << "Pointer ptr = " << fValue; break;
+   case 0: std::cout << "Undefined type"; break;
+   case kSqlObject: std::cout << "Object ref = " << fValue; break;
+   case kSqlPointer: std::cout << "Pointer ptr = " << fValue; break;
    case kSqlVersion: {
       const TClass* cl = (const TClass*) fPointer;
-      cout << "Version cl = " << cl->GetName() << " ver = " << cl->GetClassVersion();
+      std::cout << "Version cl = " << cl->GetName() << " ver = " << cl->GetClassVersion();
       break;
    }
    case kSqlStreamerInfo: {
       const TStreamerInfo* info = (const TStreamerInfo*) fPointer;
-      cout << "Class: " << info->GetName();
+      std::cout << "Class: " << info->GetName();
       break;
    }
    case kSqlCustomElement:
    case kSqlElement: {
       const TStreamerElement* elem = (const TStreamerElement*) fPointer;
-      cout << "Member: " << elem->GetName();
+      std::cout << "Member: " << elem->GetName();
       break;
    }
    case kSqlValue: {
-      cout << "Value: " << fValue;
-      if (fRepeatCnt>1) cout << "  cnt:" << fRepeatCnt;
-      if (fPointer!=0) cout << "  type = " << (const char*)fPointer;
+      std::cout << "Value: " << fValue;
+      if (fRepeatCnt>1) std::cout << "  cnt:" << fRepeatCnt;
+      if (fPointer!=0) std::cout << "  type = " << (const char*)fPointer;
       break;
    }
    case kSqlArray: {
-      cout << "Array ";
-      if (fValue.Length()>0) cout << "  sz = " << fValue;
+      std::cout << "Array ";
+      if (fValue.Length()>0) std::cout << "  sz = " << fValue;
       break;
    }
    case kSqlCustomClass: {
       TClass* cl = (TClass*) fPointer;
-      cout << "CustomClass: " << cl->GetName() << "  ver = " << fValue;
+      std::cout << "CustomClass: " << cl->GetName() << "  ver = " << fValue;
       break;
    }
    default:
-      cout << "Unknown type";
+      std::cout << "Unknown type";
    }
-   cout << endl;
+   std::cout << std::endl;
 
    for(Int_t n=0;n<NumChilds();n++)
       GetChild(n)->PrintLevel(level+2);
@@ -1389,9 +1389,9 @@ Bool_t TSQLStructure::StoreObject(TSqlRegistry* reg, Long64_t objid, TClass* cl,
    if ((cl==0) || (objid<0)) return kFALSE;
 
    if (gDebug>1) {
-      cout << "Store object " << objid <<" cl = " << cl->GetName() << endl;
-      if (GetStreamerInfo()) cout << "Info = " << GetStreamerInfo()->GetName() << endl; else
-         if (GetElement()) cout << "Element = " << GetElement()->GetName() << endl;
+      std::cout << "Store object " << objid <<" cl = " << cl->GetName() << std::endl;
+      if (GetStreamerInfo()) std::cout << "Info = " << GetStreamerInfo()->GetName() << std::endl; else
+         if (GetElement()) std::cout << "Element = " << GetElement()->GetName() << std::endl;
    }
 
    Long64_t oldid = reg->fCurrentObjId;
@@ -1419,7 +1419,7 @@ Bool_t TSQLStructure::StoreObject(TSqlRegistry* reg, Long64_t objid, TClass* cl,
          normstore = StoreObjectInNormalForm(reg);
 
    if (gDebug>2)
-      cout << "Store object " << objid << " of class " << cl->GetName() << "  normal = " << normstore << " sqltype = " << GetType() << endl;
+      std::cout << "Store object " << objid << " of class " << cl->GetName() << "  normal = " << normstore << " sqltype = " << GetType() << std::endl;
 
    if (!normstore) {
 
@@ -1569,9 +1569,9 @@ Bool_t TSQLStructure::StoreElementInNormalForm(TSqlRegistry* reg, TSQLTableData*
    Int_t columntyp = DefineElementColumnType(elem, reg->fFile);
 
    if (gDebug>4)
-      cout << "Element " << elem->GetName()
+      std::cout << "Element " << elem->GetName()
            << "   type = " << typ
-           << "  column = " << columntyp << endl;
+           << "  column = " << columntyp << std::endl;
 
    TString colname = DefineElementColumnName(elem, reg->fFile);
 
@@ -1625,7 +1625,7 @@ Bool_t TSQLStructure::StoreElementInNormalForm(TSqlRegistry* reg, TSQLTableData*
       }
 
       if (objid<0) {
-         //cout << "!!!! Not standard " << elem->GetName() << " class = " << elem->GetClassPointer()->GetName() << endl;
+         //std::cout << "!!!! Not standard " << elem->GetName() << " class = " << elem->GetClassPointer()->GetName() << std::endl;
          objid = reg->GetNextObjId();
          if (!StoreObject(reg, objid, elem->GetClassPointer()))
             objid = -1;  // this is a case, when no data was stored for this object
@@ -2137,8 +2137,8 @@ Int_t TSQLStructure::LocateElementColumn(TSQLFile* f, TBufferSQL2* buf, TSQLObje
    Int_t coltype = DefineElementColumnType(elem, f);
 
    if (gDebug>4)
-      cout <<"TSQLStructure::LocateElementColumn " << elem->GetName() <<
-         " coltyp = " << coltype << " : " << elem->GetType() << " len = " << elem->GetArrayLength() << endl;
+      std::cout <<"TSQLStructure::LocateElementColumn " << elem->GetName() <<
+         " coltyp = " << coltype << " : " << elem->GetType() << " len = " << elem->GetArrayLength() << std::endl;
 
    if (coltype==kColUnknown) return kColUnknown;
 
@@ -2148,8 +2148,8 @@ Int_t TSQLStructure::LocateElementColumn(TSQLFile* f, TBufferSQL2* buf, TSQLObje
    TString colname = DefineElementColumnName(elem, f);
 
    if (gDebug>4)
-      cout << "         colname = " << colname << " in " <<
-            data->GetInfo()->GetClassTableName() << endl;
+      std::cout << "         colname = " << colname << " in " <<
+            data->GetInfo()->GetClassTableName() << std::endl;
 
    switch (coltype) {
    case kColSimple: {
diff --git a/io/xml/inc/TXMLPlayer.h b/io/xml/inc/TXMLPlayer.h
index f2656bcad20..04af2cb9869 100644
--- a/io/xml/inc/TXMLPlayer.h
+++ b/io/xml/inc/TXMLPlayer.h
@@ -46,11 +46,11 @@ class TXMLPlayer : public TObject {
       TString GetMemberTypeName(TDataMember* member);
       TString GetBasicTypeName(TStreamerElement* el);
       TString GetBasicTypeReaderMethodName(Int_t type, const char* realname);
-      void ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist);
+      void ProduceStreamerSource(std::ostream& fs, TClass* cl, TList* cllist);
       
-      void ReadSTLarg(ostream& fs, TString& argname, int argtyp, Bool_t isargptr, TClass* argcl, TString& tname, TString& ifcond);
-      void WriteSTLarg(ostream& fs, const char* accname, int argtyp, Bool_t isargptr, TClass* argcl);
-      Bool_t ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el, Bool_t isWriting);
+      void ReadSTLarg(std::ostream& fs, TString& argname, int argtyp, Bool_t isargptr, TClass* argcl, TString& tname, TString& ifcond);
+      void WriteSTLarg(std::ostream& fs, const char* accname, int argtyp, Bool_t isargptr, TClass* argcl);
+      Bool_t ProduceSTLstreamer(std::ostream& fs, TClass* cl, TStreamerSTL* el, Bool_t isWriting);
       
       TString fGetterName;                   //!  buffer for name of getter method
       TString fSetterName;                   //!  buffer for name of setter method
diff --git a/io/xml/src/TXMLPlayer.cxx b/io/xml/src/TXMLPlayer.cxx
index be2d8cf431b..5b9f75ca506 100644
--- a/io/xml/src/TXMLPlayer.cxx
+++ b/io/xml/src/TXMLPlayer.cxx
@@ -164,17 +164,17 @@ Bool_t TXMLPlayer::ProduceCode(TList* cllist, const char* filename)
 
    if ((cllist==0) || (filename==0)) return kFALSE;
 
-   ofstream fh(TString(filename)+".h");
-   ofstream fs(TString(filename)+".cxx");
+   std::ofstream fh(TString(filename)+".h");
+   std::ofstream fs(TString(filename)+".cxx");
 
-   fh << "// generated header file" << endl << endl;
-   fh << "#ifndef " << filename << "_h" << endl;
-   fh << "#define " << filename << "_h" << endl << endl;
+   fh << "// generated header file" << std::endl << std::endl;
+   fh << "#ifndef " << filename << "_h" << std::endl;
+   fh << "#define " << filename << "_h" << std::endl << std::endl;
 
-   fh << "#include \"" << names_xmlfileclass << ".h\"" << endl << endl;
+   fh << "#include \"" << names_xmlfileclass << ".h\"" << std::endl << std::endl;
 
-   fs << "// generated source file" << endl << endl;
-   fs << "#include \"" << filename << ".h\"" << endl << endl;
+   fs << "// generated source file" << std::endl << std::endl;
+   fs << "#include \"" << filename << ".h\"" << std::endl << std::endl;
 
    // produce appropriate include for all classes
 
@@ -183,14 +183,14 @@ Bool_t TXMLPlayer::ProduceCode(TList* cllist, const char* filename)
    TClass* cl = 0;
    while ((cl = (TClass*) iter()) != 0) {
       if (inclfiles.FindObject(cl->GetDeclFileName())==0) {
-         fs << "#include \"" << cl->GetDeclFileName() << "\"" << endl;
+         fs << "#include \"" << cl->GetDeclFileName() << "\"" << std::endl;
          inclfiles.Add(new TNamed(cl->GetDeclFileName(),""));
       }
    }
    inclfiles.Delete();
 
-   fh << endl;
-   fs << endl;
+   fh << std::endl;
+   fs << std::endl;
 
    // produce streamers declarations and implementations
 
@@ -199,13 +199,13 @@ Bool_t TXMLPlayer::ProduceCode(TList* cllist, const char* filename)
    while ((cl = (TClass*) iter()) != 0) {
 
       fh << "extern void* " << GetStreamerName(cl) << "("
-         << names_xmlfileclass << " &buf, void* ptr = 0, bool checktypes = true);" << endl << endl;
+         << names_xmlfileclass << " &buf, void* ptr = 0, bool checktypes = true);" << std::endl << std::endl;
 
       ProduceStreamerSource(fs, cl, cllist);
    }
 
-   fh << "#endif" << endl << endl;
-   fs << endl << endl;
+   fh << "#endif" << std::endl << std::endl;
+   fs << std::endl << std::endl;
 
    return kTRUE;
 }
@@ -405,7 +405,7 @@ const char* TXMLPlayer::ElementSetter(TClass* cl, const char* membername, char*
 }
 
 //______________________________________________________________________________
-void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
+void TXMLPlayer::ProduceStreamerSource(std::ostream& fs, TClass* cl, TList* cllist)
 {
    // Produce source code of streamer function for specified class
 
@@ -414,13 +414,13 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
    TObjArray* elements = info->GetElements();
    if (elements==0) return;
 
-   fs << "//__________________________________________________________________________" << endl;
+   fs << "//__________________________________________________________________________" << std::endl;
    fs << "void* " << GetStreamerName(cl) << "("
-         << names_xmlfileclass << " &buf, void* ptr, bool checktypes)" << endl;
-   fs << "{" << endl;
-   fs << tab1 << cl->GetName() << " *obj = (" << cl->GetName() << "*) ptr;" << endl;
+         << names_xmlfileclass << " &buf, void* ptr, bool checktypes)" << std::endl;
+   fs << "{" << std::endl;
+   fs << tab1 << cl->GetName() << " *obj = (" << cl->GetName() << "*) ptr;" << std::endl;
 
-   fs << tab1 << "if (buf.IsReading()) { " << endl;
+   fs << tab1 << "if (buf.IsReading()) { " << std::endl;
 
    TIter iter(cllist);
    TClass* c1 = 0;
@@ -430,22 +430,22 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
       if (c1==cl) continue;
       if (c1->GetListOfBases()->FindObject(cl->GetName())==0) continue;
       if (firstchild) {
-         fs << tab2 << "if (checktypes) {" << endl;
+         fs << tab2 << "if (checktypes) {" << std::endl;
          fs << tab3 << "void* ";
          firstchild = false;
       } else
          fs << tab3;
       fs << "res = " << GetStreamerName(c1)
-         << "(buf, dynamic_cast<" << c1->GetName() << "*>(obj));" << endl;
+         << "(buf, dynamic_cast<" << c1->GetName() << "*>(obj));" << std::endl;
       fs << tab3 << "if (res) return dynamic_cast<" << cl->GetName()
-         << "*>(("<< c1->GetName() << " *) res);" << endl;
+         << "*>(("<< c1->GetName() << " *) res);" << std::endl;
    }
-   if (!firstchild) fs << tab2 << "}" << endl;
+   if (!firstchild) fs << tab2 << "}" << std::endl;
 
    fs << tab2 << "if (!buf.CheckClassNode(\"" << cl->GetName() << "\", "
-              << info->GetClassVersion() << ")) return 0;" << endl;
+              << info->GetClassVersion() << ")) return 0;" << std::endl;
 
-   fs << tab2 << "if (obj==0) obj = new " << cl->GetName() << ";" << endl;
+   fs << tab2 << "if (obj==0) obj = new " << cl->GetName() << ";" << std::endl;
 
    int n;
    for (n=0;n<=elements->GetLast();n++) {
@@ -476,7 +476,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             char endch[5];
             fs << tab2 << ElementSetter(cl, el->GetName(), endch);
             fs << "buf." << GetBasicTypeReaderMethodName(el->GetType(), 0)
-               << "(\"" << el->GetName() << "\")" << endch << ";" << endl;
+               << "(\"" << el->GetName() << "\")" << endch << ";" << std::endl;
             continue;
          }
 
@@ -499,7 +499,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             fs << tab2 << "buf.ReadArray("
                        << ElementGetter(cl, el->GetName(), (el->GetArrayDim()>1) ? 1 : 0);
             fs         << ", " << el->GetArrayLength()
-                       << ", \"" << el->GetName() << "\");" << endl;
+                       << ", \"" << el->GetName() << "\");" << std::endl;
             continue;
          }
 
@@ -521,7 +521,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kDouble32: {
             TStreamerBasicPointer* elp = dynamic_cast<TStreamerBasicPointer*> (el);
             if (elp==0) {
-               cout << "fatal error with TStreamerBasicPointer" << endl;
+               std::cout << "fatal error with TStreamerBasicPointer" << std::endl;
                continue;
             }
             char endch[5];
@@ -529,7 +529,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             fs << tab2 << ElementSetter(cl, el->GetName(), endch);
             fs         << "buf.ReadArray(" << ElementGetter(cl, el->GetName());
             fs         << ", " << ElementGetter(cl, elp->GetCountName());
-            fs         << ", \"" << el->GetName() << "\", true)" << endch << ";" << endl;
+            fs         << ", \"" << el->GetName() << "\", true)" << endch << ";" << std::endl;
             continue;
          }
 
@@ -537,14 +537,14 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             char endch[5];
             fs << tab2 << ElementSetter(cl, el->GetName(), endch);
             fs         << "buf.ReadCharStar(" << ElementGetter(cl, el->GetName());
-            fs         << ", \"" << el->GetName() << "\")" << endch << ";" << endl;
+            fs         << ", \"" << el->GetName() << "\")" << endch << ";" << std::endl;
             continue;
          }
 
          case TVirtualStreamerInfo::kBase: {
             fs << tab2 << GetStreamerName(el->GetClassPointer())
                << "(buf, dynamic_cast<" << el->GetClassPointer()->GetName()
-               << "*>(obj), false);" << endl;
+               << "*>(obj), false);" << std::endl;
             continue;
          }
 
@@ -555,11 +555,11 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
                fs << tab2 << "buf.ReadObjectArr(" << ElementGetter(cl, el->GetName());
                fs         << ", " << el->GetArrayLength() << ", -1"
                           << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             } else {
                fs << tab2 << "buf.ReadObject(" << ElementGetter(cl, el->GetName());
                fs         << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             }
             continue;
          }
@@ -569,20 +569,20 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
          case TVirtualStreamerInfo::kAnyP + TVirtualStreamerInfo::kOffsetL: {
             if (el->GetArrayLength()>0) {
                fs << tab2 << "for (int n=0;n<" << el->GetArrayLength() << ";n++) "
-                          << "delete (" << ElementGetter(cl, el->GetName()) << ")[n];" << endl;
+                          << "delete (" << ElementGetter(cl, el->GetName()) << ")[n];" << std::endl;
                fs << tab2 << "buf.ReadObjectPtrArr((void**) " << ElementGetter(cl, el->GetName(), 3);
                fs         << ", " << el->GetArrayLength()
                           << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             } else {
                char endch[5];
 
-               fs << tab2 << "delete " << ElementGetter(cl, el->GetName()) << ";" << endl;
+               fs << tab2 << "delete " << ElementGetter(cl, el->GetName()) << ";" << std::endl;
                fs << tab2 << ElementSetter(cl, el->GetName(), endch);
                fs         << "(" << el->GetClassPointer()->GetName()
                           << "*) buf.ReadObjectPtr(\"" << el->GetName() << "\", "
                           << GetStreamerName(el->GetClassPointer())
-                          << ")" <<endch << ";" << endl;
+                          << ")" <<endch << ";" << std::endl;
             }
             continue;
          }
@@ -591,7 +591,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
          case TVirtualStreamerInfo::kAny: {
             fs << tab2 << "buf.ReadObject(" << ElementGetter(cl, el->GetName(), 2);
             fs         << ", \"" << el->GetName() << "\", "
-                       << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                       << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             continue;
          }
 
@@ -601,7 +601,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             fs         << ", " << el->GetArrayLength()
                        << ", sizeof(" << el->GetClassPointer()->GetName()
                        << "), \"" << el->GetName() << "\", "
-                       << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                       << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             continue;
          }
 
@@ -615,23 +615,23 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
 
             if (ProduceSTLstreamer(fs, cl, elstl, false)) continue;
 
-            fs << tab2 << "// STL type = " << elstl->GetSTLtype() << endl;
+            fs << tab2 << "// STL type = " << elstl->GetSTLtype() << std::endl;
             break;
          }
       }
       fs << tab2 << "buf.SkipMember(\"" << el->GetName()
          << "\");   // sinfo type " << el->GetType()
          << " of class " << el->GetClassPointer()->GetName()
-         << " not supported" << endl;
+         << " not supported" << std::endl;
    }
 
-   fs << tab2 << "buf.EndClassNode();" << endl;
+   fs << tab2 << "buf.EndClassNode();" << std::endl;
 
-   fs << tab1 << "} else {" << endl;
+   fs << tab1 << "} else {" << std::endl;
 
    // generation of writing part of class streamer
 
-   fs << tab2 << "if (obj==0) return 0;" << endl;
+   fs << tab2 << "if (obj==0) return 0;" << std::endl;
 
    firstchild = true;
    iter.Reset();
@@ -640,15 +640,15 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
       if (c1->GetListOfBases()->FindObject(cl->GetName())==0) continue;
       if (firstchild) {
          firstchild = false;
-         fs << tab2 << "if (checktypes) {" << endl;
+         fs << tab2 << "if (checktypes) {" << std::endl;
       }
-      fs << tab3 << "if (dynamic_cast<" << c1->GetName() << "*>(obj))" << endl;
-      fs << tab4 << "return " << GetStreamerName(c1) << "(buf, dynamic_cast<" << c1->GetName() << "*>(obj));" << endl;
+      fs << tab3 << "if (dynamic_cast<" << c1->GetName() << "*>(obj))" << std::endl;
+      fs << tab4 << "return " << GetStreamerName(c1) << "(buf, dynamic_cast<" << c1->GetName() << "*>(obj));" << std::endl;
    }
-   if (!firstchild) fs << tab2 << "}" << endl;
+   if (!firstchild) fs << tab2 << "}" << std::endl;
 
    fs << tab2 << "buf.StartClassNode(\"" << cl->GetName() << "\", "
-              << info->GetClassVersion() << ");" << endl;
+              << info->GetClassVersion() << ");" << std::endl;
 
    for (n=0;n<=elements->GetLast();n++) {
 
@@ -680,7 +680,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
                fs <<"(unsigned char) " << ElementGetter(cl, el->GetName());
             else
                fs << ElementGetter(cl, el->GetName());
-            fs << ", \"" << el->GetName() << "\");" << endl;
+            fs << ", \"" << el->GetName() << "\");" << std::endl;
             continue;
          }
 
@@ -703,7 +703,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             fs << tab2 << "buf.WriteArray("
                        << ElementGetter(cl, el->GetName(), (el->GetArrayDim()>1) ? 1 : 0);
             fs         << ", " << el->GetArrayLength()
-                       << ", \"" << el->GetName() << "\");" << endl;
+                       << ", \"" << el->GetName() << "\");" << std::endl;
             continue;
          }
 
@@ -724,25 +724,25 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kDouble32: {
             TStreamerBasicPointer* elp = dynamic_cast<TStreamerBasicPointer*> (el);
             if (elp==0) {
-               cout << "fatal error with TStreamerBasicPointer" << endl;
+               std::cout << "fatal error with TStreamerBasicPointer" << std::endl;
                continue;
             }
             fs << tab2 << "buf.WriteArray(" << ElementGetter(cl, el->GetName());
             fs         << ", " << ElementGetter(cl, elp->GetCountName())
-                       << ", \"" << el->GetName() << "\", true);" << endl;
+                       << ", \"" << el->GetName() << "\", true);" << std::endl;
             continue;
          }
 
          case TVirtualStreamerInfo::kCharStar: {
             fs << tab2 << "buf.WriteCharStar(" << ElementGetter(cl, el->GetName())
-                       << ", \"" << el->GetName() << "\");" << endl;
+                       << ", \"" << el->GetName() << "\");" << std::endl;
             continue;
          }
 
          case TVirtualStreamerInfo::kBase: {
             fs << tab2 << GetStreamerName(el->GetClassPointer())
                << "(buf, dynamic_cast<" << el->GetClassPointer()->GetName()
-               << "*>(obj), false);" << endl;
+               << "*>(obj), false);" << std::endl;
             continue;
          }
 
@@ -753,11 +753,11 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
                fs << tab2 << "buf.WriteObjectArr(" << ElementGetter(cl, el->GetName());
                fs         << ", " << el->GetArrayLength() << ", -1"
                           << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             } else {
                fs << tab2 << "buf.WriteObject(" << ElementGetter(cl, el->GetName());
                fs         << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             }
             continue;
          }
@@ -769,11 +769,11 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
                fs << tab2 << "buf.WriteObjectPtrArr((void**) " << ElementGetter(cl, el->GetName(), 3);
                fs         << ", " << el->GetArrayLength()
                           << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             } else {
                fs << tab2 << "buf.WriteObjectPtr(" << ElementGetter(cl, el->GetName());
                fs         << ", \"" << el->GetName() << "\", "
-                          << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                          << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             }
             continue;
          }
@@ -781,7 +781,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
          case TVirtualStreamerInfo::kAny: {    // Class  NOT derived from TObject
             fs << tab2 << "buf.WriteObject(" << ElementGetter(cl, el->GetName(), 2);
             fs         << ", \"" << el->GetName() << "\", "
-                       << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                       << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             continue;
          }
 
@@ -790,7 +790,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             fs         << ", " << el->GetArrayLength()
                        << ", sizeof(" << el->GetClassPointer()->GetName()
                        << "), \"" << el->GetName() << "\", "
-                       << GetStreamerName(el->GetClassPointer()) << ");" << endl;
+                       << GetStreamerName(el->GetClassPointer()) << ");" << std::endl;
             continue;
          }
 
@@ -803,7 +803,7 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
             if (elstl==0) break; // to make skip
 
             if (ProduceSTLstreamer(fs, cl, elstl, true)) continue;
-            fs << tab2 << "// STL type = " << elstl->GetSTLtype() << endl;
+            fs << tab2 << "// STL type = " << elstl->GetSTLtype() << std::endl;
             break;
          }
 
@@ -811,18 +811,18 @@ void TXMLPlayer::ProduceStreamerSource(ostream& fs, TClass* cl, TList* cllist)
       fs << tab2 << "buf.MakeEmptyMember(\"" << el->GetName()
                  << "\");   // sinfo type " << el->GetType()
                  << " of class " << el->GetClassPointer()->GetName()
-                 << " not supported" << endl;
+                 << " not supported" << std::endl;
    }
 
-   fs << tab2 << "buf.EndClassNode();" << endl;
+   fs << tab2 << "buf.EndClassNode();" << std::endl;
 
-   fs << tab1 << "}" << endl;
-   fs << tab1 << "return obj;" << endl;
-   fs << "}" << endl << endl;
+   fs << tab1 << "}" << std::endl;
+   fs << tab1 << "return obj;" << std::endl;
+   fs << "}" << std::endl << std::endl;
 }
 
 //______________________________________________________________________________
-void TXMLPlayer::ReadSTLarg(ostream& fs,
+void TXMLPlayer::ReadSTLarg(std::ostream& fs,
                             TString& argname,
                             int argtyp,
                             Bool_t isargptr,
@@ -850,7 +850,7 @@ void TXMLPlayer::ReadSTLarg(ostream& fs,
       case TVirtualStreamerInfo::kDouble32:
       case TVirtualStreamerInfo::kCounter: {
          fs << tname << " " << argname << " = buf."
-            << GetBasicTypeReaderMethodName(argtyp, tname.Data()) << "(0);" << endl;
+            << GetBasicTypeReaderMethodName(argtyp, tname.Data()) << "(0);" << std::endl;
          break;
       }
 
@@ -858,7 +858,7 @@ void TXMLPlayer::ReadSTLarg(ostream& fs,
          fs << tname << (isargptr ? " ": " *") << argname << " = "
             << "(" << argcl->GetName() << "*)"
             << "buf.ReadObjectPtr(0, "
-            << GetStreamerName(argcl) << ");" << endl;
+            << GetStreamerName(argcl) << ");" << std::endl;
          if (!isargptr) {
             if (ifcond.Length()>0) ifcond+=" && ";
             ifcond += argname;
@@ -871,7 +871,7 @@ void TXMLPlayer::ReadSTLarg(ostream& fs,
 
       case TVirtualStreamerInfo::kSTLstring: {
          fs << "string *" << argname << " = "
-            << "buf.ReadSTLstring();" << endl;
+            << "buf.ReadSTLstring();" << std::endl;
          if (!isargptr) {
             if (ifcond.Length()>0) ifcond+=" && ";
             ifcond += argname;
@@ -888,7 +888,7 @@ void TXMLPlayer::ReadSTLarg(ostream& fs,
 }
 
 //______________________________________________________________________________
-void TXMLPlayer::WriteSTLarg(ostream& fs, const char* accname, int argtyp, Bool_t isargptr, TClass* argcl)
+void TXMLPlayer::WriteSTLarg(std::ostream& fs, const char* accname, int argtyp, Bool_t isargptr, TClass* argcl)
 {
    // Produce code to write argument of stl container to xml file
 
@@ -909,7 +909,7 @@ void TXMLPlayer::WriteSTLarg(ostream& fs, const char* accname, int argtyp, Bool_
       case TVirtualStreamerInfo::kULong64:
       case TVirtualStreamerInfo::kDouble32:
       case TVirtualStreamerInfo::kCounter: {
-         fs << "buf.WriteValue(" << accname << ", 0);" << endl;
+         fs << "buf.WriteValue(" << accname << ", 0);" << std::endl;
          break;
       }
 
@@ -919,7 +919,7 @@ void TXMLPlayer::WriteSTLarg(ostream& fs, const char* accname, int argtyp, Bool_
             fs << accname;
          else
             fs << "&(" << accname << ")";
-         fs << ", 0, " <<  GetStreamerName(argcl) << ");" << endl;
+         fs << ", 0, " <<  GetStreamerName(argcl) << ");" << std::endl;
          break;
       }
 
@@ -929,17 +929,17 @@ void TXMLPlayer::WriteSTLarg(ostream& fs, const char* accname, int argtyp, Bool_
             fs << accname;
          else
             fs << "&(" << accname << ")";
-         fs << ");" << endl;
+         fs << ");" << std::endl;
          break;
       }
 
       default:
-         fs << "/* argument not supported */" << endl;
+         fs << "/* argument not supported */" << std::endl;
    }
 }
 
 //______________________________________________________________________________
-Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el, Bool_t isWriting)
+Bool_t TXMLPlayer::ProduceSTLstreamer(std::ostream& fs, TClass* cl, TStreamerSTL* el, Bool_t isWriting)
 {
    // Produce code of xml streamer for data member of stl type
 
@@ -960,10 +960,10 @@ Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el,
    TString argtname[2];
 
    if (!isstr && TClassEdit::IsSTLCont(contcl->GetName())) {
-         string shortTypeName =
+         std::string shortTypeName =
             TClassEdit::ShortType(contcl->GetName(), TClassEdit::kDropStlDefault);
          int nestedLoc = 0;
-         vector<string> splitName;
+         std::vector<std::string> splitName;
          TClassEdit::GetSplit(shortTypeName.c_str(), splitName, nestedLoc);
 
          stltyp = TClassEdit::STLKind(splitName[0].c_str());
@@ -1027,7 +1027,7 @@ Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el,
    if (isWriting) {
 
       fs << tab2 << "if (buf.StartSTLnode(\""
-                 << fXmlSetup.XmlGetElementName(el) << "\")) {" << endl;
+                 << fXmlSetup.XmlGetElementName(el) << "\")) {" << std::endl;
 
       fs << tab3 << contcl->GetName() << " ";
 
@@ -1042,13 +1042,13 @@ Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el,
       fs << " = ";
 
       if (isparent)
-         fs << "*dynamic_cast<" << contcl->GetName() << "*>(obj);" << endl;
+         fs << "*dynamic_cast<" << contcl->GetName() << "*>(obj);" << std::endl;
       else
-         fs << ElementGetter(cl, el->GetName()) << ";" << endl;
+         fs << ElementGetter(cl, el->GetName()) << ";" << std::endl;
 
       if (isarr && el->GetArrayLength()) {
          strlcpy(tabs, tab4, sizeof(tabs));
-         fs << tab3 << "for(int n=0;n<" << el->GetArrayLength() << ";n++) {" << endl;
+         fs << tab3 << "for(int n=0;n<" << el->GetArrayLength() << ";n++) {" << std::endl;
       } else
          strlcpy(tabs, tab3, sizeof(tabs));
 
@@ -1056,63 +1056,63 @@ Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el,
 
       if (isptr) {
          strlcat(tabs2, tab1, sizeof(tabs2));
-         fs << tabs << "if (" << (isarr ? "*cont" : "cont") << "==0) {" << endl;
-         fs << tabs2 << "buf.WriteSTLsize(0" << (isstr ? ",true);" : ");") << endl;
-         fs << tabs << "} else {" << endl;
+         fs << tabs << "if (" << (isarr ? "*cont" : "cont") << "==0) {" << std::endl;
+         fs << tabs2 << "buf.WriteSTLsize(0" << (isstr ? ",true);" : ");") << std::endl;
+         fs << tabs << "} else {" << std::endl;
       }
 
       fs << tabs2 << "buf.WriteSTLsize(" << accname
-                  << (isstr ? "length(), true);" : "size());") << endl;
+                  << (isstr ? "length(), true);" : "size());") << std::endl;
 
       if (isstr) {
-         fs << tabs2 << "buf.WriteSTLstringData(" << accname << "c_str());" << endl;
+         fs << tabs2 << "buf.WriteSTLstringData(" << accname << "c_str());" << std::endl;
       } else {
          if (akaarrayaccess) {
             fs << tabs2 << argtname[0] << "* arr = new " << argtname[0]
-                                       << "[" << accname << "size()];" << endl;
-            fs << tabs2 << "int k = 0;" << endl;
+                                       << "[" << accname << "size()];" << std::endl;
+            fs << tabs2 << "int k = 0;" << std::endl;
          }
 
-         fs << tabs2 << contcl->GetName() << "::const_iterator iter;" << endl;
+         fs << tabs2 << contcl->GetName() << "::const_iterator iter;" << std::endl;
          fs << tabs2 << "for (iter = " << accname << "begin(); iter != "
                     << accname << "end(); iter++)";
          if (akaarrayaccess) {
-            fs << endl << tabs2 << tab1 << "arr[k++] = *iter;" << endl;
-            fs << tabs2 << "buf.WriteArray(arr, " << accname << "size(), 0, false);" << endl;
-            fs << tabs2 << "delete[] arr;" << endl;
+            fs << std::endl << tabs2 << tab1 << "arr[k++] = *iter;" << std::endl;
+            fs << tabs2 << "buf.WriteArray(arr, " << accname << "size(), 0, false);" << std::endl;
+            fs << tabs2 << "delete[] arr;" << std::endl;
          } else
          if (narg==1) {
-            fs << endl << tabs2 << tab1;
+            fs << std::endl << tabs2 << tab1;
             WriteSTLarg(fs, "*iter", argtype[0], isargptr[0], argcl[0]);
          } else
          if (narg==2) {
-            fs << " {" << endl;
+            fs << " {" << std::endl;
             fs << tabs2 << tab1;
             WriteSTLarg(fs, "iter->first", argtype[0], isargptr[0], argcl[0]);
             fs << tabs2 << tab1;
             WriteSTLarg(fs, "iter->second", argtype[1], isargptr[1], argcl[1]);
-            fs << tabs2 << "}" << endl;
+            fs << tabs2 << "}" << std::endl;
          }
       } // if (isstr)
 
-      if (isptr) fs << tabs << "}" << endl;
+      if (isptr) fs << tabs << "}" << std::endl;
 
       if (isarr && el->GetArrayLength()) {
          if (isptr)
-            fs << tabs << "cont++;" << endl;
+            fs << tabs << "cont++;" << std::endl;
          else
-            fs << tabs << "(void*) cont = (char*) cont + sizeof(" << contcl->GetName() << ");" << endl;
-         fs << tab3 << "}" << endl;
+            fs << tabs << "(void*) cont = (char*) cont + sizeof(" << contcl->GetName() << ");" << std::endl;
+         fs << tab3 << "}" << std::endl;
       }
 
-      fs << tab3 << "buf.EndSTLnode();" << endl;
-      fs << tab2 << "}" << endl;
+      fs << tab3 << "buf.EndSTLnode();" << std::endl;
+      fs << tab2 << "}" << std::endl;
 
    } else {
 
 
       fs << tab2 << "if (buf.VerifySTLnode(\""
-                 << fXmlSetup.XmlGetElementName(el) << "\")) {" << endl;
+                 << fXmlSetup.XmlGetElementName(el) << "\")) {" << std::endl;
 
       fs << tab3 << contcl->GetName() << " ";
       TString accname, accptr;
@@ -1126,51 +1126,51 @@ Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el,
       fs << " = ";
 
       if (isparent)
-         fs << "*dynamic_cast<" << contcl->GetName() << "*>(obj);" << endl;
+         fs << "*dynamic_cast<" << contcl->GetName() << "*>(obj);" << std::endl;
       else
-         fs << ElementGetter(cl, el->GetName()) << ";" << endl;
+         fs << ElementGetter(cl, el->GetName()) << ";" << std::endl;
 
       if (isarr && el->GetArrayLength()) {
          strlcpy(tabs, tab4, sizeof(tabs));
-         fs << tab3 << "for(int n=0;n<" << el->GetArrayLength() << ";n++) {" << endl;
+         fs << tab3 << "for(int n=0;n<" << el->GetArrayLength() << ";n++) {" << std::endl;
       } else
          strlcpy(tabs, tab3, sizeof(tabs));
 
-      fs << tabs << "int size = buf.ReadSTLsize(" << (isstr ? "true);" : ");") << endl;
+      fs << tabs << "int size = buf.ReadSTLsize(" << (isstr ? "true);" : ");") << std::endl;
 
       if (isptr) {
-         fs << tabs << "delete " << accptr << ";" << endl;
-         fs << tabs << "if (size==0) " << accptr << " = 0;" << endl;
-         fs << tabs << "        else " << accptr << " = new " << contcl->GetName() << ";" << endl;
+         fs << tabs << "delete " << accptr << ";" << std::endl;
+         fs << tabs << "if (size==0) " << accptr << " = 0;" << std::endl;
+         fs << tabs << "        else " << accptr << " = new " << contcl->GetName() << ";" << std::endl;
          if (!isarr) {
             char endch[5];
             fs << tabs << ElementSetter(cl, el->GetName(), endch);
-            fs         << "cont" << endch << ";" << endl;
+            fs         << "cont" << endch << ";" << std::endl;
          }
       } else {
-         fs << tabs << accname << (isstr ? "erase();" : "clear();") << endl;
+         fs << tabs << accname << (isstr ? "erase();" : "clear();") << std::endl;
       }
 
       if (isstr) {
-         fs << tabs << "if (size>0) " << accname << "assign(buf.ReadSTLstringData(size));" << endl;
+         fs << tabs << "if (size>0) " << accname << "assign(buf.ReadSTLstringData(size));" << std::endl;
       } else {
          if (akaarrayaccess) {
-            fs << tabs << argtname[0] << "* arr = new " << argtname[0] << "[size];" << endl;
-            fs << tabs << "buf.ReadArray(arr, size, 0, false);" << endl;
+            fs << tabs << argtname[0] << "* arr = new " << argtname[0] << "[size];" << std::endl;
+            fs << tabs << "buf.ReadArray(arr, size, 0, false);" << std::endl;
          }
 
          fs << tabs << "for(int k=0;k<size;k++)";
 
          if (akaarrayaccess) {
-            fs << endl << tabs << tab1 << accname;
+            fs << std::endl << tabs << tab1 << accname;
             if ((stltyp==TClassEdit::kSet) || (stltyp==TClassEdit::kMultiSet))
                fs << "insert"; else fs << "push_back";
-            fs << "(arr[k]);" << endl;
-            fs << tabs << "delete[] arr;" << endl;
+            fs << "(arr[k]);" << std::endl;
+            fs << tabs << "delete[] arr;" << std::endl;
          } else
          if (narg==1) {
             TString arg1("arg"), ifcond;
-            fs << " {" << endl << tabs << tab1;
+            fs << " {" << std::endl << tabs << tab1;
             ReadSTLarg(fs, arg1, argtype[0], isargptr[0], argcl[0], argtname[0], ifcond);
             fs << tabs << tab1;
             if (ifcond.Length()>0) fs << "if (" << ifcond << ") ";
@@ -1179,31 +1179,31 @@ Bool_t TXMLPlayer::ProduceSTLstreamer(ostream& fs, TClass* cl, TStreamerSTL* el,
                fs << "insert";
             else
                fs << "push_back";
-            fs << "(" << arg1 << ");" << endl;
-            fs << tabs << "}" << endl;
+            fs << "(" << arg1 << ");" << std::endl;
+            fs << tabs << "}" << std::endl;
          } else
          if (narg==2) {
             TString arg1("arg1"), arg2("arg2"), ifcond;
-            fs << " {" << endl << tabs << tab1;
+            fs << " {" << std::endl << tabs << tab1;
             ReadSTLarg(fs, arg1, argtype[0], isargptr[0], argcl[0], argtname[0], ifcond);
             fs << tabs << tab1;
             ReadSTLarg(fs, arg2, argtype[1], isargptr[1], argcl[1], argtname[1], ifcond);
             fs << tabs << tab1;
             if (ifcond.Length()>0) fs << "if (" << ifcond << ") ";
             fs << accname << "insert(make_pair("
-               << arg1 << ", " << arg2 << "));" << endl;
-            fs << tabs << "}" << endl;
+               << arg1 << ", " << arg2 << "));" << std::endl;
+            fs << tabs << "}" << std::endl;
          }
       }
 
       if (isarr && el->GetArrayLength()) {
-         if (isptr) fs << tabs << "cont++;" << endl;
-         else fs << tabs << "(void*) cont = (char*) cont + sizeof(" << contcl->GetName() << ");" << endl;
-         fs << tab3 << "}" << endl;
+         if (isptr) fs << tabs << "cont++;" << std::endl;
+         else fs << tabs << "(void*) cont = (char*) cont + sizeof(" << contcl->GetName() << ");" << std::endl;
+         fs << tab3 << "}" << std::endl;
       }
 
-      fs << tab3 << "buf.EndSTLnode();" << endl;
-      fs << tab2 << "}" << endl;
+      fs << tab3 << "buf.EndSTLnode();" << std::endl;
+      fs << tab2 << "}" << std::endl;
    }
    return true;
 }
diff --git a/io/xml/src/TXMLSetup.cxx b/io/xml/src/TXMLSetup.cxx
index 925ad2f2a87..4fc83da85f5 100644
--- a/io/xml/src/TXMLSetup.cxx
+++ b/io/xml/src/TXMLSetup.cxx
@@ -205,11 +205,11 @@ void TXMLSetup::PrintSetup()
 {
    // show setup values
 
-   cout << " *** Setup printout ***" << endl;
-   cout << "Attribute mode = " << fXmlLayout << endl;
-   cout << "Store streamer infos = " << (fStoreStreamerInfos ? "true" : "false") << endl;
-   cout << "Use dtd = " << (fUseDtd ? "true" : "false") << endl;
-   cout << "Use name spaces = " << (fUseNamespaces ? "true" : "false") << endl;
+   std::cout << " *** Setup printout ***" << std::endl;
+   std::cout << "Attribute mode = " << fXmlLayout << std::endl;
+   std::cout << "Store streamer infos = " << (fStoreStreamerInfos ? "true" : "false") << std::endl;
+   std::cout << "Use dtd = " << (fUseDtd ? "true" : "false") << std::endl;
+   std::cout << "Use name spaces = " << (fUseNamespaces ? "true" : "false") << std::endl;
 }
 
 //______________________________________________________________________________
@@ -286,6 +286,6 @@ Int_t TXMLSetup::AtoI(const char* sbuf, Int_t def, const char* errinfo)
 
    if (sbuf) return atoi(sbuf);
    if (errinfo)
-      cerr << "<Error in TXMLSetup::AtoI>" << errinfo << " not valid integer: sbuf <NULL>" << endl;
+      std::cerr << "<Error in TXMLSetup::AtoI>" << errinfo << " not valid integer: sbuf <NULL>" << std::endl;
    return def;
 }
diff --git a/main/src/hadd.cxx b/main/src/hadd.cxx
index 46dfc867fc3..4b40d6a1e4e 100644
--- a/main/src/hadd.cxx
+++ b/main/src/hadd.cxx
@@ -76,23 +76,23 @@
 int main( int argc, char **argv )
 {
 
-   if ( argc < 3 || "-h" == string(argv[1]) || "--help" == string(argv[1]) ) {
-      cout << "Usage: " << argv[0] << " [-f[0-9]] [-k] [-T] [-O] [-n maxopenedfiles] [-v verbosity] targetfile source1 [source2 source3 ...]" << endl;
-      cout << "This program will add histograms from a list of root files and write them" << endl;
-      cout << "to a target root file. The target file is newly created and must not " << endl;
-      cout << "exist, or if -f (\"force\") is given, must not be one of the source files." << endl;
-      cout << "Supply at least two source files for this to make sense... ;-)" << endl;
-      cout << "If the option -k is used, hadd will not exit on corrupt or non-existant input files but skip the offending files instead." << endl;
-      cout << "If the option -T is used, Trees are not merged" <<endl;
-      cout << "If the option -O is used, when merging TTree, the basket size is re-optimized" <<endl;
-      cout << "If the option -v is used, explicitly set the verbosity level; 0 request no output, 99 is the default" <<endl;
-      cout << "If the option -n is used, hadd will open at most 'maxopenedfiles' at once, use 0 to request to use the system maximum." << endl;
-      cout << "When -the -f option is specified, one can also specify the compression" <<endl;
-      cout << "level of the target file. By default the compression level is 1, but" <<endl;
-      cout << "if \"-f0\" is specified, the target file will not be compressed." <<endl;
-      cout << "if \"-f6\" is specified, the compression level 6 will be used." <<endl;
-      cout << "if Target and source files have different compression levels"<<endl;
-      cout << " a slower method is used"<<endl;
+   if ( argc < 3 || "-h" == std::string(argv[1]) || "--help" == std::string(argv[1]) ) {
+      std::cout << "Usage: " << argv[0] << " [-f[0-9]] [-k] [-T] [-O] [-n maxopenedfiles] [-v verbosity] targetfile source1 [source2 source3 ...]" << std::endl;
+      std::cout << "This program will add histograms from a list of root files and write them" << std::endl;
+      std::cout << "to a target root file. The target file is newly created and must not " << std::endl;
+      std::cout << "exist, or if -f (\"force\") is given, must not be one of the source files." << std::endl;
+      std::cout << "Supply at least two source files for this to make sense... ;-)" << std::endl;
+      std::cout << "If the option -k is used, hadd will not exit on corrupt or non-existant input files but skip the offending files instead." << std::endl;
+      std::cout << "If the option -T is used, Trees are not merged" <<std::endl;
+      std::cout << "If the option -O is used, when merging TTree, the basket size is re-optimized" <<std::endl;
+      std::cout << "If the option -v is used, explicitly set the verbosity level; 0 request no output, 99 is the default" <<std::endl;
+      std::cout << "If the option -n is used, hadd will open at most 'maxopenedfiles' at once, use 0 to request to use the system maximum." << std::endl;
+      std::cout << "When -the -f option is specified, one can also specify the compression" <<std::endl;
+      std::cout << "level of the target file. By default the compression level is 1, but" <<std::endl;
+      std::cout << "if \"-f0\" is specified, the target file will not be compressed." <<std::endl;
+      std::cout << "if \"-f6\" is specified, the compression level 6 will be used." <<std::endl;
+      std::cout << "if Target and source files have different compression levels"<<std::endl;
+      std::cout << " a slower method is used"<<std::endl;
       return 1;
    }
 
@@ -121,7 +121,7 @@ int main( int argc, char **argv )
          ++ffirst;
       } else if ( strcmp(argv[a],"-n") == 0 ) {
          if (a+1 >= argc) {
-            cerr << "Error: no maximum number of opened was provided after -n.\n";
+            std::cerr << "Error: no maximum number of opened was provided after -n.\n";
          } else {
             Long_t request = strtol(argv[a+1], 0, 10);
             if (request < kMaxLong && request >= 0) {
@@ -129,13 +129,13 @@ int main( int argc, char **argv )
                ++a;
                ++ffirst;
             } else {
-               cerr << "Error: could not parse the max number of opened file passed after -n: " << argv[a+1] << ". We will use the system maximum.\n";
+               std::cerr << "Error: could not parse the max number of opened file passed after -n: " << argv[a+1] << ". We will use the system maximum.\n";
             }
          }
          ++ffirst;
       } else if ( strcmp(argv[a],"-v") == 0 ) {
          if (a+1 >= argc) {
-            cerr << "Error: no verbosity level was provided after -v.\n";
+            std::cerr << "Error: no verbosity level was provided after -v.\n";
          } else {
             Long_t request = strtol(argv[a+1], 0, 10);
             if (request < kMaxLong && request >= 0) {
@@ -143,7 +143,7 @@ int main( int argc, char **argv )
                ++a;
                ++ffirst;
             } else {
-               cerr << "Error: could not parse the verbosity level passed after -v: " << argv[a+1] << ". We will use the default value (99).\n";
+               std::cerr << "Error: could not parse the verbosity level passed after -v: " << argv[a+1] << ". We will use the default value (99).\n";
             }
          }
          ++ffirst;
@@ -160,7 +160,7 @@ int main( int argc, char **argv )
          }
          if (!force) {
             // Bad argument
-            cerr << "Error: option " << argv[a] << " is not a supported option.\n";
+            std::cerr << "Error: option " << argv[a] << " is not a supported option.\n";
             ++ffirst;
          }
       } else if (!outputPlace) {
@@ -178,7 +178,7 @@ int main( int argc, char **argv )
    }
       
    if (verbosity > 1) {
-      cout << "hadd Target file: " << targetname << endl;
+      std::cout << "hadd Target file: " << targetname << std::endl;
    }
 
    TFileMerger merger(kFALSE,kFALSE);
@@ -188,8 +188,8 @@ int main( int argc, char **argv )
       merger.SetMaxOpenedFiles(maxopenedfiles);
    }
    if (!merger.OutputFile(targetname,force,newcomp) ) {
-      cerr << "hadd error opening target file (does " << argv[ffirst-1] << " exist?)." << endl;
-      cerr << "Pass \"-f\" argument to force re-creation of output file." << endl;
+      std::cerr << "hadd error opening target file (does " << argv[ffirst-1] << " exist?)." << std::endl;
+      std::cerr << "Pass \"-f\" argument to force re-creation of output file." << std::endl;
       exit(1);
    }
 
@@ -209,9 +209,9 @@ int main( int argc, char **argv )
          }         
       } else if( ! merger.AddFile(argv[i]) ) {
          if ( skip_errors ) {
-            cerr << "hadd skipping file with error: " << argv[i] << endl;
+            std::cerr << "hadd skipping file with error: " << argv[i] << std::endl;
          } else {
-            cerr << "hadd exiting due to error in " << argv[i] << endl;
+            std::cerr << "hadd exiting due to error in " << argv[i] << std::endl;
             return 1;
          }
       }
@@ -221,8 +221,8 @@ int main( int argc, char **argv )
    } else {
       if (merger.HasCompressionChange()) {
          // Don't warn if the user any request re-optimization.
-         cout <<"hadd Sources and Target have different compression levels"<<endl;
-         cout <<"hadd merging will be slower"<<endl;
+         std::cout <<"hadd Sources and Target have different compression levels"<<std::endl;
+         std::cout <<"hadd merging will be slower"<<std::endl;
       }
    }
    merger.SetNotrees(noTrees);
@@ -230,12 +230,12 @@ int main( int argc, char **argv )
 
    if (status) {
       if (verbosity == 1) {
-         cout << "hadd merged " << merger.GetMergeList()->GetEntries() << " input files in " << targetname << ".\n";
+         std::cout << "hadd merged " << merger.GetMergeList()->GetEntries() << " input files in " << targetname << ".\n";
       }
       return 0;
    } else {
       if (verbosity == 1) {
-         cout << "hadd failure during the merge of " << merger.GetMergeList()->GetEntries() << " input files in " << targetname << ".\n";
+         std::cout << "hadd failure during the merge of " << merger.GetMergeList()->GetEntries() << " input files in " << targetname << ".\n";
       }
       return 1;
    }
diff --git a/math/foam/src/TFoam.cxx b/math/foam/src/TFoam.cxx
index 83b84fff190..1a38918d507 100644
--- a/math/foam/src/TFoam.cxx
+++ b/math/foam/src/TFoam.cxx
@@ -59,12 +59,12 @@
 //     FoamX->GetMCvect( MCvect);   // get generated vector (x,y)
 //     Double_t x=MCvect[0];
 //     Double_t y=MCvect[1];
-//     if(loop<10) cout<<"(x,y) =  ( "<< x <<", "<< y <<" )"<<endl;
+//     if(loop<10) std::cout<<"(x,y) =  ( "<< x <<", "<< y <<" )"<<std::endl;
 //     hst_xy->Fill(x,y);           // fill scattergram
 //   }// loop
 //   Double_t mcResult, mcError;
 //   FoamX->GetIntegMC( mcResult, mcError);  // get MC integral, should be one
-//   cout << " mcResult= " << mcResult << " +- " << mcError <<endl;
+//   std::cout << " mcResult= " << mcResult << " +- " << mcError <<std::endl;
 //   // now hst_xy will be plotted visualizing generated distribution
 //   TCanvas *cKanwa = new TCanvas("cKanwa","Canvas for plotting",600,600);
 //   cKanwa->cd();
@@ -134,27 +134,27 @@
 ClassImp(TFoam);
 
 //FFFFFF  BoX-FORMATs for nice and flexible outputs
-#define BXOPE cout<<\
-"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<endl<<\
-"F                                                                              F"<<endl
-#define BXTXT(text) cout<<\
-"F                   "<<setw(40)<<         text           <<"                   F"<<endl
-#define BX1I(name,numb,text) cout<<\
-"F "<<setw(10)<<name<<" = "<<setw(10)<<numb<<" = "          <<setw(50)<<text<<" F"<<endl
-#define BX1F(name,numb,text)     cout<<"F "<<setw(10)<<name<<\
-          " = "<<setw(15)<<setprecision(8)<<numb<<"   =    "<<setw(40)<<text<<" F"<<endl
-#define BX2F(name,numb,err,text) cout<<"F "<<setw(10)<<name<<\
-" = "<<setw(15)<<setprecision(8)<<numb<<" +- "<<setw(15)<<setprecision(8)<<err<<\
-                                                      "  = "<<setw(25)<<text<<" F"<<endl
-#define BXCLO cout<<\
-"F                                                                              F"<<endl<<\
-"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<endl
+#define BXOPE std::cout<<\
+"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl<<\
+"F                                                                              F"<<std::endl
+#define BXTXT(text) std::cout<<\
+"F                   "<<std::setw(40)<<         text           <<"                   F"<<std::endl
+#define BX1I(name,numb,text) std::cout<<\
+"F "<<std::setw(10)<<name<<" = "<<std::setw(10)<<numb<<" = "          <<std::setw(50)<<text<<" F"<<std::endl
+#define BX1F(name,numb,text)     std::cout<<"F "<<std::setw(10)<<name<<\
+          " = "<<std::setw(15)<<std::setprecision(8)<<numb<<"   =    "<<std::setw(40)<<text<<" F"<<std::endl
+#define BX2F(name,numb,err,text) std::cout<<"F "<<std::setw(10)<<name<<\
+" = "<<std::setw(15)<<std::setprecision(8)<<numb<<" +- "<<std::setw(15)<<std::setprecision(8)<<err<< \
+                                                      "  = "<<std::setw(25)<<text<<" F"<<std::endl
+#define BXCLO std::cout<<\
+"F                                                                              F"<<std::endl<<\
+"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl
   //FFFFFF  BoX-FORMATs ends here
 
 static const Double_t gHigh= 1.0e150;
 static const Double_t gVlow=-1.0e150;
 
-#define SW2 setprecision(7) << setw(12)
+#define SW2 setprecision(7) << std::setw(12)
 
 //________________________________________________________________________________________________
 TFoam::TFoam() : 
@@ -243,7 +243,7 @@ TFoam::TFoam(const Char_t* Name) :
 TFoam::~TFoam()
 {
 // Default destructor
-//  cout<<" DESTRUCTOR entered "<<endl;
+//  std::cout<<" DESTRUCTOR entered "<<std::endl;
    Int_t i;
 
    if(fCells!= 0) {
@@ -405,7 +405,7 @@ void TFoam::Initialize()
       hname+=i;
       htitle=TString("Edge Histogram No. ");
       htitle+=i;
-      //cout<<"i= "<<i<<"  hname= "<<hname<<"  htitle= "<<htitle<<endl;
+      //std::cout<<"i= "<<i<<"  hname= "<<hname<<"  htitle= "<<htitle<<std::endl;
       (*fHistEdg)[i] = new TH1D(hname.Data(),htitle.Data(),fNBin,0.0, 1.0); // Initialize histogram for each edge
       ((TH1D*)(*fHistEdg)[i])->Sumw2();
    }
@@ -425,9 +425,9 @@ void TFoam::Initialize()
    //
    //        Define and explore root cell(s)
    InitCells();
-   //        PrintCells(); cout<<" ===== after InitCells ====="<<endl;
+   //        PrintCells(); std::cout<<" ===== after InitCells ====="<<std::endl;
    Grow();
-   //        PrintCells(); cout<<" ===== after Grow      ====="<<endl;
+   //        PrintCells(); std::cout<<" ===== after Grow      ====="<<std::endl;
 
    MakeActiveList(); // Final Preperations for the M.C. generation
 
@@ -729,8 +729,8 @@ void TFoam::Varedu(Double_t ceSum[5], Int_t &kBest, Double_t &xBest, Double_t &y
          Int_t iLo = (Int_t) (fNBin*xMin);
          Int_t iUp = (Int_t) (fNBin*xMax);
          //----------DEBUG printout
-         //cout<<"@@@@@  xMin xMax = "<<xMin   <<" "<<xMax<<"  iLo= "<<iLo<<"  iUp= "<<iUp;
-         //cout<<"  sswtBest/ssw= "<<sswtBest/ssw<<"  Gain/ssw= "<< Gain/ssw<<endl;
+         //std::cout<<"@@@@@  xMin xMax = "<<xMin   <<" "<<xMax<<"  iLo= "<<iLo<<"  iUp= "<<iUp;
+         //std::cout<<"  sswtBest/ssw= "<<sswtBest/ssw<<"  Gain/ssw= "<< Gain/ssw<<std::endl;
          //----------DEBUG auxilary Plot
          for(Int_t iBin=1;iBin<=fNBin;iBin++) {
             if( ((iBin-0.5)/fNBin > xMin) && ((iBin-0.5)/fNBin < xMax) ){
@@ -750,7 +750,7 @@ void TFoam::Varedu(Double_t ceSum[5], Int_t &kBest, Double_t &xBest, Double_t &y
       }
    } //kProj
    //----------DEBUG printout
-   //cout<<"@@@@@@@>>>>> kBest= "<<kBest<<"  maxGain/ssw= "<< maxGain/ssw<<endl;
+   //std::cout<<"@@@@@@@>>>>> kBest= "<<kBest<<"  maxGain/ssw= "<< maxGain/ssw<<std::endl;
    if( (kBest >= fDim) || (kBest<0) ) Error("Varedu", "Something wrong with kBest \n" );
 }          //TFoam::Varedu
 
@@ -780,7 +780,7 @@ void TFoam::Carver(Int_t &kBest, Double_t &xBest, Double_t &yBest)
    for(kProj=0; kProj<fDim; kProj++)
       if( fMaskDiv[kProj] ) {
          //if( kProj==1 ){
-         //cout<<"==================== Carver histogram: kProj ="<<kProj<<"==================="<<endl;
+         //std::cout<<"==================== Carver histogram: kProj ="<<kProj<<"==================="<<std::endl;
          //((TH1D *)(*fHistEdg)[kProj])->Print("all");
          binMax = gVlow;
          for(iBin=0; iBin<fNBin;iBin++){
@@ -798,7 +798,7 @@ void TFoam::Carver(Int_t &kBest, Double_t &xBest, Double_t &yBest)
             binTot  +=bins[iBin];
          }
          // primTot = binMax*fNBin;
-         //cout <<"Carver:  CarvTot "<<CarvTot<< "    primTot "<<primTot<<endl;
+         //std::cout <<"Carver:  CarvTot "<<CarvTot<< "    primTot "<<primTot<<std::endl;
          jLow =0;
          jUp  =fNBin-1;
          carvOne = gVlow;
@@ -833,7 +833,7 @@ void TFoam::Carver(Int_t &kBest, Double_t &xBest, Double_t &yBest)
          if( carvTot > carvMax) {
             carvMax   = carvTot;
             //primMax   = primTot;
-            //cout <<"Carver:   primMax "<<primMax<<endl;
+            //std::cout <<"Carver:   primMax "<<primMax<<std::endl;
             kBest = kProj;    // Best edge
             xBest = ((Double_t)(jLow))/fNBin;
             yBest = ((Double_t)(jUp+1))/fNBin;
@@ -844,7 +844,7 @@ void TFoam::Carver(Int_t &kBest, Double_t &xBest, Double_t &yBest)
             // if(jLow == 0 )     jDivi=jUp+1;
          }
          //======  extra histograms for debug purposes
-         //cout<<"kProj= "<<kProj<<" jLow= "<<jLow<<" jUp= "<<jUp<<endl;
+         //std::cout<<"kProj= "<<kProj<<" jLow= "<<jLow<<" jUp= "<<jUp<<std::endl;
          for(iBin=0;    iBin<fNBin;  iBin++)
             ((TH1D *)(*fHistDbg)[kProj])->SetBinContent(iBin+1,binMax);
          for(iBin=jLow; iBin<jUp+1;   iBin++)
@@ -888,17 +888,17 @@ void TFoam::Grow()
          if( (fLastCe%kEcho)==0) {
 	   if (fChat>0) {
 	     if(fDim<10)
-	       cout<<fDim<<flush;
+	       std::cout<<fDim<<std::flush;
              else
-	       cout<<"."<<flush;
-	     if( (fLastCe%(100*kEcho))==0)  cout<<"|"<<fLastCe<<endl<<flush;
+	       std::cout<<"."<<std::flush;
+	     if( (fLastCe%(100*kEcho))==0)  std::cout<<"|"<<fLastCe<<std::endl<<std::flush;
 	   }
 	 }
       }
       if( Divide( newCell )==0) break;  // and divide it into two
    }
    if (fChat>0) {
-     cout<<endl<<flush;
+     std::cout<<std::endl<<std::flush;
    }
    CheckAll(0);   // set arg=1 for more info
 }// Grow
@@ -917,16 +917,16 @@ Long_t  TFoam::PeekMax()
    for(i=0; i<=fLastCe; i++) {//without root
       if( fCells[i]->GetStat() == 1 ) {
          driv =  TMath::Abs( fCells[i]->GetDriv());
-         //cout<<"PeekMax: Driv = "<<driv<<endl;
+         //std::cout<<"PeekMax: Driv = "<<driv<<std::endl;
          if(driv > drivMax) {
             drivMax = driv;
             iCell = i;
          }
       }
    }
-   //  cout << 'TFoam_PeekMax: iCell=' << iCell << endl;
+   //  std::cout << 'TFoam_PeekMax: iCell=' << iCell << std::endl;
    if (iCell == -1)
-      cout << "STOP in TFoam::PeekMax: not found iCell=" <<  iCell << endl;
+      std::cout << "STOP in TFoam::PeekMax: not found iCell=" <<  iCell << std::endl;
    return(iCell);
 }                 // TFoam_PeekMax
 
@@ -1375,13 +1375,13 @@ void  TFoam::SetXdivPRD(Int_t iDim, Int_t len, Double_t xDiv[])
       Error("SetXdivPRD", "Wrong iDim  \n");
    }
    // Priting predefined division points
-   cout<<" SetXdivPRD, idim= "<<iDim<<"  len= "<<len<<"   "<<endl;
+   std::cout<<" SetXdivPRD, idim= "<<iDim<<"  len= "<<len<<"   "<<std::endl;
    for(i=0; i<len; i++) {
-      if (iDim < fDim) cout<< (*fXdivPRD[iDim])[i] <<"  ";
+      if (iDim < fDim) std::cout<< (*fXdivPRD[iDim])[i] <<"  ";
    }
-   cout<<endl;
-   for(i=0; i<len; i++)  cout<< xDiv[i] <<"   ";
-   cout<<endl;
+   std::cout<<std::endl;
+   for(i=0; i<len; i++)  std::cout<< xDiv[i] <<"   ";
+   std::cout<<std::endl;
    //
 }//SetXdivPRD
 
@@ -1398,7 +1398,7 @@ void TFoam::CheckAll(Int_t level)
    Long_t iCell;
 
    errors = 0; warnings = 0;
-   if (level==1) cout << "///////////////////////////// FOAM_Checks /////////////////////////////////" << endl;
+   if (level==1) std::cout << "///////////////////////////// FOAM_Checks /////////////////////////////////" << std::endl;
    for(iCell=1; iCell<=fLastCe; iCell++) {
       cell = fCells[iCell];
       //  checking general rules
@@ -1464,11 +1464,11 @@ void TFoam::PrintCells(void)
    Long_t iCell;
 
    for(iCell=0; iCell<=fLastCe; iCell++) {
-      cout<<"Cell["<<iCell<<"]={ ";
-      //cout<<"  "<< fCells[iCell]<<"  ";  // extra DEBUG
-      cout<<endl;
+      std::cout<<"Cell["<<iCell<<"]={ ";
+      //std::cout<<"  "<< fCells[iCell]<<"  ";  // extra DEBUG
+      std::cout<<std::endl;
       fCells[iCell]->Print("1");
-      cout<<"}"<<endl;
+      std::cout<<"}"<<std::endl;
    }
 }
 
@@ -1478,35 +1478,35 @@ void TFoam::RootPlot2dim(Char_t *filename)
 // Debugging tool which plots 2-dimensional cells as rectangles
 // in C++ format readable for root
 
-   ofstream outfile(filename, ios::out);
+   std::ofstream outfile(filename, std::ios::out);
    Double_t   x1,y1,x2,y2,x,y;
    Long_t    iCell;
    Double_t offs =0.1;
    Double_t lpag   =1-2*offs;
-   outfile<<"{" << endl;
-   outfile<<"cMap = new TCanvas(\"Map1\",\" Cell Map \",600,600);"<<endl;
+   outfile<<"{" << std::endl;
+   outfile<<"cMap = new TCanvas(\"Map1\",\" Cell Map \",600,600);"<<std::endl;
    //
-   outfile<<"TBox*a=new TBox();"<<endl;
-   outfile<<"a->SetFillStyle(0);"<<endl;  // big frame
-   outfile<<"a->SetLineWidth(4);"<<endl;
-   outfile<<"a->SetLineColor(2);"<<endl;
-   outfile<<"a->DrawBox("<<offs<<","<<offs<<","<<(offs+lpag)<<","<<(offs+lpag)<<");"<<endl;
+   outfile<<"TBox*a=new TBox();"<<std::endl;
+   outfile<<"a->SetFillStyle(0);"<<std::endl;  // big frame
+   outfile<<"a->SetLineWidth(4);"<<std::endl;
+   outfile<<"a->SetLineColor(2);"<<std::endl;
+   outfile<<"a->DrawBox("<<offs<<","<<offs<<","<<(offs+lpag)<<","<<(offs+lpag)<<");"<<std::endl;
    //
-   outfile<<"TText*t=new TText();"<<endl;  // text for numbering
-   outfile<<"t->SetTextColor(4);"<<endl;
+   outfile<<"TText*t=new TText();"<<std::endl;  // text for numbering
+   outfile<<"t->SetTextColor(4);"<<std::endl;
    if(fLastCe<51)
-      outfile<<"t->SetTextSize(0.025);"<<endl;  // text for numbering
+      outfile<<"t->SetTextSize(0.025);"<<std::endl;  // text for numbering
    else if(fLastCe<251)
-      outfile<<"t->SetTextSize(0.015);"<<endl;
+      outfile<<"t->SetTextSize(0.015);"<<std::endl;
    else
-      outfile<<"t->SetTextSize(0.008);"<<endl;
+      outfile<<"t->SetTextSize(0.008);"<<std::endl;
    //
-   outfile<<"TBox*b=new TBox();"<<endl;  // single cell
-   outfile <<"b->SetFillStyle(0);"<<endl;
+   outfile<<"TBox*b=new TBox();"<<std::endl;  // single cell
+   outfile <<"b->SetFillStyle(0);"<<std::endl;
    //
    if(fDim==2 && fLastCe<=2000) {
       TFoamVect  cellPosi(fDim); TFoamVect  cellSize(fDim);
-      outfile << "// =========== Rectangular cells  ==========="<< endl;
+      outfile << "// =========== Rectangular cells  ==========="<< std::endl;
       for(iCell=1; iCell<=fLastCe; iCell++) {
          if( fCells[iCell]->GetStat() == 1) {
             fCells[iCell]->GetHcub(cellPosi,cellSize);
@@ -1514,19 +1514,19 @@ void TFoam::RootPlot2dim(Char_t *filename)
             x2 = offs+lpag*(cellPosi[0]+cellSize[0]); y2 = offs+lpag*(cellPosi[1]+cellSize[1]);
             //     cell rectangle
             if(fLastCe<=2000)
-            outfile<<"b->DrawBox("<<x1<<","<<y1<<","<<x2<<","<<y2<<");"<<endl;
+            outfile<<"b->DrawBox("<<x1<<","<<y1<<","<<x2<<","<<y2<<");"<<std::endl;
             //     cell number
             if(fLastCe<=250) {
                x = offs+lpag*(cellPosi[0]+0.5*cellSize[0]); y = offs+lpag*(cellPosi[1]+0.5*cellSize[1]);
-               outfile<<"t->DrawText("<<x<<","<<y<<","<<"\""<<iCell<<"\""<<");"<<endl;
+               outfile<<"t->DrawText("<<x<<","<<y<<","<<"\""<<iCell<<"\""<<");"<<std::endl;
             }
          }
       }
-      outfile<<"// ============== End Rectangles ==========="<< endl;
+      outfile<<"// ============== End Rectangles ==========="<< std::endl;
    }//kDim=2
    //
    //
-   outfile << "}" << endl;
+   outfile << "}" << std::endl;
    outfile.close();
 }
 
diff --git a/math/foam/src/TFoamCell.cxx b/math/foam/src/TFoamCell.cxx
index c197f5b81be..18254d56fce 100644
--- a/math/foam/src/TFoamCell.cxx
+++ b/math/foam/src/TFoamCell.cxx
@@ -186,25 +186,25 @@ void TFoamCell::Print(Option_t *option) const
 
    if(!option) Error("Print", "No option set\n");
 
-   cout <<  " Status= "<<     fStatus   <<",";
-   cout <<  " Volume= "<<     fVolume   <<",";
-   cout <<  " TrueInteg= " << fIntegral <<",";
-   cout <<  " DriveInteg= "<< fDrive    <<",";
-   cout <<  " PrimInteg= " << fPrimary  <<",";
-   cout<< endl;
-   cout <<  " Xdiv= "<<fXdiv<<",";
-   cout <<  " Best= "<<fBest<<",";
-   cout <<  " Parent=  {"<< (GetPare() ? GetPare()->GetSerial() : -1) <<"} "; // extra DEBUG
-   cout <<  " Daught0= {"<< (GetDau0() ? GetDau0()->GetSerial() : -1 )<<"} "; // extra DEBUG
-   cout <<  " Daught1= {"<< (GetDau1() ? GetDau1()->GetSerial()  : -1 )<<"} "; // extra DEBUG
-   cout<< endl;
+   std::cout <<  " Status= "<<     fStatus   <<",";
+   std::cout <<  " Volume= "<<     fVolume   <<",";
+   std::cout <<  " TrueInteg= " << fIntegral <<",";
+   std::cout <<  " DriveInteg= "<< fDrive    <<",";
+   std::cout <<  " PrimInteg= " << fPrimary  <<",";
+   std::cout<< std::endl;
+   std::cout <<  " Xdiv= "<<fXdiv<<",";
+   std::cout <<  " Best= "<<fBest<<",";
+   std::cout <<  " Parent=  {"<< (GetPare() ? GetPare()->GetSerial() : -1) <<"} "; // extra DEBUG
+   std::cout <<  " Daught0= {"<< (GetDau0() ? GetDau0()->GetSerial() : -1 )<<"} "; // extra DEBUG
+   std::cout <<  " Daught1= {"<< (GetDau1() ? GetDau1()->GetSerial()  : -1 )<<"} "; // extra DEBUG
+   std::cout<< std::endl;
    //
    //
    if(fDim>0 ) {
       TFoamVect cellPosi(fDim); TFoamVect cellSize(fDim);
       GetHcub(cellPosi,cellSize);
-      cout <<"   Posi= "; cellPosi.Print("1"); cout<<","<< endl;
-      cout <<"   Size= "; cellSize.Print("1"); cout<<","<< endl;
+      std::cout <<"   Posi= "; cellPosi.Print("1"); std::cout<<","<< std::endl;
+      std::cout <<"   Size= "; cellSize.Print("1"); std::cout<<","<< std::endl;
    }
 }
 ///////////////////////////////////////////////////////////////////
diff --git a/math/foam/src/TFoamMaxwt.cxx b/math/foam/src/TFoamMaxwt.cxx
index 5293c82c2ad..9845bd03970 100644
--- a/math/foam/src/TFoamMaxwt.cxx
+++ b/math/foam/src/TFoamMaxwt.cxx
@@ -103,10 +103,10 @@ void TFoamMaxwt::Make(Double_t eps, Double_t &MCeff)
    Double_t wtLim,aveWt;
    GetMCeff(eps, MCeff, wtLim);
    aveWt = MCeff*wtLim;
-   cout<< "00000000000000000000000000000000000000000000000000000000000000000000000"<<endl;
-   cout<< "00 -->wtLim: No_evt ="<<fNent<<"   <Wt> = "<<aveWt<<"  wtLim=  "<<wtLim<<endl;
-   cout<< "00 -->wtLim: For eps = "<<eps  <<"    EFFICIENCY <Wt>/wtLim= "<<MCeff<<endl;
-   cout<< "00000000000000000000000000000000000000000000000000000000000000000000000"<<endl;
+   std::cout<< "00000000000000000000000000000000000000000000000000000000000000000000000"<<std::endl;
+   std::cout<< "00 -->wtLim: No_evt ="<<fNent<<"   <Wt> = "<<aveWt<<"  wtLim=  "<<wtLim<<std::endl;
+   std::cout<< "00 -->wtLim: For eps = "<<eps  <<"    EFFICIENCY <Wt>/wtLim= "<<MCeff<<std::endl;
+   std::cout<< "00000000000000000000000000000000000000000000000000000000000000000000000"<<std::endl;
 }
 
 //_________________________________________________________________________________
@@ -131,7 +131,7 @@ void TFoamMaxwt::GetMCeff(Double_t eps, Double_t &MCeff, Double_t &wtLim)
       sumWt += fWtHst2->GetBinContent(ib);
    }
    if( (sum == 0.0) || (sumWt == 0.0) ) {
-      cout<<"TFoamMaxwt::Make: zero content of histogram !!!,sum,sumWt ="<<sum<<sumWt<<endl;
+      std::cout<<"TFoamMaxwt::Make: zero content of histogram !!!,sum,sumWt ="<<sum<<sumWt<<std::endl;
    }
    aveWt = sumWt/sum;
    //--------------------------------------
@@ -153,11 +153,11 @@ void TFoamMaxwt::GetMCeff(Double_t eps, Double_t &MCeff, Double_t &wtLim)
    if(ibX == (fnBin+1) ) {
       wtLim = 1.0e200;
       MCeff   = 0.0;
-      cout<< "+++++ wtLim undefined. Higher uper limit in histogram"<<endl;
+      std::cout<< "+++++ wtLim undefined. Higher uper limit in histogram"<<std::endl;
    } else if( ibX == 1) {
       wtLim = 0.0;
       MCeff   =-1.0;
-      cout<< "+++++ wtLim undefined. Lower uper limit or more bins "<<endl;
+      std::cout<< "+++++ wtLim undefined. Lower uper limit or more bins "<<std::endl;
    } else {
       wtLim= (ibX)*fwmax/fnBin; // We over-estimate wtLim, under-estimate MCeff
       MCeff  = aveWt/wtLim;
diff --git a/math/foam/src/TFoamVect.cxx b/math/foam/src/TFoamVect.cxx
index 6b0a1a130cd..15721ccf314 100644
--- a/math/foam/src/TFoamVect.cxx
+++ b/math/foam/src/TFoamVect.cxx
@@ -201,15 +201,15 @@ TFoamVect& TFoamVect::operator =(Double_t x)
 //_____________________________________________________________________________
 void TFoamVect::Print(Option_t *option) const
 {
-// Printout of all vector components on "cout"
+// Printout of all vector components on "std::cout"
    if(!option) Error("Print ", "No option set \n");
    Int_t i;
-   Int_t pr = cout.precision(7); 
-   cout << "(";
-   for(i=0; i<fDim-1; i++) cout  << setw(12) << *(fCoords+i) << ",";
-   cout  << setw(12) << *(fCoords+fDim-1);
-   cout << ")";
-   cout.precision(pr);
+   Int_t pr = std::cout.precision(7); 
+   std::cout << "(";
+   for(i=0; i<fDim-1; i++) std::cout  << std::setw(12) << *(fCoords+i) << ",";
+   std::cout  << std::setw(12) << *(fCoords+fDim-1);
+   std::cout << ")";
+   std::cout.precision(pr);
 }
 //______________________________________________________________________________
 void TFoamVect::PrintList(void)
@@ -219,9 +219,9 @@ void TFoamVect::PrintList(void)
    if(this == 0) return;
    TFoamVect *current=this;
    while(current != 0) {
-      cout<<"vec["<<i<<"]=";
+      std::cout<<"vec["<<i<<"]=";
       current->Print("1");
-      cout<<endl;
+      std::cout<<std::endl;
       current = current->fNext;
       i++;
    }
diff --git a/math/fumili/src/TFumili.cxx b/math/fumili/src/TFumili.cxx
index 7f268defec7..95439794b51 100644
--- a/math/fumili/src/TFumili.cxx
+++ b/math/fumili/src/TFumili.cxx
@@ -488,7 +488,7 @@ Int_t TFumili::ExecuteCommand(const char *command, Double_t *args, Int_t nargs){
          else
             if(fCmPar[0]==1.) {
                ReleaseParameter(fLastFixed);
-               cout <<fLastFixed<<endl;
+               std::cout <<fLastFixed<<std::endl;
             }
          return 0;
       case 10: // RELease <parno> ...
@@ -674,9 +674,9 @@ Int_t TFumili::ExecuteSetCommand(Int_t nargs){
             printf("%5s: ",fANames[nnn++].Data());
             for (Int_t j=0;j<=i;j++)
                printf("%11.2E",fZ[l++]);
-            cout<<endl;
+            std::cout<<std::endl;
          }
-         cout<<endl;
+         std::cout<<std::endl;
          return 0;
          }
       case 4:
@@ -686,7 +686,7 @@ Int_t TFumili::ExecuteSetCommand(Int_t nargs){
             printf("%5s: ",fANames[i].Data());
             printf("%11.3E\n",TMath::Sqrt(1-1/((fR[i]!=0.)?fR[i]:1.)) );
          }
-         cout<<endl;
+         std::cout<<std::endl;
          return 0;
       case 5:   // PRIntout not implemented
          return -10;
diff --git a/math/genetic/test/GAMinTutorial.cxx b/math/genetic/test/GAMinTutorial.cxx
index ba510d78971..8437ba1d2e8 100644
--- a/math/genetic/test/GAMinTutorial.cxx
+++ b/math/genetic/test/GAMinTutorial.cxx
@@ -47,7 +47,7 @@ int GAMinimize(ROOT::Math::IMultiGenFunction& chi2Func, double& xm1, double& xm2
    // minimize the function
    ROOT::Math::GeneticMinimizer* min = new ROOT::Math::GeneticMinimizer();
    if (min == 0) { 
-      cout << "Error creating minimizer " << endl;
+      std::cout << "Error creating minimizer " << std::endl;
       return -1;
    }
 
@@ -68,7 +68,7 @@ int GAMinimize(ROOT::Math::IMultiGenFunction& chi2Func, double& xm1, double& xm2
 
    for (unsigned int i = 0; i < chi2Func.NDim(); ++i) { 
 #ifdef DEBUG
-      cout << "set variable " << i << " to value " << x0[i] << endl;
+      std::cout << "set variable " << i << " to value " << x0[i] << std::endl;
 #endif
       if ( i == 3 || i == 6 )
           min->SetLimitedVariable(i,"x" + ROOT::Math::Util::ToString(i),x0[i], 0.1,2,8);
@@ -82,7 +82,7 @@ int GAMinimize(ROOT::Math::IMultiGenFunction& chi2Func, double& xm1, double& xm2
    min->MinValue(); 
 
    // show the results
-   cout << "Min values by GeneticMinimizer: " << min->X()[3] << "  " << min->X()[6] << endl;
+   std::cout << "Min values by GeneticMinimizer: " << min->X()[3] << "  " << min->X()[6] << std::endl;
    xm1 = min->X()[3];
    xm2 = min->X()[6];
 
@@ -95,7 +95,7 @@ const double* Min2Minimize(ROOT::Math::IMultiGenFunction& chi2Func, double xm1,
    // minimize the function
    ROOT::Math::Minimizer * min = ROOT::Math::Factory::CreateMinimizer("Minuit2", "Migrad");
    if (min == 0) { 
-      cout << "Error creating minimizer " << endl;
+      std::cout << "Error creating minimizer " << std::endl;
       exit(-1);
    }
 
@@ -114,7 +114,7 @@ const double* Min2Minimize(ROOT::Math::IMultiGenFunction& chi2Func, double xm1,
 
    for (unsigned int i = 0; i < chi2Func.NDim(); ++i) { 
 #ifdef DEBUG
-      cout << "set variable " << i << " to value " << x0[i] << endl;
+      std::cout << "set variable " << i << " to value " << x0[i] << std::endl;
 #endif
       min->SetVariable(i,"x" + ROOT::Math::Util::ToString(i),x0[i], 0.1);
    }
@@ -124,13 +124,13 @@ const double* Min2Minimize(ROOT::Math::IMultiGenFunction& chi2Func, double xm1,
    double minval = min->MinValue(); 
 
    // show the results
-   cout << "--------------------------------------" << endl;
-   cout << "Minuit2Minimizer(" << xm1 << "," << xm2 << ")" << endl;
-   cout << "chi2  min value " << minval << endl; 
-   cout << " x minimum values " << min->X()[3] << "  " << min->X()[6] << endl;
+   std::cout << "--------------------------------------" << std::endl;
+   std::cout << "Minuit2Minimizer(" << xm1 << "," << xm2 << ")" << std::endl;
+   std::cout << "chi2  min value " << minval << std::endl; 
+   std::cout << " x minimum values " << min->X()[3] << "  " << min->X()[6] << std::endl;
    for (unsigned int i = 0; i < chi2Func.NDim(); ++i)
-      cout << min->X()[i] << " ";
-   cout << endl;
+      std::cout << min->X()[i] << " ";
+   std::cout << std::endl;
 
    return min->X();
 }
diff --git a/math/genetic/test/testGAMinimizer.cxx b/math/genetic/test/testGAMinimizer.cxx
index 35b716dcff1..8a37493546e 100644
--- a/math/genetic/test/testGAMinimizer.cxx
+++ b/math/genetic/test/testGAMinimizer.cxx
@@ -27,7 +27,7 @@ public :
 
    inline double DoEval (const double * x) const { 
       fNCalls++;
-      //cout << "called!" << endl;
+      //std::cout << "called!" << std::endl;
       const Double_t xx = x[0];
       const Double_t yy = x[1];
       const Double_t tmp1 = yy-xx*xx;
@@ -77,7 +77,7 @@ int testGAMinimizer() {
    gaParabole.SetFunction(parabole);
    gaParabole.SetLimitedVariable(0, "x", 0, 0, -5, +5);
    gaParabole.Minimize();
-   cout << "Parabole min:" << gaParabole.MinValue() << endl;
+   std::cout << "Parabole min:" << gaParabole.MinValue() << std::endl;
 
    ROOT::Math::GeneticMinimizer gaRosenBrock;
    RosenBrockFunction RosenBrock;
@@ -86,16 +86,16 @@ int testGAMinimizer() {
    gaRosenBrock.SetLimitedVariable(0, "x", 0, 0, -5, +5);
    gaRosenBrock.Minimize();
    const double * xmin = gaRosenBrock.X(); 
-   cout << "RosenBrock min: [" << xmin[0] << "] [" << xmin[1] << "]" << endl;
+   std::cout << "RosenBrock min: [" << xmin[0] << "] [" << xmin[1] << "]" << std::endl;
 
    ROOT::Math::GeneticMinimizer gaMultiMin;
    MultiMin multimin;
    gaMultiMin.SetFunction(multimin);
    gaMultiMin.SetLimitedVariable(0, "x", 0, 0, -5, +5);
    gaMultiMin.Minimize();
-   cout << "MultiMin min:" << gaMultiMin.MinValue() << endl;
+   std::cout << "MultiMin min:" << gaMultiMin.MinValue() << std::endl;
 
-   cout << "Done!" << endl;
+   std::cout << "Done!" << std::endl;
 
    return status;
 }
diff --git a/math/genetic/test/timeGA.cxx b/math/genetic/test/timeGA.cxx
index 4749abeb769..3dfe1877432 100644
--- a/math/genetic/test/timeGA.cxx
+++ b/math/genetic/test/timeGA.cxx
@@ -44,7 +44,7 @@ int GAMinimize(ROOT::Math::IMultiGenFunction& chi2Func, double& xm1, double& xm2
    // minimize the function
    ROOT::Math::GeneticMinimizer* min = new ROOT::Math::GeneticMinimizer();
    if (min == 0) { 
-      cout << "Error creating minimizer " << endl;
+      std::cout << "Error creating minimizer " << std::endl;
       return -1;
    }
 
@@ -65,7 +65,7 @@ int GAMinimize(ROOT::Math::IMultiGenFunction& chi2Func, double& xm1, double& xm2
 
    for (unsigned int i = 0; i < chi2Func.NDim(); ++i) { 
 #ifdef DEBUG
-      cout << "set variable " << i << " to value " << x0[i] << endl;
+      std::cout << "set variable " << i << " to value " << x0[i] << std::endl;
 #endif
       if ( i == 3 || i == 6 )
           min->SetLimitedVariable(i,"x" + ROOT::Math::Util::ToString(i),x0[i], 0.1,2,8);
@@ -79,7 +79,7 @@ int GAMinimize(ROOT::Math::IMultiGenFunction& chi2Func, double& xm1, double& xm2
    min->MinValue(); 
 
    // show the results
-   cout << "Min values by GeneticMinimizer: " << min->X()[3] << "  " << min->X()[6] << endl;
+   std::cout << "Min values by GeneticMinimizer: " << min->X()[3] << "  " << min->X()[6] << std::endl;
    xm1 = min->X()[3];
    xm2 = min->X()[6];
 
@@ -114,7 +114,7 @@ int GAMinTutorial()
    t.Start();
    GAMinimize(chi2Func, x1,x2);
    t.Stop();
-   cout << "Time :\t " << t.RealTime() << " " << t.CpuTime() << endl;
+   std::cout << "Time :\t " << t.RealTime() << " " << t.CpuTime() << std::endl;
 
    return 0; 
 }
diff --git a/math/genvector/inc/Math/LinkDef_GenVector2.h b/math/genvector/inc/Math/LinkDef_GenVector2.h
index 7a3391e6487..d4d6a492821 100644
--- a/math/genvector/inc/Math/LinkDef_GenVector2.h
+++ b/math/genvector/inc/Math/LinkDef_GenVector2.h
@@ -8,14 +8,14 @@
 
 // conflict on solaris between template class T from std::vector and T(). 
 #ifndef __sun      
-#pragma link C++ class vector<ROOT::Math::XYZTVector >+;
-#pragma link C++ class vector<ROOT::Math::PtEtaPhiEVector >+;
+#pragma link C++ class std::vector<ROOT::Math::XYZTVector >+;
+#pragma link C++ class std::vector<ROOT::Math::PtEtaPhiEVector >+;
 #endif
 
-#pragma link C++ class vector<ROOT::Math::XYZVector >+;
-#pragma link C++ class vector<ROOT::Math::XYZPoint >+;
+#pragma link C++ class std::vector<ROOT::Math::XYZVector >+;
+#pragma link C++ class std::vector<ROOT::Math::XYZPoint >+;
 
-#pragma link C++ class vector<ROOT::Math::RhoEtaPhiVector >+;
-#pragma link C++ class vector<ROOT::Math::RhoEtaPhiPoint >+;
+#pragma link C++ class std::vector<ROOT::Math::RhoEtaPhiVector >+;
+#pragma link C++ class std::vector<ROOT::Math::RhoEtaPhiPoint >+;
 
 #endif       // endif Win32
diff --git a/math/genvector/test/TrackLinkDef.h b/math/genvector/test/TrackLinkDef.h
index e7ba45e3116..cc953a68d58 100644
--- a/math/genvector/test/TrackLinkDef.h
+++ b/math/genvector/test/TrackLinkDef.h
@@ -13,8 +13,8 @@
 #pragma extra_include "vector";
 #include <vector>
 
-#pragma link C++ class vector<ROOT::Math::XYZPoint >+;
-#pragma link C++ class vector<TrackD >+;
+#pragma link C++ class std::vector<ROOT::Math::XYZPoint >+;
+#pragma link C++ class std::vector<TrackD >+;
 
 #pragma link C++ class VecTrackD+;
 #pragma link C++ class ClusterD+;
diff --git a/math/mathcore/inc/Fit/SparseData.h b/math/mathcore/inc/Fit/SparseData.h
index ffe74949151..f8eecdd4175 100644
--- a/math/mathcore/inc/Fit/SparseData.h
+++ b/math/mathcore/inc/Fit/SparseData.h
@@ -25,7 +25,7 @@ namespace ROOT {
 
    namespace Fit { 
 
-      // This is a proxy to a list<Box>
+      // This is a proxy to a std::list<Box>
       class ProxyListBox;
 
       class SparseData : public FitData  { 
diff --git a/math/mathcore/inc/LinkDef1.h b/math/mathcore/inc/LinkDef1.h
index 3dc2b71feb2..247a257431f 100644
--- a/math/mathcore/inc/LinkDef1.h
+++ b/math/mathcore/inc/LinkDef1.h
@@ -27,8 +27,8 @@
 #pragma link C++ function operator+(Double_t, const TComplex&);
 #pragma link C++ function operator/(Double_t, const TComplex&);
 #pragma link C++ function operator-(Double_t, const TComplex&);
-#pragma link C++ function operator>>(istream&,TComplex&);
-#pragma link C++ function operator<<(ostream&,const TComplex&);
+#pragma link C++ function operator>>(std::istream&,TComplex&);
+#pragma link C++ function operator<<(std::ostream&,const TComplex&);
 
 #pragma link C++ function TMath::Limits<Double_t>::Min();
 #pragma link C++ function TMath::Limits<Double_t>::Max();
diff --git a/math/mathcore/inc/LinkDef2.h b/math/mathcore/inc/LinkDef2.h
index fb9da621cb7..a45bd2bf2ee 100644
--- a/math/mathcore/inc/LinkDef2.h
+++ b/math/mathcore/inc/LinkDef2.h
@@ -26,15 +26,15 @@
 //#pragma link C++ class ROOT::Math;
 #endif
 
-#pragma link C++ class vector<Double_t>+;
-#pragma link C++ operators vector<Double_t>;
+#pragma link C++ class std::vector<Double_t>+;
+#pragma link C++ operators std::vector<Double_t>;
 #ifdef G__VECTOR_HAS_CLASS_ITERATOR
-#pragma link C++ class vector<Double_t>::iterator; 
-#pragma link C++ class vector<Double_t>::const_iterator; 
-#pragma link C++ class vector<Double_t>::reverse_iterator; 
-#pragma link C++ operators vector<Double_t>::iterator; 
-#pragma link C++ operators vector<Double_t>::const_iterator; 
-#pragma link C++ operators vector<Double_t>::reverse_iterator; 
+#pragma link C++ class std::vector<Double_t>::iterator; 
+#pragma link C++ class std::vector<Double_t>::const_iterator; 
+#pragma link C++ class std::vector<Double_t>::reverse_iterator; 
+#pragma link C++ operators std::vector<Double_t>::iterator; 
+#pragma link C++ operators std::vector<Double_t>::const_iterator; 
+#pragma link C++ operators std::vector<Double_t>::reverse_iterator; 
 #endif
 
 #pragma link C++ global gRandom;
@@ -128,7 +128,7 @@
 #pragma link C++ class ROOT::Math::DistSampler+;
 #pragma link C++ class ROOT::Math::DistSamplerOptions+;
 #pragma link C++ class ROOT::Math::GoFTest+;
-#pragma link C++ class vector<vector<double> >+;
+#pragma link C++ class std::vector<std::vector<double> >+;
 
 #pragma link C++ class ROOT::Math::TDataPoint<1,Float_t>+;
 #pragma link C++ typedef ROOT::Math::TDataPoint1F;
diff --git a/math/mathcore/inc/LinkDef3.h b/math/mathcore/inc/LinkDef3.h
index e619c647ac7..7fcf1a89451 100644
--- a/math/mathcore/inc/LinkDef3.h
+++ b/math/mathcore/inc/LinkDef3.h
@@ -61,6 +61,6 @@
 #pragma link C++ function ROOT::Fit::Fitter::LikelihoodFit(const ROOT::Fit::BinData &, bool);
 #pragma link C++ function ROOT::Fit::Fitter::LikelihoodFit(const ROOT::Fit::UnBinData &, bool);
 
-#pragma link C++ class vector<ROOT::Fit::ParameterSettings>;
+#pragma link C++ class std::vector<ROOT::Fit::ParameterSettings>;
 
 #endif
diff --git a/math/mathcore/inc/Math/Error.h b/math/mathcore/inc/Math/Error.h
index ade5f84f02b..0e3cb743d59 100644
--- a/math/mathcore/inc/Math/Error.h
+++ b/math/mathcore/inc/Math/Error.h
@@ -24,12 +24,12 @@
 /** 
    Pre-processor macro to report messages 
    which can be configured to use ROOT error or 
-   simply an iostream in case of stan-alone builds
+   simply an std::iostream in case of stan-alone builds
 */
 
 #ifndef USE_ROOT_ERROR
 
-// use iostream instead of ROOT 
+// use std::iostream instead of ROOT 
 
 #include <iostream>
 
diff --git a/math/mathcore/inc/TComplex.h b/math/mathcore/inc/TComplex.h
index f68d927dfb1..144d9440ecf 100644
--- a/math/mathcore/inc/TComplex.h
+++ b/math/mathcore/inc/TComplex.h
@@ -181,8 +181,8 @@ public:
      {return Max(lb,Min(c,ub));}
 
    // I/O
-   friend ostream& operator<<(ostream& out, const TComplex& c);
-   friend istream& operator>>(istream& in, TComplex& c);
+   friend std::ostream& operator<<(std::ostream& out, const TComplex& c);
+   friend std::istream& operator>>(std::istream& in, TComplex& c);
 
    ClassDef(TComplex,1)  //Complex Class
 };
diff --git a/math/mathcore/src/GenAlgoOptions.cxx b/math/mathcore/src/GenAlgoOptions.cxx
index 2a423bde2a3..318263959e0 100644
--- a/math/mathcore/src/GenAlgoOptions.cxx
+++ b/math/mathcore/src/GenAlgoOptions.cxx
@@ -8,7 +8,7 @@
  **********************************************************************/
 
 // implementation file for static methods of GenAlgoOptions
-// this file contains also the pointer to the static map<algorithm name, options> 
+// this file contains also the pointer to the static std::map<algorithm name, options> 
 
 #include "Math/GenAlgoOptions.h"
 #include <cassert>
diff --git a/math/mathcore/src/TComplex.cxx b/math/mathcore/src/TComplex.cxx
index 8f4d146b9ca..4fa5b0d4bce 100644
--- a/math/mathcore/src/TComplex.cxx
+++ b/math/mathcore/src/TComplex.cxx
@@ -37,14 +37,14 @@ TComplex::TComplex(Double_t re, Double_t im, Bool_t polar) : fRe(re), fIm(im)
 }
 
 //______________________________________________________________________________
-ostream& operator<<(ostream& out, const TComplex& c)
+std::ostream& operator<<(std::ostream& out, const TComplex& c)
 {
    out << "(" << c.fRe << "," << c.fIm << "i)";
    return out;
 }
 
 //______________________________________________________________________________
-istream& operator>>(istream& in, TComplex& c)
+std::istream& operator>>(std::istream& in, TComplex& c)
 {
    in >> c.fRe >> c.fIm;
    return in;
diff --git a/math/mathcore/src/TMath.cxx b/math/mathcore/src/TMath.cxx
index d6c70d17633..931e1a0a857 100644
--- a/math/mathcore/src/TMath.cxx
+++ b/math/mathcore/src/TMath.cxx
@@ -431,7 +431,7 @@ Double_t TMath::GamCf(Double_t a,Double_t x)
       del = d*c;
       h   = h*del;
       if (Abs(del-1) < eps) break;
-      //if (i==itmax) cout << "*GamCf(a,x)* a too large or itmax too small" << endl;
+      //if (i==itmax) std::cout << "*GamCf(a,x)* a too large or itmax too small" << std::endl;
    }
    Double_t v = Exp(-x+a*Log(x)-gln)*h;
    return (1-v);
@@ -459,7 +459,7 @@ Double_t TMath::GamSer(Double_t a,Double_t x)
       del  = del*x/ap;
       sum += del;
       if (TMath::Abs(del) < Abs(sum*eps)) break;
-      //if (n==itmax) cout << "*GamSer(a,x)* a too large or itmax too small" << endl;
+      //if (n==itmax) std::cout << "*GamSer(a,x)* a too large or itmax too small" << std::endl;
    }
    Double_t v = sum*Exp(-x+a*Log(x)-gln);
    return v;
diff --git a/math/mathcore/test/stressTMath.cxx b/math/mathcore/test/stressTMath.cxx
index f27943923f8..3b07368d10c 100644
--- a/math/mathcore/test/stressTMath.cxx
+++ b/math/mathcore/test/stressTMath.cxx
@@ -26,8 +26,8 @@ double Time(TStopwatch & w) {
 
 template <typename T> double stressVector(unsigned int size, const char* type)
 {
-   cout << "Generating random vector of '" 
-        << type << "' and size " << size << " ..." << endl << endl;
+   std::cout << "Generating random vector of '" 
+        << type << "' and size " << size << " ..." << std::endl << std::endl;
 
    double totalTime = 0;
    double totalUnitTime = 0;
@@ -37,7 +37,7 @@ template <typename T> double stressVector(unsigned int size, const char* type)
 
 #ifdef DEBUG
    for ( unsigned int i = 0; i < size; ++i )
-      cout << vector[i] << " " << endl;
+      std::cout << vector[i] << " " << std::endl;
 #endif
 
    TStopwatch w;
@@ -48,8 +48,8 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::MinElement(size, vector);
    w.Stop();
-   cout << "MinMaxElement() \tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "MinMaxElement() \tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
@@ -58,8 +58,8 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::LocMin(size, vector);
    w.Stop();
-   cout << "LocMin/Max() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "LocMin/Max() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
@@ -68,8 +68,8 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::Mean(size, vector);
    w.Stop();
-   cout << "Mean() \t\t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "Mean() \t\t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
@@ -78,8 +78,8 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::Median(size, vector);
    w.Stop();
-   cout << "Median() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "Median() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
@@ -88,8 +88,8 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::RMS(size, vector);
    w.Stop();
-   cout << "RMS() \t\t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "RMS() \t\t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
@@ -98,8 +98,8 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::GeomMean(size, vector);
    w.Stop();
-   cout << "GeomMean() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "GeomMean() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
@@ -109,28 +109,28 @@ template <typename T> double stressVector(unsigned int size, const char* type)
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::Sort(size, vector, index, kFALSE);
    w.Stop();
-   cout << "Sort() \t\t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "Sort() \t\t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
    std::sort(vector, vector + size);
 #ifdef DEBUG
    for ( unsigned int i = 0; i < size; ++i )
-      cout << vector[i] << " " << endl;
+      std::cout << vector[i] << " " << std::endl;
 #endif
    ntest = 20000*NUMTEST;
    w.Start( kTRUE );
    for ( unsigned int i = 0; i < ntest; ++i )
       TMath::BinarySearch(size, vector, vector[ i % size ]);
    w.Stop();
-   cout << "BinarySearch() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
-        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << endl;
+   std::cout << "BinarySearch() \t\tTotal Time: " << Time(w) << "  (s)\t\t" 
+        << " Time/call: " << Time(w)/(ntest)*1.E6 << "   (microsec)" << std::endl;
    totalUnitTime += Time(w)/ntest;
    totalTime += Time(w);
 
-   cout << "\nTotal Time :       "      << totalTime     << "  (s)\n"
-        <<   "Total Time/call :  " << totalUnitTime*1.E3 << "  (ms)\n" << endl;
+   std::cout << "\nTotal Time :       "      << totalTime     << "  (s)\n"
+        <<   "Total Time/call :  " << totalUnitTime*1.E3 << "  (ms)\n" << std::endl;
 
    delete [] vector;
    delete [] index;
@@ -142,7 +142,7 @@ void stressTMath(unsigned int size, const char * type)
 {
    double totalTime = 0;
    
-   cout << "Stress Test Start..." << endl;
+   std::cout << "Stress Test Start..." << std::endl;
 
    if ( strcmp(type, "Short_t") == 0 )
       totalTime += stressVector<Short_t>(size, type);
@@ -157,9 +157,9 @@ void stressTMath(unsigned int size, const char * type)
    else
       totalTime += stressVector<Double_t>(size, "Double_t");
    
-   //cout << "Total Test Time: " << totalTime << "\n" << endl;
+   //std::cout << "Total Test Time: " << totalTime << "\n" << std::endl;
 
-   cout << "End of Stress Test..." << endl;
+   std::cout << "End of Stress Test..." << std::endl;
 
    return;
 }
@@ -173,7 +173,7 @@ int main(int argc, char* argv[])
       
    if ( argc > 1 ) { 
       if (strcmp(argv[1], "-h") == 0) { 
-         cout << "Usage: " << argv[0]
+         std::cout << "Usage: " << argv[0]
               << " [TYPE OF ARRAY] [SIZE OF ARRAY]\n\n"
               << "where [TYPE OF ARRAY] is one of the following:\n"
               << "\t\"Short_t\"\n"
@@ -182,7 +182,7 @@ int main(int argc, char* argv[])
               << "\t\"Long_t\"\n"
               << "\t\"Long64_t\"\n"
               << "\t \"Double_t\"\n"
-              << endl;
+              << std::endl;
          return 1;
       }
       type = argv[1];
diff --git a/math/mathcore/test/testSampleQuantiles.cxx b/math/mathcore/test/testSampleQuantiles.cxx
index d0b27dc299c..38d3b327b1d 100644
--- a/math/mathcore/test/testSampleQuantiles.cxx
+++ b/math/mathcore/test/testSampleQuantiles.cxx
@@ -40,10 +40,10 @@ bool testQuantiles(int type = 0, bool sorted = true) {
       std::random_shuffle(x, x+10);
       if (debug) { 
          std::cout << "shuffle data " << std::endl;
-         cout << " data = { ";
+         std::cout << " data = { ";
          for (int i = 0; i < n; ++i) 
-            cout << x[i] << "  ";
-         cout << " }\n";      
+            std::cout << x[i] << "  ";
+         std::cout << " }\n";      
       }
    }
     
@@ -57,31 +57,31 @@ bool testQuantiles(int type = 0, bool sorted = true) {
       for (int i = 0; i < np; ++i) { 
          printf("  %5.2f ",p[i]);
       }
-      cout << endl;
+      std::cout << std::endl;
       for (int i = 0; i < np; ++i) { 
          printf("  %5.3f ",quant[i]);
       }
-      cout << endl;
+      std::cout << std::endl;
    }
 
    // test if result is OK
    if (type == 0) type = 7; 
    if (type < 0) type = - type;
    bool ok = true; 
-   cout << "Testing for type " << type << " :\t\t"; 
+   std::cout << "Testing for type " << type << " :\t\t"; 
    for (int i = 0; i < np; ++i) {       
       double r_result = result[ (type-1)*np + i];
       if (TMath::AreEqualAbs(quant[i], r_result, 1.E-6) )
-         cout << ".";
+         std::cout << ".";
       else { 
-         cout << "  Failed for prob = " << p[i] << " -  R gives " << r_result << " TMath gives " << quant[i] << std::endl;
+         std::cout << "  Failed for prob = " << p[i] << " -  R gives " << r_result << " TMath gives " << quant[i] << std::endl;
          ok = false; 
       }
    }
    if (ok) 
-      cout << "\t OK !\n";
+      std::cout << "\t OK !\n";
    else
-      cout << "\nTest Failed for type " << type << std::endl;
+      std::cout << "\nTest Failed for type " << type << std::endl;
 
    return ok;
 }
@@ -96,18 +96,18 @@ int main(int argc,  char *argv[]) {
    }
 
    bool ok = true; 
-   cout << "Test ordered data ....\n";
+   std::cout << "Test ordered data ....\n";
    //itype == 0 is considered the defafult
    for (int itype = 0; itype < 10; ++itype) { 
       ok &= testQuantiles(itype,true);
    }
-   cout << "\nTest  data in random order....\n";
+   std::cout << "\nTest  data in random order....\n";
    for (int itype = 0; itype < 10; ++itype) { 
       ok &= testQuantiles(itype,false);
    }
 
    if (!ok) { 
-      cout << "Test sample quantiles FAILED " << endl;
+      std::cout << "Test sample quantiles FAILED " << std::endl;
       return -1;
    } 
    return 0;
diff --git a/math/mathcore/test/testSpecFuncSiCi.cxx b/math/mathcore/test/testSpecFuncSiCi.cxx
index 264b131ef1a..b3c1fa7e457 100644
--- a/math/mathcore/test/testSpecFuncSiCi.cxx
+++ b/math/mathcore/test/testSpecFuncSiCi.cxx
@@ -429,17 +429,17 @@ int testSiCi() {
       xmaxrel = x;
     }
     
-//     cout << "x=" << x << ": Si(x) = " << SiMathematica
+//     std::cout << "x=" << x << ": Si(x) = " << SiMathematica
 //          << ", sinint(x) = " << SiRoot
 //          << ", rel. diff = " << SiRoot/SiMathematica-1
-//          << endl;
+//          << std::endl;
   }
-  cout << "Si: Maximum relative deviation: " << maxrel
+  std::cout << "Si: Maximum relative deviation: " << maxrel
        << " for x=" << xmaxrel 
-       << (maxrel > 1E-15 ? " -> FAIL" : " -> pass") << endl;
-  cout << "Si: Maximum absolute deviation: " << maxabs
+       << (maxrel > 1E-15 ? " -> FAIL" : " -> pass") << std::endl;
+  std::cout << "Si: Maximum absolute deviation: " << maxabs
        << " for x=" << xmaxabs 
-       << (maxabs > 1E-15 ? " -> FAIL" : " -> pass") << endl;
+       << (maxabs > 1E-15 ? " -> FAIL" : " -> pass") << std::endl;
   if (maxrel > 1E-15) fail += 1;
   if (maxabs > 1E-15) fail += 2;
   
@@ -456,17 +456,17 @@ int testSiCi() {
       maxrel = std::fabs(CiRoot/CiMathematica-1);
       xmaxrel = x;
     }
-//     cout << "x=" << x << ": Ci(x) = " << CiMathematica
+//     std::cout << "x=" << x << ": Ci(x) = " << CiMathematica
 //          << ", cosint(x) = " << CiRoot
 //          << ", rel. diff = " << CiRoot/CiMathematica-1
-//          << endl;
+//          << std::endl;
   }
-  cout << "Ci: Maximum relative deviation: " << maxrel
+  std::cout << "Ci: Maximum relative deviation: " << maxrel
        << " for x=" << xmaxrel
-       << (maxrel > 1E-13 ? " -> FAIL" : " -> pass") <<endl;
-  cout << "Ci: Maximum absolute deviation: " << maxabs
+       << (maxrel > 1E-13 ? " -> FAIL" : " -> pass") <<std::endl;
+  std::cout << "Ci: Maximum absolute deviation: " << maxabs
        << " for x=" << xmaxabs 
-       << (maxabs > 1E-15 ? " -> FAIL" : " -> pass")<< endl;
+       << (maxabs > 1E-15 ? " -> FAIL" : " -> pass")<< std::endl;
    
   if (maxrel > 1E-13) fail += 4;
   if (maxabs > 1E-15) fail += 8;
diff --git a/math/mathmore/inc/Math/GSLSimAnnealing.h b/math/mathmore/inc/Math/GSLSimAnnealing.h
index bba1783ed5c..d5479e3b9e7 100644
--- a/math/mathmore/inc/Math/GSLSimAnnealing.h
+++ b/math/mathmore/inc/Math/GSLSimAnnealing.h
@@ -114,7 +114,7 @@ public:
    virtual double Distance(const GSLSimAnFunc & func) const; 
 
    /**
-      print the position in the standard output ostream 
+      print the position in the standard output std::ostream 
       GSL prints in addition n iteration, n function calls, temperature and energy
       re-implement by derived classes if necessary
     */
diff --git a/math/mathmore/src/GSLSimAnnealing.cxx b/math/mathmore/src/GSLSimAnnealing.cxx
index 92091ac967b..100f6bda9a9 100644
--- a/math/mathmore/src/GSLSimAnnealing.cxx
+++ b/math/mathmore/src/GSLSimAnnealing.cxx
@@ -81,7 +81,7 @@ double GSLSimAnFunc::Distance(const GSLSimAnFunc & f) const {
 } 
 
 void GSLSimAnFunc::Print() { 
-   // print the position  x in standard ostream 
+   // print the position  x in standard std::ostream 
    // GSL prints also niter-  ntrials - temperature and then the energy and energy min value (from 1.10)
    std::cout << "\tx = ( "; 
    unsigned n = NDim(); 
diff --git a/math/mathmore/test/simanTSP.cxx b/math/mathmore/test/simanTSP.cxx
index f730d1bae4f..e2a569dea2f 100644
--- a/math/mathmore/test/simanTSP.cxx
+++ b/math/mathmore/test/simanTSP.cxx
@@ -453,10 +453,10 @@ int main(int argc, char **argv)
 
    if ( argc > 1 && argc != 2 )
    {
-      cerr << "Usage: " << argv[0] << " [-ng]\n";
-      cerr << "  where:\n";
-      cerr << "     -ng : no graphics mode";
-      cerr << endl;
+      std::cerr << "Usage: " << argv[0] << " [-ng]\n";
+      std::cerr << "  where:\n";
+      std::cerr << "     -ng : no graphics mode";
+      std::cerr << std::endl;
       exit(1);
    }
 
diff --git a/math/mathmore/test/testIntegrationMultiDim.cxx b/math/mathmore/test/testIntegrationMultiDim.cxx
index fae76ff4103..4b759c738da 100644
--- a/math/mathmore/test/testIntegrationMultiDim.cxx
+++ b/math/mathmore/test/testIntegrationMultiDim.cxx
@@ -260,10 +260,10 @@ int main(int argc, char **argv)
 
    if ( argc > 1 && argc != 2 )
    {
-      cerr << "Usage: " << argv[0] << " [-ng]\n";
-      cerr << "  where:\n";
-      cerr << "     -ng : no graphics mode";
-      cerr << endl;
+      std::cerr << "Usage: " << argv[0] << " [-ng]\n";
+      std::cerr << "  where:\n";
+      std::cerr << "     -ng : no graphics mode";
+      std::cerr << std::endl;
       exit(1);
    }
 
diff --git a/math/mathmore/test/testInterpolation.cxx b/math/mathmore/test/testInterpolation.cxx
index fd2bf587ba2..3e91224904e 100644
--- a/math/mathmore/test/testInterpolation.cxx
+++ b/math/mathmore/test/testInterpolation.cxx
@@ -141,10 +141,10 @@ int main(int argc, char **argv)
 
    if ( argc > 1 && argc != 2 )
    {
-      cerr << "Usage: " << argv[0] << " [-ng]\n";
-      cerr << "  where:\n";
-      cerr << "     -ng : no graphics mode";
-      cerr << endl;
+      std::cerr << "Usage: " << argv[0] << " [-ng]\n";
+      std::cerr << "  where:\n";
+      std::cerr << "     -ng : no graphics mode";
+      std::cerr << std::endl;
       exit(1);
    }
 
diff --git a/math/mathmore/test/testRandom.cxx b/math/mathmore/test/testRandom.cxx
index c3a45b6d8b8..2cbd1712c7f 100644
--- a/math/mathmore/test/testRandom.cxx
+++ b/math/mathmore/test/testRandom.cxx
@@ -266,7 +266,7 @@ int main() {
      return -1;
   }
   // save the generated number
-  ofstream file("testRandom.out");
+  std::ofstream file("testRandom.out");
   std::ostream & out = file; 
   int  j = 0; 
   int prec = std::cout.precision(9);
diff --git a/math/minuit2/inc/LinkDef.h b/math/minuit2/inc/LinkDef.h
index 62516e19b20..a9c347aa41c 100644
--- a/math/minuit2/inc/LinkDef.h
+++ b/math/minuit2/inc/LinkDef.h
@@ -56,6 +56,6 @@
 #pragma link C++ class ROOT::Minuit2::FumiliMinimizer; 
 #pragma link C++ class ROOT::Minuit2::MnMachinePrecision; 
 
-#pragma link C++ class vector<ROOT::Minuit2::MinuitParameter >;
+#pragma link C++ class std::vector<ROOT::Minuit2::MinuitParameter >;
 
 #endif
diff --git a/math/minuit2/inc/Minuit2/MnPrint.h b/math/minuit2/inc/Minuit2/MnPrint.h
index f1223cdad57..35e1bfb10cd 100644
--- a/math/minuit2/inc/Minuit2/MnPrint.h
+++ b/math/minuit2/inc/Minuit2/MnPrint.h
@@ -32,7 +32,7 @@ namespace ROOT {
 
 
 /**
-    define ostream operators for output 
+    define std::ostream operators for output 
 */
 
 class FunctionMinimum;
diff --git a/math/minuit2/inc/Minuit2/StackAllocator.h b/math/minuit2/inc/Minuit2/StackAllocator.h
index f667143c4bf..d6d3515e07f 100644
--- a/math/minuit2/inc/Minuit2/StackAllocator.h
+++ b/math/minuit2/inc/Minuit2/StackAllocator.h
@@ -126,21 +126,21 @@ public:
 #else
       free(p);
 #endif
-      // cout << "Block at " << delBlock 
-      //   << " deallocated, fStackOffset = " << fStackOffset << endl;
+      // std::cout << "Block at " << delBlock 
+      //   << " deallocated, fStackOffset = " << fStackOffset << std::endl;
   }
 
   int ReadInt( int offset) {
       int* ip = (int*)(fStack+offset);
 
-      // cout << "read " << *ip << " from offset " << offset << endl;
+      // std::cout << "read " << *ip << " from offset " << offset << std::endl;
 
       return *ip;
   }
 
   void WriteInt( int offset, int Value) {
 
-      // cout << "writing " << Value << " to offset " << offset << endl;
+      // std::cout << "writing " << Value << " to offset " << offset << std::endl;
 
       int* ip = reinterpret_cast<int*>(fStack+offset);
       *ip = Value;
@@ -149,7 +149,7 @@ public:
   int ToInt( void* p) {
       unsigned char* pc = static_cast<unsigned char*>(p);
 
-      // cout << "toInt: p = " << p << " fStack = " << (void*) fStack << endl;
+      // std::cout << "toInt: p = " << p << " fStack = " << (void*) fStack << std::endl;
 	  // VC 7.1 warning:conversin from __w64 int to int
       int userBlock = pc - fStack;
       return userBlock - sizeof(int); // correct for starting int
@@ -179,8 +179,8 @@ public:
       while (beg < fStackOffset) {
 	  end = ReadInt( beg);
 
-	  // cout << "beg = " << beg << " end = " << end 
-	  //     << " fStackOffset = " << fStackOffset << endl;
+	  // std::cout << "beg = " << beg << " end = " << end 
+	  //     << " fStackOffset = " << fStackOffset << std::endl;
 
 	  int beg2 = ReadInt( end - sizeof(int));
 	  if ( beg != beg2) {
diff --git a/math/mlp/src/TMLPAnalyzer.cxx b/math/mlp/src/TMLPAnalyzer.cxx
index 86fa1284e64..18988db6a7d 100644
--- a/math/mlp/src/TMLPAnalyzer.cxx
+++ b/math/mlp/src/TMLPAnalyzer.cxx
@@ -146,8 +146,8 @@ void TMLPAnalyzer::CheckNetwork()
    // Gives some information about the network in the terminal.
 
    TString fStructure = fNetwork->GetStructure();
-   cout << "Network with structure: " << fStructure.Data() << endl;
-   cout << "inputs with low values in the differences plot may not be needed" << endl;
+   std::cout << "Network with structure: " << fStructure.Data() << std::endl;
+   std::cout << "inputs with low values in the differences plot may not be needed" << std::endl;
    // Checks if some input variable is not needed
    char var[64], sel[64];
    for (Int_t i = 0; i < GetNeurons(1); i++) {
@@ -156,9 +156,9 @@ void TMLPAnalyzer::CheckNetwork()
       fAnalysisTree->Draw(var, sel, "goff");
       TH1F* tmp = (TH1F*)gDirectory->Get(Form("tmp%d",i));
       if (!tmp) continue;
-      cout << GetInputNeuronTitle(i)
+      std::cout << GetInputNeuronTitle(i)
            << " -> " << tmp->GetMean()
-           << " +/- " << tmp->GetRMS() << endl;
+           << " +/- " << tmp->GetRMS() << std::endl;
    }
 }
 
diff --git a/math/mlp/src/TMultiLayerPerceptron.cxx b/math/mlp/src/TMultiLayerPerceptron.cxx
index 321d85ac7f9..1160ac69645 100644
--- a/math/mlp/src/TMultiLayerPerceptron.cxx
+++ b/math/mlp/src/TMultiLayerPerceptron.cxx
@@ -543,7 +543,7 @@ void TMultiLayerPerceptron::SetData(TTree * data)
 {
    // Set the data source
    if (fData) {
-      cerr << "Error: data already defined." << endl;
+      std::cerr << "Error: data already defined." << std::endl;
       return;
    }
    fData = data;
@@ -757,7 +757,7 @@ void TMultiLayerPerceptron::Train(Int_t nEpoch, Option_t * option, Double_t minE
         fTraining->GetN(), fTest->GetN());
    // Text and Graph outputs
    if (verbosity % 2)
-      cout << "Training the Neural Network" << endl;
+      std::cout << "Training the Neural Network" << std::endl;
    if (verbosity / 2) {
       residual_plot = new TMultiGraph;
       if(newCanvas)
@@ -917,10 +917,10 @@ void TMultiLayerPerceptron::Train(Int_t nEpoch, Option_t * option, Double_t minE
       test_E = TMath::Sqrt(GetError(TMultiLayerPerceptron::kTest) / fTest->GetN());
       // Intermediate graph and text output
       if ((verbosity % 2) && ((!(iepoch % displayStepping)) || (iepoch == nEpoch - 1))) {
-         cout << "Epoch: " << iepoch
+         std::cout << "Epoch: " << iepoch
               << " learn=" << training_E
               << " test=" << test_E
-              << endl;
+              << std::endl;
       }
       if (verbosity / 2) {
          train_residual_plot->SetPoint(iepoch, iepoch,training_E);
@@ -949,7 +949,7 @@ void TMultiLayerPerceptron::Train(Int_t nEpoch, Option_t * option, Double_t minE
    delete [] dir;
    // Final Text and Graph outputs
    if (verbosity % 2)
-      cout << "Training done." << endl;
+      std::cout << "Training done." << std::endl;
    if (verbosity / 2) {
       TLegend *legend = new TLegend(.75, .80, .95, .95);
       legend->AddEntry(residual_plot->GetListOfGraphs()->At(0),
@@ -1519,44 +1519,44 @@ Bool_t TMultiLayerPerceptron::DumpWeights(Option_t * filename) const
    // Dumps the weights to a text file.
    // Set filename to "-" (default) to dump to the standard output
    TString filen = filename;
-   ostream * output;
+   std::ostream * output;
    if (filen == "") {   
       Error("TMultiLayerPerceptron::DumpWeights()","Invalid file name");
       return kFALSE;
    }
    if (filen == "-")
-      output = &cout;
+      output = &std::cout;
    else
-      output = new ofstream(filen.Data());
+      output = new std::ofstream(filen.Data());
    TNeuron *neuron = 0;
-   *output << "#input normalization" << endl;
+   *output << "#input normalization" << std::endl;
    Int_t nentries = fFirstLayer.GetEntriesFast();
    Int_t j=0;
    for (j=0;j<nentries;j++) {
       neuron = (TNeuron *) fFirstLayer.UncheckedAt(j);
       *output << neuron->GetNormalisation()[0] << " "
-              << neuron->GetNormalisation()[1] << endl;
+              << neuron->GetNormalisation()[1] << std::endl;
    }
-   *output << "#output normalization" << endl;
+   *output << "#output normalization" << std::endl;
    nentries = fLastLayer.GetEntriesFast();
    for (j=0;j<nentries;j++) {
       neuron = (TNeuron *) fLastLayer.UncheckedAt(j);
       *output << neuron->GetNormalisation()[0] << " "
-              << neuron->GetNormalisation()[1] << endl;
+              << neuron->GetNormalisation()[1] << std::endl;
    }
-   *output << "#neurons weights" << endl;
+   *output << "#neurons weights" << std::endl;
    TObjArrayIter *it = (TObjArrayIter *) fNetwork.MakeIterator();
    while ((neuron = (TNeuron *) it->Next()))
-      *output << neuron->GetWeight() << endl;
+      *output << neuron->GetWeight() << std::endl;
    delete it;
    it = (TObjArrayIter *) fSynapses.MakeIterator();
    TSynapse *synapse = 0;
-   *output << "#synapses weights" << endl;
+   *output << "#synapses weights" << std::endl;
    while ((synapse = (TSynapse *) it->Next()))
-      *output << synapse->GetWeight() << endl;
+      *output << synapse->GetWeight() << std::endl;
    delete it;
    if (filen != "-") {
-      ((ofstream *) output)->close();
+      ((std::ofstream *) output)->close();
       delete output;
    }
    return kTRUE;
@@ -1574,7 +1574,7 @@ Bool_t TMultiLayerPerceptron::LoadWeights(Option_t * filename)
       return kFALSE;
    }
    char *buff = new char[100];
-   ifstream input(filen.Data());
+   std::ifstream input(filen.Data());
    // input normalzation
    input.getline(buff, 100);
    TObjArrayIter *it = (TObjArrayIter *) fFirstLayer.MakeIterator();
@@ -1664,88 +1664,88 @@ void TMultiLayerPerceptron::Export(Option_t * filename, Option_t * language) con
       header += ".h";
       TString source = filename;
       source += ".cxx";
-      ofstream headerfile(header);
-      ofstream sourcefile(source);
-      headerfile << "#ifndef " << basefilename << "_h" << endl;
-      headerfile << "#define " << basefilename << "_h" << endl << endl;
-      headerfile << "class " << classname << " { " << endl;
-      headerfile << "public:" << endl;
-      headerfile << "   " << classname << "() {}" << endl;
-      headerfile << "   ~" << classname << "() {}" << endl;
-      sourcefile << "#include \"" << header << "\"" << endl;
-      sourcefile << "#include <cmath>" << endl << endl;
+      std::ofstream headerfile(header);
+      std::ofstream sourcefile(source);
+      headerfile << "#ifndef " << basefilename << "_h" << std::endl;
+      headerfile << "#define " << basefilename << "_h" << std::endl << std::endl;
+      headerfile << "class " << classname << " { " << std::endl;
+      headerfile << "public:" << std::endl;
+      headerfile << "   " << classname << "() {}" << std::endl;
+      headerfile << "   ~" << classname << "() {}" << std::endl;
+      sourcefile << "#include \"" << header << "\"" << std::endl;
+      sourcefile << "#include <cmath>" << std::endl << std::endl;
       headerfile << "   double Value(int index";
       sourcefile << "double " << classname << "::Value(int index";
       for (i = 0; i < fFirstLayer.GetEntriesFast(); i++) {
          headerfile << ",double in" << i;
          sourcefile << ",double in" << i;
       }
-      headerfile << ");" << endl;
-      sourcefile << ") {" << endl;
+      headerfile << ");" << std::endl;
+      sourcefile << ") {" << std::endl;
       for (i = 0; i < fFirstLayer.GetEntriesFast(); i++)
          sourcefile << "   input" << i << " = (in" << i << " - "
              << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[1] << ")/"
              << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[0] << ";"
-             << endl;
-      sourcefile << "   switch(index) {" << endl;
+             << std::endl;
+      sourcefile << "   switch(index) {" << std::endl;
       TNeuron *neuron;
       TObjArrayIter *it = (TObjArrayIter *) fLastLayer.MakeIterator();
       Int_t idx = 0;
       while ((neuron = (TNeuron *) it->Next()))
-         sourcefile << "     case " << idx++ << ":" << endl
-                    << "         return neuron" << neuron << "();" << endl;
-      sourcefile << "     default:" << endl
-                 << "         return 0.;" << endl << "   }"
-                 << endl;
-      sourcefile << "}" << endl << endl;
-      headerfile << "   double Value(int index, double* input);" << endl;
-      sourcefile << "double " << classname << "::Value(int index, double* input) {" << endl;
+         sourcefile << "     case " << idx++ << ":" << std::endl
+                    << "         return neuron" << neuron << "();" << std::endl;
+      sourcefile << "     default:" << std::endl
+                 << "         return 0.;" << std::endl << "   }"
+                 << std::endl;
+      sourcefile << "}" << std::endl << std::endl;
+      headerfile << "   double Value(int index, double* input);" << std::endl;
+      sourcefile << "double " << classname << "::Value(int index, double* input) {" << std::endl;
       for (i = 0; i < fFirstLayer.GetEntriesFast(); i++)
          sourcefile << "   input" << i << " = (input[" << i << "] - "
              << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[1] << ")/"
              << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[0] << ";"
-             << endl;
-      sourcefile << "   switch(index) {" << endl;
+             << std::endl;
+      sourcefile << "   switch(index) {" << std::endl;
       delete it;
       it = (TObjArrayIter *) fLastLayer.MakeIterator();
       idx = 0;
       while ((neuron = (TNeuron *) it->Next()))
-         sourcefile << "     case " << idx++ << ":" << endl
-                    << "         return neuron" << neuron << "();" << endl;
-      sourcefile << "     default:" << endl
-                 << "         return 0.;" << endl << "   }"
-                 << endl;
-      sourcefile << "}" << endl << endl;
-      headerfile << "private:" << endl;
+         sourcefile << "     case " << idx++ << ":" << std::endl
+                    << "         return neuron" << neuron << "();" << std::endl;
+      sourcefile << "     default:" << std::endl
+                 << "         return 0.;" << std::endl << "   }"
+                 << std::endl;
+      sourcefile << "}" << std::endl << std::endl;
+      headerfile << "private:" << std::endl;
       for (i = 0; i < fFirstLayer.GetEntriesFast(); i++)
-         headerfile << "   double input" << i << ";" << endl;
+         headerfile << "   double input" << i << ";" << std::endl;
       delete it;
       it = (TObjArrayIter *) fNetwork.MakeIterator();
       idx = 0;
       while ((neuron = (TNeuron *) it->Next())) {
          if (!neuron->GetPre(0)) {
-            headerfile << "   double neuron" << neuron << "();" << endl;
+            headerfile << "   double neuron" << neuron << "();" << std::endl;
             sourcefile << "double " << classname << "::neuron" << neuron
-                       << "() {" << endl;
-            sourcefile << "   return input" << idx++ << ";" << endl;
-            sourcefile << "}" << endl << endl;
+                       << "() {" << std::endl;
+            sourcefile << "   return input" << idx++ << ";" << std::endl;
+            sourcefile << "}" << std::endl << std::endl;
          } else {
-            headerfile << "   double input" << neuron << "();" << endl;
+            headerfile << "   double input" << neuron << "();" << std::endl;
             sourcefile << "double " << classname << "::input" << neuron
-                       << "() {" << endl;
+                       << "() {" << std::endl;
             sourcefile << "   double input = " << neuron->GetWeight()
-                       << ";" << endl;
+                       << ";" << std::endl;
             TSynapse *syn = 0;
             Int_t n = 0;
             while ((syn = neuron->GetPre(n++))) {
-               sourcefile << "   input += synapse" << syn << "();" << endl;
+               sourcefile << "   input += synapse" << syn << "();" << std::endl;
             }
-            sourcefile << "   return input;" << endl;
-            sourcefile << "}" << endl << endl;
+            sourcefile << "   return input;" << std::endl;
+            sourcefile << "}" << std::endl << std::endl;
 
-            headerfile << "   double neuron" << neuron << "();" << endl;
-            sourcefile << "double " << classname << "::neuron" << neuron << "() {" << endl;
-            sourcefile << "   double input = input" << neuron << "();" << endl;
+            headerfile << "   double neuron" << neuron << "();" << std::endl;
+            sourcefile << "double " << classname << "::neuron" << neuron << "() {" << std::endl;
+            sourcefile << "   double input = input" << neuron << "();" << std::endl;
             switch(neuron->GetType()) {
                case (TNeuron::kSigmoid):
                   {
@@ -1784,98 +1784,98 @@ void TMultiLayerPerceptron::Export(Option_t * filename, Option_t * language) con
                   }
             }
             sourcefile << neuron->GetNormalisation()[0] << ")+" ;
-            sourcefile << neuron->GetNormalisation()[1] << ";" << endl;
-            sourcefile << "}" << endl << endl;
+            sourcefile << neuron->GetNormalisation()[1] << ";" << std::endl;
+            sourcefile << "}" << std::endl << std::endl;
          }
       }
       delete it;
       TSynapse *synapse = 0;
       it = (TObjArrayIter *) fSynapses.MakeIterator();
       while ((synapse = (TSynapse *) it->Next())) {
-         headerfile << "   double synapse" << synapse << "();" << endl;
+         headerfile << "   double synapse" << synapse << "();" << std::endl;
          sourcefile << "double " << classname << "::synapse"
-                    << synapse << "() {" << endl;
+                    << synapse << "() {" << std::endl;
          sourcefile << "   return (neuron" << synapse->GetPre()
-                    << "()*" << synapse->GetWeight() << ");" << endl;
-         sourcefile << "}" << endl << endl;
+                    << "()*" << synapse->GetWeight() << ");" << std::endl;
+         sourcefile << "}" << std::endl << std::endl;
       }
       delete it;
-      headerfile << "};" << endl << endl;
-      headerfile << "#endif // " << basefilename << "_h" << endl << endl;
+      headerfile << "};" << std::endl << std::endl;
+      headerfile << "#endif // " << basefilename << "_h" << std::endl << std::endl;
       headerfile.close();
       sourcefile.close();
-      cout << header << " and " << source << " created." << endl;
+      std::cout << header << " and " << source << " created." << std::endl;
    }
    else if(lg == "FORTRAN") {
       TString implicit = "      implicit double precision (a-h,n-z)\n";
-      ofstream sigmoid("sigmoid.f");
-      sigmoid         << "      double precision FUNCTION SIGMOID(X)"        << endl
+      std::ofstream sigmoid("sigmoid.f");
+      sigmoid         << "      double precision FUNCTION SIGMOID(X)"        << std::endl
                     << implicit
-                << "      IF(X.GT.37.) THEN"                        << endl
-                    << "         SIGMOID = 1."                        << endl
-                << "      ELSE IF(X.LT.-709.) THEN"                << endl
-                    << "         SIGMOID = 0."                        << endl
-                    << "      ELSE"                                        << endl
-                    << "         SIGMOID = 1./(1.+EXP(-X))"                << endl
-                    << "      ENDIF"                                << endl
-                    << "      END"                                        << endl;
+                << "      IF(X.GT.37.) THEN"                        << std::endl
+                    << "         SIGMOID = 1."                        << std::endl
+                << "      ELSE IF(X.LT.-709.) THEN"                << std::endl
+                    << "         SIGMOID = 0."                        << std::endl
+                    << "      ELSE"                                        << std::endl
+                    << "         SIGMOID = 1./(1.+EXP(-X))"                << std::endl
+                    << "      ENDIF"                                << std::endl
+                    << "      END"                                        << std::endl;
       sigmoid.close();
       TString source = filename;
       source += ".f";
-      ofstream sourcefile(source);
+      std::ofstream sourcefile(source);
 
       // Header
       sourcefile << "      double precision function " << filename
-                 << "(x, index)" << endl;
+                 << "(x, index)" << std::endl;
       sourcefile << implicit;
       sourcefile << "      double precision x(" <<
-      fFirstLayer.GetEntriesFast() << ")" << endl << endl;
+      fFirstLayer.GetEntriesFast() << ")" << std::endl << std::endl;
 
       // Last layer
-      sourcefile << "C --- Last Layer" << endl;
+      sourcefile << "C --- Last Layer" << std::endl;
       TNeuron *neuron;
       TObjArrayIter *it = (TObjArrayIter *) fLastLayer.MakeIterator();
       Int_t idx = 0;
       TString ifelseif = "      if (index.eq.";
       while ((neuron = (TNeuron *) it->Next())) {
-         sourcefile << ifelseif.Data() << idx++ << ") then" << endl
+         sourcefile << ifelseif.Data() << idx++ << ") then" << std::endl
                     << "          " << filename
-                    << "=neuron" << neuron << "(x);" << endl;
+                    << "=neuron" << neuron << "(x);" << std::endl;
          ifelseif = "      else if (index.eq.";
       }
-      sourcefile << "      else" << endl
-                 << "          " << filename << "=0.d0" << endl
-                 << "      endif" << endl;
-      sourcefile << "      end" << endl;
+      sourcefile << "      else" << std::endl
+                 << "          " << filename << "=0.d0" << std::endl
+                 << "      endif" << std::endl;
+      sourcefile << "      end" << std::endl;
 
       // Network
-      sourcefile << "C --- First and Hidden layers" << endl;
+      sourcefile << "C --- First and Hidden layers" << std::endl;
       delete it;
       it = (TObjArrayIter *) fNetwork.MakeIterator();
       idx = 0;
       while ((neuron = (TNeuron *) it->Next())) {
          sourcefile << "      double precision function neuron"
-                    << neuron << "(x)" << endl
+                    << neuron << "(x)" << std::endl
                     << implicit;
          sourcefile << "      double precision x("
-                    << fFirstLayer.GetEntriesFast() << ")" << endl << endl;
+                    << fFirstLayer.GetEntriesFast() << ")" << std::endl << std::endl;
          if (!neuron->GetPre(0)) {
             sourcefile << "      neuron" << neuron
              << " = (x(" << idx+1 << ") - "
              << ((TNeuron *) fFirstLayer[idx])->GetNormalisation()[1]
              << "d0)/"
              << ((TNeuron *) fFirstLayer[idx])->GetNormalisation()[0]
-             << "d0" << endl;
+             << "d0" << std::endl;
             idx++;
          } else {
             sourcefile << "      neuron" << neuron
-                       << " = " << neuron->GetWeight() << "d0" << endl;
+                       << " = " << neuron->GetWeight() << "d0" << std::endl;
             TSynapse *syn;
             Int_t n = 0;
             while ((syn = neuron->GetPre(n++)))
                sourcefile << "      neuron" << neuron
                               << " = neuron" << neuron
-                          << " + synapse" << syn << "(x)" << endl;
+                          << " + synapse" << syn << "(x)" << std::endl;
             switch(neuron->GetType()) {
                case (TNeuron::kSigmoid):
                   {
@@ -1904,9 +1904,9 @@ void TMultiLayerPerceptron::Export(Option_t * filename, Option_t * language) con
                   {
                      Int_t nn = 0;
                      TNeuron* side = neuron->GetInLayer(nn++);
-                     sourcefile << "      div = exp(neuron" << side << "())" << endl;
+                     sourcefile << "      div = exp(neuron" << side << "())" << std::endl;
                      while ((side = neuron->GetInLayer(nn++)))
-                        sourcefile << "      div = div + exp(neuron" << side << "())" << endl;
+                        sourcefile << "      div = div + exp(neuron" << side << "())" << std::endl;
                      sourcefile << "      neuron"  << neuron ;
                      sourcefile << "= (exp(neuron" << neuron << ") / div * ";
                      break;
@@ -1917,72 +1917,72 @@ void TMultiLayerPerceptron::Export(Option_t * filename, Option_t * language) con
                   }
             }
             sourcefile << neuron->GetNormalisation()[0] << "d0)+" ;
-            sourcefile << neuron->GetNormalisation()[1] << "d0" << endl;
+            sourcefile << neuron->GetNormalisation()[1] << "d0" << std::endl;
          }
-         sourcefile << "      end" << endl;
+         sourcefile << "      end" << std::endl;
       }
       delete it;
 
       // Synapses
-      sourcefile << "C --- Synapses" << endl;
+      sourcefile << "C --- Synapses" << std::endl;
       TSynapse *synapse = 0;
       it = (TObjArrayIter *) fSynapses.MakeIterator();
       while ((synapse = (TSynapse *) it->Next())) {
          sourcefile << "      double precision function " << "synapse"
                     << synapse << "(x)\n" << implicit;
          sourcefile << "      double precision x("
-                    << fFirstLayer.GetEntriesFast() << ")" << endl << endl;
+                    << fFirstLayer.GetEntriesFast() << ")" << std::endl << std::endl;
          sourcefile << "      synapse" << synapse
                     << "=neuron" << synapse->GetPre()
-                    << "(x)*" << synapse->GetWeight() << "d0" << endl;
-         sourcefile << "      end" << endl << endl;
+                    << "(x)*" << synapse->GetWeight() << "d0" << std::endl;
+         sourcefile << "      end" << std::endl << std::endl;
       }
       delete it;
       sourcefile.close();
-      cout << source << " created." << endl;
+      std::cout << source << " created." << std::endl;
    }
    else if(lg == "PYTHON") {
       TString classname = filename;
       TString pyfile = filename;
       pyfile += ".py";
-      ofstream pythonfile(pyfile);
-      pythonfile << "from math import exp" << endl << endl;
-      pythonfile << "from math import tanh" << endl << endl;
-      pythonfile << "class " << classname << ":" << endl;
+      std::ofstream pythonfile(pyfile);
+      pythonfile << "from math import exp" << std::endl << std::endl;
+      pythonfile << "from math import tanh" << std::endl << std::endl;
+      pythonfile << "class " << classname << ":" << std::endl;
       pythonfile << "\tdef value(self,index";
       for (i = 0; i < fFirstLayer.GetEntriesFast(); i++) {
          pythonfile << ",in" << i;
       }
-      pythonfile << "):" << endl;
+      pythonfile << "):" << std::endl;
       for (i = 0; i < fFirstLayer.GetEntriesFast(); i++)
          pythonfile << "\t\tself.input" << i << " = (in" << i << " - "
              << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[1] << ")/"
-             << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[0] << endl;
+             << ((TNeuron *) fFirstLayer[i])->GetNormalisation()[0] << std::endl;
       TNeuron *neuron;
       TObjArrayIter *it = (TObjArrayIter *) fLastLayer.MakeIterator();
       Int_t idx = 0;
       while ((neuron = (TNeuron *) it->Next()))
          pythonfile << "\t\tif index==" << idx++
-                    << ": return self.neuron" << neuron << "();" << endl;
-      pythonfile << "\t\treturn 0." << endl;
+                    << ": return self.neuron" << neuron << "();" << std::endl;
+      pythonfile << "\t\treturn 0." << std::endl;
       delete it;
       it = (TObjArrayIter *) fNetwork.MakeIterator();
       idx = 0;
       while ((neuron = (TNeuron *) it->Next())) {
-         pythonfile << "\tdef neuron" << neuron << "(self):" << endl;
+         pythonfile << "\tdef neuron" << neuron << "(self):" << std::endl;
          if (!neuron->GetPre(0))
-            pythonfile << "\t\treturn self.input" << idx++ << endl;
+            pythonfile << "\t\treturn self.input" << idx++ << std::endl;
          else {
-            pythonfile << "\t\tinput = " << neuron->GetWeight() << endl;
+            pythonfile << "\t\tinput = " << neuron->GetWeight() << std::endl;
             TSynapse *syn;
             Int_t n = 0;
             while ((syn = neuron->GetPre(n++)))
                pythonfile << "\t\tinput = input + self.synapse"
-                          << syn << "()" << endl;
+                          << syn << "()" << std::endl;
             switch(neuron->GetType()) {
                case (TNeuron::kSigmoid):
                   {
-                     pythonfile << "\t\tif input<-709. : return " << neuron->GetNormalisation()[1] << endl;
+                     pythonfile << "\t\tif input<-709. : return " << neuron->GetNormalisation()[1] << std::endl;
                      pythonfile << "\t\treturn ((1/(1+exp(-input)))*";
                      break;
                   }
@@ -2018,20 +2018,20 @@ void TMultiLayerPerceptron::Export(Option_t * filename, Option_t * language) con
                   }
             }
             pythonfile << neuron->GetNormalisation()[0] << ")+" ;
-            pythonfile << neuron->GetNormalisation()[1] << endl;
+            pythonfile << neuron->GetNormalisation()[1] << std::endl;
          }
       }
       delete it;
       TSynapse *synapse = 0;
       it = (TObjArrayIter *) fSynapses.MakeIterator();
       while ((synapse = (TSynapse *) it->Next())) {
-         pythonfile << "\tdef synapse" << synapse << "(self):" << endl;
+         pythonfile << "\tdef synapse" << synapse << "(self):" << std::endl;
          pythonfile << "\t\treturn (self.neuron" << synapse->GetPre()
-                    << "()*" << synapse->GetWeight() << ")" << endl;
+                    << "()*" << synapse->GetWeight() << ")" << std::endl;
       }
       delete it;
       pythonfile.close();
-      cout << pyfile << " created." << endl;
+      std::cout << pyfile << " created." << std::endl;
    }
 }
 
diff --git a/math/physics/src/TFeldmanCousins.cxx b/math/physics/src/TFeldmanCousins.cxx
index f38e93a20ee..3aac371a580 100644
--- a/math/physics/src/TFeldmanCousins.cxx
+++ b/math/physics/src/TFeldmanCousins.cxx
@@ -225,7 +225,7 @@ void TFeldmanCousins::SetMuStep(Double_t newMuStep)
 {
    //set the step in signal to use when generating tables
    if(newMuStep == 0.0) {
-      cout << "TFeldmanCousins::SetMuStep ERROR New step size is zero - unable to change value"<< endl;
+      std::cout << "TFeldmanCousins::SetMuStep ERROR New step size is zero - unable to change value"<< std::endl;
       return;
    } else {
       fMuStep = newMuStep;
diff --git a/math/physics/src/TRolke.cxx b/math/physics/src/TRolke.cxx
index 62f02c976b9..ca93606483e 100644
--- a/math/physics/src/TRolke.cxx
+++ b/math/physics/src/TRolke.cxx
@@ -521,7 +521,7 @@ bool TRolke::GetLimitsML(Double_t& low, Double_t& high, Int_t& out_x)
       max = TMath::PoissonI(loop_x, background);
    }
    if (loop_x >= loop_max) {
-      std::cout << "internal error finding maximum of distribution" << endl;
+      std::cout << "internal error finding maximum of distribution" << std::endl;
       return false;
    }
 
@@ -559,7 +559,7 @@ bool TRolke::GetCriticalNumber(Int_t& ncrit, Int_t maxtry)
    }
 
    if (rolke_ncrit == -1) {
-     std::cerr << "TRolke GetCriticalNumber : Error: problem finding rolke inverse. Specify a larger maxtry value. maxtry was: " << maxj << ". highest x considered was j "<< j<< endl;
+     std::cerr << "TRolke GetCriticalNumber : Error: problem finding rolke inverse. Specify a larger maxtry value. maxtry was: " << maxj << ". highest x considered was j "<< j<< std::endl;
       ncrit = -1;
       return false;
    } else {
@@ -585,26 +585,26 @@ void TRolke::Print(Option_t*) const {
    std::cout << "*******************************************" <<std::endl;
    std::cout << "* TRolke::Print() - dump of internals:                " <<std::endl;
    std::cout << "*"<<std::endl;
-   std::cout << "* model id, mid = "<<f_mid <<endl;
+   std::cout << "* model id, mid = "<<f_mid <<std::endl;
    std::cout << "*"<<std::endl;
    std::cout << "*             x = "<<f_x   <<std::endl;
-   std::cout << "*            bm = "<<f_bm  <<endl;
-   std::cout << "*            em = "<<f_em  <<endl;
-   std::cout << "*           sde = "<<f_sde <<endl;
-   std::cout << "*           sdb = "<<f_sdb <<endl;
-   std::cout << "*             y = "<<f_y   <<endl;      
-   std::cout << "*           tau = "<<f_tau <<endl;
-   std::cout << "*             e = "<<f_e   <<endl;
-   std::cout << "*             b = "<<f_b   <<endl;
-   std::cout << "*             m = "<<f_m   <<endl;
-   std::cout << "*             z = "<<f_z   <<endl;
+   std::cout << "*            bm = "<<f_bm  <<std::endl;
+   std::cout << "*            em = "<<f_em  <<std::endl;
+   std::cout << "*           sde = "<<f_sde <<std::endl;
+   std::cout << "*           sdb = "<<f_sdb <<std::endl;
+   std::cout << "*             y = "<<f_y   <<std::endl;      
+   std::cout << "*           tau = "<<f_tau <<std::endl;
+   std::cout << "*             e = "<<f_e   <<std::endl;
+   std::cout << "*             b = "<<f_b   <<std::endl;
+   std::cout << "*             m = "<<f_m   <<std::endl;
+   std::cout << "*             z = "<<f_z   <<std::endl;
    std::cout << "*"<<std::endl;
-   std::cout << "*            CL = "<<fCL <<endl;
-   std::cout << "*      Bounding = "<<fBounding <<endl;      
+   std::cout << "*            CL = "<<fCL <<std::endl;
+   std::cout << "*      Bounding = "<<fBounding <<std::endl;      
    std::cout << "*"<<std::endl;
    std::cout << "* calculated on demand only:"<<std::endl;
-   std::cout << "*   fUpperLimit = "<<fUpperLimit<<endl; 
-   std::cout << "*   fLowerLimit = "<<fLowerLimit<<endl;      
+   std::cout << "*   fUpperLimit = "<<fUpperLimit<<std::endl; 
+   std::cout << "*   fLowerLimit = "<<fLowerLimit<<std::endl;      
    std::cout << "*******************************************" <<std::endl;
 }
 
diff --git a/math/quadp/src/TGondzioSolver.cxx b/math/quadp/src/TGondzioSolver.cxx
index 3728496b5e6..fbbd27c1143 100644
--- a/math/quadp/src/TGondzioSolver.cxx
+++ b/math/quadp/src/TGondzioSolver.cxx
@@ -196,7 +196,7 @@ Int_t TGondzioSolver::Solve(TQpDataBase *prob,TQpVar *iterate,TQpResidual *resid
 
       // enter the Gondzio correction loop:
       if (fPrintlevel >= 10)
-         cout << "**** Entering the correction loop ****" << endl;
+         std::cout << "**** Entering the correction loop ****" << std::endl;
 
       while (fNumberGondzioCorrections < fMaximum_correctors  &&
       alpha < 1.0 && !stopCorrections) {
@@ -281,40 +281,40 @@ void TGondzioSolver::DefMonitor(TQpDataBase* /* data */,TQpVar* /* vars */,
    switch (level) {
       case 0 : case 1:
       {
-         cout << endl << "Duality Gap: " << resid->GetDualityGap() << endl;
+         std::cout << std::endl << "Duality Gap: " << resid->GetDualityGap() << std::endl;
          if (i > 1) {
-            cout << " Number of Corrections = " << fNumberGondzioCorrections
-               << " alpha = " << alpha << endl;
+            std::cout << " Number of Corrections = " << fNumberGondzioCorrections
+               << " alpha = " << alpha << std::endl;
          }
-         cout << " *** Iteration " << i << " *** " << endl;
-         cout << " mu = " << mu << " relative residual norm = "
-            << resid->GetResidualNorm()/fDnorm << endl;
+         std::cout << " *** Iteration " << i << " *** " << std::endl;
+         std::cout << " mu = " << mu << " relative residual norm = "
+            << resid->GetResidualNorm()/fDnorm << std::endl;
 
          if (level == 1) {
             // Termination has been detected by the status check; print
             // appropriate message
             if (status_code == kSUCCESSFUL_TERMINATION) {
-               cout << endl
+               std::cout << std::endl
                   << " *** SUCCESSFUL TERMINATION ***"
-                  << endl;
+                  << std::endl;
             }
             else if (status_code == kMAX_ITS_EXCEEDED) {
-               cout << endl
-                  << " *** MAXIMUM ITERATIONS REACHED *** " << endl;
+               std::cout << std::endl
+                  << " *** MAXIMUM ITERATIONS REACHED *** " << std::endl;
             }
             else if (status_code == kINFEASIBLE) {
-               cout << endl
+               std::cout << std::endl
                   << " *** TERMINATION: PROBABLY INFEASIBLE *** "
-                  << endl;
+                  << std::endl;
             }
             else if (status_code == kUNKNOWN) {
-               cout << endl
-                  << " *** TERMINATION: STATUS UNKNOWN *** " << endl;
+               std::cout << std::endl
+                  << " *** TERMINATION: STATUS UNKNOWN *** " << std::endl;
             }
          }
       } break;
       case 2:
-         cout << " *** sigma = " << sigma << endl;
+         std::cout << " *** sigma = " << sigma << std::endl;
          break;
    }
 }
diff --git a/math/quadp/src/TMehrotraSolver.cxx b/math/quadp/src/TMehrotraSolver.cxx
index 582741c4996..320cae4978c 100644
--- a/math/quadp/src/TMehrotraSolver.cxx
+++ b/math/quadp/src/TMehrotraSolver.cxx
@@ -176,29 +176,29 @@ void TMehrotraSolver::DefMonitor(TQpDataBase * /* data */,TQpVar * /* vars */,
    switch (level) {
       case 0 : case 1:
       {
-         cout << endl << "Duality Gap: " << resids->GetDualityGap() << endl;
+         std::cout << std::endl << "Duality Gap: " << resids->GetDualityGap() << std::endl;
          if (i > 1) {
-            cout << " alpha = " << alpha << endl;
+            std::cout << " alpha = " << alpha << std::endl;
          }
-         cout << " *** Iteration " << i << " *** " << endl;
-         cout << " mu = " << mu << " relative residual norm = "
-            << resids->GetResidualNorm()/fDnorm << endl;
+         std::cout << " *** Iteration " << i << " *** " << std::endl;
+         std::cout << " mu = " << mu << " relative residual norm = "
+            << resids->GetResidualNorm()/fDnorm << std::endl;
 
          if (level == 1) {
             // Termination has been detected by the status check; print
             // appropriate message
             switch (status_code) {
                case kSUCCESSFUL_TERMINATION:
-                  cout << endl << " *** SUCCESSFUL TERMINATION ***" << endl;
+                  std::cout << std::endl << " *** SUCCESSFUL TERMINATION ***" << std::endl;
                   break;
                case kMAX_ITS_EXCEEDED:
-                  cout << endl << " *** MAXIMUM ITERATIONS REACHED *** " << endl;
+                  std::cout << std::endl << " *** MAXIMUM ITERATIONS REACHED *** " << std::endl;
                   break;
                case kINFEASIBLE:
-                  cout << endl << " *** TERMINATION: PROBABLY INFEASIBLE *** " << endl;
+                  std::cout << std::endl << " *** TERMINATION: PROBABLY INFEASIBLE *** " << std::endl;
                   break;
                case kUNKNOWN:
-                  cout << endl << " *** TERMINATION: STATUS UNKNOWN *** " << endl;
+                  std::cout << std::endl << " *** TERMINATION: STATUS UNKNOWN *** " << std::endl;
                   break;
             }
          }
diff --git a/math/quadp/src/TQpVar.cxx b/math/quadp/src/TQpVar.cxx
index 6256ae6d474..d83e5bfd5ba 100644
--- a/math/quadp/src/TQpVar.cxx
+++ b/math/quadp/src/TQpVar.cxx
@@ -637,13 +637,13 @@ void TQpVar::Print(Option_t * /*option*/) const
 {
 // Print class members
 
-   cout << "fNx  : " << fNx   << endl;
-   cout << "fMy  : " << fMy   << endl;
-   cout << "fMz  : " << fMz   << endl;
-   cout << "fNxup: " << fNxup << endl;
-   cout << "fNxlo: " << fNxlo << endl;
-   cout << "fMcup: " << fMcup << endl;
-   cout << "fMclo: " << fMclo << endl;
+   std::cout << "fNx  : " << fNx   << std::endl;
+   std::cout << "fMy  : " << fMy   << std::endl;
+   std::cout << "fMz  : " << fMz   << std::endl;
+   std::cout << "fNxup: " << fNxup << std::endl;
+   std::cout << "fNxlo: " << fNxlo << std::endl;
+   std::cout << "fMcup: " << fMcup << std::endl;
+   std::cout << "fMclo: " << fMclo << std::endl;
 
    fXloIndex.Print("fXloIndex");
    fXupIndex.Print("fXupIndex");
diff --git a/math/smatrix/test/testSMatrix.cxx b/math/smatrix/test/testSMatrix.cxx
index f595146fdf0..ac4311a7258 100644
--- a/math/smatrix/test/testSMatrix.cxx
+++ b/math/smatrix/test/testSMatrix.cxx
@@ -49,8 +49,8 @@ int test1() {
 
   SVector<float,3> x(4,5,6);
   SVector<float,2> y(2.0,3.0);
-  cout << "x: " << x << endl;
-  cout << "y: " << y << endl;
+  std::cout << "x: " << x << std::endl;
+  std::cout << "y: " << y << std::endl;
 
 //   float yy1=2.; float yy2 = 3;
 //   SVector<float,2> y2(yy1,yy2);
@@ -71,12 +71,12 @@ int test1() {
   //Windows need template parameters
   A.Place_at<2,2>(B , 2, 1);
 #endif
-  cout << "A: " << endl << A << endl;
+  std::cout << "A: " << std::endl << A << std::endl;
 
   SVector<float,3> z(x+2);
   z.Place_at(y, 1);
   z.Place_at(y+3, 1);
-  cout << "z: " << endl << z << endl;
+  std::cout << "z: " << std::endl << z << std::endl;
 
   
 #ifdef TEST_STATIC_CHECK
@@ -92,8 +92,8 @@ int test1() {
   //SVector<float, 2> sp(p,2);
   SMatrix<float, 2,2> sm(m,4);
 
-  //cout << "sp: " << endl << sp << endl;
-  cout << "sm: " << endl << sm << endl;
+  //std::cout << "sp: " << std::endl << sp << std::endl;
+  std::cout << "sm: " << std::endl << sm << std::endl;
 
   //std::vector<float> vp(sp.begin(), sp.end() );
   std::vector<float> vm(sm.begin(), sm.end() );
@@ -102,30 +102,30 @@ int test1() {
   SVector<float, 4> sp2(sm.begin(),sm.end());
   SMatrix<float, 2,2> sm2(vm.begin(),vm.end());
 
-  if ( sp1 != sp2) { cout << "Test STL interface for SVector failed" << endl; return -1; }
-  if ( sm2 != sm) { cout << "Test STL interface for SMatrix failed" << endl; return -1; }
+  if ( sp1 != sp2) { std::cout << "Test STL interface for SVector failed" << std::endl; return -1; }
+  if ( sm2 != sm) { std::cout << "Test STL interface for SMatrix failed" << std::endl; return -1; }
 
 
   // test construction from identity
   SMatrix<float,3,3> i3 = SMatrixIdentity(); 
 
-  cout << "3x3 Identity\n" << i3 << endl;
+  std::cout << "3x3 Identity\n" << i3 << std::endl;
 
   SMatrix<float,2,3> i23 = SMatrixIdentity(); 
-  cout << "2x3 Identity\n" << i23 << endl;
+  std::cout << "2x3 Identity\n" << i23 << std::endl;
 
   SMatrix<float,3,3,MatRepSym<float,3> > is3 = SMatrixIdentity(); 
-  cout << "Sym matrix Identity\n" << is3 << endl;
+  std::cout << "Sym matrix Identity\n" << is3 << std::endl;
 
 
   // test operator = from identity
   A = SMatrixIdentity();
-  cout << "4x3 Identity\n" << A << endl;
+  std::cout << "4x3 Identity\n" << A << std::endl;
 
   std::vector<float> v(6);
   for (int i = 0; i <6; ++i) v[i] = double(i+1);
   SMatrix<float,3,3,MatRepSym<float,3> > s3(v.begin(), v.end() );
-  cout << s3 << endl;
+  std::cout << s3 << std::endl;
 
     
   return 0;
@@ -138,13 +138,13 @@ int test2() {
   A(0,0) = A(1,0) = 1;
   A(0,1) = 3;
   A(1,1) = A(2,2) = 2;
-  cout << "A: " << endl << A << endl;
+  std::cout << "A: " << std::endl << A << std::endl;
 
   SVector<double,3> x = A.Row(0);
-  cout << "x: " << x << endl;
+  std::cout << "x: " << x << std::endl;
 
   SVector<double,3> y = A.Col(1);
-  cout << "y: " << y << endl;
+  std::cout << "y: " << y << std::endl;
 
   return 0;
 #endif
@@ -157,20 +157,20 @@ int test3() {
   A(1,1) = A(2,2) = 2;
 
   SMatrix<double,3> B = A; // save A in B
-  cout << "A: " << endl << A << endl;
+  std::cout << "A: " << std::endl << A << std::endl;
 
   double det = 0.;
   A.Det(det);
-  cout << "Determinant: " << det << endl;
+  std::cout << "Determinant: " << det << std::endl;
   // WARNING: A has changed!!
-  cout << "A again: " << endl << A << endl;
+  std::cout << "A again: " << std::endl << A << std::endl;
   A = B; 
 
   A.Invert();
-  cout << "A^-1: " << endl << A << endl;
+  std::cout << "A^-1: " << std::endl << A << std::endl;
 
   // check if this is really the inverse:
-  cout << "A^-1 * B: " << endl << A * B << endl;
+  std::cout << "A^-1 * B: " << std::endl << A * B << std::endl;
 
   return 0;
 #endif
@@ -181,13 +181,13 @@ int test4() {
   SMatrix<double,3> A;
   A(0,0) = A(0,1) = A(1,0) = 1;
   A(1,1) = A(2,2) = 2;
-  cout << " A: " << endl << A << endl;
+  std::cout << " A: " << std::endl << A << std::endl;
 
   SVector<double,3> x(1,2,3);
-  cout << "x: " << x << endl;
+  std::cout << "x: " << x << std::endl;
 
   // we add 1 to each component of x and A
-  cout << " (x+1)^T * (A+1) * (x+1): " << Similarity(x+1,A+1) << endl;
+  std::cout << " (x+1)^T * (A+1) * (x+1): " << Similarity(x+1,A+1) << std::endl;
 
   return 0;
 #endif
@@ -198,17 +198,17 @@ int test5() {
   SMatrix<float,4,3> A;
   A(0,0) = A(0,1) = A(1,1) = A(2,2) = 4.;
   A(2,3) = 1.;
-  cout << "A: " << endl << A << endl;
+  std::cout << "A: " << std::endl << A << std::endl;
   SVector<float,4> x(1,2,3,4);
-  cout << " x: " << x << endl;
+  std::cout << " x: " << x << std::endl;
   SVector<float,3> a(1,2,3);
-  cout << " a: " << a << endl;
+  std::cout << " a: " << a << std::endl;
   SVector<float,4> y = x + A * a;
   //    SVector<float,4> y = A * a;
-  cout << " y: " << y << endl;
+  std::cout << " y: " << y << std::endl;
 
   SVector<float,3> b = (x+1) * (A+1);
-  cout << " b: " << b << endl;
+  std::cout << " b: " << b << std::endl;
 
   return 0;
 #endif
@@ -218,14 +218,14 @@ int test6() {
 #ifdef XXX
   SMatrix<float,4,2> A;
   A(0,0) = A(0,1) = A(1,1) = A(2,0) = A(3,1) = 4.;
-  cout << "A: " << endl << A << endl;
+  std::cout << "A: " << std::endl << A << std::endl;
   
   SMatrix<float,2,3> S;
   S(0,0) = S(0,1) = S(1,1) = S(0,2) = 1.;
-  cout << " S: " << endl << S << endl;
+  std::cout << " S: " << std::endl << S << std::endl;
   
   SMatrix<float,4,3> C = A * S;
-  cout << " C: " << endl << C << endl;
+  std::cout << " C: " << std::endl << C << std::endl;
   
   return 0;
 #endif
@@ -247,28 +247,28 @@ int test7() {
   z.Place_in_col(zv,0,1);
   z.Place_in_col(zv,0,2);
 
-  cout << "x\n" << x << "y\n" << y << "z\n" << z << endl;
+  std::cout << "x\n" << x << "y\n" << y << "z\n" << z << std::endl;
 
   // element wise multiplication
-  cout << "x * (- y) : " << endl << Times(x, -y) << endl;
+  std::cout << "x * (- y) : " << std::endl << Times(x, -y) << std::endl;
 
   x += z - y;
-  cout << "x += z - y: " << endl << x << endl;
+  std::cout << "x += z - y: " << std::endl << x << std::endl;
 
   // element wise square root
-  cout << "sqrt(z): " << endl << sqrt(z) << endl;
+  std::cout << "sqrt(z): " << std::endl << sqrt(z) << std::endl;
 
   // element wise multiplication with constant
-  cout << "2 * y: " << endl << 2 * y << endl;
+  std::cout << "2 * y: " << std::endl << 2 * y << std::endl;
 
   // a more complex expression (failure on Win32)
 #ifndef _WIN32
-  //cout << "fabs(-z + 3*x): " << endl << fabs(-z + 3*x) << endl;
-  cout << "fabs(3*x -z): " << endl << fabs(3*x -z) << endl;
+  //std::cout << "fabs(-z + 3*x): " << std::endl << fabs(-z + 3*x) << std::endl;
+  std::cout << "fabs(3*x -z): " << std::endl << fabs(3*x -z) << std::endl;
 #else 
   // doing directly gives internal compiler error on windows
   SMatrix<float,2,3>  ztmp = 3*x - z; 
-  cout << " fabs(-z+3*x) " << endl << fabs(ztmp) << endl;
+  std::cout << " fabs(-z+3*x) " << std::endl << fabs(ztmp) << std::endl;
 #endif
 
   return 0;
@@ -283,41 +283,41 @@ int test8() {
   A.Place_in_row(av1,0,0);
   A.Place_in_row(av2,1,0);
   
-  cout << "A: " << endl << A << endl;
+  std::cout << "A: " << std::endl << A << std::endl;
 
   SVector<float,3>    x(1,2,3);
   SVector<float,3>    y(4,5,6);
 
-  cout << "dot(x,y): " << Dot(x,y) << endl;
+  std::cout << "dot(x,y): " << Dot(x,y) << std::endl;
 
-  cout << "mag(x): " << Mag(x) << endl;
+  std::cout << "mag(x): " << Mag(x) << std::endl;
 
-  cout << "cross(x,y): " << Cross(x,y) << endl;
+  std::cout << "cross(x,y): " << Cross(x,y) << std::endl;
 
-  cout << "unit(x): " << Unit(x) << endl;
+  std::cout << "unit(x): " << Unit(x) << std::endl;
 
   SVector<float,3>    z(4,16,64);
-  cout << "x + y: " << x+y << endl;
+  std::cout << "x + y: " << x+y << std::endl;
 
-  cout << "x + y(0) " << (x+y)(0) << endl;
+  std::cout << "x + y(0) " << (x+y)(0) << std::endl;
 
-  cout << "x * -y: " << x * -y << endl;
+  std::cout << "x * -y: " << x * -y << std::endl;
   x += z - y;
-  cout << "x += z - y: " << x << endl;
+  std::cout << "x += z - y: " << x << std::endl;
 
   // element wise square root
-  cout << "sqrt(z): " << sqrt(z) << endl;
+  std::cout << "sqrt(z): " << sqrt(z) << std::endl;
 
   // element wise multiplication with constant
-  cout << "2 * y: " << 2 * y << endl;
+  std::cout << "2 * y: " << 2 * y << std::endl;
 
   // a more complex expression
-  cout << "fabs(-z + 3*x): " << fabs(-z + 3*x) << endl;
+  std::cout << "fabs(-z + 3*x): " << fabs(-z + 3*x) << std::endl;
 
   SVector<float,4> a;
   SVector<float,2> b(1,2);
   a.Place_at(b,2);
-  cout << "a: " << a << endl;
+  std::cout << "a: " << a << std::endl;
 #endif
 
   SVector<float,3> x2 = Square(x); 
@@ -336,18 +336,18 @@ int test9() {
 
   double det = 0.;
   A.Det2(det);
-  cout << "Determinant: " << det << endl;
+  std::cout << "Determinant: " << det << std::endl;
 
   int ifail; 
   SMatrix<double,3> Ainv = A.Inverse(ifail);
   if (ifail) { 
-    cout << "inversion failed\n";
+    std::cout << "inversion failed\n";
     return -1;
   } 
-  cout << "A^-1: " << endl << Ainv << endl;
+  std::cout << "A^-1: " << std::endl << Ainv << std::endl;
 
   // check if this is really the inverse:
-  cout << "A^-1 * A: " << endl << Ainv * A << endl;
+  std::cout << "A^-1 * A: " << std::endl << Ainv * A << std::endl;
 
   return 0;
 }
@@ -358,7 +358,7 @@ int test10() {
   double d[9] = { 1,2,3,4,5,6,7,8,9};
   SMatrix<double,3> A( d,d+9);
 
-  cout << "A: " << A << endl;
+  std::cout << "A: " << A << std::endl;
 
   SVector<double,2> v23 = A.SubRow<SVector<double,2> >( 0,1);    
   SVector<double,2> v69 = A.SubCol<SVector<double,2> >( 2,1);    
@@ -850,14 +850,14 @@ int test15() {
   iret |= compare( A1(0,0),u[0] );
   iret |= compare( A1(1,2),u[6] );
   iret |= compare( A1(2,3),u[11] );
-  //cout << A1 << endl;
+  //std::cout << A1 << std::endl;
 
   SMatrix<double,3,4> A2(w,6,true,true);
   iret |= compare( A2(0,0),w[0] );
   iret |= compare( A2(1,0),w[1] );
   iret |= compare( A2(2,0),w[3] );
   iret |= compare( A2(2,2),w[5] );
-  //cout << A2 << endl;
+  //std::cout << A2 << std::endl;
 
   // upper diagonal (needs 9 elements)
   SMatrix<double,3,4> A3(u,9,true,false);
@@ -866,10 +866,10 @@ int test15() {
   iret |= compare( A3(0,2),u[2] );
   iret |= compare( A3(1,2),u[5] );
   iret |= compare( A3(2,3),u[8] );
-  //cout << A3 << endl;
+  //std::cout << A3 << std::endl;
 
 
-  //cout << "test sym matrix " << endl;
+  //std::cout << "test sym matrix " << std::endl;
   SMatrix<double,3,3,MatRepSym<double,3> > S1(w,6,true); 
   iret |= compare( S1(0,0),w[0] );
   iret |= compare( S1(1,0),w[1] );
diff --git a/math/unuran/test/unuranDistr.cxx b/math/unuran/test/unuranDistr.cxx
index d9d1ba463f4..ac4ef05557f 100644
--- a/math/unuran/test/unuranDistr.cxx
+++ b/math/unuran/test/unuranDistr.cxx
@@ -94,7 +94,7 @@ public:
          htmp.Fill( fCdf->Eval(x) ); 
       } 
       double prob = fHref->Chi2Test(&htmp,"UU");
-      cout << "Time using Unuran  " << unr.MethodName() << "   \t=\t " << time << "\tns/call \t\tChi2 Prob = "<< prob << endl;
+      std::cout << "Time using Unuran  " << unr.MethodName() << "   \t=\t " << time << "\tns/call \t\tChi2 Prob = "<< prob << std::endl;
       if (prob < 1E-06) { 
          std::cout << "Chi2 Test failed ! " << std::endl;
          fHref->Chi2Test(&htmp,"UUP"); // print all chi2 test info
@@ -128,7 +128,7 @@ public:
          htmp.Fill( fCdf->Eval(x) ); 
       } 
       double prob = fHref->Chi2Test(&htmp,"UU");
-      cout << "Time using TF1::GetRandom()    \t=\t " << time << "\tns/call \t\tChi2 Prob = "<< prob << endl;
+      std::cout << "Time using TF1::GetRandom()    \t=\t " << time << "\tns/call \t\tChi2 Prob = "<< prob << std::endl;
       if (prob < 1E-06) { 
          std::cout << "Chi2 Test failed ! " << std::endl;
          fHref->Chi2Test(&htmp,"UUP"); // print all chi2 test info
@@ -192,7 +192,7 @@ int unuranDistr() {
    // arou: needs pdf and dpdf (estimated numerically in dist class)
    ret = unr.Init(dist,"arou"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName() << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName() << std::endl; 
       iret = -1;
    } 
    else 
@@ -201,7 +201,7 @@ int unuranDistr() {
    // nrou (needs only pdf , mode is an option) 
    ret = unr.Init(dist,"nrou"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -2;
    } 
    else 
@@ -211,7 +211,7 @@ int unuranDistr() {
    // tdr: needs pdf and dpdf (estimated numerically in dist class)
    ret = unr.Init(dist,"tdr"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -3;
    } 
    else 
@@ -223,7 +223,7 @@ int unuranDistr() {
    // hinv (needs cdf , pdf and dpdf are  optionally)
    ret = unr.Init(dist,"hinv"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -4;
    } 
    else 
@@ -234,7 +234,7 @@ int unuranDistr() {
    ret = unr.Init(dist,"ninv"); 
    n/= 10; // method is too slow
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -5;
    } 
    else 
@@ -247,7 +247,7 @@ int unuranDistr() {
    // srou (need pdf mode sand area)
    ret = unr.Init(dist,"srou"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -6;
    } 
    else 
@@ -256,7 +256,7 @@ int unuranDistr() {
    // srou (need pdf mode sand area)
    ret = unr.Init(dist,"ssr"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -7;
    } 
    else 
@@ -265,7 +265,7 @@ int unuranDistr() {
    n*= 10;
    ret = unr.Init(dist,"utdr"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -8;
    } 
    else 
@@ -286,7 +286,7 @@ int unuranDistr() {
 
    ret = unr.Init(dist,"auto"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -10;
    } 
    else 
@@ -308,7 +308,7 @@ int unuranDistr() {
    // show now some plots 
    ret = unr.Init(dist,"auto"); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName()  << std::endl; 
       iret =  -20;
    } 
    int n2 = n/10;
diff --git a/math/unuran/test/unuranMulti2D.cxx b/math/unuran/test/unuranMulti2D.cxx
index e2e7fb34499..3612dc0fdf7 100644
--- a/math/unuran/test/unuranMulti2D.cxx
+++ b/math/unuran/test/unuranMulti2D.cxx
@@ -66,7 +66,7 @@ int testUnuran(TUnuran & unr, const std::string & method, const TUnuranMultiCont
    // init unuran 
    bool ret =   unr.Init(dist,method); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName() << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName() << std::endl; 
       return -1;
    } 
 
@@ -89,7 +89,7 @@ int testUnuran(TUnuran & unr, const std::string & method, const TUnuranMultiCont
 
    double prob = href->Chi2Test(h1,"UU");
    double ksprob = href->KolmogorovTest(h1);
-   cout << "Time using Unuran  " << unr.MethodName() << "   \t=\t " << time << "\tns/call \t\tChi2 Prob = "
+   std::cout << "Time using Unuran  " << unr.MethodName() << "   \t=\t " << time << "\tns/call \t\tChi2 Prob = "
         << prob << "\tKS Prob = " << ksprob << std::endl;
    if (prob < 1E-06) { 
       std::cout << "Chi2 Test failed ! " << std::endl;
@@ -204,7 +204,7 @@ int unuranMulti2D() {
 #endif
 
    // test setting the mode
-   cout << "\nTest setting the mode in Unuran distribution:\n\n"; 
+   std::cout << "\nTest setting the mode in Unuran distribution:\n\n"; 
    double m[2] = {0,0};
    dist.SetMode(m);
 
@@ -235,7 +235,7 @@ int unuranMulti2D() {
 
    const double *xlow = dist.GetLowerDomain(); 
    const double *xup = dist.GetUpperDomain(); 
-   cout << "\nTest truncated distribution in domain [ " << xlow[0] << " : " << xup[0] 
+   std::cout << "\nTest truncated distribution in domain [ " << xlow[0] << " : " << xup[0] 
         << " , " << xlow[1] << " : " << xup[1] << " ] :\n\n"; 
    
 
diff --git a/math/unuran/test/unuranMultiDim.cxx b/math/unuran/test/unuranMultiDim.cxx
index 26e901b70fb..e8d6d54872a 100644
--- a/math/unuran/test/unuranMultiDim.cxx
+++ b/math/unuran/test/unuranMultiDim.cxx
@@ -79,7 +79,7 @@ int testUnuran(TUnuran & unr, const std::string & method, const TUnuranMultiCont
    // init unuran 
    bool ret =   unr.Init(dist,method); 
    if (!ret) { 
-      std::cerr << "Error initializing unuran with method " << unr.MethodName() << endl; 
+      std::cerr << "Error initializing unuran with method " << unr.MethodName() << std::endl; 
       return -1;
    } 
 
@@ -99,7 +99,7 @@ int testUnuran(TUnuran & unr, const std::string & method, const TUnuranMultiCont
    w.Stop(); 
    double time = w.CpuTime()*1.E9/n; 
 
-   cout << "Time using Unuran  " << unr.MethodName() << "   \t=\t " << time << "\tns/call\t";
+   std::cout << "Time using Unuran  " << unr.MethodName() << "   \t=\t " << time << "\tns/call\t";
    if (href != 0)  { 
       double prob = href->Chi2Test(h1,"UU");
       double ksprob = href->KolmogorovTest(h1);
@@ -237,7 +237,7 @@ int  unuranMultiDim() {
 #endif
 
    // test setting the mode
-   cout << "\nTest setting the mode in Unuran distribution:\n\n"; 
+   std::cout << "\nTest setting the mode in Unuran distribution:\n\n"; 
    double m[3] = {0,0,0};
    dist.SetMode(m);
 
@@ -253,7 +253,7 @@ int  unuranMultiDim() {
    iret |= testUnuran(unr, method, logdist, h1, href);
 #endif
 
-   cout << "\nTest truncated distribution:\n\n"; 
+   std::cout << "\nTest truncated distribution:\n\n"; 
 
    double xmin[3] = { -1, -1, -1 }; 
    double xmax[3] = {  1,  1,  1 }; 
@@ -316,7 +316,7 @@ int  unuranMultiDim() {
    n/= scale;
    iret |= testUnuran(unr, method, dist3, hrefN);
 
-   cout << "\nTest 10 dimension:       (be patient , it takes time....)\n\n"; 
+   std::cout << "\nTest 10 dimension:       (be patient , it takes time....)\n\n"; 
 
    TF1 * f10 = new TF1("g10d",gaus10d,-10,10,0); 
    TUnuranMultiContDist dist10(f10,10); 
@@ -341,13 +341,13 @@ int  unuranMultiDim() {
 
 
    // 100 dim
-   cout << "\nTest 100 dimension: (  be patient , it takes time....)\n\n"; 
+   std::cout << "\nTest 100 dimension: (  be patient , it takes time....)\n\n"; 
    TF1 * f100 = new TF1("g100d",gaus100d,-10,10,0); 
    TUnuranMultiContDist dist100(f100,100); 
    
    //   scale = 5;
    //  n/=scale;
-   std::cout << "number of events to be generated  = " << n << endl;
+   std::cout << "number of events to be generated  = " << n << std::endl;
    method = "hitro;thinning=200";
    iret |= testUnuran(unr, method, dist100, h100, hrefN,100);
 //    n/= 100;
diff --git a/math/unuran/test/unuranSimple.cxx b/math/unuran/test/unuranSimple.cxx
index a0d13b56e9d..ff11d681021 100644
--- a/math/unuran/test/unuranSimple.cxx
+++ b/math/unuran/test/unuranSimple.cxx
@@ -61,7 +61,7 @@ int unuranSimple( ) {
 
    TUnuran unr; 
    if (! unr.Init( "normal()", "method=arou") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
 
@@ -77,11 +77,11 @@ int unuranSimple( ) {
 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using Unuran method arou =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using Unuran method arou =\t " <<   time << "\tns/call" << std::endl;
 
 
    if (! unr.Init( "normal()", "method=tdr") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
    w.Start(); 
@@ -90,10 +90,10 @@ int unuranSimple( ) {
 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using Unuran method tdr =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using Unuran method tdr =\t " <<   time << "\tns/call" << std::endl;
 
    if (! unr.Init( "normal()", "method=hinv") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
    w.Start(); 
@@ -102,14 +102,14 @@ int unuranSimple( ) {
 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using Unuran method hinv =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using Unuran method hinv =\t " <<   time << "\tns/call" << std::endl;
 
    w.Start();
    for (int i = 0; i < n; ++i) 
       gRandom->Gaus(0,1); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using TRandom::Gaus  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using TRandom::Gaus  =\t " <<   time << "\tns/call" << std::endl;
 
    // using Rannor
    w.Start();
@@ -118,7 +118,7 @@ int unuranSimple( ) {
       gRandom->Rannor(x1,x2); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using TRandom::Rannor  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using TRandom::Rannor  =\t " <<   time << "\tns/call" << std::endl;
 
 #ifdef HAVE_MATHMORE
    // using GSL Ziggurat
@@ -128,7 +128,7 @@ int unuranSimple( ) {
       rgsl.Gaus(0,1); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using GSL::Gaus  =\t\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using GSL::Gaus  =\t\t " <<   time << "\tns/call" << std::endl;
 
    // using GSL BoxMuller method
    w.Start();
@@ -136,7 +136,7 @@ int unuranSimple( ) {
       rgsl.GausBM(0,1); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using GSL::GausBM  =  \t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using GSL::GausBM  =  \t " <<   time << "\tns/call" << std::endl;
 
    // using GSL Ratio method
    w.Start();
@@ -144,14 +144,14 @@ int unuranSimple( ) {
       rgsl.GausR(0,1); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using GSL::GausR  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using GSL::GausR  =\t " <<   time << "\tns/call" << std::endl;
 #endif
 
 
    // run unuran standard Normal methods 2 (Polar from Marsaglia)
 
    if (! unr.Init( "normal()", "method=cstd;variant=2") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
    w.Start(); 
@@ -160,12 +160,12 @@ int unuranSimple( ) {
 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using Unuran GausPolarR =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using Unuran GausPolarR =\t " <<   time << "\tns/call" << std::endl;
 
    // run unuran standard Normal method 3 (KM)
 
    if (! unr.Init( "normal()", "method=cstd;variant=3") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
    w.Start(); 
@@ -174,10 +174,10 @@ int unuranSimple( ) {
 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using Unuran Gaus  K-R   =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using Unuran Gaus  K-R   =\t " <<   time << "\tns/call" << std::endl;
   
    if (! unr.Init( "normal()", "method=cstd;variant=6") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
    w.Start(); 
@@ -186,7 +186,7 @@ int unuranSimple( ) {
 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using Unuran Gaus exp6  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using Unuran Gaus exp6  =\t " <<   time << "\tns/call" << std::endl;
 
 
 //    w.Start();
@@ -194,7 +194,7 @@ int unuranSimple( ) {
 //       rgsl.GausRatio(0,1); 
 //    w.Stop(); 
 //    time = w.CpuTime()*1.E9/n;
-//    cout << "Time using GSL::GausRatio  =\t\t " <<   time << "\tns/call" << endl;
+//    std::cout << "Time using GSL::GausRatio  =\t\t " <<   time << "\tns/call" << std::endl;
 
 #ifdef HAVE_CLHEP
    MTwistEngine eng(111);
@@ -204,7 +204,7 @@ int unuranSimple( ) {
       rg(0,1); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using CLHEP::Gaus  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using CLHEP::Gaus  =\t " <<   time << "\tns/call" << std::endl;
 #endif
 
    std::cout << "\nTest uniform generator\n" << std::endl;
@@ -213,7 +213,7 @@ int unuranSimple( ) {
       gRandom->Rndm(); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using gRandom::Rndm  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using gRandom::Rndm  =\t " <<   time << "\tns/call" << std::endl;
 
    TRandom1 r1;
    w.Start();
@@ -221,7 +221,7 @@ int unuranSimple( ) {
       r1.Rndm(); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using TRandom1::Rndm  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using TRandom1::Rndm  =\t " <<   time << "\tns/call" << std::endl;
 
    TRandom2 r2;
    w.Start();
@@ -229,7 +229,7 @@ int unuranSimple( ) {
       r2.Rndm(); 
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using TRandom2::Rndm  =\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using TRandom2::Rndm  =\t " <<   time << "\tns/call" << std::endl;
 
 #ifdef HAVE_CLHEP
    RandFlat rf(eng);
@@ -238,7 +238,7 @@ int unuranSimple( ) {
       eng.flat(); // use directly the engine (faster!)
    w.Stop(); 
    time = w.CpuTime()*1.E9/n;
-   cout << "Time using CLHEP::MT  =\t\t " <<   time << "\tns/call" << endl;
+   std::cout << "Time using CLHEP::MT  =\t\t " <<   time << "\tns/call" << std::endl;
 
    { 
       RanecuEngine e; 
@@ -248,7 +248,7 @@ int unuranSimple( ) {
          e.flat(); 
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::Ranecu  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::Ranecu  =\t " <<   time << "\tns/call" << std::endl;
    }
    { 
       Hurd160Engine e; 
@@ -258,7 +258,7 @@ int unuranSimple( ) {
          e.flat();
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::Hard160  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::Hard160  =\t " <<   time << "\tns/call" << std::endl;
    }
    { 
       Hurd288Engine e; 
@@ -269,7 +269,7 @@ int unuranSimple( ) {
          //rf2(); 
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::Hard288  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::Hard288  =\t " <<   time << "\tns/call" << std::endl;
    }
    { 
       DualRand e; 
@@ -280,7 +280,7 @@ int unuranSimple( ) {
       //rf2(); 
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::DualRand  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::DualRand  =\t " <<   time << "\tns/call" << std::endl;
    }
    {
       TripleRand e; 
@@ -291,7 +291,7 @@ int unuranSimple( ) {
       //rf2(); 
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::TripleRand  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::TripleRand  =\t " <<   time << "\tns/call" << std::endl;
    }
    {
       RanshiEngine e; 
@@ -302,7 +302,7 @@ int unuranSimple( ) {
          e.flat();
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::Runshi  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::Runshi  =\t " <<   time << "\tns/call" << std::endl;
    }
    {
       RanluxEngine e; 
@@ -313,7 +313,7 @@ int unuranSimple( ) {
          e.flat();
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::RunLux  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::RunLux  =\t " <<   time << "\tns/call" << std::endl;
    }
    {
       Ranlux64Engine e; 
@@ -323,7 +323,7 @@ int unuranSimple( ) {
          e.flat(); 
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::RunLux64  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::RunLux64  =\t " <<   time << "\tns/call" << std::endl;
    }
    {
       HepJamesRandom e; 
@@ -334,16 +334,16 @@ int unuranSimple( ) {
          e.flat(); 
       w.Stop(); 
       time = w.CpuTime()*1.E9/n;
-      cout << "Time using CLHEP::HepJames  =\t " <<   time << "\tns/call" << endl;
+      std::cout << "Time using CLHEP::HepJames  =\t " <<   time << "\tns/call" << std::endl;
    }
 
 #endif
 
 
    // test the quality by looking at the cdf
-   cout <<"\n\nTest quality of Unuran arou" << endl;
+   std::cout <<"\n\nTest quality of Unuran arou" << std::endl;
    if (! unr.Init( "normal()", "method=arou") ) {
-      cout << "Error initializing unuran" << endl;
+      std::cout << "Error initializing unuran" << std::endl;
       return -1;
    }
 
diff --git a/misc/memstat/src/TMemStatMng.cxx b/misc/memstat/src/TMemStatMng.cxx
index 26acbc9ae4a..29a3df2dd5a 100644
--- a/misc/memstat/src/TMemStatMng.cxx
+++ b/misc/memstat/src/TMemStatMng.cxx
@@ -99,7 +99,7 @@ void TMemStatMng::Init()
    fDumpTree->GetUserInfo()->Add(fHbtids);
    fDumpTree->GetUserInfo()->Add(fFAddrsList);
    // save the system info to a tree header
-   string sSysInfo(gSystem->GetBuildNode());
+   std::string sSysInfo(gSystem->GetBuildNode());
    sSysInfo += " | ";
    sSysInfo += gSystem->GetBuildCompilerVersion();
    sSysInfo += " | ";
@@ -135,7 +135,7 @@ void TMemStatMng::Close()
    // TODO: This is a temporary solution until we find a properalgorithm for SaveData
    //fgInstance->fDumpFile->WriteObject(fgInstance->fFAddrsList, "FAddrsList");
 
-/*  ofstream f("mem_stat_debug.txt");
+/*  std::ofstream f("mem_stat_debug.txt");
   int *btids = fgInstance->fHbtids->GetArray();
    if( !btids )
       return;
@@ -157,7 +157,7 @@ void TMemStatMng::Close()
            TNamed *nm = (TNamed*)fgInstance->fFAddrsList->At(btids[j]);
            if( !nm )
                {
-                   f << "Bad ID" << endl;
+                   f << "Bad ID" << std::endl;
                    bStop = true;
                 }
            f << "-------> " << nm->GetTitle() << "\n";
@@ -385,7 +385,7 @@ Int_t TMemStatMng::generateBTID(UChar_t *CRCdigest, Int_t stackEntries,
       }
 
       // add new BT's CRC value
-      pair<CRCSet_t::iterator, bool> res = fBTChecksums.insert(CRCSet_t::value_type(CRCdigest, ret_val));
+      std::pair<CRCSet_t::iterator, bool> res = fBTChecksums.insert(CRCSet_t::value_type(CRCdigest, ret_val));
       if(!res.second)
          Error("AddPointer", "Can't added a new BTID to the container.");
 
diff --git a/misc/table/inc/LinkDef.h b/misc/table/inc/LinkDef.h
index aa7285c7f34..9d31966ed45 100644
--- a/misc/table/inc/LinkDef.h
+++ b/misc/table/inc/LinkDef.h
@@ -51,5 +51,5 @@
 #pragma link C++ class TTablePoints+;
 #pragma link C++ class TTable3Points+;
 
-#pragma link C++ function operator<<(ostream &, const TVolumePosition &);
+#pragma link C++ function operator<<(std::ostream &, const TVolumePosition &);
 #endif
diff --git a/misc/table/inc/TChair.h b/misc/table/inc/TChair.h
index 88acdd2a458..7aeba1478d7 100644
--- a/misc/table/inc/TChair.h
+++ b/misc/table/inc/TChair.h
@@ -85,7 +85,7 @@ public:
 
                void      *ReAllocate(Int_t newsize) { return GetThisTable()->ReAllocate(newsize); }
                void      *ReAllocate()              { return GetThisTable()->ReAllocate(); }
-   virtual     void       SavePrimitive(ostream &out, Option_t *option="") {GetThisTable()->SavePrimitive(out,option);}
+   virtual     void       SavePrimitive(std::ostream &out, Option_t *option="") {GetThisTable()->SavePrimitive(out,option);}
 
    virtual     void       Set(Int_t n)                                   {GetThisTable()->Set(n);}
    virtual     void       Set(Int_t n, Char_t *array)                    {GetThisTable()->Set(n,array);}
@@ -122,9 +122,9 @@ inline const void *TChair::operator[](Int_t i) const
 // from Axel:
 // Change the signature of SavePrimitive from
 //
-//   void SavePrimitive(ofstream &out, Option_t *option);
+//   void SavePrimitive(std::ofstream &out, Option_t *option);
 // to
-//   void SavePrimitive(ostream &out, Option_t *option = "");
+//   void SavePrimitive(std::ostream &out, Option_t *option = "");
 //
 // With this change one can do, eg
 //    myhist.SavePrimitive(std::cout);
diff --git a/misc/table/inc/TTable.h b/misc/table/inc/TTable.h
index 9d2046e6586..3306eada271 100644
--- a/misc/table/inc/TTable.h
+++ b/misc/table/inc/TTable.h
@@ -104,7 +104,7 @@ public:
    virtual     void       AddAt(const void *c, Int_t i);
    virtual     void       AddAt(TDataSet *dataset,Int_t idx=0);
    virtual     Long_t     AppendRows(const void *row, UInt_t nRows);
-   virtual     void       AsString(void *buf, EColumnType type, Int_t width, ostream &out) const;
+   virtual     void       AsString(void *buf, EColumnType type, Int_t width, std::ostream &out) const;
               const void *At(Int_t i) const;
    virtual     void       Browse(TBrowser *b);
    virtual     void       CopySet(TTable &array);
@@ -146,7 +146,7 @@ public:
 
                void      *ReAllocate(Int_t newsize);
                void      *ReAllocate();
-   virtual     void       SavePrimitive(ostream &out, Option_t *option = "");
+   virtual     void       SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual     void       Set(Int_t n);
    virtual     void       Set(Int_t n, Char_t *array);
    virtual     void       SetNRows(Int_t n);
@@ -195,7 +195,7 @@ public:
          iterator(const TTable &table, vec_const_iterator &arowPtr) :
             fRowSize(table.GetRowSize()), fThisTable(&table),
             fCurrentRow(*(std::vector<Long_t>::iterator *)(void *)&arowPtr) {;}
-            //fCurrentRow(* const_cast<vector<Long_t>::iterator *>(&arowPtr) ) {;}
+            //fCurrentRow(* const_cast<std::vector<Long_t>::iterator *>(&arowPtr) ) {;}
          iterator(const iterator& iter) : fRowSize (iter.fRowSize), fThisTable(iter.fThisTable),fCurrentRow(iter.fCurrentRow){}
          iterator &operator=(const iterator& iter)   { fRowSize = iter.fRowSize; fThisTable = iter.fThisTable; fCurrentRow=iter.fCurrentRow; return *this; }
          void operator++()    { ++fCurrentRow;   }
diff --git a/misc/table/inc/TVolumePosition.h b/misc/table/inc/TVolumePosition.h
index 19e8ef129c8..3cb2c62f7fc 100644
--- a/misc/table/inc/TVolumePosition.h
+++ b/misc/table/inc/TVolumePosition.h
@@ -84,7 +84,7 @@ public:
    virtual void        Print(Option_t *option="") const;
    virtual void        UpdatePosition(Option_t *option="");
    virtual TVolumePosition *Reset(TVolume *node=0,Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0);
-   virtual void        SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void        SetLineAttributes(); // *MENU*
    virtual void        SetMatrix(TRotMatrix *matrix=0);
    virtual void        SetNode(TVolume *node){ fNode = node;}
@@ -142,5 +142,5 @@ inline  TVolumePosition    &TVolumePosition::operator=(const TVolumePosition &rh
    return *this;
 }
 //______________________________________________________________________________
-ostream& operator<<(ostream& s,const TVolumePosition &target);
+std::ostream& operator<<(std::ostream& s,const TVolumePosition &target);
 #endif
diff --git a/misc/table/inc/TVolumeView.h b/misc/table/inc/TVolumeView.h
index 23b93c307be..190e9a6d731 100644
--- a/misc/table/inc/TVolumeView.h
+++ b/misc/table/inc/TVolumeView.h
@@ -70,7 +70,7 @@ public:
    virtual void     Paint(Option_t *option="");
    virtual TString  PathP() const;
    virtual void     SetLineAttributes(); // *MENU*
-   virtual void     SavePrimitive(ostream &out, Option_t *option="");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option="");
    virtual void     SetVisibility(Int_t vis=1); // *MENU*
    virtual void     Sizeof3D() const;
    ClassDef(TVolumeView,1)  // Special kind of TDataSet
diff --git a/misc/table/src/TDataSet.cxx b/misc/table/src/TDataSet.cxx
index 14191aed630..c1b2787eb0c 100644
--- a/misc/table/src/TDataSet.cxx
+++ b/misc/table/src/TDataSet.cxx
@@ -148,7 +148,7 @@ ClassImp(TDataSet)
 TDataSet::TDataSet(const Char_t *name, TDataSet *parent, Bool_t arrayFlag)
            : TNamed(name,"TDataSet"),fParent(0),fList(0)
 {
-  //  cout << "ctor for " << GetName() << " - " << GetTitle() << endl;
+  //  std::cout << "ctor for " << GetName() << " - " << GetTitle() << std::endl;
    if (name && strchr(name,'/')) {
       Error("TDataSet::TDataSet","dataset name (%s) cannot contain a slash", name);
       return;
@@ -184,7 +184,7 @@ fParent(0),fList(0)
   //
   //   All new-created sets become the structural ones anyway.
   //
-  //  cout << "ctor for " << GetName() << " - " << GetTitle() << endl;
+  //  std::cout << "ctor for " << GetName() << " - " << GetTitle() << std::endl;
 
    TDataSet *set = 0;
    TDataSetIter next((TDataSet *)&pattern);
@@ -207,7 +207,7 @@ TDataSet::TDataSet(TNode &)
 //______________________________________________________________________________
 TDataSet::~TDataSet()
 {
-//              cout << "Default destructor for " << GetName() << " - " << GetTitle() << endl;
+//              std::cout << "Default destructor for " << GetName() << " - " << GetTitle() << std::endl;
    Shunt(0); Delete();
 }
 
diff --git a/misc/table/src/TDataSetIter.cxx b/misc/table/src/TDataSetIter.cxx
index 1222877584a..a469c948817 100644
--- a/misc/table/src/TDataSetIter.cxx
+++ b/misc/table/src/TDataSetIter.cxx
@@ -249,14 +249,14 @@ Int_t TDataSetIter::Du() const {
    Int_t count = 0;
    while((nextset = (count) ? next():fWorkingDataSet)) {
       count++;
-      if (nextset->IsFolder()) cout << endl;
+      if (nextset->IsFolder()) std::cout << std::endl;
       TString path = nextset->Path();
-      cout << setw(2) << next.GetDepth() << ". ";
-      cout << path << setw(TMath::Max(Int_t(60-strlen(path.Data())),Int_t(0))) << "...";
+      std::cout << std::setw(2) << next.GetDepth() << ". ";
+      std::cout << path << std::setw(TMath::Max(Int_t(60-strlen(path.Data())),Int_t(0))) << "...";
       const Char_t *type = nextset->IsFolder() ? "directory" : "table" ;
-      cout << setw(10) << type;
-      cout  << " : " << setw(10) << nextset->GetTitle();
-      cout << endl;
+      std::cout << std::setw(10) << type;
+      std::cout  << " : " << std::setw(10) << nextset->GetTitle();
+      std::cout << std::endl;
    }
    return count;
 }
diff --git a/misc/table/src/TPoints3D.cxx b/misc/table/src/TPoints3D.cxx
index 5181a5edb6d..ddacb284d6a 100644
--- a/misc/table/src/TPoints3D.cxx
+++ b/misc/table/src/TPoints3D.cxx
@@ -164,8 +164,8 @@ void TPoints3D::ls(Option_t *option) const
 //*-*                ==========================================
 
    TROOT::IndentLevel();
-   cout << IsA()->GetName() << " N=" <<GetN()<<" Option="<<option<<endl;
-//   IsOwner()?"Owner":"Not owner" << endl;
+   std::cout << IsA()->GetName() << " N=" <<GetN()<<" Option="<<option<<std::endl;
+//   IsOwner()?"Owner":"Not owner" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -173,7 +173,7 @@ void TPoints3D::Print(Option_t *option) const
 {
 //*-*-*-*-*-*-*-*-*-*Dump this 3-D polyline with its attributes*-*-*-*-*-*-*-*-*
 //*-*                ==========================================
-   cout <<"   " << IsA()->GetName() <<" Printing N=" <<GetN()<<" Option="<<option<<endl;
-//   IsOwner()?"Owner":"Not owner" << endl;
+   std::cout <<"   " << IsA()->GetName() <<" Printing N=" <<GetN()<<" Option="<<option<<std::endl;
+//   IsOwner()?"Owner":"Not owner" << std::endl;
 }
 
diff --git a/misc/table/src/TPointsArray3D.cxx b/misc/table/src/TPointsArray3D.cxx
index a5f3a4a0bbe..083fd3750ee 100644
--- a/misc/table/src/TPointsArray3D.cxx
+++ b/misc/table/src/TPointsArray3D.cxx
@@ -245,7 +245,7 @@ void TPointsArray3D::ls(Option_t *option) const
 //*-*                ==========================================
 
    TROOT::IndentLevel();
-   cout << IsA()->GetName() << " N=" <<fN<<" Option="<<option<<endl;
+   std::cout << IsA()->GetName() << " N=" <<fN<<" Option="<<option<<std::endl;
 
 }
 //______________________________________________________________________________
@@ -254,7 +254,7 @@ void TPointsArray3D::Print(Option_t *option) const
 //*-*-*-*-*-*-*-*-*-*Dump this 3-D polyline with its attributes*-*-*-*-*-*-*-*-*
 //*-*                ==========================================
 
-   cout <<"   " << IsA()->GetName() <<" Printing N=" <<fN<<" Option="<<option<<endl;
+   std::cout <<"   " << IsA()->GetName() <<" Printing N=" <<fN<<" Option="<<option<<std::endl;
 }
 //______________________________________________________________________________
 Int_t TPointsArray3D::SetLastPosition(Int_t idx)
diff --git a/misc/table/src/TTable.cxx b/misc/table/src/TTable.cxx
index e6300781d66..26aa26319e8 100644
--- a/misc/table/src/TTable.cxx
+++ b/misc/table/src/TTable.cxx
@@ -214,7 +214,7 @@ TTableDescriptor *TTable::GetTableDescriptors() const {
 }
 
 //______________________________________________________________________________
-void TTable::AsString(void *buf, EColumnType type, Int_t width,ostream &out) const
+void TTable::AsString(void *buf, EColumnType type, Int_t width,std::ostream &out) const
 {
   //
   // AsString represents the value provided via "void *b" with type defined
@@ -229,40 +229,40 @@ void TTable::AsString(void *buf, EColumnType type, Int_t width,ostream &out) con
    
    switch (type) {
       case kFloat:
-         out << dec  << setw(width) << setprecision(width-3) << *(float *)buf;
+         out << std::dec  << std::setw(width) << std::setprecision(width-3) << *(float *)buf;
          break;
       case kInt:
-         out << dec  <<  setw(width) << *(int *)buf;
+         out << std::dec  <<  std::setw(width) << *(int *)buf;
          break;
       case kLong:
-         out << dec  << setw(width) << *(Long_t *)buf;
+         out << std::dec  << std::setw(width) << *(Long_t *)buf;
          break;
       case kShort:
-         out << dec  << setw(width) << *(short *)buf;
+         out << std::dec  << std::setw(width) << *(short *)buf;
          break;
       case kDouble:
-         out << dec  << setw(width) << setprecision(width-3) << *(double *)buf;
+         out << std::dec  << std::setw(width) << std::setprecision(width-3) << *(double *)buf;
          break;
       case kUInt:
-         out << dec  << setw(width) << *(unsigned int *)buf;
+         out << std::dec  << std::setw(width) << *(unsigned int *)buf;
          break;
       case kULong:
-         out << dec  << setw(width) << *(ULong_t *)buf;
+         out << std::dec  << std::setw(width) << *(ULong_t *)buf;
          break;
       case kUShort:
-         out  << setw(width) << "0x" << hex << *(unsigned short *)buf;
+         out  << std::setw(width) << "0x" << std::hex << *(unsigned short *)buf;
          break;
       case kUChar:
-         out  << setw(width) << "0x" << hex << int(*(unsigned char *)buf);
+         out  << std::setw(width) << "0x" << std::hex << int(*(unsigned char *)buf);
          break;
       case kChar:
-         out << setw(width) << *(char *)buf;
+         out << std::setw(width) << *(char *)buf;
          break;
       case kBool:
-         out << setw(width) << *(Bool_t *)buf;
+         out << std::setw(width) << *(Bool_t *)buf;
          break;
       case kPtr:
-         out << "->" << setw(width) << *(void **)buf;
+         out << "->" << std::setw(width) << *(void **)buf;
          break;
       default:
          out << "\"NaN\"";
@@ -1557,7 +1557,7 @@ Char_t *TTable::Print(Char_t *strbuf,Int_t lenbuf) const
       iOut += snprintf(strbuf+iOut,lenbuf-iOut,"struct %s {",typenam);
       delete [] typenam;
    } else {
-      cout << "struct " << dscT->GetName() << " {" << endl;
+      std::cout << "struct " << dscT->GetName() << " {" << std::endl;
    }
 
    TTableDescriptor::iterator dsc  = dscT->begin();
@@ -1572,7 +1572,7 @@ Char_t *TTable::Print(Char_t *strbuf,Int_t lenbuf) const
          name.ReplaceAll("int","long");
          iOut += snprintf(strbuf+iOut,lenbuf-iOut," %s %s",name.Data(),(*dsc).fColumnName);
       } else
-         cout << '\t'<< name.Data() << '\t'<< (*dsc).fColumnName;
+         std::cout << '\t'<< name.Data() << '\t'<< (*dsc).fColumnName;
 
       Int_t indx;
       Int_t dim = (*dsc).fDimensions;
@@ -1580,7 +1580,7 @@ Char_t *TTable::Print(Char_t *strbuf,Int_t lenbuf) const
          if (lenbuf>0)
             iOut += snprintf(strbuf+iOut,lenbuf-iOut,"[%d]",(*dsc).fIndexArray[indx]);
          else
-            cout <<  "[" << dec << (*dsc).fIndexArray[indx]<<"]";
+            std::cout <<  "[" << std::dec << (*dsc).fIndexArray[indx]<<"]";
       }
       // print comment if any
       TDataSet *nxc = nextComment();
@@ -1588,7 +1588,7 @@ Char_t *TTable::Print(Char_t *strbuf,Int_t lenbuf) const
          iOut += snprintf(strbuf+iOut,lenbuf-iOut, ";");
       else {
          const char *title = nxc ? nxc->GetTitle() : " ";
-         cout << ";\t//" << title << endl;
+         std::cout << ";\t//" << title << std::endl;
       }
    } /* dsc */
 
@@ -1596,7 +1596,7 @@ Char_t *TTable::Print(Char_t *strbuf,Int_t lenbuf) const
    if (lenbuf>0)
       iOut += snprintf(strbuf+iOut,lenbuf-iOut, "}");
    else
-      cout << "}" << endl;
+      std::cout << "}" << std::endl;
    return strbuf;
 }
 
@@ -1604,12 +1604,12 @@ Char_t *TTable::Print(Char_t *strbuf,Int_t lenbuf) const
 const Char_t *TTable::PrintHeader() const
 {
   // Print general table inforamtion
-   cout << endl << " ---------------------------------------------------------------------------------------" << endl
+   std::cout << std::endl << " ---------------------------------------------------------------------------------------" << std::endl
         <<  " " << Path()
                 <<"  Allocated rows: "<<fN
                 <<"\t Used rows: "<<fMaxIndex
                 <<"\t Row size: "      << fSize << " bytes"
-        <<endl;
+        <<std::endl;
    return 0;
 }
 
@@ -1633,9 +1633,9 @@ const Char_t *TTable::Print(Int_t row, Int_t rownumber, const Char_t *, const Ch
    Int_t rowNumber = rownumber;
    if (row  > Int_t(GetSize()) || GetSize() == UInt_t(0))  {
       PrintHeader();
-      cout  << " ======================================================================================" << endl
-           << "   There are " << GetSize() << " allocated rows for this table only"                     << endl
-             << " ======================================================================================" << endl;
+      std::cout  << " ======================================================================================" << std::endl
+           << "   There are " << GetSize() << " allocated rows for this table only"                     << std::endl
+             << " ======================================================================================" << std::endl;
       return 0;
    }
    if (rowNumber > Int_t(GetSize()-row)) rowNumber = GetSize()-row;
@@ -1659,20 +1659,20 @@ const Char_t *TTable::Print(Int_t row, Int_t rownumber, const Char_t *, const Ch
    while (rowCount) {
       PrintHeader();
       if  (GetNRows() == 0) {// to Print empty table header
-         cout  << " ======================================================================================" << endl
-               << "   There is NO filled row in this table"                                                 << endl
-               << " ======================================================================================" << endl;
+         std::cout  << " ======================================================================================" << std::endl
+               << "   There is NO filled row in this table"                                                 << std::endl
+               << " ======================================================================================" << std::endl;
          return 0;
       }
-      cout << " Table: " << dscT->GetName()<< "\t";
+      std::cout << " Table: " << dscT->GetName()<< "\t";
       for (Int_t j = row+rowNumber-rowCount; j<row+rowNumber-rowCount+rowStep && j < row+rowNumber ;j++) {
          Int_t hW = width-2;
          if (j>=10) hW -= (int)TMath::Log10(float(j))-1;
-         cout  << setw(hW) << "["<<j<<"]";
-         cout  << " :" ;
+         std::cout  << std::setw(hW) << "["<<j<<"]";
+         std::cout  << " :" ;
       }
-      cout << endl
-      <<       " ======================================================================================" << endl;
+      std::cout << std::endl
+      <<       " ======================================================================================" << std::endl;
       TTableDescriptor::iterator member = dscT->begin();
       TTableDescriptor::iterator   dscE = dscT->end();
       TDataSetIter nextComment(dscT->MakeCommentField(kFALSE));
@@ -1682,7 +1682,7 @@ const Char_t *TTable::Print(Int_t row, Int_t rownumber, const Char_t *, const Ch
          isdate = kFALSE;
          if (strcmp((*member).fColumnName,"fDatime") == 0 && membertype == "UInt_t")
                                                                                    isdate = kTRUE;
-         cout << membertype.Data();
+         std::cout << membertype.Data();
 
          // Add the dimensions to "array" members
          Int_t dim = (*member).fDimensions;
@@ -1707,49 +1707,49 @@ const Char_t *TTable::Print(Int_t row, Int_t rownumber, const Char_t *, const Ch
          for (indexOffset=0; indexOffset < arrayLength && !breakLoop; indexOffset++) {
             nextRow = startRow;
 
-            if (!indexOffset) cout << "\t" << (*member).fColumnName;
-            else              cout << "\t" << setw(strlen((*member).fColumnName)) << " ";
+            if (!indexOffset) std::cout << "\t" << (*member).fColumnName;
+            else              std::cout << "\t" << std::setw(strlen((*member).fColumnName)) << " ";
 
             if (dim) {
-               for (Int_t i=0;i<dim;i++) cout << "["<<dec<<arrayLayout[i]<<"]";
+               for (Int_t i=0;i<dim;i++) std::cout << "["<<std::dec<<arrayLayout[i]<<"]";
                ArrayLayout(arrayLayout,(*member).fIndexArray,dim);
             }
-            cout << "\t";
-            if ( strlen((*member).fColumnName)+3*dim < 8) cout << "\t";
+            std::cout << "\t";
+            if ( strlen((*member).fColumnName)+3*dim < 8) std::cout << "\t";
 
             for (thisStepRows = 0;thisStepRows < thisLoopLenth; thisStepRows++,nextRow += GetRowSize()) {
                const char *pointer = nextRow + offset  + indexOffset*(*member).fTypeSize;
                if (isdate) {
                   cdatime = (UInt_t*)pointer;
                   TDatime::GetDateTime(cdatime[0],cdate,ctime);
-                  cout << cdate << "/" << ctime;
+                  std::cout << cdate << "/" << ctime;
                } else if ((*member).fType == kChar && dim == 1) {
                   char charbuffer[11];
                   strlcpy(charbuffer,pointer,TMath::Min(10,arrayLength)+1);
                   charbuffer[10] = 0;
-                  cout << "\"" << charbuffer;
+                  std::cout << "\"" << charbuffer;
                   if (arrayLength > 10)
-                     cout << " . . . ";
-                  cout << "\"";
+                     std::cout << " . . . ";
+                  std::cout << "\"";
                   breakLoop = kTRUE;
                } else {
-                  AsString((void *)pointer,EColumnType((*member).fType),width,cout);
-                  cout << " :";
+                  AsString((void *)pointer,EColumnType((*member).fType),width,std::cout);
+                  std::cout << " :";
                }
             }
             // Encode  the column's comment
             if (indexOffset==0) {
                TDataSet *nxc = nextComment();
-               cout << " " << (const char *)(nxc ? nxc->GetTitle() : "no comment");
+               std::cout << " " << (const char *)(nxc ? nxc->GetTitle() : "no comment");
             }
-            cout << endl;
+            std::cout << std::endl;
          }
          if (arrayLayout) delete [] arrayLayout;
       }
       rowCount -= thisLoopLenth;
       startRow  = nextRow;
    }
-   cout << "---------------------------------------------------------------------------------------" << endl;
+   std::cout << "---------------------------------------------------------------------------------------" << std::endl;
    return 0;
 }
 //______________________________________________________________________________
@@ -1792,23 +1792,23 @@ Int_t TTable::Purge(Option_t *opt)
 }
 
 //______________________________________________________________________________
-void TTable::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TTable::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
 //   Save a primitive as a C++ statement(s) on output stream "out".
    UInt_t arrayLayout[10],arraySize[10];
    const unsigned char *pointer=0,*startRow=0;
    int i,rowCount;unsigned char ic;
 
-   out << "TDataSet *CreateTable() { " << endl;
+   out << "TDataSet *CreateTable() { " << std::endl;
 
    Int_t rowNumber =  GetNRows();
    TTableDescriptor *dscT = GetRowDescriptors();
 
 //                      Is anything Wrong??
    if (!rowNumber || !dscT ) {//
-      out << "// The output table was bad-defined!" << endl
-          << " fprintf(stderr, \"Bad table found. Please remove me\\n\");" << endl
-          << " return 0; } "    << endl;
+      out << "// The output table was bad-defined!" << std::endl
+          << " fprintf(stderr, \"Bad table found. Please remove me\\n\");" << std::endl
+          << " return 0; } "    << std::endl;
       return;
    }
 
@@ -1822,26 +1822,26 @@ void TTable::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 
    const char *className = IsA()->GetName();
 
-   out << "// -----------------------------------------------------------------" << endl;
+   out << "// -----------------------------------------------------------------" << std::endl;
    out << "// "   << Path()
        << " Allocated rows: "<< rowNumber
        <<"  Used rows: "<<      rowNumber
-       <<"  Row size: " << fSize << " bytes"                 << endl;
+       <<"  Row size: " << fSize << " bytes"                 << std::endl;
    out << "// "  << " Table: " << dscT->GetName()<<"[0]--> "
-       << dscT->GetName()<<"["<<rowNumber-1 <<"]"            << endl;
-   out << "// ====================================================================" << endl;
-   out << "// ------  Test whether this table share library was loaded ------"      << endl;
-   out << "  if (!TClass::GetClass(\"" << className << "\")) return 0;"    << endl;
-   out <<    dscT->GetName() << " " << rowId << ";" << endl
+       << dscT->GetName()<<"["<<rowNumber-1 <<"]"            << std::endl;
+   out << "// ====================================================================" << std::endl;
+   out << "// ------  Test whether this table share library was loaded ------"      << std::endl;
+   out << "  if (!TClass::GetClass(\"" << className << "\")) return 0;"    << std::endl;
+   out <<    dscT->GetName() << " " << rowId << ";" << std::endl
        <<  className << " *" << tableId << " = new "
        <<  className
-       << "(\""<<GetName()<<"\"," << GetNRows() << ");" << endl
-       << "//" <<endl ;
+       << "(\""<<GetName()<<"\"," << GetNRows() << ");" << std::endl
+       << "//" <<std::endl ;
 
 //              Row loop
    TDataSetIter nextComment(dscT->MakeCommentField(kFALSE));
    for (rowCount=0;rowCount<rowNumber; rowCount++,startRow += fSize, nextComment.Reset()) {     //row loop
-      out << "memset(" << "&" << rowId << ",0," << tableId << "->GetRowSize()" << ");" << endl ;
+      out << "memset(" << "&" << rowId << ",0," << tableId << "->GetRowSize()" << ");" << std::endl ;
 
 //              Member loop
    TTableDescriptor::iterator member  = dscT->begin();
@@ -1891,23 +1891,23 @@ void TTable::SavePrimitive(ostream &out, Option_t * /*= ""*/)
              || strchr("!#$%&()*+-,./:;<>=?@{}[]_|~",ic))) {//printable
                out << ic;
             } else {                                      //nonprintable
-               out << "\\x" << setw(2) << setfill('0') << hex << (unsigned)ic ;
-               out << setw(1) << setfill(' ') << dec;
+               out << "\\x" << std::setw(2) << std::setfill('0') << std::hex << (unsigned)ic ;
+               out << std::setw(1) << std::setfill(' ') << std::dec;
             }
          }
-         out << "\"," << dec << charLen << ");";
-         out << "// " << (const char*)memberTitle << endl;
+         out << "\"," << std::dec << charLen << ");";
+         out << "// " << (const char*)memberTitle << std::endl;
          continue;
       } //EndIf of char case
 
 //                      Normal member
       Int_t indexOffset;
       for (indexOffset=0; indexOffset < arrayLength ; indexOffset++) {//array loop
-         out << setw(3) << " " ;
+         out << std::setw(3) << " " ;
          out << " " << rowId << "." << (const char*)memberName;
 
          if (dim) {
-            for (i=0;i<dim;i++) {out << "["<<dec<<arrayLayout[i]<<"]";}
+            for (i=0;i<dim;i++) {out << "["<<std::dec<<arrayLayout[i]<<"]";}
             ArrayLayout(arrayLayout,arraySize,dim);}
 
 //                      Generate "="
@@ -1919,16 +1919,16 @@ void TTable::SavePrimitive(ostream &out, Option_t * /*= ""*/)
 
 //                      Encode data member title
             if (indexOffset==0)  out << "; // " << (const char*)memberTitle;
-            out << ";" << endl;
+            out << ";" << std::endl;
          }//end array loop
       }//end of member loop
 
-      out << tableId << "->AddAt(&" << rowId <<");" << endl;
+      out << tableId << "->AddAt(&" << rowId <<");" << std::endl;
 
    }//end of row loop
-   out << "// ----------------- end of code ---------------" << endl
-       << " return (TDataSet *)tableSet;" << endl
-       << "}"  << endl;
+   out << "// ----------------- end of code ---------------" << std::endl
+       << " return (TDataSet *)tableSet;" << std::endl
+       << "}"  << std::endl;
    return;
 }
 
@@ -1994,7 +1994,7 @@ Char_t *TTable::MakeExpression(const Char_t *expressions[],Int_t nExpressions)
       return 0;
    }
 
-   ofstream str;
+   std::ofstream str;
    str.open(fileName);
    if (str.bad() ) {
       Error("MakeExpression","Can not open the temporary file <%s>",fileName);
@@ -2005,8 +2005,8 @@ Char_t *TTable::MakeExpression(const Char_t *expressions[],Int_t nExpressions)
    TTableDescriptor *dsc = GetRowDescriptors();
    const tableDescriptor_st *descTable  = dsc->GetTable();
    // Create function
-   str << "void SelectionQWERTY(float *"<<resID<<", float **"<<addressID<< ", int& i$, int& n$ )"   << endl;
-   str << "{"                                                        << endl;
+   str << "void SelectionQWERTY(float *"<<resID<<", float **"<<addressID<< ", int& i$, int& n$ )"   << std::endl;
+   str << "{"                                                        << std::endl;
    int i = 0;
    for (i=0; i < dsc->GetNRows(); i++,descTable++ ) {
       // Take the column name
@@ -2029,16 +2029,16 @@ LETSTRY:
       if (!isFloat)   str << "(" << type << "*)";
       str << addressID << "[" << i << "]";
       if (isScalar)   str << ")" ;
-      str << ";" << endl;
+      str << ";" << std::endl;
    }
    // Create expressions
    for (i=0; i < nExpressions; i++ ) {
       if (expressions[i] && expressions[i][0])
-         str << " "<<resID<<"["<<i<<"]=(float)(" << expressions[i] << ");"  << endl;
+         str << " "<<resID<<"["<<i<<"]=(float)(" << expressions[i] << ");"  << std::endl;
 //      if (i == nExpressions-1 && i !=0 )
-//          str  << "  if ("<<resID<<"["<<i<<"] == 0){ return; }" << endl;
+//          str  << "  if ("<<resID<<"["<<i<<"] == 0){ return; }" << std::endl;
    };
-   str << "}" << endl;
+   str << "}" << std::endl;
    str.close();
    // Create byte code and check syntax
    if (str.good()) return fileName;
diff --git a/misc/table/src/TVolume.cxx b/misc/table/src/TVolume.cxx
index e9e1c1b529a..fdc216fa566 100644
--- a/misc/table/src/TVolume.cxx
+++ b/misc/table/src/TVolume.cxx
@@ -99,7 +99,7 @@ TVolume::TVolume(const char *name, const char *title, const char *shapename, Opt
    static Int_t counter = 0;
    counter++;
    SetTitle(title);
-   if(!(counter%1000))cout<<"TVolume count="<<counter<<" name="<<name<<endl;
+   if(!(counter%1000))std::cout<<"TVolume count="<<counter<<" name="<<name<<std::endl;
    if (!gGeometry) new TGeometry;
    Add(gGeometry->GetShape(shapename),kTRUE);
 //   fParent = gGeometry->GetCurrenTVolume();
diff --git a/misc/table/src/TVolumePosition.cxx b/misc/table/src/TVolumePosition.cxx
index b1a7fe96726..6d4963b3b07 100644
--- a/misc/table/src/TVolumePosition.cxx
+++ b/misc/table/src/TVolumePosition.cxx
@@ -67,7 +67,7 @@ TVolumePosition::TVolumePosition(TVolume *node,Double_t x, Double_t y, Double_t
    if (!node) return;
    static Int_t counter = 0;
    counter++;
-   if(!(counter%1000))cout<<"TVolumePosition count="<<counter<<" name="<<node->GetName()<<endl;
+   if(!(counter%1000))std::cout<<"TVolumePosition count="<<counter<<" name="<<node->GetName()<<std::endl;
 
    if (!gGeometry) new TGeometry;
    if (matrixname && strlen(matrixname)) fMatrix = gGeometry->GetRotMatrix(matrixname);
@@ -456,7 +456,7 @@ void TVolumePosition::Paint(Option_t *)
 void TVolumePosition::Print(Option_t *) const
 {
    //to be documented
-   cout << *this << endl;
+   std::cout << *this << std::endl;
 }
 
 //______________________________________________________________________________
@@ -480,12 +480,12 @@ TVolumePosition *TVolumePosition::Reset(TVolume *node,Double_t x, Double_t y, Do
 }
 
 //_______________________________________________________________________
-void TVolumePosition::SavePrimitive(ostream &, Option_t * /*= ""*/)
+void TVolumePosition::SavePrimitive(std::ostream &, Option_t * /*= ""*/)
 {
    //to be documented
 #if 0
-   out << "TVolumePosition *CreatePosition() { " << endl;
-   out << "  TVolumePosition *myPosition = 0;    " << endl;
+   out << "TVolumePosition *CreatePosition() { " << std::endl;
+   out << "  TVolumePosition *myPosition = 0;    " << std::endl;
    Double_t x = GetX();
    Double_t y = GetY();
    Double_t z = GetZ();
@@ -494,8 +494,8 @@ void TVolumePosition::SavePrimitive(ostream &, Option_t * /*= ""*/)
    : fNode(node),fX(x),fY(y),fZ(z),fMatrix(0)
 {
 /
-   out << "  return myPosition; "                << endl;
-   out << "} "                                   << endl;
+   out << "  return myPosition; "                << std::endl;
+   out << "} "                                   << std::endl;
 #endif
 
 }
@@ -610,21 +610,21 @@ void TVolumePosition::Streamer(TBuffer &R__b)
    }
 }
 //______________________________________________________________________________
-ostream& operator<<(ostream& s,const TVolumePosition &target)
+std::ostream& operator<<(std::ostream& s,const TVolumePosition &target)
 {
    //to be documented
    s << " Node: ";
-   if (target.GetNode()) s <<  target.GetNode()->GetName() << endl;
-   else                  s << "NILL" << endl;
+   if (target.GetNode()) s <<  target.GetNode()->GetName() << std::endl;
+   else                  s << "NILL" << std::endl;
    s << Form(" Position: x=%10.5f : y=%10.5f : z=%10.5f\n", target.GetX(), target.GetY(), target.GetZ());
    TRotMatrix *rot = (TRotMatrix *) target.GetMatrix();
    if (rot){
-      s << rot->IsA()->GetName() << "\t" << rot->GetName() << "\t" << rot->GetTitle() << endl;
+      s << rot->IsA()->GetName() << "\t" << rot->GetName() << "\t" << rot->GetTitle() << std::endl;
       Double_t *matrix = rot->GetMatrix();
       Int_t i = 0;
       for (i=0;i<3;i++) {
          for (Int_t j=0;j<3;j++) s << Form("%10.5f:", *matrix++);
-         s << endl;
+         s << std::endl;
       }
    }
    return s;
diff --git a/misc/table/src/TVolumeView.cxx b/misc/table/src/TVolumeView.cxx
index 4bb0e7789ee..944cd173b43 100644
--- a/misc/table/src/TVolumeView.cxx
+++ b/misc/table/src/TVolumeView.cxx
@@ -230,7 +230,7 @@ TVolumeView::TVolumeView(TVolume &pattern,Int_t maxDepLevel,
   //
   //   All new-created sets become the structural ones anyway.
   //
-  //  cout << "ctor for " << GetName() << " - " << GetTitle() << endl;
+  //  std::cout << "ctor for " << GetName() << " - " << GetTitle() << std::endl;
    if (!gGeometry) new TGeometry;
    if (!nodePosition) {
       // Create the trivial position if any
@@ -859,7 +859,7 @@ TString TVolumeView::PathP() const
 }
 
 //_______________________________________________________________________
-void TVolumeView::SavePrimitive(ostream &out, Option_t * /*= ""*/)
+void TVolumeView::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
 {
    //to be documented
    const Char_t *sceleton[] = {
@@ -900,17 +900,17 @@ void TVolumeView::SavePrimitive(ostream &out, Option_t * /*= ""*/)
    }
    Int_t im = 0;
    for (Int_t lineNumber =0; lineNumber < sceletonSize; lineNumber++) {
-      out << sceleton[lineNumber];                             // cout << lineNumber << ". " << sceleton[lineNumber];
+      out << sceleton[lineNumber];                             // std::cout << lineNumber << ". " << sceleton[lineNumber];
       switch (lineNumber) {
-         case  1:  out  << "\"" << thisNodePath.Data() << "\";" ; // cout  << "\"" << thisNodePath.Data() << "\";" ;
+         case  1:  out  << "\"" << thisNodePath.Data() << "\";" ; // std::cout  << "\"" << thisNodePath.Data() << "\";" ;
             break;
-         case  2:  out   << thisPositionId << ";" ; // cout  << "\"" << thisNodePath.Data() << "\";" ;
+         case  2:  out   << thisPositionId << ";" ; // std::cout  << "\"" << thisNodePath.Data() << "\";" ;
             break;
-         case  3:  out << "{" << thisX << ", " << thisY << ", "<< thisZ << "};";  // cout << thisX << ";" ;
+         case  3:  out << "{" << thisX << ", " << thisY << ", "<< thisZ << "};";  // std::cout << thisX << ";" ;
             break;
-         case  5:  out << "\"" << matrixName << "\";" ;           // cout << "\"" << matrixName << "\";" ;
+         case  5:  out << "\"" << matrixName << "\";" ;           // std::cout << "\"" << matrixName << "\";" ;
             break;
-         case  6:  out <<  matrixType << ";" ;                    // cout <<  matrixType << ";" ;
+         case  6:  out <<  matrixType << ";" ;                    // std::cout <<  matrixType << ";" ;
             break;
          case  7:  out << thisMatrix[im++] << ", "; out << thisMatrix[im++] << ", "; out << thisMatrix[im++] << ", ";
             break;
@@ -921,8 +921,8 @@ void TVolumeView::SavePrimitive(ostream &out, Option_t * /*= ""*/)
          default:
             break;
       };
-//   cout << " " << endl;
-      out << " " << endl;
+//   std::cout << " " << std::endl;
+      out << " " << std::endl;
    }
 }
 
diff --git a/montecarlo/vmc/src/TMCVerbose.cxx b/montecarlo/vmc/src/TMCVerbose.cxx
index 5b634eaaf7d..42b30aa6f76 100644
--- a/montecarlo/vmc/src/TMCVerbose.cxx
+++ b/montecarlo/vmc/src/TMCVerbose.cxx
@@ -70,9 +70,9 @@ void TMCVerbose::PrintBanner() const
 // Prints banner for track information
 // ---
 
-   cout << endl;
-   for (Int_t i=0; i<10; i++) cout << "**********";
-   cout << endl;
+   std::cout << std::endl;
+   for (Int_t i=0; i<10; i++) std::cout << "**********";
+   std::cout << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -83,20 +83,20 @@ void TMCVerbose::PrintTrackInfo() const
 
    // Particle
    //
-   cout << "  Particle = ";
+   std::cout << "  Particle = ";
    TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(gMC->TrackPid());
    if (particle)
-      cout << particle->GetName() << "  ";
+      std::cout << particle->GetName() << "  ";
    else
-      cout << "unknown" << "  ";
+      std::cout << "unknown" << "  ";
 
    // Track ID
    //
-   cout << "   Track ID = " << gMC->GetStack()->GetCurrentTrackNumber() << "  ";
+   std::cout << "   Track ID = " << gMC->GetStack()->GetCurrentTrackNumber() << "  ";
 
    // Parent ID
    //
-   cout << "   Parent ID = " << gMC->GetStack()->GetCurrentParentTrackNumber();
+   std::cout << "   Parent ID = " << gMC->GetStack()->GetCurrentParentTrackNumber();
 }
 
 //_____________________________________________________________________________
@@ -105,7 +105,7 @@ void TMCVerbose::PrintStepHeader() const
 // Prints the header for stepping information
 // ---
 
-   cout << "Step#     "
+   std::cout << "Step#     "
         << "X(cm)    "
         << "Y(cm)    "
         << "Z(cm)  "
@@ -115,7 +115,7 @@ void TMCVerbose::PrintStepHeader() const
         << "TrackL(cm) "
         << "Volume  "
         << "Process "
-        << endl;
+        << std::endl;
 }
 
 //
@@ -129,7 +129,7 @@ void TMCVerbose::InitMC()
 // ---
 
    if (fLevel>0)
-      cout << "--- Init MC " << endl;
+      std::cout << "--- Init MC " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -139,7 +139,7 @@ void TMCVerbose::RunMC(Int_t nofEvents)
 // ---
 
    if (fLevel>0)
-      cout << "--- Run MC for " << nofEvents << " events" << endl;
+      std::cout << "--- Run MC for " << nofEvents << " events" << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -149,7 +149,7 @@ void TMCVerbose::FinishRun()
 // ---
 
    if (fLevel>0)
-      cout << "--- Finish Run MC " << endl;
+      std::cout << "--- Finish Run MC " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -159,7 +159,7 @@ void TMCVerbose::ConstructGeometry()
 // ---
 
    if (fLevel>0)
-      cout << "--- Construct geometry " << endl;
+      std::cout << "--- Construct geometry " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -169,7 +169,7 @@ void TMCVerbose::ConstructOpGeometry()
 // ---
 
    if (fLevel>0)
-      cout << "--- Construct geometry for optical processes" << endl;
+      std::cout << "--- Construct geometry for optical processes" << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -179,7 +179,7 @@ void TMCVerbose::InitGeometry()
 // ---
 
    if (fLevel>0)
-      cout << "--- Init geometry " << endl;
+      std::cout << "--- Init geometry " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -189,7 +189,7 @@ void TMCVerbose::AddParticles()
 // ---
 
    if (fLevel>0)
-      cout << "--- Add particles " << endl;
+      std::cout << "--- Add particles " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -199,7 +199,7 @@ void TMCVerbose::AddIons()
 // ---
 
    if (fLevel>0)
-      cout << "--- Add ions " << endl;
+      std::cout << "--- Add ions " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -209,7 +209,7 @@ void TMCVerbose::GeneratePrimaries()
 // ---
 
    if (fLevel>0)
-      cout << "--- Generate primaries " << endl;
+      std::cout << "--- Generate primaries " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -219,7 +219,7 @@ void TMCVerbose::BeginEvent()
 // ---
 
    if (fLevel>0)
-      cout << "--- Begin event " << endl;
+      std::cout << "--- Begin event " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -229,7 +229,7 @@ void TMCVerbose::BeginPrimary()
 // ---
 
    if (fLevel>1)
-      cout << "--- Begin primary " << endl;
+      std::cout << "--- Begin primary " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -250,7 +250,7 @@ void TMCVerbose::PreTrack()
    }
 
    if (fLevel>1)
-      cout << "--- Pre track " << endl;
+      std::cout << "--- Pre track " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -262,55 +262,55 @@ void TMCVerbose::Stepping()
    if (fLevel>2) {
 
 #if __GNUC__ >= 3
-      cout << std::fixed;
+      std::cout << std::fixed;
 #endif
 
       // Step number
       //
-      cout << "#" << setw(4) << fStepNumber++ << "  ";
+      std::cout << "#" << std::setw(4) << fStepNumber++ << "  ";
 
       // Position
       //
       Double_t x, y, z;
       gMC->TrackPosition(x, y, z);
-      cout << setw(8) << setprecision(3) << x << " "
-           << setw(8) << setprecision(3) << y << " "
-           << setw(8) << setprecision(3) << z << "  ";
+      std::cout << std::setw(8) << std::setprecision(3) << x << " "
+           << std::setw(8) << std::setprecision(3) << y << " "
+           << std::setw(8) << std::setprecision(3) << z << "  ";
 
       // Kinetic energy
       //
       Double_t px, py, pz, etot;
       gMC->TrackMomentum(px, py, pz, etot);
       Double_t ekin = etot - gMC->TrackMass();
-      cout << setw(9) << setprecision(4) << ekin*1e03 << " ";
+      std::cout << std::setw(9) << std::setprecision(4) << ekin*1e03 << " ";
 
       // Energy deposit
       //
-      cout << setw(9) << setprecision(4) << gMC->Edep()*1e03 << " ";
+      std::cout << std::setw(9) << std::setprecision(4) << gMC->Edep()*1e03 << " ";
 
       // Step length
       //
-      cout << setw(8) << setprecision(3) << gMC->TrackStep() << " ";
+      std::cout << std::setw(8) << std::setprecision(3) << gMC->TrackStep() << " ";
 
       // Track length
       //
-      cout << setw(8) << setprecision(3) << gMC->TrackLength() << "     ";
+      std::cout << std::setw(8) << std::setprecision(3) << gMC->TrackLength() << "     ";
 
       // Volume
       //
       if (gMC->CurrentVolName() != 0)
-         cout << setw(4) << gMC->CurrentVolName() << "  ";
+         std::cout << std::setw(4) << gMC->CurrentVolName() << "  ";
       else
-         cout << setw(4) << "None"  << "  ";
+         std::cout << std::setw(4) << "None"  << "  ";
 
       // Process
       //
       TArrayI processes;
       Int_t nofProcesses = gMC->StepProcesses(processes);
       if (nofProcesses > 0)
-         cout << TMCProcessName[processes[nofProcesses-1]];
+         std::cout << TMCProcessName[processes[nofProcesses-1]];
 
-      cout << endl;
+      std::cout << std::endl;
    }
 }
 
@@ -321,7 +321,7 @@ void TMCVerbose::PostTrack()
 // ---
 
    if (fLevel==2)
-      cout << "--- Post track " << endl;
+      std::cout << "--- Post track " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -331,7 +331,7 @@ void TMCVerbose::FinishPrimary()
 // ---
 
    if (fLevel==2)
-      cout << "--- Finish primary " << endl;
+      std::cout << "--- Finish primary " << std::endl;
 }
 
 //_____________________________________________________________________________
@@ -341,6 +341,6 @@ void TMCVerbose::FinishEvent()
 // ---
 
    if (fLevel>0)
-      cout << "--- Finish event " << endl;
+      std::cout << "--- Finish event " << std::endl;
 }
 
diff --git a/net/alien/src/TAlienJDL.cxx b/net/alien/src/TAlienJDL.cxx
index fce0c996b26..443f8e13bb8 100644
--- a/net/alien/src/TAlienJDL.cxx
+++ b/net/alien/src/TAlienJDL.cxx
@@ -441,7 +441,7 @@ void TAlienJDL::Parse(const char *filename)
 {
    // fills the TAlienJDL from inputfile (should be AliEn JDL file)
 
-   ifstream file;
+   std::ifstream file;
    file.open ( filename );
    if ( !file.is_open() )  {
       Error("Parse", "error opening file %s", filename);
diff --git a/net/alien/src/TAlienResult.cxx b/net/alien/src/TAlienResult.cxx
index 4f39a036071..11fde82f21e 100644
--- a/net/alien/src/TAlienResult.cxx
+++ b/net/alien/src/TAlienResult.cxx
@@ -49,7 +49,7 @@ void TAlienResult::DumpResult()
 {
    // Dump result set.
 
-   cout << "BEGIN DUMP" << endl;
+   std::cout << "BEGIN DUMP" << std::endl;
    TIter next(this);
    TMap *map;
    while ((map = (TMap *) next())) {
@@ -61,16 +61,16 @@ void TAlienResult::DumpResult()
              dynamic_cast < TObjString * >(pair->Value());
 
          if (keyStr) {
-            cout << "Key: " << keyStr->GetString() << "   ";
+            std::cout << "Key: " << keyStr->GetString() << "   ";
          }
          if (valueStr) {
-            cout << "Value: " << valueStr->GetString();
+            std::cout << "Value: " << valueStr->GetString();
          }
-         cout << endl;
+         std::cout << std::endl;
       }
    }
 
-   cout << "END DUMP" << endl;
+   std::cout << "END DUMP" << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/net/auth/src/TAuthenticate.cxx b/net/auth/src/TAuthenticate.cxx
index 4b9913adfd0..0354ec190b7 100644
--- a/net/auth/src/TAuthenticate.cxx
+++ b/net/auth/src/TAuthenticate.cxx
@@ -4037,9 +4037,9 @@ Int_t TAuthenticate::SendRSAPublicKey(TSocket *socket, Int_t key)
                                         (unsigned char *)&fgRSAPubExport[key].keys[kk],
                                         (unsigned char *)&buftmp[ke],
                                         RSASSLServer,RSA_PKCS1_PADDING)) < 0) {
-            char cerr[120];
-            ERR_error_string(ERR_get_error(), cerr);
-            ::Info("TAuthenticate::SendRSAPublicKey","SSL: error: '%s' ",cerr);
+            char errstr[120];
+            ERR_error_string(ERR_get_error(), errstr);
+            ::Info("TAuthenticate::SendRSAPublicKey","SSL: error: '%s' ",errstr);
          }
          kk += lc;
          ke += ttmp;
diff --git a/net/bonjour/src/TBonjourRecord.cxx b/net/bonjour/src/TBonjourRecord.cxx
index e977000231b..0611345c86f 100644
--- a/net/bonjour/src/TBonjourRecord.cxx
+++ b/net/bonjour/src/TBonjourRecord.cxx
@@ -45,11 +45,11 @@ void TBonjourRecord::Print(Option_t *) const
 {
    // Print TBonjourRecord.
 
-   cout << "TBonjourRecord:"
+   std::cout << "TBonjourRecord:"
         << "\n\tService name: #" << GetServiceName() << "#"
         << "\n\tRegistered type: #" << GetRegisteredType() << "#"
         << "\n\tDomain: #" << GetReplyDomain() << "#"
         << "\n\tTXT Records (length): #" << GetTXTRecords()
                                   << "# (" << GetTXTRecordsLength() << ")"
-        << endl;
+        << std::endl;
 }
diff --git a/net/glite/src/TGLiteResult.cxx b/net/glite/src/TGLiteResult.cxx
index 88d78223da3..341cb3fb00a 100644
--- a/net/glite/src/TGLiteResult.cxx
+++ b/net/glite/src/TGLiteResult.cxx
@@ -49,8 +49,8 @@ void TGLiteResult::DumpResult()
 {
    // Dump result set.
 
-   cout << "BEGIN DUMP" << endl;
-   cout << "END DUMP" << endl;
+   std::cout << "BEGIN DUMP" << std::endl;
+   std::cout << "END DUMP" << std::endl;
 }
 
 //______________________________________________________________________________
@@ -201,18 +201,18 @@ void TGLiteResult::Print(Option_t * /*wildcard*/, Option_t *option) const
       for (Int_t count = 0; (map = dynamic_cast<TMap*>(next())); ++count) {
          TIter next2(map->GetTable());
          TPair *pair;
-         cout << "# " << setiosflags(ios::left) << setw(6) << count << " ------------------------------------------------------------" << endl;
+         std::cout << "# " << setiosflags(std::ios::left) << std::setw(6) << count << " ------------------------------------------------------------" << std::endl;
          while ((pair = dynamic_cast< TPair*>(next2()))) {
             TObjString * keyStr = dynamic_cast<TObjString*>(pair->Key());
             TObjString* valueStr = dynamic_cast<TObjString*>(pair->Value());
             if (keyStr && valueStr) {
-               cout
-               << setw(16) << keyStr->GetName()
+               std::cout
+               << std::setw(16) << keyStr->GetName()
                << valueStr->GetName()
-               << endl;
+               << std::endl;
             }
          }
-         cout << endl;
+         std::cout << std::endl;
       }
    }
 }
diff --git a/net/ldap/src/TLDAPAttribute.cxx b/net/ldap/src/TLDAPAttribute.cxx
index e61cfd2f780..e81554abb44 100644
--- a/net/ldap/src/TLDAPAttribute.cxx
+++ b/net/ldap/src/TLDAPAttribute.cxx
@@ -113,10 +113,10 @@ void TLDAPAttribute::Print(Option_t *) const
 
    Int_t counter = GetCount();
    if (counter == 0) {
-      cout << GetName() << ": " << endl;
+      std::cout << GetName() << ": " << std::endl;
    } else if (counter != 0) {
       for (Int_t i = 0; i < counter; i++) {
-         cout << GetName() << ": " << GetValue() << endl;
+         std::cout << GetName() << ": " << GetValue() << std::endl;
       }
    }
 }
diff --git a/net/ldap/src/TLDAPEntry.cxx b/net/ldap/src/TLDAPEntry.cxx
index f6f02c6e3e2..486e80d0af5 100644
--- a/net/ldap/src/TLDAPEntry.cxx
+++ b/net/ldap/src/TLDAPEntry.cxx
@@ -75,7 +75,7 @@ void TLDAPEntry::Print(Option_t *) const
 {
    // Print entry in LDIF format.
 
-   cout << "dn: "<< fDn << endl;
+   std::cout << "dn: "<< fDn << std::endl;
    TLDAPAttribute *attr = GetAttribute("objectClass");
    if (attr != 0)
       attr->Print();
@@ -85,7 +85,7 @@ void TLDAPEntry::Print(Option_t *) const
       if (TString(attr->GetName()).CompareTo("objectClass", TString::kIgnoreCase) != 0)
          attr->Print();
    }
-   cout << endl;
+   std::cout << std::endl;
 }
 
 //______________________________________________________________________________
diff --git a/net/monalisa/src/TMonaLisaWriter.cxx b/net/monalisa/src/TMonaLisaWriter.cxx
index 944a0056c5d..2aaa14de15c 100644
--- a/net/monalisa/src/TMonaLisaWriter.cxx
+++ b/net/monalisa/src/TMonaLisaWriter.cxx
@@ -1156,12 +1156,12 @@ void TMonaLisaWriter::Print(Option_t *) const
 {
    // Print info about MonaLisa object.
 
-   cout << "Site     (Farm) : " << fName << endl;
-   cout << "JobId    (Node) : " << fJobId << endl;
-   cout << "SubJobId (Node) : " << fSubJobId << endl;
-   cout << "HostName        : " << fHostname << endl;
-   cout << "Pid             : " << fPid << endl;
-   cout << "Inititialized   : " << fInitialized << endl;
-   cout << "Verbose         : " << fVerbose << endl;
+   std::cout << "Site     (Farm) : " << fName << std::endl;
+   std::cout << "JobId    (Node) : " << fJobId << std::endl;
+   std::cout << "SubJobId (Node) : " << fSubJobId << std::endl;
+   std::cout << "HostName        : " << fHostname << std::endl;
+   std::cout << "Pid             : " << fPid << std::endl;
+   std::cout << "Inititialized   : " << fInitialized << std::endl;
+   std::cout << "Verbose         : " << fVerbose << std::endl;
 
 }
diff --git a/net/net/src/TApplicationServer.cxx b/net/net/src/TApplicationServer.cxx
index 1565ec57799..647709cfce0 100644
--- a/net/net/src/TApplicationServer.cxx
+++ b/net/net/src/TApplicationServer.cxx
@@ -320,9 +320,9 @@ TApplicationServer::TApplicationServer(Int_t *argc, char **argv,
       Terminate(0);
    }
 
-   // Everybody expects iostream to be available, so load it...
+   // Everybody expects std::iostream to be available, so load it...
    ProcessLine("#include <iostream>", kTRUE);
-   ProcessLine("#include <string>",kTRUE); // for std::string iostream.
+   ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
 
    // Load user functions
    const char *logon;
diff --git a/net/net/src/TSQLColumnInfo.cxx b/net/net/src/TSQLColumnInfo.cxx
index 4a37c9d6308..c7ab8fb8f54 100644
--- a/net/net/src/TSQLColumnInfo.cxx
+++ b/net/net/src/TSQLColumnInfo.cxx
@@ -85,31 +85,31 @@ void TSQLColumnInfo::Print(Option_t*) const
    // Prints column information to standard output
    
    TROOT::IndentLevel();
-   cout << "Column: " << GetName() 
+   std::cout << "Column: " << GetName() 
         << " type:'" << fTypeName << "'"; 
    if (fSQLType>=0) {
-      cout << " typeid:";
+      std::cout << " typeid:";
       switch (fSQLType) {
-         case TSQLServer::kSQL_CHAR : cout << "kSQL_CHAR"; break;
-         case TSQLServer::kSQL_VARCHAR : cout << "kSQL_VARCHAR"; break;
-         case TSQLServer::kSQL_INTEGER : cout << "kSQL_INTEGER"; break;
-         case TSQLServer::kSQL_FLOAT : cout << "kSQL_FLOAT"; break;
-         case TSQLServer::kSQL_DOUBLE : cout << "kSQL_DOUBLE"; break;
-         case TSQLServer::kSQL_NUMERIC : cout << "kSQL_NUMERIC"; break;
-         case TSQLServer::kSQL_BINARY : cout << "kSQL_BINARY"; break;
-         case TSQLServer::kSQL_TIMESTAMP : cout << "kSQL_TIMESTAMP"; break;
-         default: cout << fSQLType;
+         case TSQLServer::kSQL_CHAR : std::cout << "kSQL_CHAR"; break;
+         case TSQLServer::kSQL_VARCHAR : std::cout << "kSQL_VARCHAR"; break;
+         case TSQLServer::kSQL_INTEGER : std::cout << "kSQL_INTEGER"; break;
+         case TSQLServer::kSQL_FLOAT : std::cout << "kSQL_FLOAT"; break;
+         case TSQLServer::kSQL_DOUBLE : std::cout << "kSQL_DOUBLE"; break;
+         case TSQLServer::kSQL_NUMERIC : std::cout << "kSQL_NUMERIC"; break;
+         case TSQLServer::kSQL_BINARY : std::cout << "kSQL_BINARY"; break;
+         case TSQLServer::kSQL_TIMESTAMP : std::cout << "kSQL_TIMESTAMP"; break;
+         default: std::cout << fSQLType;
       }
    }
-   cout << " nullable:" << (fNullable ? "yes" : "no");
-   if (fSize>=0) cout << " size:" << fSize;
-   if (fLength>=0) cout << " len:" << fLength;
-   if (fScale>=0) cout << " scale:" << fScale;
+   std::cout << " nullable:" << (fNullable ? "yes" : "no");
+   if (fSize>=0) std::cout << " size:" << fSize;
+   if (fLength>=0) std::cout << " len:" << fLength;
+   if (fScale>=0) std::cout << " scale:" << fScale;
    if (fSigned>=0) { 
       if (fSigned==0)
-         cout << " unsigned";
+         std::cout << " unsigned";
       else
-         cout << " signed";
+         std::cout << " signed";
    }
-   cout << endl;
+   std::cout << std::endl;
 }
diff --git a/net/net/src/TSQLServer.cxx b/net/net/src/TSQLServer.cxx
index 60905b1ed89..753b57a4cb6 100644
--- a/net/net/src/TSQLServer.cxx
+++ b/net/net/src/TSQLServer.cxx
@@ -172,7 +172,7 @@ TList* TSQLServer::GetTablesList(const char* wild)
    // TIter next(lst);
    // TObject* obj;
    // while (obj = next()) 
-   //   cout << "Table: " << obj->GetName() << endl; 
+   //   std::cout << "Table: " << obj->GetName() << std::endl; 
    // delete lst;
    
    TSQLResult* res = GetTables(fDB.Data(), wild);
diff --git a/net/net/src/TSQLStatement.cxx b/net/net/src/TSQLStatement.cxx
index 4d15f476d7c..ed810462dde 100644
--- a/net/net/src/TSQLStatement.cxx
+++ b/net/net/src/TSQLStatement.cxx
@@ -148,9 +148,9 @@
 //       stmt->StoreResult();
 //         
 //       // display info about selected field 
-//       cout << "NumFields = " << stmt->GetNumFields() << endl;
+//       std::cout << "NumFields = " << stmt->GetNumFields() << std::endl;
 //       for (int n=0;n<stmt->GetNumFields();n++) 
-//          cout << "Field " << n << "  = " << stmt->GetFieldName(n) << endl;
+//          std::cout << "Field " << n << "  = " << stmt->GetFieldName(n) << std::endl;
 //
 //       // extract rows one after another
 //       while (stmt->NextResultRow()) {
@@ -158,7 +158,7 @@
 //          UInt_t id2 = stmt->GetUInt(1);
 //          const char* name1 = stmt->GetString(2);
 //          const char* name2 = stmt->GetString(3);
-//          cout << id1 << " - " << id2 << "  " << name1 << "  " << name2 << endl;
+//          std::cout << id1 << " - " << id2 << "  " << name1 << "  " << name2 << std::endl;
 //       }
 //    }    
 //
diff --git a/net/net/src/TSQLTableInfo.cxx b/net/net/src/TSQLTableInfo.cxx
index 0585fdbaa32..da7f3a4deb6 100644
--- a/net/net/src/TSQLTableInfo.cxx
+++ b/net/net/src/TSQLTableInfo.cxx
@@ -76,21 +76,21 @@ void TSQLTableInfo::Print(Option_t*) const
    // Prints table and table columns info
    
    TROOT::IndentLevel();
-   cout << "Table:" << GetName();
+   std::cout << "Table:" << GetName();
    
    if ((GetTitle()!=0) && (strlen(GetTitle())!=0))
-      cout << " comm:'" << GetTitle() << "'";
+      std::cout << " comm:'" << GetTitle() << "'";
    
    if (fEngine.Length()>0)
-      cout << " engine:" << fEngine;
+      std::cout << " engine:" << fEngine;
 
    if (fCreateTime.Length()>0)
-      cout << " create:" << fCreateTime;
+      std::cout << " create:" << fCreateTime;
 
    if (fUpdateTime.Length()>0)
-      cout << " update:" << fUpdateTime;
+      std::cout << " update:" << fUpdateTime;
    
-   cout << endl;
+   std::cout << std::endl;
     
    TROOT::IncreaseDirLevel();
    if (fColumns!=0)
diff --git a/net/rpdutils/src/rpdutils.cxx b/net/rpdutils/src/rpdutils.cxx
index b22008c5446..222172dadc1 100644
--- a/net/rpdutils/src/rpdutils.cxx
+++ b/net/rpdutils/src/rpdutils.cxx
@@ -5603,9 +5603,9 @@ int RpdRecvClientRSAKey()
                                     (unsigned char *)&gPubKey[kd],
                                     gRSASSLKey,
                                     RSA_PKCS1_PADDING)) < 0) {
-            char cerr[120];
-            ERR_error_string(ERR_get_error(), cerr);
-            ErrorInfo("RpdRecvClientRSAKey: SSL: error: '%s' ",cerr);
+            char errstr[120];
+            ERR_error_string(ERR_get_error(), errstr);
+            ErrorInfo("RpdRecvClientRSAKey: SSL: error: '%s' ",errstr);
          }
          nr -= lcmax;
          kd += ndec;
diff --git a/proof/clarens/src/TClProxy.cxx b/proof/clarens/src/TClProxy.cxx
index 995e883509e..08312e2c08e 100644
--- a/proof/clarens/src/TClProxy.cxx
+++ b/proof/clarens/src/TClProxy.cxx
@@ -41,9 +41,9 @@ TClProxy::TClProxy(const Char_t *service, TXmlRpc *rpc)
 //______________________________________________________________________________
 void TClProxy::Print(Option_t *) const
 {
-   cout << IsA()->GetName()
+   std::cout << IsA()->GetName()
       << ": service " << fRpc->GetService() << " @ "
-      << fRpc->GetServer() << endl;
+      << fRpc->GetServer() << std::endl;
 }
 
 
diff --git a/proof/clarens/src/TClSession.cxx b/proof/clarens/src/TClSession.cxx
index fc59c1771f9..04d728a50ae 100644
--- a/proof/clarens/src/TClSession.cxx
+++ b/proof/clarens/src/TClSession.cxx
@@ -56,7 +56,7 @@ unsigned char *B64Encode(xmlrpc_env *env,unsigned char *instring,int len)
     xmlrpc_mem_block *mem;
     mem=xmlrpc_base64_encode (env,instring,len);
     if (env->fault_occurred) {
-       cerr<<"XML-RPC Fault: "<<env->fault_string<<"("<< env->fault_code<<")"<<endl;
+       std::cerr<<"XML-RPC Fault: "<<env->fault_string<<"("<< env->fault_code<<")"<<std::endl;
        if (mem) xmlrpc_mem_block_free (mem);
        return 0;
     }
@@ -82,7 +82,7 @@ unsigned char *B64Decode(xmlrpc_env *env, unsigned char *instring,int *len)
     xmlrpc_mem_block *mem;
     mem=xmlrpc_base64_decode (env,(char *)instring,strlen((const char *)instring));
     if (env->fault_occurred) {
-       cerr<<"XML-RPC Fault: "<<env->fault_string<<"("<< env->fault_code<<")"<<endl;
+       std::cerr<<"XML-RPC Fault: "<<env->fault_string<<"("<< env->fault_code<<")"<<std::endl;
        if (mem) xmlrpc_mem_block_free (mem);
        return 0;
     }
@@ -273,7 +273,7 @@ Bool_t TClSession::InitAuthentication()
    TString line;
    Bool_t incert=kFALSE;
    fgUserCert = "";
-   ifstream fin(certFile);
+   std::ifstream fin(certFile);
    while (!fin.eof()) {
       line.ReadToDelim(fin,'\n');
 
diff --git a/proof/clarens/src/TEcho.cxx b/proof/clarens/src/TEcho.cxx
index 647aa9bc81f..5205dfa23bc 100644
--- a/proof/clarens/src/TEcho.cxx
+++ b/proof/clarens/src/TEcho.cxx
@@ -100,9 +100,9 @@ void TEcho::Benchmark(Int_t iterations)
 
    timer.Stop();
 
-   cout <<
+   std::cout <<
       "Elapsed time is " << timer.RealTime() << " s, " <<
       iterations / timer.RealTime() << " calls/s for " <<
-      iterations << " calls" << endl;
+      iterations << " calls" << std::endl;
 }
 
diff --git a/proof/clarens/src/TGM.cxx b/proof/clarens/src/TGM.cxx
index e5ca1f8d14b..3d0b8ba3bd1 100644
--- a/proof/clarens/src/TGM.cxx
+++ b/proof/clarens/src/TGM.cxx
@@ -181,12 +181,12 @@ TGM::TFileParams::TFileParams(const Char_t *file, const Char_t *cl, const Char_t
 //______________________________________________________________________________
 void TGM::TFileParams::Print(Option_t *) const
 {
-   cout << IsA()->GetName()
+   std::cout << IsA()->GetName()
       << ":  '" << fFileName << "'"
       << "  " << fObjClass
       << " " << fObjName
       << " (" << fDir
       << ") [" << fFirst << ", " << fNum << "]"
-      << endl;
+      << std::endl;
 }
 
diff --git a/proof/clarens/src/TLM.cxx b/proof/clarens/src/TLM.cxx
index 6dc37bb2487..95f847b0471 100644
--- a/proof/clarens/src/TLM.cxx
+++ b/proof/clarens/src/TLM.cxx
@@ -246,12 +246,12 @@ Bool_t TLM::EndSession(const Char_t *sessionid)
 //______________________________________________________________________________
 void TLM::TSlaveParams::Print(Option_t * /*option*/) const
 {
-   cout << IsA()->GetName()
+   std::cout << IsA()->GetName()
       << ":  " << fNode
       << ", " << fPerfidx
       << ", " << fImg
       << ", " << fAuth
       << ", " << fAccount
       << ", " << fType
-      << endl;
+      << std::endl;
 }
diff --git a/proof/proof/src/TCondor.cxx b/proof/proof/src/TCondor.cxx
index 7d82c6d0fc2..e361ed96e16 100644
--- a/proof/proof/src/TCondor.cxx
+++ b/proof/proof/src/TCondor.cxx
@@ -88,9 +88,9 @@ void TCondor::Print(Option_t * opt) const
 {
    // Print master status
 
-   cout << "OBJ: " << IsA()->GetName()
+   std::cout << "OBJ: " << IsA()->GetName()
       << "\tPool: \"" << fPool << "\""
-      << "\tState: " << fState << endl;
+      << "\tState: " << fState << std::endl;
    fClaims->Print(opt);
 }
 
@@ -477,8 +477,8 @@ void TCondorSlave::Print(Option_t * /*opt*/ ) const
 {
    // Print worker status
 
-   cout << "OBJ: " << IsA()->GetName()
+   std::cout << "OBJ: " << IsA()->GetName()
       << " " << fHostname << ":" << fPort
       << "  Perf: " << fPerfIdx
-      << "  Image: " << fImage << endl;
+      << "  Image: " << fImage << std::endl;
 }
diff --git a/proof/proof/src/TDataSetManager.cxx b/proof/proof/src/TDataSetManager.cxx
index 96a2d2492d3..9ad81844798 100644
--- a/proof/proof/src/TDataSetManager.cxx
+++ b/proof/proof/src/TDataSetManager.cxx
@@ -247,7 +247,7 @@ Bool_t TDataSetManager::ReadGroupConfig(const char *cf)
       Info("ReadGroupConfig","reading group config from %s", cf);
 
    // Open the config file
-   ifstream in;
+   std::ifstream in;
    in.open(cf);
    if (!in.is_open()) {
       Error("ReadGroupConfig", "could not open config file %s", cf);
diff --git a/proof/proof/src/TProof.cxx b/proof/proof/src/TProof.cxx
index e49b06947c7..b45302c36b6 100644
--- a/proof/proof/src/TProof.cxx
+++ b/proof/proof/src/TProof.cxx
@@ -221,12 +221,12 @@ void TSlaveInfo::Print(Option_t *opt) const
    } else {
       TString msd  = fMsd.IsNull() ? "<null>" : fMsd.Data();
 
-      cout << "Slave: "          << fOrdinal
+      std::cout << "Slave: "          << fOrdinal
          << "  hostname: "     << fHostName
          << "  msd: "          << msd
          << "  perf index: "   << fPerfIndex
          << "  "               << stat
-         << endl;
+         << std::endl;
    }
 }
 
@@ -6384,7 +6384,7 @@ void TProof::ClearData(UInt_t what, const char *dsname)
       ShowData();
       gSystem->RedirectOutput(0, 0, &h);
       // Parse the output file now
-      ifstream in;
+      std::ifstream in;
       in.open(outtmp.Data());
       if (!in.is_open()) {
          Error("ClearData", "could not open temp file for logs: %s", outtmp.Data());
diff --git a/proof/proof/src/TProofMgr.cxx b/proof/proof/src/TProofMgr.cxx
index 0f96960db6b..31a8944c7fd 100644
--- a/proof/proof/src/TProofMgr.cxx
+++ b/proof/proof/src/TProofMgr.cxx
@@ -977,8 +977,8 @@ TFileCollection *TProofMgr::UploadFiles(const char *srcfiles,
    TString line;
    if (R_ISREG(fst.fMode)) {
       // Text file
-      ifstream f;
-      f.open(inpath.Data(), ifstream::out);
+      std::ifstream f;
+      f.open(inpath.Data(), std::ifstream::out);
       if (f.is_open()) {
          while (f.good()) {
             line.ReadToDelim(f);
diff --git a/proof/proof/src/TProofMgrLite.cxx b/proof/proof/src/TProofMgrLite.cxx
index 76c72bf9de4..4eb67e473d4 100644
--- a/proof/proof/src/TProofMgrLite.cxx
+++ b/proof/proof/src/TProofMgrLite.cxx
@@ -377,7 +377,7 @@ TObjString *TProofMgrLite::ReadBuffer(const char *fin, const char *pattern)
    TRegexp re(pat);
 
    // Open file with file info
-   ifstream in;
+   std::ifstream in;
    in.open(fn.Data());
 
    TString outbuf;
diff --git a/proof/proof/src/TProofResourcesStatic.cxx b/proof/proof/src/TProofResourcesStatic.cxx
index 73ef8864d72..ea976d7e6ff 100644
--- a/proof/proof/src/TProofResourcesStatic.cxx
+++ b/proof/proof/src/TProofResourcesStatic.cxx
@@ -177,7 +177,7 @@ Bool_t TProofResourcesStatic::ReadConfigFile(const char *confDir,
       Info("ReadConfigFile", "using PROOF config file: %s", fFileName.Data());
 
    // Open the config file
-   fstream infile(fFileName.Data(), std::ios::in);
+   std::fstream infile(fFileName.Data(), std::ios::in);
    if (infile.is_open()) {
       Bool_t isMaster = kFALSE;
       Bool_t isSubmaster = kFALSE;
diff --git a/proof/proof/src/TProofServ.cxx b/proof/proof/src/TProofServ.cxx
index 67851394b7a..5493f9f8282 100644
--- a/proof/proof/src/TProofServ.cxx
+++ b/proof/proof/src/TProofServ.cxx
@@ -851,9 +851,9 @@ Int_t TProofServ::CreateServer()
       }
    }
 
-   // Everybody expects iostream to be available, so load it...
+   // Everybody expects std::iostream to be available, so load it...
    ProcessLine("#include <iostream>", kTRUE);
-   ProcessLine("#include <string>",kTRUE); // for std::string iostream.
+   ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
 
    // The following libs are also useful to have, make sure they are loaded...
    //gROOT->LoadClass("TMinuit",     "Minuit");
diff --git a/proof/proof/src/TProofServLite.cxx b/proof/proof/src/TProofServLite.cxx
index c71395f9db4..4f1b326dc3a 100644
--- a/proof/proof/src/TProofServLite.cxx
+++ b/proof/proof/src/TProofServLite.cxx
@@ -260,9 +260,9 @@ Int_t TProofServLite::CreateServer()
       }
    }
 
-   // Everybody expects iostream to be available, so load it...
+   // Everybody expects std::iostream to be available, so load it...
    ProcessLine("#include <iostream>", kTRUE);
-   ProcessLine("#include <string>",kTRUE); // for std::string iostream.
+   ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
 
    // Load user functions
    const char *logon;
diff --git a/proof/proofd/inc/XrdProofdTrace.h b/proof/proofd/inc/XrdProofdTrace.h
index 54655c27844..4d718d64dff 100644
--- a/proof/proofd/inc/XrdProofdTrace.h
+++ b/proof/proofd/inc/XrdProofdTrace.h
@@ -82,10 +82,10 @@ R__EXTERN XrdOucTrace *XrdProofdTrace;
         }
 
 #define XPDPRT(x) \
-   {XrdProofdTrace->Beg("-I");   cerr << xpdloc <<": "<< x; XrdProofdTrace->End();}
+   {XrdProofdTrace->Beg("-I");   std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End();}
 
 #define XPDERR(x) \
-   {XrdProofdTrace->Beg("-E");   cerr << xpdloc <<": "<< x; XrdProofdTrace->End();}
+   {XrdProofdTrace->Beg("-E");   std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End();}
 
 #define TRACE(act, x) \
    if (TRACING(act)) { \
@@ -100,11 +100,11 @@ R__EXTERN XrdOucTrace *XrdProofdTrace;
    if (TRACING(act)) { \
       if (TRACINGERR(act)) { \
          if (p) {\
-            XrdProofdTrace->Beg("-E", 0, p->TraceID()); cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
+            XrdProofdTrace->Beg("-E", 0, p->TraceID()); std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
          } else {XPDERR(x);}\
       } else { \
          if (p) {\
-            XrdProofdTrace->Beg("-I", 0, p->TraceID()); cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
+            XrdProofdTrace->Beg("-I", 0, p->TraceID()); std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
          } else {XPDPRT(x);}\
       } \
    }
@@ -113,11 +113,11 @@ R__EXTERN XrdOucTrace *XrdProofdTrace;
    if (TRACING(act)) { \
       if (TRACINGERR(act)) { \
          if (id) {\
-            XrdProofdTrace->Beg("-E", 0, id); cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
+            XrdProofdTrace->Beg("-E", 0, id); std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
          } else { XPDERR(x); }\
       } else { \
          if (id) {\
-            XrdProofdTrace->Beg("-I", 0, id); cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
+            XrdProofdTrace->Beg("-I", 0, id); std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
          } else { XPDPRT(x); }\
       } \
    }
@@ -126,11 +126,11 @@ R__EXTERN XrdOucTrace *XrdProofdTrace;
    if (TRACING(act)) { \
       if (TRACINGERR(act)) { \
          if (r) {\
-            XrdProofdTrace->Beg("-E", 0, r->TraceID()); cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
+            XrdProofdTrace->Beg("-E", 0, r->TraceID()); std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
          } else { XPDERR(x); }\
       } else { \
          if (r) {\
-            XrdProofdTrace->Beg("-I", 0, r->TraceID()); cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
+            XrdProofdTrace->Beg("-I", 0, r->TraceID()); std::cerr << xpdloc <<": "<< x; XrdProofdTrace->End(); \
          } else { XPDPRT(x); }\
       } \
    }
diff --git a/proof/proofd/src/XrdProofdNetMgr.cxx b/proof/proofd/src/XrdProofdNetMgr.cxx
index 1c74e6e6506..551893dae34 100644
--- a/proof/proofd/src/XrdProofdNetMgr.cxx
+++ b/proof/proofd/src/XrdProofdNetMgr.cxx
@@ -320,10 +320,10 @@ int XrdProofdNetMgr::DoDirectiveBonjour(char *val, XrdOucStream *cfg, bool)
 void XrdProofdNetMgr::BalanceNodesOrder()
 {
    // Indices (this will be used twice).
-   list<XrdProofWorker *>::const_iterator iter, iter2;
-   list<XrdProofWorker *>::iterator iter3; // Not const, less efficient.
+   std::list<XrdProofWorker *>::const_iterator iter, iter2;
+   std::list<XrdProofWorker *>::iterator iter3; // Not const, less efficient.
    // Map to store information of the balancer.
-   map<XrdProofWorker *, BalancerInfo> info;
+   std::map<XrdProofWorker *, BalancerInfo> info;
    // Node with minimum number of workers distinct to 1.
    unsigned int min = UINT_MAX;
    // Total number of nodes and per iteration assignments.
@@ -331,7 +331,7 @@ void XrdProofdNetMgr::BalanceNodesOrder()
    // Number of iterations to get every node filled.
    unsigned int total_added = 0;
    // Temporary list to store the balanced configuration
-   list<XrdProofWorker *> tempNodes;
+   std::list<XrdProofWorker *> tempNodes;
    // Flag for the search and destroy loop.
    bool deleted;
 
@@ -377,7 +377,7 @@ void XrdProofdNetMgr::BalanceNodesOrder()
    // Finally, do the round robin assignment of nodes.
    // Stop when every node has its workers processed.
    while (total_added < total) {
-      for (map<XrdProofWorker *, BalancerInfo>::iterator i = info.begin(); i != info.end(); i++) {
+      for (std::map<XrdProofWorker *, BalancerInfo>::iterator i = info.begin(); i != info.end(); i++) {
          if (i->second.added < i->second.available) {
             // Be careful with the remainders (on prime number of nodes).
             unsigned int to_add = xrdmin(i->second.per_iteration,
diff --git a/proof/proofplayer/src/TPacketizer.cxx b/proof/proofplayer/src/TPacketizer.cxx
index eca9de58d04..2001006103e 100644
--- a/proof/proofplayer/src/TPacketizer.cxx
+++ b/proof/proofplayer/src/TPacketizer.cxx
@@ -182,9 +182,9 @@ public:
 
    void Print(Option_t *) const
    {
-      cout << "OBJ: " << IsA()->GetName() << "\t" << fNodeName
+      std::cout << "OBJ: " << IsA()->GetName() << "\t" << fNodeName
            << "\tMySlaveCount " << fMySlaveCnt
-           << "\tSlaveCount " << fSlaveCnt << endl;
+           << "\tSlaveCount " << fSlaveCnt << std::endl;
    }
 
    void Reset()
@@ -627,7 +627,7 @@ TPacketizer::TFileNode *TPacketizer::NextUnAllocNode()
 
    fUnAllocated->Sort();
    PDB(kPacketizer,2) {
-      cout << "TPacketizer::NextUnAllocNode()" << endl;
+      std::cout << "TPacketizer::NextUnAllocNode()" << std::endl;
       fUnAllocated->Print();
    }
 
@@ -672,7 +672,7 @@ TPacketizer::TFileNode *TPacketizer::NextActiveNode()
 
    fActive->Sort();
    PDB(kPacketizer,2) {
-      cout << "TPacketizer::NextActiveNode()" << endl;
+      std::cout << "TPacketizer::NextActiveNode()" << std::endl;
       fActive->Print();
    }
 
diff --git a/proof/proofx/src/TXProofServ.cxx b/proof/proofx/src/TXProofServ.cxx
index 1da8118fa03..37f208f4f64 100644
--- a/proof/proofx/src/TXProofServ.cxx
+++ b/proof/proofx/src/TXProofServ.cxx
@@ -330,9 +330,9 @@ Int_t TXProofServ::CreateServer()
       }
    }
 
-   // Everybody expects iostream to be available, so load it...
+   // Everybody expects std::iostream to be available, so load it...
    ProcessLine("#include <iostream>", kTRUE);
-   ProcessLine("#include <string>",kTRUE); // for std::string iostream.
+   ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
 
    // Load user functions
    const char *logon;
diff --git a/proof/proofx/src/TXSocket.cxx b/proof/proofx/src/TXSocket.cxx
index 0a915c67642..d7d0f83fb9a 100644
--- a/proof/proofx/src/TXSocket.cxx
+++ b/proof/proofx/src/TXSocket.cxx
@@ -980,8 +980,8 @@ Int_t TXSocket::Flush()
    // Returns number of bytes in flushed buffers.
 
    Int_t nf = 0;
-   list<TXSockBuf *> splist;
-   list<TXSockBuf *>::iterator i;
+   std::list<TXSockBuf *> splist;
+   std::list<TXSockBuf *>::iterator i;
 
    {  R__LOCKGUARD(fAMtx);
 
@@ -1489,7 +1489,7 @@ TXSockBuf *TXSocket::PopUpSpare(Int_t size)
 
    Int_t maxsz = 0;
    if (fgSQue.size() > 0) {
-      list<TXSockBuf *>::iterator i;
+      std::list<TXSockBuf *>::iterator i;
       for (i = fgSQue.begin(); i != fgSQue.end(); i++) {
          maxsz = ((*i)->fSiz > maxsz) ? (*i)->fSiz : maxsz;
          if ((*i) && (*i)->fSiz >= size) {
diff --git a/roofit/histfactory/inc/RooStats/HistFactory/ParamHistFunc.h b/roofit/histfactory/inc/RooStats/HistFactory/ParamHistFunc.h
index 3fab4355de0..86518a4290a 100755
--- a/roofit/histfactory/inc/RooStats/HistFactory/ParamHistFunc.h
+++ b/roofit/histfactory/inc/RooStats/HistFactory/ParamHistFunc.h
@@ -44,7 +44,7 @@ public:
   ParamHistFunc(const ParamHistFunc& other, const char* name = 0);
   virtual TObject* clone(const char* newname) const { return new ParamHistFunc(*this, newname); }
 
-  //  void printMetaArgs(ostream& os) const ;
+  //  void printMetaArgs(std::ostream& os) const ;
 
   const RooArgList& paramList() const { return _paramSet ; }
 
@@ -92,7 +92,7 @@ protected:
     RooArgList _funcIntList ;
     RooArgList _lowIntList ;
     RooArgList _highIntList ;
-    // will want vector<RooRealVar*> for low and high also
+    // will want std::vector<RooRealVar*> for low and high also
   } ;
   mutable RooObjCacheManager _normIntMgr ; // The integration cache manager
 
diff --git a/roofit/histfactory/inc/RooStats/HistFactory/PiecewiseInterpolation.h b/roofit/histfactory/inc/RooStats/HistFactory/PiecewiseInterpolation.h
index c895446d75e..7afbbe284ba 100644
--- a/roofit/histfactory/inc/RooStats/HistFactory/PiecewiseInterpolation.h
+++ b/roofit/histfactory/inc/RooStats/HistFactory/PiecewiseInterpolation.h
@@ -37,7 +37,7 @@ public:
 
   //  virtual Double_t defaultErrorLevel() const ;
 
-  //  void printMetaArgs(ostream& os) const ;
+  //  void printMetaArgs(std::ostream& os) const ;
 
   const RooArgList& lowList() const { return _lowSet ; }
   const RooArgList& highList() const { return _highSet ; }
@@ -74,7 +74,7 @@ protected:
     RooArgList _funcIntList ;
     RooArgList _lowIntList ;
     RooArgList _highIntList ;
-    // will want vector<RooRealVar*> for low and high also
+    // will want std::vector<RooRealVar*> for low and high also
   } ;
   mutable RooObjCacheManager _normIntMgr ; // The integration cache manager
 
diff --git a/roofit/histfactory/inc/RooStats/HistFactory/Sample.h b/roofit/histfactory/inc/RooStats/HistFactory/Sample.h
index b6912a324be..c01cb08a0ab 100644
--- a/roofit/histfactory/inc/RooStats/HistFactory/Sample.h
+++ b/roofit/histfactory/inc/RooStats/HistFactory/Sample.h
@@ -31,7 +31,7 @@ public:
 
 
   void Print(std::ostream& = std::cout);  
-  void PrintXML( ofstream& xml );
+  void PrintXML( std::ofstream& xml );
   void writeToFile( std::string FileName, std::string DirName );
 
   TH1* GetHisto();
diff --git a/roofit/histfactory/src/Channel.cxx b/roofit/histfactory/src/Channel.cxx
index 8b491c2e8af..c53b1d9bf03 100644
--- a/roofit/histfactory/src/Channel.cxx
+++ b/roofit/histfactory/src/Channel.cxx
@@ -1,11 +1,12 @@
-
-#include "stdlib.h"
+#include "RooStats/HistFactory/Channel.h"
+#include <stdlib.h>
 
 #include "TFile.h"
 #include "TTimeStamp.h"
 
 #include "RooStats/HistFactory/HistFactoryException.h"
-#include "RooStats/HistFactory/Channel.h"
+
+using namespace std;
 
 RooStats::HistFactory::Channel::Channel() :
   fName( "" ) { ; }
diff --git a/roofit/histfactory/src/FlexibleInterpVar.cxx b/roofit/histfactory/src/FlexibleInterpVar.cxx
index 0175175bf95..41a214c7a62 100644
--- a/roofit/histfactory/src/FlexibleInterpVar.cxx
+++ b/roofit/histfactory/src/FlexibleInterpVar.cxx
@@ -32,6 +32,8 @@ END_HTML
 
 #include "RooStats/HistFactory/FlexibleInterpVar.h"
 
+using namespace std;
+
 ClassImp(RooStats::HistFactory::FlexibleInterpVar)
 
 using namespace RooStats;
diff --git a/roofit/histfactory/src/LinInterpVar.cxx b/roofit/histfactory/src/LinInterpVar.cxx
index 04ae43ab7ad..8313c20adb7 100644
--- a/roofit/histfactory/src/LinInterpVar.cxx
+++ b/roofit/histfactory/src/LinInterpVar.cxx
@@ -32,6 +32,8 @@ END_HTML
 
 #include "RooStats/HistFactory/LinInterpVar.h"
 
+using namespace std;
+
 ClassImp(RooStats::HistFactory::LinInterpVar)
 
 using namespace RooStats;
diff --git a/roofit/histfactory/src/Measurement.cxx b/roofit/histfactory/src/Measurement.cxx
index a30e0ba3e6b..3f08a8d22e7 100644
--- a/roofit/histfactory/src/Measurement.cxx
+++ b/roofit/histfactory/src/Measurement.cxx
@@ -8,6 +8,8 @@
 #include "RooStats/HistFactory/Measurement.h"
 #include "RooStats/HistFactory/HistFactoryException.h"
 
+using namespace std;
+
 ClassImp(RooStats::HistFactory::Measurement) ;
 
 
diff --git a/roofit/histfactory/src/ParamHistFunc.cxx b/roofit/histfactory/src/ParamHistFunc.cxx
index 88631c70d1c..b603e43be99 100755
--- a/roofit/histfactory/src/ParamHistFunc.cxx
+++ b/roofit/histfactory/src/ParamHistFunc.cxx
@@ -40,6 +40,8 @@
 #include "RooWorkspace.h"
 #include "RooBinning.h"
 
+using namespace std;
+
 ClassImp(ParamHistFunc);
 
 
diff --git a/roofit/histfactory/src/PiecewiseInterpolation.cxx b/roofit/histfactory/src/PiecewiseInterpolation.cxx
index d12b00dc1fb..5e7ca1e110f 100644
--- a/roofit/histfactory/src/PiecewiseInterpolation.cxx
+++ b/roofit/histfactory/src/PiecewiseInterpolation.cxx
@@ -27,6 +27,8 @@
 #include "RooMsgService.h"
 #include "RooNumIntConfig.h"
 
+using namespace std;
+
 ClassImp(PiecewiseInterpolation)
 ;
 
diff --git a/roofit/roofit/inc/Roo2DKeysPdf.h b/roofit/roofit/inc/Roo2DKeysPdf.h
index 88c3a9a9247..4d0d92ca11b 100644
--- a/roofit/roofit/inc/Roo2DKeysPdf.h
+++ b/roofit/roofit/inc/Roo2DKeysPdf.h
@@ -65,7 +65,7 @@ public:
   Double_t getSigma(const char * axis) const;
 
 // print content and basic information about the data
-  void     PrintInfo(ostream &) const;
+  void     PrintInfo(std::ostream &) const;
 
 // save PDF to a file as a TH2F *, TTree * or both
 // this is so that you only need to compute the PDF once and 
diff --git a/roofit/roofit/inc/RooCFunction1Binding.h b/roofit/roofit/inc/RooCFunction1Binding.h
index 330b5de0016..8ad025440d0 100644
--- a/roofit/roofit/inc/RooCFunction1Binding.h
+++ b/roofit/roofit/inc/RooCFunction1Binding.h
@@ -175,7 +175,7 @@ void RooCFunction1Ref<VO,VI>::Streamer(TBuffer &R__b)
 
      if (tmpName=="UNKNOWN" && R__v>0) {
 
-       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << endl ;
+       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << std::endl ;
        _ptr = dummyFunction ;
 
      } else {
@@ -185,7 +185,7 @@ void RooCFunction1Ref<VO,VI>::Streamer(TBuffer &R__b)
 
        if (_ptr==0) {
 	 coutW(ObjectHandling) << "ERROR: Objected embeds pointer to function named " << tmpName 
-			       << " but no such function is registered, object will not be functional" << endl ;
+			       << " but no such function is registered, object will not be functional" << std::endl ;
        }
      }
 
@@ -207,7 +207,7 @@ void RooCFunction1Ref<VO,VI>::Streamer(TBuffer &R__b)
         } temp;
         temp._funcptr = _ptr;
         coutW(ObjectHandling) << "WARNING: Cannot persist unknown function pointer " << Form("%p",temp._ptr) 
-                              << " written object will not be functional when read back" <<  endl ;
+                              << " written object will not be functional when read back" <<  std::endl ;
        tmpName="UNKNOWN" ;
      } 
      
@@ -232,7 +232,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction1Binding(*this,newname); }
   inline virtual ~RooCFunction1Binding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;    
     for (Int_t i=0 ; i<numProxies() ; i++) {
@@ -296,7 +296,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction1PdfBinding(*this,newname); }
   inline virtual ~RooCFunction1PdfBinding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;    
     for (Int_t i=0 ; i<numProxies() ; i++) {
diff --git a/roofit/roofit/inc/RooCFunction2Binding.h b/roofit/roofit/inc/RooCFunction2Binding.h
index fa796c48ce1..57d657ffca9 100644
--- a/roofit/roofit/inc/RooCFunction2Binding.h
+++ b/roofit/roofit/inc/RooCFunction2Binding.h
@@ -184,7 +184,7 @@ void RooCFunction2Ref<VO,VI1,VI2>::Streamer(TBuffer &R__b)
 
      if (tmpName=="UNKNOWN" && R__v>0) {
 
-       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << endl ;
+       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << std::endl ;
        _ptr = dummyFunction ;
 
      } else {
@@ -194,7 +194,7 @@ void RooCFunction2Ref<VO,VI1,VI2>::Streamer(TBuffer &R__b)
 
        if (_ptr==0) {
 	 coutW(ObjectHandling) << "ERROR: Objected embeds pointer to function named " << tmpName
-			       << " but no such function is registered, object will not be functional" << endl ;
+			       << " but no such function is registered, object will not be functional" << std::endl ;
        }
      }
 
@@ -210,7 +210,7 @@ void RooCFunction2Ref<VO,VI1,VI2>::Streamer(TBuffer &R__b)
      TString tmpName = fmap().lookupName(_ptr) ;
      if (tmpName.Length()==0) {
        coutW(ObjectHandling) << "WARNING: Cannot persist unknown function pointer " << Form("0x%lx", (ULong_t)_ptr)
-			     << " written object will not be functional when read back" <<  endl ;
+			     << " written object will not be functional when read back" <<  std::endl ;
        tmpName="UNKNOWN" ;
      }
 
@@ -235,7 +235,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction2Binding(*this,newname); }
   inline virtual ~RooCFunction2Binding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;
     for (Int_t i=0 ; i<numProxies() ; i++) {
@@ -303,7 +303,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction2PdfBinding(*this,newname); }
   inline virtual ~RooCFunction2PdfBinding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;
     for (Int_t i=0 ; i<numProxies() ; i++) {
diff --git a/roofit/roofit/inc/RooCFunction3Binding.h b/roofit/roofit/inc/RooCFunction3Binding.h
index d614d1ffad9..88861592ecf 100644
--- a/roofit/roofit/inc/RooCFunction3Binding.h
+++ b/roofit/roofit/inc/RooCFunction3Binding.h
@@ -188,7 +188,7 @@ void RooCFunction3Ref<VO,VI1,VI2,VI3>::Streamer(TBuffer &R__b)
 
      if (tmpName=="UNKNOWN" && R__v>0) {
 
-       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << endl ;
+       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << std::endl ;
        _ptr = dummyFunction ;
 
      } else {
@@ -198,7 +198,7 @@ void RooCFunction3Ref<VO,VI1,VI2,VI3>::Streamer(TBuffer &R__b)
 
        if (_ptr==0) {
 	 coutW(ObjectHandling) << "ERROR: Objected embeds pointer to function named " << tmpName 
-			       << " but no such function is registered, object will not be functional" << endl ;
+			       << " but no such function is registered, object will not be functional" << std::endl ;
        }
      }
 
@@ -220,7 +220,7 @@ void RooCFunction3Ref<VO,VI1,VI2,VI3>::Streamer(TBuffer &R__b)
        } temp;
        temp._funcptr = _ptr;
        coutW(ObjectHandling) << "WARNING: Cannot persist unknown function pointer " << Form("%p",temp._ptr) 
-			     << " written object will not be functional when read back" <<  endl ;
+			     << " written object will not be functional when read back" <<  std::endl ;
        tmpName="UNKNOWN" ;
      } 
      
@@ -245,7 +245,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction3Binding(*this,newname); }
   inline virtual ~RooCFunction3Binding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;    
     for (Int_t i=0 ; i<numProxies() ; i++) {
@@ -316,7 +316,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction3PdfBinding(*this,newname); }
   inline virtual ~RooCFunction3PdfBinding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;    
     for (Int_t i=0 ; i<numProxies() ; i++) {
diff --git a/roofit/roofit/inc/RooCFunction4Binding.h b/roofit/roofit/inc/RooCFunction4Binding.h
index feef876df06..ab25203916a 100644
--- a/roofit/roofit/inc/RooCFunction4Binding.h
+++ b/roofit/roofit/inc/RooCFunction4Binding.h
@@ -182,7 +182,7 @@ void RooCFunction4Ref<VO,VI1,VI2,VI3,VI4>::Streamer(TBuffer &R__b)
 
      if (tmpName=="UNKNOWN" && R__v>0) {
 
-       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << endl ;
+       coutW(ObjectHandling) << "WARNING: Objected embeds function pointer to unknown function, object will not be functional" << std::endl ;
        _ptr = dummyFunction ;
 
      } else {
@@ -192,7 +192,7 @@ void RooCFunction4Ref<VO,VI1,VI2,VI3,VI4>::Streamer(TBuffer &R__b)
 
        if (_ptr==0) {
 	 coutW(ObjectHandling) << "ERROR: Objected embeds pointer to function named " << tmpName
-			       << " but no such function is registered, object will not be functional" << endl ;
+			       << " but no such function is registered, object will not be functional" << std::endl ;
        }
      }
 
@@ -208,7 +208,7 @@ void RooCFunction4Ref<VO,VI1,VI2,VI3,VI4>::Streamer(TBuffer &R__b)
      TString tmpName = fmap().lookupName(_ptr) ;
      if (tmpName.Length()==0) {
        coutW(ObjectHandling) << "WARNING: Cannot persist unknown function pointer " << Form("0x%lx",(ULong_t)_ptr)
-			     << " written object will not be functional when read back" <<  endl ;
+			     << " written object will not be functional when read back" <<  std::endl ;
        tmpName="UNKNOWN" ;
      }
 
@@ -233,7 +233,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction4Binding(*this,newname); }
   inline virtual ~RooCFunction4Binding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;
     for (Int_t i=0 ; i<numProxies() ; i++) {
@@ -306,7 +306,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooCFunction4PdfBinding(*this,newname); }
   inline virtual ~RooCFunction4PdfBinding() { }
 
-  void printArgs(ostream& os) const {
+  void printArgs(std::ostream& os) const {
     // Print object arguments and name/address of function pointer
     os << "[ function=" << func.name() << " " ;
     for (Int_t i=0 ; i<numProxies() ; i++) {
diff --git a/roofit/roofit/inc/RooFunctor1DBinding.h b/roofit/roofit/inc/RooFunctor1DBinding.h
index 5fa448aa578..90eeea3daae 100644
--- a/roofit/roofit/inc/RooFunctor1DBinding.h
+++ b/roofit/roofit/inc/RooFunctor1DBinding.h
@@ -43,7 +43,7 @@ public:
   RooFunctor1DBinding(const RooFunctor1DBinding& other, const char* name=0) ;
   virtual TObject* clone(const char* newname) const { return new RooFunctor1DBinding(*this,newname); }
   inline virtual ~RooFunctor1DBinding() {}
-  void printArgs(ostream& os) const ;
+  void printArgs(std::ostream& os) const ;
 
 protected:
 
@@ -69,7 +69,7 @@ public:
   RooFunctor1DPdfBinding(const RooFunctor1DPdfBinding& other, const char* name=0) ;
   virtual TObject* clone(const char* newname) const { return new RooFunctor1DPdfBinding(*this,newname); }
   inline virtual ~RooFunctor1DPdfBinding() {}
-  void printArgs(ostream& os) const ;
+  void printArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofit/inc/RooFunctorBinding.h b/roofit/roofit/inc/RooFunctorBinding.h
index ccf35313808..de1e201edd4 100644
--- a/roofit/roofit/inc/RooFunctorBinding.h
+++ b/roofit/roofit/inc/RooFunctorBinding.h
@@ -43,7 +43,7 @@ public:
   RooFunctorBinding(const RooFunctorBinding& other, const char* name=0) ;
   virtual TObject* clone(const char* newname) const { return new RooFunctorBinding(*this,newname); }
   inline virtual ~RooFunctorBinding() { delete[] x ; }
-  void printArgs(ostream& os) const ;
+  void printArgs(std::ostream& os) const ;
 
 protected:
 
@@ -70,7 +70,7 @@ public:
   RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=0) ;
   virtual TObject* clone(const char* newname) const { return new RooFunctorPdfBinding(*this,newname); }
   inline virtual ~RooFunctorPdfBinding() { delete[] x ; }
-  void printArgs(ostream& os) const ;
+  void printArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofit/inc/RooTFnBinding.h b/roofit/roofit/inc/RooTFnBinding.h
index 275dd6d0dd2..6017abd2f52 100644
--- a/roofit/roofit/inc/RooTFnBinding.h
+++ b/roofit/roofit/inc/RooTFnBinding.h
@@ -23,7 +23,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooTFnBinding(*this,newname); }
   inline virtual ~RooTFnBinding() { }
 
-  void printArgs(ostream& os) const ;
+  void printArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofit/inc/RooTFnPdfBinding.h b/roofit/roofit/inc/RooTFnPdfBinding.h
index caff266d388..23c84172a75 100644
--- a/roofit/roofit/inc/RooTFnPdfBinding.h
+++ b/roofit/roofit/inc/RooTFnPdfBinding.h
@@ -21,7 +21,7 @@ public:
   virtual TObject* clone(const char* newname) const { return new RooTFnPdfBinding(*this,newname); }
   inline virtual ~RooTFnPdfBinding() { }
 
-  void printArgs(ostream& os) const ;
+  void printArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofit/src/Roo1DMomentMorphFunction.cxx b/roofit/roofit/src/Roo1DMomentMorphFunction.cxx
index 7e1b8a92503..ab80fd4f575 100644
--- a/roofit/roofit/src/Roo1DMomentMorphFunction.cxx
+++ b/roofit/roofit/src/Roo1DMomentMorphFunction.cxx
@@ -27,6 +27,8 @@
 
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(Roo1DMomentMorphFunction) 
 
 
diff --git a/roofit/roofit/src/Roo2DMomentMorphFunction.cxx b/roofit/roofit/src/Roo2DMomentMorphFunction.cxx
index a5d62066d62..51fb44e00ce 100644
--- a/roofit/roofit/src/Roo2DMomentMorphFunction.cxx
+++ b/roofit/roofit/src/Roo2DMomentMorphFunction.cxx
@@ -65,6 +65,8 @@
 */
 
 
+using namespace std;
+
 ClassImp(Roo2DMomentMorphFunction) 
 
 
diff --git a/roofit/roofit/src/RooArgusBG.cxx b/roofit/roofit/src/RooArgusBG.cxx
index 3133a5bc12e..1ccaf704bcf 100644
--- a/roofit/roofit/src/RooArgusBG.cxx
+++ b/roofit/roofit/src/RooArgusBG.cxx
@@ -33,6 +33,8 @@
 #include "RooMath.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooArgusBG)
 
 
diff --git a/roofit/roofit/src/RooBCPEffDecay.cxx b/roofit/roofit/src/RooBCPEffDecay.cxx
index 6d33a14f92b..86793cd3153 100644
--- a/roofit/roofit/src/RooBCPEffDecay.cxx
+++ b/roofit/roofit/src/RooBCPEffDecay.cxx
@@ -32,6 +32,8 @@
 #include "RooBCPEffDecay.h"
 #include "RooRealIntegral.h"
 
+using namespace std;
+
 ClassImp(RooBCPEffDecay) 
 ;
 
diff --git a/roofit/roofit/src/RooBCPGenDecay.cxx b/roofit/roofit/src/RooBCPGenDecay.cxx
index ccb44ca97a8..f1710d04884 100644
--- a/roofit/roofit/src/RooBCPGenDecay.cxx
+++ b/roofit/roofit/src/RooBCPGenDecay.cxx
@@ -34,6 +34,8 @@
 #include "RooBCPGenDecay.h"
 #include "RooRealIntegral.h"
 
+using namespace std;
+
 ClassImp(RooBCPGenDecay) 
 ;
 
diff --git a/roofit/roofit/src/RooBDecay.cxx b/roofit/roofit/src/RooBDecay.cxx
index e75e6fdb922..6cf1d536c80 100644
--- a/roofit/roofit/src/RooBDecay.cxx
+++ b/roofit/roofit/src/RooBDecay.cxx
@@ -34,6 +34,8 @@
 #include "RooRealVar.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooBDecay);
 
 
diff --git a/roofit/roofit/src/RooBMixDecay.cxx b/roofit/roofit/src/RooBMixDecay.cxx
index be9c66c18e1..88d456ad2b0 100644
--- a/roofit/roofit/src/RooBMixDecay.cxx
+++ b/roofit/roofit/src/RooBMixDecay.cxx
@@ -32,6 +32,8 @@
 #include "RooRealIntegral.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooBMixDecay) 
 ;
 
diff --git a/roofit/roofit/src/RooBernstein.cxx b/roofit/roofit/src/RooBernstein.cxx
index a76b0ae5a6f..2c618587043 100644
--- a/roofit/roofit/src/RooBernstein.cxx
+++ b/roofit/roofit/src/RooBernstein.cxx
@@ -32,6 +32,8 @@
 #include "RooRealVar.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooBernstein)
 ;
 
diff --git a/roofit/roofit/src/RooBifurGauss.cxx b/roofit/roofit/src/RooBifurGauss.cxx
index 8395139b4d9..4fc212b94ce 100644
--- a/roofit/roofit/src/RooBifurGauss.cxx
+++ b/roofit/roofit/src/RooBifurGauss.cxx
@@ -32,6 +32,8 @@
 #include "RooAbsReal.h"
 #include "RooMath.h"
 
+using namespace std;
+
 ClassImp(RooBifurGauss)
 
 static const char rcsid[] =
diff --git a/roofit/roofit/src/RooBlindTools.cxx b/roofit/roofit/src/RooBlindTools.cxx
index 412437d829f..ee4848c76a8 100644
--- a/roofit/roofit/src/RooBlindTools.cxx
+++ b/roofit/roofit/src/RooBlindTools.cxx
@@ -29,6 +29,8 @@
 #include <string.h>
 #include <ctype.h>
 
+using namespace std;
+
 ClassImp(RooBlindTools)
 
 
diff --git a/roofit/roofit/src/RooBreitWigner.cxx b/roofit/roofit/src/RooBreitWigner.cxx
index 13a279c6f30..6cf366dc5d2 100644
--- a/roofit/roofit/src/RooBreitWigner.cxx
+++ b/roofit/roofit/src/RooBreitWigner.cxx
@@ -35,6 +35,8 @@
 #include "RooRealVar.h"
 // #include "RooFitTools/RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooBreitWigner)
 
 
diff --git a/roofit/roofit/src/RooBukinPdf.cxx b/roofit/roofit/src/RooBukinPdf.cxx
index 55e75cf36dd..c02e12ac829 100644
--- a/roofit/roofit/src/RooBukinPdf.cxx
+++ b/roofit/roofit/src/RooBukinPdf.cxx
@@ -46,6 +46,8 @@
 #include "RooRealVar.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooBukinPdf)
 
 
diff --git a/roofit/roofit/src/RooCBShape.cxx b/roofit/roofit/src/RooCBShape.cxx
index c5d930e6904..60d2fdfd99e 100644
--- a/roofit/roofit/src/RooCBShape.cxx
+++ b/roofit/roofit/src/RooCBShape.cxx
@@ -33,6 +33,8 @@
 #include "RooMath.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooCBShape)
 ;
 
diff --git a/roofit/roofit/src/RooChebychev.cxx b/roofit/roofit/src/RooChebychev.cxx
index cfcff048711..f278904f433 100644
--- a/roofit/roofit/src/RooChebychev.cxx
+++ b/roofit/roofit/src/RooChebychev.cxx
@@ -31,6 +31,8 @@
 #include "RooRealVar.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooChebychev)
 ;
 
diff --git a/roofit/roofit/src/RooChi2MCSModule.cxx b/roofit/roofit/src/RooChi2MCSModule.cxx
index ae57f179577..a73fc5c12ec 100644
--- a/roofit/roofit/src/RooChi2MCSModule.cxx
+++ b/roofit/roofit/src/RooChi2MCSModule.cxx
@@ -42,6 +42,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooChi2MCSModule)
   ;
 
diff --git a/roofit/roofit/src/RooChiSquarePdf.cxx b/roofit/roofit/src/RooChiSquarePdf.cxx
index 398ba352e5a..5af10f102f9 100644
--- a/roofit/roofit/src/RooChiSquarePdf.cxx
+++ b/roofit/roofit/src/RooChiSquarePdf.cxx
@@ -26,6 +26,8 @@
 #include "RooAbsReal.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooChiSquarePdf)
 ;
 
diff --git a/roofit/roofit/src/RooDecay.cxx b/roofit/roofit/src/RooDecay.cxx
index 393dc9036e7..37ea992a3ef 100644
--- a/roofit/roofit/src/RooDecay.cxx
+++ b/roofit/roofit/src/RooDecay.cxx
@@ -30,6 +30,8 @@
 #include "RooRealVar.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooDecay) 
 ;
 
diff --git a/roofit/roofit/src/RooDstD0BG.cxx b/roofit/roofit/src/RooDstD0BG.cxx
index bc07953bab7..e27b5ad418f 100644
--- a/roofit/roofit/src/RooDstD0BG.cxx
+++ b/roofit/roofit/src/RooDstD0BG.cxx
@@ -37,6 +37,8 @@
 #include "RooIntegrator1D.h"
 #include "RooAbsFunc.h"
 
+using namespace std;
+
 ClassImp(RooDstD0BG) 
 
 static const char rcsid[] =
diff --git a/roofit/roofit/src/RooExponential.cxx b/roofit/roofit/src/RooExponential.cxx
index db0391181b8..30e73d926cb 100644
--- a/roofit/roofit/src/RooExponential.cxx
+++ b/roofit/roofit/src/RooExponential.cxx
@@ -30,6 +30,8 @@
 #include "RooExponential.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooExponential)
 
 
diff --git a/roofit/roofit/src/RooGExpModel.cxx b/roofit/roofit/src/RooGExpModel.cxx
index 974c127b91e..32ee9daae6a 100644
--- a/roofit/roofit/src/RooGExpModel.cxx
+++ b/roofit/roofit/src/RooGExpModel.cxx
@@ -35,6 +35,8 @@
 #include "RooMath.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooGExpModel) 
 ;
 
diff --git a/roofit/roofit/src/RooGamma.cxx b/roofit/roofit/src/RooGamma.cxx
index 2f256809a6f..1227e80fe3d 100644
--- a/roofit/roofit/src/RooGamma.cxx
+++ b/roofit/roofit/src/RooGamma.cxx
@@ -50,6 +50,8 @@
 #include <Math/PdfFuncMathCore.h>
 #include <Math/ProbFuncMathCore.h>
 
+using namespace std;
+
 ClassImp(RooGamma)
 
 
diff --git a/roofit/roofit/src/RooGaussModel.cxx b/roofit/roofit/src/RooGaussModel.cxx
index 688111ddc15..3987a5a3ab0 100644
--- a/roofit/roofit/src/RooGaussModel.cxx
+++ b/roofit/roofit/src/RooGaussModel.cxx
@@ -33,6 +33,8 @@
 #include "RooRealConstant.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooGaussModel) 
 ;
 
diff --git a/roofit/roofit/src/RooGaussian.cxx b/roofit/roofit/src/RooGaussian.cxx
index 3a4a1ff5085..0e210acf58c 100644
--- a/roofit/roofit/src/RooGaussian.cxx
+++ b/roofit/roofit/src/RooGaussian.cxx
@@ -33,6 +33,8 @@
 #include "RooRandom.h"
 #include "RooMath.h"
 
+using namespace std;
+
 ClassImp(RooGaussian)
 
 
diff --git a/roofit/roofit/src/RooHistConstraint.cxx b/roofit/roofit/src/RooHistConstraint.cxx
index 65bfa9b1948..7c194ac8cea 100644
--- a/roofit/roofit/src/RooHistConstraint.cxx
+++ b/roofit/roofit/src/RooHistConstraint.cxx
@@ -16,6 +16,8 @@
 #include <math.h> 
 #include "TMath.h" 
 
+using namespace std;
+
 ClassImp(RooHistConstraint) 
   
 RooHistConstraint::RooHistConstraint(const char *name, const char *title, const RooArgSet& phfSet, Int_t threshold) :
diff --git a/roofit/roofit/src/RooIntegralMorph.cxx b/roofit/roofit/src/RooIntegralMorph.cxx
index 5dcf642e8ef..960137addbf 100644
--- a/roofit/roofit/src/RooIntegralMorph.cxx
+++ b/roofit/roofit/src/RooIntegralMorph.cxx
@@ -88,6 +88,8 @@
 #include "RooDataHist.h"
 #include "TH1.h"
 
+using namespace std;
+
 ClassImp(RooIntegralMorph) 
 
 
diff --git a/roofit/roofit/src/RooJeffreysPrior.cxx b/roofit/roofit/src/RooJeffreysPrior.cxx
index a2f66641fcc..f4739970ef3 100644
--- a/roofit/roofit/src/RooJeffreysPrior.cxx
+++ b/roofit/roofit/src/RooJeffreysPrior.cxx
@@ -29,6 +29,8 @@
 #include "RooNumIntConfig.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooJeffreysPrior)
 ;
 
diff --git a/roofit/roofit/src/RooKeysPdf.cxx b/roofit/roofit/src/RooKeysPdf.cxx
index e4345d7779d..5730af1a112 100644
--- a/roofit/roofit/src/RooKeysPdf.cxx
+++ b/roofit/roofit/src/RooKeysPdf.cxx
@@ -26,6 +26,8 @@
 #include "RooRandom.h"
 #include "RooDataSet.h"
 
+using namespace std;
+
 ClassImp(RooKeysPdf)
 
 
diff --git a/roofit/roofit/src/RooLandau.cxx b/roofit/roofit/src/RooLandau.cxx
index 670e67c639c..4c3c5ccc04c 100644
--- a/roofit/roofit/src/RooLandau.cxx
+++ b/roofit/roofit/src/RooLandau.cxx
@@ -28,6 +28,8 @@
 #include "RooLandau.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooLandau)
 
 
diff --git a/roofit/roofit/src/RooLegendre.cxx b/roofit/roofit/src/RooLegendre.cxx
index 3e03241276e..614f818ad62 100644
--- a/roofit/roofit/src/RooLegendre.cxx
+++ b/roofit/roofit/src/RooLegendre.cxx
@@ -28,6 +28,8 @@
 #include "Math/SpecFunc.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooLegendre)
 ;
 
diff --git a/roofit/roofit/src/RooLognormal.cxx b/roofit/roofit/src/RooLognormal.cxx
index 719031911b8..18723af69a8 100644
--- a/roofit/roofit/src/RooLognormal.cxx
+++ b/roofit/roofit/src/RooLognormal.cxx
@@ -41,6 +41,8 @@
 #include <Math/PdfFuncMathCore.h>
 #include <Math/ProbFuncMathCore.h>
 
+using namespace std;
+
 ClassImp(RooLognormal)
 
 
diff --git a/roofit/roofit/src/RooMomentMorph.cxx b/roofit/roofit/src/RooMomentMorph.cxx
index 27e4af2e39c..d0d0badc88e 100644
--- a/roofit/roofit/src/RooMomentMorph.cxx
+++ b/roofit/roofit/src/RooMomentMorph.cxx
@@ -23,6 +23,8 @@
 
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooMomentMorph) 
 
 
diff --git a/roofit/roofit/src/RooNonCPEigenDecay.cxx b/roofit/roofit/src/RooNonCPEigenDecay.cxx
index bd527e0fefa..8537f3cae39 100644
--- a/roofit/roofit/src/RooNonCPEigenDecay.cxx
+++ b/roofit/roofit/src/RooNonCPEigenDecay.cxx
@@ -54,6 +54,8 @@
 #include "TMath.h"
 #include "RooRealIntegral.h"
 
+using namespace std;
+
 ClassImp(RooNonCPEigenDecay);
 
 #define Debug_RooNonCPEigenDecay 1
diff --git a/roofit/roofit/src/RooNonCentralChiSquare.cxx b/roofit/roofit/src/RooNonCentralChiSquare.cxx
index 565725fb164..08fbc9c0a37 100644
--- a/roofit/roofit/src/RooNonCentralChiSquare.cxx
+++ b/roofit/roofit/src/RooNonCentralChiSquare.cxx
@@ -49,6 +49,8 @@
 
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooNonCentralChiSquare) 
 
 RooNonCentralChiSquare::RooNonCentralChiSquare(const char *name, const char *title, 
diff --git a/roofit/roofit/src/RooNovosibirsk.cxx b/roofit/roofit/src/RooNovosibirsk.cxx
index 9e3a629ba62..adbd097665c 100644
--- a/roofit/roofit/src/RooNovosibirsk.cxx
+++ b/roofit/roofit/src/RooNovosibirsk.cxx
@@ -30,6 +30,8 @@
 #include "RooNovosibirsk.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooNovosibirsk)
 
 
diff --git a/roofit/roofit/src/RooParamHistFunc.cxx b/roofit/roofit/src/RooParamHistFunc.cxx
index a0fed0019f5..2ebc72dccc4 100644
--- a/roofit/roofit/src/RooParamHistFunc.cxx
+++ b/roofit/roofit/src/RooParamHistFunc.cxx
@@ -14,6 +14,8 @@
 #include <math.h> 
 #include "TMath.h" 
 
+using namespace std;
+
 ClassImp(RooParamHistFunc) 
   ;  
 
diff --git a/roofit/roofit/src/RooParametricStepFunction.cxx b/roofit/roofit/src/RooParametricStepFunction.cxx
index a7098b66e88..1d2913ddbde 100644
--- a/roofit/roofit/src/RooParametricStepFunction.cxx
+++ b/roofit/roofit/src/RooParametricStepFunction.cxx
@@ -52,6 +52,8 @@
 #include "RooRealVar.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooParametricStepFunction)
 ;
 
diff --git a/roofit/roofit/src/RooPoisson.cxx b/roofit/roofit/src/RooPoisson.cxx
index c6b6934fae7..62b8a7eaf42 100644
--- a/roofit/roofit/src/RooPoisson.cxx
+++ b/roofit/roofit/src/RooPoisson.cxx
@@ -24,6 +24,8 @@
 #include "TMath.h"
 #include "Math/ProbFuncMathCore.h"
 
+using namespace std;
+
 ClassImp(RooPoisson) 
 
 
diff --git a/roofit/roofit/src/RooPolynomial.cxx b/roofit/roofit/src/RooPolynomial.cxx
index e8fdb3b37d6..cd78b78d8fc 100644
--- a/roofit/roofit/src/RooPolynomial.cxx
+++ b/roofit/roofit/src/RooPolynomial.cxx
@@ -38,6 +38,8 @@
 #include "RooRealVar.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooPolynomial)
 ;
 
diff --git a/roofit/roofit/src/RooSpHarmonic.cxx b/roofit/roofit/src/RooSpHarmonic.cxx
index 364683645fa..440fad39412 100644
--- a/roofit/roofit/src/RooSpHarmonic.cxx
+++ b/roofit/roofit/src/RooSpHarmonic.cxx
@@ -51,6 +51,8 @@
 #include "Math/SpecFunc.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooSpHarmonic)
 ;
 
diff --git a/roofit/roofit/src/RooStepFunction.cxx b/roofit/roofit/src/RooStepFunction.cxx
index 8ed184ac719..33ec4dbbcd1 100644
--- a/roofit/roofit/src/RooStepFunction.cxx
+++ b/roofit/roofit/src/RooStepFunction.cxx
@@ -40,6 +40,8 @@
 #include "RooMsgService.h"
 #include "RooMath.h"
 
+using namespace std;
+
 ClassImp(RooStepFunction)
   ;
 
diff --git a/roofit/roofit/src/RooTFnBinding.cxx b/roofit/roofit/src/RooTFnBinding.cxx
index 7efa7c2312c..792ff9f140a 100644
--- a/roofit/roofit/src/RooTFnBinding.cxx
+++ b/roofit/roofit/src/RooTFnBinding.cxx
@@ -13,6 +13,8 @@
 #include "RooAbsCategory.h" 
 #include "TF3.h"
 
+using namespace std;
+
 ClassImp(RooTFnBinding) 
 
 RooTFnBinding::RooTFnBinding(const char *name, const char *title, TF1* _func, const RooArgList& _list) :
diff --git a/roofit/roofit/src/RooTFnPdfBinding.cxx b/roofit/roofit/src/RooTFnPdfBinding.cxx
index 65d066aef33..7316db5b8f3 100644
--- a/roofit/roofit/src/RooTFnPdfBinding.cxx
+++ b/roofit/roofit/src/RooTFnPdfBinding.cxx
@@ -13,6 +13,8 @@
 #include "RooAbsCategory.h" 
 #include "TF3.h"
 
+using namespace std;
+
 ClassImp(RooTFnPdfBinding) 
 
 RooTFnPdfBinding::RooTFnPdfBinding(const char *name, const char *title, TF1* _func, const RooArgList& _list) :
diff --git a/roofit/roofit/src/RooUnblindCPAsymVar.cxx b/roofit/roofit/src/RooUnblindCPAsymVar.cxx
index 286bae3cc7b..0cbfe01d261 100644
--- a/roofit/roofit/src/RooUnblindCPAsymVar.cxx
+++ b/roofit/roofit/src/RooUnblindCPAsymVar.cxx
@@ -37,6 +37,8 @@
 #include "RooUnblindCPAsymVar.h"
 
 
+using namespace std;
+
 ClassImp(RooUnblindCPAsymVar)
 ;
 
diff --git a/roofit/roofit/src/RooUnblindOffset.cxx b/roofit/roofit/src/RooUnblindOffset.cxx
index 4e663cc1691..efc26a071b0 100644
--- a/roofit/roofit/src/RooUnblindOffset.cxx
+++ b/roofit/roofit/src/RooUnblindOffset.cxx
@@ -37,6 +37,8 @@
 #include "RooUnblindOffset.h"
 
 
+using namespace std;
+
 ClassImp(RooUnblindOffset)
 ;
 
diff --git a/roofit/roofit/src/RooUnblindPrecision.cxx b/roofit/roofit/src/RooUnblindPrecision.cxx
index 3e989143bc1..f4508ea501d 100644
--- a/roofit/roofit/src/RooUnblindPrecision.cxx
+++ b/roofit/roofit/src/RooUnblindPrecision.cxx
@@ -37,6 +37,8 @@
 #include "RooUnblindPrecision.h"
 
 
+using namespace std;
+
 ClassImp(RooUnblindPrecision)
 ;
 
diff --git a/roofit/roofit/src/RooUnblindUniform.cxx b/roofit/roofit/src/RooUnblindUniform.cxx
index b8ab7037302..49dced00631 100644
--- a/roofit/roofit/src/RooUnblindUniform.cxx
+++ b/roofit/roofit/src/RooUnblindUniform.cxx
@@ -36,6 +36,8 @@
 #include "RooUnblindUniform.h"
 
 
+using namespace std;
+
 ClassImp(RooUnblindUniform)
 ;
 
diff --git a/roofit/roofit/src/RooUniform.cxx b/roofit/roofit/src/RooUniform.cxx
index 4e66888efe0..41632f6ffe6 100644
--- a/roofit/roofit/src/RooUniform.cxx
+++ b/roofit/roofit/src/RooUniform.cxx
@@ -33,6 +33,8 @@
 #include "RooMath.h"
 #include "RooArgSet.h"
 
+using namespace std;
+
 ClassImp(RooUniform)
 
 
diff --git a/roofit/roofit/src/RooVoigtian.cxx b/roofit/roofit/src/RooVoigtian.cxx
index 4cf7f18e48c..fc579219d32 100644
--- a/roofit/roofit/src/RooVoigtian.cxx
+++ b/roofit/roofit/src/RooVoigtian.cxx
@@ -39,6 +39,8 @@
 #include "RooComplex.h"
 #include "RooMath.h"
 
+using namespace std;
+
 ClassImp(RooVoigtian)
 
 
diff --git a/roofit/roofitcore/inc/LinkDef3.h b/roofit/roofitcore/inc/LinkDef3.h
index bd6df16d9e8..c16d3f79112 100644
--- a/roofit/roofitcore/inc/LinkDef3.h
+++ b/roofit/roofitcore/inc/LinkDef3.h
@@ -2,9 +2,9 @@
 #pragma link off all globals;
 #pragma link off all classes;
 #pragma link off all functions;
-#pragma link C++ class RooCacheManager<vector<double> >+ ;
-#pragma link C++ class list<RooAbsData*>+ ;
-#pragma link C++ class map<string,RooAbsData*>+ ;
+#pragma link C++ class RooCacheManager<std::vector<double> >+ ;
+#pragma link C++ class std::list<RooAbsData*>+ ;
+#pragma link C++ class std::map<string,RooAbsData*>+ ;
 #pragma link C++ class RooCacheManager<RooAbsCacheElement>+ ;
 #pragma link C++ class RooRandomizeParamMCSModule+ ;
 #pragma link C++ class RooRangeBinning+ ;
@@ -48,8 +48,8 @@
 #pragma link C++ class RooWorkspace- ;
 #pragma link C++ class RooWorkspace::CodeRepo- ;
 #pragma link C++ class RooWorkspace::WSDir+ ;
-#pragma link C++ class list<TObject*>+ ;
-#pragma link C++ class list<RooAbsData*>+ ;
+#pragma link C++ class std::list<TObject*>+ ;
+#pragma link C++ class std::list<RooAbsData*>+ ;
 #pragma link C++ class RooProfileLL+ ;
 #pragma link C++ class RooAbsCachedPdf+ ;
 #pragma link C++ class RooAbsSelfCachedPdf+ ;
@@ -114,7 +114,7 @@
 #pragma link C++ class RooVectorDataStore::RealFullVector- ;
 #pragma link C++ class RooVectorDataStore::CatVector- ;
 #pragma link C++ class std::pair<std::string,RooAbsData*>+ ;
-#pragma link C++ class pair<int,RooLinkedListElem*>+ ;
+#pragma link C++ class std::pair<int,RooLinkedListElem*>+ ;
 #pragma link C++ class RooUnitTest+ ;
 #ifndef __ROOFIT_NOROOMINIMIZER
 #pragma link C++ class RooMinimizer+ ;
@@ -126,11 +126,11 @@
 #pragma link C++ class RooAbsStudy+ ;
 #pragma link C++ class RooGenFitStudy+ ;
 #pragma link C++ class RooProofDriverSelector+ ;
-#pragma link C++ class list<RooAbsStudy*>+ ;
-#pragma link C++ class map<string,RooDataSet*>+ ;
-#pragma link C++ class map<string,RooDataHist*>+ ;
+#pragma link C++ class std::list<RooAbsStudy*>+ ;
+#pragma link C++ class std::map<string,RooDataSet*>+ ;
+#pragma link C++ class std::map<string,RooDataHist*>+ ;
 // The nomap options excludes the class from the roomap file
-#pragma link C++ options=nomap class map<string,TH1*>+ ;
+#pragma link C++ options=nomap class std::map<string,TH1*>+ ;
 #pragma link C++ namespace RooCintUtils+ ;
 #pragma link off class RooErrorHandler+ ;
 #pragma link off class RooNag+ ;
diff --git a/roofit/roofitcore/inc/Roo1DTable.h b/roofit/roofitcore/inc/Roo1DTable.h
index 55eb3c2eb7b..a9c49492261 100644
--- a/roofit/roofitcore/inc/Roo1DTable.h
+++ b/roofit/roofitcore/inc/Roo1DTable.h
@@ -40,11 +40,11 @@ public:
   Double_t getOverflow() const ;
 
   // Printing interface (human readable)
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
 
   inline virtual void Print(Option_t *options= 0) const {
diff --git a/roofit/roofitcore/inc/RooAbsAnaConvPdf.h b/roofit/roofitcore/inc/RooAbsAnaConvPdf.h
index 3d7765f23c1..5722ee6a874 100644
--- a/roofit/roofitcore/inc/RooAbsAnaConvPdf.h
+++ b/roofit/roofitcore/inc/RooAbsAnaConvPdf.h
@@ -44,7 +44,7 @@ public:
   virtual ~RooAbsAnaConvPdf();
 
   Int_t declareBasis(const char* expression, const RooArgList& params) ;
-  virtual void printMultiline(ostream& stream, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
+  virtual void printMultiline(std::ostream& stream, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
 
   // Coefficient normalization access
   inline Double_t getCoefNorm(Int_t coefIdx, const RooArgSet& nset, const char* rangeName) const { 
diff --git a/roofit/roofitcore/inc/RooAbsArg.h b/roofit/roofitcore/inc/RooAbsArg.h
index 56ca0979be6..2da16b4c5c0 100644
--- a/roofit/roofitcore/inc/RooAbsArg.h
+++ b/roofit/roofitcore/inc/RooAbsArg.h
@@ -68,7 +68,7 @@ public:
   virtual Bool_t isDerived() const { 
     // Does value or shape of this arg depend on any other arg?
     return kTRUE ;
-    //cout << IsA()->GetName() << "::isDerived(" << GetName() << ") = " << (_serverList.GetSize()>0 || _proxyList.GetSize()>0) << endl ;
+    //std::cout << IsA()->GetName() << "::isDerived(" << GetName() << ") = " << (_serverList.GetSize()>0 || _proxyList.GetSize()>0) << std::endl ;
     //return (_serverList.GetSize()>0 || _proxyList.GetSize()>0)?kTRUE:kFALSE; 
   }
   Bool_t isCloneOf(const RooAbsArg& other) const ; 
@@ -208,22 +208,22 @@ public:
   void attachDataStore(const RooAbsDataStore &set);
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) = 0 ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const = 0 ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) = 0 ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const = 0 ;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface (human readable)
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
   }
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printAddress(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printMetaArgs(ostream& /*os*/) const {} ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
-  virtual void printTree(ostream& os, TString indent="") const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printAddress(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printMetaArgs(std::ostream& /*os*/) const {} ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
+  virtual void printTree(std::ostream& os, TString indent="") const ;
 
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
 
@@ -238,7 +238,7 @@ public:
   void setStringAttribute(const Text_t* key, const Text_t* value) ;
   const Text_t* getStringAttribute(const Text_t* key) const ;
   inline const std::map<std::string,std::string>& stringAttributes() const { 
-    // Returns map<string,string> with all string attributes defined
+    // Returns std::map<string,string> with all string attributes defined
     return _stringAttrib ; 
   }
 
@@ -301,14 +301,14 @@ public:
   virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE) ;
   
   void graphVizTree(const char* fileName, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
-  void graphVizTree(ostream& os, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
+  void graphVizTree(std::ostream& os, const char* delimiter="\n", bool useTitle=false, bool useLatex=false) ;
 
 /*   TGraphStruct* graph(Bool_t useFactoryTag=kFALSE, Double_t textSize=0.03) ; */
 
   void printComponentTree(const char* indent="",const char* namePat=0, Int_t nLevel=999) ;
   void printCompactTree(const char* indent="",const char* fileName=0, const char* namePat=0, RooAbsArg* client=0) ;
-  void printCompactTree(ostream& os, const char* indent="", const char* namePat=0, RooAbsArg* client=0) ;
-  virtual void printCompactTreeHook(ostream& os, const char *ind="") ;
+  void printCompactTree(std::ostream& os, const char* indent="", const char* namePat=0, RooAbsArg* client=0) ;
+  virtual void printCompactTreeHook(std::ostream& os, const char *ind="") ;
 
   // Dirty state accessor
   inline Bool_t isShapeDirty() const { 
@@ -497,7 +497,7 @@ public:
   std::map<std::string,std::string> _stringAttrib ; // String attributes
   std::set<std::string> _boolAttribTransient ; //! Transient boolean attributes (not copied in ctor)
 
-  void printAttribList(ostream& os) const;
+  void printAttribList(std::ostream& os) const;
 
   // Hooks for RooTreeData interface
   friend class RooCompositeDataStore ;
@@ -518,8 +518,8 @@ public:
   TString cleanBranchName() const ;
 
   // Global   
-  friend ostream& operator<<(ostream& os, const RooAbsArg &arg);  
-  friend istream& operator>>(istream& is, RooAbsArg &arg) ;
+  friend std::ostream& operator<<(std::ostream& os, const RooAbsArg &arg);  
+  friend std::istream& operator>>(std::istream& is, RooAbsArg &arg) ;
 
   // Debug stuff
   static Bool_t _verboseDirty ; // Static flag controlling verbose messaging for dirty state changes
@@ -550,7 +550,7 @@ public:
   ClassDef(RooAbsArg,5) // Abstract variable
 };
 
-ostream& operator<<(ostream& os, const RooAbsArg &arg);  
-istream& operator>>(istream& is, RooAbsArg &arg) ;
+std::ostream& operator<<(std::ostream& os, const RooAbsArg &arg);  
+std::istream& operator>>(std::istream& is, RooAbsArg &arg) ;
 
 #endif
diff --git a/roofit/roofitcore/inc/RooAbsBinning.h b/roofit/roofitcore/inc/RooAbsBinning.h
index 4f09d6d4722..7e358f2b0c9 100644
--- a/roofit/roofitcore/inc/RooAbsBinning.h
+++ b/roofit/roofitcore/inc/RooAbsBinning.h
@@ -69,11 +69,11 @@ public:
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
   }
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
   
 
   virtual Bool_t isParameterized() const { 
diff --git a/roofit/roofitcore/inc/RooAbsCache.h b/roofit/roofitcore/inc/RooAbsCache.h
index 76eb9b4273a..797af722b06 100644
--- a/roofit/roofitcore/inc/RooAbsCache.h
+++ b/roofit/roofitcore/inc/RooAbsCache.h
@@ -35,7 +35,7 @@ public:
   virtual void operModeHook() ;
   virtual void optimizeCacheMode(const RooArgSet&, RooArgSet&, RooLinkedList& ) ;
   virtual void findConstantNodes(const RooArgSet&, RooArgSet& , RooLinkedList&) ;
-  virtual void printCompactTreeHook(ostream&, const char *) ;
+  virtual void printCompactTreeHook(std::ostream&, const char *) ;
   virtual void wireCache() {} ;
   
   virtual ~RooAbsCache() ;
diff --git a/roofit/roofitcore/inc/RooAbsCategory.h b/roofit/roofitcore/inc/RooAbsCategory.h
index 8e5eb205c83..b61f0a2ab9d 100644
--- a/roofit/roofitcore/inc/RooAbsCategory.h
+++ b/roofit/roofitcore/inc/RooAbsCategory.h
@@ -64,11 +64,11 @@ public:
   Roo1DTable *createTable(const char *label) const ;
 
   // I/O streaming interface
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
-  virtual void printValue(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual Bool_t isIntegrationSafeLValue(const RooArgSet* /*set*/) const { 
     // Is this l-value object safe for use as integration observable
diff --git a/roofit/roofitcore/inc/RooAbsCategoryLValue.h b/roofit/roofitcore/inc/RooAbsCategoryLValue.h
index 0a563fb39b5..e2ecfd26896 100644
--- a/roofit/roofitcore/inc/RooAbsCategoryLValue.h
+++ b/roofit/roofitcore/inc/RooAbsCategoryLValue.h
@@ -66,8 +66,8 @@ public:
   }
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooAbsCollection.h b/roofit/roofitcore/inc/RooAbsCollection.h
index 9ad9443f80c..751449ebb0c 100644
--- a/roofit/roofitcore/inc/RooAbsCollection.h
+++ b/roofit/roofitcore/inc/RooAbsCollection.h
@@ -119,11 +119,11 @@ public:
   std::string contentsString() const ;
 
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
 
@@ -132,7 +132,7 @@ public:
 		  const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(),	
 		  const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(),	
 		  const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg()) const ;
-  void printLatex(ostream& ofs, Int_t ncol, const char* option="NEYU", Int_t sigDigit=1, 
+  void printLatex(std::ostream& ofs, Int_t ncol, const char* option="NEYU", Int_t sigDigit=1, 
                   const RooLinkedList& siblingLists=RooLinkedList(), const RooCmdArg* formatCmd=0) const ;
 
   void setName(const char *name) {
diff --git a/roofit/roofitcore/inc/RooAbsData.h b/roofit/roofitcore/inc/RooAbsData.h
index 7acb7bcd779..15b0d6a2054 100644
--- a/roofit/roofitcore/inc/RooAbsData.h
+++ b/roofit/roofitcore/inc/RooAbsData.h
@@ -158,10 +158,10 @@ public:
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
   }
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
 
diff --git a/roofit/roofitcore/inc/RooAbsDataStore.h b/roofit/roofitcore/inc/RooAbsDataStore.h
index 5cd68cd5f1f..6f338526e93 100644
--- a/roofit/roofitcore/inc/RooAbsDataStore.h
+++ b/roofit/roofitcore/inc/RooAbsDataStore.h
@@ -85,12 +85,12 @@ public:
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
   }
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
-  void printMultiline(ostream& os, Int_t content, Bool_t verbose, TString indent) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t content, Bool_t verbose, TString indent) const ;
 
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
    
diff --git a/roofit/roofitcore/inc/RooAbsGenContext.h b/roofit/roofitcore/inc/RooAbsGenContext.h
index c5f8e22a470..b987011dc9b 100644
--- a/roofit/roofitcore/inc/RooAbsGenContext.h
+++ b/roofit/roofitcore/inc/RooAbsGenContext.h
@@ -54,11 +54,11 @@ public:
 
   virtual void attach(const RooArgSet& params) ;
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
 
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
   virtual StyleOption defaultPrintStyle(Option_t* opt) const ;
diff --git a/roofit/roofitcore/inc/RooAbsHiddenReal.h b/roofit/roofitcore/inc/RooAbsHiddenReal.h
index 63e85b7a52b..209d070151a 100644
--- a/roofit/roofitcore/inc/RooAbsHiddenReal.h
+++ b/roofit/roofitcore/inc/RooAbsHiddenReal.h
@@ -34,11 +34,11 @@ public:
   virtual ~RooAbsHiddenReal();
   
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
-  virtual void printValue(ostream& stream) const ;
+  virtual void printValue(std::ostream& stream) const ;
   
   inline Bool_t isHidden() const { 
     // If true, hiding mode is active
diff --git a/roofit/roofitcore/inc/RooAbsNumGenerator.h b/roofit/roofitcore/inc/RooAbsNumGenerator.h
index 7a69fd9e3a0..363608a26fb 100644
--- a/roofit/roofitcore/inc/RooAbsNumGenerator.h
+++ b/roofit/roofitcore/inc/RooAbsNumGenerator.h
@@ -57,10 +57,10 @@ public:
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
   }
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
   
   void attachParameters(const RooArgSet& vars) ;
 
diff --git a/roofit/roofitcore/inc/RooAbsOptTestStatistic.h b/roofit/roofitcore/inc/RooAbsOptTestStatistic.h
index 7c45acf71b5..482fcda3278 100644
--- a/roofit/roofitcore/inc/RooAbsOptTestStatistic.h
+++ b/roofit/roofitcore/inc/RooAbsOptTestStatistic.h
@@ -68,7 +68,7 @@ protected:
   void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTrackingOpt=kTRUE) ;
 
   virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
-  virtual void printCompactTreeHook(ostream& os, const char* indent="") ;
+  virtual void printCompactTreeHook(std::ostream& os, const char* indent="") ;
   virtual RooArgSet requiredExtraObservables() const { return RooArgSet() ; }
   void optimizeCaching() ;
   void optimizeConstantTerms(Bool_t,Bool_t=kTRUE) ;
diff --git a/roofit/roofitcore/inc/RooAbsPdf.h b/roofit/roofitcore/inc/RooAbsPdf.h
index 8da267e13e8..0e94b12e38a 100644
--- a/roofit/roofitcore/inc/RooAbsPdf.h
+++ b/roofit/roofitcore/inc/RooAbsPdf.h
@@ -232,8 +232,8 @@ public:
   }
 
   // Printing interface (human readable)
-  virtual void printValue(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   static void verboseEval(Int_t stat) ;
   static int verboseEval() ;
diff --git a/roofit/roofitcore/inc/RooAbsProxy.h b/roofit/roofitcore/inc/RooAbsProxy.h
index ded2c72799d..f6118e324f2 100644
--- a/roofit/roofitcore/inc/RooAbsProxy.h
+++ b/roofit/roofitcore/inc/RooAbsProxy.h
@@ -48,7 +48,7 @@ public:
     // Return normalization set to be used for evaluation of contents
     return _nset ; 
   }
-  virtual void print(ostream& os, Bool_t addContents=kFALSE) const ;
+  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooAbsReal.h b/roofit/roofitcore/inc/RooAbsReal.h
index 55f3900844e..c9a7c208990 100644
--- a/roofit/roofitcore/inc/RooAbsReal.h
+++ b/roofit/roofitcore/inc/RooAbsReal.h
@@ -62,7 +62,7 @@ public:
 
   // Return value and unit accessors
   inline Double_t getVal(const RooArgSet* set=0) const { 
-/*    if (_fast && !_inhibitDirty) cout << "RooAbsReal::getVal(" << GetName() << ") CLEAN value = " << _value << endl ;  */
+/*    if (_fast && !_inhibitDirty) std::cout << "RooAbsReal::getVal(" << GetName() << ") CLEAN value = " << _value << std::endl ;  */
 #ifndef _WIN32
     return (_fast && !_inhibitDirty) ? _value : getValV(set) ; 
 #else
@@ -235,12 +235,12 @@ public:
 			    Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
-  virtual void printValue(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   static void setCacheCheck(Bool_t flag) ;
 
@@ -260,7 +260,7 @@ public:
   static void setEvalErrorLoggingMode(ErrorLoggingMode m) ;
   void logEvalError(const char* message, const char* serverValueString=0) const ;
   static void logEvalError(const RooAbsReal* originator, const char* origName, const char* message, const char* serverValueString=0) ;
-  static void printEvalErrors(ostream&os=std::cout, Int_t maxPerNode=10000000) ;
+  static void printEvalErrors(std::ostream&os=std::cout, Int_t maxPerNode=10000000) ;
   static Int_t numEvalErrors() ;
   static Int_t numEvalErrorItems() ;
 
diff --git a/roofit/roofitcore/inc/RooAbsRealLValue.h b/roofit/roofitcore/inc/RooAbsRealLValue.h
index b8b335bfae3..24798e1ba12 100644
--- a/roofit/roofitcore/inc/RooAbsRealLValue.h
+++ b/roofit/roofitcore/inc/RooAbsRealLValue.h
@@ -90,11 +90,11 @@ public:
   inline void setConstant(Bool_t value= kTRUE) { setAttribute("Constant",value); setValueDirty() ; setShapeDirty() ; }
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   
   // Build 1-dimensional plots
diff --git a/roofit/roofitcore/inc/RooAbsString.h b/roofit/roofitcore/inc/RooAbsString.h
index 02db999965b..7a7e9667f18 100644
--- a/roofit/roofitcore/inc/RooAbsString.h
+++ b/roofit/roofitcore/inc/RooAbsString.h
@@ -37,11 +37,11 @@ public:
   virtual Bool_t operator==(const RooAbsArg& other) ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
-  virtual void printValue(ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
 
 
   RooAbsArg *createFundamental(const char* newname=0) const;
diff --git a/roofit/roofitcore/inc/RooAbsTestStatistic.h b/roofit/roofitcore/inc/RooAbsTestStatistic.h
index 4d79d010a24..71efc605a0d 100644
--- a/roofit/roofitcore/inc/RooAbsTestStatistic.h
+++ b/roofit/roofitcore/inc/RooAbsTestStatistic.h
@@ -59,7 +59,7 @@ public:
 
 protected:
 
-  virtual void printCompactTreeHook(ostream& os, const char* indent="") ;
+  virtual void printCompactTreeHook(std::ostream& os, const char* indent="") ;
 
   virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
   virtual Double_t evaluate() const ;
diff --git a/roofit/roofitcore/inc/RooAddGenContext.h b/roofit/roofitcore/inc/RooAddGenContext.h
index ca2b6cee17d..79311f479d2 100644
--- a/roofit/roofitcore/inc/RooAddGenContext.h
+++ b/roofit/roofitcore/inc/RooAddGenContext.h
@@ -42,7 +42,7 @@ public:
 
   virtual void attach(const RooArgSet& params) ;
 
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooAddModel.h b/roofit/roofitcore/inc/RooAddModel.h
index f8f50aa1940..1350ec4ea62 100644
--- a/roofit/roofitcore/inc/RooAddModel.h
+++ b/roofit/roofitcore/inc/RooAddModel.h
@@ -81,7 +81,7 @@ public:
   void fixCoefRange(const char* rangeName) ;
   virtual void resetErrorCounters(Int_t resetValue=10) ;
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooAddPdf.h b/roofit/roofitcore/inc/RooAddPdf.h
index 8b0ec12495a..4e67db7115e 100644
--- a/roofit/roofitcore/inc/RooAddPdf.h
+++ b/roofit/roofitcore/inc/RooAddPdf.h
@@ -86,7 +86,7 @@ public:
   virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
   Bool_t isBinnedDistribution(const RooArgSet& obs) const  ;
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooAddition.h b/roofit/roofitcore/inc/RooAddition.h
index 224ea121b46..e49133bc852 100644
--- a/roofit/roofitcore/inc/RooAddition.h
+++ b/roofit/roofitcore/inc/RooAddition.h
@@ -36,7 +36,7 @@ public:
 
   virtual Double_t defaultErrorLevel() const ;
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   const RooArgList& list1() const { return _set ; }
   const RooArgList& list() const { return _set ; }
diff --git a/roofit/roofitcore/inc/RooArgList.h b/roofit/roofitcore/inc/RooArgList.h
index 1b6c94ed7e8..284f37379ba 100644
--- a/roofit/roofitcore/inc/RooArgList.h
+++ b/roofit/roofitcore/inc/RooArgList.h
@@ -88,8 +88,8 @@ public:
   }
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) ;  
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) ;  
 
   RooAbsArg& operator[](Int_t idx) const ; 
 
diff --git a/roofit/roofitcore/inc/RooArgProxy.h b/roofit/roofitcore/inc/RooArgProxy.h
index f71a539db24..f9deaaaf0c7 100644
--- a/roofit/roofitcore/inc/RooArgProxy.h
+++ b/roofit/roofitcore/inc/RooArgProxy.h
@@ -43,7 +43,7 @@ public:
     // Return name of proxy
     return GetName() ; 
   }
-  virtual void print(ostream& os, Bool_t addContents=kFALSE) const ;
+  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooArgSet.h b/roofit/roofitcore/inc/RooArgSet.h
index 63e62cf5e16..5d9f3ecfefa 100644
--- a/roofit/roofitcore/inc/RooArgSet.h
+++ b/roofit/roofitcore/inc/RooArgSet.h
@@ -103,12 +103,12 @@ public:
 
   RooAbsArg& operator[](const char* name) const ;   
 
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) {
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) {
     // I/O streaming interface (machine readable)
     return readFromStream(is, compact, 0, 0, verbose) ;
   }
-  Bool_t readFromStream(istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact, const char* section=0) const;  
+  Bool_t readFromStream(std::istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact, const char* section=0) const;  
   void writeToFile(const char* fileName) const ;
   Bool_t readFromFile(const char* fileName, const char* flagReadAtt=0, const char* section=0, Bool_t verbose=kFALSE) ;
 
diff --git a/roofit/roofitcore/inc/RooBinnedGenContext.h b/roofit/roofitcore/inc/RooBinnedGenContext.h
index c17c5afe72a..8862f3b9a60 100644
--- a/roofit/roofitcore/inc/RooBinnedGenContext.h
+++ b/roofit/roofitcore/inc/RooBinnedGenContext.h
@@ -39,7 +39,7 @@ public:
 
   virtual void attach(const RooArgSet& params) ;
 
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual void setExpectedData(Bool_t) ;
 
diff --git a/roofit/roofitcore/inc/RooBinningCategory.h b/roofit/roofitcore/inc/RooBinningCategory.h
index da4908090a2..2ccb7b50198 100644
--- a/roofit/roofitcore/inc/RooBinningCategory.h
+++ b/roofit/roofitcore/inc/RooBinningCategory.h
@@ -32,7 +32,7 @@ public:
   virtual ~RooBinningCategory();
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
 protected:
   
diff --git a/roofit/roofitcore/inc/RooCacheManager.h b/roofit/roofitcore/inc/RooCacheManager.h
index a1842f64bd3..a75948813d8 100644
--- a/roofit/roofitcore/inc/RooCacheManager.h
+++ b/roofit/roofitcore/inc/RooCacheManager.h
@@ -167,7 +167,7 @@ RooCacheManager<T>::RooCacheManager(const RooCacheManager& other, RooAbsArg* own
   _wired = kFALSE ;
   _lastIndex = -1 ;
 
-//   cout << "RooCacheManager:cctor(" << this << ")" << std::endl ;
+//   std::cout << "RooCacheManager:cctor(" << this << ")" << std::endl ;
 
   Int_t i ;
   for (i=0 ; i<other._size ; i++) {    
diff --git a/roofit/roofitcore/inc/RooCatType.h b/roofit/roofitcore/inc/RooCatType.h
index 49f9fe2eb0e..181a3807734 100644
--- a/roofit/roofitcore/inc/RooCatType.h
+++ b/roofit/roofitcore/inc/RooCatType.h
@@ -86,10 +86,10 @@ public:
   _value = newValue ; 
   }
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
   
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface
diff --git a/roofit/roofitcore/inc/RooCategory.h b/roofit/roofitcore/inc/RooCategory.h
index ed69fe90c54..1480891a627 100644
--- a/roofit/roofitcore/inc/RooCategory.h
+++ b/roofit/roofitcore/inc/RooCategory.h
@@ -49,8 +49,8 @@ public:
   virtual Bool_t setLabel(const char* label, Bool_t printError=kTRUE) ;
   
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // We implement a fundamental type of AbsArg that can be stored in a dataset
   inline virtual Bool_t isFundamental() const { 
diff --git a/roofit/roofitcore/inc/RooComplex.h b/roofit/roofitcore/inc/RooComplex.h
index 9840198dccd..b67db6b9eb7 100644
--- a/roofit/roofitcore/inc/RooComplex.h
+++ b/roofit/roofitcore/inc/RooComplex.h
@@ -98,6 +98,6 @@ private:
 };
 
 // output formatting
-ostream& operator<<(ostream& os, const RooComplex& z);
+std::ostream& operator<<(std::ostream& os, const RooComplex& z);
 
 #endif
diff --git a/roofit/roofitcore/inc/RooConstVar.h b/roofit/roofitcore/inc/RooConstVar.h
index 035824517dd..4f58b3e2f35 100644
--- a/roofit/roofitcore/inc/RooConstVar.h
+++ b/roofit/roofitcore/inc/RooConstVar.h
@@ -34,7 +34,7 @@ public:
   virtual ~RooConstVar();
 
   virtual Double_t getValV(const RooArgSet* set=0) const ;
-  void writeToStream(ostream& os, Bool_t compact) const ;
+  void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   virtual Bool_t isDerived() const { 
     // Does value or shape of this arg depend on any other arg?
diff --git a/roofit/roofitcore/inc/RooConvGenContext.h b/roofit/roofitcore/inc/RooConvGenContext.h
index fee75239d79..d48eee2538f 100644
--- a/roofit/roofitcore/inc/RooConvGenContext.h
+++ b/roofit/roofitcore/inc/RooConvGenContext.h
@@ -43,7 +43,7 @@ public:
 
   virtual void attach(const RooArgSet& params) ;
 
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
 
 protected:
diff --git a/roofit/roofitcore/inc/RooCurve.h b/roofit/roofitcore/inc/RooCurve.h
index 286d5a78d55..d344ddf3b9f 100644
--- a/roofit/roofitcore/inc/RooCurve.h
+++ b/roofit/roofitcore/inc/RooCurve.h
@@ -51,10 +51,10 @@ public:
   Double_t getFitRangeNEvt() const;
 
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface
diff --git a/roofit/roofitcore/inc/RooCustomizer.h b/roofit/roofitcore/inc/RooCustomizer.h
index d0c22ef7748..2cb1c5dd3c6 100644
--- a/roofit/roofitcore/inc/RooCustomizer.h
+++ b/roofit/roofitcore/inc/RooCustomizer.h
@@ -59,11 +59,11 @@ public:
   }
 
   // Printing interface 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent= "") const;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent= "") const;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface
diff --git a/roofit/roofitcore/inc/RooDataHist.h b/roofit/roofitcore/inc/RooDataHist.h
index 3d43be9a961..70d79e5ddff 100644
--- a/roofit/roofitcore/inc/RooDataHist.h
+++ b/roofit/roofitcore/inc/RooDataHist.h
@@ -116,9 +116,9 @@ public:
   virtual void reset() ;
   void dump2() ;
 
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
 
   void SetName(const char *name) ;
   void SetNameTitle(const char *name, const char* title) ;
diff --git a/roofit/roofitcore/inc/RooDataSet.h b/roofit/roofitcore/inc/RooDataSet.h
index fd498d863b1..a599a1dd821 100644
--- a/roofit/roofitcore/inc/RooDataSet.h
+++ b/roofit/roofitcore/inc/RooDataSet.h
@@ -121,9 +121,9 @@ public:
   TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, Int_t nx, Int_t ny,
                         const char* cuts="", const char *name="hist") const;
 
-  void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
 
   void SetName(const char *name) ;
   void SetNameTitle(const char *name, const char* title) ;
diff --git a/roofit/roofitcore/inc/RooEllipse.h b/roofit/roofitcore/inc/RooEllipse.h
index 3b610f20b99..e6be5fb06c5 100644
--- a/roofit/roofitcore/inc/RooEllipse.h
+++ b/roofit/roofitcore/inc/RooEllipse.h
@@ -26,10 +26,10 @@ public:
   virtual ~RooEllipse();
 
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface
diff --git a/roofit/roofitcore/inc/RooErrorVar.h b/roofit/roofitcore/inc/RooErrorVar.h
index 76d44ef6db7..06a4af3db31 100644
--- a/roofit/roofitcore/inc/RooErrorVar.h
+++ b/roofit/roofitcore/inc/RooErrorVar.h
@@ -55,8 +55,8 @@ public:
   }
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Set/get finite fit range limits
   inline void setMin(Double_t value) { 
diff --git a/roofit/roofitcore/inc/RooFFTConvPdf.h b/roofit/roofitcore/inc/RooFFTConvPdf.h
index b21954a022e..7c6ea7af00d 100644
--- a/roofit/roofitcore/inc/RooFFTConvPdf.h
+++ b/roofit/roofitcore/inc/RooFFTConvPdf.h
@@ -55,7 +55,7 @@ public:
   void setBufferStrategy(BufStrat bs) ;
   void setBufferFraction(Double_t frac) ;
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   // Propagate maximum value estimate of pdf1 as convolution can only result in lower max values
   virtual Int_t getMaxVal(const RooArgSet& vars) const { return _pdf1.arg().getMaxVal(vars) ; }
diff --git a/roofit/roofitcore/inc/RooFitResult.h b/roofit/roofitcore/inc/RooFitResult.h
index 6e517f6e241..6535a22e62c 100644
--- a/roofit/roofitcore/inc/RooFitResult.h
+++ b/roofit/roofitcore/inc/RooFitResult.h
@@ -55,12 +55,12 @@ public:
   static RooFitResult* lastMinuitFit(const RooArgList& varList=RooArgList()) ;
 
   // Printing interface (human readable)
-  virtual void printValue(ostream& os) const ;
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface
diff --git a/roofit/roofitcore/inc/RooFormula.h b/roofit/roofitcore/inc/RooFormula.h
index 9f3efd4ffae..4ba41f9c6b5 100644
--- a/roofit/roofitcore/inc/RooFormula.h
+++ b/roofit/roofitcore/inc/RooFormula.h
@@ -55,12 +55,12 @@ public:
   Bool_t reCompile(const char* newFormula) ;
 
 
-  virtual void printValue(ostream& os) const ;
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface (human readable)
diff --git a/roofit/roofitcore/inc/RooFormulaVar.h b/roofit/roofitcore/inc/RooFormulaVar.h
index b719e0e26f4..275fddbc587 100644
--- a/roofit/roofitcore/inc/RooFormulaVar.h
+++ b/roofit/roofitcore/inc/RooFormulaVar.h
@@ -45,12 +45,12 @@ public:
   }
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
-  void printMetaArgs(ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   // Debugging
   void dumpFormula() { formula().dump() ; }
diff --git a/roofit/roofitcore/inc/RooGenCategory.h b/roofit/roofitcore/inc/RooGenCategory.h
index 9173eedb5ac..cc71f3ba63a 100644
--- a/roofit/roofitcore/inc/RooGenCategory.h
+++ b/roofit/roofitcore/inc/RooGenCategory.h
@@ -38,11 +38,11 @@ public:
   virtual ~RooGenCategory();
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent= "") const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent= "") const ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooGenContext.h b/roofit/roofitcore/inc/RooGenContext.h
index f6518ca1dcf..11f7dc77df1 100644
--- a/roofit/roofitcore/inc/RooGenContext.h
+++ b/roofit/roofitcore/inc/RooGenContext.h
@@ -33,7 +33,7 @@ public:
 		const RooArgSet* auxProto=0, Bool_t verbose=kFALSE, const RooArgSet* forceDirect=0);
   virtual ~RooGenContext();
 
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual void attach(const RooArgSet& params) ;
 
diff --git a/roofit/roofitcore/inc/RooGenericPdf.h b/roofit/roofitcore/inc/RooGenericPdf.h
index b3b7c8d9506..24bc10e512b 100644
--- a/roofit/roofitcore/inc/RooGenericPdf.h
+++ b/roofit/roofitcore/inc/RooGenericPdf.h
@@ -33,12 +33,12 @@ public:
   virtual ~RooGenericPdf();
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
-  void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
-  void printMetaArgs(ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   // Debugging
   void dumpFormula() { formula().dump() ; }
diff --git a/roofit/roofitcore/inc/RooGlobalFunc.h b/roofit/roofitcore/inc/RooGlobalFunc.h
index fd813b5275c..cf134ee5faa 100644
--- a/roofit/roofitcore/inc/RooGlobalFunc.h
+++ b/roofit/roofitcore/inc/RooGlobalFunc.h
@@ -255,7 +255,7 @@ RooCmdArg ObjectName(const char* name) ;
 RooCmdArg ClassName(const char* name) ;
 RooCmdArg BaseClassName(const char* name) ;
 RooCmdArg TagName(const char* name) ;
-RooCmdArg OutputStream(ostream& os) ;
+RooCmdArg OutputStream(std::ostream& os) ;
 RooCmdArg Prefix(Bool_t flag) ;
 RooCmdArg Color(Color_t color) ;
 
diff --git a/roofit/roofitcore/inc/RooGrid.h b/roofit/roofitcore/inc/RooGrid.h
index 1f984337f01..09c6375981b 100644
--- a/roofit/roofitcore/inc/RooGrid.h
+++ b/roofit/roofitcore/inc/RooGrid.h
@@ -28,10 +28,10 @@ public:
   virtual ~RooGrid();
 
   // Printing interface
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const;
 
   inline virtual void Print(Option_t *options= 0) const {
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
diff --git a/roofit/roofitcore/inc/RooHist.h b/roofit/roofitcore/inc/RooHist.h
index d7d0b6a1cb4..8a9ead548be 100644
--- a/roofit/roofitcore/inc/RooHist.h
+++ b/roofit/roofitcore/inc/RooHist.h
@@ -53,10 +53,10 @@ public:
   // add a datapoint for the efficiency (n1)/(n1+n2), using a sum-of-weights error
   void addEfficiencyBinWithError(Axis_t binCenter, Double_t n1, Double_t n2, Double_t en1, Double_t en2, Double_t binWidth= 0, Double_t xErrorFrac=1.0, Double_t scaleFactor=1.0);
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent= "") const;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent= "") const;
 
   inline virtual void Print(Option_t *options= 0) const {
     // Printing interface
diff --git a/roofit/roofitcore/inc/RooLinearVar.h b/roofit/roofitcore/inc/RooLinearVar.h
index c032ed99338..b3f56f68ac1 100644
--- a/roofit/roofitcore/inc/RooLinearVar.h
+++ b/roofit/roofitcore/inc/RooLinearVar.h
@@ -48,8 +48,8 @@ public:
   virtual Bool_t isJacobianOK(const RooArgSet& depList) const ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // Printing interface (human readable)
 
diff --git a/roofit/roofitcore/inc/RooListProxy.h b/roofit/roofitcore/inc/RooListProxy.h
index b8f918f7dbe..f47a4955c5d 100644
--- a/roofit/roofitcore/inc/RooListProxy.h
+++ b/roofit/roofitcore/inc/RooListProxy.h
@@ -47,7 +47,7 @@ public:
 
   RooListProxy& operator=(const RooArgList& other) ;
 
-  virtual void print(ostream& os, Bool_t addContents=kFALSE) const ;
+  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
   
 protected:
     
diff --git a/roofit/roofitcore/inc/RooMappedCategory.h b/roofit/roofitcore/inc/RooMappedCategory.h
index ad1cdc23417..4343706ce3c 100644
--- a/roofit/roofitcore/inc/RooMappedCategory.h
+++ b/roofit/roofitcore/inc/RooMappedCategory.h
@@ -38,12 +38,12 @@ public:
   Bool_t map(const char* inKeyRegExp, const char* outKeyName, Int_t outKeyNum=NoCatIdx) ; 
 
   // Printing interface (human readable)
-  void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
-  void printMetaArgs(ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
 
   class Entry {
diff --git a/roofit/roofitcore/inc/RooMinimizer.h b/roofit/roofitcore/inc/RooMinimizer.h
index 5dd382e0909..14cb6963267 100644
--- a/roofit/roofitcore/inc/RooMinimizer.h
+++ b/roofit/roofitcore/inc/RooMinimizer.h
@@ -88,7 +88,7 @@ protected:
   void profileStop() ;
 
   inline Int_t getNPar() const { return _fcn->NDim() ; }
-  inline ofstream* logfile() const { return _fcn->GetLogFile(); }
+  inline std::ofstream* logfile() const { return _fcn->GetLogFile(); }
   inline Double_t& maxFCN() { return _fcn->GetMaxFCN() ; }
 
 private:
diff --git a/roofit/roofitcore/inc/RooMinimizerFcn.h b/roofit/roofitcore/inc/RooMinimizerFcn.h
index 03bb720f085..187ca29e51c 100644
--- a/roofit/roofitcore/inc/RooMinimizerFcn.h
+++ b/roofit/roofitcore/inc/RooMinimizerFcn.h
@@ -49,7 +49,7 @@ class RooMinimizerFcn : public ROOT::Math::IBaseFunctionMultiDim {
   void SetEvalErrorWall(Bool_t flag) { _doEvalErrorWall = flag ; }
   void SetPrintEvalErrors(Int_t numEvalErrors) { _printEvalErrors = numEvalErrors ; }
   Bool_t SetLogFile(const char* inLogfile);
-  ofstream* GetLogFile() { return _logfile; }
+  std::ofstream* GetLogFile() { return _logfile; }
   void SetVerbose(Bool_t flag=kTRUE) { _verbose = flag ; }
 
   Double_t& GetMaxFCN() { return _maxFCN; }
@@ -85,7 +85,7 @@ private:
   Bool_t _doEvalErrorWall;
 
   int _nDim;
-  ofstream *_logfile;
+  std::ofstream *_logfile;
   bool _verbose;
 
   RooArgList* _floatParamList;
diff --git a/roofit/roofitcore/inc/RooMinuit.h b/roofit/roofitcore/inc/RooMinuit.h
index 22b0b83cde4..55edcc3aced 100644
--- a/roofit/roofitcore/inc/RooMinuit.h
+++ b/roofit/roofitcore/inc/RooMinuit.h
@@ -93,7 +93,7 @@ protected:
   void backProp() ;
 
   inline Int_t getNPar() const { return _nPar ; }
-  inline ofstream* logfile() const { return _logfile ; }
+  inline std::ofstream* logfile() const { return _logfile ; }
   inline Double_t& maxFCN() { return _maxFCN ; }
 
   Double_t getPdfParamVal(Int_t index) ;
@@ -129,7 +129,7 @@ private:
   RooAbsReal* _func ;
 
   Double_t    _maxFCN ;  
-  ofstream*   _logfile ;
+  std::ofstream*   _logfile ;
   Bool_t      _verbose ;
   TStopwatch  _timer ;
   TStopwatch  _cumulTimer ;
diff --git a/roofit/roofitcore/inc/RooMsgService.h b/roofit/roofitcore/inc/RooMsgService.h
index 66da1aae5db..6ed6bee4f68 100644
--- a/roofit/roofitcore/inc/RooMsgService.h
+++ b/roofit/roofitcore/inc/RooMsgService.h
@@ -136,7 +136,7 @@ public:
     Color_t color ;
     Bool_t prefix ;
     
-    ostream* os ;
+    std::ostream* os ;
 
   } ;
 
@@ -163,8 +163,8 @@ public:
   void showPid(Bool_t flag) { _showPid = flag ; }
 
   // Back end -- Send message or check if particular logging configuration is active
-  ostream& log(const RooAbsArg* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix=kFALSE) ;
-  ostream& log(const TObject* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix=kFALSE) ;
+  std::ostream& log(const RooAbsArg* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix=kFALSE) ;
+  std::ostream& log(const TObject* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix=kFALSE) ;
   Bool_t isActive(const RooAbsArg* self, RooFit::MsgTopic facility, RooFit::MsgLevel level) ;
   Bool_t isActive(const TObject* self, RooFit::MsgTopic facility, RooFit::MsgLevel level) ;
 
diff --git a/roofit/roofitcore/inc/RooMultiCategory.h b/roofit/roofitcore/inc/RooMultiCategory.h
index ba7a4855bc0..f0b53e84c48 100644
--- a/roofit/roofitcore/inc/RooMultiCategory.h
+++ b/roofit/roofitcore/inc/RooMultiCategory.h
@@ -33,11 +33,11 @@ public:
   virtual ~RooMultiCategory();
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   const RooArgSet& inputCatList() const { return _catSet ; }
 
diff --git a/roofit/roofitcore/inc/RooNameSet.h b/roofit/roofitcore/inc/RooNameSet.h
index 30c13c30578..b796090c24c 100644
--- a/roofit/roofitcore/inc/RooNameSet.h
+++ b/roofit/roofitcore/inc/RooNameSet.h
@@ -36,10 +36,10 @@ public:
   Bool_t operator==(const RooNameSet& other) ;  
   RooNameSet& operator=(const RooNameSet&) ;
 
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
 
   inline virtual void Print(Option_t *options= 0) const {
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
diff --git a/roofit/roofitcore/inc/RooNumConvPdf.h b/roofit/roofitcore/inc/RooNumConvPdf.h
index 69a5364c95f..e279cfa2f5d 100644
--- a/roofit/roofitcore/inc/RooNumConvPdf.h
+++ b/roofit/roofitcore/inc/RooNumConvPdf.h
@@ -53,7 +53,7 @@ public:
   RooAbsReal&  pdf() const { return const_cast<RooAbsReal&>(_origPdf.arg()) ; }
   RooAbsReal&  model() const { return const_cast<RooAbsReal&>(_origModel.arg()) ; }
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooNumConvolution.h b/roofit/roofitcore/inc/RooNumConvolution.h
index 3bb2b36721d..37fe497b152 100644
--- a/roofit/roofitcore/inc/RooNumConvolution.h
+++ b/roofit/roofitcore/inc/RooNumConvolution.h
@@ -64,7 +64,7 @@ protected:
   void initialize() const ;
   Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
 
-  virtual void printCompactTreeHook(ostream& os, const char* indent="") ;
+  virtual void printCompactTreeHook(std::ostream& os, const char* indent="") ;
 
   RooNumIntConfig _convIntConfig ; // Configuration of numeric convolution integral ;
   mutable RooConvIntegrandBinding* _integrand ; //! Binding of Convolution Integrand function
diff --git a/roofit/roofitcore/inc/RooNumGenConfig.h b/roofit/roofitcore/inc/RooNumGenConfig.h
index 64a1834c56f..8beb8975da3 100644
--- a/roofit/roofitcore/inc/RooNumGenConfig.h
+++ b/roofit/roofitcore/inc/RooNumGenConfig.h
@@ -45,7 +45,7 @@ public:
   const RooArgSet& getConfigSection(const char* name) const ;
   RooArgSet& getConfigSection(const char* name) ;
 
-  void printMultiline(ostream &os, Int_t content, Bool_t verbose, TString indent= "") const;
+  void printMultiline(std::ostream &os, Int_t content, Bool_t verbose, TString indent= "") const;
 
   inline virtual void Print(Option_t *options= 0) const {
     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
diff --git a/roofit/roofitcore/inc/RooNumIntConfig.h b/roofit/roofitcore/inc/RooNumIntConfig.h
index ab5bc98a954..1da3baa35a9 100644
--- a/roofit/roofitcore/inc/RooNumIntConfig.h
+++ b/roofit/roofitcore/inc/RooNumIntConfig.h
@@ -63,7 +63,7 @@ public:
   const RooArgSet& getConfigSection(const char* name) const ;
   RooArgSet& getConfigSection(const char* name) ;
 
-  void printMultiline(ostream &os, Int_t content, Bool_t verbose, TString indent= "") const;
+  void printMultiline(std::ostream &os, Int_t content, Bool_t verbose, TString indent= "") const;
 
   virtual StyleOption defaultPrintStyle(Option_t* opt) const ; 
   inline virtual void Print(Option_t *options= 0) const {
diff --git a/roofit/roofitcore/inc/RooParamBinning.h b/roofit/roofitcore/inc/RooParamBinning.h
index 55415ca2971..49cbe6ecd29 100644
--- a/roofit/roofitcore/inc/RooParamBinning.h
+++ b/roofit/roofitcore/inc/RooParamBinning.h
@@ -47,7 +47,7 @@ public:
   virtual Double_t averageBinWidth() const { return _binw ; }
   virtual Double_t* array() const ;
 
-  void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual void insertHook(RooAbsRealLValue&) const  ;
   virtual void removeHook(RooAbsRealLValue&) const  ;
diff --git a/roofit/roofitcore/inc/RooPlot.h b/roofit/roofitcore/inc/RooPlot.h
index 355ee5ae9d0..a34399b2f1f 100644
--- a/roofit/roofitcore/inc/RooPlot.h
+++ b/roofit/roofitcore/inc/RooPlot.h
@@ -115,12 +115,12 @@ public:
   void remove(const char* name=0, Bool_t deleteToo=kTRUE) ;
 
   // ascii printing
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
 
diff --git a/roofit/roofitcore/inc/RooPlotable.h b/roofit/roofitcore/inc/RooPlotable.h
index 3bb0547cc18..d2789c8a9b8 100644
--- a/roofit/roofitcore/inc/RooPlotable.h
+++ b/roofit/roofitcore/inc/RooPlotable.h
@@ -47,7 +47,7 @@ public:
   virtual Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const = 0;
   virtual Double_t getFitRangeBinW() const = 0;
 
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const;
 
   TObject *crossCast();
 protected:
diff --git a/roofit/roofitcore/inc/RooPrintable.h b/roofit/roofitcore/inc/RooPrintable.h
index 2158d9cd701..89123d73739 100644
--- a/roofit/roofitcore/inc/RooPrintable.h
+++ b/roofit/roofitcore/inc/RooPrintable.h
@@ -33,20 +33,20 @@ public:
   // Master print function
   enum ContentsOption { kName=1, kClassName=2, kValue=4, kArgs=8, kExtras=16, kAddress=32, kTitle=64,  kCollectionHeader=128} ; // Can be ORed
   enum StyleOption { kInline=1, kSingleLine=2, kStandard=3, kVerbose=4, kTreeStructure=5 } ; // Exclusive
-  virtual void printStream(ostream& os, Int_t contents, StyleOption style, TString indent="") const ;
+  virtual void printStream(std::ostream& os, Int_t contents, StyleOption style, TString indent="") const ;
   
   // Virtual hook function for class-specific content implementation
-  virtual void printAddress(ostream& os) const ;
-  virtual void printName(ostream& os) const ;
-  virtual void printTitle(ostream& os) const ;
-  virtual void printClassName(ostream& os) const ;
-  virtual void printValue(ostream& os) const ;
-  virtual void printArgs(ostream& os) const ;
-  virtual void printExtras(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
-  virtual void printTree(ostream& os, TString indent="") const ;
+  virtual void printAddress(std::ostream& os) const ;
+  virtual void printName(std::ostream& os) const ;
+  virtual void printTitle(std::ostream& os) const ;
+  virtual void printClassName(std::ostream& os) const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printArgs(std::ostream& os) const ;
+  virtual void printExtras(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printTree(std::ostream& os, TString indent="") const ;
 
-  static ostream& defaultPrintStream(ostream *os= 0);
+  static std::ostream& defaultPrintStream(std::ostream *os= 0);
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
   virtual StyleOption defaultPrintStyle(Option_t* opt) const ;
    
@@ -63,7 +63,7 @@ protected:
 };
 
 namespace RooFit {
-ostream& operator<<(ostream& os, const RooPrintable& rp) ; 
+std::ostream& operator<<(std::ostream& os, const RooPrintable& rp) ; 
 }
 
 #ifndef __CINT__
diff --git a/roofit/roofitcore/inc/RooProdGenContext.h b/roofit/roofitcore/inc/RooProdGenContext.h
index cebee68aa6c..846a8306d7b 100644
--- a/roofit/roofitcore/inc/RooProdGenContext.h
+++ b/roofit/roofitcore/inc/RooProdGenContext.h
@@ -35,7 +35,7 @@ public:
   virtual ~RooProdGenContext();
 
   virtual void setProtoDataOrder(Int_t* lut) ;
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual void attach(const RooArgSet& params) ;
 
diff --git a/roofit/roofitcore/inc/RooProdPdf.h b/roofit/roofitcore/inc/RooProdPdf.h
index b08091f4d28..e915646f93d 100644
--- a/roofit/roofitcore/inc/RooProdPdf.h
+++ b/roofit/roofitcore/inc/RooProdPdf.h
@@ -81,7 +81,7 @@ public:
   virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
   Bool_t isBinnedDistribution(const RooArgSet& obs) const  ;
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   virtual void selectNormalizationRange(const char* rangeName=0, Bool_t force=kFALSE) ;
   void fixRefRange(const char* rangeName) ;
diff --git a/roofit/roofitcore/inc/RooProduct.h b/roofit/roofitcore/inc/RooProduct.h
index bfab51fda6c..0e43c4c0d3e 100644
--- a/roofit/roofitcore/inc/RooProduct.h
+++ b/roofit/roofitcore/inc/RooProduct.h
@@ -50,7 +50,7 @@ public:
 
   class ProdMap ;
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
   virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
diff --git a/roofit/roofitcore/inc/RooProjectedPdf.h b/roofit/roofitcore/inc/RooProjectedPdf.h
index 5fc72a745cd..ef4bbee6b79 100644
--- a/roofit/roofitcore/inc/RooProjectedPdf.h
+++ b/roofit/roofitcore/inc/RooProjectedPdf.h
@@ -43,7 +43,7 @@ public:
   // Handle projection of projection explicitly
   virtual RooAbsPdf* createProjection(const RooArgSet& iset) ;  
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
 
 protected:
diff --git a/roofit/roofitcore/inc/RooRealIntegral.h b/roofit/roofitcore/inc/RooRealIntegral.h
index 25ede672bc1..2f42a71de4b 100644
--- a/roofit/roofitcore/inc/RooRealIntegral.h
+++ b/roofit/roofitcore/inc/RooRealIntegral.h
@@ -45,8 +45,8 @@ public:
 
   Bool_t isValid() const { return _valid; }
 
-  void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
-  void printMetaArgs(ostream& os) const ;
+  void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  void printMetaArgs(std::ostream& os) const ;
 
   const RooArgSet& numIntCatVars() const { return _sumList ; }
   const RooArgSet& numIntRealVars() const { return _intList ; }
diff --git a/roofit/roofitcore/inc/RooRealSumPdf.h b/roofit/roofitcore/inc/RooRealSumPdf.h
index 71fe3a8f611..67cfa903a36 100644
--- a/roofit/roofitcore/inc/RooRealSumPdf.h
+++ b/roofit/roofitcore/inc/RooRealSumPdf.h
@@ -52,7 +52,7 @@ public:
     return expectedEvents(&nset) ; 
   }
 
-  void printMetaArgs(ostream& os) const ;
+  void printMetaArgs(std::ostream& os) const ;
 
 
   virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
diff --git a/roofit/roofitcore/inc/RooRealVar.h b/roofit/roofitcore/inc/RooRealVar.h
index 780eb7aa023..2c3cfc7ffff 100644
--- a/roofit/roofitcore/inc/RooRealVar.h
+++ b/roofit/roofitcore/inc/RooRealVar.h
@@ -86,8 +86,8 @@ public:
   inline void removeRange(const char* name=0) { getBinning(name).setRange(-RooNumber::infinity(),RooNumber::infinity()) ; }
  
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   // We implement a fundamental type of AbsArg that can be stored in a dataset
   inline virtual Bool_t isFundamental() const { return kTRUE; }
@@ -99,9 +99,9 @@ public:
   }
 
   // Printing interface (human readable)
-  virtual void printValue(ostream& os) const ;
-  virtual void printExtras(ostream& os) const ;
-  virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printValue(std::ostream& os) const ;
+  virtual void printExtras(std::ostream& os) const ;
+  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
   virtual Int_t defaultPrintContents(Option_t* opt) const ;
 
 
diff --git a/roofit/roofitcore/inc/RooResolutionModel.h b/roofit/roofitcore/inc/RooResolutionModel.h
index a0290f052ed..853f86697be 100644
--- a/roofit/roofitcore/inc/RooResolutionModel.h
+++ b/roofit/roofitcore/inc/RooResolutionModel.h
@@ -45,7 +45,7 @@ public:
   inline const RooFormulaVar& basis() const { return _basis?*_basis:*identity() ; }
   Bool_t isConvolved() { return _basis ? kTRUE : kFALSE ; }
 
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   static void cleanup() ;
 
diff --git a/roofit/roofitcore/inc/RooSetProxy.h b/roofit/roofitcore/inc/RooSetProxy.h
index a853a6385cd..25ee4aa1734 100644
--- a/roofit/roofitcore/inc/RooSetProxy.h
+++ b/roofit/roofitcore/inc/RooSetProxy.h
@@ -55,7 +55,7 @@ public:
   Bool_t remove(const RooAbsCollection& list, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
   virtual void removeAll() ;
 
-  virtual void print(ostream& os, Bool_t addContents=kFALSE) const ;
+  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
 
   RooSetProxy& operator=(const RooArgSet& other) ;
   
diff --git a/roofit/roofitcore/inc/RooSimGenContext.h b/roofit/roofitcore/inc/RooSimGenContext.h
index 538bf80ee64..c7ae552a0ed 100644
--- a/roofit/roofitcore/inc/RooSimGenContext.h
+++ b/roofit/roofitcore/inc/RooSimGenContext.h
@@ -34,7 +34,7 @@ public:
 
   virtual void attach(const RooArgSet& params) ;
 
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
 
 protected:
diff --git a/roofit/roofitcore/inc/RooSimSplitGenContext.h b/roofit/roofitcore/inc/RooSimSplitGenContext.h
index 616117141fd..ea8037b5e91 100644
--- a/roofit/roofitcore/inc/RooSimSplitGenContext.h
+++ b/roofit/roofitcore/inc/RooSimSplitGenContext.h
@@ -33,7 +33,7 @@ public:
 
   virtual void attach(const RooArgSet& params) ;
 
-  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   virtual RooDataSet *generate(Int_t nEvents= 0, Bool_t skipInit=kFALSE, Bool_t extendedMode=kFALSE);
 
diff --git a/roofit/roofitcore/inc/RooSimWSTool.h b/roofit/roofitcore/inc/RooSimWSTool.h
index b506e2eefc1..71d0bc8bcfd 100644
--- a/roofit/roofitcore/inc/RooSimWSTool.h
+++ b/roofit/roofitcore/inc/RooSimWSTool.h
@@ -140,7 +140,7 @@ protected:
 		 const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none()) ;
 
   std::list<std::string>                                             _miStateNameList ;
-  std::map<std::string, std::pair<std::list<std::string>,std::string> > _paramSplitMap  ; //<paramName,<list<splitCatSet>,remainderStateName>>
+  std::map<std::string, std::pair<std::list<std::string>,std::string> > _paramSplitMap  ; //<paramName,<std::list<splitCatSet>,remainderStateName>>
   ClassDef(SplitRule,0) // Split rule specification for prototype p.d.f
  } ;
 
@@ -155,7 +155,7 @@ protected:
   friend class RooSimWSTool ;
   friend class RooSimWSTool::ObjBuildConfig ;
   std::list<const RooCatType*>                            _miStateList ; 
-  std::map<RooAbsArg*, std::pair<RooArgSet,std::string> > _paramSplitMap  ; //<paramName,<list<splitCatSet>,remainderStateName>>
+  std::map<RooAbsArg*, std::pair<RooArgSet,std::string> > _paramSplitMap  ; //<paramName,<std::list<splitCatSet>,remainderStateName>>
   ClassDef(ObjSplitRule,0) // Validated RooSimWSTool split rule
  } ;
 
diff --git a/roofit/roofitcore/inc/RooStreamParser.h b/roofit/roofitcore/inc/RooStreamParser.h
index 32f9acd3d11..6a5fa6d49df 100644
--- a/roofit/roofitcore/inc/RooStreamParser.h
+++ b/roofit/roofitcore/inc/RooStreamParser.h
@@ -22,8 +22,8 @@
 class RooStreamParser {
 public:
   // Constructors, assignment etc.
-  RooStreamParser(istream& is) ;
-  RooStreamParser(istream& is, const TString& errPrefix) ;
+  RooStreamParser(std::istream& is) ;
+  RooStreamParser(std::istream& is, const TString& errPrefix) ;
   virtual ~RooStreamParser();
 
   TString readToken() ;
@@ -49,14 +49,14 @@ public:
   
 protected:
 
-  istream* _is ;
+  std::istream* _is ;
   Bool_t _atEOL ;
   Bool_t _atEOF ;
   TString _prefix ;
   TString _punct ;
 
   
-  ClassDef(RooStreamParser,0) // Utility class that parses iostream data into tokens
+  ClassDef(RooStreamParser,0) // Utility class that parses std::iostream data into tokens
 };
 
 #endif
diff --git a/roofit/roofitcore/inc/RooStringVar.h b/roofit/roofitcore/inc/RooStringVar.h
index 0713ddfb416..7fded7b84c8 100644
--- a/roofit/roofitcore/inc/RooStringVar.h
+++ b/roofit/roofitcore/inc/RooStringVar.h
@@ -40,8 +40,8 @@ public:
   inline virtual Bool_t isFundamental() const { return kTRUE; }
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
 protected:
 
diff --git a/roofit/roofitcore/inc/RooSuperCategory.h b/roofit/roofitcore/inc/RooSuperCategory.h
index b47b8f803aa..3804fb708b8 100644
--- a/roofit/roofitcore/inc/RooSuperCategory.h
+++ b/roofit/roofitcore/inc/RooSuperCategory.h
@@ -36,11 +36,11 @@ public:
   virtual Bool_t setLabel(const char* label, Bool_t printError=kTRUE) ;
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
   // I/O streaming interface (machine readable)
-  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
-  virtual void writeToStream(ostream& os, Bool_t compact) const ;
+  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
+  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
 
   TIterator* MakeIterator() const ;
   const RooArgSet& inputCatList() const { return _catSet ; }
diff --git a/roofit/roofitcore/inc/RooThresholdCategory.h b/roofit/roofitcore/inc/RooThresholdCategory.h
index b77754741be..9f8d519e698 100644
--- a/roofit/roofitcore/inc/RooThresholdCategory.h
+++ b/roofit/roofitcore/inc/RooThresholdCategory.h
@@ -35,9 +35,9 @@ public:
   Bool_t addThreshold(Double_t upperLimit, const char* catName, Int_t catIdx=-99999) ;
 
   // Printing interface (human readable)
-  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
+  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
 
-  void writeToStream(ostream& os, Bool_t compact) const ;
+  void writeToStream(std::ostream& os, Bool_t compact) const ;
 
 protected:
   
diff --git a/roofit/roofitcore/inc/RooTrace.h b/roofit/roofitcore/inc/RooTrace.h
index c3a9fba3670..ec1ccf9ec0e 100644
--- a/roofit/roofitcore/inc/RooTrace.h
+++ b/roofit/roofitcore/inc/RooTrace.h
@@ -32,7 +32,7 @@ public:
   static void verbose(Bool_t flag) ;
 
   static void dump() ;
-  static void dump(ostream& os, Bool_t sinceMarked=kFALSE) ;
+  static void dump(std::ostream& os, Bool_t sinceMarked=kFALSE) ;
   static void mark() ;
   
   static void callgrind_zero() ;
diff --git a/roofit/roofitcore/inc/RooVectorDataStore.h b/roofit/roofitcore/inc/RooVectorDataStore.h
index fa69854d1cc..257aa18c850 100644
--- a/roofit/roofitcore/inc/RooVectorDataStore.h
+++ b/roofit/roofitcore/inc/RooVectorDataStore.h
@@ -196,7 +196,7 @@ public:
     } ;
 
     void write(Int_t i) {
-/*       cout << "write(" << this << ") [" << i << "] nativeReal = " << _nativeReal << " = " << _nativeReal->GetName() << " real = " << _real << " buf = " << _buf << " value = " << *_buf << " native getVal() = " << _nativeReal->getVal() << " getVal() = " << _real->getVal() << endl ; */
+/*       std::cout << "write(" << this << ") [" << i << "] nativeReal = " << _nativeReal << " = " << _nativeReal->GetName() << " real = " << _real << " buf = " << _buf << " value = " << *_buf << " native getVal() = " << _nativeReal->getVal() << " getVal() = " << _real->getVal() << std::endl ; */
       _vec[i] = *_buf ;
     }
     
@@ -288,7 +288,7 @@ public:
     }
     
     void setErrorBuffer(Double_t* newBuf) { 
-/*       cout << "setErrorBuffer(" << _nativeReal->GetName() << ") newBuf = " << newBuf << endl ; */
+/*       std::cout << "setErrorBuffer(" << _nativeReal->GetName() << ") newBuf = " << newBuf << std::endl ; */
       _bufE = newBuf ; 
       if (!_vecE) _vecE = new std::vector<Double_t> ;
       _vecE->reserve(_vec.capacity()) ;
diff --git a/roofit/roofitcore/src/RooAICRegistry.cxx b/roofit/roofitcore/src/RooAICRegistry.cxx
index 9c538315a20..0583a9bc80b 100644
--- a/roofit/roofitcore/src/RooAICRegistry.cxx
+++ b/roofit/roofitcore/src/RooAICRegistry.cxx
@@ -33,6 +33,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooAICRegistry)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsAnaConvPdf.cxx b/roofit/roofitcore/src/RooAbsAnaConvPdf.cxx
index 4c80911988a..0a0ec833d25 100644
--- a/roofit/roofitcore/src/RooAbsAnaConvPdf.cxx
+++ b/roofit/roofitcore/src/RooAbsAnaConvPdf.cxx
@@ -70,6 +70,8 @@
 #include "RooConvCoefVar.h"
 #include "RooNameReg.h"
 
+using namespace std;
+
 ClassImp(RooAbsAnaConvPdf) 
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsBinning.cxx b/roofit/roofitcore/src/RooAbsBinning.cxx
index 07d35911360..6476cd4c2ac 100644
--- a/roofit/roofitcore/src/RooAbsBinning.cxx
+++ b/roofit/roofitcore/src/RooAbsBinning.cxx
@@ -31,6 +31,8 @@
 
 #include "Riostream.h"
 
+using namespace std;
+
 ClassImp(RooAbsBinning)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsCache.cxx b/roofit/roofitcore/src/RooAbsCache.cxx
index 4ce5fe52a6e..2006a701577 100644
--- a/roofit/roofitcore/src/RooAbsCache.cxx
+++ b/roofit/roofitcore/src/RooAbsCache.cxx
@@ -32,6 +32,8 @@
 #include "RooAbsArg.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooAbsCache) 
    ;
 
diff --git a/roofit/roofitcore/src/RooAbsCacheElement.cxx b/roofit/roofitcore/src/RooAbsCacheElement.cxx
index 1a62c6c731a..efe36cf4fb7 100644
--- a/roofit/roofitcore/src/RooAbsCacheElement.cxx
+++ b/roofit/roofitcore/src/RooAbsCacheElement.cxx
@@ -32,6 +32,8 @@
 #include "RooAbsArg.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooAbsCacheElement) 
    ;
 
diff --git a/roofit/roofitcore/src/RooAbsCategory.cxx b/roofit/roofitcore/src/RooAbsCategory.cxx
index bfb42b6e3d4..2c6bea326e3 100644
--- a/roofit/roofitcore/src/RooAbsCategory.cxx
+++ b/roofit/roofitcore/src/RooAbsCategory.cxx
@@ -44,6 +44,8 @@
 #include "RooMsgService.h"
 #include "RooVectorDataStore.h"
 
+using namespace std;
+
 ClassImp(RooAbsCategory) 
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsCategoryLValue.cxx b/roofit/roofitcore/src/RooAbsCategoryLValue.cxx
index e08c1defee1..bf119107396 100644
--- a/roofit/roofitcore/src/RooAbsCategoryLValue.cxx
+++ b/roofit/roofitcore/src/RooAbsCategoryLValue.cxx
@@ -42,6 +42,8 @@
 #include "RooRandom.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooAbsCategoryLValue) 
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsData.cxx b/roofit/roofitcore/src/RooAbsData.cxx
index 0a077ea4a3e..dd01c895221 100644
--- a/roofit/roofitcore/src/RooAbsData.cxx
+++ b/roofit/roofitcore/src/RooAbsData.cxx
@@ -58,6 +58,8 @@
 #include "TH3.h"
 
 
+using namespace std;
+
 ClassImp(RooAbsData)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsFunc.cxx b/roofit/roofitcore/src/RooAbsFunc.cxx
index 6a7d05546b0..9750c9613af 100644
--- a/roofit/roofitcore/src/RooAbsFunc.cxx
+++ b/roofit/roofitcore/src/RooAbsFunc.cxx
@@ -32,6 +32,8 @@
 #include "RooAbsFunc.h"
 #include "RooAbsFunc.h"
 
+using namespace std;
+
 ClassImp(RooAbsFunc)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsGenContext.cxx b/roofit/roofitcore/src/RooAbsGenContext.cxx
index 16a0eae8354..83813a13d21 100644
--- a/roofit/roofitcore/src/RooAbsGenContext.cxx
+++ b/roofit/roofitcore/src/RooAbsGenContext.cxx
@@ -41,6 +41,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooAbsGenContext)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsHiddenReal.cxx b/roofit/roofitcore/src/RooAbsHiddenReal.cxx
index d28facd00a1..87a4630816d 100644
--- a/roofit/roofitcore/src/RooAbsHiddenReal.cxx
+++ b/roofit/roofitcore/src/RooAbsHiddenReal.cxx
@@ -36,6 +36,8 @@
 #include "RooCategory.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooAbsHiddenReal)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsIntegrator.cxx b/roofit/roofitcore/src/RooAbsIntegrator.cxx
index 6b990643530..00a7fb86567 100644
--- a/roofit/roofitcore/src/RooAbsIntegrator.cxx
+++ b/roofit/roofitcore/src/RooAbsIntegrator.cxx
@@ -33,6 +33,8 @@
 #include "RooMsgService.h"
 #include "TClass.h"
 
+using namespace std;
+
 ClassImp(RooAbsIntegrator)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsLValue.cxx b/roofit/roofitcore/src/RooAbsLValue.cxx
index ea0c1a9167b..fa488924b55 100644
--- a/roofit/roofitcore/src/RooAbsLValue.cxx
+++ b/roofit/roofitcore/src/RooAbsLValue.cxx
@@ -30,6 +30,8 @@
 #include "RooAbsLValue.h"
 #include "RooAbsLValue.h"
 
+using namespace std;
+
 ClassImp(RooAbsLValue)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsMCStudyModule.cxx b/roofit/roofitcore/src/RooAbsMCStudyModule.cxx
index 01f1b82018e..b775fbf5f1b 100644
--- a/roofit/roofitcore/src/RooAbsMCStudyModule.cxx
+++ b/roofit/roofitcore/src/RooAbsMCStudyModule.cxx
@@ -34,6 +34,8 @@
 #include "RooFit.h"
 #include "RooAbsMCStudyModule.h"
 
+using namespace std;
+
 ClassImp(RooAbsMCStudyModule)
   ;
 
diff --git a/roofit/roofitcore/src/RooAbsNumGenerator.cxx b/roofit/roofitcore/src/RooAbsNumGenerator.cxx
index 750def0a8b7..de8997f3e6e 100644
--- a/roofit/roofitcore/src/RooAbsNumGenerator.cxx
+++ b/roofit/roofitcore/src/RooAbsNumGenerator.cxx
@@ -42,6 +42,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooAbsNumGenerator)
   ;
 
diff --git a/roofit/roofitcore/src/RooAbsOptTestStatistic.cxx b/roofit/roofitcore/src/RooAbsOptTestStatistic.cxx
index e56506d2327..6205e9bfbe7 100644
--- a/roofit/roofitcore/src/RooAbsOptTestStatistic.cxx
+++ b/roofit/roofitcore/src/RooAbsOptTestStatistic.cxx
@@ -61,6 +61,8 @@
 #include "RooTrace.h"
 #include "RooVectorDataStore.h" 
 
+using namespace std;
+
 ClassImp(RooAbsOptTestStatistic)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsPdf.cxx b/roofit/roofitcore/src/RooAbsPdf.cxx
index 15a1e202929..60931458765 100644
--- a/roofit/roofitcore/src/RooAbsPdf.cxx
+++ b/roofit/roofitcore/src/RooAbsPdf.cxx
@@ -154,6 +154,8 @@
 #include "RooRealIntegral.h"
 #include <string>
 
+using namespace std;
+
 ClassImp(RooAbsPdf) 
 ;
 ClassImp(RooAbsPdf::GenSpec)
diff --git a/roofit/roofitcore/src/RooAbsProxy.cxx b/roofit/roofitcore/src/RooAbsProxy.cxx
index 5dca2626419..73cb51b4516 100644
--- a/roofit/roofitcore/src/RooAbsProxy.cxx
+++ b/roofit/roofitcore/src/RooAbsProxy.cxx
@@ -34,6 +34,8 @@
 //
 
 
+using namespace std;
+
 ClassImp(RooAbsProxy)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsRealLValue.cxx b/roofit/roofitcore/src/RooAbsRealLValue.cxx
index db30eca1efe..76792e0e8f1 100644
--- a/roofit/roofitcore/src/RooAbsRealLValue.cxx
+++ b/roofit/roofitcore/src/RooAbsRealLValue.cxx
@@ -59,6 +59,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooAbsRealLValue)
 
 //_____________________________________________________________________________
diff --git a/roofit/roofitcore/src/RooAbsRootFinder.cxx b/roofit/roofitcore/src/RooAbsRootFinder.cxx
index 9033572f05e..a8638796ed1 100644
--- a/roofit/roofitcore/src/RooAbsRootFinder.cxx
+++ b/roofit/roofitcore/src/RooAbsRootFinder.cxx
@@ -31,6 +31,8 @@
 #include "RooMsgService.h"
 #include "Riostream.h"
 
+using namespace std;
+
 ClassImp(RooAbsRootFinder)
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsString.cxx b/roofit/roofitcore/src/RooAbsString.cxx
index 9b042bd39e4..fbbae6d75e7 100644
--- a/roofit/roofitcore/src/RooAbsString.cxx
+++ b/roofit/roofitcore/src/RooAbsString.cxx
@@ -39,6 +39,8 @@
 #include "RooStringVar.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooAbsString) 
 ;
 
diff --git a/roofit/roofitcore/src/RooAbsTestStatistic.cxx b/roofit/roofitcore/src/RooAbsTestStatistic.cxx
index 60192eb5d24..fccdba4dee8 100644
--- a/roofit/roofitcore/src/RooAbsTestStatistic.cxx
+++ b/roofit/roofitcore/src/RooAbsTestStatistic.cxx
@@ -50,6 +50,8 @@
 
 #include <string>
 
+using namespace std;
+
 ClassImp(RooAbsTestStatistic)
 ;
 
diff --git a/roofit/roofitcore/src/RooAcceptReject.cxx b/roofit/roofitcore/src/RooAcceptReject.cxx
index b64d62f19c8..4f3d836b41d 100644
--- a/roofit/roofitcore/src/RooAcceptReject.cxx
+++ b/roofit/roofitcore/src/RooAcceptReject.cxx
@@ -49,6 +49,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooAcceptReject)
   ;
 
diff --git a/roofit/roofitcore/src/RooAdaptiveIntegratorND.cxx b/roofit/roofitcore/src/RooAdaptiveIntegratorND.cxx
index 206b5be7faf..fa828baee13 100644
--- a/roofit/roofitcore/src/RooAdaptiveIntegratorND.cxx
+++ b/roofit/roofitcore/src/RooAdaptiveIntegratorND.cxx
@@ -41,6 +41,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooAdaptiveIntegratorND)
 ;
 
diff --git a/roofit/roofitcore/src/RooAddGenContext.cxx b/roofit/roofitcore/src/RooAddGenContext.cxx
index 39db886dc27..efc1cca33d6 100644
--- a/roofit/roofitcore/src/RooAddGenContext.cxx
+++ b/roofit/roofitcore/src/RooAddGenContext.cxx
@@ -40,6 +40,8 @@
 #include "RooRandom.h"
 #include "RooAddModel.h"
 
+using namespace std;
+
 ClassImp(RooAddGenContext)
 ;
   
diff --git a/roofit/roofitcore/src/RooAddModel.cxx b/roofit/roofitcore/src/RooAddModel.cxx
index b8acb4d7d17..fa44d6fd295 100644
--- a/roofit/roofitcore/src/RooAddModel.cxx
+++ b/roofit/roofitcore/src/RooAddModel.cxx
@@ -61,6 +61,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooAddModel)
 ;
 
diff --git a/roofit/roofitcore/src/RooAddPdf.cxx b/roofit/roofitcore/src/RooAddPdf.cxx
index 0a90fa0521a..ad5afa2c96d 100644
--- a/roofit/roofitcore/src/RooAddPdf.cxx
+++ b/roofit/roofitcore/src/RooAddPdf.cxx
@@ -70,6 +70,8 @@
 #include <algorithm>
 
 
+using namespace std;
+
 ClassImp(RooAddPdf)
 ;
 
diff --git a/roofit/roofitcore/src/RooArgList.cxx b/roofit/roofitcore/src/RooArgList.cxx
index 067ce173156..82411b9f607 100644
--- a/roofit/roofitcore/src/RooArgList.cxx
+++ b/roofit/roofitcore/src/RooArgList.cxx
@@ -54,6 +54,8 @@
 #include "RooTrace.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooArgList)
   ;
 
diff --git a/roofit/roofitcore/src/RooBanner.cxx b/roofit/roofitcore/src/RooBanner.cxx
index cb0c8af43c2..70971354e53 100644
--- a/roofit/roofitcore/src/RooBanner.cxx
+++ b/roofit/roofitcore/src/RooBanner.cxx
@@ -1,6 +1,5 @@
 #include "RooFit.h"
 
-#include "Rtypes.h"
 #include "Rtypes.h"
 #include "Riostream.h"
 
@@ -11,6 +10,8 @@
 // END_HTML
 //
 
+using namespace std;
+
 const char* VTAG="3.54" ;
 
 Int_t doBanner()
diff --git a/roofit/roofitcore/src/RooBinIntegrator.cxx b/roofit/roofitcore/src/RooBinIntegrator.cxx
index 114e859e838..d4aa56e5eea 100644
--- a/roofit/roofitcore/src/RooBinIntegrator.cxx
+++ b/roofit/roofitcore/src/RooBinIntegrator.cxx
@@ -40,6 +40,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooBinIntegrator)
 ;
 
diff --git a/roofit/roofitcore/src/RooBinnedGenContext.cxx b/roofit/roofitcore/src/RooBinnedGenContext.cxx
index cd9d885b4af..00e997d3ff8 100644
--- a/roofit/roofitcore/src/RooBinnedGenContext.cxx
+++ b/roofit/roofitcore/src/RooBinnedGenContext.cxx
@@ -36,6 +36,8 @@
 #include "RooDataSet.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooBinnedGenContext)
 ;
   
diff --git a/roofit/roofitcore/src/RooBinning.cxx b/roofit/roofitcore/src/RooBinning.cxx
index 748f9b5bdd3..db959f67b4a 100644
--- a/roofit/roofitcore/src/RooBinning.cxx
+++ b/roofit/roofitcore/src/RooBinning.cxx
@@ -37,6 +37,8 @@
 #include "RooMsgService.h"
 #include "TList.h"
 
+using namespace std;
+
 ClassImp(RooBinning)
 ;
 
diff --git a/roofit/roofitcore/src/RooBinningCategory.cxx b/roofit/roofitcore/src/RooBinningCategory.cxx
index 6fa94e1eaa7..ff674833820 100644
--- a/roofit/roofitcore/src/RooBinningCategory.cxx
+++ b/roofit/roofitcore/src/RooBinningCategory.cxx
@@ -35,6 +35,8 @@
 #include "RooThreshEntry.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooBinningCategory)
 
 
diff --git a/roofit/roofitcore/src/RooBrentRootFinder.cxx b/roofit/roofitcore/src/RooBrentRootFinder.cxx
index 73e570b181d..294f3c844b0 100644
--- a/roofit/roofitcore/src/RooBrentRootFinder.cxx
+++ b/roofit/roofitcore/src/RooBrentRootFinder.cxx
@@ -32,6 +32,8 @@
 #include "Riostream.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooBrentRootFinder)
 ;
 
diff --git a/roofit/roofitcore/src/RooCachedPdf.cxx b/roofit/roofitcore/src/RooCachedPdf.cxx
index 407978f25d1..7a40c813f6d 100644
--- a/roofit/roofitcore/src/RooCachedPdf.cxx
+++ b/roofit/roofitcore/src/RooCachedPdf.cxx
@@ -26,6 +26,8 @@
 #include "RooDataHist.h"
 #include "RooHistPdf.h"
 
+using namespace std;
+
 ClassImp(RooCachedPdf) 
   ;
 
diff --git a/roofit/roofitcore/src/RooCachedReal.cxx b/roofit/roofitcore/src/RooCachedReal.cxx
index 1a5ec112892..add59855f20 100644
--- a/roofit/roofitcore/src/RooCachedReal.cxx
+++ b/roofit/roofitcore/src/RooCachedReal.cxx
@@ -26,6 +26,8 @@
 #include "RooDataHist.h"
 #include "RooHistPdf.h"
 
+using namespace std;
+
 ClassImp(RooCachedReal) 
   ;
 
diff --git a/roofit/roofitcore/src/RooCatType.cxx b/roofit/roofitcore/src/RooCatType.cxx
index f2457e7c0de..0f47563f4ae 100644
--- a/roofit/roofitcore/src/RooCatType.cxx
+++ b/roofit/roofitcore/src/RooCatType.cxx
@@ -33,6 +33,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooCatType)
 ;
 
diff --git a/roofit/roofitcore/src/RooCategory.cxx b/roofit/roofitcore/src/RooCategory.cxx
index dab5d24cc2c..ba38752ddd3 100644
--- a/roofit/roofitcore/src/RooCategory.cxx
+++ b/roofit/roofitcore/src/RooCategory.cxx
@@ -37,6 +37,8 @@
 #include "RooStreamParser.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooCategory) 
 ;
 
diff --git a/roofit/roofitcore/src/RooCategoryProxy.cxx b/roofit/roofitcore/src/RooCategoryProxy.cxx
index 4076217cbbe..cf6d1df9e82 100644
--- a/roofit/roofitcore/src/RooCategoryProxy.cxx
+++ b/roofit/roofitcore/src/RooCategoryProxy.cxx
@@ -32,6 +32,8 @@
 #include "RooArgSet.h"
 #include "RooCategoryProxy.h"
 
+using namespace std;
+
 ClassImp(RooCategoryProxy)
 ;
 
diff --git a/roofit/roofitcore/src/RooChi2Var.cxx b/roofit/roofitcore/src/RooChi2Var.cxx
index e4c7900b2f5..d2f55af229e 100644
--- a/roofit/roofitcore/src/RooChi2Var.cxx
+++ b/roofit/roofitcore/src/RooChi2Var.cxx
@@ -42,6 +42,8 @@
 #include "RooAbsDataStore.h"
 
 
+using namespace std;
+
 ClassImp(RooChi2Var)
 ;
 
diff --git a/roofit/roofitcore/src/RooCmdArg.cxx b/roofit/roofitcore/src/RooCmdArg.cxx
index fd7b2354e99..a7a53590bec 100644
--- a/roofit/roofitcore/src/RooCmdArg.cxx
+++ b/roofit/roofitcore/src/RooCmdArg.cxx
@@ -35,6 +35,8 @@
 #include "RooArgSet.h"
 #include <string>
 
+using namespace std;
+
 ClassImp(RooCmdArg)
   ;
 
diff --git a/roofit/roofitcore/src/RooCmdConfig.cxx b/roofit/roofitcore/src/RooCmdConfig.cxx
index 96d25a87eef..a59846b0e6b 100644
--- a/roofit/roofitcore/src/RooCmdConfig.cxx
+++ b/roofit/roofitcore/src/RooCmdConfig.cxx
@@ -42,6 +42,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooCmdConfig) 
   ;
 
diff --git a/roofit/roofitcore/src/RooComplex.cxx b/roofit/roofitcore/src/RooComplex.cxx
index 09463cdcddc..957c6caecf3 100644
--- a/roofit/roofitcore/src/RooComplex.cxx
+++ b/roofit/roofitcore/src/RooComplex.cxx
@@ -28,6 +28,8 @@
 #include "Riostream.h"
 #include <iomanip>
 
+using namespace std;
+
 ClassImp(RooComplex)
 
 
diff --git a/roofit/roofitcore/src/RooConstVar.cxx b/roofit/roofitcore/src/RooConstVar.cxx
index 05d0ba7549e..b7efd1c9f34 100644
--- a/roofit/roofitcore/src/RooConstVar.cxx
+++ b/roofit/roofitcore/src/RooConstVar.cxx
@@ -27,6 +27,8 @@
 #include "Riostream.h"
 #include "RooConstVar.h"
 
+using namespace std;
+
 ClassImp(RooConstVar)
   ;
 
diff --git a/roofit/roofitcore/src/RooConstraintSum.cxx b/roofit/roofitcore/src/RooConstraintSum.cxx
index 5d49edb96ee..fcd1962e225 100644
--- a/roofit/roofitcore/src/RooConstraintSum.cxx
+++ b/roofit/roofitcore/src/RooConstraintSum.cxx
@@ -41,6 +41,8 @@
 #include "RooChi2Var.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooConstraintSum)
 ;
 
diff --git a/roofit/roofitcore/src/RooConvCoefVar.cxx b/roofit/roofitcore/src/RooConvCoefVar.cxx
index 7b65269c8e9..4a658c76133 100644
--- a/roofit/roofitcore/src/RooConvCoefVar.cxx
+++ b/roofit/roofitcore/src/RooConvCoefVar.cxx
@@ -31,6 +31,8 @@
 #include "RooAbsAnaConvPdf.h"
 #include "RooConvCoefVar.h"
 
+using namespace std;
+
 ClassImp(RooConvCoefVar)
 ;
 
diff --git a/roofit/roofitcore/src/RooConvGenContext.cxx b/roofit/roofitcore/src/RooConvGenContext.cxx
index ae1784b9453..4f54746f7e8 100644
--- a/roofit/roofitcore/src/RooConvGenContext.cxx
+++ b/roofit/roofitcore/src/RooConvGenContext.cxx
@@ -39,6 +39,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooConvGenContext)
 ;
   
diff --git a/roofit/roofitcore/src/RooConvIntegrandBinding.cxx b/roofit/roofitcore/src/RooConvIntegrandBinding.cxx
index aa2619217cf..8e6bd98124a 100644
--- a/roofit/roofitcore/src/RooConvIntegrandBinding.cxx
+++ b/roofit/roofitcore/src/RooConvIntegrandBinding.cxx
@@ -34,6 +34,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooConvIntegrandBinding)
 ;
 
diff --git a/roofit/roofitcore/src/RooCustomizer.cxx b/roofit/roofitcore/src/RooCustomizer.cxx
index 72643e657f4..5c9c9f61b34 100644
--- a/roofit/roofitcore/src/RooCustomizer.cxx
+++ b/roofit/roofitcore/src/RooCustomizer.cxx
@@ -149,6 +149,8 @@ static char *strtok_r(char *s1, const char *s2, char **lasts)
 #endif
 
 
+using namespace std;
+
 ClassImp(RooCustomizer) 
 ;
 
diff --git a/roofit/roofitcore/src/RooDLLSignificanceMCSModule.cxx b/roofit/roofitcore/src/RooDLLSignificanceMCSModule.cxx
index aa722ae6a78..3951b892b42 100644
--- a/roofit/roofitcore/src/RooDLLSignificanceMCSModule.cxx
+++ b/roofit/roofitcore/src/RooDLLSignificanceMCSModule.cxx
@@ -42,6 +42,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooDLLSignificanceMCSModule)
   ;
 
diff --git a/roofit/roofitcore/src/RooDataHistSliceIter.cxx b/roofit/roofitcore/src/RooDataHistSliceIter.cxx
index 78d11375bf2..c83c2c88802 100644
--- a/roofit/roofitcore/src/RooDataHistSliceIter.cxx
+++ b/roofit/roofitcore/src/RooDataHistSliceIter.cxx
@@ -36,6 +36,8 @@
 #include "RooAbsLValue.h"
 #include "RooDataHistSliceIter.h"
 
+using namespace std;
+
 ClassImp(RooDataHistSliceIter)
 ;
 
diff --git a/roofit/roofitcore/src/RooDataProjBinding.cxx b/roofit/roofitcore/src/RooDataProjBinding.cxx
index c68d4b80127..86f5c56f10f 100644
--- a/roofit/roofitcore/src/RooDataProjBinding.cxx
+++ b/roofit/roofitcore/src/RooDataProjBinding.cxx
@@ -44,6 +44,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooDataProjBinding)
 ;
 
diff --git a/roofit/roofitcore/src/RooDataSet.cxx b/roofit/roofitcore/src/RooDataSet.cxx
index 8ab3effbc54..083ad1c6cc6 100644
--- a/roofit/roofitcore/src/RooDataSet.cxx
+++ b/roofit/roofitcore/src/RooDataSet.cxx
@@ -56,6 +56,8 @@
 char* operator+( streampos&, char* );
 #endif
 
+using namespace std;
+
 ClassImp(RooDataSet)
 ;
 
diff --git a/roofit/roofitcore/src/RooDataWeightedAverage.cxx b/roofit/roofitcore/src/RooDataWeightedAverage.cxx
index 4726f9d4a3a..1f78e6c7350 100644
--- a/roofit/roofitcore/src/RooDataWeightedAverage.cxx
+++ b/roofit/roofitcore/src/RooDataWeightedAverage.cxx
@@ -41,6 +41,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooDataWeightedAverage)
 ;
 
diff --git a/roofit/roofitcore/src/RooDerivative.cxx b/roofit/roofitcore/src/RooDerivative.cxx
index 7314315a0f9..f3f34067088 100644
--- a/roofit/roofitcore/src/RooDerivative.cxx
+++ b/roofit/roofitcore/src/RooDerivative.cxx
@@ -43,6 +43,8 @@
 #include "Math/WrappedFunction.h"
 #include "Math/RichardsonDerivator.h"
 
+using namespace std;
+
 ClassImp(RooDerivative)
 ;
 
diff --git a/roofit/roofitcore/src/RooDirItem.cxx b/roofit/roofitcore/src/RooDirItem.cxx
index 6fee88f0cb4..56a166b1a5b 100644
--- a/roofit/roofitcore/src/RooDirItem.cxx
+++ b/roofit/roofitcore/src/RooDirItem.cxx
@@ -33,6 +33,8 @@
 #include "TString.h"
 #include "RooDirItem.h"
 
+using namespace std;
+
 ClassImp(RooDirItem) ;
 
 
diff --git a/roofit/roofitcore/src/RooDouble.cxx b/roofit/roofitcore/src/RooDouble.cxx
index eda8141fc33..b78ca2a96f7 100644
--- a/roofit/roofitcore/src/RooDouble.cxx
+++ b/roofit/roofitcore/src/RooDouble.cxx
@@ -26,6 +26,8 @@
 #include "RooDouble.h"
 #include <string>
 
+using namespace std;
+
 ClassImp(RooDouble)
 ;
 
diff --git a/roofit/roofitcore/src/RooEffGenContext.cxx b/roofit/roofitcore/src/RooEffGenContext.cxx
index aa45293ebb6..4994afff76a 100644
--- a/roofit/roofitcore/src/RooEffGenContext.cxx
+++ b/roofit/roofitcore/src/RooEffGenContext.cxx
@@ -31,6 +31,8 @@
 #include "RooAbsPdf.h"
 #include "RooRandom.h"
 
+using namespace std;
+
 ClassImp(RooEffGenContext);
 
 //_____________________________________________________________________________
diff --git a/roofit/roofitcore/src/RooEffProd.cxx b/roofit/roofitcore/src/RooEffProd.cxx
index 3af4ad27bd9..5ca3b8b6cad 100644
--- a/roofit/roofitcore/src/RooEffProd.cxx
+++ b/roofit/roofitcore/src/RooEffProd.cxx
@@ -28,6 +28,8 @@
 #include "RooNameReg.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooEffProd)
   ;
 
diff --git a/roofit/roofitcore/src/RooEfficiency.cxx b/roofit/roofitcore/src/RooEfficiency.cxx
index cfeaa77c49e..99fc203b2e7 100644
--- a/roofit/roofitcore/src/RooEfficiency.cxx
+++ b/roofit/roofitcore/src/RooEfficiency.cxx
@@ -35,6 +35,8 @@
 #include "RooStreamParser.h"
 #include "RooArgList.h"
 
+using namespace std;
+
 ClassImp(RooEfficiency)
   ;
 
diff --git a/roofit/roofitcore/src/RooEllipse.cxx b/roofit/roofitcore/src/RooEllipse.cxx
index f06b2da2ad0..744817f9736 100644
--- a/roofit/roofitcore/src/RooEllipse.cxx
+++ b/roofit/roofitcore/src/RooEllipse.cxx
@@ -35,6 +35,8 @@
 #include <math.h>
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooEllipse)
 
 
diff --git a/roofit/roofitcore/src/RooErrorVar.cxx b/roofit/roofitcore/src/RooErrorVar.cxx
index 351d99b947a..88603f2f155 100644
--- a/roofit/roofitcore/src/RooErrorVar.cxx
+++ b/roofit/roofitcore/src/RooErrorVar.cxx
@@ -38,6 +38,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooErrorVar)
 ;
 
diff --git a/roofit/roofitcore/src/RooExtendPdf.cxx b/roofit/roofitcore/src/RooExtendPdf.cxx
index 64b3ff59d40..ec5422f92b1 100644
--- a/roofit/roofitcore/src/RooExtendPdf.cxx
+++ b/roofit/roofitcore/src/RooExtendPdf.cxx
@@ -49,6 +49,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooExtendPdf)
 ;
 
diff --git a/roofit/roofitcore/src/RooExtendedTerm.cxx b/roofit/roofitcore/src/RooExtendedTerm.cxx
index 6d3dcea16cf..8eb291d81dc 100644
--- a/roofit/roofitcore/src/RooExtendedTerm.cxx
+++ b/roofit/roofitcore/src/RooExtendedTerm.cxx
@@ -26,6 +26,8 @@
 #include "RooFit.h"
 #include "RooExtendedTerm.h"
 
+using namespace std;
+
 ClassImp(RooExtendedTerm)
 ;
 
diff --git a/roofit/roofitcore/src/RooFitResult.cxx b/roofit/roofitcore/src/RooFitResult.cxx
index 23ff296e2d9..237f7b70f85 100644
--- a/roofit/roofitcore/src/RooFitResult.cxx
+++ b/roofit/roofitcore/src/RooFitResult.cxx
@@ -56,6 +56,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooFitResult) 
 ;
 
diff --git a/roofit/roofitcore/src/RooFoamGenerator.cxx b/roofit/roofitcore/src/RooFoamGenerator.cxx
index e47538d4c8c..555113f75fa 100644
--- a/roofit/roofitcore/src/RooFoamGenerator.cxx
+++ b/roofit/roofitcore/src/RooFoamGenerator.cxx
@@ -48,6 +48,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooFoamGenerator)
   ;
 
diff --git a/roofit/roofitcore/src/RooFormula.cxx b/roofit/roofitcore/src/RooFormula.cxx
index 76086d8506c..fa6dfd3a857 100644
--- a/roofit/roofitcore/src/RooFormula.cxx
+++ b/roofit/roofitcore/src/RooFormula.cxx
@@ -41,6 +41,8 @@
 #include "RooArgList.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooFormula)
 
 
diff --git a/roofit/roofitcore/src/RooFormulaVar.cxx b/roofit/roofitcore/src/RooFormulaVar.cxx
index 369c4aaf827..541f1e38808 100644
--- a/roofit/roofitcore/src/RooFormulaVar.cxx
+++ b/roofit/roofitcore/src/RooFormulaVar.cxx
@@ -49,6 +49,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooFormulaVar)
 
 
diff --git a/roofit/roofitcore/src/RooFracRemainder.cxx b/roofit/roofitcore/src/RooFracRemainder.cxx
index 95b1d70f09b..315d858c2de 100644
--- a/roofit/roofitcore/src/RooFracRemainder.cxx
+++ b/roofit/roofitcore/src/RooFracRemainder.cxx
@@ -39,6 +39,8 @@
 #include "RooArgSet.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooFracRemainder)
 ;
 
diff --git a/roofit/roofitcore/src/RooFunctor.cxx b/roofit/roofitcore/src/RooFunctor.cxx
index 3f6454166f5..c1a4eb8f553 100644
--- a/roofit/roofitcore/src/RooFunctor.cxx
+++ b/roofit/roofitcore/src/RooFunctor.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooFunctor)
 ;
 
diff --git a/roofit/roofitcore/src/RooGaussKronrodIntegrator1D.cxx b/roofit/roofitcore/src/RooGaussKronrodIntegrator1D.cxx
index 2d23e26bcd1..18ebf97c58e 100644
--- a/roofit/roofitcore/src/RooGaussKronrodIntegrator1D.cxx
+++ b/roofit/roofitcore/src/RooGaussKronrodIntegrator1D.cxx
@@ -57,6 +57,8 @@
 #include "RooMsgService.h"
 
 
+using namespace std;
+
 ClassImp(RooGaussKronrodIntegrator1D)
 ;
 
diff --git a/roofit/roofitcore/src/RooGenCategory.cxx b/roofit/roofitcore/src/RooGenCategory.cxx
index a89774cdbbd..bc9ee618f80 100644
--- a/roofit/roofitcore/src/RooGenCategory.cxx
+++ b/roofit/roofitcore/src/RooGenCategory.cxx
@@ -48,6 +48,8 @@
 #include "Api.h"
 #endif
 
+using namespace std;
+
 ClassImp(RooGenCategory)
 
 
diff --git a/roofit/roofitcore/src/RooGenContext.cxx b/roofit/roofitcore/src/RooGenContext.cxx
index 9035cc8b240..4ed2dce559b 100644
--- a/roofit/roofitcore/src/RooGenContext.cxx
+++ b/roofit/roofitcore/src/RooGenContext.cxx
@@ -49,6 +49,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooGenContext)
   ;
 
diff --git a/roofit/roofitcore/src/RooGenFunction.cxx b/roofit/roofitcore/src/RooGenFunction.cxx
index ecfa08f97cc..a396131ef63 100644
--- a/roofit/roofitcore/src/RooGenFunction.cxx
+++ b/roofit/roofitcore/src/RooGenFunction.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooGenFunction)
 ;
 
diff --git a/roofit/roofitcore/src/RooGenProdProj.cxx b/roofit/roofitcore/src/RooGenProdProj.cxx
index 8bb079eaef3..3110f674c69 100644
--- a/roofit/roofitcore/src/RooGenProdProj.cxx
+++ b/roofit/roofitcore/src/RooGenProdProj.cxx
@@ -43,6 +43,8 @@
 #include "RooErrorHandler.h"
 #include "RooProduct.h"
 
+using namespace std;
+
 ClassImp(RooGenProdProj)
 ;
 
diff --git a/roofit/roofitcore/src/RooGenericPdf.cxx b/roofit/roofitcore/src/RooGenericPdf.cxx
index fa0659ea219..3e9fff1c390 100644
--- a/roofit/roofitcore/src/RooGenericPdf.cxx
+++ b/roofit/roofitcore/src/RooGenericPdf.cxx
@@ -45,6 +45,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooGenericPdf)
 
 
diff --git a/roofit/roofitcore/src/RooGlobalFunc.cxx b/roofit/roofitcore/src/RooGlobalFunc.cxx
index 6009ddb696f..4dd1ffdb2c0 100644
--- a/roofit/roofitcore/src/RooGlobalFunc.cxx
+++ b/roofit/roofitcore/src/RooGlobalFunc.cxx
@@ -18,7 +18,6 @@
 
 #include "RooFit.h"
 
-#include "RooGlobalFunc.h"
 #include "RooGlobalFunc.h"
 #include "RooCategory.h"
 #include "RooRealConstant.h"
@@ -30,6 +29,8 @@
 #include "RooAbsPdf.h"
 #include "TH1.h"
 
+using namespace std;
+
 namespace RooFit {
 
   // RooAbsReal::plotOn arguments
@@ -291,7 +292,7 @@ namespace RooFit {
   RooCmdArg ClassName(const char* name)     { return RooCmdArg("ClassName",0,0,0,0,name,0,0,0) ; }
   RooCmdArg BaseClassName(const char* name) { return RooCmdArg("BaseClassName",0,0,0,0,name,0,0,0) ; }
   RooCmdArg TagName(const char* name)     { return RooCmdArg("LabelName",0,0,0,0,name,0,0,0) ; }
-  RooCmdArg OutputStream(ostream& os)    { return RooCmdArg("OutputStream",0,0,0,0,0,0,reinterpret_cast<TObject*>(&os),0) ; }
+   RooCmdArg OutputStream(ostream& os)    { return RooCmdArg("OutputStream",0,0,0,0,0,0,reinterpret_cast<TObject*>(&os),0) ; }
   RooCmdArg Prefix(Bool_t flag)          { return RooCmdArg("Prefix",flag,0,0,0,0,0,0,0) ; }
   RooCmdArg Color(Color_t color)         { return RooCmdArg("Color",color,0,0,0,0,0,0,0) ; }
 
diff --git a/roofit/roofitcore/src/RooGrid.cxx b/roofit/roofitcore/src/RooGrid.cxx
index dc85e681db4..bcf19e5f232 100644
--- a/roofit/roofitcore/src/RooGrid.cxx
+++ b/roofit/roofitcore/src/RooGrid.cxx
@@ -38,6 +38,8 @@
 #include "Riostream.h"
 #include <iomanip>
 
+using namespace std;
+
 ClassImp(RooGrid)
 ;
 
diff --git a/roofit/roofitcore/src/RooHashTable.cxx b/roofit/roofitcore/src/RooHashTable.cxx
index e7ec9cd5d16..a6e179914b6 100644
--- a/roofit/roofitcore/src/RooHashTable.cxx
+++ b/roofit/roofitcore/src/RooHashTable.cxx
@@ -24,6 +24,8 @@
 #include "RooAbsArg.h"
 #include "RooSetPair.h"
 
+using namespace std;
+
 ClassImp(RooHashTable)
 ;
 
diff --git a/roofit/roofitcore/src/RooHist.cxx b/roofit/roofitcore/src/RooHist.cxx
index 3920fccd533..65fbd7583e8 100644
--- a/roofit/roofitcore/src/RooHist.cxx
+++ b/roofit/roofitcore/src/RooHist.cxx
@@ -38,6 +38,8 @@
 #include <iomanip>
 #include <math.h>
 
+using namespace std;
+
 ClassImp(RooHist)
   ;
 
diff --git a/roofit/roofitcore/src/RooHistError.cxx b/roofit/roofitcore/src/RooHistError.cxx
index 2c27e85829e..8ebfa21caa1 100644
--- a/roofit/roofitcore/src/RooHistError.cxx
+++ b/roofit/roofitcore/src/RooHistError.cxx
@@ -33,6 +33,8 @@
 #include "Riostream.h"
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooHistError)
   ;
 
diff --git a/roofit/roofitcore/src/RooHistFunc.cxx b/roofit/roofitcore/src/RooHistFunc.cxx
index d01089c70f7..fd28c846a24 100644
--- a/roofit/roofitcore/src/RooHistFunc.cxx
+++ b/roofit/roofitcore/src/RooHistFunc.cxx
@@ -34,6 +34,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooHistFunc)
 ;
 
diff --git a/roofit/roofitcore/src/RooHistPdf.cxx b/roofit/roofitcore/src/RooHistPdf.cxx
index 8f252e09007..d47414a65ef 100644
--- a/roofit/roofitcore/src/RooHistPdf.cxx
+++ b/roofit/roofitcore/src/RooHistPdf.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooHistPdf)
 ;
 
diff --git a/roofit/roofitcore/src/RooImproperIntegrator1D.cxx b/roofit/roofitcore/src/RooImproperIntegrator1D.cxx
index a1c80dd81dc..57993416906 100644
--- a/roofit/roofitcore/src/RooImproperIntegrator1D.cxx
+++ b/roofit/roofitcore/src/RooImproperIntegrator1D.cxx
@@ -41,6 +41,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooImproperIntegrator1D)
 ;
 
diff --git a/roofit/roofitcore/src/RooInt.cxx b/roofit/roofitcore/src/RooInt.cxx
index f328cff6b3a..667e794928a 100644
--- a/roofit/roofitcore/src/RooInt.cxx
+++ b/roofit/roofitcore/src/RooInt.cxx
@@ -27,6 +27,8 @@
 #include "RooInt.h"
 #include "RooInt.h"
 
+using namespace std;
+
 ClassImp(RooInt)
 ;
 
diff --git a/roofit/roofitcore/src/RooIntegrator1D.cxx b/roofit/roofitcore/src/RooIntegrator1D.cxx
index 5d867c5fa53..167581a6f49 100644
--- a/roofit/roofitcore/src/RooIntegrator1D.cxx
+++ b/roofit/roofitcore/src/RooIntegrator1D.cxx
@@ -40,6 +40,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooIntegrator1D)
 ;
 
diff --git a/roofit/roofitcore/src/RooIntegrator2D.cxx b/roofit/roofitcore/src/RooIntegrator2D.cxx
index 21946394183..be6d9dac14f 100644
--- a/roofit/roofitcore/src/RooIntegrator2D.cxx
+++ b/roofit/roofitcore/src/RooIntegrator2D.cxx
@@ -35,6 +35,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooIntegrator2D)
 ;
 
diff --git a/roofit/roofitcore/src/RooIntegratorBinding.cxx b/roofit/roofitcore/src/RooIntegratorBinding.cxx
index dd3b76805b7..e6922b6fdfc 100644
--- a/roofit/roofitcore/src/RooIntegratorBinding.cxx
+++ b/roofit/roofitcore/src/RooIntegratorBinding.cxx
@@ -27,6 +27,8 @@
 #include "RooIntegratorBinding.h"
 #include "RooIntegratorBinding.h"
 
+using namespace std;
+
 ClassImp(RooIntegratorBinding)
 ;
 
diff --git a/roofit/roofitcore/src/RooInvTransform.cxx b/roofit/roofitcore/src/RooInvTransform.cxx
index 40c5f33d5de..f41a8e1066c 100644
--- a/roofit/roofitcore/src/RooInvTransform.cxx
+++ b/roofit/roofitcore/src/RooInvTransform.cxx
@@ -33,6 +33,8 @@
 #include "Riostream.h"
 #include <math.h>
 
+using namespace std;
+
 ClassImp(RooInvTransform)
 ;
 
diff --git a/roofit/roofitcore/src/RooLinTransBinning.cxx b/roofit/roofitcore/src/RooLinTransBinning.cxx
index 53227b9a049..745d4e1eed5 100644
--- a/roofit/roofitcore/src/RooLinTransBinning.cxx
+++ b/roofit/roofitcore/src/RooLinTransBinning.cxx
@@ -29,6 +29,8 @@
 #include "RooLinTransBinning.h"
 #include "RooLinTransBinning.h"
 
+using namespace std;
+
 ClassImp(RooLinTransBinning) 
 ;
 
diff --git a/roofit/roofitcore/src/RooLinearVar.cxx b/roofit/roofitcore/src/RooLinearVar.cxx
index 372490b92ec..232e8d3b122 100644
--- a/roofit/roofitcore/src/RooLinearVar.cxx
+++ b/roofit/roofitcore/src/RooLinearVar.cxx
@@ -57,6 +57,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooLinearVar)
 
 
diff --git a/roofit/roofitcore/src/RooLinkedList.cxx b/roofit/roofitcore/src/RooLinkedList.cxx
index 1b0abb7ff7a..aaf3278f83b 100644
--- a/roofit/roofitcore/src/RooLinkedList.cxx
+++ b/roofit/roofitcore/src/RooLinkedList.cxx
@@ -38,6 +38,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooLinkedList)
 ;
 
diff --git a/roofit/roofitcore/src/RooLinkedListElem.cxx b/roofit/roofitcore/src/RooLinkedListElem.cxx
index e3ca0040874..cfee9f519d1 100644
--- a/roofit/roofitcore/src/RooLinkedListElem.cxx
+++ b/roofit/roofitcore/src/RooLinkedListElem.cxx
@@ -28,6 +28,8 @@
 #include "RooLinkedListElem.h"
 
 
+using namespace std;
+
 ClassImp(RooLinkedListElem) 
 ;
 
diff --git a/roofit/roofitcore/src/RooLinkedListIter.cxx b/roofit/roofitcore/src/RooLinkedListIter.cxx
index 4dd7119f532..0511d5f77d3 100644
--- a/roofit/roofitcore/src/RooLinkedListIter.cxx
+++ b/roofit/roofitcore/src/RooLinkedListIter.cxx
@@ -26,6 +26,8 @@
 #include "RooLinkedListIter.h"
 #include "RooLinkedListIter.h"
 
+using namespace std;
+
 ClassImp(RooLinkedListIter)
 
 ;
diff --git a/roofit/roofitcore/src/RooList.cxx b/roofit/roofitcore/src/RooList.cxx
index f9749344093..eb6a5efc550 100644
--- a/roofit/roofitcore/src/RooList.cxx
+++ b/roofit/roofitcore/src/RooList.cxx
@@ -30,6 +30,8 @@
 
 #include "Riostream.h"
 
+using namespace std;
+
 ClassImp(RooList)
 
 
diff --git a/roofit/roofitcore/src/RooListProxy.cxx b/roofit/roofitcore/src/RooListProxy.cxx
index 4bb41ced23a..7d71ff9464b 100644
--- a/roofit/roofitcore/src/RooListProxy.cxx
+++ b/roofit/roofitcore/src/RooListProxy.cxx
@@ -35,6 +35,8 @@
 #include "RooArgList.h"
 #include "RooAbsArg.h"
 
+using namespace std;
+
 ClassImp(RooListProxy)
 ;
 
diff --git a/roofit/roofitcore/src/RooMCIntegrator.cxx b/roofit/roofitcore/src/RooMCIntegrator.cxx
index 569f8dd8010..8c9d75e98fc 100644
--- a/roofit/roofitcore/src/RooMCIntegrator.cxx
+++ b/roofit/roofitcore/src/RooMCIntegrator.cxx
@@ -43,6 +43,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooMCIntegrator)
 ;
 
diff --git a/roofit/roofitcore/src/RooMPSentinel.cxx b/roofit/roofitcore/src/RooMPSentinel.cxx
index c16a6afef57..e1d54df8dbc 100644
--- a/roofit/roofitcore/src/RooMPSentinel.cxx
+++ b/roofit/roofitcore/src/RooMPSentinel.cxx
@@ -31,6 +31,8 @@
 #include "RooMPSentinel.h"
 #include "RooRealMPFE.h"
 
+using namespace std;
+
 ClassImp(RooMPSentinel)
   ;
 
diff --git a/roofit/roofitcore/src/RooMapCatEntry.cxx b/roofit/roofitcore/src/RooMapCatEntry.cxx
index 3c0838d0d5d..a41703628dc 100644
--- a/roofit/roofitcore/src/RooMapCatEntry.cxx
+++ b/roofit/roofitcore/src/RooMapCatEntry.cxx
@@ -26,6 +26,8 @@
 #include "RooMapCatEntry.h"
 #include "TString.h"
 
+using namespace std;
+
 ClassImp(RooMapCatEntry)
 ;
 
diff --git a/roofit/roofitcore/src/RooMath.cxx b/roofit/roofitcore/src/RooMath.cxx
index c58e8e18309..14484404cc5 100644
--- a/roofit/roofitcore/src/RooMath.cxx
+++ b/roofit/roofitcore/src/RooMath.cxx
@@ -31,6 +31,8 @@
 #include "RooSentinel.h"
 #include "TSystem.h"
 
+using namespace std;
+
 ClassImp(RooMath)
 ;
 
diff --git a/roofit/roofitcore/src/RooMinimizer.cxx b/roofit/roofitcore/src/RooMinimizer.cxx
index 75671955e25..4cd635417ea 100644
--- a/roofit/roofitcore/src/RooMinimizer.cxx
+++ b/roofit/roofitcore/src/RooMinimizer.cxx
@@ -77,6 +77,8 @@
 char* operator+( streampos&, char* );
 #endif
 
+using namespace std;
+
 ClassImp(RooMinimizer)
 ;
 
diff --git a/roofit/roofitcore/src/RooMinimizerFcn.cxx b/roofit/roofitcore/src/RooMinimizerFcn.cxx
index d96f04a3d32..a6c54a34fee 100644
--- a/roofit/roofitcore/src/RooMinimizerFcn.cxx
+++ b/roofit/roofitcore/src/RooMinimizerFcn.cxx
@@ -38,6 +38,8 @@
 
 #include "RooMinimizer.h"
 
+using namespace std;
+
 RooMinimizerFcn::RooMinimizerFcn(RooAbsReal *funct, RooMinimizer* context,
 			   bool verbose) :
   _funct(funct), _context(context),
diff --git a/roofit/roofitcore/src/RooMinuit.cxx b/roofit/roofitcore/src/RooMinuit.cxx
index 22aee24f274..40592ca2d9d 100644
--- a/roofit/roofitcore/src/RooMinuit.cxx
+++ b/roofit/roofitcore/src/RooMinuit.cxx
@@ -73,6 +73,8 @@
 char* operator+( streampos&, char* );
 #endif
 
+using namespace std;
+
 ClassImp(RooMinuit)
 ;
 
diff --git a/roofit/roofitcore/src/RooMultiCatIter.cxx b/roofit/roofitcore/src/RooMultiCatIter.cxx
index dbb35405a72..510d3cf6815 100644
--- a/roofit/roofitcore/src/RooMultiCatIter.cxx
+++ b/roofit/roofitcore/src/RooMultiCatIter.cxx
@@ -39,6 +39,8 @@
 #include "RooAbsCategoryLValue.h"
 #include "RooMultiCatIter.h"
 
+using namespace std;
+
 ClassImp(RooMultiCatIter)
 ;
 
diff --git a/roofit/roofitcore/src/RooMultiCategory.cxx b/roofit/roofitcore/src/RooMultiCategory.cxx
index a3d826f8adc..cf390e8879e 100644
--- a/roofit/roofitcore/src/RooMultiCategory.cxx
+++ b/roofit/roofitcore/src/RooMultiCategory.cxx
@@ -40,6 +40,8 @@
 #include "RooAbsCategory.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooMultiCategory)
 ;
 
diff --git a/roofit/roofitcore/src/RooMultiGenFunction.cxx b/roofit/roofitcore/src/RooMultiGenFunction.cxx
index 603d300793e..efce7ec4021 100644
--- a/roofit/roofitcore/src/RooMultiGenFunction.cxx
+++ b/roofit/roofitcore/src/RooMultiGenFunction.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooMultiGenFunction)
 ;
 
diff --git a/roofit/roofitcore/src/RooMultiVarGaussian.cxx b/roofit/roofitcore/src/RooMultiVarGaussian.cxx
index cac8a4ec2d5..c2e8458282e 100644
--- a/roofit/roofitcore/src/RooMultiVarGaussian.cxx
+++ b/roofit/roofitcore/src/RooMultiVarGaussian.cxx
@@ -36,6 +36,8 @@
 #include "TDecompChol.h"
 #include "RooFitResult.h"
 
+using namespace std;
+
 ClassImp(RooMultiVarGaussian)
   ;
 
diff --git a/roofit/roofitcore/src/RooNLLVar.cxx b/roofit/roofitcore/src/RooNLLVar.cxx
index ed8521c63d8..039672e4494 100644
--- a/roofit/roofitcore/src/RooNLLVar.cxx
+++ b/roofit/roofitcore/src/RooNLLVar.cxx
@@ -40,6 +40,8 @@
 #include "RooRealVar.h"
 
 
+using namespace std;
+
 ClassImp(RooNLLVar)
 ;
 
diff --git a/roofit/roofitcore/src/RooNameSet.cxx b/roofit/roofitcore/src/RooNameSet.cxx
index bc4b1c67443..f9256f8e36d 100644
--- a/roofit/roofitcore/src/RooNameSet.cxx
+++ b/roofit/roofitcore/src/RooNameSet.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooNameSet)
 ;
 
diff --git a/roofit/roofitcore/src/RooNumCdf.cxx b/roofit/roofitcore/src/RooNumCdf.cxx
index fcccd1c8544..f71a0b9ff5b 100644
--- a/roofit/roofitcore/src/RooNumCdf.cxx
+++ b/roofit/roofitcore/src/RooNumCdf.cxx
@@ -33,6 +33,8 @@
 #include "RooHistPdf.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooNumCdf) 
   ;
 
diff --git a/roofit/roofitcore/src/RooNumConvPdf.cxx b/roofit/roofitcore/src/RooNumConvPdf.cxx
index 2318cb7fca3..dd9dc311a43 100644
--- a/roofit/roofitcore/src/RooNumConvPdf.cxx
+++ b/roofit/roofitcore/src/RooNumConvPdf.cxx
@@ -79,6 +79,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooNumConvPdf)
 ;
 
diff --git a/roofit/roofitcore/src/RooNumConvolution.cxx b/roofit/roofitcore/src/RooNumConvolution.cxx
index 3184b4864a3..24327d4f7a4 100644
--- a/roofit/roofitcore/src/RooNumConvolution.cxx
+++ b/roofit/roofitcore/src/RooNumConvolution.cxx
@@ -75,6 +75,8 @@
 #include "RooMsgService.h"
 
 
+using namespace std;
+
 ClassImp(RooNumConvolution)
 ;
 
diff --git a/roofit/roofitcore/src/RooNumGenConfig.cxx b/roofit/roofitcore/src/RooNumGenConfig.cxx
index ed6c6ac5757..9f1b002d55d 100644
--- a/roofit/roofitcore/src/RooNumGenConfig.cxx
+++ b/roofit/roofitcore/src/RooNumGenConfig.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooNumGenConfig)
 ;
 
diff --git a/roofit/roofitcore/src/RooNumIntConfig.cxx b/roofit/roofitcore/src/RooNumIntConfig.cxx
index b177958872a..885cc6132dc 100644
--- a/roofit/roofitcore/src/RooNumIntConfig.cxx
+++ b/roofit/roofitcore/src/RooNumIntConfig.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooNumIntConfig)
 ;
 
diff --git a/roofit/roofitcore/src/RooNumRunningInt.cxx b/roofit/roofitcore/src/RooNumRunningInt.cxx
index 106825b0c1e..24ca2cd220c 100644
--- a/roofit/roofitcore/src/RooNumRunningInt.cxx
+++ b/roofit/roofitcore/src/RooNumRunningInt.cxx
@@ -36,6 +36,8 @@
 #include "RooHistPdf.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooNumRunningInt) 
   ;
 
diff --git a/roofit/roofitcore/src/RooNumber.cxx b/roofit/roofitcore/src/RooNumber.cxx
index 8ad2c0f9d73..05ad902adbd 100644
--- a/roofit/roofitcore/src/RooNumber.cxx
+++ b/roofit/roofitcore/src/RooNumber.cxx
@@ -24,6 +24,8 @@
 #include "RooFit.h"
 #include "RooNumber.h"
 
+using namespace std;
+
 ClassImp(RooNumber)
 ;
 
diff --git a/roofit/roofitcore/src/RooParamBinning.cxx b/roofit/roofitcore/src/RooParamBinning.cxx
index f81cda34124..9033da01603 100644
--- a/roofit/roofitcore/src/RooParamBinning.cxx
+++ b/roofit/roofitcore/src/RooParamBinning.cxx
@@ -35,6 +35,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooParamBinning)
 ;
 
diff --git a/roofit/roofitcore/src/RooPlot.cxx b/roofit/roofitcore/src/RooPlot.cxx
index 76c300e8751..d38605a9f14 100644
--- a/roofit/roofitcore/src/RooPlot.cxx
+++ b/roofit/roofitcore/src/RooPlot.cxx
@@ -69,6 +69,8 @@
 #include <string.h>
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooPlot)
 ;
 
diff --git a/roofit/roofitcore/src/RooPlotable.cxx b/roofit/roofitcore/src/RooPlotable.cxx
index 1bdf7ae2b45..dc34138ed7d 100644
--- a/roofit/roofitcore/src/RooPlotable.cxx
+++ b/roofit/roofitcore/src/RooPlotable.cxx
@@ -30,6 +30,8 @@
 #include "TObject.h"
 #include "Riostream.h"
 
+using namespace std;
+
 ClassImp(RooPlotable)
 ;
 
diff --git a/roofit/roofitcore/src/RooPolyVar.cxx b/roofit/roofitcore/src/RooPolyVar.cxx
index db27427ae77..9b139d03f39 100644
--- a/roofit/roofitcore/src/RooPolyVar.cxx
+++ b/roofit/roofitcore/src/RooPolyVar.cxx
@@ -41,6 +41,8 @@
 #include "RooMsgService.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooPolyVar)
 ;
 
diff --git a/roofit/roofitcore/src/RooPrintable.cxx b/roofit/roofitcore/src/RooPrintable.cxx
index 8520d137c5c..6814aaba7a0 100644
--- a/roofit/roofitcore/src/RooPrintable.cxx
+++ b/roofit/roofitcore/src/RooPrintable.cxx
@@ -40,6 +40,8 @@
 #include "TNamed.h"
 #include "TClass.h"
 
+using namespace std;
+
 ClassImp(RooPrintable)
 ;
 
diff --git a/roofit/roofitcore/src/RooProdGenContext.cxx b/roofit/roofitcore/src/RooProdGenContext.cxx
index bd47c24cd7b..fbeb731bc9f 100644
--- a/roofit/roofitcore/src/RooProdGenContext.cxx
+++ b/roofit/roofitcore/src/RooProdGenContext.cxx
@@ -37,6 +37,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooProdGenContext)
 ;
   
diff --git a/roofit/roofitcore/src/RooProdPdf.cxx b/roofit/roofitcore/src/RooProdPdf.cxx
index fa90c29c406..cb56a1462c9 100644
--- a/roofit/roofitcore/src/RooProdPdf.cxx
+++ b/roofit/roofitcore/src/RooProdPdf.cxx
@@ -95,6 +95,8 @@ static char *strtok_r(char *s1, const char *s2, char **lasts)
 
 #include "TSystem.h"
 
+using namespace std;
+
 ClassImp(RooProdPdf)
 ;
 
diff --git a/roofit/roofitcore/src/RooProjectedPdf.cxx b/roofit/roofitcore/src/RooProjectedPdf.cxx
index 95979a42d30..f15911aa200 100644
--- a/roofit/roofitcore/src/RooProjectedPdf.cxx
+++ b/roofit/roofitcore/src/RooProjectedPdf.cxx
@@ -37,6 +37,7 @@
 #include "RooRealVar.h"
 #include "RooNameReg.h"
 
+using namespace std;
 
  ClassImp(RooProjectedPdf) 
    ;
diff --git a/roofit/roofitcore/src/RooPullVar.cxx b/roofit/roofitcore/src/RooPullVar.cxx
index b9f91549ff5..aeff76533df 100644
--- a/roofit/roofitcore/src/RooPullVar.cxx
+++ b/roofit/roofitcore/src/RooPullVar.cxx
@@ -35,6 +35,8 @@
 #include "RooAbsReal.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooPullVar)
 ;
 
diff --git a/roofit/roofitcore/src/RooQuasiRandomGenerator.cxx b/roofit/roofitcore/src/RooQuasiRandomGenerator.cxx
index 32d5373a9a6..f547056b956 100644
--- a/roofit/roofitcore/src/RooQuasiRandomGenerator.cxx
+++ b/roofit/roofitcore/src/RooQuasiRandomGenerator.cxx
@@ -37,6 +37,8 @@
 #include "Riostream.h"
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooQuasiRandomGenerator)
   ;
 
diff --git a/roofit/roofitcore/src/RooRandom.cxx b/roofit/roofitcore/src/RooRandom.cxx
index d22837015df..1e94fcd5700 100644
--- a/roofit/roofitcore/src/RooRandom.cxx
+++ b/roofit/roofitcore/src/RooRandom.cxx
@@ -32,6 +32,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooRandom)
   ;
 
diff --git a/roofit/roofitcore/src/RooRangeBinning.cxx b/roofit/roofitcore/src/RooRangeBinning.cxx
index 401b87b8d06..ee78dc5f82c 100644
--- a/roofit/roofitcore/src/RooRangeBinning.cxx
+++ b/roofit/roofitcore/src/RooRangeBinning.cxx
@@ -33,6 +33,8 @@
 
 #include "RooRangeBinning.h"
 
+using namespace std;
+
 ClassImp(RooRangeBinning) 
 ;
 
diff --git a/roofit/roofitcore/src/RooRangeBoolean.cxx b/roofit/roofitcore/src/RooRangeBoolean.cxx
index 40524e75c10..5d4a681fd1e 100644
--- a/roofit/roofitcore/src/RooRangeBoolean.cxx
+++ b/roofit/roofitcore/src/RooRangeBoolean.cxx
@@ -35,6 +35,8 @@
 #include "RooMsgService.h"
 #include "TMath.h"
 
+using namespace std;
+
 ClassImp(RooRangeBoolean)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealAnalytic.cxx b/roofit/roofitcore/src/RooRealAnalytic.cxx
index 3f785c6cf42..fd786587009 100644
--- a/roofit/roofitcore/src/RooRealAnalytic.cxx
+++ b/roofit/roofitcore/src/RooRealAnalytic.cxx
@@ -31,6 +31,8 @@
 
 #include <assert.h>
 
+using namespace std;
+
 ClassImp(RooRealAnalytic)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealBinding.cxx b/roofit/roofitcore/src/RooRealBinding.cxx
index e399a1d25b5..530ff60042d 100644
--- a/roofit/roofitcore/src/RooRealBinding.cxx
+++ b/roofit/roofitcore/src/RooRealBinding.cxx
@@ -37,6 +37,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooRealBinding)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealConstant.cxx b/roofit/roofitcore/src/RooRealConstant.cxx
index be510f4fae6..ad419cbd99d 100644
--- a/roofit/roofitcore/src/RooRealConstant.cxx
+++ b/roofit/roofitcore/src/RooRealConstant.cxx
@@ -39,6 +39,8 @@
 #include "RooArgList.h"
 #include "RooSentinel.h"
 
+using namespace std;
+
 ClassImp(RooRealConstant)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealIntegral.cxx b/roofit/roofitcore/src/RooRealIntegral.cxx
index 1cb8d9e8d3c..f3803c55f89 100644
--- a/roofit/roofitcore/src/RooRealIntegral.cxx
+++ b/roofit/roofitcore/src/RooRealIntegral.cxx
@@ -50,6 +50,8 @@
 #include "RooConstVar.h"
 #include "RooDouble.h"
 
+using namespace std;
+
 ClassImp(RooRealIntegral) 
 ;
 
diff --git a/roofit/roofitcore/src/RooRealMPFE.cxx b/roofit/roofitcore/src/RooRealMPFE.cxx
index 88fb841be3f..df16ec2a18b 100644
--- a/roofit/roofitcore/src/RooRealMPFE.cxx
+++ b/roofit/roofitcore/src/RooRealMPFE.cxx
@@ -65,6 +65,8 @@
 
 RooMPSentinel RooRealMPFE::_sentinel ;
 
+using namespace std;
+
 ClassImp(RooRealMPFE)
   ;
 
diff --git a/roofit/roofitcore/src/RooRealProxy.cxx b/roofit/roofitcore/src/RooRealProxy.cxx
index 63c8309e905..c784f5c4ec7 100644
--- a/roofit/roofitcore/src/RooRealProxy.cxx
+++ b/roofit/roofitcore/src/RooRealProxy.cxx
@@ -33,6 +33,8 @@
 #include "RooRealProxy.h"
 #include "RooRealVar.h"
 
+using namespace std;
+
 ClassImp(RooRealProxy)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealSumPdf.cxx b/roofit/roofitcore/src/RooRealSumPdf.cxx
index 9ca88fed4b3..db3525dfc6c 100644
--- a/roofit/roofitcore/src/RooRealSumPdf.cxx
+++ b/roofit/roofitcore/src/RooRealSumPdf.cxx
@@ -45,6 +45,8 @@
 #include <memory>
 #include <algorithm>
 
+using namespace std;
+
 ClassImp(RooRealSumPdf)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealVar.cxx b/roofit/roofitcore/src/RooRealVar.cxx
index d41f9463db0..f1847aa5cef 100644
--- a/roofit/roofitcore/src/RooRealVar.cxx
+++ b/roofit/roofitcore/src/RooRealVar.cxx
@@ -45,6 +45,8 @@
 #include "RooVectorDataStore.h"
 
 
+using namespace std;
+
 ClassImp(RooRealVar)
 ;
 
diff --git a/roofit/roofitcore/src/RooRealVarSharedProperties.cxx b/roofit/roofitcore/src/RooRealVarSharedProperties.cxx
index 6c409aef10b..bcb044a538d 100644
--- a/roofit/roofitcore/src/RooRealVarSharedProperties.cxx
+++ b/roofit/roofitcore/src/RooRealVarSharedProperties.cxx
@@ -28,6 +28,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooRealVarSharedProperties)
 ;
 
diff --git a/roofit/roofitcore/src/RooRecursiveFraction.cxx b/roofit/roofitcore/src/RooRecursiveFraction.cxx
index 14388564615..9f1131fc165 100644
--- a/roofit/roofitcore/src/RooRecursiveFraction.cxx
+++ b/roofit/roofitcore/src/RooRecursiveFraction.cxx
@@ -40,6 +40,8 @@
 #include "RooChi2Var.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooRecursiveFraction)
 ;
 
diff --git a/roofit/roofitcore/src/RooRefCountList.cxx b/roofit/roofitcore/src/RooRefCountList.cxx
index 5bc0b97d6f5..310463a19bc 100644
--- a/roofit/roofitcore/src/RooRefCountList.cxx
+++ b/roofit/roofitcore/src/RooRefCountList.cxx
@@ -32,6 +32,8 @@
 #include "Riostream.h"
 #include <stdlib.h>
 
+using namespace std;
+
 ClassImp(RooRefCountList)
   ;
 
diff --git a/roofit/roofitcore/src/RooResolutionModel.cxx b/roofit/roofitcore/src/RooResolutionModel.cxx
index 971f2b8ad91..eeaf1cb98a1 100644
--- a/roofit/roofitcore/src/RooResolutionModel.cxx
+++ b/roofit/roofitcore/src/RooResolutionModel.cxx
@@ -68,6 +68,8 @@
 #include "RooMsgService.h"
 #include "RooSentinel.h"
 
+using namespace std;
+
 ClassImp(RooResolutionModel) 
 ;
 
diff --git a/roofit/roofitcore/src/RooScaledFunc.cxx b/roofit/roofitcore/src/RooScaledFunc.cxx
index 854b54a3d82..97fe7b75dac 100644
--- a/roofit/roofitcore/src/RooScaledFunc.cxx
+++ b/roofit/roofitcore/src/RooScaledFunc.cxx
@@ -28,6 +28,8 @@
 #include "RooScaledFunc.h"
 #include "RooScaledFunc.h"
 
+using namespace std;
+
 ClassImp(RooScaledFunc)
 ;
 
diff --git a/roofit/roofitcore/src/RooSegmentedIntegrator1D.cxx b/roofit/roofitcore/src/RooSegmentedIntegrator1D.cxx
index 96f21ac002a..cb92f0cc862 100644
--- a/roofit/roofitcore/src/RooSegmentedIntegrator1D.cxx
+++ b/roofit/roofitcore/src/RooSegmentedIntegrator1D.cxx
@@ -38,6 +38,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooSegmentedIntegrator1D)
 ;
 
diff --git a/roofit/roofitcore/src/RooSegmentedIntegrator2D.cxx b/roofit/roofitcore/src/RooSegmentedIntegrator2D.cxx
index 959197fe463..4455e0e84ef 100644
--- a/roofit/roofitcore/src/RooSegmentedIntegrator2D.cxx
+++ b/roofit/roofitcore/src/RooSegmentedIntegrator2D.cxx
@@ -39,6 +39,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooSegmentedIntegrator2D)
 ;
 
diff --git a/roofit/roofitcore/src/RooSetPair.cxx b/roofit/roofitcore/src/RooSetPair.cxx
index 833f4dd09b7..fa1e669d800 100644
--- a/roofit/roofitcore/src/RooSetPair.cxx
+++ b/roofit/roofitcore/src/RooSetPair.cxx
@@ -27,6 +27,8 @@
 #include "RooSetPair.h"
 
 
+using namespace std;
+
 ClassImp(RooSetPair) 
 ;
 
diff --git a/roofit/roofitcore/src/RooSetProxy.cxx b/roofit/roofitcore/src/RooSetProxy.cxx
index c187928e02f..f83630cabfd 100644
--- a/roofit/roofitcore/src/RooSetProxy.cxx
+++ b/roofit/roofitcore/src/RooSetProxy.cxx
@@ -38,6 +38,8 @@
 #include "RooArgSet.h"
 #include "RooAbsArg.h"
 
+using namespace std;
+
 ClassImp(RooSetProxy)
 ;
 
diff --git a/roofit/roofitcore/src/RooSharedProperties.cxx b/roofit/roofitcore/src/RooSharedProperties.cxx
index 826d63690ab..50cda662e80 100644
--- a/roofit/roofitcore/src/RooSharedProperties.cxx
+++ b/roofit/roofitcore/src/RooSharedProperties.cxx
@@ -31,6 +31,8 @@
 using std::cout ;
 using std::endl ;
 
+using namespace std;
+
 ClassImp(RooSharedProperties)
 ;
 
diff --git a/roofit/roofitcore/src/RooSharedPropertiesList.cxx b/roofit/roofitcore/src/RooSharedPropertiesList.cxx
index f06e19fc973..7608e7333bd 100644
--- a/roofit/roofitcore/src/RooSharedPropertiesList.cxx
+++ b/roofit/roofitcore/src/RooSharedPropertiesList.cxx
@@ -32,6 +32,8 @@
 using std::cout ;
 using std::endl ;
 
+using namespace std;
+
 ClassImp(RooSharedPropertiesList)
 ;
 
diff --git a/roofit/roofitcore/src/RooSimGenContext.cxx b/roofit/roofitcore/src/RooSimGenContext.cxx
index 06f0bc4fee4..2cf38085146 100644
--- a/roofit/roofitcore/src/RooSimGenContext.cxx
+++ b/roofit/roofitcore/src/RooSimGenContext.cxx
@@ -40,6 +40,8 @@ using namespace RooFit ;
 
 #include <string>
 
+using namespace std;
+
 ClassImp(RooSimGenContext)
 ;
   
diff --git a/roofit/roofitcore/src/RooSimSplitGenContext.cxx b/roofit/roofitcore/src/RooSimSplitGenContext.cxx
index 14b64ce52fc..789e8c4b718 100644
--- a/roofit/roofitcore/src/RooSimSplitGenContext.cxx
+++ b/roofit/roofitcore/src/RooSimSplitGenContext.cxx
@@ -40,6 +40,8 @@ using namespace RooFit ;
 
 #include <string>
 
+using namespace std;
+
 ClassImp(RooSimSplitGenContext)
 ;
   
diff --git a/roofit/roofitcore/src/RooStreamParser.cxx b/roofit/roofitcore/src/RooStreamParser.cxx
index 9bdbe6af919..c247764fd2a 100644
--- a/roofit/roofitcore/src/RooStreamParser.cxx
+++ b/roofit/roofitcore/src/RooStreamParser.cxx
@@ -50,6 +50,8 @@
 #include "RooNumber.h"
 
 
+using namespace std;
+
 ClassImp(RooStreamParser)
 
 
diff --git a/roofit/roofitcore/src/RooStringVar.cxx b/roofit/roofitcore/src/RooStringVar.cxx
index ccf700f82f5..b71a789edb4 100644
--- a/roofit/roofitcore/src/RooStringVar.cxx
+++ b/roofit/roofitcore/src/RooStringVar.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooStringVar)
 
 
diff --git a/roofit/roofitcore/src/RooSuperCategory.cxx b/roofit/roofitcore/src/RooSuperCategory.cxx
index 1a5ef516df1..ba894f902cb 100644
--- a/roofit/roofitcore/src/RooSuperCategory.cxx
+++ b/roofit/roofitcore/src/RooSuperCategory.cxx
@@ -45,6 +45,8 @@
 #include "RooAbsCategoryLValue.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooSuperCategory)
 ;
 
diff --git a/roofit/roofitcore/src/RooTFoamBinding.cxx b/roofit/roofitcore/src/RooTFoamBinding.cxx
index 00eb32ccc25..a05eedb06ea 100644
--- a/roofit/roofitcore/src/RooTFoamBinding.cxx
+++ b/roofit/roofitcore/src/RooTFoamBinding.cxx
@@ -35,6 +35,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooTFoamBinding)
 ;
 
diff --git a/roofit/roofitcore/src/RooTObjWrap.cxx b/roofit/roofitcore/src/RooTObjWrap.cxx
index 110bc5aab75..939a9def16a 100644
--- a/roofit/roofitcore/src/RooTObjWrap.cxx
+++ b/roofit/roofitcore/src/RooTObjWrap.cxx
@@ -26,6 +26,8 @@
 #include "RooTObjWrap.h"
 #include "RooTObjWrap.h"
 
+using namespace std;
+
 ClassImp(RooTObjWrap)
 ;
 
diff --git a/roofit/roofitcore/src/RooTable.cxx b/roofit/roofitcore/src/RooTable.cxx
index fb9375363e0..a9bbdcee01b 100644
--- a/roofit/roofitcore/src/RooTable.cxx
+++ b/roofit/roofitcore/src/RooTable.cxx
@@ -30,6 +30,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooTable)
 
 
diff --git a/roofit/roofitcore/src/RooThreshEntry.cxx b/roofit/roofitcore/src/RooThreshEntry.cxx
index 577f52c3e67..37e8f0f1dd8 100644
--- a/roofit/roofitcore/src/RooThreshEntry.cxx
+++ b/roofit/roofitcore/src/RooThreshEntry.cxx
@@ -27,6 +27,8 @@
 #include "TClass.h"
 #include "RooThreshEntry.h"
 
+using namespace std;
+
 ClassImp(RooThreshEntry)
 ;
 
diff --git a/roofit/roofitcore/src/RooThresholdCategory.cxx b/roofit/roofitcore/src/RooThresholdCategory.cxx
index 39d82943d94..d77c5ec5674 100644
--- a/roofit/roofitcore/src/RooThresholdCategory.cxx
+++ b/roofit/roofitcore/src/RooThresholdCategory.cxx
@@ -35,6 +35,8 @@
 #include "RooThreshEntry.h"
 #include "RooMsgService.h"
 
+using namespace std;
+
 ClassImp(RooThresholdCategory)
 
 
diff --git a/roofit/roofitcore/src/RooTrace.cxx b/roofit/roofitcore/src/RooTrace.cxx
index 329491c0135..ada36557b84 100644
--- a/roofit/roofitcore/src/RooTrace.cxx
+++ b/roofit/roofitcore/src/RooTrace.cxx
@@ -36,6 +36,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooTrace)
 ;
 
diff --git a/roofit/roofitcore/src/RooTreeData.cxx b/roofit/roofitcore/src/RooTreeData.cxx
index 532b26b3445..e362adef5a0 100644
--- a/roofit/roofitcore/src/RooTreeData.cxx
+++ b/roofit/roofitcore/src/RooTreeData.cxx
@@ -28,6 +28,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooTreeData)
 ;
 
diff --git a/roofit/roofitcore/src/RooUniformBinning.cxx b/roofit/roofitcore/src/RooUniformBinning.cxx
index 76fb6e6f695..db4880c5cc2 100644
--- a/roofit/roofitcore/src/RooUniformBinning.cxx
+++ b/roofit/roofitcore/src/RooUniformBinning.cxx
@@ -33,6 +33,8 @@
 #include "Riostream.h"
 
 
+using namespace std;
+
 ClassImp(RooUniformBinning)
 ;
 
diff --git a/roofit/roofitcore/src/RooXYChi2Var.cxx b/roofit/roofitcore/src/RooXYChi2Var.cxx
index 6ff0c802da4..402b167e9cd 100644
--- a/roofit/roofitcore/src/RooXYChi2Var.cxx
+++ b/roofit/roofitcore/src/RooXYChi2Var.cxx
@@ -44,6 +44,8 @@
 #include "RooRealBinding.h"
 #include "RooNumIntFactory.h"
 
+using namespace std;
+
 ClassImp(RooXYChi2Var)
 ;
 
diff --git a/roofit/roostats/inc/RooStats/NeymanConstruction.h b/roofit/roostats/inc/RooStats/NeymanConstruction.h
index 1ef898fa398..e37219f3a68 100644
--- a/roofit/roostats/inc/RooStats/NeymanConstruction.h
+++ b/roofit/roostats/inc/RooStats/NeymanConstruction.h
@@ -66,7 +66,7 @@ namespace RooStats {
       //      void SetNumSteps(Int_t);
       // This class can make regularly spaced scans based on range stored in RooRealVars.
       // Choose number of steps for a rastor scan (specific for each dimension)
-      //      void SetNumSteps(map<RooAbsArg, Int_t>)
+      //      void SetNumSteps(std::map<RooAbsArg, Int_t>)
 
       // Get the size of the test (eg. rate of Type I error)
       virtual Double_t Size() const {return fSize;}
diff --git a/roofit/roostats/inc/RooStats/SimpleLikelihoodRatioTestStat.h b/roofit/roostats/inc/RooStats/SimpleLikelihoodRatioTestStat.h
index be9f8b292d7..624acfd2317 100644
--- a/roofit/roostats/inc/RooStats/SimpleLikelihoodRatioTestStat.h
+++ b/roofit/roostats/inc/RooStats/SimpleLikelihoodRatioTestStat.h
@@ -191,7 +191,7 @@ class SimpleLikelihoodRatioTestStat : public TestStatistic {
          *attachedSet = nullPOI;
          double nullNLL = fNllNull->getVal();
          
-         //cout << std::endl << "SLRTS: null params:" << std::endl;
+         //std::cout << std::endl << "SLRTS: null params:" << std::endl;
          //attachedSet->Print("v");
          
 
@@ -215,11 +215,11 @@ class SimpleLikelihoodRatioTestStat : public TestStatistic {
          *attachedSet = *fAltParameters;
          double altNLL = fNllAlt->getVal();
 
-         //cout << std::endl << "SLRTS: alt params:" << std::endl;
+         //std::cout << std::endl << "SLRTS: alt params:" << std::endl;
          //attachedSet->Print("v");
 
 
-         //cout << std::endl << "SLRTS null NLL: " << nullNLL << "    alt NLL: " << altNLL << std::endl << std::endl;
+         //std::cout << std::endl << "SLRTS null NLL: " << nullNLL << "    alt NLL: " << altNLL << std::endl << std::endl;
 
 
          if (!reuse) { 
@@ -238,9 +238,9 @@ class SimpleLikelihoodRatioTestStat : public TestStatistic {
             fDetailedOutput->setRealValue( "nullNLL", nullNLL );
             fDetailedOutput->setRealValue( "altNLL", altNLL );
 
-//             cout << std::endl << "STORING THIS AS DETAILED OUTPUT:" << std::endl;
+//             std::cout << std::endl << "STORING THIS AS DETAILED OUTPUT:" << std::endl;
 //             fDetailedOutput->Print("v");
-//             cout << std::endl;
+//             std::cout << std::endl;
          }
 
 
diff --git a/roofit/roostats/src/HLFactory.cxx b/roofit/roostats/src/HLFactory.cxx
index 7b85a45f84f..9c0ff017930 100644
--- a/roofit/roostats/src/HLFactory.cxx
+++ b/roofit/roostats/src/HLFactory.cxx
@@ -34,6 +34,8 @@ END_HTML
 
 #include "RooSimultaneous.h"
 
+using namespace std;
+
 ClassImp(RooStats::HLFactory) ;
 
 
diff --git a/roofit/roostats/src/Heaviside.cxx b/roofit/roostats/src/Heaviside.cxx
index 5c2a04a5e39..3042d0bf94d 100644
--- a/roofit/roostats/src/Heaviside.cxx
+++ b/roofit/roostats/src/Heaviside.cxx
@@ -26,6 +26,8 @@ END_HTML
 #include "RooAbsReal.h"
 #endif
 
+using namespace std;
+
 ClassImp(RooStats::Heaviside)
 
 using namespace RooFit;
diff --git a/roofit/roostats/src/HybridCalculatorOriginal.cxx b/roofit/roostats/src/HybridCalculatorOriginal.cxx
index 7cd1db59c33..a4e8e529bfd 100644
--- a/roofit/roostats/src/HybridCalculatorOriginal.cxx
+++ b/roofit/roostats/src/HybridCalculatorOriginal.cxx
@@ -73,6 +73,8 @@ see also the following interesting references:
 
 #include "RooStats/HybridCalculatorOriginal.h"
 
+using namespace std;
+
 ClassImp(RooStats::HybridCalculatorOriginal)
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/HybridPlot.cxx b/roofit/roostats/src/HybridPlot.cxx
index e8119247338..ef5e2ae767c 100644
--- a/roofit/roostats/src/HybridPlot.cxx
+++ b/roofit/roostats/src/HybridPlot.cxx
@@ -31,6 +31,8 @@ An example plot is available here:
 #include <algorithm>
 
 /// To build the THtml documentation
+using namespace std;
+
 ClassImp(RooStats::HybridPlot)
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/HybridResult.cxx b/roofit/roostats/src/HybridResult.cxx
index 9f540a417ab..d222204d020 100644
--- a/roofit/roostats/src/HybridResult.cxx
+++ b/roofit/roostats/src/HybridResult.cxx
@@ -39,6 +39,8 @@ TConfidenceLevel class (http://root.cern.ch/root/html/TConfidenceLevel.html).
 
 
 /// ClassImp for building the THtml documentation of the class 
+using namespace std;
+
 ClassImp(RooStats::HybridResult)
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/HypoTestInverterPlot.cxx b/roofit/roostats/src/HypoTestInverterPlot.cxx
index 0751452267c..7f2af3026ed 100644
--- a/roofit/roostats/src/HypoTestInverterPlot.cxx
+++ b/roofit/roostats/src/HypoTestInverterPlot.cxx
@@ -33,6 +33,8 @@
 #include "TPad.h"
 #include "Math/DistFuncMathCore.h"
 
+using namespace std;
+
 ClassImp(RooStats::HypoTestInverterPlot)
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/LikelihoodIntervalPlot.cxx b/roofit/roostats/src/LikelihoodIntervalPlot.cxx
index 280178dd696..6953536df20 100644
--- a/roofit/roostats/src/LikelihoodIntervalPlot.cxx
+++ b/roofit/roostats/src/LikelihoodIntervalPlot.cxx
@@ -41,6 +41,8 @@ object.
 #include "TF1.h"
 
 /// ClassImp for building the THtml documentation of the class 
+using namespace std;
+
 ClassImp(RooStats::LikelihoodIntervalPlot);
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/MarkovChain.cxx b/roofit/roostats/src/MarkovChain.cxx
index ac6292617f2..727a7abf77b 100644
--- a/roofit/roostats/src/MarkovChain.cxx
+++ b/roofit/roostats/src/MarkovChain.cxx
@@ -50,6 +50,8 @@ END_HTML
 #include "THnSparse.h"
 #endif
 
+using namespace std;
+
 ClassImp(RooStats::MarkovChain);
 
 using namespace RooFit;
diff --git a/roofit/roostats/src/PointSetInterval.cxx b/roofit/roostats/src/PointSetInterval.cxx
index c6965d664bd..82e15617e3d 100644
--- a/roofit/roostats/src/PointSetInterval.cxx
+++ b/roofit/roostats/src/PointSetInterval.cxx
@@ -40,6 +40,8 @@
 #include "RooDataSet.h"
 #include "RooDataHist.h"
 
+using namespace std;
+
 ClassImp(RooStats::PointSetInterval) ;
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/ProfileLikelihoodCalculator.cxx b/roofit/roostats/src/ProfileLikelihoodCalculator.cxx
index eba3a6a7ced..a865d7491d6 100644
--- a/roofit/roostats/src/ProfileLikelihoodCalculator.cxx
+++ b/roofit/roostats/src/ProfileLikelihoodCalculator.cxx
@@ -67,6 +67,8 @@ END_HTML
 #include "Math/MinimizerOptions.h"
 //#include "RooProdPdf.h"
 
+using namespace std;
+
 ClassImp(RooStats::ProfileLikelihoodCalculator) ;
 
 using namespace RooFit;
diff --git a/roofit/roostats/src/SequentialProposal.cxx b/roofit/roostats/src/SequentialProposal.cxx
index 34ed4f3fee9..439c8127dde 100644
--- a/roofit/roostats/src/SequentialProposal.cxx
+++ b/roofit/roostats/src/SequentialProposal.cxx
@@ -17,6 +17,8 @@
 #include <RooRandom.h>
 #include <RooStats/RooStatsUtils.h>
 
+using namespace std;
+
 ClassImp(RooStats::SequentialProposal)
 
 namespace RooStats { 
diff --git a/roofit/roostats/src/SimpleInterval.cxx b/roofit/roostats/src/SimpleInterval.cxx
index 87d32dc4144..a096eb36c8a 100644
--- a/roofit/roostats/src/SimpleInterval.cxx
+++ b/roofit/roostats/src/SimpleInterval.cxx
@@ -37,6 +37,8 @@
 #include <string>
 
 
+using namespace std;
+
 ClassImp(RooStats::SimpleInterval) ;
 
 using namespace RooStats;
diff --git a/roofit/roostats/src/UniformProposal.cxx b/roofit/roostats/src/UniformProposal.cxx
index 0ad2debd6ad..7446377e65f 100644
--- a/roofit/roostats/src/UniformProposal.cxx
+++ b/roofit/roostats/src/UniformProposal.cxx
@@ -47,6 +47,8 @@ END_HTML
 #include "TIterator.h"
 #endif
 
+using namespace std;
+
 ClassImp(RooStats::UniformProposal);
 
 using namespace RooFit;
diff --git a/roofit/roostats/src/UpperLimitMCSModule.cxx b/roofit/roostats/src/UpperLimitMCSModule.cxx
index 662048fcc1a..4f96bd9501f 100644
--- a/roofit/roostats/src/UpperLimitMCSModule.cxx
+++ b/roofit/roostats/src/UpperLimitMCSModule.cxx
@@ -42,6 +42,8 @@
 
 
 
+using namespace std;
+
 ClassImp(RooStats::UpperLimitMCSModule);
 
 
diff --git a/sql/odbc/src/TODBCServer.cxx b/sql/odbc/src/TODBCServer.cxx
index e1a54e242e2..e8e1e84ce03 100644
--- a/sql/odbc/src/TODBCServer.cxx
+++ b/sql/odbc/src/TODBCServer.cxx
@@ -300,11 +300,11 @@ void TODBCServer::PrintDrivers()
    //   <name> : <options list>
     
    TList* lst = GetDrivers();
-   cout << "List of ODBC drivers:" << endl;
+   std::cout << "List of ODBC drivers:" << std::endl;
    TIter iter(lst);
    TNamed* n = 0;
    while ((n = (TNamed*) iter()) != 0) 
-      cout << "  " << n->GetName() << " : " << n->GetTitle() << endl; 
+      std::cout << "  " << n->GetName() << " : " << n->GetTitle() << std::endl; 
    delete lst;
 }
 
@@ -326,11 +326,11 @@ void TODBCServer::PrintDataSources()
    //   <name> : <options list>
     
    TList* lst = GetDataSources();
-   cout << "List of ODBC data sources:" << endl;
+   std::cout << "List of ODBC data sources:" << std::endl;
    TIter iter(lst);
    TNamed* n = 0;
    while ((n = (TNamed*) iter()) != 0) 
-      cout << "  " << n->GetName() << " : " << n->GetTitle() << endl; 
+      std::cout << "  " << n->GetName() << " : " << n->GetTitle() << std::endl; 
    delete lst;
 }
 
diff --git a/test/MainEvent.cxx b/test/MainEvent.cxx
index 5820c6edeb4..76648859397 100644
--- a/test/MainEvent.cxx
+++ b/test/MainEvent.cxx
@@ -94,6 +94,7 @@
 
 #include "Event.h"
 
+using namespace std;
 
 //______________________________________________________________________________
 int main(int argc, char **argv)
@@ -177,7 +178,7 @@ int main(int argc, char **argv)
       } else {    //read random
          Int_t evrandom;
          for (ev = 0; ev < nevent; ev++) {
-            if (ev%printev == 0) cout<<"event="<<ev<<endl;
+            if (ev%printev == 0) std::cout<<"event="<<ev<<std::endl;
             evrandom = Int_t(nevent*gRandom->Rndm(1));
             nb += tree->GetEntry(evrandom);  //read complete event in memory
          }
diff --git a/test/QpRandomDriver.cxx b/test/QpRandomDriver.cxx
index b8531aa0133..a4a2d975cb1 100644
--- a/test/QpRandomDriver.cxx
+++ b/test/QpRandomDriver.cxx
@@ -16,11 +16,11 @@ int main(int argc,char *argv[])
     m1 = atoi(argv[2]);
     m2 = atoi(argv[3]);
   } else {
-    cout << endl 
-         << " Usage: QpRandomDriver n my mz " << endl
-         << " where n  = # primal variables, " << endl
-         << "       my = # equality constraints, " << endl
-         << "       mz = # inequality constraints " << endl << endl;
+    std::cout << std::endl 
+         << " Usage: QpRandomDriver n my mz " << std::endl
+         << " where n  = # primal variables, " << std::endl
+         << "       my = # equality constraints, " << std::endl
+         << "       mz = # inequality constraints " << std::endl << std::endl;
     return 1;
   }
 
@@ -46,22 +46,22 @@ int main(int argc,char *argv[])
   delete s;
 
   if (status == 0) {
-    cout.precision(4);
-    cout << endl << "Computed solution:\n\n" <<endl <<endl;
+    std::cout.precision(4);
+    std::cout << std::endl << "Computed solution:\n\n" <<std::endl <<std::endl;
     vars->fX.Print();
 
     TQpVar *temp = qp->MakeVariables(prob);
 
-    cout << endl << "Checking the solution...";
+    std::cout << std::endl << "Checking the solution...";
     if (SolutionMatches(vars,soln,temp,1e-4)) {
-      cout << "The solution appears to be correct." <<endl;
+      std::cout << "The solution appears to be correct." <<std::endl;
     } else {
-      cout << endl << "The solution may be wrong "
-	"(or the generated problem may be ill conditioned.)" <<endl;
+      std::cout << std::endl << "The solution may be wrong "
+	"(or the generated problem may be ill conditioned.)" <<std::endl;
     }
     delete temp;
   } else {
-    cout << "Could not solve this problem." <<endl;
+    std::cout << "Could not solve this problem." <<std::endl;
   }
 
   delete vars;
diff --git a/test/RootShower/RootShower.cxx b/test/RootShower/RootShower.cxx
index 80303204508..a3db39775ca 100644
--- a/test/RootShower/RootShower.cxx
+++ b/test/RootShower/RootShower.cxx
@@ -588,14 +588,14 @@ void RootShower::CloseWindow()
          fRootShowerEnv->SetValue("RootShower.fE0",fE0);
          fRootShowerEnv->SetValue("RootShower.fB",fB);
          fRootShowerEnv->SaveLevel(kEnvLocal);
-         cout << " Saving stuff .... " << endl;
+         std::cout << " Saving stuff .... " << std::endl;
 #ifdef R__WIN32
          gSystem->Exec("del .rootshowerrc");
          gSystem->Rename(".rootshowerrc.new",".rootshowerrc");
 #endif
       }
    }
-   cout << "Terminating RootShower" << endl;
+   std::cout << "Terminating RootShower" << std::endl;
    DeleteWindow();
    gApplication->Terminate(0);
 }
diff --git a/test/TBench.cxx b/test/TBench.cxx
index 7e1d8dd1800..8d368f6e927 100644
--- a/test/TBench.cxx
+++ b/test/TBench.cxx
@@ -41,7 +41,7 @@ namespace {
          print();
       }
       void print(const std::string& msg="")  {
-         cout << msg << " --- Counter: " << name << " " << count << endl;
+         std::cout << msg << " --- Counter: " << name << " " << count << std::endl;
       }
    };
 }
@@ -812,7 +812,7 @@ TSTLhitStar::~TSTLhitStar() {
 
 void TSTLhitStar::Clear(Option_t *)
 {
-   for (vector<THit*>::iterator it = fList2.begin(); it<fList2.end(); it++) {
+   for (std::vector<THit*>::iterator it = fList2.begin(); it<fList2.end(); it++) {
       delete (*it);
    }
    fList2.erase(fList2.begin(),fList2.end());
@@ -887,7 +887,7 @@ TSTLhitStarList::~TSTLhitStarList() {
 
 void TSTLhitStarList::Clear(Option_t *)
 {
-   for (list<THit*>::iterator it = fList2.begin(); it!=fList2.end(); it++) {
+   for (std::list<THit*>::iterator it = fList2.begin(); it!=fList2.end(); it++) {
       delete (*it);
    }
    fList2.erase(fList2.begin(),fList2.end());
@@ -1185,7 +1185,7 @@ TSTLhitStarMap::~TSTLhitStarMap() {
 
 void TSTLhitStarMap::Clear(Option_t *)
 {
-   for (map<int,THit*>::iterator it = fList2.begin(); it!=fList2.end(); it++) {
+   for (std::map<int,THit*>::iterator it = fList2.begin(); it!=fList2.end(); it++) {
       delete (*it).second;
    }
    fList2.clear();
diff --git a/test/bench.cxx b/test/bench.cxx
index 524305aa0d1..72b1425196a 100644
--- a/test/bench.cxx
+++ b/test/bench.cxx
@@ -31,6 +31,8 @@
 
 #include "TBench.h"
 
+using namespace std;
+
 struct TBenchData {
    TBenchData() : cp1(0), nbytes1(0), cp2w(0), cp2r(0), cx3(0), nbytes3(0), cp3w(0), cp3r(0)  {}
    TBenchData(const char *name, Double_t i_cp1, Float_t i_cx3, Long64_t i_nbytes1, Long64_t i_nbytes3, Double_t i_cp2w, Double_t i_cp3w, Double_t i_cp2r, Double_t i_cp3r) 
diff --git a/test/benchLinkDef.h b/test/benchLinkDef.h
index b0168f2d2be..e2f925a40b4 100644
--- a/test/benchLinkDef.h
+++ b/test/benchLinkDef.h
@@ -15,7 +15,7 @@
 #pragma link C++ class TSTLhitMultiMap+;
 //#pragma link C++ class TSTLhitHashSet;
 //#pragma link C++ class TSTLhitHashMultiset;
-#pragma link C++ class pair<int,THit>+;
+#pragma link C++ class std::pair<int,THit>+;
 
 #pragma link C++ class TSTLhitStar+;
 #pragma link C++ class TSTLhitStarList+;
@@ -24,7 +24,7 @@
 #pragma link C++ class TSTLhitStarMultiSet+;
 #pragma link C++ class TSTLhitStarMap+;
 #pragma link C++ class TSTLhitStarMultiMap+;
-#pragma link C++ class pair<int,THit*>+;
+#pragma link C++ class std::pair<int,THit*>+;
 
 #pragma link C++ class TCloneshit+;
 
diff --git a/test/ctorture.cxx b/test/ctorture.cxx
index 23c5c89c4c0..ba1f648c2e2 100644
--- a/test/ctorture.cxx
+++ b/test/ctorture.cxx
@@ -20,8 +20,8 @@ void Verify(const TComplex a, const TComplex b,
     ifail++;
     if(err<epsmax) {
       printf("Fail %s %e\n",where,err);
-      cout << a << endl;
-      cout << b << endl;
+      std::cout << a << std::endl;
+      std::cout << b << std::endl;
     }
   }
 }
diff --git a/test/guiviewer.cxx b/test/guiviewer.cxx
index 7e575aeadcd..6a2d8b7e3d5 100644
--- a/test/guiviewer.cxx
+++ b/test/guiviewer.cxx
@@ -273,7 +273,7 @@ void Viewer::SetRange(Float_t xmin, Float_t ymin, Float_t xmax, Float_t ymax,
 {
    fCanvas->Range(xmin,ymin,xmax,ymax);
 
-   //cerr << "x=[" << xmin << " - " << xmax << "], "
+   //std::cerr << "x=[" << xmin << " - " << xmax << "], "
    //     << "y=[" << ymin << " - " << ymax << "]\n";
 
    fHScale->SetWmin(xmin);
diff --git a/test/periodic/NdbMF.cxx b/test/periodic/NdbMF.cxx
index cf9f65f9563..598ceb51c13 100644
--- a/test/periodic/NdbMF.cxx
+++ b/test/periodic/NdbMF.cxx
@@ -34,7 +34,7 @@ NdbMF::Section(const char *name )
 void
 NdbMF::Add(NdbMT& )
 {
-	cout << "NdbMF::add(sec)" << endl;
+	std::cout << "NdbMF::add(sec)" << std::endl;
 } // Add
 
 /* ---------- EnumerateENDFType ---------- */
@@ -45,6 +45,6 @@ NdbMF::Add(NdbMT& )
 Int_t
 NdbMF::EnumerateENDFType( Int_t )
 {
-	cout << "NdbMF ::enumerateENDFSection" << endl;
+	std::cout << "NdbMF ::enumerateENDFSection" << std::endl;
 	return 0;
 } // EnumerateENDFType
diff --git a/test/periodic/NdbMTReactionXS.cxx b/test/periodic/NdbMTReactionXS.cxx
index 95d37f337eb..f30297d04e9 100644
--- a/test/periodic/NdbMTReactionXS.cxx
+++ b/test/periodic/NdbMTReactionXS.cxx
@@ -89,19 +89,19 @@ NdbMTReactionXS::Interpolate( Float_t e )
 
 	switch (IT) {
 		case IT_LINLOG:
-			cout << "Linear-Log interpolation" << endl;
+			std::cout << "Linear-Log interpolation" << std::endl;
 			return 0.0;
 
 		case IT_LOGLIN:
-			cout << "Log-Linear interpolation" << endl;
+			std::cout << "Log-Linear interpolation" << std::endl;
 			return 0.0;
 
 		case IT_LOGLOG:
-			cout << "Log-Log interpolation" << endl;
+			std::cout << "Log-Log interpolation" << std::endl;
 			return 0.0;
 
 		case IT_GAMOW:
-			cout << "GAMOW interpolation" << endl;
+			std::cout << "GAMOW interpolation" << std::endl;
 			return 0.0;
 
 		case IT_LINLIN:
diff --git a/test/periodic/NdbParticleList.cxx b/test/periodic/NdbParticleList.cxx
index d5c22a7448f..acad6b345e3 100644
--- a/test/periodic/NdbParticleList.cxx
+++ b/test/periodic/NdbParticleList.cxx
@@ -49,5 +49,5 @@ NdbParticleList::Name()
 void
 NdbParticleList::Add(NdbParticle *, Int_t)
 {
-	cout << "NdbParticleList::add()" << endl;
+	std::cout << "NdbParticleList::add()" << std::endl;
 } // Add
diff --git a/test/stressFit.cxx b/test/stressFit.cxx
index 7c3ba6d578e..ffe39a674ed 100644
--- a/test/stressFit.cxx
+++ b/test/stressFit.cxx
@@ -78,7 +78,7 @@ void StatusPrint(Int_t id,const TString &title,Bool_t status)
   TString header = TString("Test ")+number+" : "+title;
   const Int_t nch = header.Length();
   for (Int_t i = nch; i < kMAX; i++) header += '.';
-  cout << header << (status ? "OK" : "FAILED") << endl;
+  std::cout << header << (status ? "OK" : "FAILED") << std::endl;
 }
 
 //______________________________________________________________________________
@@ -603,16 +603,16 @@ Int_t stressFit(const char *theFitter, Int_t N)
 {
   TVirtualFitter::SetDefaultFitter(theFitter);
   
-  cout << "******************************************************************" <<endl;
-  cout << "*  Minimization - S T R E S S suite                              *" <<endl;
-  cout << "******************************************************************" <<endl;
-  cout << "******************************************************************" <<endl;
+  std::cout << "******************************************************************" <<std::endl;
+  std::cout << "*  Minimization - S T R E S S suite                              *" <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
 
    TStopwatch timer;
    timer.Start();
 
-  cout << "*  Starting  S T R E S S  with fitter : "<<TVirtualFitter::GetDefaultFitter() <<endl;
-  cout << "******************************************************************" <<endl;
+  std::cout << "*  Starting  S T R E S S  with fitter : "<<TVirtualFitter::GetDefaultFitter() <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
 
   gBenchmark->Start("stressFit");
 
diff --git a/test/stressGUI.cxx b/test/stressGUI.cxx
index 841b2307165..9c12e112b33 100644
--- a/test/stressGUI.cxx
+++ b/test/stressGUI.cxx
@@ -218,23 +218,23 @@ void stressGUI()
    if (gOptionRef) {
       fprintf(sgref, "Test#     Size#\n");
    } else {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting  GUI - S T R E S S suite                                 *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting  GUI - S T R E S S suite                                 *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    gTestNum = 0;
 
    gBenchmark->Start("stressGUI");
 
    if (!gOptionRef) {
-      cout << "*  Running macros in $ROOTSYS/tutorials/gui - S T R E S S            *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "*  Running macros in $ROOTSYS/tutorials/gui - S T R E S S            *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    run_tutorials();
    if (!gOptionRef) {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting Basic GUI Widgets - S T R E S S                          *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting Basic GUI Widgets - S T R E S S                          *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    testLayout();
    testTextAlign();
@@ -248,9 +248,9 @@ void stressGUI()
    testNumberEntry();
    testTableLayout();
    if (!gOptionRef) {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting High Level GUI Widgets - S T R E S S                     *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting High Level GUI Widgets - S T R E S S                     *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    testPack();
    testSearchDlg();
@@ -269,32 +269,32 @@ void stressGUI()
    if (!gOptionRef) {
 
       if (gOptionFull) {
-         cout << "**********************************************************************" <<endl;
-         cout << "*  Starting Drag and Drop playback - S T R E S S                     *" <<endl;
-         cout << "**********************************************************************" <<endl;
+         std::cout << "**********************************************************************" <<std::endl;
+         std::cout << "*  Starting Drag and Drop playback - S T R E S S                     *" <<std::endl;
+         std::cout << "**********************************************************************" <<std::endl;
          dnd_playback();
 
-         cout << "**********************************************************************" <<endl;
-         cout << "*  Starting MDI test playback - S T R E S S                          *" <<endl;
-         cout << "**********************************************************************" <<endl;
+         std::cout << "**********************************************************************" <<std::endl;
+         std::cout << "*  Starting MDI test playback - S T R E S S                          *" <<std::endl;
+         std::cout << "**********************************************************************" <<std::endl;
          mditest_playback();
 
-         cout << "**********************************************************************" <<endl;
-         cout << "*  Starting guitest recorder playback - S T R E S S                  *" <<endl;
-         cout << "**********************************************************************" <<endl;
+         std::cout << "**********************************************************************" <<std::endl;
+         std::cout << "*  Starting guitest recorder playback - S T R E S S                  *" <<std::endl;
+         std::cout << "**********************************************************************" <<std::endl;
          guitest_playback();
 
-         cout << "**********************************************************************" <<endl;
-         cout << "*  Starting fit panel recorder playback - S T R E S S                *" <<endl;
-         cout << "**********************************************************************" <<endl;
+         std::cout << "**********************************************************************" <<std::endl;
+         std::cout << "*  Starting fit panel recorder playback - S T R E S S                *" <<std::endl;
+         std::cout << "**********************************************************************" <<std::endl;
          fitpanel_playback();
 
-         cout << "**********************************************************************" <<endl;
-         cout << "*  Starting graphic editors recorder playback - S T R E S S          *" <<endl;
-         cout << "**********************************************************************" <<endl;
+         std::cout << "**********************************************************************" <<std::endl;
+         std::cout << "*  Starting graphic editors recorder playback - S T R E S S          *" <<std::endl;
+         std::cout << "**********************************************************************" <<std::endl;
          graph_edit_playback();
       }
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
 
       gBenchmark->Stop("stressGUI");
 
@@ -388,15 +388,15 @@ Bool_t VerifySize(const char *filename, const char *title)
       snprintf(gLine,80,"Test %2d: %s", gTestNum, title);
       const Int_t nch = strlen(gLine);
       if (success) {
-         cout << gLine;
-         for (Int_t i = nch; i < 67; i++) cout << ".";
-         cout << " OK" << endl;
+         std::cout << gLine;
+         for (Int_t i = nch; i < 67; i++) std::cout << ".";
+         std::cout << " OK" << std::endl;
       } else {
-         cout << gLine;
-         for (Int_t i = nch; i < 63; i++) cout << ".";
-         cout << " FAILED" << endl;
-         cout << "         File Size = "  << fsize << endl;
-         cout << "          Ref Size = "  << sizes[gTestNum] << endl;
+         std::cout << gLine;
+         for (Int_t i = nch; i < 63; i++) std::cout << ".";
+         std::cout << " FAILED" << std::endl;
+         std::cout << "         File Size = "  << fsize << std::endl;
+         std::cout << "          Ref Size = "  << sizes[gTestNum] << std::endl;
       }
    } else {
       fprintf(sgref, "%5d%10d\n", gTestNum, fsize);
diff --git a/test/stressGraphics.cxx b/test/stressGraphics.cxx
index 4c50547e91e..382837bdaf0 100644
--- a/test/stressGraphics.cxx
+++ b/test/stressGraphics.cxx
@@ -259,11 +259,11 @@ void stressGraphics(Int_t verbose = 0)
    gRandom->SetSeed(65539);
 
    if (gOptionR) {
-      cout << "Test#   PS1Ref#   PS1Err#   PDFRef#   PDFErr#   GIFRef#   GIFErr#   JPGRef#   JPGErr#   PNGRef#   PNGErr#   PS2Ref#   PS2Err#" <<endl;
+      std::cout << "Test#   PS1Ref#   PS1Err#   PDFRef#   PDFErr#   GIFRef#   GIFErr#   JPGRef#   JPGErr#   PNGRef#   PNGErr#   PS2Ref#   PS2Err#" <<std::endl;
    } else {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting  Graphics - S T R E S S suite                            *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting  Graphics - S T R E S S suite                            *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
 
    gVerbose = verbose;
@@ -272,8 +272,8 @@ void stressGraphics(Int_t verbose = 0)
    gBenchmark->Start("stressGraphics");
 
    if (!gOptionR) {
-      cout << "*  Starting Basic Graphics - S T R E S S                             *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "*  Starting Basic Graphics - S T R E S S                             *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    tline        ();
    tmarker      ();
@@ -291,9 +291,9 @@ void stressGraphics(Int_t verbose = 0)
    transpad     ();
    statfitparam ();
    if (!gOptionR) {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting High Level 2D Primitives - S T R E S S                   *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting High Level 2D Primitives - S T R E S S                   *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    tgaxis1      ();
    tgaxis2      ();
@@ -309,9 +309,9 @@ void stressGraphics(Int_t verbose = 0)
    tmultigraph2 ();
    waves        ();
    if (!gOptionR) {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting High Level 3D Primitives - S T R E S S                   *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting High Level 3D Primitives - S T R E S S                   *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    options2d1   ();
    options2d2   ();
@@ -323,9 +323,9 @@ void stressGraphics(Int_t verbose = 0)
    tgraph2d2    ();
    tgraph2d3    ();
    if (!gOptionR) {
-      cout << "**********************************************************************" <<endl;
-      cout << "*  Starting complex drawing and TPad - S T R E S S                   *" <<endl;
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
+      std::cout << "*  Starting complex drawing and TPad - S T R E S S                   *" <<std::endl;
+      std::cout << "**********************************************************************" <<std::endl;
    }
    ntuple1      ();
    quarks       ();
@@ -335,7 +335,7 @@ void stressGraphics(Int_t verbose = 0)
    parallelcoord();
 ///clonepad     ();
    if (!gOptionR) {
-      cout << "**********************************************************************" <<endl;
+      std::cout << "**********************************************************************" <<std::endl;
 
       gBenchmark->Stop("stressGraphics");
 
@@ -391,21 +391,21 @@ Int_t StatusPrint(TString &filename, Int_t id, const TString &title,
 
       const Int_t nch = strlen(gLine);
       if (TMath::Abs(res-ref)<=err) {
-         cout << gLine;
-         for (Int_t i = nch; i < 67; i++) cout << ".";
-         cout << " OK" << endl;
+         std::cout << gLine;
+         for (Int_t i = nch; i < 67; i++) std::cout << ".";
+         std::cout << " OK" << std::endl;
          if (!gOptionK) gSystem->Unlink(filename.Data());
       } else {
-         cout << gLine;
+         std::cout << gLine;
          Int_t ndots = 60;
          Int_t w = 3;
          if (gTestNum < 10) { ndots++; w--;}
-         for (Int_t i = nch; i < ndots; i++) cout << ".";
-         cout << setw(w) << gTestNum << " FAILED" << endl;
-         cout << "         Result    = "  << res << endl;
-         cout << "         Reference = "  << ref << endl;
-         cout << "         Error     = "  << TMath::Abs(res-ref)
-                                          << " (was " << err << ")"<< endl;
+         for (Int_t i = nch; i < ndots; i++) std::cout << ".";
+         std::cout << std::setw(w) << gTestNum << " FAILED" << std::endl;
+         std::cout << "         Result    = "  << res << std::endl;
+         std::cout << "         Reference = "  << ref << std::endl;
+         std::cout << "         Error     = "  << TMath::Abs(res-ref)
+                                          << " (was " << err << ")"<< std::endl;
          return 1;
       }
    } else {
@@ -2030,7 +2030,7 @@ void earth()
    TH2F *h2 = new TH2F("h02","Mercator",  50, -180, 180, 50, -80.5, 80.5);
    TH2F *h3 = new TH2F("h03","Sinusoidal",50, -180, 180, 50, -90.5, 90.5);
    TH2F *h4 = new TH2F("h04","Parabolic", 50, -180, 180, 50, -90.5, 90.5);
-   ifstream in;
+   std::ifstream in;
    in.open("../tutorials/graphics/earth.dat");
    if (!in) {
       in.clear();
diff --git a/test/stressHistogram.cxx b/test/stressHistogram.cxx
index 74b507c647f..8c7e1e6ff08 100644
--- a/test/stressHistogram.cxx
+++ b/test/stressHistogram.cxx
@@ -88,6 +88,8 @@
 #include <algorithm>
 #include <cassert>
 
+using namespace std;
+
 const unsigned int __DRAW__ = 0;
 
 const Double_t minRange = 1;
@@ -150,7 +152,7 @@ int equals(const char* msg, THnBase* h1, THnBase* h2, int options = 0, double ER
 int equals(const char* msg, THnBase* h1, TH1* h2, int options = 0, double ERRORLIMIT = defaultErrorLimit);
 int equals(Double_t n1, Double_t n2, double ERRORLIMIT = defaultErrorLimit);
 int compareStatistics( TH1* h1, TH1* h2, bool debug, double ERRORLIMIT = defaultErrorLimit);
-ostream& operator<<(ostream& out, TH1D* h);
+std::ostream& operator<<(std::ostream& out, TH1D* h);
 // old stresHistOpts.cxx file
 
 bool testAdd1() 
@@ -5797,16 +5799,16 @@ bool testInterpolation1D()
      
       if (  fabs(ip  - function1D(xp) ) > 1.E-13*fabs(ip) ) {
          status = true;
-         cout << "x: " << xp 
+         std::cout << "x: " << xp 
               << " h3->Inter: " << ip
               << " functionD: " << function1D(xp)
               << " diff: " << fabs(ip  - function1D(xp))
-              << endl;
+              << std::endl;
       }
    }
 
    delete h1;
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testInterpolation1D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testInterpolation1D: \t" << (status?"FAILED":"OK") << std::endl;
    return status; 
 }
 
@@ -5836,16 +5838,16 @@ bool testInterpolationVar1D()
      
       if (  fabs(ip  - function1D(xp) ) > 1.E-13*fabs(ip) ) {
          status = true;
-         cout << "x: " << xp 
+         std::cout << "x: " << xp 
               << " h3->Inter: " << ip
               << " functionD: " << function1D(xp)
               << " diff: " << fabs(ip  - function1D(xp))
-              << endl;
+              << std::endl;
       }
    }
 
    delete h1;
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testInterpolaVar1D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testInterpolaVar1D: \t" << (status?"FAILED":"OK") << std::endl;
    return status; 
 }
 
@@ -5886,16 +5888,16 @@ bool testInterpolation2D()
      
       if (  fabs(ip  - function2D(xp, yp) ) > 1.E-13*fabs(ip) ) {
          status = true;
-         cout << "x: " << xp << " y: " << yp
+         std::cout << "x: " << xp << " y: " << yp
               << " h3->Inter: " << ip
               << " function: " << function2D(xp, yp)
               << " diff: " << fabs(ip  - function2D(xp, yp))
-              << endl;
+              << std::endl;
       }
    }
 
    delete h1;
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testInterpolation2D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testInterpolation2D: \t" << (status?"FAILED":"OK") << std::endl;
    return status; 
 }
 
@@ -5945,7 +5947,7 @@ bool testInterpolation3D()
 
    delete h1;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testInterpolation3D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testInterpolation3D: \t" << (status?"FAILED":"OK") << std::endl;
 
    return status; 
 }
@@ -6473,12 +6475,12 @@ int findBin(ROOT::Fit::BinData& bd, const double *x)
       double value1, error1;
       const double *x1 = bd.GetPoint(i, value1, error1);
 
-//       cout << "\ti: " << i
+//       std::cout << "\ti: " << i
 //            << " x: ";
-//       std::copy(x1, x1+ndim, ostream_iterator<double>(cout, " "));
-//       cout << " val: " << value1
+//       std::copy(x1, x1+ndim, ostream_iterator<double>(std::cout, " "));
+//       std::cout << " val: " << value1
 //            << " error: " << error1
-//            << endl;
+//            << std::endl;
 
       bool thisIsIt = true;
       for ( unsigned int j = 0; j < ndim; ++j )
@@ -6486,12 +6488,12 @@ int findBin(ROOT::Fit::BinData& bd, const double *x)
          thisIsIt &= fabs(x1[j] - x[j]) < 1E-15;
       }
       if ( thisIsIt ) { 
-//          cout << "RETURNED!" << endl;
+//          std::cout << "RETURNED!" << std::endl;
          return i; 
       }
    }
 
-//    cout << "ERROR FINDING BIN!" << endl;
+//    std::cout << "ERROR FINDING BIN!" << std::endl;
    return -1;
 }
 
@@ -6507,12 +6509,12 @@ bool operator ==(ROOT::Fit::BinData& bd1, ROOT::Fit::BinData& bd2)
       double value1, error1;
       const double *x1 = bd1.GetPoint(i, value1, error1);
 
-//       cout << "i: " << i
+//       std::cout << "i: " << i
 //            << " x: ";
-//       std::copy(x1, x1+ndim, ostream_iterator<double>(cout, " "));
-//       cout << " val: " << value1
+//       std::copy(x1, x1+ndim, ostream_iterator<double>(std::cout, " "));
+//       std::cout << " val: " << value1
 //            << " error: " << error1
-//            << endl;
+//            << std::endl;
 
       int bin = findBin(bd2, x1);
       if ( bin < 0 )
@@ -6534,7 +6536,7 @@ bool operator ==(ROOT::Fit::BinData& bd1, ROOT::Fit::BinData& bd2)
 
 
 int findBin(ROOT::Fit::SparseData& sd, 
-            const vector<double>& minRef, const vector<double>& maxRef,
+            const std::vector<double>& minRef, const std::vector<double>& maxRef,
             const double valRef, const double errorRef)
 {
    const unsigned int ndim = sd.NDim();
@@ -6542,42 +6544,42 @@ int findBin(ROOT::Fit::SparseData& sd,
 
    for ( unsigned int i = 0; i < npoints; ++i )
    {
-      vector<double> min(ndim);
-      vector<double> max(ndim);
+      std::vector<double> min(ndim);
+      std::vector<double> max(ndim);
       double val;
       double error;
       sd.GetPoint(i, min, max, val, error);
 
-//       cout << "\ti: " << i
+//       std::cout << "\ti: " << i
 //            << " min: ";
-//       std::copy(min.begin(), min.end(), ostream_iterator<double>(cout, " "));
-//       cout << " max: ";
-//       std::copy(max.begin(), max.end(), ostream_iterator<double>(cout, " "));
-//       cout << " val: " << val
+//       std::copy(min.begin(), min.end(), ostream_iterator<double>(std::cout, " "));
+//       std::cout << " max: ";
+//       std::copy(max.begin(), max.end(), ostream_iterator<double>(std::cout, " "));
+//       std::cout << " val: " << val
 //            << " error: " << error
-//            << endl;
+//            << std::endl;
 
       bool thisIsIt = true;
-//       cout << "\t\t" << thisIsIt << " ";
+//       std::cout << "\t\t" << thisIsIt << " ";
       thisIsIt &= !equals(valRef, val, 1E-8);
-//       cout << thisIsIt << " ";
+//       std::cout << thisIsIt << " ";
       thisIsIt &= !equals(errorRef, error, 1E-15);
-//       cout << thisIsIt << " ";
+//       std::cout << thisIsIt << " ";
       for ( unsigned int j = 0; j < ndim && thisIsIt; ++j )
       {
          thisIsIt &= !equals(minRef[j], min[j]);
-//          cout << thisIsIt << " ";
+//          std::cout << thisIsIt << " ";
          thisIsIt &= !equals(maxRef[j], max[j]);
-//          cout << thisIsIt << " ";
+//          std::cout << thisIsIt << " ";
       }
-//       cout << thisIsIt << " " << endl;
+//       std::cout << thisIsIt << " " << std::endl;
       if ( thisIsIt ) { 
-//          cout << "RETURNING " << i << endl; 
+//          std::cout << "RETURNING " << i << std::endl; 
          return i; 
       }
    }
 
-//    cout << "ERROR FINDING BIN!" << endl;
+//    std::cout << "ERROR FINDING BIN!" << std::endl;
    return -1;
 }
 bool operator ==(ROOT::Fit::SparseData& sd1, ROOT::Fit::SparseData& sd2)
@@ -6591,8 +6593,8 @@ bool operator ==(ROOT::Fit::SparseData& sd1, ROOT::Fit::SparseData& sd2)
 
    for ( unsigned int i = 0; i < npoints1 && equals; ++i )
    {
-      vector<double> min(ndim);
-      vector<double> max(ndim);
+      std::vector<double> min(ndim);
+      std::vector<double> max(ndim);
       double val;
       double error;
       sd1.GetPoint(i, min, max, val, error);
@@ -6602,8 +6604,8 @@ bool operator ==(ROOT::Fit::SparseData& sd1, ROOT::Fit::SparseData& sd2)
 
    for ( unsigned int i = 0; i < npoints2 && equals; ++i )
    {
-      vector<double> min(ndim);
-      vector<double> max(ndim);
+      std::vector<double> min(ndim);
+      std::vector<double> max(ndim);
       double val;
       double error;
       sd2.GetPoint(i, min, max, val, error);
@@ -6646,7 +6648,7 @@ bool testSparseData1DFull()
    delete h1;
    delete s1;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testSparseData1DFull: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testSparseData1DFull: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6682,7 +6684,7 @@ bool testSparseData1DSparse()
    delete h1;
    delete s1;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testSparseData1DSpar: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testSparseData1DSpar: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6720,7 +6722,7 @@ bool testSparseData2DFull()
    delete h2;
    delete s2;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testSparseData2DFull: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testSparseData2DFull: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6758,7 +6760,7 @@ bool testSparseData2DSparse()
    delete h2;
    delete s2;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testSparseData2DSpar: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testSparseData2DSpar: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6798,7 +6800,7 @@ bool testSparseData3DFull()
    delete h3;
    delete s3;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testSparseData3DFull: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testSparseData3DFull: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6838,7 +6840,7 @@ bool testSparseData3DSparse()
    delete h3;
    delete s3;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testSparseData3DSpar: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testSparseData3DSpar: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6877,7 +6879,7 @@ bool testBinDataData1D()
    delete h1;
    delete s1;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testBinDataData1D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testBinDataData1D: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6919,7 +6921,7 @@ bool testBinDataData2D()
    delete h2;
    delete s2;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testBinDataData2D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testBinDataData2D: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -6963,7 +6965,7 @@ bool testBinDataData3D()
    delete h3;
    delete s3;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testBinDataData3D: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testBinDataData3D: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -7006,7 +7008,7 @@ bool testBinDataData1DInt()
    delete h1;
    delete s1;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testBinDataData1DInt: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testBinDataData1DInt: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -7052,7 +7054,7 @@ bool testBinDataData2DInt()
    delete h2;
    delete s2;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testBinDataData2DInt: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testBinDataData2DInt: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -7100,7 +7102,7 @@ bool testBinDataData3DInt()
    delete h3;
    delete s3;
 
-   if ( defaultEqualOptions & cmpOptPrint ) cout << "testBinDataData3DInt: \t" << (status?"FAILED":"OK") << endl;
+   if ( defaultEqualOptions & cmpOptPrint ) std::cout << "testBinDataData3DInt: \t" << (status?"FAILED":"OK") << std::endl;
    return status;
 }
 
@@ -7499,8 +7501,8 @@ bool testArrayRebin()
 #ifdef __DEBUG__
    std::cout << "min range = " << minRange << " max range " << maxRange << std::endl;
    for ( Int_t i = 0; i < rebin; ++i ) 
-      cout << rebinArray[i] << endl;
-   cout << "rebin: " << rebin << endl;
+      std::cout << rebinArray[i] << std::endl;
+   std::cout << "rebin: " << rebin << std::endl;
 #endif
 
    TH1D* h2 = static_cast<TH1D*>( h1->Rebin(rebin - 1, "testArrayRebin", rebinArray) );
@@ -7547,8 +7549,8 @@ bool testArrayRebinProfile()
 
    #ifdef __DEBUG__
    for ( Int_t i = 0; i < rebin; ++i ) 
-      cout << rebinArray[i] << endl;
-   cout << "rebin: " << rebin << endl;
+      std::cout << rebinArray[i] << std::endl;
+   std::cout << "rebin: " << rebin << std::endl;
    #endif
 
    TProfile* p2 = static_cast<TProfile*>( p1->Rebin(rebin - 1, "testArrayRebinProf", rebinArray) );
@@ -8769,7 +8771,7 @@ public:
                        h3->GetZaxis()->FindBin(z) >= zmin && h3->GetZaxis()->FindBin(z) <= zmax )
                   {
                      if ( defaultEqualOptions & cmpOptPrint )
-                        cout << "Filling (" << x << "," << y << "," << z << ")!" << endl;
+                        std::cout << "Filling (" << x << "," << y << "," << z << ")!" << std::endl;
                      
                      h2XY->Fill(x,y);
                      h2XZ->Fill(x,z);
@@ -8869,7 +8871,7 @@ public:
       status += equals("TH3 -> ZY", h2ZY, (TH2D*) h3->Project3D("YZ"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
       
       // TH1 derived from TH3
       options = cmpOptStats;
@@ -8889,7 +8891,7 @@ public:
 
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
       
       // TH1 derived from h2XY
       options = cmpOptStats;
@@ -8912,7 +8914,7 @@ public:
       status += equals("TH2ZY -> Y", h1Y, (TH1D*) h2ZY->ProjectionY("y"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
 
       // in the following comparison with profiles we need to re-calculate statistics using bin centers 
@@ -8940,7 +8942,7 @@ public:
       status += equals("TH3 -> PBZY", h2ZY, (TH2D*) h3->Project3DProfile("yz UF OF")->ProjectionXY("6", "B"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
       
       // test directly project3dprofile
       options = cmpOptStats;
@@ -8952,7 +8954,7 @@ public:
       status += equals("TH3 -> PZY", (TH2D*) pe2ZY, (TH2D*) h3->Project3DProfile("yz  UF OF"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
       
       // test option E of ProjectionXY
       options = 0;
@@ -8964,7 +8966,7 @@ public:
       status += equals("TH3 -> PEZY", (TH2D*) pe2ZY, (TH2D*) h3->Project3DProfile("yz  UF OF")->ProjectionXY("6", "E"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
       
       // test option W of ProjectionXY
       
@@ -8978,7 +8980,7 @@ public:
       status += equals("TH3 -> PWZY", (TH2D*) h2wZY, (TH2D*) h3->Project3DProfile("yz  UF OF")->ProjectionXY("6", "W"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
       
       // test 1D histograms
       options = cmpOptStats;
@@ -8999,7 +9001,7 @@ public:
       status += equals("TH2ZY -> PBY", h1Y, (TH1D*) h2ZY->ProfileY("PBY", 0,h2ZY->GetXaxis()->GetNbins()+1)->ProjectionX("1", "B"),options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
       // 1D testing direct profiles 
       options = cmpOptStats;
@@ -9017,7 +9019,7 @@ public:
       status += equals("TH2ZY -> PY", pe1YZ, (TH1D*) h2ZY->ProfileY("PY", 0,h2ZY->GetXaxis()->GetNbins()+1), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
       // 1D testing e profiles
       options = 0;
@@ -9047,7 +9049,7 @@ public:
                        (TH1D*) h2ZY->ProfileY("PEY", 0,h2ZY->GetXaxis()->GetNbins()+1)->ProjectionX("1", "E"), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
       // 1D testing w profiles
       // The error is not properly propagated when build with weights :S
@@ -9079,7 +9081,7 @@ public:
 
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
 
       // do THNsparse after Profile because reference histograms need to have a ResetStats
@@ -9102,7 +9104,7 @@ public:
       status += equals("THn3 -> ZY", h2ZY, (TH2D*) n3->Projection(1,2), options); 
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
       // TH1 derived from STH3
       options = cmpOptStats;
@@ -9115,7 +9117,7 @@ public:
       status += equals("THn3 -> Z", h1Z, (TH1D*) n3->Projection(2), options);
       options = 0;
       if ( defaultEqualOptions & cmpOptPrint )
-         cout << "----------------------------------------------" << endl;
+         std::cout << "----------------------------------------------" << std::endl;
 
       
       
@@ -9145,16 +9147,16 @@ int stressHistogram()
    TBenchmark bm;
    bm.Start("stressHistogram");
 
-   cout << "****************************************************************************" <<endl;
-   cout << "*  Starting  stress  H I S T O G R A M                                     *" <<endl;
-   cout << "****************************************************************************" <<endl;
+   std::cout << "****************************************************************************" <<std::endl;
+   std::cout << "*  Starting  stress  H I S T O G R A M                                     *" <<std::endl;
+   std::cout << "****************************************************************************" <<std::endl;
 
    // Test 1
    if ( defaultEqualOptions & cmpOptPrint )
-      cout << "**********************************\n"
+      std::cout << "**********************************\n"
            << "       Test without weights       \n" 
            << "**********************************\n"
-           << endl;
+           << std::endl;
 
 
    TH1::SetDefaultSumw2(); 
@@ -9175,10 +9177,10 @@ int stressHistogram()
 
    // Test 2
    if ( defaultEqualOptions & cmpOptPrint )
-      cout << "**********************************\n"
+      std::cout << "**********************************\n"
            << "        Test with weights         \n" 
            << "**********************************\n"
-           << endl;
+           << std::endl;
    
    ProjectionTester* ht2 = new ProjectionTester();
    ht2->buildHistogramsWithWeights();
@@ -9485,7 +9487,7 @@ int stressHistogram()
    return GlobalStatus;
 }
 
-ostream& operator<<(ostream& out, TH1D* h)
+std::ostream& operator<<(std::ostream& out, TH1D* h)
 {
    out << h->GetName() << ": [" << h->GetBinContent(1);
    for ( Int_t i = 1; i < h->GetNbinsX(); ++i )
@@ -9498,11 +9500,11 @@ ostream& operator<<(ostream& out, TH1D* h)
 void printResult(const char* msg, bool status)
 {
    static int counter = 1;
-   cout << "Test ";
-   cout.width(2);
-   cout<< counter << ": "
+   std::cout << "Test ";
+   std::cout.width(2);
+   std::cout<< counter << ": "
        << msg
-       << (status?"FAILED":"OK") << endl;
+       << (status?"FAILED":"OK") << std::endl;
    counter += 1;
 }
 
@@ -9566,7 +9568,7 @@ int equals(const char* msg, THnBase* h1, THnBase* h2, int options, double ERRORL
             Int_t bin[3] = {i, j, h};
             
             if (debug) {
-               cout << equals(x, h2->GetAxis(0)->GetBinCenter(i), ERRORLIMIT) << " "
+               std::cout << equals(x, h2->GetAxis(0)->GetBinCenter(i), ERRORLIMIT) << " "
                     << equals(y, h2->GetAxis(1)->GetBinCenter(j), ERRORLIMIT) << " "
                     << equals(z, h2->GetAxis(2)->GetBinCenter(h), ERRORLIMIT) << " "
                     << "[" << x << "," << y << "," << z << "]: " 
@@ -9576,7 +9578,7 @@ int equals(const char* msg, THnBase* h1, THnBase* h2, int options, double ERRORL
                     << " "   << equals(h1->GetBinError(bin)  , h2->GetBinError(bin),   ERRORLIMIT)
                     << " "   << differents
                     << " "   << (fabs(h1->GetBinContent(bin) - h2->GetBinContent(bin)))
-                    << endl;
+                    << std::endl;
             }
             differents += equals(x, h2->GetAxis(0)->GetBinCenter(i), ERRORLIMIT);
             differents += equals(y, h2->GetAxis(1)->GetBinCenter(j), ERRORLIMIT);
@@ -9591,7 +9593,7 @@ int equals(const char* msg, THnBase* h1, THnBase* h2, int options, double ERRORL
 //    if ( compareStats )
 //       differents += compareStatistics( h1, h2, debug, ERRORLIMIT);
    
-   if ( print || debug ) cout << msg << ": \t" << (differents?"FAILED":"OK") << endl;
+   if ( print || debug ) std::cout << msg << ": \t" << (differents?"FAILED":"OK") << std::endl;
    
    delete h2;
    
@@ -9651,7 +9653,7 @@ int equals(const char* msg, THnBase* s, TH1* h2, int options, double ERRORLIMIT)
          differents += equals(err1  , err2, ERRORLIMIT);
    }
 
-   if ( print || debug ) cout << msg << ": \t" << (differents?"FAILED":"OK") << endl;
+   if ( print || debug ) std::cout << msg << ": \t" << (differents?"FAILED":"OK") << std::endl;
    
    delete h2;
    
@@ -9668,8 +9670,8 @@ int equals(const char* msg, TH3D* h1, TH3D* h2, int options, double ERRORLIMIT)
    
    int differents = ( h1 == h2 ); // Check they are not the same histogram!
    if (debug) {
-      cout << static_cast<void*>(h1) << " " << static_cast<void*>(h2) << " "
-           << (h1 == h2 ) << " " << differents << endl;
+      std::cout << static_cast<void*>(h1) << " " << static_cast<void*>(h2) << " "
+           << (h1 == h2 ) << " " << differents << std::endl;
    }
    
    for ( int i = 0; i <= h1->GetNbinsX() + 1; ++i )
@@ -9682,7 +9684,7 @@ int equals(const char* msg, TH3D* h1, TH3D* h2, int options, double ERRORLIMIT)
          
          if (debug)
          {
-            cout << equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT) << " "
+            std::cout << equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT) << " "
                  << equals(y, h2->GetYaxis()->GetBinCenter(j), ERRORLIMIT) << " "
                  << equals(z, h2->GetZaxis()->GetBinCenter(h), ERRORLIMIT) << " "
                  << "[" << x << "," << y << "," << z << "]: " 
@@ -9692,7 +9694,7 @@ int equals(const char* msg, TH3D* h1, TH3D* h2, int options, double ERRORLIMIT)
                  << " "   << equals(h1->GetBinError(i,j,h)  , h2->GetBinError(i,j,h),   ERRORLIMIT)
                  << " "   << differents
                  << " "   << (fabs(h1->GetBinContent(i,j,h) - h2->GetBinContent(i,j,h)))
-                 << endl;
+                 << std::endl;
          }
          differents += (bool) equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT);
          differents += (bool) equals(y, h2->GetYaxis()->GetBinCenter(j), ERRORLIMIT);
@@ -9706,7 +9708,7 @@ int equals(const char* msg, TH3D* h1, TH3D* h2, int options, double ERRORLIMIT)
    if ( compareStats )
       differents += compareStatistics( h1, h2, debug, ERRORLIMIT);
    
-   if ( print || debug ) cout << msg << ": \t" << (differents?"FAILED":"OK") << endl;
+   if ( print || debug ) std::cout << msg << ": \t" << (differents?"FAILED":"OK") << std::endl;
    
    delete h2;
    
@@ -9723,8 +9725,8 @@ int equals(const char* msg, TH2D* h1, TH2D* h2, int options, double ERRORLIMIT)
    
    int differents = ( h1 == h2 ); // Check they are not the same histogram!
    if (debug) {
-      cout << static_cast<void*>(h1) << " " << static_cast<void*>(h2) << " "
-           << (h1 == h2 ) << " " << differents << endl;
+      std::cout << static_cast<void*>(h1) << " " << static_cast<void*>(h2) << " "
+           << (h1 == h2 ) << " " << differents << std::endl;
    }
 
    for ( int i = 0; i <= h1->GetNbinsX() + 1; ++i )
@@ -9735,7 +9737,7 @@ int equals(const char* msg, TH2D* h1, TH2D* h2, int options, double ERRORLIMIT)
          
          if (debug)
          {
-            cout << equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT) << " "
+            std::cout << equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT) << " "
                  << equals(y, h2->GetYaxis()->GetBinCenter(j), ERRORLIMIT) << " "
                  << "[" << x << "," << y << "]: " 
                  << h1->GetBinContent(i,j) << " +/- " << h1->GetBinError(i,j) << " | "
@@ -9744,7 +9746,7 @@ int equals(const char* msg, TH2D* h1, TH2D* h2, int options, double ERRORLIMIT)
                  << " "   << equals(h1->GetBinError(i,j)  , h2->GetBinError(i,j),   ERRORLIMIT)
                  << " "   << differents
                  << " "   << (fabs(h1->GetBinContent(i,j) - h2->GetBinContent(i,j)))
-                 << endl;
+                 << std::endl;
          }
          differents += (bool) equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT);
          differents += (bool) equals(y, h2->GetYaxis()->GetBinCenter(j), ERRORLIMIT);
@@ -9757,7 +9759,7 @@ int equals(const char* msg, TH2D* h1, TH2D* h2, int options, double ERRORLIMIT)
    if ( compareStats )
       differents += compareStatistics( h1, h2, debug, ERRORLIMIT);
    
-   if ( print || debug ) cout << msg << ": \t" << (differents?"FAILED":"OK") << endl;
+   if ( print || debug ) std::cout << msg << ": \t" << (differents?"FAILED":"OK") << std::endl;
    
    delete h2;
    
@@ -9774,13 +9776,13 @@ int equals(const char* msg, TH1D* h1, TH1D* h2, int options, double ERRORLIMIT)
    
 
    if (debug) { 
-      cout << "Nbins  = " << h1->GetXaxis()->GetNbins() << " ,  " <<  h2->GetXaxis()->GetNbins() << endl;
+      std::cout << "Nbins  = " << h1->GetXaxis()->GetNbins() << " ,  " <<  h2->GetXaxis()->GetNbins() << std::endl;
    }
 
    int differents = ( h1 == h2 ); // Check they are not the same histogram!
    if (debug) {
-      cout << static_cast<void*>(h1) << " " << static_cast<void*>(h2) << " "
-           << (h1 == h2 ) << " " << differents << endl;
+      std::cout << static_cast<void*>(h1) << " " << static_cast<void*>(h2) << " "
+           << (h1 == h2 ) << " " << differents << std::endl;
    }
 
    for ( int i = 0; i <= h1->GetNbinsX() + 1; ++i )
@@ -9788,14 +9790,14 @@ int equals(const char* msg, TH1D* h1, TH1D* h2, int options, double ERRORLIMIT)
       Double_t x = h1->GetXaxis()->GetBinCenter(i);
       if ( debug )
       {
-         cout << equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT)
+         std::cout << equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT)
               << " [" << x << "]: " 
               << h1->GetBinContent(i) << " +/- " << h1->GetBinError(i) << " | "
               << h2->GetBinContent(i) << " +/- " << h2->GetBinError(i)
               << " | " << equals(h1->GetBinContent(i), h2->GetBinContent(i), ERRORLIMIT)
               << " "   << equals(h1->GetBinError(i),   h2->GetBinError(i),   ERRORLIMIT)
               << " "   << differents
-              << endl;
+              << std::endl;
       }
       differents += (bool) equals(x, h2->GetXaxis()->GetBinCenter(i), ERRORLIMIT);
       differents += (bool) equals(h1->GetBinContent(i), h2->GetBinContent(i), ERRORLIMIT);
@@ -9808,7 +9810,7 @@ int equals(const char* msg, TH1D* h1, TH1D* h2, int options, double ERRORLIMIT)
    if ( compareStats )
       differents += compareStatistics( h1, h2, debug, ERRORLIMIT);
    
-   if ( print || debug ) cout << msg << ": \t" << (differents?"FAILED":"OK") << endl;
+   if ( print || debug ) std::cout << msg << ": \t" << (differents?"FAILED":"OK") << std::endl;
    
    delete h2;
    
@@ -9843,27 +9845,27 @@ int compareStatistics( TH1* h1, TH1* h2, bool debug, double ERRORLIMIT)
    differents += (bool) equals(chi_21, 1, ERRORLIMIT);  
    differents += (bool) equals(chi_12, chi_21, ERRORLIMIT);
    if ( debug )
-      cout << "Chi2Test " << chi_12 << " " <<  chi_21 
+      std::cout << "Chi2Test " << chi_12 << " " <<  chi_21 
            << " | " << differents
-           << endl;
+           << std::endl;
 
    if (!debug) gErrorIgnoreLevel = precLevel; 
 
    // Mean
    differents += (bool) equals(h1->GetMean(1), h2->GetMean(1), ERRORLIMIT);
    if ( debug )
-      cout << "Mean: " << h1->GetMean(1) << " " << h2->GetMean(1) 
+      std::cout << "Mean: " << h1->GetMean(1) << " " << h2->GetMean(1) 
            << " | " << fabs( h1->GetMean(1) - h2->GetMean(1) ) 
            << " " << differents
-           << endl;
+           << std::endl;
    
    // RMS
    differents += (bool) equals( h1->GetRMS(1), h2->GetRMS(1), ERRORLIMIT);
    if ( debug )
-      cout << "RMS: " << h1->GetRMS(1) << " " << h2->GetRMS(1) 
+      std::cout << "RMS: " << h1->GetRMS(1) << " " << h2->GetRMS(1) 
            << " | " << fabs( h1->GetRMS(1) - h2->GetRMS(1) ) 
            << " " << differents
-           << endl;  
+           << std::endl;  
 
    // Number of Entries
    // check if is an unweighted histogram compare entries and  effective entries
@@ -9877,28 +9879,28 @@ int compareStatistics( TH1* h1, TH1* h2, bool debug, double ERRORLIMIT)
    // check first sum of weights
    differents += (bool) equals( stats1[0], stats2[0], 100*ERRORLIMIT);
    if ( debug )
-      cout << "Sum Of Weigths: " << stats1[0] << " " << stats2[0]
+      std::cout << "Sum Of Weigths: " << stats1[0] << " " << stats2[0]
            << " | " << fabs( stats1[0] - stats2[0] ) 
            << " " << differents
-           << endl;  
+           << std::endl;  
 
    if (TMath::AreEqualRel(stats1[0], h1->GetEffectiveEntries() , 1.E-12) ) { 
       // unweighted histograms - check also number of entries
       differents += (bool) equals( h1->GetEntries(), h2->GetEntries(), 100*ERRORLIMIT);
       if ( debug )
-         cout << "Entries: " << h1->GetEntries() << " " << h2->GetEntries() 
+         std::cout << "Entries: " << h1->GetEntries() << " " << h2->GetEntries() 
               << " | " << fabs( h1->GetEntries() - h2->GetEntries() ) 
               << " " << differents
-              << endl;  
+              << std::endl;  
    }
    
    // Number of Effective Entries
    differents += (bool) equals( h1->GetEffectiveEntries(), h2->GetEffectiveEntries(), 100*ERRORLIMIT);
    if ( debug )
-      cout << "Eff Entries: " << h1->GetEffectiveEntries() << " " << h2->GetEffectiveEntries() 
+      std::cout << "Eff Entries: " << h1->GetEffectiveEntries() << " " << h2->GetEffectiveEntries() 
            << " | " << fabs( h1->GetEffectiveEntries() - h2->GetEffectiveEntries() ) 
            << " " << differents
-           << endl;  
+           << std::endl;  
 
    std::cout.precision(pr);   
 
diff --git a/test/stressLinear.cxx b/test/stressLinear.cxx
index f76c1d146a0..9f4fe36b07f 100644
--- a/test/stressLinear.cxx
+++ b/test/stressLinear.cxx
@@ -198,10 +198,10 @@ const Int_t gSizeA[] = {5,6,7,8,9,10,15,20,30,40,50,60,70,80,90,100,300,500,700,
 
 void stressLinear(Int_t maxSizeReq,Int_t verbose)
 {
-  cout << "******************************************************************" <<endl;
-  cout << "*  Starting  Linear Algebra - S T R E S S suite                  *" <<endl;
-  cout << "******************************************************************" <<endl;
-  cout << "******************************************************************" <<endl;
+  std::cout << "******************************************************************" <<std::endl;
+  std::cout << "*  Starting  Linear Algebra - S T R E S S suite                  *" <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
 
   gVerbose = verbose;
 
@@ -215,8 +215,8 @@ void stressLinear(Int_t maxSizeReq,Int_t verbose)
 
   // Matrix
   {
-    cout << "*  Starting  Matrix - S T R E S S                                *" <<endl;
-    cout << "******************************************************************" <<endl;
+    std::cout << "*  Starting  Matrix - S T R E S S                                *" <<std::endl;
+    std::cout << "******************************************************************" <<std::endl;
     mstress_allocation(maxSize);
     mstress_matrix_fill(maxSize,maxSize/2);
     mstress_element_op(maxSize,maxSize/2);
@@ -234,13 +234,13 @@ void stressLinear(Int_t maxSizeReq,Int_t verbose)
     mstress_inversion();
 
     mstress_matrix_io();
-    cout << "******************************************************************" <<endl;
+    std::cout << "******************************************************************" <<std::endl;
   }
 
   // Sparse Matrix
   {
-    cout << "*  Starting  Sparse Matrix - S T R E S S                         *" <<endl;
-    cout << "******************************************************************" <<endl;
+    std::cout << "*  Starting  Sparse Matrix - S T R E S S                         *" <<std::endl;
+    std::cout << "******************************************************************" <<std::endl;
     spstress_allocation(maxSize);
     spstress_matrix_fill(maxSize,maxSize/2);
     spstress_element_op(maxSize,maxSize/2);
@@ -251,39 +251,39 @@ void stressLinear(Int_t maxSizeReq,Int_t verbose)
     spstress_vm_multiplications();
     spstress_matrix_slices(maxSize);
     spstress_matrix_io();
-    cout << "******************************************************************" <<endl;
+    std::cout << "******************************************************************" <<std::endl;
   }
 
   {
-    cout << "*  Starting  Vector - S T R E S S                                *" <<endl;
-    cout << "******************************************************************" <<endl;
+    std::cout << "*  Starting  Vector - S T R E S S                                *" <<std::endl;
+    std::cout << "******************************************************************" <<std::endl;
     vstress_allocation(maxSize);
     vstress_element_op(maxSize);
     vstress_binary_op(maxSize);
     vstress_norms(maxSize);
     vstress_matrix_slices(maxSize);
     vstress_vector_io();
-    cout << "******************************************************************" <<endl;
+    std::cout << "******************************************************************" <<std::endl;
   }
 
   // Linear Algebra
   {
-    cout << "*  Starting  Linear Algebra - S T R E S S                        *" <<endl;
-    cout << "******************************************************************" <<endl;
+    std::cout << "*  Starting  Linear Algebra - S T R E S S                        *" <<std::endl;
+    std::cout << "******************************************************************" <<std::endl;
     astress_decomp();
     astress_lineqn();
     astress_pseudo();
     astress_eigen(5);
     astress_decomp_io(10);
-    cout << "******************************************************************" <<endl;
+    std::cout << "******************************************************************" <<std::endl;
   }
 
   //Backward Compatibility of Streamers
   {
-    cout << "*  Starting  Backward IO compatibility - S T R E S S             *" <<endl;
-    cout << "******************************************************************" <<endl;
+    std::cout << "*  Starting  Backward IO compatibility - S T R E S S             *" <<std::endl;
+    std::cout << "******************************************************************" <<std::endl;
     stress_backward_io();
-    cout << "******************************************************************" <<endl;
+    std::cout << "******************************************************************" <<std::endl;
   }
 
   gBenchmark->Stop("stressLinear");
@@ -336,7 +336,7 @@ void StatusPrint(Int_t id,const TString &title,Bool_t status)
   TString header = TString("Test ")+number+" : "+title;
   const Int_t nch = header.Length();
   for (Int_t i = nch; i < kMAX; i++) header += '.';
-  cout << header << (status ? "OK" : "FAILED") << endl;
+  std::cout << header << (status ? "OK" : "FAILED") << std::endl;
 }
 
 //------------------------------------------------------------------------
@@ -345,7 +345,7 @@ void StatusPrint(Int_t id,const TString &title,Bool_t status)
 void mstress_allocation(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n\n---> Test allocation and compatibility check" << endl;
+    std::cout << "\n\n---> Test allocation and compatibility check" << std::endl;
 
   Int_t i,j;
   Bool_t ok = kTRUE;
@@ -360,26 +360,26 @@ void mstress_allocation(Int_t msize)
   TMatrixD m4(m1);
 
   if (gVerbose) {
-    cout << "\nStatus information reported for matrix m3:" << endl;
-    cout << "  Row lower bound ... " << m3.GetRowLwb() << endl;
-    cout << "  Row upper bound ... " << m3.GetRowUpb() << endl;
-    cout << "  Col lower bound ... " << m3.GetColLwb() << endl;
-    cout << "  Col upper bound ... " << m3.GetColUpb() << endl;
-    cout << "  No. rows ..........." << m3.GetNrows()  << endl;
-    cout << "  No. cols ..........." << m3.GetNcols()  << endl;
-    cout << "  No. of elements ...." << m3.GetNoElements() << endl;
+    std::cout << "\nStatus information reported for matrix m3:" << std::endl;
+    std::cout << "  Row lower bound ... " << m3.GetRowLwb() << std::endl;
+    std::cout << "  Row upper bound ... " << m3.GetRowUpb() << std::endl;
+    std::cout << "  Col lower bound ... " << m3.GetColLwb() << std::endl;
+    std::cout << "  Col upper bound ... " << m3.GetColUpb() << std::endl;
+    std::cout << "  No. rows ..........." << m3.GetNrows()  << std::endl;
+    std::cout << "  No. cols ..........." << m3.GetNcols()  << std::endl;
+    std::cout << "  No. of elements ...." << m3.GetNoElements() << std::endl;
   }
 
   if (gVerbose)
-    cout << "\nCheck matrices 1 & 2 for compatibility" << endl;
+    std::cout << "\nCheck matrices 1 & 2 for compatibility" << std::endl;
   ok &= AreCompatible(m1,m2,gVerbose);
 
   if (gVerbose)
-    cout << "Check matrices 1 & 4 for compatibility" << endl;
+    std::cout << "Check matrices 1 & 4 for compatibility" << std::endl;
   ok &= AreCompatible(m1,m4,gVerbose);
 
   if (gVerbose)
-    cout << "m2 has to be compatible with m3 after resizing to m3" << endl;
+    std::cout << "m2 has to be compatible with m3 after resizing to m3" << std::endl;
   m2.ResizeTo(m3);
   ok &= AreCompatible(m2,m3,gVerbose);
 
@@ -389,23 +389,23 @@ void mstress_allocation(Int_t msize)
       m5(i,j) = TMath::Pi()*i+TMath::E()*j;
 
   if (gVerbose)
-    cout << "m1 has to be compatible with m5 after resizing to m5" << endl;
+    std::cout << "m1 has to be compatible with m5 after resizing to m5" << std::endl;
   m1.ResizeTo(m5.GetNrows(),m5.GetNcols());
   ok &= AreCompatible(m1,m5,gVerbose);
 
   if (gVerbose)
-    cout << "m1 has to be equal to m4 after stretching and shrinking" << endl;
+    std::cout << "m1 has to be equal to m4 after stretching and shrinking" << std::endl;
   m1.ResizeTo(m4.GetNrows(),m4.GetNcols());
   ok &= VerifyMatrixIdentity(m1,m4,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "m5 has to be equal to m1 after shrinking" << endl;
+    std::cout << "m5 has to be equal to m1 after shrinking" << std::endl;
   m5.ResizeTo(m1.GetNrows(),m1.GetNcols());
   ok &= VerifyMatrixIdentity(m1,m5,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "stretching and shrinking for small matrices (stack)" << endl;
+    std::cout << "stretching and shrinking for small matrices (stack)" << std::endl;
   if (gVerbose)
-    cout << "m8 has to be equal to m7 after stretching and shrinking" << endl;
+    std::cout << "m8 has to be equal to m7 after stretching and shrinking" << std::endl;
   TMatrixD m6(4,4);
   for (i = m6.GetRowLwb(); i <= m6.GetRowUpb(); i++)
     for (j = m6.GetColLwb(); j <= m6.GetColUpb(); j++)
@@ -421,12 +421,12 @@ void mstress_allocation(Int_t msize)
   ok &= VerifyMatrixIdentity(m7,m8,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "m6 has to be equal to m8 after shrinking" << endl;
+    std::cout << "m6 has to be equal to m8 after shrinking" << std::endl;
   m6.ResizeTo(3,3);
   ok &= VerifyMatrixIdentity(m6,m8,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(1,"Allocation, Resizing",ok);
 }
@@ -448,11 +448,11 @@ public:
 void mstress_matrix_fill(Int_t rsize,Int_t csize)
 {
   if (gVerbose)
-    cout << "\n\n---> Test different matrix filling methods\n" << endl;
+    std::cout << "\n\n---> Test different matrix filling methods\n" << std::endl;
 
   Bool_t ok = kTRUE;
   if (gVerbose)
-    cout << "Creating m  with Apply function..." << endl;
+    std::cout << "Creating m  with Apply function..." << std::endl;
   TMatrixD m(-1,rsize-2,1,csize);
 #ifndef __CINT__
   FillMatrix f(m);
@@ -465,7 +465,7 @@ void mstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check identity between m and matrix filled through (i,j)" << endl;
+      std::cout << "Check identity between m and matrix filled through (i,j)" << std::endl;
 
     TMatrixD m_overload1(-1,rsize-2,1,csize);
     TMatrixD m_overload2(-1,rsize-2,1,csize);
@@ -482,10 +482,10 @@ void mstress_matrix_fill(Int_t rsize,Int_t csize)
 
     ok &= VerifyMatrixIdentity(m,m_overload1,gVerbose,EPSILON);
     if (gVerbose)
-      cout << "Check identity between m and matrix filled through [i][j]" << endl;
+      std::cout << "Check identity between m and matrix filled through [i][j]" << std::endl;
     ok &= VerifyMatrixIdentity(m,m_overload2,gVerbose,EPSILON);
     if (gVerbose)
-      cout << "Check identity between matrix filled through [i][j] and (i,j)" << endl;
+      std::cout << "Check identity between matrix filled through [i][j] and (i,j)" << std::endl;
     ok &= VerifyMatrixIdentity(m_overload1,m_overload2,gVerbose,EPSILON);
   }
 
@@ -502,23 +502,23 @@ void mstress_matrix_fill(Int_t rsize,Int_t csize)
     }
 
     if (gVerbose)
-      cout << "Creating m_fortran by filling with fortran stored matrix" << endl;
+      std::cout << "Creating m_fortran by filling with fortran stored matrix" << std::endl;
     TMatrixD m_fortran(-1,rsize-2,1,csize,a_fortran.GetArray(),"F");
     if (gVerbose)
-      cout << "Check identity between m and m_fortran" << endl;
+      std::cout << "Check identity between m and m_fortran" << std::endl;
     ok &= VerifyMatrixIdentity(m,m_fortran,gVerbose,EPSILON);
 
     if (gVerbose)
-      cout << "Creating m_c by filling with c stored matrix" << endl;
+      std::cout << "Creating m_c by filling with c stored matrix" << std::endl;
     TMatrixD m_c(-1,rsize-2,1,csize,a_c.GetArray());
     if (gVerbose)
-      cout << "Check identity between m and m_c" << endl;
+      std::cout << "Check identity between m and m_c" << std::endl;
     ok &= VerifyMatrixIdentity(m,m_c,gVerbose,EPSILON);
   }
 
   {
     if (gVerbose)
-      cout << "Check insertion/extraction of sub-matrices" << endl;
+      std::cout << "Check insertion/extraction of sub-matrices" << std::endl;
     {
       TMatrixD m_sub1 = m;
       m_sub1.ResizeTo(0,rsize-2,2,csize);
@@ -555,7 +555,7 @@ void mstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check sub-matrix views" << endl;
+      std::cout << "Check sub-matrix views" << std::endl;
     {
       TMatrixD m3(-1,rsize-2,1,csize);
       TMatrixDSub(m3,0,rsize-2,2,csize) = TMatrixDSub(m,0,rsize-2,2,csize);
@@ -580,7 +580,7 @@ void mstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check array Use" << endl;
+      std::cout << "Check array Use" << std::endl;
     {
       TMatrixD *m1a = new TMatrixD(m);
       TMatrixD *m2a = new TMatrixD();
@@ -595,7 +595,7 @@ void mstress_matrix_fill(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(2,"Filling, Inserting, Using",ok);
 }
@@ -620,7 +620,7 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   TMatrixD m(-1,rsize-2,1,csize);
 
   if (gVerbose)
-    cout << "\nWriting zeros to m..." << endl;
+    std::cout << "\nWriting zeros to m..." << std::endl;
   {
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for(Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
@@ -629,17 +629,17 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "Creating zero m1 ..." << endl;
+    std::cout << "Creating zero m1 ..." << std::endl;
   TMatrixD m1(TMatrixD::kZero, m);
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing m1 with 0 ..." << endl;
+    std::cout << "Comparing m1 with 0 ..." << std::endl;
   R__ASSERT(m1 == 0);
   R__ASSERT(!(m1 != 0));
 
   if (gVerbose)
-    cout << "Writing a pattern " << pattern << " by assigning to m(i,j)..." << endl;
+    std::cout << "Writing a pattern " << pattern << " by assigning to m(i,j)..." << std::endl;
   {
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
@@ -648,38 +648,38 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "Writing the pattern by assigning to m1 as a whole ..."  << endl;
+    std::cout << "Writing the pattern by assigning to m1 as a whole ..."  << std::endl;
   m1 = pattern;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing m and m1 ..." << endl;
+    std::cout << "Comparing m and m1 ..." << std::endl;
   R__ASSERT(m == m1);
   if (gVerbose)
-    cout << "Comparing (m=0) and m1 ..." << endl;
+    std::cout << "Comparing (m=0) and m1 ..." << std::endl;
   R__ASSERT(!(m.Zero() == m1));
 
   if (gVerbose)
-    cout << "Clearing m1 ..." << endl;
+    std::cout << "Clearing m1 ..." << std::endl;
   m1.Zero();
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nClear m and add the pattern" << endl;
+    std::cout << "\nClear m and add the pattern" << std::endl;
   m.Zero();
   m += pattern;
   ok &= VerifyMatrixValue(m,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   add the doubled pattern with the negative sign" << endl;
+    std::cout << "   add the doubled pattern with the negative sign" << std::endl;
   m += -2*pattern;
   ok &= VerifyMatrixValue(m,-pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   subtract the trippled pattern with the negative sign" << endl;
+    std::cout << "   subtract the trippled pattern with the negative sign" << std::endl;
   m -= -3*pattern;
   ok &= VerifyMatrixValue(m,2*pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify comparison operations when all elems are the same" << endl;
+    std::cout << "\nVerify comparison operations when all elems are the same" << std::endl;
   m = pattern;
   R__ASSERT( m == pattern && !(m != pattern) );
   R__ASSERT( m > 0 && m >= pattern && m <= pattern );
@@ -690,7 +690,7 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   R__ASSERT( m  >= -pattern && !(m > -pattern) );
 
   if (gVerbose)
-    cout << "\nVerify comparison operations when not all elems are the same" << endl;
+    std::cout << "\nVerify comparison operations when not all elems are the same" << std::endl;
   m = pattern; m(m.GetRowUpb(),m.GetColUpb()) = pattern-1;
   R__ASSERT( !(m == pattern) && !(m != pattern) );
   R__ASSERT( m != 0 );                   // none of elements are 0
@@ -698,25 +698,25 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   R__ASSERT( !(m <= pattern-1) && m >= pattern-1 && !(m>pattern-1) );
 
   if (gVerbose)
-    cout << "\nAssign 2*pattern to m by repeating additions" << endl;
+    std::cout << "\nAssign 2*pattern to m by repeating additions" << std::endl;
   m = 0; m += pattern; m += pattern;
   if (gVerbose)
-    cout << "Assign 2*pattern to m1 by multiplying by two " << endl;
+    std::cout << "Assign 2*pattern to m1 by multiplying by two " << std::endl;
   m1 = pattern; m1 *= 2;
   ok &= VerifyMatrixValue(m1,2*pattern,gVerbose,EPSILON);
   R__ASSERT( m == m1 );
   if (gVerbose)
-    cout << "Multiply m1 by one half returning it to the 1*pattern" << endl;
+    std::cout << "Multiply m1 by one half returning it to the 1*pattern" << std::endl;
   m1 *= 1/2.;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nAssign -pattern to m and m1" << endl;
+    std::cout << "\nAssign -pattern to m and m1" << std::endl;
   m.Zero(); m -= pattern; m1 = -pattern;
   ok &= VerifyMatrixValue(m,-pattern,gVerbose,EPSILON);
   R__ASSERT( m == m1 );
   if (gVerbose)
-    cout << "m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same" << endl;
+    std::cout << "m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same" << std::endl;
   m.Sqr();
   ok &= VerifyMatrixValue(m,pattern*pattern,gVerbose,EPSILON);
   m.Sqrt();
@@ -726,7 +726,7 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   ok &= VerifyMatrixIdentity(m1,m,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << endl;
+    std::cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << std::endl;
   {
 #ifndef __CINT__
     FillMatrix f(m);
@@ -759,7 +759,7 @@ void mstress_element_op(Int_t rsize,Int_t csize)
   ok &= VerifyMatrixValue(m,1.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(3,"Uniform matrix operations",ok);
 }
@@ -771,7 +771,7 @@ void mstress_element_op(Int_t rsize,Int_t csize)
 void mstress_binary_ebe_op(Int_t rsize, Int_t csize)
 {
   if (gVerbose)
-    cout << "\n---> Test Binary Matrix element-by-element operations" << endl;
+    std::cout << "\n---> Test Binary Matrix element-by-element operations" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 4.25;
@@ -787,7 +787,7 @@ void mstress_binary_ebe_op(Int_t rsize, Int_t csize)
   }
 
   if (gVerbose)
-    cout << "\nVerify assignment of a matrix to the matrix" << endl;
+    std::cout << "\nVerify assignment of a matrix to the matrix" << std::endl;
   m = pattern;
   m1.Zero();
   m1 = m;
@@ -795,51 +795,51 @@ void mstress_binary_ebe_op(Int_t rsize, Int_t csize)
   R__ASSERT( m1 == m );
 
   if (gVerbose)
-    cout << "\nAdding the matrix to itself, uniform pattern " << pattern << endl;
+    std::cout << "\nAdding the matrix to itself, uniform pattern " << pattern << std::endl;
   m.Zero(); m = pattern;
   m1 = m; m1 += m1;
   ok &= VerifyMatrixValue(m1,2*pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting two matrices ..." << endl;
+    std::cout << "  subtracting two matrices ..." << std::endl;
   m1 -= m;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting the matrix from itself" << endl;
+    std::cout << "  subtracting the matrix from itself" << std::endl;
   m1 -= m1;
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  adding two matrices together" << endl;
+    std::cout << "  adding two matrices together" << std::endl;
   m1 += m;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose) {
-    cout << "\nArithmetic operations on matrices with not the same elements" << endl;
-    cout << "   adding mp to the zero matrix..." << endl;
+    std::cout << "\nArithmetic operations on matrices with not the same elements" << std::endl;
+    std::cout << "   adding mp to the zero matrix..." << std::endl;
   }
   m.Zero(); m += mp;
   ok &= VerifyMatrixIdentity(m,mp,gVerbose,EPSILON);
   m1 = m;
   if (gVerbose)
-    cout << "   making m = 3*mp and m1 = 3*mp, via add() and succesive mult" << endl;
+    std::cout << "   making m = 3*mp and m1 = 3*mp, via add() and succesive mult" << std::endl;
   Add(m,2.,mp);
   m1 += m1; m1 += mp;
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   clear both m and m1, by subtracting from itself and via add()" << endl;
+    std::cout << "   clear both m and m1, by subtracting from itself and via add()" << std::endl;
   m1 -= m1;
   Add(m,-3.,mp);
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
 
   if (gVerbose) {
-    cout << "\nTesting element-by-element multiplications and divisions" << endl;
-    cout << "   squaring each element with sqr() and via multiplication" << endl;
+    std::cout << "\nTesting element-by-element multiplications and divisions" << std::endl;
+    std::cout << "   squaring each element with sqr() and via multiplication" << std::endl;
   }
   m = mp; m1 = mp;
   m.Sqr();
   ElementMult(m1,m1);
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   compare (m = pattern^2)/pattern with pattern" << endl;
+    std::cout << "   compare (m = pattern^2)/pattern with pattern" << std::endl;
   m = pattern; m1 = pattern;
   m.Sqr();
   ElementDiv(m,m1);
@@ -848,7 +848,7 @@ void mstress_binary_ebe_op(Int_t rsize, Int_t csize)
     Compare(m1,m);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(4,"Binary Matrix element-by-element operations",ok);
 }
@@ -860,14 +860,14 @@ void mstress_binary_ebe_op(Int_t rsize, Int_t csize)
 void mstress_transposition(Int_t msize)
 {
   if (gVerbose) {
-    cout << "\n---> Verify matrix transpose "
-            "for matrices of a characteristic size " << msize << endl;
+    std::cout << "\n---> Verify matrix transpose "
+            "for matrices of a characteristic size " << msize << std::endl;
   }
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nCheck to see that a square UnitMatrix stays the same";
+      std::cout << "\nCheck to see that a square UnitMatrix stays the same";
     TMatrixD m(msize,msize);
     m.UnitMatrix();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -876,7 +876,7 @@ void mstress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nTest a non-square UnitMatrix";
+      std::cout << "\nTest a non-square UnitMatrix";
     TMatrixD m(msize,msize+1);
     m.UnitMatrix();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -888,7 +888,7 @@ void mstress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck to see that a symmetric (Hilbert)Matrix stays the same";
+      std::cout << "\nCheck to see that a symmetric (Hilbert)Matrix stays the same";
     TMatrixD m = THilbertMatrixD(msize,msize);
     TMatrixD mt(TMatrixD::kTransposed,m);
     ok &= ( m == mt ) ? kTRUE : kFALSE;
@@ -896,7 +896,7 @@ void mstress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck transposing a non-symmetric matrix";
+      std::cout << "\nCheck transposing a non-symmetric matrix";
     TMatrixD m = THilbertMatrixD(msize+1,msize);
     m(1,2) = TMath::Pi();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -905,13 +905,13 @@ void mstress_transposition(Int_t msize)
     R__ASSERT(mt[2][1] == (Double_t)TMath::Pi() && mt[1][2] != (Double_t)TMath::Pi());
 
     if (gVerbose)
-      cout << "\nCheck double transposing a non-symmetric matrix" << endl;
+      std::cout << "\nCheck double transposing a non-symmetric matrix" << std::endl;
     TMatrixD mtt(TMatrixD::kTransposed,mt);
     ok &= ( m == mtt ) ? kTRUE : kFALSE;
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(5,"Matrix transposition",ok);
 }
@@ -951,12 +951,12 @@ public:
 void mstress_special_creation(Int_t dim)
 {
   if (gVerbose)
-    cout << "\n---> Check creating some special matrices of dimension " << dim << endl;
+    std::cout << "\n---> Check creating some special matrices of dimension " << dim << std::endl;
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\ntest creating Hilbert matrices" << endl;
+      std::cout << "\ntest creating Hilbert matrices" << std::endl;
     TMatrixD m = THilbertMatrixD(dim+1,dim);
     TMatrixD m1(TMatrixD::kZero,m);
     ok &= ( !(m == m1) ) ? kTRUE : kFALSE;
@@ -975,7 +975,7 @@ void mstress_special_creation(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "test creating zero matrix and copy constructor" << endl;
+      std::cout << "test creating zero matrix and copy constructor" << std::endl;
     TMatrixD m = THilbertMatrixD(dim,dim+1);
     ok &= ( m != 0 ) ? kTRUE : kFALSE;
     TMatrixD m1(m);               // Applying the copy constructor
@@ -987,7 +987,7 @@ void mstress_special_creation(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "test creating unit matrices" << endl;
+      std::cout << "test creating unit matrices" << std::endl;
     TMatrixD m(dim,dim);
 #ifndef __CINT__
     {
@@ -1034,7 +1034,7 @@ void mstress_special_creation(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "check to see that Haar matrix has *exactly* orthogonal columns" << endl;
+      std::cout << "check to see that Haar matrix has *exactly* orthogonal columns" << std::endl;
     Int_t j;
     const Int_t order = 5;
     const TMatrixD haar = THaarMatrixD(order);
@@ -1053,7 +1053,7 @@ void mstress_special_creation(Int_t dim)
     }
 
     if (gVerbose)
-      cout << "make Haar (sub)matrix and test it *is* a submatrix" << endl;
+      std::cout << "make Haar (sub)matrix and test it *is* a submatrix" << std::endl;
     const Int_t no_sub_cols = (1<<order) - 3;
     const TMatrixD haar_sub = THaarMatrixD(order,no_sub_cols);
     ok &= ( haar_sub.GetNrows() == (1<<order) &&
@@ -1066,7 +1066,7 @@ void mstress_special_creation(Int_t dim)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(6,"Haar/Hilbert Matrix",ok);
 }
@@ -1091,12 +1091,12 @@ public:
 void mstress_matrix_promises(Int_t dim)
 {
   if (gVerbose)
-    cout << "\n---> Check making/forcing promises, (lazy)matrices of dimension " << dim << endl;
+    std::cout << "\n---> Check making/forcing promises, (lazy)matrices of dimension " << dim << std::endl;
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nmake a promise and force it by a constructor" << endl;
+      std::cout << "\nmake a promise and force it by a constructor" << std::endl;
     TMatrixD m  = hilbert_matrix_promise(dim,dim+1);
     TMatrixD m1 = THilbertMatrixD(dim,dim+1);
     ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
@@ -1104,7 +1104,7 @@ void mstress_matrix_promises(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "make a promise and force it by an assignment" << endl;
+      std::cout << "make a promise and force it by an assignment" << std::endl;
     TMatrixD m(-1,dim,0,dim);
     m = hilbert_matrix_promise(-1,dim,0,dim);
     TMatrixD m1 = THilbertMatrixD(-1,dim,0,dim);
@@ -1112,7 +1112,7 @@ void mstress_matrix_promises(Int_t dim)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(7,"Matrix promises",ok);
 }
@@ -1125,7 +1125,7 @@ void mstress_matrix_promises(Int_t dim)
 void mstress_norms(Int_t rsize_req,Int_t csize_req)
 {
   if (gVerbose)
-    cout << "\n---> Verify norm calculations" << endl;
+    std::cout << "\n---> Verify norm calculations" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 10.25;
@@ -1135,32 +1135,32 @@ void mstress_norms(Int_t rsize_req,Int_t csize_req)
   Int_t csize = csize_req;
   if (csize%2 != 0)  csize--;
   if (rsize%2 == 1 || csize%2 == 1) {
-    cout << "rsize: " << rsize <<endl;
-    cout << "csize: " << csize <<endl;
+    std::cout << "rsize: " << rsize <<std::endl;
+    std::cout << "csize: " << csize <<std::endl;
     Fatal("mstress_norms","Sorry, size of the matrix to test must be even for this test\n");
   }
 
   TMatrixD m(rsize,csize);
 
   if (gVerbose)
-    cout << "\nAssign " << pattern << " to all the elements and check norms" << endl;
+    std::cout << "\nAssign " << pattern << " to all the elements and check norms" << std::endl;
   m = pattern;
   if (gVerbose)
-    cout << "  1. (col) norm should be pattern*nrows" << endl;
+    std::cout << "  1. (col) norm should be pattern*nrows" << std::endl;
   ok &= ( m.Norm1() == pattern*m.GetNrows() ) ? kTRUE : kFALSE;
   ok &= ( m.Norm1() == m.ColNorm() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Inf (row) norm should be pattern*ncols" << endl;
+    std::cout << "  Inf (row) norm should be pattern*ncols" << std::endl;
   ok &= ( m.NormInf() == pattern*m.GetNcols() ) ? kTRUE : kFALSE;
   ok &= ( m.NormInf() == m.RowNorm() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Square of the Eucl norm has got to be pattern^2 * no_elems" << endl;
+    std::cout << "  Square of the Eucl norm has got to be pattern^2 * no_elems" << std::endl;
   ok &= ( m.E2Norm() == (pattern*pattern)*m.GetNoElements() ) ? kTRUE : kFALSE;
   TMatrixD m1(TMatrixD::kZero,m);
   ok &= ( m.E2Norm() == E2Norm(m,m1) ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(8,"Matrix Norms",ok);
 }
@@ -1172,7 +1172,7 @@ void mstress_norms(Int_t rsize_req,Int_t csize_req)
 void mstress_determinant(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify determinant evaluation for a square matrix of size " << msize << endl;
+    std::cout << "\n---> Verify determinant evaluation for a square matrix of size " << msize << std::endl;
 
   Bool_t ok = kTRUE;
   TMatrixD m(msize,msize);
@@ -1180,14 +1180,14 @@ void mstress_determinant(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck to see that the determinant of the unit matrix is one" <<endl;
+      std::cout << "\nCheck to see that the determinant of the unit matrix is one" <<std::endl;
     m.UnitMatrix();
     Double_t d1,d2;
     m.Determinant(d1,d2);
     const Double_t det = d1*TMath::Power(2.,d2);
     if (gVerbose) {
-      cout << "det = " << det << " deviation= " << TMath::Abs(det-1);
-      cout << ( (TMath::Abs(det-1) < EPSILON) ? " OK" : " too large") <<endl;
+      std::cout << "det = " << det << " deviation= " << TMath::Abs(det-1);
+      std::cout << ( (TMath::Abs(det-1) < EPSILON) ? " OK" : " too large") <<std::endl;
     }
     ok &= (TMath::Abs(det-1) < EPSILON) ? kTRUE : kFALSE;
   }
@@ -1195,7 +1195,7 @@ void mstress_determinant(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nCheck the determinant for the matrix with " << pattern << " at the diagonal" << endl;
+      std::cout << "\nCheck the determinant for the matrix with " << pattern << " at the diagonal" << std::endl;
     {
       for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
         for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
@@ -1207,8 +1207,8 @@ void mstress_determinant(Int_t msize)
     const Double_t log_det1 = d2*TMath::Log(2.)+TMath::Log(d1_abs);
     const Double_t log_det2 = ((Double_t)m.GetNrows())*TMath::Log(pattern);
     if (gVerbose) {
-      cout << "log_det1 = " << log_det1 << " deviation= " << TMath::Abs(log_det1-log_det2);
-      cout << ( (TMath::Abs(log_det1-log_det2) < msize*EPSILON) ? " OK" : " too large") <<endl;
+      std::cout << "log_det1 = " << log_det1 << " deviation= " << TMath::Abs(log_det1-log_det2);
+      std::cout << ( (TMath::Abs(log_det1-log_det2) < msize*EPSILON) ? " OK" : " too large") <<std::endl;
     }
     ok &= ( TMath::Abs(log_det1-log_det2) < msize*EPSILON  ) ? kTRUE : kFALSE;
   }
@@ -1216,7 +1216,7 @@ void mstress_determinant(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nCheck the determinant of the transposed matrix" << endl;
+      std::cout << "\nCheck the determinant of the transposed matrix" << std::endl;
     m.UnitMatrix();
     m(1,2) = pattern;
     TMatrixD m_tran(TMatrixD::kTransposed,m);
@@ -1224,8 +1224,8 @@ void mstress_determinant(Int_t msize)
     const Double_t det1 = m.Determinant();
     const Double_t det2 = m_tran.Determinant();
     if (gVerbose) {
-      cout << "det1 = " << det1 << " deviation= " << TMath::Abs(det1-det2);
-      cout << ( (TMath::Abs(det1-det2) < msize*EPSILON) ? " OK" : " too large") <<endl;
+      std::cout << "det1 = " << det1 << " deviation= " << TMath::Abs(det1-det2);
+      std::cout << ( (TMath::Abs(det1-det2) < msize*EPSILON) ? " OK" : " too large") <<std::endl;
     }
     ok &= ( TMath::Abs(det1-det2) < msize*EPSILON ) ? kTRUE : kFALSE;
   }
@@ -1233,7 +1233,7 @@ void mstress_determinant(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nswap two rows/cols of a matrix through method 1 and watch det's sign" << endl;
+      std::cout << "\nswap two rows/cols of a matrix through method 1 and watch det's sign" << std::endl;
     m.UnitMatrix();
     TMatrixDRow(m,3) = pattern;
     Double_t d1,d2;
@@ -1245,8 +1245,8 @@ void mstress_determinant(Int_t msize)
     Double_t d1_p,d2_p;
     m.Determinant(d1_p,d2_p);
     if (gVerbose) {
-      cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1+d1_p);
-      cout << ( ( d1 == -d1_p ) ? " OK" : " too large") <<endl;
+      std::cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1+d1_p);
+      std::cout << ( ( d1 == -d1_p ) ? " OK" : " too large") <<std::endl;
     }
     ok &= ( d1 == -d1_p ) ? kTRUE : kFALSE;
     TMatrixDColumn col2(m,2);
@@ -1255,8 +1255,8 @@ void mstress_determinant(Int_t msize)
     col2 = vcol4; TMatrixDColumn(m,4) = vcol2;
     m.Determinant(d1_p,d2_p);
     if (gVerbose) {
-      cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1-d1_p);
-      cout << ( ( d1 == d1_p ) ? " OK" : " too large") <<endl;
+      std::cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1-d1_p);
+      std::cout << ( ( d1 == d1_p ) ? " OK" : " too large") <<std::endl;
     }
     ok &= ( d1 == d1_p ) ? kTRUE : kFALSE;
   }
@@ -1264,7 +1264,7 @@ void mstress_determinant(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nswap two rows/cols of a matrix through method 2 and watch det's sign" << endl;
+      std::cout << "\nswap two rows/cols of a matrix through method 2 and watch det's sign" << std::endl;
     m.UnitMatrix();
     TMatrixDRow(m,3) = pattern;
     Double_t d1,d2;
@@ -1276,8 +1276,8 @@ void mstress_determinant(Int_t msize)
     Double_t d1_p,d2_p;
     m.Determinant(d1_p,d2_p);
     if (gVerbose) {
-      cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1+d1_p);
-      cout << ( ( d1 == -d1_p ) ? " OK" : " too large") <<endl;
+      std::cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1+d1_p);
+      std::cout << ( ( d1 == -d1_p ) ? " OK" : " too large") <<std::endl;
     }
     ok &= ( d1 == -d1_p ) ? kTRUE : kFALSE;
 
@@ -1286,8 +1286,8 @@ void mstress_determinant(Int_t msize)
     TMatrixDColumn(m,4) = TMatrixDColumn(m_save,2);
     m.Determinant(d1_p,d2_p);
     if (gVerbose) {
-      cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1-d1_p);
-      cout << ( ( d1 == d1_p ) ? " OK" : " too large") <<endl;
+      std::cout << "d1 = " << d1 << " deviation= " << TMath::Abs(d1-d1_p);
+      std::cout << ( ( d1 == d1_p ) ? " OK" : " too large") <<std::endl;
     }
     ok &= ( d1 == d1_p ) ? kTRUE : kFALSE;
   }
@@ -1295,7 +1295,7 @@ void mstress_determinant(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nCheck the determinant for the matrix with " << pattern << " at the anti-diagonal" << endl;
+      std::cout << "\nCheck the determinant for the matrix with " << pattern << " at the anti-diagonal" << std::endl;
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
         m(i,j) = ( i==(m.GetColUpb()+m.GetColLwb()-j) ? pattern : 0 );
@@ -1307,9 +1307,9 @@ void mstress_determinant(Int_t msize)
     const Double_t log_det2 = ((Double_t)m.GetNrows())*TMath::Log(pattern);
     const Double_t sign     = ( m.GetNrows()*(m.GetNrows()-1)/2 & 1 ? -1 : 1 );
     if (gVerbose) {
-      cout << "log_det1 = " << log_det1 << " deviation= " << TMath::Abs(log_det1-log_det2);
-      cout << ( (TMath::Abs(log_det1-log_det2) < msize*EPSILON) ? " OK" : " too large") <<endl;
-      cout << ( sign * d1 > 0. ? " OK sign" : " wrong sign") <<endl;
+      std::cout << "log_det1 = " << log_det1 << " deviation= " << TMath::Abs(log_det1-log_det2);
+      std::cout << ( (TMath::Abs(log_det1-log_det2) < msize*EPSILON) ? " OK" : " too large") <<std::endl;
+      std::cout << ( sign * d1 > 0. ? " OK sign" : " wrong sign") <<std::endl;
     }
     ok &= ( TMath::Abs(log_det1-log_det2) < msize*EPSILON  ) ? kTRUE : kFALSE;
     ok &= ( sign * d1 > 0. ) ? kTRUE : kFALSE;
@@ -1318,90 +1318,90 @@ void mstress_determinant(Int_t msize)
   // Next test disabled because it produces (of course) a Warning
   if (0) {
     if (gVerbose)
-      cout << "\nCheck the determinant for the singular matrix"
-              "\n	defined as above with zero first row" << endl;
+      std::cout << "\nCheck the determinant for the singular matrix"
+              "\n	defined as above with zero first row" << std::endl;
     m.Zero();
     {
       for (Int_t i = m.GetRowLwb()+1; i <= m.GetRowUpb(); i++)
         for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
           m(i,j) = ( i==(m.GetColUpb()+m.GetColLwb()-j) ? pattern : 0 );
     }
-    cout << "\n	determinant is " << m.Determinant();
+    std::cout << "\n	determinant is " << m.Determinant();
     ok &= ( m.Determinant() == 0 ) ? kTRUE : kFALSE;
   }
 
   if (gVerbose)
-    cout << "\nCheck out the determinant of the Hilbert matrix";
+    std::cout << "\nCheck out the determinant of the Hilbert matrix";
   TMatrixDSym H = THilbertMatrixDSym(3);
   H.SetTol(1.0e-20);
   if (gVerbose) {
-    cout << "\n    3x3 Hilbert matrix: exact determinant 1/2160 ";
-    cout << "\n                              computed    1/"<< 1/H.Determinant();
+    std::cout << "\n    3x3 Hilbert matrix: exact determinant 1/2160 ";
+    std::cout << "\n                              computed    1/"<< 1/H.Determinant();
   }
 
   H.ResizeTo(4,4);
   H = THilbertMatrixDSym(4);
   H.SetTol(1.0e-20);
   if (gVerbose) {
-    cout << "\n    4x4 Hilbert matrix: exact determinant 1/6048000 ";
-    cout << "\n                              computed    1/"<< 1/H.Determinant();
+    std::cout << "\n    4x4 Hilbert matrix: exact determinant 1/6048000 ";
+    std::cout << "\n                              computed    1/"<< 1/H.Determinant();
   }
 
   H.ResizeTo(5,5);
   H = THilbertMatrixDSym(5);
   H.SetTol(1.0e-20);
   if (gVerbose) {
-    cout << "\n    5x5 Hilbert matrix: exact determinant 3.749295e-12";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    5x5 Hilbert matrix: exact determinant 3.749295e-12";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   if (gVerbose) {
     TDecompQRH qrh(H);
     Double_t d1,d2;
     qrh.Det(d1,d2);
-    cout  << "\n qrh det = " << d1*TMath::Power(2.0,d2) <<endl;
+    std::cout  << "\n qrh det = " << d1*TMath::Power(2.0,d2) <<std::endl;
   }
 
   if (gVerbose) {
     TDecompChol chol(H);
     Double_t d1,d2;
     chol.Det(d1,d2);
-    cout  << "\n chol det = " << d1*TMath::Power(2.0,d2) <<endl;
+    std::cout  << "\n chol det = " << d1*TMath::Power(2.0,d2) <<std::endl;
   }
 
   if (gVerbose) {
     TDecompSVD svd(H);
     Double_t d1,d2;
     svd.Det(d1,d2);
-    cout  << "\n svd det = " << d1*TMath::Power(2.0,d2) <<endl;
+    std::cout  << "\n svd det = " << d1*TMath::Power(2.0,d2) <<std::endl;
   }
 
   H.ResizeTo(7,7);
   H = THilbertMatrixDSym(7);
   H.SetTol(1.0e-20);
   if (gVerbose) {
-    cout << "\n    7x7 Hilbert matrix: exact determinant 4.8358e-25";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    7x7 Hilbert matrix: exact determinant 4.8358e-25";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   H.ResizeTo(9,9);
   H = THilbertMatrixDSym(9);
   H.SetTol(1.0e-20);
   if (gVerbose) {
-    cout << "\n    9x9 Hilbert matrix: exact determinant 9.72023e-43";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    9x9 Hilbert matrix: exact determinant 9.72023e-43";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   H.ResizeTo(10,10);
   H = THilbertMatrixDSym(10);
   H.SetTol(1.0e-20);
   if (gVerbose) {
-    cout << "\n    10x10 Hilbert matrix: exact determinant 2.16418e-53";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    10x10 Hilbert matrix: exact determinant 2.16418e-53";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   if (gVerbose)
-  cout << "\nDone\n" << endl;
+  std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(9,"Matrix Determinant",ok);
 }
@@ -1429,12 +1429,12 @@ void mstress_mm_multiplications()
     }
 
     if (verbose)
-      cout << "\n---> Verify matrix multiplications "
-              "for matrices of the characteristic size " << msize << endl;
+      std::cout << "\n---> Verify matrix multiplications "
+              "for matrices of the characteristic size " << msize << std::endl;
 
     {
       if (verbose)
-        cout << "\nTest inline multiplications of the UnitMatrix" << endl;
+        std::cout << "\nTest inline multiplications of the UnitMatrix" << std::endl;
       TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixD u(TMatrixD::kUnit,m);
       m(3,1) = TMath::Pi();
@@ -1445,7 +1445,7 @@ void mstress_mm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Test inline multiplications by a DiagMat" << endl;
+        std::cout << "Test inline multiplications by a DiagMat" << std::endl;
       TMatrixD m = THilbertMatrixD(msize+3,msize);
       m(1,3) = TMath::Pi();
       TVectorD v(msize);
@@ -1465,7 +1465,7 @@ void mstress_mm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Test XPP = X where P is a permutation matrix" << endl;
+        std::cout << "Test XPP = X where P is a permutation matrix" << std::endl;
       TMatrixD m = THilbertMatrixD(msize-1,msize);
       m(2,3) = TMath::Pi();
       TMatrixD eth = m;
@@ -1480,7 +1480,7 @@ void mstress_mm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Test general matrix multiplication through inline mult" << endl;
+        std::cout << "Test general matrix multiplication through inline mult" << std::endl;
       TMatrixD m = THilbertMatrixD(msize-2,msize);
       m(3,3) = TMath::Pi();
       TMatrixD mt(TMatrixD::kTransposed,m);
@@ -1499,7 +1499,7 @@ void mstress_mm_multiplications()
       ok &= VerifyMatrixIdentity(m,mp2,verbose,epsilon);
 
       if (verbose)
-        cout << "Test XP=X*P  vs XP=X;XP*=P" << endl;
+        std::cout << "Test XP=X*P  vs XP=X;XP*=P" << std::endl;
       TMatrixD mp3 = m1*p;
       ok &= VerifyMatrixIdentity(m,mp3,verbose,epsilon);
     }
@@ -1507,7 +1507,7 @@ void mstress_mm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Check n * m  == n * m_sym; m_sym * n == m * n; m_sym * m_sym == m * m" <<endl;
+        std::cout << "Check n * m  == n * m_sym; m_sym * n == m * n; m_sym * m_sym == m * m" <<std::endl;
 
       const TMatrixD     n     = THilbertMatrixD(0,msize-1,0,msize-1);
       const TMatrixD     m     = n;
@@ -1537,7 +1537,7 @@ void mstress_mm_multiplications()
 
     if (!ok) {
       if (gVerbose)
-        cout << "General Matrix Multiplications failed for size " << msize << endl;
+        std::cout << "General Matrix Multiplications failed for size " << msize << std::endl;
       break;
     }
   }
@@ -1545,7 +1545,7 @@ void mstress_mm_multiplications()
   if (ok)
   {
     if (gVerbose)
-      cout << "Check to see UU' = U'U = E when U is the Haar matrix" << endl;
+      std::cout << "Check to see UU' = U'U = E when U is the Haar matrix" << std::endl;
     const Int_t order = 5;
     const Int_t no_sub_cols = (1<<order)-5;
     TMatrixD haar_sub = THaarMatrixD(5,no_sub_cols);
@@ -1570,7 +1570,7 @@ void mstress_mm_multiplications()
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(10,"General Matrix Multiplications",ok);
 }
@@ -1582,8 +1582,8 @@ void mstress_mm_multiplications()
 void mstress_sym_mm_multiplications(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify symmetric matrix multiplications "
-            "for matrices of the characteristic size " << msize << endl;
+    std::cout << "\n---> Verify symmetric matrix multiplications "
+            "for matrices of the characteristic size " << msize << std::endl;
 
   Int_t i,j;
   Bool_t ok = kTRUE;
@@ -1592,7 +1592,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nTest inline multiplications of the UnitMatrix" << endl;
+      std::cout << "\nTest inline multiplications of the UnitMatrix" << std::endl;
     TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
     TMatrixDSym m_sym(-1,msize,m.GetMatrixArray());
     TMatrixDSym u(TMatrixDSym::kUnit,m_sym);
@@ -1603,10 +1603,10 @@ void mstress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nTest symmetric multiplications" << endl;
+      std::cout << "\nTest symmetric multiplications" << std::endl;
     {
       if (gVerbose)
-        cout << "\n  Test m * m_sym == m_sym * m == m_sym * m_sym  multiplications" << endl;
+        std::cout << "\n  Test m * m_sym == m_sym * m == m_sym * m_sym  multiplications" << std::endl;
       TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixDSym m_sym(-1,msize,m.GetMatrixArray());
       TMatrixD mm      = m * m;
@@ -1620,7 +1620,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
 
     {
       if (gVerbose)
-        cout << "\n  Test m^T * m_sym == m_sym^T * m == m_sym^T * m_sym  multiplications" << endl;
+        std::cout << "\n  Test m^T * m_sym == m_sym^T * m == m_sym^T * m_sym  multiplications" << std::endl;
       TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixDSym m_sym(-1,msize,m.GetMatrixArray());
       TMatrixD mtm      = TMatrixD(m    ,TMatrixD::kTransposeMult,m);
@@ -1634,7 +1634,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
 
     {
       if (gVerbose)
-        cout << "\n  Test m * m_sym^T == m_sym * m^T == m_sym * m_sym^T  multiplications" << endl;
+        std::cout << "\n  Test m * m_sym^T == m_sym * m^T == m_sym * m_sym^T  multiplications" << std::endl;
       TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixDSym m_sym(-1,msize,m.GetMatrixArray());
       TMatrixD mmt      = TMatrixD(m    ,TMatrixD::kMultTranspose,m);
@@ -1648,7 +1648,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
 
     {
       if (gVerbose)
-        cout << "\n  Test n * m_sym == n * m multiplications" << endl;
+        std::cout << "\n  Test n * m_sym == n * m multiplications" << std::endl;
       TMatrixD n = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixD m = n;
       n(1,3) = TMath::Pi();
@@ -1663,7 +1663,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Test inline multiplications by a DiagMatrix" << endl;
+      std::cout << "Test inline multiplications by a DiagMatrix" << std::endl;
     TMatrixDSym ms = THilbertMatrixDSym(msize);
     ms(1,3) = TMath::Pi();
     ms(3,1) = TMath::Pi();
@@ -1683,7 +1683,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Test XPP = X where P is a permutation matrix" << endl;
+      std::cout << "Test XPP = X where P is a permutation matrix" << std::endl;
     TMatrixDSym ms = THilbertMatrixDSym(msize);
     ms(2,3) = TMath::Pi();
     ms(3,2) = TMath::Pi();
@@ -1699,7 +1699,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Test general matrix multiplication through inline mult" << endl;
+      std::cout << "Test general matrix multiplication through inline mult" << std::endl;
     TMatrixDSym ms = THilbertMatrixDSym(msize);
     ms(2,3) = TMath::Pi();
     ms(3,2) = TMath::Pi();
@@ -1718,7 +1718,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
     ok &= ( mp2 == 0 ) ? kTRUE : kFALSE;
 
     if (gVerbose)
-      cout << "Test XP=X*P  vs XP=X;XP*=P" << endl;
+      std::cout << "Test XP=X*P  vs XP=X;XP*=P" << std::endl;
     TMatrixD mp3 = m1*p;
     ok &= VerifyMatrixIdentity(ms,mp3,gVerbose,epsilon);
   }
@@ -1726,7 +1726,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Check to see UU' = U'U = E when U is the Haar matrix" << endl;
+      std::cout << "Check to see UU' = U'U = E when U is the Haar matrix" << std::endl;
     {
       const Int_t order = 5;
       const Int_t no_sub_cols = (1<<order)-5;
@@ -1753,8 +1753,8 @@ void mstress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Check to see A.Similarity(Haar) = Haar * A * Haar^T" <<
-              " and A.SimilarityT(Haar) = Haar^T * A * Haar" << endl;
+      std::cout << "Check to see A.Similarity(Haar) = Haar * A * Haar^T" <<
+              " and A.SimilarityT(Haar) = Haar^T * A * Haar" << std::endl;
     {
       TMatrixD    h  = THaarMatrixD(5);
       TMatrixDSym ms = THilbertMatrixDSym(1<<5);
@@ -1764,7 +1764,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
       ok &= VerifyMatrixIdentity(ms.SimilarityT(h),htmh,gVerbose,epsilon);
     }
     if (gVerbose)
-      cout << "Check to see A.Similarity(B_sym) = A.Similarity(B)" << endl;
+      std::cout << "Check to see A.Similarity(B_sym) = A.Similarity(B)" << std::endl;
     {
       TMatrixDSym nsym = THilbertMatrixDSym(5);
       TMatrixD    n    = THilbertMatrixD(5,5);
@@ -1774,7 +1774,7 @@ void mstress_sym_mm_multiplications(Int_t msize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(11,"Symmetric Matrix Multiplications",ok);
 }
@@ -1797,12 +1797,12 @@ void mstress_vm_multiplications()
     const Int_t verbose = (gVerbose && nr==0 && iloop==gNrLoop);
 
     if (verbose)
-      cout << "\n---> Verify vector-matrix multiplications "
-             "for matrices of the characteristic size " << msize << endl;
+      std::cout << "\n---> Verify vector-matrix multiplications "
+             "for matrices of the characteristic size " << msize << std::endl;
 
     {
       if (verbose)
-        cout << "\nCheck shrinking a vector by multiplying by a non-sq unit matrix" << endl;
+        std::cout << "\nCheck shrinking a vector by multiplying by a non-sq unit matrix" << std::endl;
       TVectorD vb(-2,msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()-i;
@@ -1819,7 +1819,7 @@ void mstress_vm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Check expanding a vector by multiplying by a non-sq unit matrix" << endl;
+        std::cout << "Check expanding a vector by multiplying by a non-sq unit matrix" << std::endl;
       TVectorD vb(msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()+i;
@@ -1836,7 +1836,7 @@ void mstress_vm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Check general matrix-vector multiplication" << endl;
+        std::cout << "Check general matrix-vector multiplication" << std::endl;
       TVectorD vb(msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()+i;
@@ -1854,7 +1854,7 @@ void mstress_vm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Check symmetric matrix-vector multiplication" << endl;
+        std::cout << "Check symmetric matrix-vector multiplication" << std::endl;
       TVectorD vb(msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()+i;
@@ -1881,13 +1881,13 @@ void mstress_vm_multiplications()
 
     if (!ok) {
       if (gVerbose)
-        cout << "Vector Matrix Multiplications failed for size " << msize << endl;
+        std::cout << "Vector Matrix Multiplications failed for size " << msize << std::endl;
       break;
     }
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(12,"Matrix Vector Multiplications",ok);
 }
@@ -1910,10 +1910,10 @@ void mstress_inversion()
     const Int_t verbose = (gVerbose && nr==0 && iloop==gNrLoop);
 
     if (verbose)
-      cout << "\n---> Verify matrix inversion for square matrices of size " << msize << endl;
+      std::cout << "\n---> Verify matrix inversion for square matrices of size " << msize << std::endl;
     {
       if (verbose)
-        cout << "\nTest inversion of a diagonal matrix" << endl;
+        std::cout << "\nTest inversion of a diagonal matrix" << std::endl;
       TMatrixD m(-1,msize,-1,msize);
       TMatrixD mi(TMatrixD::kZero,m);
       for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++) {
@@ -1929,7 +1929,7 @@ void mstress_inversion()
     if (ok)
     {
       if (verbose)
-        cout << "Test inversion of an orthonormal (Haar) matrix" << endl;
+        std::cout << "Test inversion of an orthonormal (Haar) matrix" << std::endl;
       const Int_t order = Int_t(TMath::Log(msize)/TMath::Log(2));
       TMatrixD mr = THaarMatrixD(order);
       TMatrixD morig = mr;
@@ -1939,8 +1939,8 @@ void mstress_inversion()
       ok &= VerifyMatrixIdentity(mr,mt,verbose,epsilon);
       ok &= ( TMath::Abs(det-1) <= msize*epsilon ) ? kTRUE : kFALSE;
       if (verbose) {
-        cout << "det = " << det << " deviation= " << TMath::Abs(det-1);
-        cout << ( (TMath::Abs(det-1) < msize*epsilon) ? " OK" : " too large") <<endl;
+        std::cout << "det = " << det << " deviation= " << TMath::Abs(det-1);
+        std::cout << ( (TMath::Abs(det-1) < msize*epsilon) ? " OK" : " too large") <<std::endl;
       }
       TMatrixD mti(TMatrixD::kInverted,mt);
       ok &= VerifyMatrixIdentity(mti,morig,verbose,msize*epsilon);
@@ -1949,7 +1949,7 @@ void mstress_inversion()
     if (ok)
     {
       if (verbose)
-        cout << "Test inversion of a good matrix with diagonal dominance" << endl;
+        std::cout << "Test inversion of a good matrix with diagonal dominance" << std::endl;
       TMatrixD mh = THilbertMatrixD(msize,msize);
       TMatrixDDiag(mh) += 1;
       TMatrixD morig = mh;
@@ -1957,44 +1957,44 @@ void mstress_inversion()
       const Double_t det_comp = mh.Determinant();
       mh.Invert(&det_inv);
       if (verbose) {
-        cout << "\tcomputed determinant             " << det_comp << endl;
-        cout << "\tdeterminant returned by Invert() " << det_inv << endl;
+        std::cout << "\tcomputed determinant             " << det_comp << std::endl;
+        std::cout << "\tdeterminant returned by Invert() " << det_inv << std::endl;
       }
 
       if (verbose)
-        cout << "\tcheck to see M^(-1) * M is E" << endl;
+        std::cout << "\tcheck to see M^(-1) * M is E" << std::endl;
       TMatrixD mim(mh,TMatrixD::kMult,morig);
       TMatrixD unit(TMatrixD::kUnit,mh);
       ok &= VerifyMatrixIdentity(mim,unit,verbose,epsilon);
 
       if (verbose)
-        cout << "Test inversion through the matrix decompositions" << endl;
+        std::cout << "Test inversion through the matrix decompositions" << std::endl;
 
       TMatrixDSym ms = THilbertMatrixDSym(msize);
       TMatrixDDiag(ms) += 1;
       if (verbose)
-        cout << "Test inversion through SVD" << endl;
+        std::cout << "Test inversion through SVD" << std::endl;
       TMatrixD inv_svd (msize,msize); TDecompSVD  svd (ms); svd.Invert(inv_svd);
       ok &= VerifyMatrixIdentity(inv_svd,mh,verbose,epsilon);
       if (verbose)
-        cout << "Test inversion through LU" << endl;
+        std::cout << "Test inversion through LU" << std::endl;
       TMatrixD inv_lu  (msize,msize); TDecompLU   lu  (ms); lu.Invert(inv_lu);
       ok &= VerifyMatrixIdentity(inv_lu,mh,verbose,epsilon);
       if (verbose)
-        cout << "Test inversion through Cholesky" << endl;
+        std::cout << "Test inversion through Cholesky" << std::endl;
       TMatrixDSym inv_chol(msize); TDecompChol chol(ms); chol.Invert(inv_chol);
       ok &= VerifyMatrixIdentity(inv_chol,mh,verbose,epsilon);
       if (verbose)
-        cout << "Test inversion through QRH" << endl;
+        std::cout << "Test inversion through QRH" << std::endl;
       TMatrixD inv_qrh (msize,msize); TDecompQRH  qrh (ms); qrh.Invert(inv_qrh);
       ok &= VerifyMatrixIdentity(inv_qrh,mh,verbose,epsilon);
       if (verbose)
-        cout << "Test inversion through Bunch-Kaufman" << endl;
+        std::cout << "Test inversion through Bunch-Kaufman" << std::endl;
       TMatrixDSym inv_bk(msize); TDecompBK bk(ms); chol.Invert(inv_bk);
       ok &= VerifyMatrixIdentity(inv_bk,mh,verbose,epsilon);
 
       if (verbose)
-        cout << "\tcheck to see M * M^(-1) is E" << endl;
+        std::cout << "\tcheck to see M * M^(-1) is E" << std::endl;
       TMatrixD mmi = morig; mmi *= mh;
       ok &= VerifyMatrixIdentity(mmi,unit,verbose,epsilon);
     }
@@ -2011,15 +2011,15 @@ void mstress_inversion()
 
     if (!ok) {
       if (gVerbose)
-        cout << "Matrix Inversion failed for size " << msize << endl;
+        std::cout << "Matrix Inversion failed for size " << msize << std::endl;
       break;
     }
   }
 
   {
     if (gVerbose) {
-      cout << "Check to see that Invert() and InvertFast() give identical results" <<endl;
-      cout << " for size < (7x7)" <<endl;
+      std::cout << "Check to see that Invert() and InvertFast() give identical results" <<std::endl;
+      std::cout << " for size < (7x7)" <<std::endl;
     }
     Int_t size;
     for (size = 2; size < 7; size++) {
@@ -2034,9 +2034,9 @@ void mstress_inversion()
       ok &= VerifyMatrixIdentity(m1,m2,gVerbose,EPSILON);
       ok &= (TMath::Abs(det1-det2) < EPSILON);
       if (gVerbose) {
-        cout << "det(Invert)= " << det1 << "  det(InvertFast)= " << det2 <<endl;
-        cout << " deviation= " << TMath::Abs(det1-det2);
-        cout << ( (TMath::Abs(det1-det2) <  EPSILON) ? " OK" : " too large") <<endl;
+        std::cout << "det(Invert)= " << det1 << "  det(InvertFast)= " << det2 <<std::endl;
+        std::cout << " deviation= " << TMath::Abs(det1-det2);
+        std::cout << ( (TMath::Abs(det1-det2) <  EPSILON) ? " OK" : " too large") <<std::endl;
       }
     }
     for (size = 2; size < 7; size++) {
@@ -2050,15 +2050,15 @@ void mstress_inversion()
       ok &= VerifyMatrixIdentity(ms1,ms2,gVerbose,EPSILON);
       ok &= (TMath::Abs(det1-det2) < EPSILON);
       if (gVerbose) {
-        cout << "det(Invert)= " << det1 << "  det(InvertFast)= " << det2 <<endl;
-        cout << " deviation= " << TMath::Abs(det1-det2);
-        cout << ( (TMath::Abs(det1-det2) <  EPSILON) ? " OK" : " too large") <<endl;
+        std::cout << "det(Invert)= " << det1 << "  det(InvertFast)= " << det2 <<std::endl;
+        std::cout << " deviation= " << TMath::Abs(det1-det2);
+        std::cout << ( (TMath::Abs(det1-det2) <  EPSILON) ? " OK" : " too large") <<std::endl;
       }
     }
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(13,"Matrix Inversion",ok);
 }
@@ -2070,7 +2070,7 @@ void mstress_inversion()
 void mstress_matrix_io()
 {
   if (gVerbose)
-    cout << "\n---> Test matrix I/O" << endl;
+    std::cout << "\n---> Test matrix I/O" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = TMath::Pi();
@@ -2097,17 +2097,17 @@ void mstress_matrix_io()
     ms = pattern;
 
     if (verbose)
-      cout << "\nWrite matrix m to database" << endl;
+      std::cout << "\nWrite matrix m to database" << std::endl;
     snprintf(name,80,"m_%d",msize);
     m.Write(name);
 
     if (verbose)
-      cout << "\nWrite matrix ma which adopts to database" << endl;
+      std::cout << "\nWrite matrix ma which adopts to database" << std::endl;
     snprintf(name,80,"ma_%d",msize);
     ma.Write(name);
 
     if (verbose)
-      cout << "\nWrite symmetric matrix ms to database" << endl;
+      std::cout << "\nWrite symmetric matrix ms to database" << std::endl;
     snprintf(name,80,"ms_%d",msize);
     ms.Write(name);
 
@@ -2117,11 +2117,11 @@ void mstress_matrix_io()
   }
 
   if (gVerbose)
-    cout << "\nClose database" << endl;
+    std::cout << "\nClose database" << std::endl;
   delete f;
 
   if (gVerbose)
-    cout << "\nOpen database in read-only mode and read matrix" << endl;
+    std::cout << "\nOpen database in read-only mode and read matrix" << std::endl;
   TFile *f1 = new TFile("vmatrix.root");
 
   iloop = gNrLoop;
@@ -2140,7 +2140,7 @@ void mstress_matrix_io()
     TMatrixDSym *msr = (TMatrixDSym*) f1->Get(name);
 
     if (verbose)
-      cout << "\nRead matrix should be same as original" << endl;
+      std::cout << "\nRead matrix should be same as original" << std::endl;
     ok &= ((*mr)  == m) ? kTRUE : kFALSE;
     ok &= ((*mar) == m) ? kTRUE : kFALSE;
     ok &= ((*msr) == m) ? kTRUE : kFALSE;
@@ -2151,7 +2151,7 @@ void mstress_matrix_io()
   delete f1;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(14,"Matrix Persistence",ok);
 }
@@ -2162,7 +2162,7 @@ void mstress_matrix_io()
 void spstress_allocation(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n\n---> Test allocation and compatibility check" << endl;
+    std::cout << "\n\n---> Test allocation and compatibility check" << std::endl;
 
   Int_t i,j;
   Bool_t ok = kTRUE;
@@ -2194,22 +2194,22 @@ void spstress_allocation(Int_t msize)
   TMatrixDSparse m4(m1);
 
   if (gVerbose) {
-    cout << "\nStatus information reported for matrix m3:" << endl;
-    cout << "  Row lower bound ... " << m3.GetRowLwb() << endl;
-    cout << "  Row upper bound ... " << m3.GetRowUpb() << endl;
-    cout << "  Col lower bound ... " << m3.GetColLwb() << endl;
-    cout << "  Col upper bound ... " << m3.GetColUpb() << endl;
-    cout << "  No. rows ..........." << m3.GetNrows()  << endl;
-    cout << "  No. cols ..........." << m3.GetNcols()  << endl;
-    cout << "  No. of elements ...." << m3.GetNoElements() << endl;
+    std::cout << "\nStatus information reported for matrix m3:" << std::endl;
+    std::cout << "  Row lower bound ... " << m3.GetRowLwb() << std::endl;
+    std::cout << "  Row upper bound ... " << m3.GetRowUpb() << std::endl;
+    std::cout << "  Col lower bound ... " << m3.GetColLwb() << std::endl;
+    std::cout << "  Col upper bound ... " << m3.GetColUpb() << std::endl;
+    std::cout << "  No. rows ..........." << m3.GetNrows()  << std::endl;
+    std::cout << "  No. cols ..........." << m3.GetNcols()  << std::endl;
+    std::cout << "  No. of elements ...." << m3.GetNoElements() << std::endl;
   }
 
   if (gVerbose)
-    cout << "Check matrices 1 & 4 for compatibility" << endl;
+    std::cout << "Check matrices 1 & 4 for compatibility" << std::endl;
   ok &= AreCompatible(m1,m4,gVerbose);
 
   if (gVerbose)
-    cout << "m2 has to be compatible with m3 after resizing to m3" << endl;
+    std::cout << "m2 has to be compatible with m3 after resizing to m3" << std::endl;
   m2.ResizeTo(m3);
   ok &= AreCompatible(m2,m3,gVerbose);
 
@@ -2220,21 +2220,21 @@ void spstress_allocation(Int_t msize)
   TMatrixDSparse m5(m5_d);
 
   if (gVerbose)
-    cout << "m1 has to be compatible with m5 after resizing to m5" << endl;
+    std::cout << "m1 has to be compatible with m5 after resizing to m5" << std::endl;
   m1.ResizeTo(m5.GetNrows(),m5.GetNcols());
   ok &= AreCompatible(m1,m5,gVerbose);
 
   if (gVerbose)
-    cout << "m1 has to be equal to m4 after stretching and shrinking" << endl;
+    std::cout << "m1 has to be equal to m4 after stretching and shrinking" << std::endl;
   m1.ResizeTo(m4.GetNrows(),m4.GetNcols());
   ok &= VerifyMatrixIdentity(m1,m4,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "m5 has to be equal to m1 after shrinking" << endl;
+    std::cout << "m5 has to be equal to m1 after shrinking" << std::endl;
   m5.ResizeTo(m1.GetNrows(),m1.GetNcols());
   ok &= VerifyMatrixIdentity(m1,m5,gVerbose,msize*EPSILON);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(1,"Allocation, Resizing",ok);
 }
@@ -2271,7 +2271,7 @@ void spstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check filling through operator(i,j) without setting sparse index" << endl;
+      std::cout << "Check filling through operator(i,j) without setting sparse index" << std::endl;
     TMatrixDSparse m1(-1,rsize-2,1,csize);
 
     for (Int_t i = m1.GetRowLwb(); i <= m1.GetRowUpb(); i++)
@@ -2283,7 +2283,7 @@ void spstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check filling through operator(i,j)" << endl;
+      std::cout << "Check filling through operator(i,j)" << std::endl;
     TMatrixDSparse m2(-1,rsize-2,1,csize);
     m2.SetSparseIndex(m);
 
@@ -2296,7 +2296,7 @@ void spstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check insertion/extraction of sub-matrices" << endl;
+      std::cout << "Check insertion/extraction of sub-matrices" << std::endl;
     {
       TMatrixDSparse m_sub1 = m;
       m_sub1.ResizeTo(0,rsize-2,2,csize);
@@ -2354,7 +2354,7 @@ void spstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check insertion/extraction of rows" << endl;
+      std::cout << "Check insertion/extraction of rows" << std::endl;
 
     TMatrixDSparse m1 = m;
     TVectorD v1(1,csize);
@@ -2375,7 +2375,7 @@ void spstress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check array Use" << endl;
+      std::cout << "Check array Use" << std::endl;
     {
       TMatrixDSparse *m1a = new TMatrixDSparse(m);
       TMatrixDSparse *m2a = new TMatrixDSparse();
@@ -2389,7 +2389,7 @@ void spstress_matrix_fill(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(2,"Filling, Inserting, Using",ok);
 }
@@ -2406,17 +2406,17 @@ void spstress_element_op(Int_t rsize,Int_t csize)
   TMatrixDSparse m(-1,rsize-2,1,csize);
 
   if (gVerbose)
-    cout << "Creating zero m1 ..." << endl;
+    std::cout << "Creating zero m1 ..." << std::endl;
   TMatrixDSparse m1(TMatrixDSparse::kZero, m);
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing m1 with 0 ..." << endl;
+    std::cout << "Comparing m1 with 0 ..." << std::endl;
   R__ASSERT(m1 == 0);
   R__ASSERT(!(m1 != 0));
 
   if (gVerbose)
-    cout << "Writing a pattern " << pattern << " by assigning through SetMatrixArray..." << endl;
+    std::cout << "Writing a pattern " << pattern << " by assigning through SetMatrixArray..." << std::endl;
   {
     const Int_t nr = rsize*csize;
     Int_t    *irow = new Int_t[nr];
@@ -2440,38 +2440,38 @@ void spstress_element_op(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "Writing the pattern by assigning to m1 as a whole ..."  << endl;
+    std::cout << "Writing the pattern by assigning to m1 as a whole ..."  << std::endl;
   m1.SetSparseIndex(m);
   m1 = pattern;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing m and m1 ..." << endl;
+    std::cout << "Comparing m and m1 ..." << std::endl;
   R__ASSERT(m == m1);
   if (gVerbose)
-    cout << "Comparing (m=0) and m1 ..." << endl;
+    std::cout << "Comparing (m=0) and m1 ..." << std::endl;
   R__ASSERT(!((m=0) == m1));
 
   if (gVerbose)
-    cout << "Clearing m1 ..." << endl;
+    std::cout << "Clearing m1 ..." << std::endl;
   m1.Zero();
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nSet m = pattern" << endl;
+    std::cout << "\nSet m = pattern" << std::endl;
   m = pattern;
   ok &= VerifyMatrixValue(m,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   add the doubled pattern with the negative sign" << endl;
+    std::cout << "   add the doubled pattern with the negative sign" << std::endl;
   m += -2*pattern;
   ok &= VerifyMatrixValue(m,-pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   subtract the trippled pattern with the negative sign" << endl;
+    std::cout << "   subtract the trippled pattern with the negative sign" << std::endl;
   m -= -3*pattern;
   ok &= VerifyMatrixValue(m,2*pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify comparison operations when all elems are the same" << endl;
+    std::cout << "\nVerify comparison operations when all elems are the same" << std::endl;
   m = pattern;
   R__ASSERT( m == pattern && !(m != pattern) );
   R__ASSERT( m > 0 && m >= pattern && m <= pattern );
@@ -2482,7 +2482,7 @@ void spstress_element_op(Int_t rsize,Int_t csize)
   R__ASSERT( m  >= -pattern && !(m > -pattern) );
 
   if (gVerbose)
-    cout << "\nVerify comparison operations when not all elems are the same" << endl;
+    std::cout << "\nVerify comparison operations when not all elems are the same" << std::endl;
   {
     Int_t nr = rsize*csize;
     Int_t    *irow = new Int_t[nr];
@@ -2510,26 +2510,26 @@ void spstress_element_op(Int_t rsize,Int_t csize)
   R__ASSERT( !(m >= pattern) && m <= pattern && !(m<pattern) );
   R__ASSERT( !(m <= pattern-1) && m >= pattern-1 && !(m>pattern-1) );
   if (gVerbose)
-    cout << "\nAssign 2*pattern to m by repeating additions" << endl;
+    std::cout << "\nAssign 2*pattern to m by repeating additions" << std::endl;
   m = 0; m += pattern; m += pattern;
   if (gVerbose)
-    cout << "Assign 2*pattern to m1 by multiplying by two " << endl;
+    std::cout << "Assign 2*pattern to m1 by multiplying by two " << std::endl;
   m1.SetSparseIndex(m);
   m1 = pattern; m1 *= 2;
   ok &= VerifyMatrixValue(m1,2*pattern,gVerbose,EPSILON);
   R__ASSERT( m == m1 );
   if (gVerbose)
-    cout << "Multiply m1 by one half returning it to the 1*pattern" << endl;
+    std::cout << "Multiply m1 by one half returning it to the 1*pattern" << std::endl;
   m1 *= 1/2.;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nAssign -pattern to m and m1" << endl;
+    std::cout << "\nAssign -pattern to m and m1" << std::endl;
   m = 0; m -= pattern; m1 = -pattern;
   ok &= VerifyMatrixValue(m,-pattern,gVerbose,EPSILON);
   R__ASSERT( m == m1 );
   if (gVerbose)
-    cout << "m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same" << endl;
+    std::cout << "m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same" << std::endl;
   m.Sqr();
   ok &= VerifyMatrixValue(m,pattern*pattern,gVerbose,EPSILON);
   m.Sqrt();
@@ -2539,7 +2539,7 @@ void spstress_element_op(Int_t rsize,Int_t csize)
   ok &= VerifyMatrixIdentity(m1,m,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(3,"Uniform matrix operations",ok);
 }
@@ -2551,7 +2551,7 @@ void spstress_element_op(Int_t rsize,Int_t csize)
 void spstress_binary_ebe_op(Int_t rsize, Int_t csize)
 {
   if (gVerbose)
-    cout << "\n---> Test Binary Matrix element-by-element operations" << endl;
+    std::cout << "\n---> Test Binary Matrix element-by-element operations" << std::endl;
 
   Bool_t ok = kTRUE;
 
@@ -2569,49 +2569,49 @@ void spstress_binary_ebe_op(Int_t rsize, Int_t csize)
   }
 
   if (gVerbose)
-    cout << "\nVerify assignment of a matrix to the matrix" << endl;
+    std::cout << "\nVerify assignment of a matrix to the matrix" << std::endl;
   m  = pattern;
   m1 = m;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
   R__ASSERT( m1 == m );
 
   if (gVerbose)
-    cout << "\nAdding the matrix to itself, uniform pattern " << pattern << endl;
+    std::cout << "\nAdding the matrix to itself, uniform pattern " << pattern << std::endl;
   m.Zero(); m.SetSparseIndex(m_d); m = pattern;
 
   m1 = m; m1 += m1;
   ok &= VerifyMatrixValue(m1,2*pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting two matrices ..." << endl;
+    std::cout << "  subtracting two matrices ..." << std::endl;
   m1 -= m;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting the matrix from itself" << endl;
+    std::cout << "  subtracting the matrix from itself" << std::endl;
   m1 -= m1;
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
   m1.SetSparseIndex(m_d);
 
   if (gVerbose) {
-    cout << "\nArithmetic operations on matrices with not the same elements" << endl;
-    cout << "   adding mp to the zero matrix..." << endl;
+    std::cout << "\nArithmetic operations on matrices with not the same elements" << std::endl;
+    std::cout << "   adding mp to the zero matrix..." << std::endl;
   }
   m.Zero(); m.SetSparseIndex(m_d); m += mp;
   ok &= VerifyMatrixIdentity(m,mp,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   making m = 3*mp and m1 = 3*mp, via add() and succesive mult" << endl;
+    std::cout << "   making m = 3*mp and m1 = 3*mp, via add() and succesive mult" << std::endl;
   m1 = m;
   Add(m,2.,mp);
   m1 += m1; m1 += mp;
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   clear both m and m1, by subtracting from itself and via add()" << endl;
+    std::cout << "   clear both m and m1, by subtracting from itself and via add()" << std::endl;
   m1 -= m1;
   Add(m,-3.,mp);
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
 
   if (gVerbose) {
-    cout << "\nTesting element-by-element multiplications and divisions" << endl;
-    cout << "   squaring each element with sqr() and via multiplication" << endl;
+    std::cout << "\nTesting element-by-element multiplications and divisions" << std::endl;
+    std::cout << "   squaring each element with sqr() and via multiplication" << std::endl;
   }
   m.SetSparseIndex(m_d);  m = mp;
   m1.SetSparseIndex(m_d); m1 = mp;
@@ -2619,7 +2619,7 @@ void spstress_binary_ebe_op(Int_t rsize, Int_t csize)
   ElementMult(m1,m1);
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   compare (m = pattern^2)/pattern with pattern" << endl;
+    std::cout << "   compare (m = pattern^2)/pattern with pattern" << std::endl;
   m = pattern; m1 = pattern;
   m.Sqr();
   ElementDiv(m,m1);
@@ -2628,7 +2628,7 @@ void spstress_binary_ebe_op(Int_t rsize, Int_t csize)
     Compare(m1,m);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(4,"Binary Matrix element-by-element operations",ok);
 }
@@ -2640,14 +2640,14 @@ void spstress_binary_ebe_op(Int_t rsize, Int_t csize)
 void spstress_transposition(Int_t msize)
 {
   if (gVerbose) {
-    cout << "\n---> Verify matrix transpose "
-            "for matrices of a characteristic size " << msize << endl;
+    std::cout << "\n---> Verify matrix transpose "
+            "for matrices of a characteristic size " << msize << std::endl;
   }
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nCheck to see that a square UnitMatrix stays the same";
+      std::cout << "\nCheck to see that a square UnitMatrix stays the same";
     TMatrixDSparse m(msize,msize);
     m.UnitMatrix();
     TMatrixDSparse mt(TMatrixDSparse::kTransposed,m);
@@ -2656,7 +2656,7 @@ void spstress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nTest a non-square UnitMatrix";
+      std::cout << "\nTest a non-square UnitMatrix";
     TMatrixDSparse m(msize,msize+1);
     m.UnitMatrix();
     TMatrixDSparse mt(TMatrixDSparse::kTransposed,m);
@@ -2671,7 +2671,7 @@ void spstress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck to see that a symmetric (Hilbert)Matrix stays the same";
+      std::cout << "\nCheck to see that a symmetric (Hilbert)Matrix stays the same";
     TMatrixDSparse m = TMatrixD(THilbertMatrixD(msize,msize));
     TMatrixDSparse mt(TMatrixDSparse::kTransposed,m);
     ok &= ( m == mt ) ? kTRUE : kFALSE;
@@ -2679,7 +2679,7 @@ void spstress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck transposing a non-symmetric matrix";
+      std::cout << "\nCheck transposing a non-symmetric matrix";
     TMatrixDSparse m = TMatrixD(THilbertMatrixD(msize+1,msize));
     m(1,2) = TMath::Pi();
     TMatrixDSparse mt(TMatrixDSparse::kTransposed,m);
@@ -2688,13 +2688,13 @@ void spstress_transposition(Int_t msize)
     R__ASSERT(mt[2][1] == (Double_t)TMath::Pi() && mt[1][2] != (Double_t)TMath::Pi());
 
     if (gVerbose)
-      cout << "\nCheck double transposing a non-symmetric matrix" << endl;
+      std::cout << "\nCheck double transposing a non-symmetric matrix" << std::endl;
     TMatrixDSparse mtt(TMatrixDSparse::kTransposed,mt);
     ok &= ( m == mtt ) ? kTRUE : kFALSE;
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(5,"Matrix transposition",ok);
 }
@@ -2706,7 +2706,7 @@ void spstress_transposition(Int_t msize)
 void spstress_norms(Int_t rsize_req,Int_t csize_req)
 {
   if (gVerbose)
-    cout << "\n---> Verify norm calculations" << endl;
+    std::cout << "\n---> Verify norm calculations" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 10.25;
@@ -2716,8 +2716,8 @@ void spstress_norms(Int_t rsize_req,Int_t csize_req)
   Int_t csize = csize_req;
   if (csize%2 != 0)  csize--;
   if (rsize%2 == 1 || csize%2 == 1) {
-    cout << "rsize: " << rsize <<endl;
-    cout << "csize: " << csize <<endl;
+    std::cout << "rsize: " << rsize <<std::endl;
+    std::cout << "csize: " << csize <<std::endl;
     Fatal("spstress_norms","Sorry, size of the matrix to test must be even for this test\n");
   }
 
@@ -2725,24 +2725,24 @@ void spstress_norms(Int_t rsize_req,Int_t csize_req)
   TMatrixDSparse m(rsize,csize); m.SetSparseIndex(m_d);
 
   if (gVerbose)
-    cout << "\nAssign " << pattern << " to all the elements and check norms" << endl;
+    std::cout << "\nAssign " << pattern << " to all the elements and check norms" << std::endl;
   m = pattern;
   if (gVerbose)
-    cout << "  1. (col) norm should be pattern*nrows" << endl;
+    std::cout << "  1. (col) norm should be pattern*nrows" << std::endl;
   ok &= ( m.Norm1() == pattern*m.GetNrows() ) ? kTRUE : kFALSE;
   ok &= ( m.Norm1() == m.ColNorm() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Inf (row) norm should be pattern*ncols" << endl;
+    std::cout << "  Inf (row) norm should be pattern*ncols" << std::endl;
   ok &= ( m.NormInf() == pattern*m.GetNcols() ) ? kTRUE : kFALSE;
   ok &= ( m.NormInf() == m.RowNorm() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Square of the Eucl norm has got to be pattern^2 * no_elems" << endl;
+    std::cout << "  Square of the Eucl norm has got to be pattern^2 * no_elems" << std::endl;
   ok &= ( m.E2Norm() == (pattern*pattern)*m.GetNoElements() ) ? kTRUE : kFALSE;
   TMatrixDSparse m1(m); m1 = 1;
   ok &= ( m.E2Norm() == E2Norm(m+1.,m1) ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(6,"Matrix Norms",ok);
 }
@@ -2770,12 +2770,12 @@ void spstress_mm_multiplications()
     }
 
     if (verbose)
-      cout << "\n---> Verify matrix multiplications "
-              "for matrices of the characteristic size " << msize << endl;
+      std::cout << "\n---> Verify matrix multiplications "
+              "for matrices of the characteristic size " << msize << std::endl;
 
     {
       if (verbose)
-        cout << "\nTest inline multiplications of the UnitMatrix" << endl;
+        std::cout << "\nTest inline multiplications of the UnitMatrix" << std::endl;
       if (ok)
       {
         TMatrixDSparse m = TMatrixD(THilbertMatrixD(-1,msize,-1,msize));
@@ -2802,7 +2802,7 @@ void spstress_mm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Test XPP = X where P is a permutation matrix" << endl;
+        std::cout << "Test XPP = X where P is a permutation matrix" << std::endl;
       TMatrixDSparse m = TMatrixD(THilbertMatrixD(msize-1,msize));
       m(2,3) = TMath::Pi();
       TMatrixDSparse eth = m;
@@ -2832,7 +2832,7 @@ void spstress_mm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Test general matrix multiplication through inline mult" << endl;
+        std::cout << "Test general matrix multiplication through inline mult" << std::endl;
       TMatrixDSparse m = TMatrixD(THilbertMatrixD(msize-2,msize));
       m(3,3) = TMath::Pi();
       TMatrixD p_d = THilbertMatrixD(msize,msize);
@@ -2853,7 +2853,7 @@ void spstress_mm_multiplications()
       ok &= VerifyMatrixIdentity(m,mp2,verbose,epsilon);
 
       if (verbose)
-        cout << "Test XP=X*P  vs XP=X;XP*=P" << endl;
+        std::cout << "Test XP=X*P  vs XP=X;XP*=P" << std::endl;
       TMatrixDSparse mp3 = m1*p_d;
       ok &= VerifyMatrixIdentity(m,mp3,verbose,epsilon);
     }
@@ -2870,7 +2870,7 @@ void spstress_mm_multiplications()
 
     if (!ok) {
       if (gVerbose)
-        cout << "General Matrix Multiplications failed for size " << msize << endl;
+        std::cout << "General Matrix Multiplications failed for size " << msize << std::endl;
       break;
     }
   }
@@ -2878,7 +2878,7 @@ void spstress_mm_multiplications()
   if (ok)
   {
     if (gVerbose)
-      cout << "Check to see UU' = U'U = E when U is the Haar matrix" << endl;
+      std::cout << "Check to see UU' = U'U = E when U is the Haar matrix" << std::endl;
     const Int_t order = 5;
     const Int_t no_sub_cols = (1<<order)-order;
     TMatrixDSparse haar_sub = TMatrixD(THaarMatrixD(order,no_sub_cols));
@@ -2910,7 +2910,7 @@ void spstress_mm_multiplications()
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(7,"General Matrix Multiplications",ok);
 }
@@ -2933,12 +2933,12 @@ void spstress_vm_multiplications()
     const Int_t verbose = (gVerbose && nr==0 && iloop==gNrLoop);
 
     if (verbose)
-      cout << "\n---> Verify vector-matrix multiplications "
-             "for matrices of the characteristic size " << msize << endl;
+      std::cout << "\n---> Verify vector-matrix multiplications "
+             "for matrices of the characteristic size " << msize << std::endl;
 
     {
       if (verbose)
-        cout << "\nCheck shrinking a vector by multiplying by a non-sq unit matrix" << endl;
+        std::cout << "\nCheck shrinking a vector by multiplying by a non-sq unit matrix" << std::endl;
       TVectorD vb(-2,msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()-i;
@@ -2955,7 +2955,7 @@ void spstress_vm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Check expanding a vector by multiplying by a non-sq unit matrix" << endl;
+        std::cout << "Check expanding a vector by multiplying by a non-sq unit matrix" << std::endl;
       TVectorD vb(msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()+i;
@@ -2972,7 +2972,7 @@ void spstress_vm_multiplications()
     if (ok)
     {
       if (verbose)
-        cout << "Check general matrix-vector multiplication" << endl;
+        std::cout << "Check general matrix-vector multiplication" << std::endl;
       TVectorD vb(msize);
       for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
         vb(i) = TMath::Pi()+i;
@@ -3002,13 +3002,13 @@ void spstress_vm_multiplications()
 
     if (!ok) {
       if (gVerbose)
-        cout << "Vector Matrix Multiplications failed for size " << msize << endl;
+        std::cout << "Vector Matrix Multiplications failed for size " << msize << std::endl;
       break;
     }
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(8,"Matrix Vector Multiplications",ok);
 }
@@ -3020,7 +3020,7 @@ void spstress_vm_multiplications()
 void spstress_matrix_slices(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test operations with vectors and sparse matrix slices" << endl;
+    std::cout << "\n---> Test operations with vectors and sparse matrix slices" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 8.625;
@@ -3032,7 +3032,7 @@ void spstress_matrix_slices(Int_t vsize)
 
   Int_t i,j;
   if (gVerbose)
-    cout << "\nCheck modifying the matrix row-by-row" << endl;
+    std::cout << "\nCheck modifying the matrix row-by-row" << std::endl;
   m = pattern;
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
   for (i = m.GetRowLwb(); i <= m.GetRowUpb(); i++) {
@@ -3066,7 +3066,7 @@ void spstress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nCheck modifying the matrix diagonal" << endl;
+    std::cout << "\nCheck modifying the matrix diagonal" << std::endl;
   m = pattern;
   TMatrixDSparseDiag td = m;
   td = pattern-3;
@@ -3092,7 +3092,7 @@ void spstress_matrix_slices(Int_t vsize)
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(9,"Matrix Slices to Vectors",ok);
 }
 
@@ -3103,7 +3103,7 @@ void spstress_matrix_slices(Int_t vsize)
 void spstress_matrix_io()
 {
   if (gVerbose)
-    cout << "\n---> Test matrix I/O" << endl;
+    std::cout << "\n---> Test matrix I/O" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = TMath::Pi();
@@ -3123,12 +3123,12 @@ void spstress_matrix_io()
     ma.Use(m);
 
     if (verbose)
-      cout << "\nWrite matrix m to database" << endl;
+      std::cout << "\nWrite matrix m to database" << std::endl;
     snprintf(name,80,"m_%d",msize);
     m.Write(name);
 
     if (verbose)
-      cout << "\nWrite matrix ma which adopts to database" << endl;
+      std::cout << "\nWrite matrix ma which adopts to database" << std::endl;
     snprintf(name,80,"ma_%d",msize);
     ma.Write(name);
 
@@ -3136,11 +3136,11 @@ void spstress_matrix_io()
   }
 
   if (gVerbose)
-    cout << "\nClose database" << endl;
+    std::cout << "\nClose database" << std::endl;
   delete f;
 
   if (gVerbose)
-    cout << "\nOpen database in read-only mode and read matrix" << endl;
+    std::cout << "\nOpen database in read-only mode and read matrix" << std::endl;
   TFile *f1 = new TFile("vmatrix.root");
 
   iloop = gNrLoop;
@@ -3158,7 +3158,7 @@ void spstress_matrix_io()
     snprintf(name,80,"ms_%d",msize);
 
     if (verbose)
-      cout << "\nRead matrix should be same as original" << endl;
+      std::cout << "\nRead matrix should be same as original" << std::endl;
     ok &= ((*mr)  == m) ? kTRUE : kFALSE;
     ok &= ((*mar) == m) ? kTRUE : kFALSE;
 
@@ -3168,7 +3168,7 @@ void spstress_matrix_io()
   delete f1;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(10,"Matrix Persistence",ok);
 }
@@ -3179,7 +3179,7 @@ void spstress_matrix_io()
 void vstress_allocation(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n\n---> Test allocation and compatibility check" << endl;
+    std::cout << "\n\n---> Test allocation and compatibility check" << std::endl;
 
   Int_t i;
   Bool_t ok = kTRUE;
@@ -3189,34 +3189,34 @@ void vstress_allocation(Int_t msize)
   TVectorD v4(v1);
 
   if (gVerbose) {
-    cout << "\nStatus information reported for vector v3:" << endl;
-    cout << "  Lower bound ... " << v3.GetLwb() << endl;
-    cout << "  Upper bound ... " << v3.GetUpb() << endl;
-    cout << "  No. of elements " << v3.GetNoElements() << endl;
+    std::cout << "\nStatus information reported for vector v3:" << std::endl;
+    std::cout << "  Lower bound ... " << v3.GetLwb() << std::endl;
+    std::cout << "  Upper bound ... " << v3.GetUpb() << std::endl;
+    std::cout << "  No. of elements " << v3.GetNoElements() << std::endl;
   }
 
   if (gVerbose)
-    cout << "\nCheck vectors 1 & 2 for compatibility" << endl;
+    std::cout << "\nCheck vectors 1 & 2 for compatibility" << std::endl;
   ok &= AreCompatible(v1,v2,gVerbose);
 
   if (gVerbose)
-    cout << "Check vectors 1 & 4 for compatibility" << endl;
+    std::cout << "Check vectors 1 & 4 for compatibility" << std::endl;
   ok &= AreCompatible(v1,v4,gVerbose);
 
   if (gVerbose)
-    cout << "v2 has to be compatible with v3 after resizing to v3" << endl;
+    std::cout << "v2 has to be compatible with v3 after resizing to v3" << std::endl;
   v2.ResizeTo(v3);
   ok &= AreCompatible(v2,v3,gVerbose);
 
   TVectorD v5(v1.GetUpb()+5);
   if (gVerbose)
-    cout << "v1 has to be compatible with v5 after resizing to v5.upb" << endl;
+    std::cout << "v1 has to be compatible with v5 after resizing to v5.upb" << std::endl;
   v1.ResizeTo(v5.GetNoElements());
   ok &= AreCompatible(v1,v5,gVerbose);
 
   {
     if (gVerbose)
-      cout << "Check that shrinking does not change remaining elements" << endl;
+      std::cout << "Check that shrinking does not change remaining elements" << std::endl;
     TVectorD vb(-1,msize);
     for (i = vb.GetLwb(); i <= vb.GetUpb(); i++)
       vb(i) = i+TMath::Pi();
@@ -3227,7 +3227,7 @@ void vstress_allocation(Int_t msize)
     for (i = v.GetLwb(); i <= v.GetUpb(); i++)
       ok &= ( v(i) == vb(i) ) ? kTRUE : kFALSE;
     if (gVerbose)
-      cout << "Check that expansion expands by zeros" << endl;
+      std::cout << "Check that expansion expands by zeros" << std::endl;
     const Int_t old_nelems = v.GetNoElements();
     const Int_t old_lwb    = v.GetLwb();
     v.ResizeTo(vb);
@@ -3241,7 +3241,7 @@ void vstress_allocation(Int_t msize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(1,"Allocation, Filling, Resizing",ok);
 }
 
@@ -3265,7 +3265,7 @@ class CosAction : public TElementPosActionD {
 void vstress_element_op(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test operations that treat each element uniformly" << endl;
+    std::cout << "\n---> Test operations that treat each element uniformly" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = TMath::Pi();
@@ -3274,22 +3274,22 @@ void vstress_element_op(Int_t vsize)
   TVectorD v1(v);
 
   if (gVerbose)
-    cout << "\nWriting zeros to v..." << endl;
+    std::cout << "\nWriting zeros to v..." << std::endl;
   for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
     v(i) = 0;
   ok &= VerifyVectorValue(v,0.0,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Clearing v1 ..." << endl;
+    std::cout << "Clearing v1 ..." << std::endl;
   v1.Zero();
   ok &= VerifyVectorValue(v1,0.0,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing v1 with 0 ..." << endl;
+    std::cout << "Comparing v1 with 0 ..." << std::endl;
   ok &= (v1 == 0) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "Writing a pattern " << pattern << " by assigning to v(i)..." << endl;
+    std::cout << "Writing a pattern " << pattern << " by assigning to v(i)..." << std::endl;
   {
     for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
       v(i) = pattern;
@@ -3297,33 +3297,33 @@ void vstress_element_op(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "Writing the pattern by assigning to v1 as a whole ..." << endl;
+    std::cout << "Writing the pattern by assigning to v1 as a whole ..." << std::endl;
   v1 = pattern;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing v and v1 ..." << endl;
+    std::cout << "Comparing v and v1 ..." << std::endl;
   ok &= (v == v1) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "Comparing (v=0) and v1 ..." << endl;
+    std::cout << "Comparing (v=0) and v1 ..." << std::endl;
   ok &= (!(v.Zero() == v1)) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nClear v and add the pattern" << endl;
+    std::cout << "\nClear v and add the pattern" << std::endl;
   v.Zero();
   v += pattern;
   ok &= VerifyVectorValue(v,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   add the doubled pattern with the negative sign" << endl;
+    std::cout << "   add the doubled pattern with the negative sign" << std::endl;
   v += -2*pattern;
   ok &= VerifyVectorValue(v,-pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   subtract the trippled pattern with the negative sign" << endl;
+    std::cout << "   subtract the trippled pattern with the negative sign" << std::endl;
   v -= -3*pattern;
   ok &= VerifyVectorValue(v,2*pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify comparison operations" << endl;
+    std::cout << "\nVerify comparison operations" << std::endl;
   v = pattern;
   ok &= ( v == pattern && !(v != pattern) && v >= pattern && v <= pattern ) ? kTRUE : kFALSE;
   ok &= ( v > 0 && v >= 0 ) ? kTRUE : kFALSE;
@@ -3335,25 +3335,25 @@ void vstress_element_op(Int_t vsize)
   ok &= ( v <= pattern+1.001 && !(v < pattern+1) && !(v <= pattern) ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nAssign 2*pattern to v by repeating additions" << endl;
+    std::cout << "\nAssign 2*pattern to v by repeating additions" << std::endl;
   v = 0; v += pattern; v += pattern;
   if (gVerbose)
-    cout << "Assign 2*pattern to v1 by multiplying by two" << endl;
+    std::cout << "Assign 2*pattern to v1 by multiplying by two" << std::endl;
   v1 = pattern; v1 *= 2;
   ok &= VerifyVectorValue(v1,2*pattern,gVerbose,EPSILON);
   ok &= ( v == v1 ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "Multiply v1 by one half returning it to the 1*pattern" << endl;
+    std::cout << "Multiply v1 by one half returning it to the 1*pattern" << std::endl;
   v1 *= 1/2.;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nAssign -pattern to v and v1" << endl;
+    std::cout << "\nAssign -pattern to v and v1" << std::endl;
   v.Zero(); v -= pattern; v1 = -pattern;
   ok &= VerifyVectorValue(v,-pattern,gVerbose,EPSILON);
   ok &= ( v == v1 ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "v = sqrt(sqr(v)); v1 = abs(v1); Now v and v1 have to be the same" << endl;
+    std::cout << "v = sqrt(sqr(v)); v1 = abs(v1); Now v and v1 have to be the same" << std::endl;
   v.Sqr();
   ok &= VerifyVectorValue(v,pattern*pattern,gVerbose,EPSILON);
   v.Sqrt();
@@ -3364,7 +3364,7 @@ void vstress_element_op(Int_t vsize)
 
   {
     if (gVerbose)
-      cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << endl;
+      std::cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << std::endl;
     for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
       v(i) = 2*TMath::Pi()/v.GetNoElements()*i;
 #ifndef __CINT__
@@ -3387,7 +3387,7 @@ void vstress_element_op(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nVerify constructor with initialization" << endl;
+    std::cout << "\nVerify constructor with initialization" << std::endl;
 #ifndef __CINT__
   TVectorD vi(0,4,0.0,1.0,2.0,3.0,4.0,"END");
 #else
@@ -3402,7 +3402,7 @@ void vstress_element_op(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(2,"Uniform vector operations",ok);
 }
 
@@ -3413,7 +3413,7 @@ void vstress_element_op(Int_t vsize)
 void vstress_binary_op(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test Binary Vector operations" << endl;
+    std::cout << "\n---> Test Binary Vector operations" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = TMath::Pi();
@@ -3424,7 +3424,7 @@ void vstress_binary_op(Int_t vsize)
   TVectorD v1(v);
 
   if (gVerbose)
-    cout << "\nVerify assignment of a vector to the vector" << endl;
+    std::cout << "\nVerify assignment of a vector to the vector" << std::endl;
   v = pattern;
   v1.Zero();
   v1 = v;
@@ -3432,20 +3432,20 @@ void vstress_binary_op(Int_t vsize)
   ok &= ( v1 == v ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nAdding one vector to itself, uniform pattern " << pattern << endl;
+    std::cout << "\nAdding one vector to itself, uniform pattern " << pattern << std::endl;
   v.Zero(); v = pattern;
   v1 = v; v1 += v1;
   ok &= VerifyVectorValue(v1,2*pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting two vectors ..." << endl;
+    std::cout << "  subtracting two vectors ..." << std::endl;
   v1 -= v;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting the vector from itself" << endl;
+    std::cout << "  subtracting the vector from itself" << std::endl;
   v1 -= v1;
   ok &= VerifyVectorValue(v1,0.,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  adding two vectors together" << endl;
+    std::cout << "  adding two vectors together" << std::endl;
   v1 += v;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
 
@@ -3456,8 +3456,8 @@ void vstress_binary_op(Int_t vsize)
   }
 
   if (gVerbose) {
-    cout << "\nArithmetic operations on vectors with not the same elements" << endl;
-    cout << "   adding vp to the zero vector..." << endl;
+    std::cout << "\nArithmetic operations on vectors with not the same elements" << std::endl;
+    std::cout << "   adding vp to the zero vector..." << std::endl;
   }
   v.Zero();
   ok &= ( v == 0.0 ) ? kTRUE : kFALSE;
@@ -3465,26 +3465,26 @@ void vstress_binary_op(Int_t vsize)
   ok &= VerifyVectorIdentity(v,vp,gVerbose,epsilon);
   v1 = v;
   if (gVerbose)
-    cout << "   making v = 3*vp and v1 = 3*vp, via add() and succesive mult" << endl;
+    std::cout << "   making v = 3*vp and v1 = 3*vp, via add() and succesive mult" << std::endl;
   Add(v,2.,vp);
   v1 += v1; v1 += vp;
   ok &= VerifyVectorIdentity(v,v1,gVerbose,epsilon);
   if (gVerbose)
-    cout << "   clear both v and v1, by subtracting from itself and via add()" << endl;
+    std::cout << "   clear both v and v1, by subtracting from itself and via add()" << std::endl;
   v1 -= v1;
   Add(v,-3.,vp);
   ok &= VerifyVectorIdentity(v,v1,gVerbose,epsilon);
 
   if (gVerbose) {
-    cout << "\nTesting element-by-element multiplications and divisions" << endl;
-    cout << "   squaring each element with sqr() and via multiplication" << endl;
+    std::cout << "\nTesting element-by-element multiplications and divisions" << std::endl;
+    std::cout << "   squaring each element with sqr() and via multiplication" << std::endl;
   }
   v = vp; v1 = vp;
   v.Sqr();
   ElementMult(v1,v1);
   ok &= VerifyVectorIdentity(v,v1,gVerbose,epsilon);
   if (gVerbose)
-    cout << "   compare (v = pattern^2)/pattern with pattern" << endl;
+    std::cout << "   compare (v = pattern^2)/pattern with pattern" << std::endl;
   v = pattern; v1 = pattern;
   v.Sqr();
   ElementDiv(v,v1);
@@ -3493,7 +3493,7 @@ void vstress_binary_op(Int_t vsize)
    Compare(v1,v);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(3,"Binary vector element-by-element operations",ok);
 }
 
@@ -3504,7 +3504,7 @@ void vstress_binary_op(Int_t vsize)
 void vstress_norms(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Verify norm calculations" << endl;
+    std::cout << "\n---> Verify norm calculations" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 10.25;
@@ -3516,27 +3516,27 @@ void vstress_norms(Int_t vsize)
   TVectorD v1(v);
 
   if (gVerbose)
-    cout << "\nAssign " << pattern << " to all the elements and check norms" << endl;
+    std::cout << "\nAssign " << pattern << " to all the elements and check norms" << std::endl;
   v = pattern;
   if (gVerbose)
-    cout << "  1. norm should be pattern*no_elems" << endl;
+    std::cout << "  1. norm should be pattern*no_elems" << std::endl;
   ok &= ( v.Norm1() == pattern*v.GetNoElements() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Square of the 2. norm has got to be pattern^2 * no_elems" << endl;
+    std::cout << "  Square of the 2. norm has got to be pattern^2 * no_elems" << std::endl;
   ok &= ( v.Norm2Sqr() == (pattern*pattern)*v.GetNoElements() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Inf norm should be pattern itself" << endl;
+    std::cout << "  Inf norm should be pattern itself" << std::endl;
   ok &= ( v.NormInf() == pattern ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << endl;
+    std::cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << std::endl;
   ok &= ( v.Norm2Sqr() == v*v ) ? kTRUE : kFALSE;
 
   Double_t ap_step = 1;
   Double_t ap_a0   = -pattern;
   Int_t n = v.GetNoElements();
   if (gVerbose) {
-    cout << "\nAssign the arithm progression with 1. term " << ap_a0 <<
-            "\nand the difference " << ap_step << endl;
+    std::cout << "\nAssign the arithm progression with 1. term " << ap_a0 <<
+            "\nand the difference " << ap_step << std::endl;
   }
   {
     for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
@@ -3546,21 +3546,21 @@ void vstress_norms(Int_t vsize)
   Double_t norm = (2*ap_a0+(l+n-1)*ap_step)/2*(n-l) +
                   (-2*ap_a0-(l-1)*ap_step)/2*l;
   if (gVerbose)
-    cout << "  1. norm should be " << norm << endl;
+    std::cout << "  1. norm should be " << norm << std::endl;
   ok &= ( v.Norm1() == norm ) ? kTRUE : kFALSE;
   norm = n*( (ap_a0*ap_a0)+ap_a0*ap_step*(n-1)+(ap_step*ap_step)*(n-1)*(2*n-1)/6);
   if (gVerbose) {
-    cout << "  Square of the 2. norm has got to be "
-            "n*[ a0^2 + a0*q*(n-1) + q^2/6*(n-1)*(2n-1) ], or " << norm << endl;
+    std::cout << "  Square of the 2. norm has got to be "
+            "n*[ a0^2 + a0*q*(n-1) + q^2/6*(n-1)*(2n-1) ], or " << norm << std::endl;
   }
   ok &= ( TMath::Abs( (v.Norm2Sqr()-norm)/norm ) < EPSILON ) ? kTRUE : kFALSE;
 
   norm = TMath::Max(TMath::Abs(v(v.GetLwb())),TMath::Abs(v(v.GetUpb())));
   if (gVerbose)
-    cout << "  Inf norm should be max(abs(a0),abs(a0+(n-1)*q)), ie " << norm << endl;
+    std::cout << "  Inf norm should be max(abs(a0),abs(a0+(n-1)*q)), ie " << norm << std::endl;
   ok &= ( v.NormInf() == norm ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << endl;
+    std::cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << std::endl;
   ok &= ( v.Norm2Sqr() == v*v ) ? kTRUE : kFALSE;
 
 #if 0
@@ -3569,22 +3569,22 @@ void vstress_norms(Int_t vsize)
 #endif
 
   if (gVerbose)
-    cout << "\nConstruct v1 to be orthogonal to v as v(n), -v(n-1), v(n-2)..." << endl;
+    std::cout << "\nConstruct v1 to be orthogonal to v as v(n), -v(n-1), v(n-2)..." << std::endl;
   {
     for (Int_t i = 0; i < v1.GetNoElements(); i++)
       v1(i+v1.GetLwb()) = v(v.GetUpb()-i) * ( i % 2 == 1 ? -1 : 1 );
   }
   if (gVerbose)
-    cout << "||v1|| has got to be equal ||v|| regardless of the norm def" << endl;
+    std::cout << "||v1|| has got to be equal ||v|| regardless of the norm def" << std::endl;
   ok &= ( v1.Norm1()    == v.Norm1() ) ? kTRUE : kFALSE;
   ok &= ( v1.Norm2Sqr() == v.Norm2Sqr() ) ? kTRUE : kFALSE;
   ok &= ( v1.NormInf()  == v.NormInf() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "But the scalar product has to be zero" << endl;
+    std::cout << "But the scalar product has to be zero" << std::endl;
   ok &= ( v1 * v == 0 ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(4,"Vector Norms",ok);
 }
 
@@ -3595,7 +3595,7 @@ void vstress_norms(Int_t vsize)
 void vstress_matrix_slices(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test operations with vectors and matrix slices" << endl;
+    std::cout << "\n---> Test operations with vectors and matrix slices" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 8.625;
@@ -3606,7 +3606,7 @@ void vstress_matrix_slices(Int_t vsize)
 
   Int_t i,j;
   if (gVerbose)
-    cout << "\nCheck modifying the matrix column-by-column" << endl;
+    std::cout << "\nCheck modifying the matrix column-by-column" << std::endl;
   m = pattern;
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
   for (i = m.GetColLwb(); i <= m.GetColUpb(); i++) {
@@ -3642,7 +3642,7 @@ void vstress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nCheck modifying the matrix row-by-row" << endl;
+    std::cout << "\nCheck modifying the matrix row-by-row" << std::endl;
   m = pattern;
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
   for (i = m.GetRowLwb(); i <= m.GetRowUpb(); i++) {
@@ -3676,7 +3676,7 @@ void vstress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nCheck modifying the matrix diagonal" << endl;
+    std::cout << "\nCheck modifying the matrix diagonal" << std::endl;
   m = pattern;
   TMatrixDDiag td = m;
   td = pattern-3;
@@ -3702,8 +3702,8 @@ void vstress_matrix_slices(Int_t vsize)
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
 
   if (gVerbose) {
-    cout << "\nCheck out to see that multiplying by diagonal is column-wise"
-            "\nmatrix multiplication" << endl;
+    std::cout << "\nCheck out to see that multiplying by diagonal is column-wise"
+            "\nmatrix multiplication" << std::endl;
   }
   TMatrixD mm(m);
   TMatrixD m1(m.GetRowLwb(),TMath::Max(m.GetRowUpb(),m.GetColUpb()),
@@ -3729,7 +3729,7 @@ void vstress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(5,"Matrix Slices to Vectors",ok);
 }
 
@@ -3740,7 +3740,7 @@ void vstress_matrix_slices(Int_t vsize)
 void vstress_vector_io()
 {
   if (gVerbose)
-    cout << "\n---> Test vector I/O" << endl;
+    std::cout << "\n---> Test vector I/O" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = TMath::Pi();
@@ -3764,7 +3764,7 @@ void vstress_vector_io()
     va.Use(msize,pattern_array);
 
     if (verbose)
-      cout << "\nWrite vector v to database" << endl;
+      std::cout << "\nWrite vector v to database" << std::endl;
 
     snprintf(name,80,"v_%d",msize);
     v.Write(name);
@@ -3777,11 +3777,11 @@ void vstress_vector_io()
   }
 
   if (gVerbose)
-    cout << "\nClose database" << endl;
+    std::cout << "\nClose database" << std::endl;
   delete f;
 
   if (gVerbose)
-    cout << "\nOpen database in read-only mode and read vector" << endl;
+    std::cout << "\nOpen database in read-only mode and read vector" << std::endl;
   TFile *f1 = new TFile("vvector.root");
 
   iloop = gNrLoop;
@@ -3799,7 +3799,7 @@ void vstress_vector_io()
     TVectorD *var = (TVectorD*) f1->Get(name);
 
     if (verbose)
-      cout << "\nRead vector should be same as original still in memory" << endl;
+      std::cout << "\nRead vector should be same as original still in memory" << std::endl;
     ok &= ((*vr) == v)  ? kTRUE : kFALSE;
     ok &= ((*var) == v) ? kTRUE : kFALSE;
 
@@ -3809,30 +3809,30 @@ void vstress_vector_io()
   delete f1;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(6,"Vector Persistence",ok);
 }
 
 Bool_t test_svd_expansion(const TMatrixD &A)
 {
   if (gVerbose)
-    cout << "\n\nSVD-decompose matrix A and check if we can compose it back\n" <<endl;
+    std::cout << "\n\nSVD-decompose matrix A and check if we can compose it back\n" <<std::endl;
 
   Bool_t ok = kTRUE;
 
   TDecompSVD svd(A);
   if (gVerbose) {
-    cout << "left factor U" <<endl;
+    std::cout << "left factor U" <<std::endl;
     svd.GetU().Print();
-    cout << "Vector of Singular values" <<endl;
+    std::cout << "Vector of Singular values" <<std::endl;
     svd.GetSig().Print();
-    cout << "right factor V" <<endl;
+    std::cout << "right factor V" <<std::endl;
     svd.GetV().Print();
   }
 
   {
     if (gVerbose)
-      cout << "\tchecking that U is orthogonal indeed, i.e., U'U=E and UU'=E" <<endl;
+      std::cout << "\tchecking that U is orthogonal indeed, i.e., U'U=E and UU'=E" <<std::endl;
     const Int_t nRows = svd.GetU().GetNrows();
     const Int_t nCols = svd.GetU().GetNcols();
     TMatrixD E1(nRows,nRows); E1.UnitMatrix();
@@ -3844,7 +3844,7 @@ Bool_t test_svd_expansion(const TMatrixD &A)
 
   {
     if (gVerbose)
-      cout << "\tchecking that V is orthogonal indeed, i.e., V'V=E and VV'=E" <<endl;
+      std::cout << "\tchecking that V is orthogonal indeed, i.e., V'V=E and VV'=E" <<std::endl;
     const Int_t nRows = svd.GetV().GetNrows();
     const Int_t nCols = svd.GetV().GetNcols();
     TMatrixD E1(nRows,nRows); E1.UnitMatrix();
@@ -3856,7 +3856,7 @@ Bool_t test_svd_expansion(const TMatrixD &A)
 
   {
     if (gVerbose)
-      cout << "\tchecking that U*Sig*V' is indeed A" <<endl;
+      std::cout << "\tchecking that U*Sig*V' is indeed A" <<std::endl;
     const Int_t nRows = svd.GetU().GetNrows();
     const Int_t nCols = svd.GetV().GetNcols();
     TMatrixD s(nRows,nCols);
@@ -3865,7 +3865,7 @@ Bool_t test_svd_expansion(const TMatrixD &A)
     TMatrixD tmp = s * vt;
     ok &= VerifyMatrixIdentity(A,svd.GetU() * tmp,gVerbose,100*EPSILON);
     if (gVerbose) {
-      cout << "U*Sig*V'" <<endl;
+      std::cout << "U*Sig*V'" <<std::endl;
       (svd.GetU()*tmp).Print();
     }
   }
@@ -3910,7 +3910,7 @@ void astress_decomp()
 
   {
     if (gVerbose)
-      cout << "\nBrandt example page 503\n" <<endl;
+      std::cout << "\nBrandt example page 503\n" <<std::endl;
 
     Double_t array0[] = { -2,1,0,0, 2,1,0,0, 0,0,0,0, 0,0,0,0 };
     ok &= test_svd_expansion(MakeMatrix(4,4,array0,sizeof(array0)/sizeof(array0[0])));
@@ -3918,7 +3918,7 @@ void astress_decomp()
 
   {
     if (gVerbose)
-      cout << "\nRotated by PI/2 Matrix Diag(1,4,9)\n" <<endl;
+      std::cout << "\nRotated by PI/2 Matrix Diag(1,4,9)\n" <<std::endl;
 
     Double_t array1[] = {0,-4,0,  1,0,0,  0,0,9 };
     ok &= test_svd_expansion(MakeMatrix(3,3,array1,sizeof(array1)/sizeof(array1[0])));
@@ -3926,7 +3926,7 @@ void astress_decomp()
 
   {
     if (gVerbose)
-      cout << "\nExample from the Forsythe, Malcolm, Moler's book\n" <<endl;
+      std::cout << "\nExample from the Forsythe, Malcolm, Moler's book\n" <<std::endl;
 
     Double_t array2[] =
          { 1,6,11, 2,7,12, 3,8,13, 4,9,14, 5,10,15};
@@ -3935,8 +3935,8 @@ void astress_decomp()
 
   {
     if (gVerbose)
-      cout << "\nExample from the Wilkinson, Reinsch's book\n" <<
-              "Singular numbers are 0, 19.5959, 20, 0, 35.3270\n" <<endl;
+      std::cout << "\nExample from the Wilkinson, Reinsch's book\n" <<
+              "Singular numbers are 0, 19.5959, 20, 0, 35.3270\n" <<std::endl;
 
     Double_t array3[] =
         { 22, 10,  2,   3,  7,    14,  7, 10,  0,  8,
@@ -3948,8 +3948,8 @@ void astress_decomp()
 
   {
     if (gVerbose)
-      cout << "\nExample from the Wilkinson, Reinsch's book\n" <<
-              "Ordered singular numbers are Sig[21-k] = sqrt(k*(k-1))\n" <<endl;
+      std::cout << "\nExample from the Wilkinson, Reinsch's book\n" <<
+              "Ordered singular numbers are Sig[21-k] = sqrt(k*(k-1))\n" <<std::endl;
     TMatrixD A(21,20);
     for (Int_t irow = A.GetRowLwb(); irow <= A.GetRowUpb(); irow++)
       for (Int_t icol = A.GetColLwb(); icol <= A.GetColUpb(); icol++)
@@ -3961,10 +3961,10 @@ void astress_decomp()
   if (0)
   {
     if (gVerbose) {
-      cout << "\nTest by W. Meier <wmeier@manu.com> to catch an obscure "
-           << "bug in QR\n" <<endl;
-      cout << "expect singular values to be\n"
-           << "1.4666e-024   1.828427   3.828427   4.366725  7.932951\n" <<endl;
+      std::cout << "\nTest by W. Meier <wmeier@manu.com> to catch an obscure "
+           << "bug in QR\n" <<std::endl;
+      std::cout << "expect singular values to be\n"
+           << "1.4666e-024   1.828427   3.828427   4.366725  7.932951\n" <<std::endl;
     }
 
     Double_t array4[] =
@@ -3990,7 +3990,7 @@ void astress_decomp()
   }
 
   if (gVerbose)
-    cout << "\nDone" <<endl;
+    std::cout << "\nDone" <<std::endl;
 
   StatusPrint(1,"Decomposition / Reconstruction",ok);
 }
@@ -3998,7 +3998,7 @@ void astress_decomp()
 void astress_lineqn()
 {
   if (gVerbose)
-    cout << "\nSolve Ax=b where A is a Hilbert matrix and b(i) = sum_j Aij\n" <<endl;
+    std::cout << "\nSolve Ax=b where A is a Hilbert matrix and b(i) = sum_j Aij\n" <<std::endl;
 
   Bool_t ok = kTRUE;
 
@@ -4011,7 +4011,7 @@ void astress_lineqn()
     const Int_t verbose = (gVerbose && nr==0 && iloop==gNrLoop);
 
     if (verbose)
-      cout << "\nSolve Ax=b for size = " << msize <<endl;
+      std::cout << "\nSolve Ax=b for size = " << msize <<std::endl;
 
     // Since The Hilbert matrix is accuracy "challenged", I will use a diagonaly
     // dominant one fore sizes > 100, otherwise the verification might fail
@@ -4120,13 +4120,13 @@ void astress_lineqn()
 
     if (!ok) {
       if (gVerbose)
-        cout << "Linear Equations failed for size " << msize << endl;
+        std::cout << "Linear Equations failed for size " << msize << std::endl;
       break;
     }
   }
 
   if (gVerbose)
-    cout << "\nDone" <<endl;
+    std::cout << "\nDone" <<std::endl;
 
   StatusPrint(2,"Linear Equations",ok);
 }
@@ -4163,7 +4163,7 @@ void astress_pseudo()
 
   TDecompSVD svd(A);
   if (gVerbose)
-    cout << "\ncondition number " << svd.Condition() << endl;
+    std::cout << "\ncondition number " << svd.Condition() << std::endl;
 
   // Compute the inverse as a solution of A*Ainv = E
   TMatrixD Ainv(nrows,nrows); Ainv.UnitMatrix();
@@ -4175,21 +4175,21 @@ void astress_pseudo()
   ok &= VerifyMatrixIdentity(Ainv,Ainv2,gVerbose,EPSILON);
 
   if (gVerbose) {
-    cout << "\nChecking the Moore-Penrose conditions for the Ainv" << endl;
-    cout << "\nVerify that Ainv * A * Ainv is Ainv" << endl;
+    std::cout << "\nChecking the Moore-Penrose conditions for the Ainv" << std::endl;
+    std::cout << "\nVerify that Ainv * A * Ainv is Ainv" << std::endl;
   }
   ok &= VerifyMatrixIdentity(Ainv * A * Ainv, Ainv,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify that A * Ainv * A is A" << endl;
+    std::cout << "\nVerify that A * Ainv * A is A" << std::endl;
   ok &= VerifyMatrixIdentity(A * Ainv * A, A,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify that Ainv * A is symmetric" << endl;
+    std::cout << "\nVerify that Ainv * A is symmetric" << std::endl;
   ok &= VerifyMatrixIdentity(Ainv * A, (Ainv*A).T(),gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify that A * Ainv is symmetric" << endl;
+    std::cout << "\nVerify that A * Ainv is symmetric" << std::endl;
   ok &= VerifyMatrixIdentity(A * Ainv, (A*Ainv).T(),gVerbose,EPSILON);
 
   StatusPrint(3,"Pseudo-Inverse, Moore-Penrose",ok);
@@ -4253,7 +4253,7 @@ void astress_decomp_io(Int_t msize)
 //           Test decomposition I/O
 //
   if (gVerbose)
-    cout << "\n---> Test decomp I/O" << endl;
+    std::cout << "\n---> Test decomp I/O" << std::endl;
 
   Bool_t ok = kTRUE;
 
@@ -4269,7 +4269,7 @@ void astress_decomp_io(Int_t msize)
   }
 
   if (gVerbose)
-    cout << "\nWrite decomp m to database" << endl;
+    std::cout << "\nWrite decomp m to database" << std::endl;
 
   TFile *f = new TFile("vdecomp.root", "RECREATE");
 
@@ -4286,15 +4286,15 @@ void astress_decomp_io(Int_t msize)
   bk.Write("bk");
 
   if (gVerbose)
-    cout << "\nClose database" << endl;
+    std::cout << "\nClose database" << std::endl;
   delete f;
 
   if (gVerbose)
-    cout << "\nOpen database in read-only mode and read matrix" << endl;
+    std::cout << "\nOpen database in read-only mode and read matrix" << std::endl;
   TFile *f1 = new TFile("vdecomp.root");
 
   if (gVerbose)
-    cout << "\nRead decompositions should create same solutions" << endl;
+    std::cout << "\nRead decompositions should create same solutions" << std::endl;
   {
     TDecompLU *rlu = (TDecompLU*)  f1->Get("lu");
     TVectorD b1(rowsum);
@@ -4368,7 +4368,7 @@ void astress_decomp_io(Int_t msize)
   delete f1;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(5,"Decomposition Persistence",ok);
 }
diff --git a/test/stressSpectrum.cxx b/test/stressSpectrum.cxx
index a84b89612c2..de39284bf41 100644
--- a/test/stressSpectrum.cxx
+++ b/test/stressSpectrum.cxx
@@ -253,9 +253,9 @@ void stressSpectrum(Int_t ntimes) {
 #else
 void stressSpectrum(Int_t ntimes=100) {
 #endif
-   cout << "****************************************************************************" <<endl;
-   cout << "*  Starting  stress S P E C T R U M                                        *" <<endl;
-   cout << "****************************************************************************" <<endl;
+   std::cout << "****************************************************************************" <<std::endl;
+   std::cout << "*  Starting  stress S P E C T R U M                                        *" <<std::endl;
+   std::cout << "****************************************************************************" <<std::endl;
    gBenchmark->Start("stressSpectrum");
    stress1(ntimes);
    stress2(300);
diff --git a/test/tcollbm.cxx b/test/tcollbm.cxx
index ae6f2ce4ccb..4a41945f9f9 100644
--- a/test/tcollbm.cxx
+++ b/test/tcollbm.cxx
@@ -57,7 +57,7 @@ public:
 };
 
 void HitNames::InitNames() {        // Create and fill names
-  //  cout << "HitNames::InitNames() are called" << endl;
+  //  std::cout << "HitNames::InitNames() are called" << std::endl;
   fNames = new char* [fSize];
   for (int i=0;i<fSize;i++) {
     fNames[i] = new char [20];
@@ -66,7 +66,7 @@ void HitNames::InitNames() {        // Create and fill names
 }
 void HitNames::DeleteNames() {      // Clean up
   if(!fNames) return;
-  //  cout << "HitNames::DeleteNames() are called" << endl;
+  //  std::cout << "HitNames::DeleteNames() are called" << std::endl;
   for (int i=0;i<fSize;i++) {
     delete fNames[i];
   }
@@ -163,8 +163,8 @@ Double_t Tester::TestByIndex() {      // benchmark access by index
     }
     timer.Stop();
   } else {
-    cout << "Class " << GetName()
-	 << " doesn't support access by index" << endl;
+    std::cout << "Class " << GetName()
+	 << " doesn't support access by index" << std::endl;
   }
   CleanUp();
   return timer.CpuTime();
diff --git a/test/tstring.cxx b/test/tstring.cxx
index 61b26e7af12..334032ceb43 100644
--- a/test/tstring.cxx
+++ b/test/tstring.cxx
@@ -12,11 +12,11 @@
 
 void Ok(int i, int b)
 {
-   cout << "Test " << i;
+   std::cout << "Test " << i;
    if (b)
-      cout << "   ok" << endl;
+      std::cout << "   ok" << std::endl;
    else
-      cout << "   NOT ok" << endl;
+      std::cout << "   NOT ok" << std::endl;
 }
 
 
@@ -25,12 +25,12 @@ int main()
 {
    // create base string
    TString s = "aap noot mies";
-   cout << s << endl;
+   std::cout << s << std::endl;
 
    // use different constructors and excercise +, += and == operators
    TString s1 = TString("aa") + "p ";
    s1 += TString("noot ") + "mi" + "es";
-   cout << s1 << endl;
+   std::cout << s1 << std::endl;
    Ok(1, s1==s);
 
    // use single char constructor and excercise again += and == operators
@@ -38,13 +38,13 @@ int main()
    s2 += "ap ";
    s2 += "noot ";
    s2 += "mies";
-   cout << s2 << endl;
+   std::cout << s2 << std::endl;
    Ok(2, s2==s);
 
    // get and set a subrange (via TSubString)
    TString s3 = s(4,9);
    s3(0,4) = "mama papa";
-   cout << s3 << endl;
+   std::cout << s3 << std::endl;
    Ok(3, s3=="mama papa mies");
 
    // create a regular expression, make search in string and replace
@@ -52,23 +52,23 @@ int main()
    TRegexp re(" n.*t ");
    TString s4 = s;
    s4(re) = " pipo ";
-   cout << s4 << endl;
+   std::cout << s4 << std::endl;
    Ok(4, s4=="aap pipo mies");
 
    // use "const char*" operator and the Data() member function to access
    // the string as a const char*
    const char *a = (const char*)s;
-   cout << a << endl;
+   std::cout << a << std::endl;
    Ok(5, !strcmp(a, s.Data()));
 
    // return 13th character and replace it by 't', getting 14th character
    // should result in an error message since operator[] uses range checking
    TString s6 = s;
    s6[12] = 't';
-   cout << s6 << endl;
-   cout << "*** Error message ok, accessing intentionaly out-of-bounds" << endl;
+   std::cout << s6 << std::endl;
+   std::cout << "*** Error message ok, accessing intentionaly out-of-bounds" << std::endl;
    char b = s6[13];
-   cout << b << endl;
+   std::cout << b << std::endl;
    Ok(6, s6=="aap noot miet");
 
    // return 13th character and replace it by 'p', getting 14th character
@@ -76,25 +76,25 @@ int main()
    // range checking
    TString s7 = s;
    s7(12) = 'p';
-   cout << s7 << endl;
+   std::cout << s7 << std::endl;
    char c = s7(13);
-   cout << c << endl;
+   std::cout << c << std::endl;
    Ok(7, s7=="aap noot miep");
 
    // use Append, Remove, Prepend, Replace and Insert
    TString s8 = s;
    s8.Append(" tante ");
    s8.Append(s7(9,4));
-   cout << s8 << endl;
+   std::cout << s8 << std::endl;
 
    s8.Remove(0,14);
-   cout << s8 << endl;
+   std::cout << s8 << std::endl;
    s8.Prepend("oom jan");
-   cout << s8 << endl;
+   std::cout << s8 << std::endl;
    s8.Insert(7," en ");
-   cout << s8 << endl;
+   std::cout << s8 << std::endl;
    s8.Replace(4,3,"jaap");
-   cout << s8 << endl;
+   std::cout << s8 << std::endl;
    Ok(8, s8=="oom jaap en tante miep");
 
    // use CompareTo to compare char * and TString
@@ -148,12 +148,12 @@ int main()
 
    // test Resize and Strip
    s9.Prepend("   ");
-   cout << s9 << endl;
+   std::cout << s9 << std::endl;
 
    s9.Resize(50);
-   cout << s9 << "<<ends here" << endl;
+   std::cout << s9 << "<<ends here" << std::endl;
 
-   cout << s9.Strip(TString::kBoth) << "<<ends here" << endl;
+   std::cout << s9.Strip(TString::kBoth) << "<<ends here" << std::endl;
 
    Printf("Using Print: %s (%d)\n", (const char*) s9, s9.Length());
    
@@ -171,16 +171,16 @@ int main()
    Ok(32, (s23 < s24) != (s24 < s23));
 
    // test file access
-   ifstream f("tstring.cxx");
-   f.seekg(0, ios::end);
+   std::ifstream f("tstring.cxx");
+   f.seekg(0, std::ios::end);
    Ssiz_t size = f.tellg();
-   f.seekg(0, ios::beg);
+   f.seekg(0, std::ios::beg);
    
    TString fs;
    fs.ReadFile(f);
    Ok(33, size == fs.Length());
 
-   ifstream f2("tstring.cxx");
+   std::ifstream f2("tstring.cxx");
    fs.ReadLine(f2);  // read '// @(#)root/test:$Id: tstring.cxx 38977..."
    Ok(34, fs.Contains("root/test"));
 
diff --git a/test/vlazy.cxx b/test/vlazy.cxx
index 4c930efbbef..8623d696945 100644
--- a/test/vlazy.cxx
+++ b/test/vlazy.cxx
@@ -71,13 +71,13 @@ static TMatrix traditional_downsampling(const TMatrix &orig_matrix)
 
 int main()
 {
-   cout << "\nDownsample matrices using traditional and non-traditional methods"
-        << endl;
+   std::cout << "\nDownsample matrices using traditional and non-traditional methods"
+        << std::endl;
 
    TStopwatch sw;
 
    {
-      cout << "\nMake sure that both methods give the same results" << endl;
+      std::cout << "\nMake sure that both methods give the same results" << std::endl;
       TMatrix orig_m = THaarMatrixF(9,201);   // which is a pretty big matrix
       TMatrix small1 = traditional_downsampling(orig_m);
       TMatrix small2 = downsample_matrix(orig_m);
@@ -85,7 +85,7 @@ int main()
    }
 
    {
-      cout << "\nClock the traditional downsampling" << endl;
+      std::cout << "\nClock the traditional downsampling" << std::endl;
       sw.Start();
       for (int order = 1; order <= 10; order++) {
          TMatrix orig_m = THaarMatrixF(order);   // may be pretty big, btw
@@ -94,12 +94,12 @@ int main()
             small(0,0) = 1;                     // just to use the matrix
          }
       }
-      cout << "\tIt took " << sw.RealTime()
-           << " sec to complete the test" << endl;
+      std::cout << "\tIt took " << sw.RealTime()
+           << " sec to complete the test" << std::endl;
    }
 
    {
-      cout << "\nClock the 'new style' downsampling (with lazy matrices)"<< endl;
+      std::cout << "\nClock the 'new style' downsampling (with lazy matrices)"<< std::endl;
       sw.Start();
       for (int order = 1; order <= 10; order++) {
          TMatrix orig_m = THaarMatrixF(order);     // may be pretty big, btw
@@ -108,8 +108,8 @@ int main()
             small(0,0) = 1;                       // just to use the matrix
          }
       }
-      cout << "\tIt took " << sw.RealTime()
-           << " sec to complete the test" << endl;
+      std::cout << "\tIt took " << sw.RealTime()
+           << " sec to complete the test" << std::endl;
    }
    return 0;
 }
diff --git a/test/vmatrix.cxx b/test/vmatrix.cxx
index 5f1f7ea2724..d6ccfb07015 100644
--- a/test/vmatrix.cxx
+++ b/test/vmatrix.cxx
@@ -93,9 +93,9 @@ Int_t gVerbose = 0;
 
 void stress_matrix(Int_t verbose=0)
 {
-  cout << "******************************************************************" <<endl;
-  cout << "*  Starting  Matrix - S T R E S S suite                          *" <<endl;
-  cout << "******************************************************************" <<endl;
+  std::cout << "******************************************************************" <<std::endl;
+  std::cout << "*  Starting  Matrix - S T R E S S suite                          *" <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
 
   gVerbose = verbose;
   stress_allocation();
@@ -115,7 +115,7 @@ void stress_matrix(Int_t verbose=0)
   stress_inversion(20);
 
   stress_matrix_io();
-  cout << "******************************************************************" <<endl;
+  std::cout << "******************************************************************" <<std::endl;
 }
 
 //------------------------------------------------------------------------
@@ -126,7 +126,7 @@ void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
 //   TString header = TString("Test ")+Form("%2d",id)+" : "+title;
 //   const Int_t nch = header.Length();
 //   for (Int_t i = nch; i < kMAX; i++) header += '.';
-//   cout << header << (status ? "OK" : "FAILED") << endl;
+//   std::cout << header << (status ? "OK" : "FAILED") << std::endl;
   // Print test program number and its title
    const Int_t kMAX = 65;
    char header[80];
@@ -135,7 +135,7 @@ void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
    for (Int_t i=nch;i<kMAX;i++) header[i] = '.';
    header[kMAX] = 0;
    header[kMAX-1] = ' ';
-   cout << header << (status ? "OK" : "FAILED") << endl;
+   std::cout << header << (status ? "OK" : "FAILED") << std::endl;
 }
 
 //------------------------------------------------------------------------
@@ -144,7 +144,7 @@ void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
 void stress_allocation()
 {
   if (gVerbose)
-    cout << "\n\n---> Test allocation and compatibility check" << endl;
+    std::cout << "\n\n---> Test allocation and compatibility check" << std::endl;
 
   Bool_t ok = kTRUE;
 
@@ -159,26 +159,26 @@ void stress_allocation()
   TMatrixD m4(m1);
 
   if (gVerbose) {
-    cout << "\nStatus information reported for matrix m3:" << endl;
-    cout << "  Row lower bound ... " << m3.GetRowLwb() << endl;
-    cout << "  Row upper bound ... " << m3.GetRowUpb() << endl;
-    cout << "  Col lower bound ... " << m3.GetColLwb() << endl;
-    cout << "  Col upper bound ... " << m3.GetColUpb() << endl;
-    cout << "  No. rows ..........." << m3.GetNrows()  << endl;
-    cout << "  No. cols ..........." << m3.GetNcols()  << endl;
-    cout << "  No. of elements ...." << m3.GetNoElements() << endl;
+    std::cout << "\nStatus information reported for matrix m3:" << std::endl;
+    std::cout << "  Row lower bound ... " << m3.GetRowLwb() << std::endl;
+    std::cout << "  Row upper bound ... " << m3.GetRowUpb() << std::endl;
+    std::cout << "  Col lower bound ... " << m3.GetColLwb() << std::endl;
+    std::cout << "  Col upper bound ... " << m3.GetColUpb() << std::endl;
+    std::cout << "  No. rows ..........." << m3.GetNrows()  << std::endl;
+    std::cout << "  No. cols ..........." << m3.GetNcols()  << std::endl;
+    std::cout << "  No. of elements ...." << m3.GetNoElements() << std::endl;
   }
 
   if (gVerbose)
-    cout << "\nCheck matrices 1 & 2 for compatibility" << endl;
+    std::cout << "\nCheck matrices 1 & 2 for compatibility" << std::endl;
   ok &= AreCompatible(m1,m2,gVerbose);
 
   if (gVerbose)
-    cout << "Check matrices 1 & 4 for compatibility" << endl;
+    std::cout << "Check matrices 1 & 4 for compatibility" << std::endl;
   ok &= AreCompatible(m1,m4,gVerbose);
 
   if (gVerbose)
-    cout << "m2 has to be compatible with m3 after resizing to m3" << endl;
+    std::cout << "m2 has to be compatible with m3 after resizing to m3" << std::endl;
   m2.ResizeTo(m3);
   ok &= AreCompatible(m2,m3,gVerbose);
 
@@ -188,23 +188,23 @@ void stress_allocation()
       m5(i,j) = TMath::Pi()*i+TMath::E()*j;
 
   if (gVerbose)
-    cout << "m1 has to be compatible with m5 after resizing to m5" << endl;
+    std::cout << "m1 has to be compatible with m5 after resizing to m5" << std::endl;
   m1.ResizeTo(m5.GetNrows(),m5.GetNcols());
   ok &= AreCompatible(m1,m5,gVerbose);
 
   if (gVerbose)
-    cout << "m1 has to be equal to m4 after stretching and shrinking" << endl;
+    std::cout << "m1 has to be equal to m4 after stretching and shrinking" << std::endl;
   m1.ResizeTo(m4.GetNrows(),m4.GetNcols());
   ok &= VerifyMatrixIdentity(m1,m4,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "m5 has to be equal to m1 after shrinking" << endl;
+    std::cout << "m5 has to be equal to m1 after shrinking" << std::endl;
   m5.ResizeTo(m1.GetNrows(),m1.GetNcols());
   ok &= VerifyMatrixIdentity(m1,m5,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "stretching and shrinking for small matrices (stack)" << endl;
+    std::cout << "stretching and shrinking for small matrices (stack)" << std::endl;
   if (gVerbose)
-    cout << "m8 has to be equal to m7 after stretching and shrinking" << endl;
+    std::cout << "m8 has to be equal to m7 after stretching and shrinking" << std::endl;
   TMatrixD m6(4,4);
   for (i = m6.GetRowLwb(); i <= m6.GetRowUpb(); i++)
     for (j = m6.GetColLwb(); j <= m6.GetColUpb(); j++)
@@ -220,12 +220,12 @@ void stress_allocation()
   ok &= VerifyMatrixIdentity(m7,m8,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "m6 has to be equal to m8 after shrinking" << endl;
+    std::cout << "m6 has to be equal to m8 after shrinking" << std::endl;
   m6.ResizeTo(3,3);
   ok &= VerifyMatrixIdentity(m6,m8,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(1,"Allocation, Resizing",ok);
 }
@@ -247,11 +247,11 @@ public:
 void stress_matrix_fill(Int_t rsize,Int_t csize)
 {
   if (gVerbose)
-    cout << "\n\n---> Test different matrix filling methods\n" << endl;
+    std::cout << "\n\n---> Test different matrix filling methods\n" << std::endl;
 
   Bool_t ok = kTRUE;
   if (gVerbose)
-    cout << "Creating m  with Apply function..." << endl;
+    std::cout << "Creating m  with Apply function..." << std::endl;
   TMatrixD m(-1,rsize-2,1,csize);
 #ifndef __CINT__
   FillMatrix f(m);
@@ -264,7 +264,7 @@ void stress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check identity between m and matrix filled through (i,j)" << endl;
+      std::cout << "Check identity between m and matrix filled through (i,j)" << std::endl;
 
     TMatrixD m_overload1(-1,rsize-2,1,csize);
     TMatrixD m_overload2(-1,rsize-2,1,csize);
@@ -281,10 +281,10 @@ void stress_matrix_fill(Int_t rsize,Int_t csize)
 
     ok &= VerifyMatrixIdentity(m,m_overload1,gVerbose,EPSILON);
     if (gVerbose)
-      cout << "Check identity between m and matrix filled through [i][j]" << endl;
+      std::cout << "Check identity between m and matrix filled through [i][j]" << std::endl;
     ok &= VerifyMatrixIdentity(m,m_overload2,gVerbose,EPSILON);
     if (gVerbose)
-      cout << "Check identity between matrix filled through [i][j] and (i,j)" << endl;
+      std::cout << "Check identity between matrix filled through [i][j] and (i,j)" << std::endl;
     ok &= VerifyMatrixIdentity(m_overload1,m_overload2,gVerbose,EPSILON);
   }
 
@@ -301,23 +301,23 @@ void stress_matrix_fill(Int_t rsize,Int_t csize)
     }
 
     if (gVerbose)
-      cout << "Creating m_fortran by filling with fortran stored matrix" << endl;
+      std::cout << "Creating m_fortran by filling with fortran stored matrix" << std::endl;
     TMatrixD m_fortran(-1,rsize-2,1,csize,a_fortran.GetArray(),"F");
     if (gVerbose)
-      cout << "Check identity between m and m_fortran" << endl;
+      std::cout << "Check identity between m and m_fortran" << std::endl;
     ok &= VerifyMatrixIdentity(m,m_fortran,gVerbose,EPSILON);
 
     if (gVerbose)
-      cout << "Creating m_c by filling with c stored matrix" << endl;
+      std::cout << "Creating m_c by filling with c stored matrix" << std::endl;
     TMatrixD m_c(-1,rsize-2,1,csize,a_c.GetArray());
     if (gVerbose)
-      cout << "Check identity between m and m_c" << endl;
+      std::cout << "Check identity between m and m_c" << std::endl;
     ok &= VerifyMatrixIdentity(m,m_c,gVerbose,EPSILON);
   }
 
   {
     if (gVerbose)
-      cout << "Check insertion/extraction of sub-matrices" << endl;
+      std::cout << "Check insertion/extraction of sub-matrices" << std::endl;
     {
       TMatrixD m_sub1 = m;
       m_sub1.ResizeTo(0,rsize-2,2,csize);
@@ -354,7 +354,7 @@ void stress_matrix_fill(Int_t rsize,Int_t csize)
 
   {
     if (gVerbose)
-      cout << "Check array Use" << endl;
+      std::cout << "Check array Use" << std::endl;
     {
       TMatrixD *m1 = new TMatrixD(m);
       TMatrixD *m2 = new TMatrixD();
@@ -369,7 +369,7 @@ void stress_matrix_fill(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(2,"Filling, Inserting, Using",ok);
 }
@@ -394,7 +394,7 @@ void stress_element_op(Int_t rsize,Int_t csize)
   TMatrixD m(-1,rsize-2,1,csize);
 
   if (gVerbose)
-    cout << "\nWriting zeros to m..." << endl;
+    std::cout << "\nWriting zeros to m..." << std::endl;
   {
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for(Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
@@ -403,17 +403,17 @@ void stress_element_op(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "Creating zero m1 ..." << endl;
+    std::cout << "Creating zero m1 ..." << std::endl;
   TMatrixD m1(TMatrixD::kZero, m);
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing m1 with 0 ..." << endl;
+    std::cout << "Comparing m1 with 0 ..." << std::endl;
   R__ASSERT(m1 == 0);
   R__ASSERT(!(m1 != 0));
 
   if (gVerbose)
-    cout << "Writing a pattern " << pattern << " by assigning to m(i,j)..." << endl;
+    std::cout << "Writing a pattern " << pattern << " by assigning to m(i,j)..." << std::endl;
   {
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
@@ -422,38 +422,38 @@ void stress_element_op(Int_t rsize,Int_t csize)
   }
 
   if (gVerbose)
-    cout << "Writing the pattern by assigning to m1 as a whole ..."  << endl;
+    std::cout << "Writing the pattern by assigning to m1 as a whole ..."  << std::endl;
   m1 = pattern;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing m and m1 ..." << endl;
+    std::cout << "Comparing m and m1 ..." << std::endl;
   R__ASSERT(m == m1);
   if (gVerbose)
-    cout << "Comparing (m=0) and m1 ..." << endl;
+    std::cout << "Comparing (m=0) and m1 ..." << std::endl;
   R__ASSERT(!(m.Zero() == m1));
 
   if (gVerbose)
-    cout << "Clearing m1 ..." << endl;
+    std::cout << "Clearing m1 ..." << std::endl;
   m1.Zero();
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nClear m and add the pattern" << endl;
+    std::cout << "\nClear m and add the pattern" << std::endl;
   m.Zero();
   m += pattern;
   ok &= VerifyMatrixValue(m,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   add the doubled pattern with the negative sign" << endl;
+    std::cout << "   add the doubled pattern with the negative sign" << std::endl;
   m += -2*pattern;
   ok &= VerifyMatrixValue(m,-pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   subtract the trippled pattern with the negative sign" << endl;
+    std::cout << "   subtract the trippled pattern with the negative sign" << std::endl;
   m -= -3*pattern;
   ok &= VerifyMatrixValue(m,2*pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify comparison operations when all elems are the same" << endl;
+    std::cout << "\nVerify comparison operations when all elems are the same" << std::endl;
   m = pattern;
   R__ASSERT( m == pattern && !(m != pattern) );
   R__ASSERT( m > 0 && m >= pattern && m <= pattern );
@@ -464,7 +464,7 @@ void stress_element_op(Int_t rsize,Int_t csize)
   R__ASSERT( m  >= -pattern && !(m > -pattern) );
 
   if (gVerbose)
-    cout << "\nVerify comparison operations when not all elems are the same" << endl;
+    std::cout << "\nVerify comparison operations when not all elems are the same" << std::endl;
   m = pattern; m(m.GetRowUpb(),m.GetColUpb()) = pattern-1;
   R__ASSERT( !(m == pattern) && !(m != pattern) );
   R__ASSERT( m != 0 );                   // none of elements are 0
@@ -472,25 +472,25 @@ void stress_element_op(Int_t rsize,Int_t csize)
   R__ASSERT( !(m <= pattern-1) && m >= pattern-1 && !(m>pattern-1) );
 
   if (gVerbose)
-    cout << "\nAssign 2*pattern to m by repeating additions" << endl;
+    std::cout << "\nAssign 2*pattern to m by repeating additions" << std::endl;
   m = 0; m += pattern; m += pattern;
   if (gVerbose)
-    cout << "Assign 2*pattern to m1 by multiplying by two " << endl;
+    std::cout << "Assign 2*pattern to m1 by multiplying by two " << std::endl;
   m1 = pattern; m1 *= 2;
   ok &= VerifyMatrixValue(m1,2*pattern,gVerbose,EPSILON);
   R__ASSERT( m == m1 );
   if (gVerbose)
-    cout << "Multiply m1 by one half returning it to the 1*pattern" << endl;
+    std::cout << "Multiply m1 by one half returning it to the 1*pattern" << std::endl;
   m1 *= 1/2.;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nAssign -pattern to m and m1" << endl;
+    std::cout << "\nAssign -pattern to m and m1" << std::endl;
   m.Zero(); m -= pattern; m1 = -pattern;
   ok &= VerifyMatrixValue(m,-pattern,gVerbose,EPSILON);
   R__ASSERT( m == m1 );
   if (gVerbose)
-    cout << "m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same" << endl;
+    std::cout << "m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same" << std::endl;
   m.Sqr();
   ok &= VerifyMatrixValue(m,pattern*pattern,gVerbose,EPSILON);
   m.Sqrt();
@@ -500,7 +500,7 @@ void stress_element_op(Int_t rsize,Int_t csize)
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << endl;
+    std::cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << std::endl;
   {
 #ifndef __CINT__
     FillMatrix f(m);
@@ -533,7 +533,7 @@ void stress_element_op(Int_t rsize,Int_t csize)
   ok &= VerifyMatrixValue(m,1.,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(3,"Uniform matrix operations",ok);
 }
@@ -545,7 +545,7 @@ void stress_element_op(Int_t rsize,Int_t csize)
 void stress_binary_ebe_op(Int_t rsize, Int_t csize)
 {
   if (gVerbose)
-    cout << "\n---> Test Binary Matrix element-by-element operations" << endl;
+    std::cout << "\n---> Test Binary Matrix element-by-element operations" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = 4.25;
@@ -561,7 +561,7 @@ void stress_binary_ebe_op(Int_t rsize, Int_t csize)
   }
 
   if (gVerbose)
-    cout << "\nVerify assignment of a matrix to the matrix" << endl;
+    std::cout << "\nVerify assignment of a matrix to the matrix" << std::endl;
   m = pattern;
   m1.Zero();
   m1 = m;
@@ -569,51 +569,51 @@ void stress_binary_ebe_op(Int_t rsize, Int_t csize)
   R__ASSERT( m1 == m );
 
   if (gVerbose)
-    cout << "\nAdding the matrix to itself, uniform pattern " << pattern << endl;
+    std::cout << "\nAdding the matrix to itself, uniform pattern " << pattern << std::endl;
   m.Zero(); m = pattern;
   m1 = m; m1 += m1;
   ok &= VerifyMatrixValue(m1,2*pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting two matrices ..." << endl;
+    std::cout << "  subtracting two matrices ..." << std::endl;
   m1 -= m;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting the matrix from itself" << endl;
+    std::cout << "  subtracting the matrix from itself" << std::endl;
   m1 -= m1;
   ok &= VerifyMatrixValue(m1,0.,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  adding two matrices together" << endl;
+    std::cout << "  adding two matrices together" << std::endl;
   m1 += m;
   ok &= VerifyMatrixValue(m1,pattern,gVerbose,EPSILON);
 
   if (gVerbose) {
-    cout << "\nArithmetic operations on matrices with not the same elements" << endl;
-    cout << "   adding mp to the zero matrix..." << endl;
+    std::cout << "\nArithmetic operations on matrices with not the same elements" << std::endl;
+    std::cout << "   adding mp to the zero matrix..." << std::endl;
   }
   m.Zero(); m += mp;
   ok &= VerifyMatrixIdentity(m,mp,gVerbose,EPSILON);
   m1 = m;
   if (gVerbose)
-    cout << "   making m = 3*mp and m1 = 3*mp, via add() and succesive mult" << endl;
+    std::cout << "   making m = 3*mp and m1 = 3*mp, via add() and succesive mult" << std::endl;
   Add(m,2.,mp);
   m1 += m1; m1 += mp;
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   clear both m and m1, by subtracting from itself and via add()" << endl;
+    std::cout << "   clear both m and m1, by subtracting from itself and via add()" << std::endl;
   m1 -= m1;
   Add(m,-3.,mp);
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
 
   if (gVerbose) {
-    cout << "\nTesting element-by-element multiplications and divisions" << endl;
-    cout << "   squaring each element with sqr() and via multiplication" << endl;
+    std::cout << "\nTesting element-by-element multiplications and divisions" << std::endl;
+    std::cout << "   squaring each element with sqr() and via multiplication" << std::endl;
   }
   m = mp; m1 = mp;
   m.Sqr();
   ElementMult(m1,m1);
   ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   compare (m = pattern^2)/pattern with pattern" << endl;
+    std::cout << "   compare (m = pattern^2)/pattern with pattern" << std::endl;
   m = pattern; m1 = pattern;
   m.Sqr();
   ElementDiv(m,m1);
@@ -622,7 +622,7 @@ void stress_binary_ebe_op(Int_t rsize, Int_t csize)
     Compare(m1,m);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(4,"Binary Matrix element-by-element operations",ok);
 }
@@ -634,14 +634,14 @@ void stress_binary_ebe_op(Int_t rsize, Int_t csize)
 void stress_transposition(Int_t msize)
 {
   if (gVerbose) {
-    cout << "\n---> Verify matrix transpose "
-            "for matrices of a characteristic size " << msize << endl;
+    std::cout << "\n---> Verify matrix transpose "
+            "for matrices of a characteristic size " << msize << std::endl;
   }
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nCheck to see that a square UnitMatrix stays the same";
+      std::cout << "\nCheck to see that a square UnitMatrix stays the same";
     TMatrixD m(msize,msize);
     m.UnitMatrix();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -650,7 +650,7 @@ void stress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nTest a non-square UnitMatrix";
+      std::cout << "\nTest a non-square UnitMatrix";
     TMatrixD m(msize,msize+1);
     m.UnitMatrix();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -662,7 +662,7 @@ void stress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck to see that a symmetric (Hilbert)Matrix stays the same";
+      std::cout << "\nCheck to see that a symmetric (Hilbert)Matrix stays the same";
     TMatrixD m = THilbertMatrixD(msize,msize);
     TMatrixD mt(TMatrixD::kTransposed,m);
     ok &= ( m == mt ) ? kTRUE : kFALSE;
@@ -670,7 +670,7 @@ void stress_transposition(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nCheck transposing a non-symmetric matrix";
+      std::cout << "\nCheck transposing a non-symmetric matrix";
     TMatrixD m = THilbertMatrixD(msize+1,msize);
     m(1,2) = TMath::Pi();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -679,13 +679,13 @@ void stress_transposition(Int_t msize)
     R__ASSERT(mt[2][1] == (Double_t)TMath::Pi() && mt[1][2] != (Double_t)TMath::Pi());
 
     if (gVerbose)
-      cout << "\nCheck double transposing a non-symmetric matrix" << endl;
+      std::cout << "\nCheck double transposing a non-symmetric matrix" << std::endl;
     TMatrixD mtt(TMatrixD::kTransposed,mt);
     ok &= ( m == mtt ) ? kTRUE : kFALSE;
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(5,"Matrix transposition",ok);
 }
@@ -725,13 +725,13 @@ public:
 void stress_special_creation(Int_t dim)
 {
   if (gVerbose)
-    cout << "\n---> Check creating some special matrices of dimension " << dim << endl;
+    std::cout << "\n---> Check creating some special matrices of dimension " << dim << std::endl;
 
   Int_t j;
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\ntest creating Hilbert matrices" << endl;
+      std::cout << "\ntest creating Hilbert matrices" << std::endl;
     TMatrixD m = THilbertMatrixD(dim+1,dim);
     TMatrixD m1(TMatrixD::kZero,m);
     ok &= ( !(m == m1) ) ? kTRUE : kFALSE;
@@ -750,7 +750,7 @@ void stress_special_creation(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "test creating zero matrix and copy constructor" << endl;
+      std::cout << "test creating zero matrix and copy constructor" << std::endl;
     TMatrixD m = THilbertMatrixD(dim,dim+1);
     ok &= ( m != 0 ) ? kTRUE : kFALSE;
     TMatrixD m1(m);               // Applying the copy constructor
@@ -762,7 +762,7 @@ void stress_special_creation(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "test creating unit matrices" << endl;
+      std::cout << "test creating unit matrices" << std::endl;
     TMatrixD m(dim,dim);
 #ifndef __CINT__
     {
@@ -809,7 +809,7 @@ void stress_special_creation(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "check to see that Haar matrix has *exactly* orthogonal columns" << endl;
+      std::cout << "check to see that Haar matrix has *exactly* orthogonal columns" << std::endl;
     const Int_t order = 5;
     const TMatrixD haar = THaarMatrixD(order);
     ok &= ( haar.GetNrows() == (1<<order) &&
@@ -827,7 +827,7 @@ void stress_special_creation(Int_t dim)
     }
 
     if (gVerbose)
-      cout << "make Haar (sub)matrix and test it *is* a submatrix" << endl;
+      std::cout << "make Haar (sub)matrix and test it *is* a submatrix" << std::endl;
     const Int_t no_sub_cols = (1<<order) - 3;
     const TMatrixD haar_sub = THaarMatrixD(order,no_sub_cols);
     ok &= ( haar_sub.GetNrows() == (1<<order) &&
@@ -840,7 +840,7 @@ void stress_special_creation(Int_t dim)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(6,"Haar/Hilbert Matrix",ok);
 }
@@ -864,12 +864,12 @@ public:
 void stress_matrix_promises(Int_t dim)
 {
   if (gVerbose)
-    cout << "\n---> Check making/forcing promises, (lazy)matrices of dimension " << dim << endl;
+    std::cout << "\n---> Check making/forcing promises, (lazy)matrices of dimension " << dim << std::endl;
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nmake a promise and force it by a constructor" << endl;
+      std::cout << "\nmake a promise and force it by a constructor" << std::endl;
     TMatrixD m  = hilbert_matrix_promise(dim,dim+1);
     TMatrixD m1 = THilbertMatrixD(dim,dim+1);
     ok &= VerifyMatrixIdentity(m,m1,gVerbose,EPSILON);
@@ -877,7 +877,7 @@ void stress_matrix_promises(Int_t dim)
 
   {
     if (gVerbose)
-      cout << "make a promise and force it by an assignment" << endl;
+      std::cout << "make a promise and force it by an assignment" << std::endl;
     TMatrixD m(-1,dim,0,dim);
     m = hilbert_matrix_promise(-1,dim,0,dim);
     TMatrixD m1 = THilbertMatrixD(-1,dim,0,dim);
@@ -885,7 +885,7 @@ void stress_matrix_promises(Int_t dim)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(7,"Matrix promises",ok);
 }
@@ -897,7 +897,7 @@ void stress_matrix_promises(Int_t dim)
 void stress_norms(Int_t rsize,Int_t csize)
 {
   if (gVerbose)
-    cout << "\n---> Verify norm calculations" << endl;
+    std::cout << "\n---> Verify norm calculations" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = 10.25;
@@ -908,24 +908,24 @@ void stress_norms(Int_t rsize,Int_t csize)
   TMatrixD m(rsize,csize);
 
   if (gVerbose)
-    cout << "\nAssign " << pattern << " to all the elements and check norms" << endl;
+    std::cout << "\nAssign " << pattern << " to all the elements and check norms" << std::endl;
   m = pattern;
   if (gVerbose)
-    cout << "  1. (col) norm should be pattern*nrows" << endl;
+    std::cout << "  1. (col) norm should be pattern*nrows" << std::endl;
   ok &= ( m.Norm1() == pattern*m.GetNrows() ) ? kTRUE : kFALSE;
   ok &= ( m.Norm1() == m.ColNorm() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Inf (row) norm should be pattern*ncols" << endl;
+    std::cout << "  Inf (row) norm should be pattern*ncols" << std::endl;
   ok &= ( m.NormInf() == pattern*m.GetNcols() ) ? kTRUE : kFALSE;
   ok &= ( m.NormInf() == m.RowNorm() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Square of the Eucl norm has got to be pattern^2 * no_elems" << endl;
+    std::cout << "  Square of the Eucl norm has got to be pattern^2 * no_elems" << std::endl;
   ok &= ( m.E2Norm() == (pattern*pattern)*m.GetNoElements() ) ? kTRUE : kFALSE;
   TMatrixD m1(TMatrixD::kZero,m);
   ok &= ( m.E2Norm() == E2Norm(m,m1) ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(8,"Matrix Norms",ok);
 }
@@ -937,32 +937,32 @@ void stress_norms(Int_t rsize,Int_t csize)
 void stress_determinant(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify determinant evaluation for a square matrix of size " << msize << endl;
+    std::cout << "\n---> Verify determinant evaluation for a square matrix of size " << msize << std::endl;
 
   Bool_t ok = kTRUE;
   TMatrixD m(msize,msize);
   const double pattern = 2.5;
 
   if (gVerbose)
-    cout << "\nCheck to see that the determinant of the unit matrix is one";
+    std::cout << "\nCheck to see that the determinant of the unit matrix is one";
   m.UnitMatrix();
   if (gVerbose)
-    cout << "\n	determinant is " << m.Determinant();
+    std::cout << "\n	determinant is " << m.Determinant();
   ok &= ( m.Determinant() == 1 ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nCheck the determinant for the matrix with " << pattern << " at the diagonal";
+    std::cout << "\nCheck the determinant for the matrix with " << pattern << " at the diagonal";
   {
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
         m(i,j) = ( i==j ? pattern : 0 );
   }
   if (gVerbose)
-    cout << "\n	determinant is " << m.Determinant() << " should be " << TMath::Power(pattern,(double)m.GetNrows()) <<endl;
+    std::cout << "\n	determinant is " << m.Determinant() << " should be " << TMath::Power(pattern,(double)m.GetNrows()) <<std::endl;
   ok &= ( TMath::Abs(m.Determinant()-TMath::Power(pattern,(double)m.GetNrows())) < DBL_EPSILON  ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nCheck the determinant of the transposed matrix";
+    std::cout << "\nCheck the determinant of the transposed matrix";
   m.UnitMatrix();
   m(1,2) = pattern;
   TMatrixD m_tran(TMatrixD::kTransposed,m);
@@ -971,7 +971,7 @@ void stress_determinant(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nswap two rows/cols of a matrix through method 1 and watch det's sign";
+      std::cout << "\nswap two rows/cols of a matrix through method 1 and watch det's sign";
     m.UnitMatrix();
     TMatrixDRow(m,3) = pattern;
     const double det1 = m.Determinant();
@@ -989,7 +989,7 @@ void stress_determinant(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nswap two rows/cols of a matrix through method 2 and watch det's sign";
+      std::cout << "\nswap two rows/cols of a matrix through method 2 and watch det's sign";
     m.UnitMatrix();
     TMatrixDRow(m,3) = pattern;
     const double det1 = m.Determinant();
@@ -1006,7 +1006,7 @@ void stress_determinant(Int_t msize)
   }
 
   if (gVerbose)
-    cout << "\nCheck the determinant for the matrix with " << pattern << " at the anti-diagonal";
+    std::cout << "\nCheck the determinant for the matrix with " << pattern << " at the anti-diagonal";
   {
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
       for (Int_t j = m.GetColLwb(); j <= m.GetColUpb(); j++)
@@ -1018,7 +1018,7 @@ void stress_determinant(Int_t msize)
   if (0)
   {
     if (gVerbose)
-      cout << "\nCheck the determinant for the singular matrix"
+      std::cout << "\nCheck the determinant for the singular matrix"
               "\n	defined as above with zero first row";
     m.Zero();
     {
@@ -1027,69 +1027,69 @@ void stress_determinant(Int_t msize)
           m(i,j) = ( i==(m.GetColUpb()+m.GetColLwb()-j) ? pattern : 0 );
     }
     if (gVerbose)
-      cout << "\n	determinant is " << m.Determinant();
+      std::cout << "\n	determinant is " << m.Determinant();
     ok &= ( m.Determinant() == 0 ) ? kTRUE : kFALSE;
   }
 
   if (gVerbose)
-    cout << "\nCheck out the determinant of the Hilbert matrix";
+    std::cout << "\nCheck out the determinant of the Hilbert matrix";
   TMatrixD H = THilbertMatrixD(3,3);
   if (gVerbose) {
-    cout << "\n    3x3 Hilbert matrix: exact determinant 1/2160 ";
-    cout << "\n                              computed    1/"<< 1/H.Determinant();
+    std::cout << "\n    3x3 Hilbert matrix: exact determinant 1/2160 ";
+    std::cout << "\n                              computed    1/"<< 1/H.Determinant();
   }
 
   H.ResizeTo(4,4);
   H = THilbertMatrixD(4,4);
   if (gVerbose) {
-    cout << "\n    4x4 Hilbert matrix: exact determinant 1/6048000 ";
-    cout << "\n                              computed    1/"<< 1/H.Determinant();
+    std::cout << "\n    4x4 Hilbert matrix: exact determinant 1/6048000 ";
+    std::cout << "\n                              computed    1/"<< 1/H.Determinant();
   }
 
   H.ResizeTo(5,5);
   H = THilbertMatrixD(5,5);
   if (gVerbose) {
-    cout << "\n    5x5 Hilbert matrix: exact determinant 3.749295e-12";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    5x5 Hilbert matrix: exact determinant 3.749295e-12";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   if (gVerbose) {
     TDecompQRH qrh(H);
     Double_t d1,d2;
     qrh.Det(d1,d2);
-    cout  << "\n qrh det = " << d1*TMath::Power(2.0,d2) <<endl;
+    std::cout  << "\n qrh det = " << d1*TMath::Power(2.0,d2) <<std::endl;
   }
 
   if (gVerbose) {
     TDecompSVD svd(H);
     Double_t d1,d2;
     svd.Det(d1,d2);
-    cout  << "\n svd det = " << d1*TMath::Power(2.0,d2) <<endl;
+    std::cout  << "\n svd det = " << d1*TMath::Power(2.0,d2) <<std::endl;
   }
 
   H.ResizeTo(7,7);
   H = THilbertMatrixD(7,7);
   if (gVerbose) {
-    cout << "\n    7x7 Hilbert matrix: exact determinant 4.8358e-25";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    7x7 Hilbert matrix: exact determinant 4.8358e-25";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   H.ResizeTo(9,9);
   H = THilbertMatrixD(9,9);
   if (gVerbose) {
-    cout << "\n    9x9 Hilbert matrix: exact determinant 9.72023e-43";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    9x9 Hilbert matrix: exact determinant 9.72023e-43";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   H.ResizeTo(10,10);
   H = THilbertMatrixD(10,10);
   if (gVerbose) {
-    cout << "\n    10x10 Hilbert matrix: exact determinant 2.16418e-53";
-    cout << "\n                              computed    "<< H.Determinant();
+    std::cout << "\n    10x10 Hilbert matrix: exact determinant 2.16418e-53";
+    std::cout << "\n                              computed    "<< H.Determinant();
   }
 
   if (gVerbose)
-  cout << "\nDone\n" << endl;
+  std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(9,"Matrix Determinant",ok);
 }
@@ -1101,8 +1101,8 @@ void stress_determinant(Int_t msize)
 void stress_mm_multiplications(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify matrix multiplications "
-            "for matrices of the characteristic size " << msize << endl;
+    std::cout << "\n---> Verify matrix multiplications "
+            "for matrices of the characteristic size " << msize << std::endl;
 
   const Double_t epsilon = EPSILON*msize/100;
 
@@ -1110,7 +1110,7 @@ void stress_mm_multiplications(Int_t msize)
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nTest inline multiplications of the UnitMatrix" << endl;
+      std::cout << "\nTest inline multiplications of the UnitMatrix" << std::endl;
     TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
     TMatrixD u(TMatrixD::kUnit,m);
     m(3,1) = TMath::Pi();
@@ -1120,7 +1120,7 @@ void stress_mm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Test inline multiplications by a DiagMat" << endl;
+      std::cout << "Test inline multiplications by a DiagMat" << std::endl;
     TMatrixD m = THilbertMatrixD(msize+3,msize);
     m(1,3) = TMath::Pi();
     TVectorD v(msize);
@@ -1139,7 +1139,7 @@ void stress_mm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Test XPP = X where P is a permutation matrix" << endl;
+      std::cout << "Test XPP = X where P is a permutation matrix" << std::endl;
     TMatrixD m = THilbertMatrixD(msize-1,msize);
     m(2,3) = TMath::Pi();
     TMatrixD eth = m;
@@ -1153,7 +1153,7 @@ void stress_mm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Test general matrix multiplication through inline mult" << endl;
+      std::cout << "Test general matrix multiplication through inline mult" << std::endl;
     TMatrixD m = THilbertMatrixD(msize-2,msize);
     m(3,3) = TMath::Pi();
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -1172,14 +1172,14 @@ void stress_mm_multiplications(Int_t msize)
     ok &= VerifyMatrixIdentity(m,mp2,gVerbose,epsilon);
 
     if (gVerbose)
-      cout << "Test XP=X*P  vs XP=X;XP*=P" << endl;
+      std::cout << "Test XP=X*P  vs XP=X;XP*=P" << std::endl;
     TMatrixD mp3 = m1*p;
     ok &= VerifyMatrixIdentity(m,mp3,gVerbose,epsilon);
   }
 
   {
     if (gVerbose)
-      cout << "Check to see UU' = U'U = E when U is the Haar matrix" << endl;
+      std::cout << "Check to see UU' = U'U = E when U is the Haar matrix" << std::endl;
     const Int_t order = 5;
     const Int_t no_sub_cols = (1<<order)-5;
     TMatrixD haar_sub = THaarMatrixD(5,no_sub_cols);
@@ -1203,7 +1203,7 @@ void stress_mm_multiplications(Int_t msize)
     ok &= VerifyMatrixIdentity(unit,hht2,gVerbose,EPSILON);
   }
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(10,"General Matrix Multiplications",ok);
 }
@@ -1215,8 +1215,8 @@ void stress_mm_multiplications(Int_t msize)
 void stress_sym_mm_multiplications(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify symmetric matrix multiplications "
-            "for matrices of the characteristic size " << msize << endl;
+    std::cout << "\n---> Verify symmetric matrix multiplications "
+            "for matrices of the characteristic size " << msize << std::endl;
 
   Bool_t ok = kTRUE;
 
@@ -1225,7 +1225,7 @@ void stress_sym_mm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "\nTest inline multiplications of the UnitMatrix" << endl;
+      std::cout << "\nTest inline multiplications of the UnitMatrix" << std::endl;
     TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
     TMatrixDSym m_sym(-1,msize,m.GetMatrixArray());
     TMatrixDSym u(TMatrixDSym::kUnit,m_sym);
@@ -1236,10 +1236,10 @@ void stress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "\nTest symmetric multiplications" << endl;
+      std::cout << "\nTest symmetric multiplications" << std::endl;
     {
       if (gVerbose)
-        cout << "\n  Test m * m_sym == m_sym * m == m_sym * m_sym  multiplications" << endl;
+        std::cout << "\n  Test m * m_sym == m_sym * m == m_sym * m_sym  multiplications" << std::endl;
       TMatrixD m = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixDSym m_sym(-1,msize,m.GetMatrixArray());
       TMatrixD mm      = m * m;
@@ -1253,7 +1253,7 @@ void stress_sym_mm_multiplications(Int_t msize)
 
     {
       if (gVerbose)
-        cout << "\n  Test n * m_sym == n * m multiplications" << endl;
+        std::cout << "\n  Test n * m_sym == n * m multiplications" << std::endl;
       TMatrixD n = THilbertMatrixD(-1,msize,-1,msize);
       TMatrixD m = n;
       n(1,3) = TMath::Pi();
@@ -1268,7 +1268,7 @@ void stress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Test inline multiplications by a DiagMatrix" << endl;
+      std::cout << "Test inline multiplications by a DiagMatrix" << std::endl;
     TMatrixDSym m = THilbertMatrixDSym(msize);
     m(1,3) = TMath::Pi();
     m(3,1) = TMath::Pi();
@@ -1288,7 +1288,7 @@ void stress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Test XPP = X where P is a permutation matrix" << endl;
+      std::cout << "Test XPP = X where P is a permutation matrix" << std::endl;
     TMatrixDSym m = THilbertMatrixDSym(msize);
     m(2,3) = TMath::Pi();
     m(3,2) = TMath::Pi();
@@ -1304,7 +1304,7 @@ void stress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Test general matrix multiplication through inline mult" << endl;
+      std::cout << "Test general matrix multiplication through inline mult" << std::endl;
     TMatrixDSym m = THilbertMatrixDSym(msize);
     m(2,3) = TMath::Pi();
     m(3,2) = TMath::Pi();
@@ -1323,7 +1323,7 @@ void stress_sym_mm_multiplications(Int_t msize)
     ok &= ( mp2 == 0 ) ? kTRUE : kFALSE;
 
     if (gVerbose)
-      cout << "Test XP=X*P  vs XP=X;XP*=P" << endl;
+      std::cout << "Test XP=X*P  vs XP=X;XP*=P" << std::endl;
     TMatrixD mp3 = m1*p;
     ok &= VerifyMatrixIdentity(m,mp3,gVerbose,epsilon);
   }
@@ -1331,7 +1331,7 @@ void stress_sym_mm_multiplications(Int_t msize)
   if (ok)
   {
     if (gVerbose)
-      cout << "Check to see UU' = U'U = E when U is the Haar matrix" << endl;
+      std::cout << "Check to see UU' = U'U = E when U is the Haar matrix" << std::endl;
     {
       const Int_t order = 5;
       const Int_t no_sub_cols = (1<<order)-5;
@@ -1356,7 +1356,7 @@ void stress_sym_mm_multiplications(Int_t msize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(11,"Symmetric Matrix Multiplications",ok);
 }
@@ -1368,15 +1368,15 @@ void stress_sym_mm_multiplications(Int_t msize)
 void stress_vm_multiplications(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify vector-matrix multiplications "
-           "for matrices of the characteristic size " << msize << endl;
+    std::cout << "\n---> Verify vector-matrix multiplications "
+           "for matrices of the characteristic size " << msize << std::endl;
 
   const Double_t epsilon = EPSILON*msize/100;
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nCheck shrinking a vector by multiplying by a non-sq unit matrix" << endl;
+      std::cout << "\nCheck shrinking a vector by multiplying by a non-sq unit matrix" << std::endl;
     TVectorD vb(-2,msize);
     for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
       vb(i) = TMath::Pi()-i;
@@ -1392,7 +1392,7 @@ void stress_vm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Check expanding a vector by multiplying by a non-sq unit matrix" << endl;
+      std::cout << "Check expanding a vector by multiplying by a non-sq unit matrix" << std::endl;
     TVectorD vb(msize);
     for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
       vb(i) = TMath::Pi()+i;
@@ -1408,7 +1408,7 @@ void stress_vm_multiplications(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Check general matrix-vector multiplication" << endl;
+      std::cout << "Check general matrix-vector multiplication" << std::endl;
     TVectorD vb(msize);
     for (Int_t i = vb.GetLwb(); i <= vb.GetUpb(); i++)
       vb(i) = TMath::Pi()+i;
@@ -1424,7 +1424,7 @@ void stress_vm_multiplications(Int_t msize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(12,"Matrix Vector Multiplications",ok);
 }
@@ -1436,14 +1436,14 @@ void stress_vm_multiplications(Int_t msize)
 void stress_inversion(Int_t msize)
 {
   if (gVerbose)
-    cout << "\n---> Verify matrix inversion for square matrices of size " << msize << endl;
+    std::cout << "\n---> Verify matrix inversion for square matrices of size " << msize << std::endl;
 
   const Double_t epsilon = EPSILON*msize/10;
 
   Bool_t ok = kTRUE;
   {
     if (gVerbose)
-      cout << "\nTest inversion of a diagonal matrix" << endl;
+      std::cout << "\nTest inversion of a diagonal matrix" << std::endl;
     TMatrixD m(-1,msize,-1,msize);
     TMatrixD mi(TMatrixD::kZero,m);
     for (Int_t i = m.GetRowLwb(); i <= m.GetRowUpb(); i++)
@@ -1456,7 +1456,7 @@ void stress_inversion(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Test inversion of an orthonormal (Haar) matrix" << endl;
+      std::cout << "Test inversion of an orthonormal (Haar) matrix" << std::endl;
     TMatrixD m = THaarMatrixD(3);
     TMatrixD morig = m;
     TMatrixD mt(TMatrixD::kTransposed,m);
@@ -1470,7 +1470,7 @@ void stress_inversion(Int_t msize)
 
   {
     if (gVerbose)
-      cout << "Test inversion of a good matrix with diagonal dominance" << endl;
+      std::cout << "Test inversion of a good matrix with diagonal dominance" << std::endl;
     TMatrixD m = THilbertMatrixD(msize,msize);
     TMatrixDDiag(m) += 1;
     TMatrixD morig = m;
@@ -1478,24 +1478,24 @@ void stress_inversion(Int_t msize)
     const Double_t det_comp = m.Determinant();
     m.Invert(&det_inv);
     if (gVerbose) {
-      cout << "\tcomputed determinant             " << det_comp << endl;
-      cout << "\tdeterminant returned by Invert() " << det_inv << endl;
+      std::cout << "\tcomputed determinant             " << det_comp << std::endl;
+      std::cout << "\tdeterminant returned by Invert() " << det_inv << std::endl;
     }
 
     if (gVerbose)
-      cout << "\tcheck to see M^(-1) * M is E" << endl;
+      std::cout << "\tcheck to see M^(-1) * M is E" << std::endl;
     TMatrixD mim(m,TMatrixD::kMult,morig);
     TMatrixD unit(TMatrixD::kUnit,m);
     ok &= VerifyMatrixIdentity(mim,unit,gVerbose,epsilon);
 
     if (gVerbose)
-      cout << "\tcheck to see M * M^(-1) is E" << endl;
+      std::cout << "\tcheck to see M * M^(-1) is E" << std::endl;
     TMatrixD mmi = morig; mmi *= m;
     ok &= VerifyMatrixIdentity(mmi,unit,gVerbose,epsilon);
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(13,"Matrix Inversion",ok);
 }
@@ -1507,7 +1507,7 @@ void stress_inversion(Int_t msize)
 void stress_matrix_io()
 {
   if (gVerbose)
-    cout << "\n---> Test matrix I/O" << endl;
+    std::cout << "\n---> Test matrix I/O" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = TMath::Pi();
@@ -1516,30 +1516,30 @@ void stress_matrix_io()
   m = pattern;
 
   if (gVerbose)
-    cout << "\nWrite matrix m to database" << endl;
+    std::cout << "\nWrite matrix m to database" << std::endl;
 
   TFile *f = new TFile("vmatrix.root", "RECREATE");
 
   m.Write("m");
 
   if (gVerbose)
-    cout << "\nClose database" << endl;
+    std::cout << "\nClose database" << std::endl;
   delete f;
 
   if (gVerbose)
-    cout << "\nOpen database in read-only mode and read matrix" << endl;
+    std::cout << "\nOpen database in read-only mode and read matrix" << std::endl;
   TFile *f1 = new TFile("vmatrix.root");
 
   TMatrixD *mr = (TMatrixD*) f1->Get("m");
 
   if (gVerbose)
-    cout << "\nRead matrix should be same as original still in memory" << endl;
+    std::cout << "\nRead matrix should be same as original still in memory" << std::endl;
   ok &= ((*mr) == m) ? kTRUE : kFALSE;
 
   delete f1;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
 
   StatusPrint(14,"Matrix Persistence",ok);
 }
diff --git a/test/vvector.cxx b/test/vvector.cxx
index 6ca682695a0..e1562f52f5b 100644
--- a/test/vvector.cxx
+++ b/test/vvector.cxx
@@ -68,9 +68,9 @@ Int_t gVerbose = 0;
 
 void stress_vector(Int_t verbose=0)
 {
-  cout << "******************************************************************" <<endl;
-  cout << "*  Starting  Vector - S T R E S S suite                          *" <<endl;
-  cout << "******************************************************************" <<endl;
+  std::cout << "******************************************************************" <<std::endl;
+  std::cout << "*  Starting  Vector - S T R E S S suite                          *" <<std::endl;
+  std::cout << "******************************************************************" <<std::endl;
 
   gVerbose = verbose;
   stress_allocation();
@@ -80,7 +80,7 @@ void stress_vector(Int_t verbose=0)
   stress_matrix_slices(20);
   stress_vector_io();
 
-  cout << "******************************************************************" <<endl;
+  std::cout << "******************************************************************" <<std::endl;
 }
 
 void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
@@ -90,7 +90,7 @@ void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
 //   TString header = TString("Test ")+Form("%2d",id)+" : "+title;
 //   const Int_t nch = header.Length();
 //   for (Int_t i = nch; i < kMAX; i++) header += '.';
-//   cout << header << (status ? "OK" : "FAILED") << endl;
+//   std::cout << header << (status ? "OK" : "FAILED") << std::endl;
   // Print test program number and its title
    const Int_t kMAX = 65;
    char header[80];
@@ -99,7 +99,7 @@ void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
    for (Int_t i=nch;i<kMAX;i++) header[i] = '.';
    header[kMAX] = 0;
    header[kMAX-1] = ' ';
-   cout << header << (status ? "OK" : "FAILED") << endl;
+   std::cout << header << (status ? "OK" : "FAILED") << std::endl;
 }
 
 //------------------------------------------------------------------------
@@ -109,7 +109,7 @@ void StatusPrint(Int_t id,const Char_t *title,Bool_t status)
 void stress_allocation()
 {
   if (gVerbose)
-    cout << "\n\n---> Test allocation and compatibility check" << endl;
+    std::cout << "\n\n---> Test allocation and compatibility check" << std::endl;
 
   Bool_t ok = kTRUE;
   TVectorD v1(20);
@@ -118,34 +118,34 @@ void stress_allocation()
   TVectorD v4(v1);
 
   if (gVerbose) {
-    cout << "\nStatus information reported for vector v3:" << endl;
-    cout << "  Lower bound ... " << v3.GetLwb() << endl;
-    cout << "  Upper bound ... " << v3.GetUpb() << endl;
-    cout << "  No. of elements " << v3.GetNoElements() << endl;
+    std::cout << "\nStatus information reported for vector v3:" << std::endl;
+    std::cout << "  Lower bound ... " << v3.GetLwb() << std::endl;
+    std::cout << "  Upper bound ... " << v3.GetUpb() << std::endl;
+    std::cout << "  No. of elements " << v3.GetNoElements() << std::endl;
   }
 
   if (gVerbose)
-    cout << "\nCheck vectors 1 & 2 for compatibility" << endl;
+    std::cout << "\nCheck vectors 1 & 2 for compatibility" << std::endl;
   ok &= AreCompatible(v1,v2,gVerbose);
 
   if (gVerbose)
-    cout << "Check vectors 1 & 4 for compatibility" << endl;
+    std::cout << "Check vectors 1 & 4 for compatibility" << std::endl;
   ok &= AreCompatible(v1,v4,gVerbose);
 
   if (gVerbose)
-    cout << "v2 has to be compatible with v3 after resizing to v3" << endl;
+    std::cout << "v2 has to be compatible with v3 after resizing to v3" << std::endl;
   v2.ResizeTo(v3);
   ok &= AreCompatible(v2,v3,gVerbose);
 
   TVectorD v5(v1.GetUpb()+5);
   if (gVerbose)
-    cout << "v1 has to be compatible with v5 after resizing to v5.upb" << endl;
+    std::cout << "v1 has to be compatible with v5 after resizing to v5.upb" << std::endl;
   v1.ResizeTo(v5.GetNoElements());
   ok &= AreCompatible(v1,v5,gVerbose);
 
   {
     if (gVerbose)
-      cout << "Check that shrinking does not change remaining elements" << endl;
+      std::cout << "Check that shrinking does not change remaining elements" << std::endl;
     TVectorD vb(-1,20);
     Int_t i;
     for (i = vb.GetLwb(); i <= vb.GetUpb(); i++)
@@ -157,7 +157,7 @@ void stress_allocation()
     for (i = v.GetLwb(); i <= v.GetUpb(); i++)
       ok &= ( v(i) == vb(i) ) ? kTRUE : kFALSE;
     if (gVerbose)
-      cout << "Check that expansion expands by zeros" << endl;
+      std::cout << "Check that expansion expands by zeros" << std::endl;
     const Int_t old_nelems = v.GetNoElements();
     const Int_t old_lwb    = v.GetLwb();
     v.ResizeTo(vb);
@@ -171,7 +171,7 @@ void stress_allocation()
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(1,"Allocation, Filling, Resizing",ok);
 }
 
@@ -196,7 +196,7 @@ class CosAction : public TElementPosActionD {
 void stress_element_op(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test operations that treat each element uniformly" << endl;
+    std::cout << "\n---> Test operations that treat each element uniformly" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = TMath::Pi();
@@ -205,22 +205,22 @@ void stress_element_op(Int_t vsize)
   TVectorD v1(v);
 
   if (gVerbose)
-    cout << "\nWriting zeros to v..." << endl;
+    std::cout << "\nWriting zeros to v..." << std::endl;
   for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
     v(i) = 0;
   ok &= VerifyVectorValue(v,0.0,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Clearing v1 ..." << endl;
+    std::cout << "Clearing v1 ..." << std::endl;
   v1.Zero();
   ok &= VerifyVectorValue(v1,0.0,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing v1 with 0 ..." << endl;
+    std::cout << "Comparing v1 with 0 ..." << std::endl;
   ok &= (v1 == 0) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "Writing a pattern " << pattern << " by assigning to v(i)..." << endl;
+    std::cout << "Writing a pattern " << pattern << " by assigning to v(i)..." << std::endl;
   {
     for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
       v(i) = pattern;
@@ -228,33 +228,33 @@ void stress_element_op(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "Writing the pattern by assigning to v1 as a whole ..." << endl;
+    std::cout << "Writing the pattern by assigning to v1 as a whole ..." << std::endl;
   v1 = pattern;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "Comparing v and v1 ..." << endl;
+    std::cout << "Comparing v and v1 ..." << std::endl;
   ok &= (v == v1) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "Comparing (v=0) and v1 ..." << endl;
+    std::cout << "Comparing (v=0) and v1 ..." << std::endl;
   ok &= (!(v.Zero() == v1)) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nClear v and add the pattern" << endl;
+    std::cout << "\nClear v and add the pattern" << std::endl;
   v.Zero();
   v += pattern;
   ok &= VerifyVectorValue(v,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   add the doubled pattern with the negative sign" << endl;
+    std::cout << "   add the doubled pattern with the negative sign" << std::endl;
   v += -2*pattern;
   ok &= VerifyVectorValue(v,-pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "   subtract the trippled pattern with the negative sign" << endl;
+    std::cout << "   subtract the trippled pattern with the negative sign" << std::endl;
   v -= -3*pattern;
   ok &= VerifyVectorValue(v,2*pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nVerify comparison operations" << endl;
+    std::cout << "\nVerify comparison operations" << std::endl;
   v = pattern;
   ok &= ( v == pattern && !(v != pattern) && v >= pattern && v <= pattern ) ? kTRUE : kFALSE;
   ok &= ( v > 0 && v >= 0 ) ? kTRUE : kFALSE;
@@ -266,25 +266,25 @@ void stress_element_op(Int_t vsize)
   ok &= ( v <= pattern+1.001 && !(v < pattern+1) && !(v <= pattern) ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nAssign 2*pattern to v by repeating additions" << endl;
+    std::cout << "\nAssign 2*pattern to v by repeating additions" << std::endl;
   v = 0; v += pattern; v += pattern;
   if (gVerbose)
-    cout << "Assign 2*pattern to v1 by multiplying by two" << endl;
+    std::cout << "Assign 2*pattern to v1 by multiplying by two" << std::endl;
   v1 = pattern; v1 *= 2;
   ok &= VerifyVectorValue(v1,2*pattern,gVerbose,EPSILON);
   ok &= ( v == v1 ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "Multiply v1 by one half returning it to the 1*pattern" << endl;
+    std::cout << "Multiply v1 by one half returning it to the 1*pattern" << std::endl;
   v1 *= 1/2.;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
 
   if (gVerbose)
-    cout << "\nAssign -pattern to v and v1" << endl;
+    std::cout << "\nAssign -pattern to v and v1" << std::endl;
   v.Zero(); v -= pattern; v1 = -pattern;
   ok &= VerifyVectorValue(v,-pattern,gVerbose,EPSILON);
   ok &= ( v == v1 ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "v = sqrt(sqr(v)); v1 = abs(v1); Now v and v1 have to be the same" << endl;
+    std::cout << "v = sqrt(sqr(v)); v1 = abs(v1); Now v and v1 have to be the same" << std::endl;
   v.Sqr();
   ok &= VerifyVectorValue(v,pattern*pattern,gVerbose,EPSILON);
   v.Sqrt();
@@ -295,7 +295,7 @@ void stress_element_op(Int_t vsize)
 
   {
     if (gVerbose)
-      cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << endl;
+      std::cout << "\nCheck out to see that sin^2(x) + cos^2(x) = 1" << std::endl;
     for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
       v(i) = 2*TMath::Pi()/v.GetNoElements()*i;
 #ifndef __CINT__
@@ -318,7 +318,7 @@ void stress_element_op(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nVerify constructor with initialization" << endl;
+    std::cout << "\nVerify constructor with initialization" << std::endl;
 #ifndef __CINT__
   TVectorD vi(0,4,0.0,1.0,2.0,3.0,4.0,"END");
 #else
@@ -333,7 +333,7 @@ void stress_element_op(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(2,"Uniform vector operations",ok);
 }
 
@@ -344,7 +344,7 @@ void stress_element_op(Int_t vsize)
 void stress_binary_op(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test Binary Vector operations" << endl;
+    std::cout << "\n---> Test Binary Vector operations" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = TMath::Pi();
@@ -355,7 +355,7 @@ void stress_binary_op(Int_t vsize)
   TVectorD v1(v);
 
   if (gVerbose)
-    cout << "\nVerify assignment of a vector to the vector" << endl;
+    std::cout << "\nVerify assignment of a vector to the vector" << std::endl;
   v = pattern;
   v1.Zero();
   v1 = v;
@@ -363,20 +363,20 @@ void stress_binary_op(Int_t vsize)
   ok &= ( v1 == v ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nAdding one vector to itself, uniform pattern " << pattern << endl;
+    std::cout << "\nAdding one vector to itself, uniform pattern " << pattern << std::endl;
   v.Zero(); v = pattern;
   v1 = v; v1 += v1;
   ok &= VerifyVectorValue(v1,2*pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting two vectors ..." << endl;
+    std::cout << "  subtracting two vectors ..." << std::endl;
   v1 -= v;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  subtracting the vector from itself" << endl;
+    std::cout << "  subtracting the vector from itself" << std::endl;
   v1 -= v1;
   ok &= VerifyVectorValue(v1,0.,gVerbose,EPSILON);
   if (gVerbose)
-    cout << "  adding two vectors together" << endl;
+    std::cout << "  adding two vectors together" << std::endl;
   v1 += v;
   ok &= VerifyVectorValue(v1,pattern,gVerbose,EPSILON);
 
@@ -387,8 +387,8 @@ void stress_binary_op(Int_t vsize)
   }
 
   if (gVerbose) {
-    cout << "\nArithmetic operations on vectors with not the same elements" << endl;
-    cout << "   adding vp to the zero vector..." << endl;
+    std::cout << "\nArithmetic operations on vectors with not the same elements" << std::endl;
+    std::cout << "   adding vp to the zero vector..." << std::endl;
   }
   v.Zero();
   ok &= ( v == 0.0 ) ? kTRUE : kFALSE;
@@ -397,26 +397,26 @@ void stress_binary_op(Int_t vsize)
 //  ok &= ( v == vp ) ? kTRUE : kFALSE;
   v1 = v;
   if (gVerbose)
-    cout << "   making v = 3*vp and v1 = 3*vp, via add() and succesive mult" << endl;
+    std::cout << "   making v = 3*vp and v1 = 3*vp, via add() and succesive mult" << std::endl;
   Add(v,2.,vp);
   v1 += v1; v1 += vp;
   ok &= VerifyVectorIdentity(v,v1,gVerbose,epsilon);
   if (gVerbose)
-    cout << "   clear both v and v1, by subtracting from itself and via add()" << endl;
+    std::cout << "   clear both v and v1, by subtracting from itself and via add()" << std::endl;
   v1 -= v1;
   Add(v,-3.,vp);
   ok &= VerifyVectorIdentity(v,v1,gVerbose,epsilon);
 
   if (gVerbose) {
-    cout << "\nTesting element-by-element multiplications and divisions" << endl;
-    cout << "   squaring each element with sqr() and via multiplication" << endl;
+    std::cout << "\nTesting element-by-element multiplications and divisions" << std::endl;
+    std::cout << "   squaring each element with sqr() and via multiplication" << std::endl;
   }
   v = vp; v1 = vp;
   v.Sqr();
   ElementMult(v1,v1);
   ok &= VerifyVectorIdentity(v,v1,gVerbose,epsilon);
   if (gVerbose)
-    cout << "   compare (v = pattern^2)/pattern with pattern" << endl;
+    std::cout << "   compare (v = pattern^2)/pattern with pattern" << std::endl;
   v = pattern; v1 = pattern;
   v.Sqr();
   ElementDiv(v,v1);
@@ -425,7 +425,7 @@ void stress_binary_op(Int_t vsize)
    Compare(v1,v);
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(3,"Binary vector element-by-element operations",ok);
 }
 
@@ -436,7 +436,7 @@ void stress_binary_op(Int_t vsize)
 void stress_norms(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Verify norm calculations" << endl;
+    std::cout << "\n---> Verify norm calculations" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = 10.25;
@@ -448,27 +448,27 @@ void stress_norms(Int_t vsize)
   TVectorD v1(v);
 
   if (gVerbose)
-    cout << "\nAssign " << pattern << " to all the elements and check norms" << endl;
+    std::cout << "\nAssign " << pattern << " to all the elements and check norms" << std::endl;
   v = pattern;
   if (gVerbose)
-    cout << "  1. norm should be pattern*no_elems" << endl;
+    std::cout << "  1. norm should be pattern*no_elems" << std::endl;
   ok &= ( v.Norm1() == pattern*v.GetNoElements() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Square of the 2. norm has got to be pattern^2 * no_elems" << endl;
+    std::cout << "  Square of the 2. norm has got to be pattern^2 * no_elems" << std::endl;
   ok &= ( v.Norm2Sqr() == (pattern*pattern)*v.GetNoElements() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Inf norm should be pattern itself" << endl;
+    std::cout << "  Inf norm should be pattern itself" << std::endl;
   ok &= ( v.NormInf() == pattern ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << endl;
+    std::cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << std::endl;
   ok &= ( v.Norm2Sqr() == v*v ) ? kTRUE : kFALSE;
 
   Double_t ap_step = 1;
   Double_t ap_a0   = -pattern;
   Int_t n = v.GetNoElements();
   if (gVerbose) {
-    cout << "\nAssign the arithm progression with 1. term " << ap_a0 <<
-            "\nand the difference " << ap_step << endl;
+    std::cout << "\nAssign the arithm progression with 1. term " << ap_a0 <<
+            "\nand the difference " << ap_step << std::endl;
   }
   {
     for (Int_t i = v.GetLwb(); i <= v.GetUpb(); i++)
@@ -478,21 +478,21 @@ void stress_norms(Int_t vsize)
   Double_t norm = (2*ap_a0+(l+n-1)*ap_step)/2*(n-l) +
                   (-2*ap_a0-(l-1)*ap_step)/2*l;
   if (gVerbose)
-    cout << "  1. norm should be " << norm << endl;
+    std::cout << "  1. norm should be " << norm << std::endl;
   ok &= ( v.Norm1() == norm ) ? kTRUE : kFALSE;
   norm = n*( (ap_a0*ap_a0)+ap_a0*ap_step*(n-1)+(ap_step*ap_step)*(n-1)*(2*n-1)/6);
   if (gVerbose) {
-    cout << "  Square of the 2. norm has got to be "
-            "n*[ a0^2 + a0*q*(n-1) + q^2/6*(n-1)*(2n-1) ], or " << norm << endl;
+    std::cout << "  Square of the 2. norm has got to be "
+            "n*[ a0^2 + a0*q*(n-1) + q^2/6*(n-1)*(2n-1) ], or " << norm << std::endl;
   }
   ok &= ( TMath::Abs( (v.Norm2Sqr()-norm)/norm ) < 1e-15 ) ? kTRUE : kFALSE;
 
   norm = TMath::Max(TMath::Abs(v(v.GetLwb())),TMath::Abs(v(v.GetUpb())));
   if (gVerbose)
-    cout << "  Inf norm should be max(abs(a0),abs(a0+(n-1)*q)), ie " << norm << endl;
+    std::cout << "  Inf norm should be max(abs(a0),abs(a0+(n-1)*q)), ie " << norm << std::endl;
   ok &= ( v.NormInf() == norm ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << endl;
+    std::cout << "  Scalar product of vector by itself is the sqr(2. vector norm)" << std::endl;
   ok &= ( v.Norm2Sqr() == v*v ) ? kTRUE : kFALSE;
 
 #if 0
@@ -501,22 +501,22 @@ void stress_norms(Int_t vsize)
 #endif
 
   if (gVerbose)
-    cout << "\nConstruct v1 to be orthogonal to v as v(n), -v(n-1), v(n-2)..." << endl;
+    std::cout << "\nConstruct v1 to be orthogonal to v as v(n), -v(n-1), v(n-2)..." << std::endl;
   {
     for (Int_t i = 0; i < v1.GetNoElements(); i++)
       v1(i+v1.GetLwb()) = v(v.GetUpb()-i) * ( i % 2 == 1 ? -1 : 1 );
   }
   if (gVerbose)
-    cout << "||v1|| has got to be equal ||v|| regardless of the norm def" << endl;
+    std::cout << "||v1|| has got to be equal ||v|| regardless of the norm def" << std::endl;
   ok &= ( v1.Norm1()    == v.Norm1() ) ? kTRUE : kFALSE;
   ok &= ( v1.Norm2Sqr() == v.Norm2Sqr() ) ? kTRUE : kFALSE;
   ok &= ( v1.NormInf()  == v.NormInf() ) ? kTRUE : kFALSE;
   if (gVerbose)
-    cout << "But the scalar product has to be zero" << endl;
+    std::cout << "But the scalar product has to be zero" << std::endl;
   ok &= ( v1 * v == 0 ) ? kTRUE : kFALSE;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(4,"Vector Norms",ok);
 }
 
@@ -527,7 +527,7 @@ void stress_norms(Int_t vsize)
 void stress_matrix_slices(Int_t vsize)
 {
   if (gVerbose)
-    cout << "\n---> Test operations with vectors and matrix slices" << endl;
+    std::cout << "\n---> Test operations with vectors and matrix slices" << std::endl;
 
   Bool_t ok = kTRUE;
   const Double_t pattern = 8.625;
@@ -538,7 +538,7 @@ void stress_matrix_slices(Int_t vsize)
 
   Int_t i,j;
   if (gVerbose)
-    cout << "\nCheck modifying the matrix column-by-column" << endl;
+    std::cout << "\nCheck modifying the matrix column-by-column" << std::endl;
   m = pattern;
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
   for (i = m.GetColLwb(); i <= m.GetColUpb(); i++) {
@@ -574,7 +574,7 @@ void stress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nCheck modifying the matrix row-by-row" << endl;
+    std::cout << "\nCheck modifying the matrix row-by-row" << std::endl;
   m = pattern;
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
   for (i = m.GetRowLwb(); i <= m.GetRowUpb(); i++) {
@@ -608,7 +608,7 @@ void stress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nCheck modifying the matrix diagonal" << endl;
+    std::cout << "\nCheck modifying the matrix diagonal" << std::endl;
   m = pattern;
   TMatrixDDiag td = m;
   td = pattern-3;
@@ -634,8 +634,8 @@ void stress_matrix_slices(Int_t vsize)
   ok &= ( m == pattern ) ? kTRUE : kFALSE;
 
   if (gVerbose) {
-    cout << "\nCheck out to see that multiplying by diagonal is column-wise"
-            "\nmatrix multiplication" << endl;
+    std::cout << "\nCheck out to see that multiplying by diagonal is column-wise"
+            "\nmatrix multiplication" << std::endl;
   }
   TMatrixD mm(m);
   TMatrixD m1(m.GetRowLwb(),TMath::Max(m.GetRowUpb(),m.GetColUpb()),
@@ -661,7 +661,7 @@ void stress_matrix_slices(Int_t vsize)
   }
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(5,"Matrix Slices to Vectors",ok);
 }
 
@@ -672,7 +672,7 @@ void stress_matrix_slices(Int_t vsize)
 void stress_vector_io()
 {
   if (gVerbose)
-    cout << "\n---> Test vector I/O" << endl;
+    std::cout << "\n---> Test vector I/O" << std::endl;
 
   Bool_t ok = kTRUE;
   const double pattern = TMath::Pi();
@@ -681,29 +681,29 @@ void stress_vector_io()
   v = pattern;
 
   if (gVerbose)
-    cout << "\nWrite vector v to database" << endl;
+    std::cout << "\nWrite vector v to database" << std::endl;
 
   TFile *f = new TFile("vvector.root","RECREATE");
 
   v.Write("v");
 
   if (gVerbose)
-    cout << "\nClose database" << endl;
+    std::cout << "\nClose database" << std::endl;
   delete f;
 
   if (gVerbose)
-    cout << "\nOpen database in read-only mode and read vector" << endl;
+    std::cout << "\nOpen database in read-only mode and read vector" << std::endl;
   TFile *f1 = new TFile("vvector.root");
 
   TVectorD *vr = (TVectorD*) f1->Get("v");
 
   if (gVerbose)
-    cout << "\nRead vector should be same as original still in memory" << endl;
+    std::cout << "\nRead vector should be same as original still in memory" << std::endl;
   ok &= ((*vr) == v) ? kTRUE : kFALSE;
 
   delete f1;
 
   if (gVerbose)
-    cout << "\nDone\n" << endl;
+    std::cout << "\nDone\n" << std::endl;
   StatusPrint(6,"Vector Persistence",ok);
 }
diff --git a/tmva/inc/TMVA/BinaryTree.h b/tmva/inc/TMVA/BinaryTree.h
index f2d26de9c23..81fe591789c 100644
--- a/tmva/inc/TMVA/BinaryTree.h
+++ b/tmva/inc/TMVA/BinaryTree.h
@@ -62,13 +62,13 @@ namespace TMVA {
    class BinaryTree;
    class MsgLogger;
 
-   ostream& operator<< ( ostream& os, const BinaryTree& tree );
-   istream& operator>> ( istream& istr,     BinaryTree& tree );
+   std::ostream& operator<< ( std::ostream& os, const BinaryTree& tree );
+   std::istream& operator>> ( std::istream& istr,     BinaryTree& tree );
    
    class BinaryTree {
       
-      friend ostream& operator<< ( ostream& os, const BinaryTree& tree );
-      friend istream& operator>> ( istream& istr,     BinaryTree& tree );
+      friend std::ostream& operator<< ( std::ostream& os, const BinaryTree& tree );
+      friend std::istream& operator>> ( std::istream& istr,     BinaryTree& tree );
       
    public:
       
@@ -104,8 +104,8 @@ namespace TMVA {
       Node* GetLeftDaughter ( Node* n);    
       Node* GetRightDaughter( Node* n);
 
-      virtual void Print( ostream& os ) const;
-      virtual void Read ( istream& istr, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
+      virtual void Print( std::ostream& os ) const;
+      virtual void Read ( std::istream& istr, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
       virtual void* AddXMLTo(void* parent) const;
       virtual void  ReadXML(void* node, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
 
diff --git a/tmva/inc/TMVA/CCTreeWrapper.h b/tmva/inc/TMVA/CCTreeWrapper.h
index e97a6104ff0..2d0351a5e05 100644
--- a/tmva/inc/TMVA/CCTreeWrapper.h
+++ b/tmva/inc/TMVA/CCTreeWrapper.h
@@ -107,10 +107,10 @@ namespace TMVA {
          inline CCTreeNode* GetMother( ) { return dynamic_cast<CCTreeNode*>(GetParent()); }
 
          // printout of the node (can be read in with ReadDataRecord)
-         virtual void Print( ostream& os ) const;
+         virtual void Print( std::ostream& os ) const;
 
          // recursive printout of the node and its daughters 
-         virtual void PrintRec ( ostream& os ) const;
+         virtual void PrintRec ( std::ostream& os ) const;
 
          virtual void AddAttributesToNode(void* node) const;
          virtual void AddContentToNode(std::stringstream& s) const;
diff --git a/tmva/inc/TMVA/Configurable.h b/tmva/inc/TMVA/Configurable.h
index 53c963d8635..71fa4639791 100644
--- a/tmva/inc/TMVA/Configurable.h
+++ b/tmva/inc/TMVA/Configurable.h
@@ -87,7 +87,7 @@ namespace TMVA {
       void SetOptions(const TString& s) { fOptions = s; }
 
       void WriteOptionsToStream ( std::ostream& o, const TString& prefix ) const;
-      void ReadOptionsFromStream( istream& istr );
+      void ReadOptionsFromStream( std::istream& istr );
 
       void AddOptionsXMLTo( void* parent ) const;
       void ReadOptionsFromXML( void* node );
diff --git a/tmva/inc/TMVA/DataSet.h b/tmva/inc/TMVA/DataSet.h
index 534a642e892..fcb2976d7d5 100644
--- a/tmva/inc/TMVA/DataSet.h
+++ b/tmva/inc/TMVA/DataSet.h
@@ -162,7 +162,7 @@ namespace TMVA {
       mutable Long64_t           fCurrentEventIdx;
 
       // event sampling
-      std::vector<Char_t>        fSampling;                    // random or importance sampling (not all events are taken) !! Bool_t are stored ( no vector<bool> taken for speed (performance) issues )
+      std::vector<Char_t>        fSampling;                    // random or importance sampling (not all events are taken) !! Bool_t are stored ( no std::vector<bool> taken for speed (performance) issues )
       std::vector<Int_t>         fSamplingNEvents;            // number of events which should be sampled
       std::vector<Float_t>       fSamplingWeight;              // weight change factor [weight is indicating if sampling is random (1.0) or importance (<1.0)] 
       mutable std::vector< std::vector< std::pair< Float_t, Long64_t >* > > fSamplingEventList;  // weights and indices for sampling
@@ -181,7 +181,7 @@ namespace TMVA {
       std::vector<Char_t>        fBlockBelongToTraining;       // when dividing the dataset to blocks, sets whether 
                                                                // the certain block is in the Training set or else 
                                                                // in the validation set 
-                                                               // boolean are stored, taken vector<Char_t> for performance reasons (instead of vector<Bool_t>)
+                                                               // boolean are stored, taken std::vector<Char_t> for performance reasons (instead of std::vector<Bool_t>)
       Long64_t                   fTrainingBlockSize;           // block size into which the training dataset is divided
 
       void  ApplyTrainingBlockDivision();
diff --git a/tmva/inc/TMVA/DecisionTreeNode.h b/tmva/inc/TMVA/DecisionTreeNode.h
index 1eed1b99da8..568d23706ca 100644
--- a/tmva/inc/TMVA/DecisionTreeNode.h
+++ b/tmva/inc/TMVA/DecisionTreeNode.h
@@ -244,10 +244,10 @@ namespace TMVA {
       Float_t GetSeparationGain( void ) const  { return fTrainInfo->fSeparationGain; }
 
       // printout of the node
-      virtual void Print( ostream& os ) const;
+      virtual void Print( std::ostream& os ) const;
 
       // recursively print the node and its daughters (--> print the 'tree')
-      virtual void PrintRec( ostream&  os ) const;
+      virtual void PrintRec( std::ostream&  os ) const;
 
       virtual void AddAttributesToNode(void* node) const;
       virtual void AddContentToNode(std::stringstream& s) const;
@@ -315,8 +315,8 @@ namespace TMVA {
       // flag indicates whether this node is terminal
       inline Bool_t IsTerminal() const            { return fIsTerminalNode; }
       inline void SetTerminal( Bool_t s = kTRUE ) { fIsTerminalNode = s;    }
-      void PrintPrune( ostream& os ) const ;
-      void PrintRecPrune( ostream& os ) const;
+      void PrintPrune( std::ostream& os ) const ;
+      void PrintRecPrune( std::ostream& os ) const;
 
       void     SetCC(Double_t cc);
       Double_t GetCC() const {return (fTrainInfo? fTrainInfo->fCC : -1.);}
@@ -350,7 +350,7 @@ namespace TMVA {
    private:
 
       virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
-      virtual Bool_t ReadDataRecord( istream& is, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
+      virtual Bool_t ReadDataRecord( std::istream& is, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
       virtual void ReadContent(std::stringstream& s);
 
       ClassDef(DecisionTreeNode,0) // Node for the Decision Tree 
diff --git a/tmva/inc/TMVA/GeneticPopulation.h b/tmva/inc/TMVA/GeneticPopulation.h
index 5f4da238482..9d60224c0f2 100644
--- a/tmva/inc/TMVA/GeneticPopulation.h
+++ b/tmva/inc/TMVA/GeneticPopulation.h
@@ -79,7 +79,7 @@ namespace TMVA {
       std::vector<TMVA::GeneticRange*>& GetRanges()   { return fRanges; }
 
       void Print( Int_t untilIndex = -1 );
-      void Print( ostream & out, Int_t utilIndex = -1 );
+      void Print( std::ostream & out, Int_t utilIndex = -1 );
 
       TH1F* VariableDistribution( Int_t varNumber, Int_t bins, Int_t min, Int_t max  );
       std::vector< Double_t > VariableDistribution( Int_t varNumber );
diff --git a/tmva/inc/TMVA/MethodANNBase.h b/tmva/inc/TMVA/MethodANNBase.h
index b0fd992dfe3..3043f51fcbd 100644
--- a/tmva/inc/TMVA/MethodANNBase.h
+++ b/tmva/inc/TMVA/MethodANNBase.h
@@ -118,7 +118,7 @@ namespace TMVA {
       void ReadWeightsFromXML( void* wghtnode );
 
       // read weights from file
-      virtual void ReadWeightsFromStream( istream& istr );
+      virtual void ReadWeightsFromStream( std::istream& istr );
       
       // calculate the MVA value
       virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
diff --git a/tmva/inc/TMVA/MethodBDT.h b/tmva/inc/TMVA/MethodBDT.h
index fa9594507c2..8cf4a7f9948 100644
--- a/tmva/inc/TMVA/MethodBDT.h
+++ b/tmva/inc/TMVA/MethodBDT.h
@@ -100,7 +100,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML(void* parent);
 
       // write method specific histos to target file
diff --git a/tmva/inc/TMVA/MethodBayesClassifier.h b/tmva/inc/TMVA/MethodBayesClassifier.h
index e252c0b5904..7f98c1e6b17 100644
--- a/tmva/inc/TMVA/MethodBayesClassifier.h
+++ b/tmva/inc/TMVA/MethodBayesClassifier.h
@@ -72,7 +72,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML   ( void* /*wghtnode*/ ) {}
 
       // calculate the MVA value
diff --git a/tmva/inc/TMVA/MethodCFMlpANN.h b/tmva/inc/TMVA/MethodCFMlpANN.h
index 01958146ee6..be3811fc289 100644
--- a/tmva/inc/TMVA/MethodCFMlpANN.h
+++ b/tmva/inc/TMVA/MethodCFMlpANN.h
@@ -126,7 +126,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML( void* wghtnode );
       // calculate the MVA value
       Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
diff --git a/tmva/inc/TMVA/MethodCommittee.h b/tmva/inc/TMVA/MethodCommittee.h
index f591e1901a5..f7fae695095 100644
--- a/tmva/inc/TMVA/MethodCommittee.h
+++ b/tmva/inc/TMVA/MethodCommittee.h
@@ -84,7 +84,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML   ( void* /*wghtnode*/ ) {}
 
       // write method specific histos to target file
diff --git a/tmva/inc/TMVA/MethodCompositeBase.h b/tmva/inc/TMVA/MethodCompositeBase.h
index c12427f2fe7..50aa1db1e2e 100644
--- a/tmva/inc/TMVA/MethodCompositeBase.h
+++ b/tmva/inc/TMVA/MethodCompositeBase.h
@@ -77,7 +77,7 @@ namespace TMVA {
       using MethodBase::GetMvaValue;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
 
       // performs classifier training
       virtual void Train() = 0;
diff --git a/tmva/inc/TMVA/MethodDT.h b/tmva/inc/TMVA/MethodDT.h
index 4482d765707..f433b685991 100644
--- a/tmva/inc/TMVA/MethodDT.h
+++ b/tmva/inc/TMVA/MethodDT.h
@@ -82,7 +82,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML   ( void* wghtnode );
 
       // calculate the MVA value
diff --git a/tmva/inc/TMVA/MethodHMatrix.h b/tmva/inc/TMVA/MethodHMatrix.h
index 7f25284236b..c066efb34c4 100644
--- a/tmva/inc/TMVA/MethodHMatrix.h
+++ b/tmva/inc/TMVA/MethodHMatrix.h
@@ -86,7 +86,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML( void* wghtnode );
       // calculate the MVA value
       Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
diff --git a/tmva/inc/TMVA/MethodLikelihood.h b/tmva/inc/TMVA/MethodLikelihood.h
index decb1a4129a..470c80189a4 100644
--- a/tmva/inc/TMVA/MethodLikelihood.h
+++ b/tmva/inc/TMVA/MethodLikelihood.h
@@ -88,7 +88,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromStream( TFile& istr );
       void ReadWeightsFromXML( void* wghtnode );
       // calculate the MVA value
@@ -101,7 +101,7 @@ namespace TMVA {
       // ranking of input variables
       const Ranking* CreateRanking();
 
-      virtual void WriteOptionsToStream ( ostream& o, const TString& prefix ) const;
+      virtual void WriteOptionsToStream ( std::ostream& o, const TString& prefix ) const;
 
    protected:
 
diff --git a/tmva/inc/TMVA/MethodPDERS.h b/tmva/inc/TMVA/MethodPDERS.h
index ec7731eeff5..3ae5d497451 100644
--- a/tmva/inc/TMVA/MethodPDERS.h
+++ b/tmva/inc/TMVA/MethodPDERS.h
@@ -91,7 +91,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromStream( TFile& istr );
       void ReadWeightsFromXML( void* wghtnode );
 
diff --git a/tmva/inc/TMVA/MethodRuleFit.h b/tmva/inc/TMVA/MethodRuleFit.h
index 052df6dae28..56a2897bd57 100644
--- a/tmva/inc/TMVA/MethodRuleFit.h
+++ b/tmva/inc/TMVA/MethodRuleFit.h
@@ -81,7 +81,7 @@ namespace TMVA {
       void AddWeightsXMLTo     ( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML   ( void* wghtnode );
 
       // calculate the MVA value
diff --git a/tmva/inc/TMVA/MethodTMlpANN.h b/tmva/inc/TMVA/MethodTMlpANN.h
index 4aa7454dca9..7418aac47cb 100644
--- a/tmva/inc/TMVA/MethodTMlpANN.h
+++ b/tmva/inc/TMVA/MethodTMlpANN.h
@@ -75,7 +75,7 @@ namespace TMVA {
       void AddWeightsXMLTo( void* parent ) const;
 
       // read weights from file
-      void ReadWeightsFromStream( istream& istr );
+      void ReadWeightsFromStream( std::istream& istr );
       void ReadWeightsFromXML(void* wghtnode);
 
       // calculate the MVA value ...
diff --git a/tmva/inc/TMVA/Option.h b/tmva/inc/TMVA/Option.h
index 25b7c18e2c9..702619b37bb 100644
--- a/tmva/inc/TMVA/Option.h
+++ b/tmva/inc/TMVA/Option.h
@@ -80,7 +80,7 @@ namespace TMVA {
       virtual Bool_t SetValue( const TString& vs, Int_t i=-1 );
 
       using TObject::Print;
-      virtual void Print( ostream&, Int_t levelofdetail=0 ) const = 0;
+      virtual void Print( std::ostream&, Int_t levelofdetail=0 ) const = 0;
 
    private:
 
@@ -120,8 +120,8 @@ namespace TMVA {
       // setters
       virtual void AddPreDefVal(const T&);
       using OptionBase::Print;
-      virtual void Print       ( ostream&, Int_t levelofdetail=0 ) const;
-      virtual void PrintPreDefs( ostream&, Int_t levelofdetail=0 ) const;
+      virtual void Print       ( std::ostream&, Int_t levelofdetail=0 ) const;
+      virtual void PrintPreDefs( std::ostream&, Int_t levelofdetail=0 ) const;
 
    protected:
 
@@ -153,7 +153,7 @@ namespace TMVA {
       virtual Int_t  GetArraySize() const { return fSize; }
    
       using Option<T>::Print;
-      virtual void Print( ostream&, Int_t levelofdetail=0 ) const;
+      virtual void Print( std::ostream&, Int_t levelofdetail=0 ) const;
 
       virtual Bool_t SetValue( const TString& val, Int_t i=0 );
 
@@ -262,7 +262,7 @@ namespace TMVA {
    }
 
    template<class T>
-   inline void TMVA::Option<T>::Print( ostream& os, Int_t levelofdetail ) const 
+   inline void TMVA::Option<T>::Print( std::ostream& os, Int_t levelofdetail ) const 
    {
       // template specialization for TString printing
       os << TheName() << ": " << "\"" << GetValue() << "\"" << " [" << Description() << "]";
@@ -270,7 +270,7 @@ namespace TMVA {
    }
 
    template<class T>
-   inline void TMVA::Option<T*>::Print( ostream& os, Int_t levelofdetail ) const 
+   inline void TMVA::Option<T*>::Print( std::ostream& os, Int_t levelofdetail ) const 
    {
       // template specialization for TString printing
       for (Int_t i=0; i<fSize; i++) {
@@ -285,7 +285,7 @@ namespace TMVA {
 
    //______________________________________________________________________
    template<class T>
-   inline void TMVA::Option<T>::PrintPreDefs( ostream& os, Int_t levelofdetail ) const 
+   inline void TMVA::Option<T>::PrintPreDefs( std::ostream& os, Int_t levelofdetail ) const 
    {
       // template specialization for TString printing
       if (HasPreDefinedVal() && levelofdetail>0) {
diff --git a/tmva/inc/TMVA/PDF.h b/tmva/inc/TMVA/PDF.h
index be6dff09c62..f64bf39258c 100644
--- a/tmva/inc/TMVA/PDF.h
+++ b/tmva/inc/TMVA/PDF.h
@@ -62,13 +62,13 @@ namespace TMVA {
    class MsgLogger;
 
    class PDF;
-   ostream& operator<< ( ostream& os, const PDF& tree );
-   istream& operator>> ( istream& istr, PDF& tree);
+   std::ostream& operator<< ( std::ostream& os, const PDF& tree );
+   std::istream& operator>> ( std::istream& istr, PDF& tree);
 
    class PDF : public Configurable {
 
-      friend ostream& operator<< ( ostream& os, const PDF& tree );
-      friend istream& operator>> ( istream& istr, PDF& tree);
+      friend std::ostream& operator<< ( std::ostream& os, const PDF& tree );
+      friend std::istream& operator>> ( std::istream& istr, PDF& tree);
       
    public:
 
@@ -123,7 +123,7 @@ namespace TMVA {
       void   SetReadingVersion( UInt_t rv ) { fReadingVersion = rv; }      
       UInt_t GetReadingVersion() const { return fReadingVersion; }
 
-      //void WriteOptionsToStream ( ostream& o, const TString& prefix ) const;
+      //void WriteOptionsToStream ( std::ostream& o, const TString& prefix ) const;
       void ProcessOptions();
 
       // reads from and option string the definitions for pdf returns it
diff --git a/tmva/inc/TMVA/Rule.h b/tmva/inc/TMVA/Rule.h
index 82685db2604..89e8ffb9d89 100644
--- a/tmva/inc/TMVA/Rule.h
+++ b/tmva/inc/TMVA/Rule.h
@@ -51,12 +51,12 @@ namespace TMVA {
    class MsgLogger;
    class Rule;
 
-   ostream& operator<<( ostream& os, const Rule & rule );
+   std::ostream& operator<<( std::ostream& os, const Rule & rule );
 
    class Rule {
 
       // ouput operator for a Rule
-      friend ostream& operator<< ( ostream& os, const Rule & rule );
+      friend std::ostream& operator<< ( std::ostream& os, const Rule & rule );
 
    public:
 
@@ -155,10 +155,10 @@ namespace TMVA {
       void PrintLogger( const char *title=0 ) const;
 
       // print just the raw info, used for weight file generation
-      void  PrintRaw   ( ostream& os  ) const; // obsolete
+      void  PrintRaw   ( std::ostream& os  ) const; // obsolete
       void* AddXMLTo   ( void* parent ) const;
 
-      void  ReadRaw    ( istream& os    ); // obsolete
+      void  ReadRaw    ( std::istream& os    ); // obsolete
       void  ReadFromXML( void* wghtnode );
 
    private:
@@ -167,7 +167,7 @@ namespace TMVA {
       void SetSigma(Double_t v)         { fSigma=v; }
 
       // print info about the Rule
-      void Print( ostream& os ) const;
+      void Print( std::ostream& os ) const;
 
       // copy from another rule
       void Copy( const Rule & other );
diff --git a/tmva/inc/TMVA/RuleEnsemble.h b/tmva/inc/TMVA/RuleEnsemble.h
index ccc038208c0..6498a0af920 100644
--- a/tmva/inc/TMVA/RuleEnsemble.h
+++ b/tmva/inc/TMVA/RuleEnsemble.h
@@ -63,12 +63,12 @@ namespace TMVA {
    class RuleEnsemble;
    class MsgLogger;
 
-   ostream& operator<<( ostream& os, const RuleEnsemble& event );
+   std::ostream& operator<<( std::ostream& os, const RuleEnsemble& event );
 
    class RuleEnsemble {
 
       // output operator for a RuleEnsemble
-      friend ostream& operator<< ( ostream& os, const RuleEnsemble& rules );
+      friend std::ostream& operator<< ( std::ostream& os, const RuleEnsemble& rules );
       
    public:
 
@@ -320,11 +320,11 @@ namespace TMVA {
       void  Print() const;
 
       // print the model in a cryptic way
-      void  PrintRaw   ( ostream& os  ) const; // obsolete
+      void  PrintRaw   ( std::ostream& os  ) const; // obsolete
       void* AddXMLTo   ( void* parent ) const;
    
       // read the model from input stream
-      void  ReadRaw    ( istream& istr ); // obsolete
+      void  ReadRaw    ( std::istream& istr ); // obsolete
       void  ReadFromXML( void* wghtnode ); 
 
 
diff --git a/tmva/inc/TMVA/RuleFitAPI.h b/tmva/inc/TMVA/RuleFitAPI.h
index ab2b39ba9e9..aa2d7c48373 100644
--- a/tmva/inc/TMVA/RuleFitAPI.h
+++ b/tmva/inc/TMVA/RuleFitAPI.h
@@ -133,10 +133,10 @@ namespace TMVA {
       inline Bool_t  OpenRFile(TString name, std::ifstream & f);
 
       // read/write binary files
-      inline Bool_t WriteInt(ofstream &   f, const Int_t   *v, Int_t n=1);
-      inline Bool_t WriteFloat(ofstream & f, const Float_t *v, Int_t n=1);
-      inline Int_t  ReadInt(ifstream & f,   Int_t *v, Int_t n=1) const;
-      inline Int_t  ReadFloat(ifstream & f, Float_t *v, Int_t n=1) const;
+      inline Bool_t WriteInt(std::ofstream &   f, const Int_t   *v, Int_t n=1);
+      inline Bool_t WriteFloat(std::ofstream & f, const Float_t *v, Int_t n=1);
+      inline Int_t  ReadInt(std::ifstream & f,   Int_t *v, Int_t n=1) const;
+      inline Int_t  ReadFloat(std::ifstream & f, Float_t *v, Int_t n=1) const;
 
       // write rf_go.exe i/o files
       Bool_t WriteAll();
@@ -261,7 +261,7 @@ Bool_t TMVA::RuleFitAPI::OpenRFile(TString name, std::ifstream & f)
 }
 
 //_______________________________________________________________________
-Bool_t TMVA::RuleFitAPI::WriteInt(ofstream &   f, const Int_t   *v, Int_t n)
+Bool_t TMVA::RuleFitAPI::WriteInt(std::ofstream &   f, const Int_t   *v, Int_t n)
 {
    // write an int
    if (!f.is_open()) return kFALSE;
@@ -269,7 +269,7 @@ Bool_t TMVA::RuleFitAPI::WriteInt(ofstream &   f, const Int_t   *v, Int_t n)
 }
 
 //_______________________________________________________________________
-Bool_t TMVA::RuleFitAPI::WriteFloat(ofstream & f, const Float_t *v, Int_t n)
+Bool_t TMVA::RuleFitAPI::WriteFloat(std::ofstream & f, const Float_t *v, Int_t n)
 {
    // write a float
    if (!f.is_open()) return kFALSE;
@@ -277,7 +277,7 @@ Bool_t TMVA::RuleFitAPI::WriteFloat(ofstream & f, const Float_t *v, Int_t n)
 }
 
 //_______________________________________________________________________
-Int_t TMVA::RuleFitAPI::ReadInt(ifstream & f,   Int_t *v, Int_t n) const
+Int_t TMVA::RuleFitAPI::ReadInt(std::ifstream & f,   Int_t *v, Int_t n) const
 {
    // read an int
    if (!f.is_open()) return 0;
@@ -286,7 +286,7 @@ Int_t TMVA::RuleFitAPI::ReadInt(ifstream & f,   Int_t *v, Int_t n) const
 }
 
 //_______________________________________________________________________
-Int_t TMVA::RuleFitAPI::ReadFloat(ifstream & f, Float_t *v, Int_t n) const
+Int_t TMVA::RuleFitAPI::ReadFloat(std::ifstream & f, Float_t *v, Int_t n) const
 {
    // read a float
    if (!f.is_open()) return 0;
diff --git a/tmva/inc/TMVA/Tools.h b/tmva/inc/TMVA/Tools.h
index 6a44e33c35e..860055ca679 100644
--- a/tmva/inc/TMVA/Tools.h
+++ b/tmva/inc/TMVA/Tools.h
@@ -174,8 +174,8 @@ namespace TMVA {
       void FormattedOutput( const TMatrixD&, const std::vector<TString>& vert, const std::vector<TString>& horiz, 
                             MsgLogger& logger );
 
-      void WriteFloatArbitraryPrecision( Float_t  val, ostream& os );
-      void ReadFloatArbitraryPrecision ( Float_t& val, istream& is );
+      void WriteFloatArbitraryPrecision( Float_t  val, std::ostream& os );
+      void ReadFloatArbitraryPrecision ( Float_t& val, std::istream& is );
 
       // for histogramming
       TString GetXTitleWithUnit( const TString& title, const TString& unit );
diff --git a/tmva/inc/TMVA/VariableDecorrTransform.h b/tmva/inc/TMVA/VariableDecorrTransform.h
index c7bebe3b684..556402b2100 100644
--- a/tmva/inc/TMVA/VariableDecorrTransform.h
+++ b/tmva/inc/TMVA/VariableDecorrTransform.h
@@ -70,7 +70,7 @@ namespace TMVA {
       virtual void AttachXMLTo(void* parent);
       virtual void ReadFromXML( void* trfnode );
 
-      virtual void PrintTransformation( ostream & o );
+      virtual void PrintTransformation( std::ostream & o );
 
       // writer of function code
       virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
diff --git a/tmva/inc/TMVA/VariableGaussTransform.h b/tmva/inc/TMVA/VariableGaussTransform.h
index 2c70a561c58..73fd11f97e8 100644
--- a/tmva/inc/TMVA/VariableGaussTransform.h
+++ b/tmva/inc/TMVA/VariableGaussTransform.h
@@ -102,7 +102,7 @@ namespace TMVA {
       virtual void AttachXMLTo(void* parent);
       virtual void ReadFromXML( void* trfnode );
 
-      virtual void PrintTransformation( ostream & o );
+      virtual void PrintTransformation( std::ostream & o );
 
       // writer of function code
       virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
diff --git a/tmva/inc/TMVA/VariableNormalizeTransform.h b/tmva/inc/TMVA/VariableNormalizeTransform.h
index ea0d6eb42d7..0eab347e734 100644
--- a/tmva/inc/TMVA/VariableNormalizeTransform.h
+++ b/tmva/inc/TMVA/VariableNormalizeTransform.h
@@ -69,7 +69,7 @@ namespace TMVA {
       virtual void AttachXMLTo(void* parent);
       virtual void ReadFromXML( void* trfnode );
 
-      virtual void PrintTransformation( ostream & o );
+      virtual void PrintTransformation( std::ostream & o );
 
       // writer of function code
       virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
diff --git a/tmva/inc/TMVA/VariableRearrangeTransform.h b/tmva/inc/TMVA/VariableRearrangeTransform.h
index 12b65d8bf76..139dc02ecbf 100644
--- a/tmva/inc/TMVA/VariableRearrangeTransform.h
+++ b/tmva/inc/TMVA/VariableRearrangeTransform.h
@@ -61,7 +61,7 @@ namespace TMVA {
       virtual void AttachXMLTo(void* parent);
       virtual void ReadFromXML( void* trfnode );
 
-      virtual void PrintTransformation( ostream & o );
+      virtual void PrintTransformation( std::ostream & o );
 
       // writer of function code
       virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
diff --git a/tmva/inc/TMVA/VariableTransformBase.h b/tmva/inc/TMVA/VariableTransformBase.h
index 8c5c0fc00f5..6205d63beca 100644
--- a/tmva/inc/TMVA/VariableTransformBase.h
+++ b/tmva/inc/TMVA/VariableTransformBase.h
@@ -118,7 +118,7 @@ namespace TMVA {
 
       // provides string vector giving explicit transformation
       virtual std::vector<TString>* GetTransformationStrings( Int_t cls ) const;
-      virtual void PrintTransformation( ostream & ) {}
+      virtual void PrintTransformation( std::ostream & ) {}
 
       const std::vector<TMVA::VariableInfo>& Variables() const { return fVariables; }
       const std::vector<TMVA::VariableInfo>& Targets()   const { return fTargets;   }
diff --git a/tmva/src/BinarySearchTree.cxx b/tmva/src/BinarySearchTree.cxx
index 5c831dcc109..4078fa9524c 100644
--- a/tmva/src/BinarySearchTree.cxx
+++ b/tmva/src/BinarySearchTree.cxx
@@ -332,13 +332,13 @@ void TMVA::BinarySearchTree::NormalizeTree ( std::vector< std::pair<Double_t, co
 
    Insert( mid->second );
 
-   //    Print(cout);
-   //    cout << endl << endl;
+   //    Print(std::cout);
+   //    std::cout << std::endl << std::endl;
 
    NormalizeTree( leftBound, mid, actDim+1 );
    mid++;
-   //    Print(cout);
-   //    cout << endl << endl;
+   //    Print(std::cout);
+   //    std::cout << std::endl << std::endl;
    NormalizeTree( mid, rightBound, actDim+1 );
 
 
diff --git a/tmva/src/BinarySearchTreeNode.cxx b/tmva/src/BinarySearchTreeNode.cxx
index 18a64180336..8070dd9249c 100644
--- a/tmva/src/BinarySearchTreeNode.cxx
+++ b/tmva/src/BinarySearchTreeNode.cxx
@@ -135,7 +135,7 @@ Bool_t TMVA::BinarySearchTreeNode::EqualsMe(const TMVA::Event& e) const
 }
 
 //_______________________________________________________________________
-void TMVA::BinarySearchTreeNode::Print( ostream& os ) const
+void TMVA::BinarySearchTreeNode::Print( std::ostream& os ) const
 {
    // print the node
    os << "< ***  " << std::endl << " node.Data: ";
@@ -155,7 +155,7 @@ void TMVA::BinarySearchTreeNode::Print( ostream& os ) const
 }
 
 //_______________________________________________________________________
-void TMVA::BinarySearchTreeNode::PrintRec( ostream& os ) const
+void TMVA::BinarySearchTreeNode::PrintRec( std::ostream& os ) const
 {
    // recursively print the node and its daughters (--> print the 'tree')
    os << this->GetDepth() << " " << this->GetPos() << " " << this->GetSelector()
@@ -171,7 +171,7 @@ void TMVA::BinarySearchTreeNode::PrintRec( ostream& os ) const
 }
 
 //_______________________________________________________________________
-Bool_t TMVA::BinarySearchTreeNode::ReadDataRecord( istream& is, UInt_t /* Tmva_Version_Code */  ) 
+Bool_t TMVA::BinarySearchTreeNode::ReadDataRecord( std::istream& is, UInt_t /* Tmva_Version_Code */  ) 
 {
    // Read the data block
    Int_t       itmp;
diff --git a/tmva/src/BinaryTree.cxx b/tmva/src/BinaryTree.cxx
index f48df664ad2..4b3b7d2d5e2 100644
--- a/tmva/src/BinaryTree.cxx
+++ b/tmva/src/BinaryTree.cxx
@@ -115,7 +115,7 @@ UInt_t TMVA::BinaryTree::CountNodes(TMVA::Node *n)
 }
 
 //_______________________________________________________________________
-void TMVA::BinaryTree::Print(ostream & os) const
+void TMVA::BinaryTree::Print(std::ostream & os) const
 {
    // recursively print the tree
    this->GetRoot()->PrintRec(os);
@@ -147,7 +147,7 @@ void TMVA::BinaryTree::ReadXML(void* node, UInt_t tmva_Version_Code ) {
 
 
 //_______________________________________________________________________
-ostream& TMVA::operator<< (ostream& os, const TMVA::BinaryTree& tree)
+std::ostream& TMVA::operator<< (std::ostream& os, const TMVA::BinaryTree& tree)
 {
    // print the tree recursinvely using the << operator
    tree.Print(os);
@@ -155,7 +155,7 @@ ostream& TMVA::operator<< (ostream& os, const TMVA::BinaryTree& tree)
 }
 
 //_______________________________________________________________________
-void TMVA::BinaryTree::Read(istream & istr, UInt_t tmva_Version_Code )
+void TMVA::BinaryTree::Read(std::istream & istr, UInt_t tmva_Version_Code )
 {
    // Read the binary tree from an input stream.
    // The input stream format depends on the tree type,
@@ -192,9 +192,9 @@ void TMVA::BinaryTree::Read(istream & istr, UInt_t tmva_Version_Code )
 }
 
 //_______________________________________________________________________
-istream& TMVA::operator>> (istream& istr, TMVA::BinaryTree& tree)
+std::istream& TMVA::operator>> (std::istream& istr, TMVA::BinaryTree& tree)
 { 
-   // read the tree from an istream
+   // read the tree from an std::istream
    tree.Read(istr);
    return istr;
 }
diff --git a/tmva/src/CCPruner.cxx b/tmva/src/CCPruner.cxx
index 4a857a00b17..fa196afb056 100644
--- a/tmva/src/CCPruner.cxx
+++ b/tmva/src/CCPruner.cxx
@@ -98,7 +98,7 @@ void CCPruner::Optimize( )
    Double_t epsilon = std::numeric_limits<double>::epsilon();
    Double_t alpha = -1.0e10;
 
-   ofstream outfile;
+   std::ofstream outfile;
    if (fDebug) outfile.open("costcomplexity.log");
    if(!HaveStopCondition && (fValidationSample == NULL && fValidationDataSet == NULL) ) {
       if (fDebug) outfile << "ERROR: no validation sample, so cannot optimize pruning!" << std::endl;
diff --git a/tmva/src/CCTreeWrapper.cxx b/tmva/src/CCTreeWrapper.cxx
index c712a03bdf2..530ff6a4e48 100644
--- a/tmva/src/CCTreeWrapper.cxx
+++ b/tmva/src/CCTreeWrapper.cxx
@@ -69,7 +69,7 @@ Bool_t TMVA::CCTreeWrapper::CCTreeNode::ReadDataRecord( std::istream& in, UInt_t
 }
 
 //_______________________________________________________________________
-void TMVA::CCTreeWrapper::CCTreeNode::Print( ostream& os ) const {
+void TMVA::CCTreeWrapper::CCTreeNode::Print( std::ostream& os ) const {
    // printout of the node (can be read in with ReadDataRecord)
 
    os << "----------------------" << std::endl 
@@ -81,7 +81,7 @@ void TMVA::CCTreeWrapper::CCTreeNode::Print( ostream& os ) const {
 }
 
 //_______________________________________________________________________
-void TMVA::CCTreeWrapper::CCTreeNode::PrintRec( ostream& os ) const {
+void TMVA::CCTreeWrapper::CCTreeNode::PrintRec( std::ostream& os ) const {
    // recursive printout of the node and its daughters 
 
    this->Print(os);
diff --git a/tmva/src/Configurable.cxx b/tmva/src/Configurable.cxx
index 81b59e017ff..97240b7fa26 100644
--- a/tmva/src/Configurable.cxx
+++ b/tmva/src/Configurable.cxx
@@ -315,7 +315,7 @@ void TMVA::Configurable::PrintOptions() const
 }
 
 //______________________________________________________________________
-void TMVA::Configurable::WriteOptionsToStream( ostream& o, const TString& prefix ) const 
+void TMVA::Configurable::WriteOptionsToStream( std::ostream& o, const TString& prefix ) const 
 {
    // write options to output stream (e.g. in writing the MVA weight files
 
@@ -415,7 +415,7 @@ void TMVA::Configurable::WriteOptionsReferenceToFile()
 }
 
 //______________________________________________________________________
-void TMVA::Configurable::ReadOptionsFromStream(istream& istr)
+void TMVA::Configurable::ReadOptionsFromStream(std::istream& istr)
 {
    // read option back from the weight file
 
diff --git a/tmva/src/DataInputHandler.cxx b/tmva/src/DataInputHandler.cxx
index 384ed942516..69fe115206b 100644
--- a/tmva/src/DataInputHandler.cxx
+++ b/tmva/src/DataInputHandler.cxx
@@ -134,7 +134,7 @@ TTree* TMVA::DataInputHandler::ReadInputTree( const TString& dataFile )
    // create trees from these ascii files
    TTree* tr = new TTree( "tmp", dataFile );
   
-   ifstream in(dataFile);
+   std::ifstream in(dataFile);
    if (!in.good()) Log() << kFATAL << "Could not open file: " << dataFile << Endl;
    in.close();
 
diff --git a/tmva/src/DecisionTree.cxx b/tmva/src/DecisionTree.cxx
index 64dad92dff7..8919d060fe6 100644
--- a/tmva/src/DecisionTree.cxx
+++ b/tmva/src/DecisionTree.cxx
@@ -264,7 +264,7 @@ TMVA::DecisionTree* TMVA::DecisionTree::CreateFromXML(void* node, UInt_t tmva_Ve
 
 
 //_______________________________________________________________________
-UInt_t TMVA::DecisionTree::BuildTree( const vector<TMVA::Event*> & eventSample,
+UInt_t TMVA::DecisionTree::BuildTree( const std::vector<TMVA::Event*> & eventSample,
                                       TMVA::DecisionTreeNode *node)
 {
    // building the decision tree by recursively calling the splitting of
@@ -392,8 +392,8 @@ UInt_t TMVA::DecisionTree::BuildTree( const vector<TMVA::Event*> & eventSample,
 
       } else {
 
-         vector<TMVA::Event*> leftSample; leftSample.reserve(nevents);
-         vector<TMVA::Event*> rightSample; rightSample.reserve(nevents);
+         std::vector<TMVA::Event*> leftSample; leftSample.reserve(nevents);
+         std::vector<TMVA::Event*> rightSample; rightSample.reserve(nevents);
 
          Double_t nRight=0, nLeft=0;
 
@@ -514,7 +514,7 @@ UInt_t TMVA::DecisionTree::BuildTree( const vector<TMVA::Event*> & eventSample,
 }
 
 //_______________________________________________________________________
-void TMVA::DecisionTree::FillTree( vector<TMVA::Event*> & eventSample )
+void TMVA::DecisionTree::FillTree( std::vector<TMVA::Event*> & eventSample )
   
 {
    // fill the existing the decision tree structure by filling event
@@ -599,7 +599,7 @@ UInt_t TMVA::DecisionTree::CleanTree( DecisionTreeNode *node )
 }
 
 //_______________________________________________________________________
-Double_t TMVA::DecisionTree::PruneTree( vector<Event*>* validationSample )
+Double_t TMVA::DecisionTree::PruneTree( std::vector<Event*>* validationSample )
 {
    // prune (get rid of internal nodes) the Decision tree to avoid overtraining
    // serveral different pruning methods can be applied as selected by the 
@@ -909,7 +909,7 @@ void TMVA::DecisionTree::GetRandomisedVariables(Bool_t *useVariable, UInt_t *map
 }
 
 //_______________________________________________________________________
-Double_t TMVA::DecisionTree::TrainNodeFast( const vector<TMVA::Event*> & eventSample,
+Double_t TMVA::DecisionTree::TrainNodeFast( const std::vector<TMVA::Event*> & eventSample,
                                            TMVA::DecisionTreeNode *node )
 {
    // Decide how to split a node using one of the variables that gives
@@ -936,7 +936,7 @@ Double_t TMVA::DecisionTree::TrainNodeFast( const vector<TMVA::Event*> & eventSa
 
    // the +1 comes from the fact that I treat later on the Fisher output as an 
    // additional possible variable.
-   Bool_t *useVariable = new Bool_t[fNvars+1];   // for performance reasons instead of vector<Bool_t> useVariable(fNvars);
+   Bool_t *useVariable = new Bool_t[fNvars+1];   // for performance reasons instead of std::vector<Bool_t> useVariable(fNvars);
    UInt_t *mapVariable = new UInt_t[fNvars+1];    // map the subset of variables used in randomised trees to the original variable number (used in the Event() ) 
 
    std::vector<Double_t> fisherCoeff;
@@ -958,7 +958,7 @@ Double_t TMVA::DecisionTree::TrainNodeFast( const vector<TMVA::Event*> & eventSa
 
       //use for the Fisher discriminant ONLY those variables that show
       //some reasonable linear correlation in either Signal or Background
-      Bool_t *useVarInFisher = new Bool_t[fNvars];   // for performance reasons instead of vector<Bool_t> useVariable(fNvars);
+      Bool_t *useVarInFisher = new Bool_t[fNvars];   // for performance reasons instead of std::vector<Bool_t> useVariable(fNvars);
       UInt_t *mapVarInFisher = new UInt_t[fNvars];   // map the subset of variables used in randomised trees to the original variable number (used in the Event() ) 
       for (UInt_t ivar=0; ivar < fNvars; ivar++) {
          useVarInFisher[ivar] = kFALSE;
@@ -1469,7 +1469,7 @@ std::vector<Double_t>  TMVA::DecisionTree::GetFisherCoefficients(const EventList
 }
 
 //_______________________________________________________________________
-Double_t TMVA::DecisionTree::TrainNodeFull( const vector<TMVA::Event*> & eventSample,
+Double_t TMVA::DecisionTree::TrainNodeFull( const std::vector<TMVA::Event*> & eventSample,
                                            TMVA::DecisionTreeNode *node )
 {
   
@@ -1479,17 +1479,17 @@ Double_t TMVA::DecisionTree::TrainNodeFull( const vector<TMVA::Event*> & eventSa
    Double_t nTotS = 0.0, nTotB = 0.0;
    Int_t nTotS_unWeighted = 0, nTotB_unWeighted = 0;  
   
-   vector<TMVA::BDTEventWrapper> bdtEventSample;
+   std::vector<TMVA::BDTEventWrapper> bdtEventSample;
   
    // List of optimal cuts, separation gains, and cut types (removed background or signal) - one for each variable
-   vector<Double_t> lCutValue( fNvars, 0.0 );
-   vector<Double_t> lSepGain( fNvars, -1.0e6 );
-   vector<Char_t> lCutType( fNvars ); // <----- bool is stored (for performance reasons, no vector<bool>  has been taken)
+   std::vector<Double_t> lCutValue( fNvars, 0.0 );
+   std::vector<Double_t> lSepGain( fNvars, -1.0e6 );
+   std::vector<Char_t> lCutType( fNvars ); // <----- bool is stored (for performance reasons, no std::vector<bool>  has been taken)
    lCutType.assign( fNvars, Char_t(kFALSE) );
   
    // Initialize (un)weighted counters for signal & background
    // Construct a list of event wrappers that point to the original data
-   for( vector<TMVA::Event*>::const_iterator it = eventSample.begin(); it != eventSample.end(); ++it ) {
+   for( std::vector<TMVA::Event*>::const_iterator it = eventSample.begin(); it != eventSample.end(); ++it ) {
       if((*it)->GetClass() == fSigClass) { // signal or background event
          nTotS += (*it)->GetWeight();
          ++nTotS_unWeighted;
@@ -1501,7 +1501,7 @@ Double_t TMVA::DecisionTree::TrainNodeFull( const vector<TMVA::Event*> & eventSa
       bdtEventSample.push_back(TMVA::BDTEventWrapper(*it));
    }
   
-   vector<Char_t> useVariable(fNvars); // <----- bool is stored (for performance reasons, no vector<bool>  has been taken)
+   std::vector<Char_t> useVariable(fNvars); // <----- bool is stored (for performance reasons, no std::vector<bool>  has been taken)
    useVariable.assign( fNvars, Char_t(kTRUE) );
 
    for (UInt_t ivar=0; ivar < fNvars; ivar++) useVariable[ivar]=Char_t(kFALSE);
@@ -1530,7 +1530,7 @@ Double_t TMVA::DecisionTree::TrainNodeFull( const vector<TMVA::Event*> & eventSa
       std::sort( bdtEventSample.begin(),bdtEventSample.end() ); // sort the event data 
     
       Double_t bkgWeightCtr = 0.0, sigWeightCtr = 0.0;
-      vector<TMVA::BDTEventWrapper>::iterator it = bdtEventSample.begin(), it_end = bdtEventSample.end();
+      std::vector<TMVA::BDTEventWrapper>::iterator it = bdtEventSample.begin(), it_end = bdtEventSample.end();
       for( ; it != it_end; ++it ) {
          if((**it)->GetClass() == fSigClass ) // specify signal or background event
             sigWeightCtr += (**it)->GetWeight();
@@ -1647,7 +1647,7 @@ Double_t TMVA::DecisionTree::CheckEvent( const TMVA::Event & e, Bool_t UseYesNoL
 }
 
 //_______________________________________________________________________
-Double_t  TMVA::DecisionTree::SamplePurity( vector<TMVA::Event*> eventSample )
+Double_t  TMVA::DecisionTree::SamplePurity( std::vector<TMVA::Event*> eventSample )
 {
    // calculates the purity S/(S+B) of a given event sample
   
@@ -1674,7 +1674,7 @@ vector< Double_t >  TMVA::DecisionTree::GetVariableImportance()
    // evaluated as the total separation-gain that this variable had in
    // the decision trees (weighted by the number of events)
   
-   vector<Double_t> relativeImportance(fNvars);
+   std::vector<Double_t> relativeImportance(fNvars);
    Double_t  sum=0;
    for (UInt_t i=0; i< fNvars; i++) {
       sum += fVariableImportance[i];
@@ -1695,7 +1695,7 @@ Double_t  TMVA::DecisionTree::GetVariableImportance( UInt_t ivar )
 {
    // returns the relative improtance of variable ivar
   
-   vector<Double_t> relativeImportance = this->GetVariableImportance();
+   std::vector<Double_t> relativeImportance = this->GetVariableImportance();
    if (ivar < fNvars) return relativeImportance[ivar];
    else {
       Log() << kFATAL << "<GetVariableImportance>" << Endl
diff --git a/tmva/src/DecisionTreeNode.cxx b/tmva/src/DecisionTreeNode.cxx
index 8575f92a535..5c7747ce1e6 100644
--- a/tmva/src/DecisionTreeNode.cxx
+++ b/tmva/src/DecisionTreeNode.cxx
@@ -195,7 +195,7 @@ void TMVA::DecisionTreeNode::SetPurity( void )
 
 // print a node
 //_______________________________________________________________________
-void TMVA::DecisionTreeNode::Print(ostream& os) const
+void TMVA::DecisionTreeNode::Print(std::ostream& os) const
 {
    //print the node
    os << "< ***  "  << std::endl;
@@ -226,7 +226,7 @@ void TMVA::DecisionTreeNode::Print(ostream& os) const
 }
 
 //_______________________________________________________________________
-void TMVA::DecisionTreeNode::PrintRec(ostream& os) const
+void TMVA::DecisionTreeNode::PrintRec(std::ostream& os) const
 {
    //recursively print the node and its daughters (--> print the 'tree')
 
@@ -257,7 +257,7 @@ void TMVA::DecisionTreeNode::PrintRec(ostream& os) const
 }
 
 //_______________________________________________________________________
-Bool_t TMVA::DecisionTreeNode::ReadDataRecord( istream& is, UInt_t tmva_Version_Code )
+Bool_t TMVA::DecisionTreeNode::ReadDataRecord( std::istream& is, UInt_t tmva_Version_Code )
 {
    // Read the data block
 
@@ -363,7 +363,7 @@ void TMVA::DecisionTreeNode::ResetValidationData( ) {
 }
 
 //_______________________________________________________________________
-void TMVA::DecisionTreeNode::PrintPrune( ostream& os ) const {
+void TMVA::DecisionTreeNode::PrintPrune( std::ostream& os ) const {
    // printout of the node (can be read in with ReadDataRecord)
 
    os << "----------------------" << std::endl
@@ -375,7 +375,7 @@ void TMVA::DecisionTreeNode::PrintPrune( ostream& os ) const {
 }
 
 //_______________________________________________________________________
-void TMVA::DecisionTreeNode::PrintRecPrune( ostream& os ) const {
+void TMVA::DecisionTreeNode::PrintRecPrune( std::ostream& os ) const {
    // recursive printout of the node and its daughters
 
    this->PrintPrune(os);
diff --git a/tmva/src/Event.cxx b/tmva/src/Event.cxx
index addf596711c..b766224dfed 100644
--- a/tmva/src/Event.cxx
+++ b/tmva/src/Event.cxx
@@ -295,7 +295,7 @@ void TMVA::Event::SetSpectator( UInt_t ivar, Float_t value )
 }
 
 //_______________________________________________________________________
-ostream& TMVA::operator << ( ostream& os, const TMVA::Event& event )
+std::ostream& TMVA::operator << ( std::ostream& os, const TMVA::Event& event )
 { 
    // Outputs the data of an event
    os << "Variables [" << event.fValues.size() << "]:";
diff --git a/tmva/src/GeneticAlgorithm.cxx b/tmva/src/GeneticAlgorithm.cxx
index 789ba613613..72c64e9a6e3 100644
--- a/tmva/src/GeneticAlgorithm.cxx
+++ b/tmva/src/GeneticAlgorithm.cxx
@@ -68,7 +68,7 @@ TMVA::GeneticAlgorithm::GeneticAlgorithm( IFitterTarget& target, Int_t populatio
    // Parameters: 
    //     int populationSize : defines the number of "Individuals" which are created and tested 
    //                          within one Generation (Iteration of the Evolution)
-   //     vector<TMVA::Interval*> ranges : Interval holds the information of an interval, where the GetMin 
+   //     std::vector<TMVA::Interval*> ranges : Interval holds the information of an interval, where the GetMin 
    //                          gets the low and GetMax gets the high constraint of the variable
    //                          the size of "ranges" is the number of coefficients which are optimised
    // Purpose: 
diff --git a/tmva/src/MethodANNBase.cxx b/tmva/src/MethodANNBase.cxx
index b11aec893bf..a5982e85b8c 100644
--- a/tmva/src/MethodANNBase.cxx
+++ b/tmva/src/MethodANNBase.cxx
@@ -60,6 +60,7 @@
 #include "TMVA/Ranking.h"
 
 using std::vector;
+using std::stringstream;
 
 ClassImp(TMVA::MethodANNBase)
 
@@ -124,7 +125,7 @@ void TMVA::MethodANNBase::DeclareOptions()
 
 
    TActivationChooser aChooser;
-   vector<TString>* names = aChooser.GetAllActivationNames();
+   std::vector<TString>* names = aChooser.GetAllActivationNames();
    Int_t nTypes = names->size();
    for (Int_t i = 0; i < nTypes; i++)
       AddPreDefVal(names->at(i));
@@ -146,17 +147,17 @@ void TMVA::MethodANNBase::ProcessOptions()
    if      ( DoRegression() || DoMulticlass())  fEstimatorS = "MSE";    //zjh
    if      (fEstimatorS == "MSE" )  fEstimator = kMSE;   
    else if (fEstimatorS == "CE")    fEstimator = kCE;      //zjh
-   vector<Int_t>* layout = ParseLayoutString(fLayerSpec);
+   std::vector<Int_t>* layout = ParseLayoutString(fLayerSpec);
    BuildNetwork(layout);
    delete layout;
 }
 
 //______________________________________________________________________________
-vector<Int_t>* TMVA::MethodANNBase::ParseLayoutString(TString layerSpec)
+std::vector<Int_t>* TMVA::MethodANNBase::ParseLayoutString(TString layerSpec)
 {
    // parse layout specification string and return a vector, each entry
    // containing the number of neurons to go in each successive layer
-   vector<Int_t>* layout = new vector<Int_t>();
+   std::vector<Int_t>* layout = new std::vector<Int_t>();
    layout->push_back((Int_t)GetNvar());
    while(layerSpec.Length()>0) {
       TString sToAdd="";
@@ -268,7 +269,7 @@ void TMVA::MethodANNBase::DeleteNetworkLayer( TObjArray*& layer )
 }
 
 //______________________________________________________________________________
-void TMVA::MethodANNBase::BuildNetwork( vector<Int_t>* layout, vector<Double_t>* weights, Bool_t fromFile )
+void TMVA::MethodANNBase::BuildNetwork( std::vector<Int_t>* layout, std::vector<Double_t>* weights, Bool_t fromFile )
 {
    // build network given a layout (number of neurons in each layer)
    // and optional weights array
@@ -310,7 +311,7 @@ void TMVA::MethodANNBase::BuildNetwork( vector<Int_t>* layout, vector<Double_t>*
 }
 
 //______________________________________________________________________________
-void TMVA::MethodANNBase::BuildLayers( vector<Int_t>* layout, Bool_t fromFile )
+void TMVA::MethodANNBase::BuildLayers( std::vector<Int_t>* layout, Bool_t fromFile )
 {
    // build the network layers
 
@@ -432,7 +433,7 @@ void TMVA::MethodANNBase::InitWeights()
 }
 
 //_______________________________________________________________________
-void TMVA::MethodANNBase::ForceWeights(vector<Double_t>* weights)
+void TMVA::MethodANNBase::ForceWeights(std::vector<Double_t>* weights)
 {
    // force the synapse weights
    PrintMessage("Forcing weights");
@@ -498,9 +499,9 @@ void TMVA::MethodANNBase::PrintMessage(TString message, Bool_t force) const
 void TMVA::MethodANNBase::WaitForKeyboard()
 {
    // wait for keyboard input, for debugging
-   string dummy;
+   std::string dummy;
    Log() << kINFO << "***Type anything to continue (q to quit): ";
-   getline(cin, dummy);
+   std::getline(std::cin, dummy);
    if (dummy == "q" || dummy == "Q") {
       PrintMessage( "quit" );
       delete this;
@@ -741,7 +742,7 @@ void TMVA::MethodANNBase::ReadWeightsFromXML( void* wghtnode )
 
    // build the layout first
    Bool_t fromFile = kTRUE;
-   vector<Int_t>* layout = new vector<Int_t>();
+   std::vector<Int_t>* layout = new std::vector<Int_t>();
 
    void* xmlLayout = NULL;
    xmlLayout = gTools().GetChild(wghtnode, "Layout");
@@ -780,7 +781,7 @@ void TMVA::MethodANNBase::ReadWeightsFromXML( void* wghtnode )
          gTools().ReadAttr( nodeN, "NSynapses", nSyn );
          if( nSyn > 0 ){
             const char* content = gTools().GetContent(nodeN);
-            std::stringstream s(content);
+            stringstream s(content);
             for (UInt_t iSyn = 0; iSyn<nSyn; iSyn++) { // synapses
 
                TSynapse* synapse = neuron->PostLinkAt(iSyn);
@@ -829,7 +830,7 @@ void TMVA::MethodANNBase::ReadWeightsFromXML( void* wghtnode )
 
       const char* content = gTools().xmlengine().GetNodeContent(xmlRow);
 
-      std::stringstream s(content);
+      stringstream s(content);
       for (Int_t iCol = 0; iCol<nCols; iCol++) { // columns
 	 s >> (*(elements+index));
 	 ++index;
@@ -845,7 +846,7 @@ void TMVA::MethodANNBase::ReadWeightsFromXML( void* wghtnode )
 
 
 //_______________________________________________________________________
-void TMVA::MethodANNBase::ReadWeightsFromStream( istream & istr)
+void TMVA::MethodANNBase::ReadWeightsFromStream( std::istream & istr)
 {
    // destroy/clear the network then read it back in from the weights file
 
@@ -855,7 +856,7 @@ void TMVA::MethodANNBase::ReadWeightsFromStream( istream & istr)
 
    // synapse weights
    Double_t weight;
-   vector<Double_t>* weights = new vector<Double_t>();
+   std::vector<Double_t>* weights = new std::vector<Double_t>();
    istr>> dummy;
    while (istr>> dummy >> weight) weights->push_back(weight); // use w/ slower write-out
 
@@ -988,38 +989,38 @@ void TMVA::MethodANNBase::MakeClassSpecific( std::ostream& fout, const TString&
    // write specific classifier response
    Int_t numLayers = fNetwork->GetEntries();
 
-   fout << endl;
-   fout << "   double ActivationFnc(double x) const;" << endl;
-   fout << "   double OutputActivationFnc(double x) const;" << endl;     //zjh
-   fout << endl;
-   fout << "   int fLayers;" << endl;
-   fout << "   int fLayerSize["<<numLayers<<"];" << endl;
+   fout << std::endl;
+   fout << "   double ActivationFnc(double x) const;" << std::endl;
+   fout << "   double OutputActivationFnc(double x) const;" << std::endl;     //zjh
+   fout << std::endl;
+   fout << "   int fLayers;" << std::endl;
+   fout << "   int fLayerSize["<<numLayers<<"];" << std::endl;
    int numNodesFrom = -1;
    for (Int_t lIdx = 0; lIdx < numLayers; lIdx++) {
       int numNodesTo = ((TObjArray*)fNetwork->At(lIdx))->GetEntries();
       if (numNodesFrom<0) { numNodesFrom=numNodesTo; continue; }
       fout << "   double fWeightMatrix" << lIdx-1  << "to" << lIdx << "[" << numNodesTo << "][" << numNodesFrom << "];";
-      fout << "   // weight matrix from layer " << lIdx-1  << " to " << lIdx << endl;
+      fout << "   // weight matrix from layer " << lIdx-1  << " to " << lIdx << std::endl;
       numNodesFrom = numNodesTo;
    }
-   fout << endl;
-   fout << "   double * fWeights["<<numLayers<<"];" << endl;
-   fout << "};" << endl;
+   fout << std::endl;
+   fout << "   double * fWeights["<<numLayers<<"];" << std::endl;
+   fout << "};" << std::endl;
 
-   fout << endl;
+   fout << std::endl;
 
-   fout << "inline void " << className << "::Initialize()" << endl;
-   fout << "{" << endl;
-   fout << "   // build network structure" << endl;
-   fout << "   fLayers = " << numLayers << ";" << endl;
+   fout << "inline void " << className << "::Initialize()" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // build network structure" << std::endl;
+   fout << "   fLayers = " << numLayers << ";" << std::endl;
    for (Int_t lIdx = 0; lIdx < numLayers; lIdx++) {
       TObjArray* layer = (TObjArray*)fNetwork->At(lIdx);
       int numNodes = layer->GetEntries();
-      fout << "   fLayerSize[" << lIdx << "] = " << numNodes << "; fWeights["<<lIdx<<"] = new double["<<numNodes<<"]; " << endl;
+      fout << "   fLayerSize[" << lIdx << "] = " << numNodes << "; fWeights["<<lIdx<<"] = new double["<<numNodes<<"]; " << std::endl;
    }
 
    for (Int_t i = 0; i < numLayers-1; i++) {
-      fout << "   // weight matrix from layer " << i  << " to " << i+1 << endl;
+      fout << "   // weight matrix from layer " << i  << " to " << i+1 << std::endl;
       TObjArray* layer = (TObjArray*)fNetwork->At(i);
       Int_t numNeurons = layer->GetEntriesFast();
       for (Int_t j = 0; j < numNeurons; j++) {
@@ -1027,73 +1028,73 @@ void TMVA::MethodANNBase::MakeClassSpecific( std::ostream& fout, const TString&
          Int_t numSynapses = neuron->NumPostLinks();
          for (Int_t k = 0; k < numSynapses; k++) {
             TSynapse* synapse = neuron->PostLinkAt(k);
-            fout << "   fWeightMatrix" << i  << "to" << i+1 << "[" << k << "][" << j << "] = " << synapse->GetWeight() << ";" << endl;
+            fout << "   fWeightMatrix" << i  << "to" << i+1 << "[" << k << "][" << j << "] = " << synapse->GetWeight() << ";" << std::endl;
          }
       }
    }
 
-   fout << "}" << endl;
-   fout << endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
 
    // writing of the GetMvaValue__ method
-   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   if (inputValues.size() != (unsigned int)fLayerSize[0]-1) {" << endl;
-   fout << "      std::cout << \"Input vector needs to be of size \" << fLayerSize[0]-1 << std::endl;" << endl;
-   fout << "      return 0;" << endl;
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   for (int l=0; l<fLayers; l++)" << endl;
-   fout << "      for (int i=0; i<fLayerSize[l]; i++) fWeights[l][i]=0;" << endl;
-   fout << endl;
-   fout << "   for (int l=0; l<fLayers-1; l++)" << endl;
-   fout << "      fWeights[l][fLayerSize[l]-1]=1;" << endl;
-   fout << endl;
-   fout << "   for (int i=0; i<fLayerSize[0]-1; i++)" << endl;
-   fout << "      fWeights[0][i]=inputValues[i];" << endl;
-   fout << endl;
+   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   if (inputValues.size() != (unsigned int)fLayerSize[0]-1) {" << std::endl;
+   fout << "      std::cout << \"Input vector needs to be of size \" << fLayerSize[0]-1 << std::endl;" << std::endl;
+   fout << "      return 0;" << std::endl;
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   for (int l=0; l<fLayers; l++)" << std::endl;
+   fout << "      for (int i=0; i<fLayerSize[l]; i++) fWeights[l][i]=0;" << std::endl;
+   fout << std::endl;
+   fout << "   for (int l=0; l<fLayers-1; l++)" << std::endl;
+   fout << "      fWeights[l][fLayerSize[l]-1]=1;" << std::endl;
+   fout << std::endl;
+   fout << "   for (int i=0; i<fLayerSize[0]-1; i++)" << std::endl;
+   fout << "      fWeights[0][i]=inputValues[i];" << std::endl;
+   fout << std::endl;
    for (Int_t i = 0; i < numLayers-1; i++) {
-      fout << "   // layer " << i << " to " << i+1 << endl;
+      fout << "   // layer " << i << " to " << i+1 << std::endl;
       if (i+1 == numLayers-1) {
-         fout << "   for (int o=0; o<fLayerSize[" << i+1 << "]; o++) {" << endl;
+         fout << "   for (int o=0; o<fLayerSize[" << i+1 << "]; o++) {" << std::endl;
       } 
       else {
-         fout << "   for (int o=0; o<fLayerSize[" << i+1 << "]-1; o++) {" << endl;
+         fout << "   for (int o=0; o<fLayerSize[" << i+1 << "]-1; o++) {" << std::endl;
       }
-      fout << "      for (int i=0; i<fLayerSize[" << i << "]; i++) {" << endl;
-      fout << "         double inputVal = fWeightMatrix" << i << "to" << i+1 << "[o][i] * fWeights[" << i << "][i];" << endl;
+      fout << "      for (int i=0; i<fLayerSize[" << i << "]; i++) {" << std::endl;
+      fout << "         double inputVal = fWeightMatrix" << i << "to" << i+1 << "[o][i] * fWeights[" << i << "][i];" << std::endl;
 
       if ( fNeuronInputType == "sum") {
-         fout << "         fWeights[" << i+1 << "][o] += inputVal;" << endl;
+         fout << "         fWeights[" << i+1 << "][o] += inputVal;" << std::endl;
       } 
       else if ( fNeuronInputType == "sqsum") {
-         fout << "         fWeights[" << i+1 << "][o] += inputVal*inputVal;" << endl;
+         fout << "         fWeights[" << i+1 << "][o] += inputVal*inputVal;" << std::endl;
       } 
       else { // fNeuronInputType == TNeuronInputChooser::kAbsSum
-         fout << "         fWeights[" << i+1 << "][o] += fabs(inputVal);" << endl;
+         fout << "         fWeights[" << i+1 << "][o] += fabs(inputVal);" << std::endl;
       }
-      fout << "      }" << endl;
+      fout << "      }" << std::endl;
       if (i+1 != numLayers-1) // in the last layer no activation function is applied
-         fout << "      fWeights[" << i+1 << "][o] = ActivationFnc(fWeights[" << i+1 << "][o]);" << endl;
-      else	fout << "      fWeights[" << i+1 << "][o] = OutputActivationFnc(fWeights[" << i+1 << "][o]);" << endl; //zjh
-      fout << "   }" << endl;
+         fout << "      fWeights[" << i+1 << "][o] = ActivationFnc(fWeights[" << i+1 << "][o]);" << std::endl;
+      else	fout << "      fWeights[" << i+1 << "][o] = OutputActivationFnc(fWeights[" << i+1 << "][o]);" << std::endl; //zjh
+      fout << "   }" << std::endl;
    }
-   fout << endl;
-   fout << "   return fWeights[" << numLayers-1 << "][0];" << endl;   
-   fout << "}" << endl;
+   fout << std::endl;
+   fout << "   return fWeights[" << numLayers-1 << "][0];" << std::endl;   
+   fout << "}" << std::endl;
 
-   fout << endl;
+   fout << std::endl;
    TString fncName = className+"::ActivationFnc";
    fActivation->MakeFunction(fout, fncName);
    fncName = className+"::OutputActivationFnc";  	//zjh
    fOutput->MakeFunction(fout, fncName); 			//zjh
 
-   fout << "   " << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // nothing to clear" << endl;
-   fout << "}" << endl;
+   fout << "   " << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // nothing to clear" << std::endl;
+   fout << "}" << std::endl;
 }
 
 //_________________________________________________________________________
diff --git a/tmva/src/MethodBDT.cxx b/tmva/src/MethodBDT.cxx
index 84147ef2010..65fce006bf4 100644
--- a/tmva/src/MethodBDT.cxx
+++ b/tmva/src/MethodBDT.cxx
@@ -134,6 +134,7 @@
 #include "TMVA/PDF.h"
 
 using std::vector;
+using std::make_pair;
 
 REGISTER_METHOD(BDT)
 
@@ -1102,13 +1103,13 @@ Double_t TMVA::MethodBDT::GetGradBoostMVA(TMVA::Event& e, UInt_t nTrees)
 }
 
 //_______________________________________________________________________
-void TMVA::MethodBDT::UpdateTargets(vector<TMVA::Event*> eventSample, UInt_t cls)
+void TMVA::MethodBDT::UpdateTargets(std::vector<TMVA::Event*> eventSample, UInt_t cls)
 {
    //Calculate residua for all events;
 
    if(DoMulticlass()){
       UInt_t nClasses = DataInfo().GetNClasses();
-      for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+      for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
          fResiduals[*e].at(cls)+=fForest.back()->CheckEvent(*(*e),kFALSE);
          if(cls == nClasses-1){
             for(UInt_t i=0;i<nClasses;i++){
@@ -1125,7 +1126,7 @@ void TMVA::MethodBDT::UpdateTargets(vector<TMVA::Event*> eventSample, UInt_t cls
       }
    }
    else{
-      for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+      for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
          fResiduals[*e].at(0)+=fForest.back()->CheckEvent(*(*e),kFALSE);
          Double_t p_sig=1.0/(1.0+exp(-2.0*fResiduals[*e].at(0)));
          Double_t res = (DataInfo().IsSignal(*e)?1:0)-p_sig;
@@ -1135,10 +1136,10 @@ void TMVA::MethodBDT::UpdateTargets(vector<TMVA::Event*> eventSample, UInt_t cls
 }
 
 //_______________________________________________________________________
-void TMVA::MethodBDT::UpdateTargetsRegression(vector<TMVA::Event*> eventSample, Bool_t first)
+void TMVA::MethodBDT::UpdateTargetsRegression(std::vector<TMVA::Event*> eventSample, Bool_t first)
 {
    //Calculate current residuals for all events and update targets for next iteration
-   for (vector<TMVA::Event*>::iterator e=fEventSample.begin(); e!=fEventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=fEventSample.begin(); e!=fEventSample.end();e++) {
       if(!first){
          fWeightedResiduals[*e].first -= fForest.back()->CheckEvent(*(*e),kFALSE);
       }
@@ -1146,15 +1147,15 @@ void TMVA::MethodBDT::UpdateTargetsRegression(vector<TMVA::Event*> eventSample,
    }
    
    fSumOfWeights = 0;
-   vector< pair<Double_t, Double_t> > temp;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++){
+   vector< std::pair<Double_t, Double_t> > temp;
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++){
       temp.push_back(make_pair(fabs(fWeightedResiduals[*e].first),fWeightedResiduals[*e].second));
       fSumOfWeights += (*e)->GetWeight();
    }
    fTransitionPoint = GetWeightedQuantile(temp,0.7,fSumOfWeights);
 
    Int_t i=0;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
  
       if(temp[i].first<=fTransitionPoint)
          (*e)->SetTarget(0,fWeightedResiduals[*e].first);
@@ -1165,7 +1166,7 @@ void TMVA::MethodBDT::UpdateTargetsRegression(vector<TMVA::Event*> eventSample,
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::GetWeightedQuantile(vector<  pair<Double_t, Double_t> > vec, const Double_t quantile, const Double_t norm){
+Double_t TMVA::MethodBDT::GetWeightedQuantile(vector<  std::pair<Double_t, Double_t> > vec, const Double_t quantile, const Double_t norm){
    //calculates the quantile of the distribution of the first pair entries weighted with the values in the second pair entries
    Double_t temp = 0.0;
    std::sort(vec.begin(), vec.end());
@@ -1179,11 +1180,11 @@ Double_t TMVA::MethodBDT::GetWeightedQuantile(vector<  pair<Double_t, Double_t>
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::GradBoost( vector<TMVA::Event*> eventSample, DecisionTree *dt, UInt_t cls)
+Double_t TMVA::MethodBDT::GradBoost( std::vector<TMVA::Event*> eventSample, DecisionTree *dt, UInt_t cls)
 {
    //Calculate the desired response value for each region
-   std::map<TMVA::DecisionTreeNode*,vector<Double_t> > leaves;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   std::map<TMVA::DecisionTreeNode*,std::vector<Double_t> > leaves;
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       Double_t weight = (*e)->GetWeight();
       TMVA::DecisionTreeNode* node = dt->GetEventNode(*(*e));
       if ((leaves[node]).empty()){
@@ -1195,7 +1196,7 @@ Double_t TMVA::MethodBDT::GradBoost( vector<TMVA::Event*> eventSample, DecisionT
          (leaves[node])[1]+=fabs((*e)->GetTarget(cls))*(1.0-fabs((*e)->GetTarget(cls))) * weight* weight;
       }
    }
-   for (std::map<TMVA::DecisionTreeNode*,vector<Double_t> >::iterator iLeave=leaves.begin();
+   for (std::map<TMVA::DecisionTreeNode*,std::vector<Double_t> >::iterator iLeave=leaves.begin();
         iLeave!=leaves.end();++iLeave){
       if ((iLeave->second)[1]<1e-30) (iLeave->second)[1]=1e-30;
 
@@ -1211,20 +1212,20 @@ Double_t TMVA::MethodBDT::GradBoost( vector<TMVA::Event*> eventSample, DecisionT
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::GradBoostRegression( vector<TMVA::Event*> eventSample, DecisionTree *dt )
+Double_t TMVA::MethodBDT::GradBoostRegression( std::vector<TMVA::Event*> eventSample, DecisionTree *dt )
 {
    // Implementation of M_TreeBoost using a Huber loss function as desribed by Friedman 1999
    std::map<TMVA::DecisionTreeNode*,Double_t > leaveWeights;
-   std::map<TMVA::DecisionTreeNode*,vector< pair<Double_t, Double_t> > > leaves;
+   std::map<TMVA::DecisionTreeNode*,vector< std::pair<Double_t, Double_t> > > leaves;
    UInt_t i =0;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       TMVA::DecisionTreeNode* node = dt->GetEventNode(*(*e));      
       (leaves[node]).push_back(make_pair(fWeightedResiduals[*e].first,(*e)->GetWeight()));
       (leaveWeights[node]) += (*e)->GetWeight();
       i++;
    }
 
-   for (std::map<TMVA::DecisionTreeNode*,vector< pair<Double_t, Double_t> > >::iterator iLeave=leaves.begin();
+   for (std::map<TMVA::DecisionTreeNode*,vector< std::pair<Double_t, Double_t> > >::iterator iLeave=leaves.begin();
         iLeave!=leaves.end();++iLeave){
       Double_t shift=0,diff= 0;
       Double_t ResidualMedian = GetWeightedQuantile(iLeave->second,0.5,leaveWeights[iLeave->first]);
@@ -1245,14 +1246,14 @@ Double_t TMVA::MethodBDT::GradBoostRegression( vector<TMVA::Event*> eventSample,
 }
 
 //_______________________________________________________________________
-void TMVA::MethodBDT::InitGradBoost( vector<TMVA::Event*> eventSample)
+void TMVA::MethodBDT::InitGradBoost( std::vector<TMVA::Event*> eventSample)
 {
    // initialize targets for first tree
    fSumOfWeights = 0;
    fSepType=NULL; //set fSepType to NULL (regression trees are used for both classification an regression)
    std::vector<std::pair<Double_t, Double_t> > temp;
    if(DoRegression()){
-      for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+      for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
          fWeightedResiduals[*e]= make_pair((*e)->GetTarget(0), (*e)->GetWeight());
          fSumOfWeights+=(*e)->GetWeight();
          temp.push_back(make_pair(fWeightedResiduals[*e].first,fWeightedResiduals[*e].second));
@@ -1276,7 +1277,7 @@ void TMVA::MethodBDT::InitGradBoost( vector<TMVA::Event*> eventSample)
    }
    else if(DoMulticlass()){
       UInt_t nClasses = DataInfo().GetNClasses();
-      for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+      for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
          for (UInt_t i=0;i<nClasses;i++){
             //Calculate initial residua, assuming equal probability for all classes
             Double_t r = (*e)->GetClass()==i?(1-1.0/nClasses):(-1.0/nClasses);
@@ -1286,7 +1287,7 @@ void TMVA::MethodBDT::InitGradBoost( vector<TMVA::Event*> eventSample)
       }
    }
    else{
-      for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+      for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
          Double_t r = (DataInfo().IsSignal(*e)?1:0)-0.5; //Calculate initial residua
          (*e)->SetTarget(0,r);
          fResiduals[*e].push_back(0);         
@@ -1315,7 +1316,7 @@ Double_t TMVA::MethodBDT::TestTreeQuality( DecisionTree *dt )
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::Boost( vector<TMVA::Event*> eventSample, DecisionTree *dt, Int_t iTree, UInt_t cls )
+Double_t TMVA::MethodBDT::Boost( std::vector<TMVA::Event*> eventSample, DecisionTree *dt, Int_t iTree, UInt_t cls )
 {
    // apply the boosting alogrithim (the algorithm is selecte via the the "option" given
    // in the constructor. The return value is the boosting weight
@@ -1391,7 +1392,7 @@ void TMVA::MethodBDT::BoostMonitor(Int_t iTree)
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTree *dt )
+Double_t TMVA::MethodBDT::AdaBoost( std::vector<TMVA::Event*> eventSample, DecisionTree *dt )
 {
    // the AdaBoost implementation.
    // a new training sample is generated by weighting
@@ -1405,12 +1406,12 @@ Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTr
 
    Double_t err=0, sumGlobalw=0, sumGlobalwfalse=0, sumGlobalwfalse2=0;
 
-   vector<Double_t> sumw; //for individually re-scaling  each class
-   map<Node*,Int_t> sigEventsInNode; // how many signal events of the training tree
+   std::vector<Double_t> sumw; //for individually re-scaling  each class
+   std::map<Node*,Int_t> sigEventsInNode; // how many signal events of the training tree
 
    UInt_t maxCls = sumw.size();
    Double_t maxDev=0;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       Double_t w = (*e)->GetWeight();
       sumGlobalw += w;
       UInt_t iclass=(*e)->GetClass();
@@ -1444,7 +1445,7 @@ Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTr
       }
       else if (fAdaBoostR2Loss=="exponential"){
          err = 0;
-         for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+         for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
             Double_t w = (*e)->GetWeight();
             Double_t  tmpDev = TMath::Abs(dt->CheckEvent(*(*e),kFALSE) - (*e)->GetTarget(0) ); 
             err += w * (1 - exp (-tmpDev/maxDev)) / sumGlobalw;
@@ -1462,7 +1463,7 @@ Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTr
 
 
    Double_t newSumGlobalw=0;
-   vector<Double_t> newSumw(sumw.size(),0);
+   std::vector<Double_t> newSumw(sumw.size(),0);
 
    Double_t boostWeight=1.;
    if (err >= 0.5) { // sanity check ... should never happen as otherwise there is apparently
@@ -1499,7 +1500,7 @@ Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTr
    Results* results = Data()->GetResults(GetMethodName(),Types::kTraining, Types::kMaxAnalysisType);
 
 
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
  
       if ((!( (dt->CheckEvent(*(*e),fUseYesNoLeaf) > fNodePurityLimit ) == DataInfo().IsSignal(*e))) || DoRegression()) {
          Double_t boostfactor = boostWeight;
@@ -1519,13 +1520,13 @@ Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTr
 
    // re-normalise the weights (independent for Signal and Background)
    Double_t globalNormWeight=sumGlobalw/newSumGlobalw;
-   vector<Double_t>  normWeightByClass;
+   std::vector<Double_t>  normWeightByClass;
    for (UInt_t i=0; i<sumw.size(); i++) normWeightByClass.push_back(sumw[i]/newSumw[i]);
 
    Log() << kDEBUG << "new Nsig="<<newSumw[0]*globalNormWeight << " new Nbkg="<<newSumw[1]*globalNormWeight << Endl;
 
 
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       if (fRenormByClass) (*e)->ScaleBoostWeight( normWeightByClass[(*e)->GetClass()] );
       else                (*e)->ScaleBoostWeight( globalNormWeight );
    }
@@ -1545,7 +1546,7 @@ Double_t TMVA::MethodBDT::AdaBoost( vector<TMVA::Event*> eventSample, DecisionTr
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::Bagging( vector<TMVA::Event*> eventSample, Int_t iTree )
+Double_t TMVA::MethodBDT::Bagging( std::vector<TMVA::Event*> eventSample, Int_t iTree )
 {
    // call it boot-strapping, re-sampling or whatever you like, in the end it is nothing
    // else but applying "random" weights to each event.
@@ -1553,13 +1554,13 @@ Double_t TMVA::MethodBDT::Bagging( vector<TMVA::Event*> eventSample, Int_t iTree
    Double_t newWeight;
    TRandom3 *trandom   = new TRandom3(iTree);
    Double_t eventFraction = fUseNTrainEvents/Data()->GetNTrainingEvents();
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       newWeight = trandom->PoissonD(eventFraction);
       (*e)->SetBoostWeight(newWeight);
       newSumw+=(*e)->GetBoostWeight();
    }
    Double_t normWeight =  eventSample.size() / newSumw ;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       (*e)->SetBoostWeight( (*e)->GetBoostWeight() * normWeight );
       // change this backwards      (*e)->ScaleBoostWeight( normWeight );
    }
@@ -1568,7 +1569,7 @@ Double_t TMVA::MethodBDT::Bagging( vector<TMVA::Event*> eventSample, Int_t iTree
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::RegBoost( vector<TMVA::Event*> /* eventSample */, DecisionTree* /* dt */ )
+Double_t TMVA::MethodBDT::RegBoost( std::vector<TMVA::Event*> /* eventSample */, DecisionTree* /* dt */ )
 {
    // a special boosting only for Regression ...
    // maybe I'll implement it later...
@@ -1577,7 +1578,7 @@ Double_t TMVA::MethodBDT::RegBoost( vector<TMVA::Event*> /* eventSample */, Deci
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodBDT::AdaBoostR2( vector<TMVA::Event*> eventSample, DecisionTree *dt )
+Double_t TMVA::MethodBDT::AdaBoostR2( std::vector<TMVA::Event*> eventSample, DecisionTree *dt )
 {
    // adaption of the AdaBoost to regression problems (see H.Drucker 1997)
 
@@ -1585,7 +1586,7 @@ Double_t TMVA::MethodBDT::AdaBoostR2( vector<TMVA::Event*> eventSample, Decision
 
    Double_t err=0, sumw=0, sumwfalse=0, sumwfalse2=0;
    Double_t maxDev=0;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       Double_t w = (*e)->GetWeight();
       sumw += w;
 
@@ -1604,7 +1605,7 @@ Double_t TMVA::MethodBDT::AdaBoostR2( vector<TMVA::Event*> eventSample, Decision
    }
    else if (fAdaBoostR2Loss=="exponential"){
       err = 0;
-      for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+      for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
          Double_t w = (*e)->GetWeight();
          Double_t  tmpDev = TMath::Abs(dt->CheckEvent(*(*e),kFALSE) - (*e)->GetTarget(0) ); 
          err += w * (1 - exp (-tmpDev/maxDev)) / sumw;
@@ -1648,10 +1649,10 @@ Double_t TMVA::MethodBDT::AdaBoostR2( vector<TMVA::Event*> eventSample, Decision
 
    Results* results = Data()->GetResults(GetMethodName(), Types::kTraining, Types::kMaxAnalysisType);
 
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       Double_t boostfactor =  TMath::Power(boostWeight,(1.-TMath::Abs(dt->CheckEvent(*(*e),kFALSE) - (*e)->GetTarget(0) )/maxDev ) );
       results->GetHist("BoostWeights")->Fill(boostfactor);
-      //      cout << "R2  " << boostfactor << "   " << boostWeight << "   " << (1.-TMath::Abs(dt->CheckEvent(*(*e),kFALSE) - (*e)->GetTarget(0) )/maxDev)  << endl;
+      //      std::cout << "R2  " << boostfactor << "   " << boostWeight << "   " << (1.-TMath::Abs(dt->CheckEvent(*(*e),kFALSE) - (*e)->GetTarget(0) )/maxDev)  << std::endl;
       if ( (*e)->GetWeight() > 0 ){
          Float_t newBoostWeight = (*e)->GetBoostWeight() * boostfactor;
          Float_t newWeight = (*e)->GetWeight() * (*e)->GetBoostWeight() * boostfactor;
@@ -1676,7 +1677,7 @@ Double_t TMVA::MethodBDT::AdaBoostR2( vector<TMVA::Event*> eventSample, Decision
 
    // re-normalise the weights
    Double_t normWeight =  sumw / newSumw;
-   for (vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
+   for (std::vector<TMVA::Event*>::iterator e=eventSample.begin(); e!=eventSample.end();e++) {
       //Helge    (*e)->ScaleBoostWeight( sumw/newSumw);
       // (*e)->ScaleBoostWeight( normWeight);
       (*e)->SetBoostWeight( (*e)->GetBoostWeight() * normWeight );
@@ -1741,7 +1742,7 @@ void TMVA::MethodBDT::ReadWeightsFromXML(void* parent) {
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodBDT::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodBDT::ReadWeightsFromStream( std::istream& istr )
 {
    // read the weights (BDT coefficients)
    TString dummy;
@@ -1760,7 +1761,7 @@ void  TMVA::MethodBDT::ReadWeightsFromStream( istream& istr )
    for (int i=0;i<fNTrees;i++) {
       istr >> dummy >> iTree >> dummy >> boostWeight;
       if (iTree != i) {
-         fForest.back()->Print( cout );
+         fForest.back()->Print( std::cout );
          Log() << kFATAL << "Error while reading weight file; mismatch iTree="
                << iTree << " i=" << i
                << " dummy " << dummy
@@ -1895,7 +1896,7 @@ const std::vector<Float_t> & TMVA::MethodBDT::GetRegressionValues()
          totalSumOfWeights += fBoostWeights[itree];
       }
 
-      vector< vector<Double_t> > vtemp;
+      vector< std::vector<Double_t> > vtemp;
       vtemp.push_back( response ); // this is the vector that will get sorted
       vtemp.push_back( weight ); 
       gTools().UsefulSortAscending( vtemp );
@@ -1977,7 +1978,7 @@ vector< Double_t > TMVA::MethodBDT::GetVariableImportance()
    }
    Double_t  sum=0;
    for (int itree = 0; itree < fNTrees; itree++) {
-      vector<Double_t> relativeImportance(fForest[itree]->GetVariableImportance());
+      std::vector<Double_t> relativeImportance(fForest[itree]->GetVariableImportance());
       for (UInt_t i=0; i< relativeImportance.size(); i++) {
          fVariableImportance[i] +=  fBoostWeights[itree] * relativeImportance[i];
       }
@@ -1999,7 +2000,7 @@ Double_t TMVA::MethodBDT::GetVariableImportance( UInt_t ivar )
    // which is later used in GetVariableImportance() to calculate the
    // relative variable importances.
 
-   vector<Double_t> relativeImportance = this->GetVariableImportance();
+   std::vector<Double_t> relativeImportance = this->GetVariableImportance();
    if (ivar < (UInt_t)relativeImportance.size()) return relativeImportance[ivar];
    else Log() << kFATAL << "<GetVariableImportance> ivar = " << ivar << " is out of range " << Endl;
 
@@ -2091,60 +2092,60 @@ void TMVA::MethodBDT::MakeClassSpecific( std::ostream& fout, const TString& clas
    nodeName.ReplaceAll("Read","");
    nodeName.Append("Node");
    // write BDT-specific classifier response
-   fout << "   std::vector<"<<nodeName<<"*> fForest;       // i.e. root nodes of decision trees" << endl;
-   fout << "   std::vector<double>                fBoostWeights; // the weights applied in the individual boosts" << endl;
-   fout << "};" << endl << endl;
-   fout << "double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   double myMVA = 0;" << endl;
+   fout << "   std::vector<"<<nodeName<<"*> fForest;       // i.e. root nodes of decision trees" << std::endl;
+   fout << "   std::vector<double>                fBoostWeights; // the weights applied in the individual boosts" << std::endl;
+   fout << "};" << std::endl << std::endl;
+   fout << "double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   double myMVA = 0;" << std::endl;
    if (fBoostType!="Grad"){
-      fout << "   double norm  = 0;" << endl;
-   }
-   fout << "   for (unsigned int itree=0; itree<fForest.size(); itree++){" << endl;
-   fout << "      "<<nodeName<<" *current = fForest[itree];" << endl;
-   fout << "      while (current->GetNodeType() == 0) { //intermediate node" << endl;
-   fout << "         if (current->GoesRight(inputValues)) current=("<<nodeName<<"*)current->GetRight();" << endl;
-   fout << "         else current=("<<nodeName<<"*)current->GetLeft();" << endl;
-   fout << "      }" << endl;
+      fout << "   double norm  = 0;" << std::endl;
+   }
+   fout << "   for (unsigned int itree=0; itree<fForest.size(); itree++){" << std::endl;
+   fout << "      "<<nodeName<<" *current = fForest[itree];" << std::endl;
+   fout << "      while (current->GetNodeType() == 0) { //intermediate node" << std::endl;
+   fout << "         if (current->GoesRight(inputValues)) current=("<<nodeName<<"*)current->GetRight();" << std::endl;
+   fout << "         else current=("<<nodeName<<"*)current->GetLeft();" << std::endl;
+   fout << "      }" << std::endl;
    if (fBoostType=="Grad"){
-      fout << "      myMVA += current->GetResponse();" << endl;
+      fout << "      myMVA += current->GetResponse();" << std::endl;
    }
    else if (fUseWeightedTrees) {
-      if (fUseYesNoLeaf) fout << "      myMVA += fBoostWeights[itree] *  current->GetNodeType();" << endl;
-      else               fout << "      myMVA += fBoostWeights[itree] *  current->GetPurity();" << endl;
-      fout << "      norm  += fBoostWeights[itree];" << endl;
+      if (fUseYesNoLeaf) fout << "      myMVA += fBoostWeights[itree] *  current->GetNodeType();" << std::endl;
+      else               fout << "      myMVA += fBoostWeights[itree] *  current->GetPurity();" << std::endl;
+      fout << "      norm  += fBoostWeights[itree];" << std::endl;
    }
    else {
-      if (fUseYesNoLeaf) fout << "      myMVA += current->GetNodeType();" << endl;
-      else               fout << "      myMVA += current->GetPurity();" << endl;
-      fout << "      norm  += 1.;" << endl;
+      if (fUseYesNoLeaf) fout << "      myMVA += current->GetNodeType();" << std::endl;
+      else               fout << "      myMVA += current->GetPurity();" << std::endl;
+      fout << "      norm  += 1.;" << std::endl;
    }
-   fout << "   }" << endl;
+   fout << "   }" << std::endl;
    if (fBoostType=="Grad"){
-      fout << "   return 2.0/(1.0+exp(-2.0*myMVA))-1.0;" << endl;
+      fout << "   return 2.0/(1.0+exp(-2.0*myMVA))-1.0;" << std::endl;
    }
-   else fout << "   return myMVA /= norm;" << endl;
-   fout << "};" << endl << endl;
-   fout << "void " << className << "::Initialize()" << endl;
-   fout << "{" << endl;
+   else fout << "   return myMVA /= norm;" << std::endl;
+   fout << "};" << std::endl << std::endl;
+   fout << "void " << className << "::Initialize()" << std::endl;
+   fout << "{" << std::endl;
    //Now for each decision tree, write directly the constructors of the nodes in the tree structure
    for (int itree=0; itree<fNTrees; itree++) {
-      fout << "  // itree = " << itree << endl;
-      fout << "  fBoostWeights.push_back(" << fBoostWeights[itree] << ");" << endl;
-      fout << "  fForest.push_back( " << endl;
+      fout << "  // itree = " << itree << std::endl;
+      fout << "  fBoostWeights.push_back(" << fBoostWeights[itree] << ");" << std::endl;
+      fout << "  fForest.push_back( " << std::endl;
       this->MakeClassInstantiateNode((DecisionTreeNode*)fForest[itree]->GetRoot(), fout, className);
-      fout <<"   );" << endl;
-   }
-   fout << "   return;" << endl;
-   fout << "};" << endl;
-   fout << " " << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   for (unsigned int itree=0; itree<fForest.size(); itree++) { " << endl;
-   fout << "      delete fForest[itree]; " << endl;
-   fout << "   }" << endl;
-   fout << "}" << endl;
+      fout <<"   );" << std::endl;
+   }
+   fout << "   return;" << std::endl;
+   fout << "};" << std::endl;
+   fout << " " << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   for (unsigned int itree=0; itree<fForest.size(); itree++) { " << std::endl;
+   fout << "      delete fForest[itree]; " << std::endl;
+   fout << "   }" << std::endl;
+   fout << "}" << std::endl;
 }
 
 //_______________________________________________________________________
@@ -2154,107 +2155,107 @@ void TMVA::MethodBDT::MakeClassSpecificHeader(  std::ostream& fout, const TStrin
    TString nodeName = className;
    nodeName.ReplaceAll("Read","");
    nodeName.Append("Node");
-   //fout << "#ifndef NN" << endl; commented out on purpose see next line
-   fout << "#define NN new "<<nodeName << endl; // NN definition depends on individual methods. Important to have NO #ifndef if several BDT methods compile together
-   //fout << "#endif" << endl; commented out on purpose see previous line
-   fout << "   " << endl;
-   fout << "#ifndef "<<nodeName<<"__def" << endl;
-   fout << "#define "<<nodeName<<"__def" << endl;
-   fout << "   " << endl;
-   fout << "class "<<nodeName<<" {" << endl;
-   fout << "   " << endl;
-   fout << "public:" << endl;
-   fout << "   " << endl;
-   fout << "   // constructor of an essentially \"empty\" node floating in space" << endl;
-   fout << "   "<<nodeName<<" ( "<<nodeName<<"* left,"<<nodeName<<"* right," << endl;
+   //fout << "#ifndef NN" << std::endl; commented out on purpose see next line
+   fout << "#define NN new "<<nodeName << std::endl; // NN definition depends on individual methods. Important to have NO #ifndef if several BDT methods compile together
+   //fout << "#endif" << std::endl; commented out on purpose see previous line
+   fout << "   " << std::endl;
+   fout << "#ifndef "<<nodeName<<"__def" << std::endl;
+   fout << "#define "<<nodeName<<"__def" << std::endl;
+   fout << "   " << std::endl;
+   fout << "class "<<nodeName<<" {" << std::endl;
+   fout << "   " << std::endl;
+   fout << "public:" << std::endl;
+   fout << "   " << std::endl;
+   fout << "   // constructor of an essentially \"empty\" node floating in space" << std::endl;
+   fout << "   "<<nodeName<<" ( "<<nodeName<<"* left,"<<nodeName<<"* right," << std::endl;
    if (fUseFisherCuts){
-      fout << "                          int nFisherCoeff," << endl;
+      fout << "                          int nFisherCoeff," << std::endl;
       for (UInt_t i=0;i<GetNVariables()+1;i++){
-         fout << "                          double fisherCoeff"<<i<<"," << endl;
+         fout << "                          double fisherCoeff"<<i<<"," << std::endl;
       }
    }
-   fout << "                          int selector, double cutValue, bool cutType, " << endl;
-   fout << "                          int nodeType, double purity, double response ) :" << endl;
-   fout << "   fLeft         ( left         )," << endl;
-   fout << "   fRight        ( right        )," << endl;
-   if (fUseFisherCuts) fout << "   fNFisherCoeff ( nFisherCoeff )," << endl;
-   fout << "   fSelector     ( selector     )," << endl;
-   fout << "   fCutValue     ( cutValue     )," << endl;
-   fout << "   fCutType      ( cutType      )," << endl;
-   fout << "   fNodeType     ( nodeType     )," << endl;
-   fout << "   fPurity       ( purity       )," << endl;
-   fout << "   fResponse     ( response     ){" << endl;
+   fout << "                          int selector, double cutValue, bool cutType, " << std::endl;
+   fout << "                          int nodeType, double purity, double response ) :" << std::endl;
+   fout << "   fLeft         ( left         )," << std::endl;
+   fout << "   fRight        ( right        )," << std::endl;
+   if (fUseFisherCuts) fout << "   fNFisherCoeff ( nFisherCoeff )," << std::endl;
+   fout << "   fSelector     ( selector     )," << std::endl;
+   fout << "   fCutValue     ( cutValue     )," << std::endl;
+   fout << "   fCutType      ( cutType      )," << std::endl;
+   fout << "   fNodeType     ( nodeType     )," << std::endl;
+   fout << "   fPurity       ( purity       )," << std::endl;
+   fout << "   fResponse     ( response     ){" << std::endl;
    if (fUseFisherCuts){
       for (UInt_t i=0;i<GetNVariables()+1;i++){
-         fout << "     fFisherCoeff.push_back(fisherCoeff"<<i<<");" << endl;
+         fout << "     fFisherCoeff.push_back(fisherCoeff"<<i<<");" << std::endl;
       }
    }
-   fout << "   }" << endl << endl;
-   fout << "   virtual ~"<<nodeName<<"();" << endl << endl;
-   fout << "   // test event if it decends the tree at this node to the right" << endl;
-   fout << "   virtual bool GoesRight( const std::vector<double>& inputValues ) const;" << endl;
-   fout << "   "<<nodeName<<"* GetRight( void )  {return fRight; };" << endl << endl;
-   fout << "   // test event if it decends the tree at this node to the left " << endl;
-   fout << "   virtual bool GoesLeft ( const std::vector<double>& inputValues ) const;" << endl;
-   fout << "   "<<nodeName<<"* GetLeft( void ) { return fLeft; };   " << endl << endl;
-   fout << "   // return  S/(S+B) (purity) at this node (from  training)" << endl << endl;
-   fout << "   double GetPurity( void ) const { return fPurity; } " << endl;
-   fout << "   // return the node type" << endl;
-   fout << "   int    GetNodeType( void ) const { return fNodeType; }" << endl;
-   fout << "   double GetResponse(void) const {return fResponse;}" << endl << endl;
-   fout << "private:" << endl << endl;
-   fout << "   "<<nodeName<<"*   fLeft;     // pointer to the left daughter node" << endl;
-   fout << "   "<<nodeName<<"*   fRight;    // pointer to the right daughter node" << endl;
+   fout << "   }" << std::endl << std::endl;
+   fout << "   virtual ~"<<nodeName<<"();" << std::endl << std::endl;
+   fout << "   // test event if it decends the tree at this node to the right" << std::endl;
+   fout << "   virtual bool GoesRight( const std::vector<double>& inputValues ) const;" << std::endl;
+   fout << "   "<<nodeName<<"* GetRight( void )  {return fRight; };" << std::endl << std::endl;
+   fout << "   // test event if it decends the tree at this node to the left " << std::endl;
+   fout << "   virtual bool GoesLeft ( const std::vector<double>& inputValues ) const;" << std::endl;
+   fout << "   "<<nodeName<<"* GetLeft( void ) { return fLeft; };   " << std::endl << std::endl;
+   fout << "   // return  S/(S+B) (purity) at this node (from  training)" << std::endl << std::endl;
+   fout << "   double GetPurity( void ) const { return fPurity; } " << std::endl;
+   fout << "   // return the node type" << std::endl;
+   fout << "   int    GetNodeType( void ) const { return fNodeType; }" << std::endl;
+   fout << "   double GetResponse(void) const {return fResponse;}" << std::endl << std::endl;
+   fout << "private:" << std::endl << std::endl;
+   fout << "   "<<nodeName<<"*   fLeft;     // pointer to the left daughter node" << std::endl;
+   fout << "   "<<nodeName<<"*   fRight;    // pointer to the right daughter node" << std::endl;
    if (fUseFisherCuts){
-      fout << "   int                     fNFisherCoeff; // =0 if this node doesn use fisher, else =nvar+1 " << endl;
-      fout << "   std::vector<double>     fFisherCoeff;  // the fisher coeff (offset at the last element)" << endl;
-   }
-   fout << "   int                     fSelector; // index of variable used in node selection (decision tree)   " << endl;
-   fout << "   double                  fCutValue; // cut value appplied on this node to discriminate bkg against sig" << endl;
-   fout << "   bool                    fCutType;  // true: if event variable > cutValue ==> signal , false otherwise" << endl;
-   fout << "   int                     fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Signal-leaf, 0 = internal " << endl;
-   fout << "   double                  fPurity;   // Purity of node from training"<< endl;
-   fout << "   double                  fResponse; // Regression response value of node" << endl;
-   fout << "}; " << endl;
-   fout << "   " << endl;
-   fout << "//_______________________________________________________________________" << endl;
-   fout << "   "<<nodeName<<"::~"<<nodeName<<"()" << endl;
-   fout << "{" << endl;
-   fout << "   if (fLeft  != NULL) delete fLeft;" << endl;
-   fout << "   if (fRight != NULL) delete fRight;" << endl;
-   fout << "}; " << endl;
-   fout << "   " << endl;
-   fout << "//_______________________________________________________________________" << endl;
-   fout << "bool "<<nodeName<<"::GoesRight( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   // test event if it decends the tree at this node to the right" << endl;
-   fout << "   bool result;" << endl;
+      fout << "   int                     fNFisherCoeff; // =0 if this node doesn use fisher, else =nvar+1 " << std::endl;
+      fout << "   std::vector<double>     fFisherCoeff;  // the fisher coeff (offset at the last element)" << std::endl;
+   }
+   fout << "   int                     fSelector; // index of variable used in node selection (decision tree)   " << std::endl;
+   fout << "   double                  fCutValue; // cut value appplied on this node to discriminate bkg against sig" << std::endl;
+   fout << "   bool                    fCutType;  // true: if event variable > cutValue ==> signal , false otherwise" << std::endl;
+   fout << "   int                     fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Signal-leaf, 0 = internal " << std::endl;
+   fout << "   double                  fPurity;   // Purity of node from training"<< std::endl;
+   fout << "   double                  fResponse; // Regression response value of node" << std::endl;
+   fout << "}; " << std::endl;
+   fout << "   " << std::endl;
+   fout << "//_______________________________________________________________________" << std::endl;
+   fout << "   "<<nodeName<<"::~"<<nodeName<<"()" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   if (fLeft  != NULL) delete fLeft;" << std::endl;
+   fout << "   if (fRight != NULL) delete fRight;" << std::endl;
+   fout << "}; " << std::endl;
+   fout << "   " << std::endl;
+   fout << "//_______________________________________________________________________" << std::endl;
+   fout << "bool "<<nodeName<<"::GoesRight( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // test event if it decends the tree at this node to the right" << std::endl;
+   fout << "   bool result;" << std::endl;
    if (fUseFisherCuts){
-     fout << "   if (fNFisherCoeff == 0){" << endl;
-     fout << "     result = (inputValues[fSelector] > fCutValue );" << endl;
-     fout << "   }else{" << endl;
-     fout << "     double fisher = fFisherCoeff.at(fFisherCoeff.size()-1);" << endl;
-     fout << "     for (unsigned int ivar=0; ivar<fFisherCoeff.size()-1; ivar++)" << endl;
-     fout << "       fisher += fFisherCoeff.at(ivar)*inputValues.at(ivar);" << endl;
-     fout << "     result = fisher > fCutValue;" << endl;
-     fout << "   }" << endl;
+     fout << "   if (fNFisherCoeff == 0){" << std::endl;
+     fout << "     result = (inputValues[fSelector] > fCutValue );" << std::endl;
+     fout << "   }else{" << std::endl;
+     fout << "     double fisher = fFisherCoeff.at(fFisherCoeff.size()-1);" << std::endl;
+     fout << "     for (unsigned int ivar=0; ivar<fFisherCoeff.size()-1; ivar++)" << std::endl;
+     fout << "       fisher += fFisherCoeff.at(ivar)*inputValues.at(ivar);" << std::endl;
+     fout << "     result = fisher > fCutValue;" << std::endl;
+     fout << "   }" << std::endl;
    }else{
-     fout << "     result = (inputValues[fSelector] > fCutValue );" << endl;
-   }
-   fout << "   if (fCutType == true) return result; //the cuts are selecting Signal ;" << endl;
-   fout << "   else return !result;" << endl;
-   fout << "}" << endl;
-   fout << "   " << endl;
-   fout << "//_______________________________________________________________________" << endl;
-   fout << "bool "<<nodeName<<"::GoesLeft( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   // test event if it decends the tree at this node to the left" << endl;
-   fout << "   if (!this->GoesRight(inputValues)) return true;" << endl;
-   fout << "   else return false;" << endl;
-   fout << "}" << endl;
-   fout << "   " << endl;
-   fout << "#endif" << endl;
-   fout << "   " << endl;
+     fout << "     result = (inputValues[fSelector] > fCutValue );" << std::endl;
+   }
+   fout << "   if (fCutType == true) return result; //the cuts are selecting Signal ;" << std::endl;
+   fout << "   else return !result;" << std::endl;
+   fout << "}" << std::endl;
+   fout << "   " << std::endl;
+   fout << "//_______________________________________________________________________" << std::endl;
+   fout << "bool "<<nodeName<<"::GoesLeft( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // test event if it decends the tree at this node to the left" << std::endl;
+   fout << "   if (!this->GoesRight(inputValues)) return true;" << std::endl;
+   fout << "   else return false;" << std::endl;
+   fout << "}" << std::endl;
+   fout << "   " << std::endl;
+   fout << "#endif" << std::endl;
+   fout << "   " << std::endl;
 }
 
 //_______________________________________________________________________
@@ -2265,22 +2266,22 @@ void TMVA::MethodBDT::MakeClassInstantiateNode( DecisionTreeNode *n, std::ostrea
       Log() << kFATAL << "MakeClassInstantiateNode: started with undefined node" <<Endl;
       return ;
    }
-   fout << "NN("<<endl;
+   fout << "NN("<<std::endl;
    if (n->GetLeft() != NULL){
       this->MakeClassInstantiateNode( (DecisionTreeNode*)n->GetLeft() , fout, className);
    }
    else {
       fout << "0";
    }
-   fout << ", " <<endl;
+   fout << ", " <<std::endl;
    if (n->GetRight() != NULL){
       this->MakeClassInstantiateNode( (DecisionTreeNode*)n->GetRight(), fout, className );
    }
    else {
       fout << "0";
    }
-   fout << ", " <<  endl
-        << setprecision(6);
+   fout << ", " <<  std::endl
+        << std::setprecision(6);
    if (fUseFisherCuts){
      fout << n->GetNFisherCoeff() << ", ";
      for (UInt_t i=0; i< GetNVariables()+1; i++) {
diff --git a/tmva/src/MethodBase.cxx b/tmva/src/MethodBase.cxx
index cef3388a65f..b3df93a3141 100644
--- a/tmva/src/MethodBase.cxx
+++ b/tmva/src/MethodBase.cxx
@@ -1134,35 +1134,35 @@ void TMVA::MethodBase::WriteStateToStream( std::ostream& tf ) const
    TString prefix = "";
    UserGroup_t * userInfo = gSystem->GetUserInfo();
 
-   tf << prefix << "#GEN -*-*-*-*-*-*-*-*-*-*-*- general info -*-*-*-*-*-*-*-*-*-*-*-" << endl << prefix << endl;
-   tf << prefix << "Method         : " << GetMethodTypeName() << "::" << GetMethodName() << endl;
+   tf << prefix << "#GEN -*-*-*-*-*-*-*-*-*-*-*- general info -*-*-*-*-*-*-*-*-*-*-*-" << std::endl << prefix << std::endl;
+   tf << prefix << "Method         : " << GetMethodTypeName() << "::" << GetMethodName() << std::endl;
    tf.setf(std::ios::left);
    tf << prefix << "TMVA Release   : " << std::setw(10) << GetTrainingTMVAVersionString() << "    ["
-      << GetTrainingTMVAVersionCode() << "]" << endl;
+      << GetTrainingTMVAVersionCode() << "]" << std::endl;
    tf << prefix << "ROOT Release   : " << std::setw(10) << GetTrainingROOTVersionString() << "    ["
-      << GetTrainingROOTVersionCode() << "]" << endl;
-   tf << prefix << "Creator        : " << userInfo->fUser << endl;
-   tf << prefix << "Date           : "; TDatime *d = new TDatime; tf << d->AsString() << endl; delete d;
-   tf << prefix << "Host           : " << gSystem->GetBuildNode() << endl;
-   tf << prefix << "Dir            : " << gSystem->WorkingDirectory() << endl;
-   tf << prefix << "Training events: " << Data()->GetNTrainingEvents() << endl;
+      << GetTrainingROOTVersionCode() << "]" << std::endl;
+   tf << prefix << "Creator        : " << userInfo->fUser << std::endl;
+   tf << prefix << "Date           : "; TDatime *d = new TDatime; tf << d->AsString() << std::endl; delete d;
+   tf << prefix << "Host           : " << gSystem->GetBuildNode() << std::endl;
+   tf << prefix << "Dir            : " << gSystem->WorkingDirectory() << std::endl;
+   tf << prefix << "Training events: " << Data()->GetNTrainingEvents() << std::endl;
 
    TString analysisType(((const_cast<TMVA::MethodBase*>(this)->GetAnalysisType()==Types::kRegression) ? "Regression" : "Classification"));
 
-   tf << prefix << "Analysis type  : " << "[" << ((GetAnalysisType()==Types::kRegression) ? "Regression" : "Classification") << "]" << endl;
-   tf << prefix << endl;
+   tf << prefix << "Analysis type  : " << "[" << ((GetAnalysisType()==Types::kRegression) ? "Regression" : "Classification") << "]" << std::endl;
+   tf << prefix << std::endl;
 
    delete userInfo;
 
    // First write all options
-   tf << prefix << endl << prefix << "#OPT -*-*-*-*-*-*-*-*-*-*-*-*- options -*-*-*-*-*-*-*-*-*-*-*-*-" << endl << prefix << endl;
+   tf << prefix << std::endl << prefix << "#OPT -*-*-*-*-*-*-*-*-*-*-*-*- options -*-*-*-*-*-*-*-*-*-*-*-*-" << std::endl << prefix << std::endl;
    WriteOptionsToStream( tf, prefix );
-   tf << prefix << endl;
+   tf << prefix << std::endl;
 
    // Second write variable info
-   tf << prefix << endl << prefix << "#VAR -*-*-*-*-*-*-*-*-*-*-*-* variables *-*-*-*-*-*-*-*-*-*-*-*-" << endl << prefix << endl;
+   tf << prefix << std::endl << prefix << "#VAR -*-*-*-*-*-*-*-*-*-*-*-* variables *-*-*-*-*-*-*-*-*-*-*-*-" << std::endl << prefix << std::endl;
    WriteVarsToStream( tf, prefix );
-   tf << prefix << endl;
+   tf << prefix << std::endl;
 }
 
 //_______________________________________________________________________
@@ -1301,13 +1301,13 @@ void TMVA::MethodBase::ReadStateFromFile()
       gTools().xmlengine().FreeDoc(doc);
    }
    else {
-      filebuf fb;
-      fb.open(tfname.Data(),ios::in);
+      std::filebuf fb;
+      fb.open(tfname.Data(),std::ios::in);
       if (!fb.is_open()) { // file not found --> Error
          Log() << kFATAL << "<ReadStateFromFile> "
                << "Unable to open input weight file: " << tfname << Endl;
       }
-      istream fin(&fb);
+      std::istream fin(&fb);
       ReadStateFromStream(fin);
       fb.close();
    }
@@ -1565,10 +1565,10 @@ void TMVA::MethodBase::WriteVarsToStream( std::ostream& o, const TString& prefix
 {
    // write the list of variables (name, min, max) for a given data
    // transformation method to the stream
-   o << prefix << "NVar " << DataInfo().GetNVariables() << endl;
+   o << prefix << "NVar " << DataInfo().GetNVariables() << std::endl;
    std::vector<VariableInfo>::const_iterator varIt = DataInfo().GetVariableInfos().begin();
    for (; varIt!=DataInfo().GetVariableInfos().end(); varIt++) { o << prefix; varIt->WriteToStream(o); }
-   o << prefix << "NSpec " << DataInfo().GetNSpectators() << endl;
+   o << prefix << "NSpec " << DataInfo().GetNSpectators() << std::endl;
    varIt = DataInfo().GetSpectatorInfos().begin();
    for (; varIt!=DataInfo().GetSpectatorInfos().end(); varIt++) { o << prefix; varIt->WriteToStream(o); }
 }
@@ -2765,217 +2765,217 @@ void TMVA::MethodBase::MakeClass( const TString& theClassFileName ) const
    Log() << kINFO << "Creating standalone response class: "
          << gTools().Color("lightblue") << classFileName << gTools().Color("reset") << Endl;
 
-   ofstream fout( classFileName );
+   std::ofstream fout( classFileName );
    if (!fout.good()) { // file could not be opened --> Error
       Log() << kFATAL << "<MakeClass> Unable to open file: " << classFileName << Endl;
    }
 
    // now create the class
    // preamble
-   fout << "// Class: " << className << endl;
-   fout << "// Automatically generated by MethodBase::MakeClass" << endl << "//" << endl;
+   fout << "// Class: " << className << std::endl;
+   fout << "// Automatically generated by MethodBase::MakeClass" << std::endl << "//" << std::endl;
 
    // print general information and configuration state
-   fout << endl;
-   fout << "/* configuration options =====================================================" << endl << endl;
+   fout << std::endl;
+   fout << "/* configuration options =====================================================" << std::endl << std::endl;
    WriteStateToStream( fout );
-   fout << endl;
-   fout << "============================================================================ */" << endl;
+   fout << std::endl;
+   fout << "============================================================================ */" << std::endl;
 
    // generate the class
-   fout << "" << endl;
-   fout << "#include <vector>" << endl;
-   fout << "#include <cmath>" << endl;
-   fout << "#include <string>" << endl;
-   fout << "#include <iostream>" << endl;
-   fout << "" << endl;
+   fout << "" << std::endl;
+   fout << "#include <vector>" << std::endl;
+   fout << "#include <cmath>" << std::endl;
+   fout << "#include <string>" << std::endl;
+   fout << "#include <iostream>" << std::endl;
+   fout << "" << std::endl;
    // now if the classifier needs to write some addicional classes for its response implementation
    // this code goes here: (at least the header declarations need to come before the main class
    this->MakeClassSpecificHeader( fout, className );
 
-   fout << "#ifndef IClassifierReader__def" << endl;
-   fout << "#define IClassifierReader__def" << endl;
-   fout << endl;
-   fout << "class IClassifierReader {" << endl;
-   fout << endl;
-   fout << " public:" << endl;
-   fout << endl;
-   fout << "   // constructor" << endl;
-   fout << "   IClassifierReader() : fStatusIsClean( true ) {}" << endl;
-   fout << "   virtual ~IClassifierReader() {}" << endl;
-   fout << endl;
-   fout << "   // return classifier response" << endl;
-   fout << "   virtual double GetMvaValue( const std::vector<double>& inputValues ) const = 0;" << endl;
-   fout << endl;
-   fout << "   // returns classifier status" << endl;
-   fout << "   bool IsStatusClean() const { return fStatusIsClean; }" << endl;
-   fout << endl;
-   fout << " protected:" << endl;
-   fout << endl;
-   fout << "   bool fStatusIsClean;" << endl;
-   fout << "};" << endl;
-   fout << endl;
-   fout << "#endif" << endl;
-   fout << endl;
-   fout << "class " << className << " : public IClassifierReader {" << endl;
-   fout << endl;
-   fout << " public:" << endl;
-   fout << endl;
-   fout << "   // constructor" << endl;
-   fout << "   " << className << "( std::vector<std::string>& theInputVars ) " << endl;
-   fout << "      : IClassifierReader()," << endl;
-   fout << "        fClassName( \"" << className << "\" )," << endl;
-   fout << "        fNvars( " << GetNvar() << " )," << endl;
-   fout << "        fIsNormalised( " << (IsNormalised() ? "true" : "false") << " )" << endl;
-   fout << "   {      " << endl;
-   fout << "      // the training input variables" << endl;
+   fout << "#ifndef IClassifierReader__def" << std::endl;
+   fout << "#define IClassifierReader__def" << std::endl;
+   fout << std::endl;
+   fout << "class IClassifierReader {" << std::endl;
+   fout << std::endl;
+   fout << " public:" << std::endl;
+   fout << std::endl;
+   fout << "   // constructor" << std::endl;
+   fout << "   IClassifierReader() : fStatusIsClean( true ) {}" << std::endl;
+   fout << "   virtual ~IClassifierReader() {}" << std::endl;
+   fout << std::endl;
+   fout << "   // return classifier response" << std::endl;
+   fout << "   virtual double GetMvaValue( const std::vector<double>& inputValues ) const = 0;" << std::endl;
+   fout << std::endl;
+   fout << "   // returns classifier status" << std::endl;
+   fout << "   bool IsStatusClean() const { return fStatusIsClean; }" << std::endl;
+   fout << std::endl;
+   fout << " protected:" << std::endl;
+   fout << std::endl;
+   fout << "   bool fStatusIsClean;" << std::endl;
+   fout << "};" << std::endl;
+   fout << std::endl;
+   fout << "#endif" << std::endl;
+   fout << std::endl;
+   fout << "class " << className << " : public IClassifierReader {" << std::endl;
+   fout << std::endl;
+   fout << " public:" << std::endl;
+   fout << std::endl;
+   fout << "   // constructor" << std::endl;
+   fout << "   " << className << "( std::vector<std::string>& theInputVars ) " << std::endl;
+   fout << "      : IClassifierReader()," << std::endl;
+   fout << "        fClassName( \"" << className << "\" )," << std::endl;
+   fout << "        fNvars( " << GetNvar() << " )," << std::endl;
+   fout << "        fIsNormalised( " << (IsNormalised() ? "true" : "false") << " )" << std::endl;
+   fout << "   {      " << std::endl;
+   fout << "      // the training input variables" << std::endl;
    fout << "      const char* inputVars[] = { ";
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
       fout << "\"" << GetOriginalVarName(ivar) << "\"";
       if (ivar<GetNvar()-1) fout << ", ";
    }
-   fout << " };" << endl;
-   fout << endl;
-   fout << "      // sanity checks" << endl;
-   fout << "      if (theInputVars.size() <= 0) {" << endl;
-   fout << "         std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": empty input vector\" << std::endl;" << endl;
-   fout << "         fStatusIsClean = false;" << endl;
-   fout << "      }" << endl;
-   fout << endl;
-   fout << "      if (theInputVars.size() != fNvars) {" << endl;
-   fout << "         std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": mismatch in number of input values: \"" << endl;
-   fout << "                   << theInputVars.size() << \" != \" << fNvars << std::endl;" << endl;
-   fout << "         fStatusIsClean = false;" << endl;
-   fout << "      }" << endl;
-   fout << endl;
-   fout << "      // validate input variables" << endl;
-   fout << "      for (size_t ivar = 0; ivar < theInputVars.size(); ivar++) {" << endl;
-   fout << "         if (theInputVars[ivar] != inputVars[ivar]) {" << endl;
-   fout << "            std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": mismatch in input variable names\" << std::endl" << endl;
-   fout << "                      << \" for variable [\" << ivar << \"]: \" << theInputVars[ivar].c_str() << \" != \" << inputVars[ivar] << std::endl;" << endl;
-   fout << "            fStatusIsClean = false;" << endl;
-   fout << "         }" << endl;
-   fout << "      }" << endl;
-   fout << endl;
-   fout << "      // initialize min and max vectors (for normalisation)" << endl;
+   fout << " };" << std::endl;
+   fout << std::endl;
+   fout << "      // sanity checks" << std::endl;
+   fout << "      if (theInputVars.size() <= 0) {" << std::endl;
+   fout << "         std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": empty input vector\" << std::endl;" << std::endl;
+   fout << "         fStatusIsClean = false;" << std::endl;
+   fout << "      }" << std::endl;
+   fout << std::endl;
+   fout << "      if (theInputVars.size() != fNvars) {" << std::endl;
+   fout << "         std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": mismatch in number of input values: \"" << std::endl;
+   fout << "                   << theInputVars.size() << \" != \" << fNvars << std::endl;" << std::endl;
+   fout << "         fStatusIsClean = false;" << std::endl;
+   fout << "      }" << std::endl;
+   fout << std::endl;
+   fout << "      // validate input variables" << std::endl;
+   fout << "      for (size_t ivar = 0; ivar < theInputVars.size(); ivar++) {" << std::endl;
+   fout << "         if (theInputVars[ivar] != inputVars[ivar]) {" << std::endl;
+   fout << "            std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": mismatch in input variable names\" << std::endl" << std::endl;
+   fout << "                      << \" for variable [\" << ivar << \"]: \" << theInputVars[ivar].c_str() << \" != \" << inputVars[ivar] << std::endl;" << std::endl;
+   fout << "            fStatusIsClean = false;" << std::endl;
+   fout << "         }" << std::endl;
+   fout << "      }" << std::endl;
+   fout << std::endl;
+   fout << "      // initialize min and max vectors (for normalisation)" << std::endl;
    for (UInt_t ivar = 0; ivar < GetNvar(); ivar++) {
-      fout << "      fVmin[" << ivar << "] = " << std::setprecision(15) << GetXmin( ivar ) << ";" << endl;
-      fout << "      fVmax[" << ivar << "] = " << std::setprecision(15) << GetXmax( ivar ) << ";" << endl;
+      fout << "      fVmin[" << ivar << "] = " << std::setprecision(15) << GetXmin( ivar ) << ";" << std::endl;
+      fout << "      fVmax[" << ivar << "] = " << std::setprecision(15) << GetXmax( ivar ) << ";" << std::endl;
    }
-   fout << endl;
-   fout << "      // initialize input variable types" << endl;
+   fout << std::endl;
+   fout << "      // initialize input variable types" << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
-      fout << "      fType[" << ivar << "] = \'" << DataInfo().GetVariableInfo(ivar).GetVarType() << "\';" << endl;
+      fout << "      fType[" << ivar << "] = \'" << DataInfo().GetVariableInfo(ivar).GetVarType() << "\';" << std::endl;
    }
-   fout << endl;
-   fout << "      // initialize constants" << endl;
-   fout << "      Initialize();" << endl;
-   fout << endl;
+   fout << std::endl;
+   fout << "      // initialize constants" << std::endl;
+   fout << "      Initialize();" << std::endl;
+   fout << std::endl;
    if (GetTransformationHandler().GetTransformationList().GetSize() != 0) {
-      fout << "      // initialize transformation" << endl;
-      fout << "      InitTransform();" << endl;
-   }
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   // destructor" << endl;
-   fout << "   virtual ~" << className << "() {" << endl;
-   fout << "      Clear(); // method-specific" << endl;
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   // the classifier response" << endl;
-   fout << "   // \"inputValues\" is a vector of input values in the same order as the " << endl;
-   fout << "   // variables given to the constructor" << endl;
-   fout << "   double GetMvaValue( const std::vector<double>& inputValues ) const;" << endl;
-   fout << endl;
-   fout << " private:" << endl;
-   fout << endl;
-   fout << "   // method-specific destructor" << endl;
-   fout << "   void Clear();" << endl;
-   fout << endl;
+      fout << "      // initialize transformation" << std::endl;
+      fout << "      InitTransform();" << std::endl;
+   }
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   // destructor" << std::endl;
+   fout << "   virtual ~" << className << "() {" << std::endl;
+   fout << "      Clear(); // method-specific" << std::endl;
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   // the classifier response" << std::endl;
+   fout << "   // \"inputValues\" is a vector of input values in the same order as the " << std::endl;
+   fout << "   // variables given to the constructor" << std::endl;
+   fout << "   double GetMvaValue( const std::vector<double>& inputValues ) const;" << std::endl;
+   fout << std::endl;
+   fout << " private:" << std::endl;
+   fout << std::endl;
+   fout << "   // method-specific destructor" << std::endl;
+   fout << "   void Clear();" << std::endl;
+   fout << std::endl;
    if (GetTransformationHandler().GetTransformationList().GetSize()!=0) {
-      fout << "   // input variable transformation" << endl;
+      fout << "   // input variable transformation" << std::endl;
       GetTransformationHandler().MakeFunction(fout, className,1);
-      fout << "   void InitTransform();" << endl;
-      fout << "   void Transform( std::vector<double> & iv, int sigOrBgd ) const;" << endl;
-      fout << endl;
-   }
-   fout << "   // common member variables" << endl;
-   fout << "   const char* fClassName;" << endl;
-   fout << endl;
-   fout << "   const size_t fNvars;" << endl;
-   fout << "   size_t GetNvar()           const { return fNvars; }" << endl;
-   fout << "   char   GetType( int ivar ) const { return fType[ivar]; }" << endl;
-   fout << endl;
-   fout << "   // normalisation of input variables" << endl;
-   fout << "   const bool fIsNormalised;" << endl;
-   fout << "   bool IsNormalised() const { return fIsNormalised; }" << endl;
-   fout << "   double fVmin[" << GetNvar() << "];" << endl;
-   fout << "   double fVmax[" << GetNvar() << "];" << endl;
-   fout << "   double NormVariable( double x, double xmin, double xmax ) const {" << endl;
-   fout << "      // normalise to output range: [-1, 1]" << endl;
-   fout << "      return 2*(x - xmin)/(xmax - xmin) - 1.0;" << endl;
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   // type of input variable: 'F' or 'I'" << endl;
-   fout << "   char   fType[" << GetNvar() << "];" << endl;
-   fout << endl;
-   fout << "   // initialize internal variables" << endl;
-   fout << "   void Initialize();" << endl;
-   fout << "   double GetMvaValue__( const std::vector<double>& inputValues ) const;" << endl;
-   fout << "" << endl;
-   fout << "   // private members (method specific)" << endl;
+      fout << "   void InitTransform();" << std::endl;
+      fout << "   void Transform( std::vector<double> & iv, int sigOrBgd ) const;" << std::endl;
+      fout << std::endl;
+   }
+   fout << "   // common member variables" << std::endl;
+   fout << "   const char* fClassName;" << std::endl;
+   fout << std::endl;
+   fout << "   const size_t fNvars;" << std::endl;
+   fout << "   size_t GetNvar()           const { return fNvars; }" << std::endl;
+   fout << "   char   GetType( int ivar ) const { return fType[ivar]; }" << std::endl;
+   fout << std::endl;
+   fout << "   // normalisation of input variables" << std::endl;
+   fout << "   const bool fIsNormalised;" << std::endl;
+   fout << "   bool IsNormalised() const { return fIsNormalised; }" << std::endl;
+   fout << "   double fVmin[" << GetNvar() << "];" << std::endl;
+   fout << "   double fVmax[" << GetNvar() << "];" << std::endl;
+   fout << "   double NormVariable( double x, double xmin, double xmax ) const {" << std::endl;
+   fout << "      // normalise to output range: [-1, 1]" << std::endl;
+   fout << "      return 2*(x - xmin)/(xmax - xmin) - 1.0;" << std::endl;
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   // type of input variable: 'F' or 'I'" << std::endl;
+   fout << "   char   fType[" << GetNvar() << "];" << std::endl;
+   fout << std::endl;
+   fout << "   // initialize internal variables" << std::endl;
+   fout << "   void Initialize();" << std::endl;
+   fout << "   double GetMvaValue__( const std::vector<double>& inputValues ) const;" << std::endl;
+   fout << "" << std::endl;
+   fout << "   // private members (method specific)" << std::endl;
 
    // call the classifier specific output (the classifier must close the class !)
    MakeClassSpecific( fout, className );
 
-   fout << "   inline double " << className << "::GetMvaValue( const std::vector<double>& inputValues ) const" << endl;
-   fout << "   {" << endl;
-   fout << "      // classifier response value" << endl;
-   fout << "      double retval = 0;" << endl;
-   fout << endl;
-   fout << "      // classifier response, sanity check first" << endl;
-   fout << "      if (!IsStatusClean()) {" << endl;
-   fout << "         std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": cannot return classifier response\"" << endl;
-   fout << "                   << \" because status is dirty\" << std::endl;" << endl;
-   fout << "         retval = 0;" << endl;
-   fout << "      }" << endl;
-   fout << "      else {" << endl;
-   fout << "         if (IsNormalised()) {" << endl;
-   fout << "            // normalise variables" << endl;
-   fout << "            std::vector<double> iV;" << endl;
-   fout << "            int ivar = 0;" << endl;
-   fout << "            for (std::vector<double>::const_iterator varIt = inputValues.begin();" << endl;
-   fout << "                 varIt != inputValues.end(); varIt++, ivar++) {" << endl;
-   fout << "               iV.push_back(NormVariable( *varIt, fVmin[ivar], fVmax[ivar] ));" << endl;
-   fout << "            }" << endl;
+   fout << "   inline double " << className << "::GetMvaValue( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "   {" << std::endl;
+   fout << "      // classifier response value" << std::endl;
+   fout << "      double retval = 0;" << std::endl;
+   fout << std::endl;
+   fout << "      // classifier response, sanity check first" << std::endl;
+   fout << "      if (!IsStatusClean()) {" << std::endl;
+   fout << "         std::cout << \"Problem in class \\\"\" << fClassName << \"\\\": cannot return classifier response\"" << std::endl;
+   fout << "                   << \" because status is dirty\" << std::endl;" << std::endl;
+   fout << "         retval = 0;" << std::endl;
+   fout << "      }" << std::endl;
+   fout << "      else {" << std::endl;
+   fout << "         if (IsNormalised()) {" << std::endl;
+   fout << "            // normalise variables" << std::endl;
+   fout << "            std::vector<double> iV;" << std::endl;
+   fout << "            int ivar = 0;" << std::endl;
+   fout << "            for (std::vector<double>::const_iterator varIt = inputValues.begin();" << std::endl;
+   fout << "                 varIt != inputValues.end(); varIt++, ivar++) {" << std::endl;
+   fout << "               iV.push_back(NormVariable( *varIt, fVmin[ivar], fVmax[ivar] ));" << std::endl;
+   fout << "            }" << std::endl;
    if (GetTransformationHandler().GetTransformationList().GetSize()!=0 && 
        GetMethodType() != Types::kLikelihood &&
        GetMethodType() != Types::kHMatrix) {
-      fout << "            Transform( iV, -1 );" << endl;
+      fout << "            Transform( iV, -1 );" << std::endl;
    }
-   fout << "            retval = GetMvaValue__( iV );" << endl;
-   fout << "         }" << endl;
-   fout << "         else {" << endl;
+   fout << "            retval = GetMvaValue__( iV );" << std::endl;
+   fout << "         }" << std::endl;
+   fout << "         else {" << std::endl;
    if (GetTransformationHandler().GetTransformationList().GetSize()!=0 && 
        GetMethodType() != Types::kLikelihood &&
        GetMethodType() != Types::kHMatrix) {
-      fout << "            std::vector<double> iV;" << endl;
-      fout << "            int ivar = 0;" << endl;
-      fout << "            for (std::vector<double>::const_iterator varIt = inputValues.begin();" << endl;
-      fout << "                 varIt != inputValues.end(); varIt++, ivar++) {" << endl;
-      fout << "               iV.push_back(*varIt);" << endl;
-      fout << "            }" << endl;
-      fout << "            Transform( iV, -1 );" << endl;
-      fout << "            retval = GetMvaValue__( iV );" << endl;
+      fout << "            std::vector<double> iV;" << std::endl;
+      fout << "            int ivar = 0;" << std::endl;
+      fout << "            for (std::vector<double>::const_iterator varIt = inputValues.begin();" << std::endl;
+      fout << "                 varIt != inputValues.end(); varIt++, ivar++) {" << std::endl;
+      fout << "               iV.push_back(*varIt);" << std::endl;
+      fout << "            }" << std::endl;
+      fout << "            Transform( iV, -1 );" << std::endl;
+      fout << "            retval = GetMvaValue__( iV );" << std::endl;
    }
    else {
-      fout << "            retval = GetMvaValue__( inputValues );" << endl;
+      fout << "            retval = GetMvaValue__( inputValues );" << std::endl;
    }
-   fout << "         }" << endl;
-   fout << "      }" << endl;
-   fout << endl;
-   fout << "      return retval;" << endl;
-   fout << "   }" << endl;
+   fout << "         }" << std::endl;
+   fout << "      }" << std::endl;
+   fout << std::endl;
+   fout << "      return retval;" << std::endl;
+   fout << "   }" << std::endl;
 
    // create output for transformation - if any
    if (GetTransformationHandler().GetTransformationList().GetSize()!=0)
@@ -2999,7 +2999,7 @@ void TMVA::MethodBase::PrintHelpMessage() const
       if (!o->good()) { // file could not be opened --> Error
          Log() << kFATAL << "<PrintHelpMessage> Unable to append to output file: " << GetReferenceFile() << Endl;
       }
-      std::cout.rdbuf( o->rdbuf() ); // redirect 'cout' to file
+      std::cout.rdbuf( o->rdbuf() ); // redirect 'std::cout' to file
    }
 
    //         "|--------------------------------------------------------------|"
diff --git a/tmva/src/MethodBayesClassifier.cxx b/tmva/src/MethodBayesClassifier.cxx
index d3a9ddc1f81..b488f228545 100644
--- a/tmva/src/MethodBayesClassifier.cxx
+++ b/tmva/src/MethodBayesClassifier.cxx
@@ -104,7 +104,7 @@ void TMVA::MethodBayesClassifier::AddWeightsXMLTo( void* /*parent*/ ) const {
 }
   
 //_______________________________________________________________________
-void  TMVA::MethodBayesClassifier::ReadWeightsFromStream( istream & )
+void  TMVA::MethodBayesClassifier::ReadWeightsFromStream( std::istream & )
 {
    // read back the training results from a file (stream)
 }
@@ -125,8 +125,8 @@ Double_t TMVA::MethodBayesClassifier::GetMvaValue( Double_t* err, Double_t* errU
 void TMVA::MethodBayesClassifier::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write specific classifier response
-   fout << "   // not implemented for class: \"" << className << "\"" << endl;
-   fout << "};" << endl;
+   fout << "   // not implemented for class: \"" << className << "\"" << std::endl;
+   fout << "};" << std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodBoost.cxx b/tmva/src/MethodBoost.cxx
index 018d8690442..3c9e04b293a 100644
--- a/tmva/src/MethodBoost.cxx
+++ b/tmva/src/MethodBoost.cxx
@@ -682,9 +682,9 @@ void TMVA::MethodBoost::FindMVACut()
       Double_t bSel=mvaBC->GetBinContent(1);
       Double_t separationGain=sepGain->GetSeparationGain(sSel,bSel,sTot,bTot);
       Double_t mvaCut=mvaSC->GetBinLowEdge(1);
-      //      cout << "minMVA =" << minMVA << " maxMVA = " << maxMVA << " width = " << mvaSC->GetBinWidth(1) <<  endl;
+      //      std::cout << "minMVA =" << minMVA << " maxMVA = " << maxMVA << " width = " << mvaSC->GetBinWidth(1) <<  std::endl;
 
-      //      for (Int_t ibin=1;ibin<=nBins;ibin++) cout << " cutvalues[" << ibin<<"]="<<mvaSC->GetBinLowEdge(ibin) << "  " << mvaSC->GetBinCenter(ibin) << endl;
+      //      for (Int_t ibin=1;ibin<=nBins;ibin++) std::cout << " cutvalues[" << ibin<<"]="<<mvaSC->GetBinLowEdge(ibin) << "  " << mvaSC->GetBinCenter(ibin) << std::endl;
       Double_t mvaCutOrientation=1; // 1 if mva > mvaCut --> Signal and -1 if mva < mvaCut (i.e. mva*-1 > mvaCut*-1) --> Signal
       Double_t SoBRight=1, SoBLeft=1;
       for (Int_t ibin=2;ibin<nBins;ibin++){ 
@@ -716,14 +716,14 @@ void TMVA::MethodBoost::FindMVACut()
       }
       
       
-      // cout << "Min="<<minMVA << " Max=" << maxMVA 
+      // std::cout << "Min="<<minMVA << " Max=" << maxMVA 
       //      << " sTot=" << sTot
       //      << " bTot=" << bTot
       //      << " sepGain="<<separationGain
       //      << " cut=" << mvaCut 
       //      << " cutOrientation="<<mvaCutOrientation
-      //      << endl;
-      // cout << "S/B right="<<SoBRight << " left="<<SoBLeft<<endl;
+      //      << std::endl;
+      // std::cout << "S/B right="<<SoBRight << " left="<<SoBLeft<<std::endl;
       // if (fMethodIndex==0)mvaCut = -1.9616885110735893e-02;
       // if (fMethodIndex==1)mvaCut = -6.8812005221843719e-02;
       lastMethod->SetSignalReferenceCut(mvaCut);
@@ -893,15 +893,15 @@ void TMVA::MethodBoost::CalcMethodWeight()
       }
       
       // if (ievt < 10)
-      // cout << " TYpe=" << DataInfo().IsSignal(ev) 
+      // std::cout << " TYpe=" << DataInfo().IsSignal(ev) 
       //      << " mvaValue="<<fMVAvalues->at(ievt)
       //      << " mvaCutVal="<<method->GetSignalReferenceCut()
       //      << " mvaCutValOrien="<<method->GetSignalReferenceCutOrientation()
       //      << " isSignallike="<<method->IsSignalLike(fMVAvalues->at(ievt))
-      //      << endl;
+      //      << std::endl;
    }
 
-   //   cout << "sumWrong="<<sumWrong << " sumAll="<<sumAll<<endl;
+   //   std::cout << "sumWrong="<<sumWrong << " sumAll="<<sumAll<<std::endl;
    fMethodError=sumWrong/sumAll;
 
    // calculating the fMethodError and the fBoostWeight out of it uses
diff --git a/tmva/src/MethodCFMlpANN.cxx b/tmva/src/MethodCFMlpANN.cxx
index 9a446d08311..b96624678e7 100644
--- a/tmva/src/MethodCFMlpANN.cxx
+++ b/tmva/src/MethodCFMlpANN.cxx
@@ -79,6 +79,9 @@
 
 REGISTER_METHOD(CFMlpANN)
 
+using std::stringstream;
+using std::make_pair;
+
 ClassImp(TMVA::MethodCFMlpANN)
 
 // initialization of global variable
@@ -216,7 +219,7 @@ void TMVA::MethodCFMlpANN::ProcessOptions()
     
       // Data LUT
       fData  = new TMatrix( nEvtTrain, GetNvar() );
-      fClass = new vector<Int_t>( nEvtTrain );
+      fClass = new std::vector<Int_t>( nEvtTrain );
 
       // ---- fill LUTs
 
@@ -312,7 +315,7 @@ Double_t TMVA::MethodCFMlpANN::GetMvaValue( Double_t* err, Double_t* errUpper )
    const Event* ev = GetEvent();
 
    // copy of input variables
-   vector<Double_t> inputVec( GetNvar() );
+   std::vector<Double_t> inputVec( GetNvar() );
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) inputVec[ivar] = ev->GetValue(ivar);
 
    Double_t myMVA = EvalANN( inputVec, isOK );
@@ -325,7 +328,7 @@ Double_t TMVA::MethodCFMlpANN::GetMvaValue( Double_t* err, Double_t* errUpper )
 }
 
 //_______________________________________________________________________
-Double_t TMVA::MethodCFMlpANN::EvalANN( vector<Double_t>& inVar, Bool_t& isOK )
+Double_t TMVA::MethodCFMlpANN::EvalANN( std::vector<Double_t>& inVar, Bool_t& isOK )
 {
    // evaluates NN value as function of input variables
 
@@ -394,7 +397,7 @@ Double_t TMVA::MethodCFMlpANN::NN_fonc( Int_t i, Double_t u ) const
 }
 
 //_______________________________________________________________________
-void TMVA::MethodCFMlpANN::ReadWeightsFromStream( istream & istr )
+void TMVA::MethodCFMlpANN::ReadWeightsFromStream( std::istream & istr )
 {
    // read back the weight from the training from file (stream)
    TString var;
@@ -568,7 +571,7 @@ void TMVA::MethodCFMlpANN::ReadWeightsFromXML( void* wghtnode )
    gTools().ReadAttr( wghtnode, "NLayers",fParam_1.layerm );
    void* minmaxnode = gTools().GetChild(wghtnode);
    const char* minmaxcontent = gTools().GetContent(minmaxnode);
-   std::stringstream content(minmaxcontent);
+   stringstream content(minmaxcontent);
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) 
       content >> fVarn_1.xmin[ivar] >> fVarn_1.xmax[ivar];
    if (fYNN != 0) {
@@ -615,21 +618,21 @@ void TMVA::MethodCFMlpANN::PrintWeights( std::ostream & o ) const
    // write the weights of the neural net
 
    // write number of variables and classes
-   o << "Number of vars " << fParam_1.nvar << endl;
-   o << "Output nodes   " << fParam_1.lclass << endl;
+   o << "Number of vars " << fParam_1.nvar << std::endl;
+   o << "Output nodes   " << fParam_1.lclass << std::endl;
    
    // write extrema of input variables
    for (Int_t ivar=0; ivar<fParam_1.nvar; ivar++) 
-      o << "Var " << ivar << " [" << fVarn_1.xmin[ivar] << " - " << fVarn_1.xmax[ivar] << "]" << endl;
+      o << "Var " << ivar << " [" << fVarn_1.xmin[ivar] << " - " << fVarn_1.xmax[ivar] << "]" << std::endl;
         
    // write number of layers (sum of: input + output + hidden)
-   o << "Number of layers " << fParam_1.layerm << endl;
+   o << "Number of layers " << fParam_1.layerm << std::endl;
    
    o << "Nodes per layer ";
    for (Int_t layer=0; layer<fParam_1.layerm; layer++)
       // write number of neurons for each layer
       o << fNeur_1.neuron[layer] << "     ";   
-   o << endl;
+   o << std::endl;
         
    // write weights
    for (Int_t layer=1; layer<=fParam_1.layerm-1; layer++) { 
@@ -652,22 +655,22 @@ void TMVA::MethodCFMlpANN::PrintWeights( std::ostream & o ) const
             o << Ww_ref(fNeur_1.ww, layer+1, j) << "   ";
 
          }
-         o << endl;
+         o << std::endl;
          //for (i=1; i<=fNeur_1.neuron[layer-1]; i++) {
          for (i=1; i<=fNeur_1.neuron[layer-1]; i++) {
             for (j=jmin; j<=jmax; j++) {
                //               o << fNeur_1.w[(i*max_nNodes_ + j)*max_nLayers_ + layer - 186] << "   ";
                o << W_ref(fNeur_1.w, layer+1, j, i) << "   ";
             }
-            o << endl;
+            o << std::endl;
          }
             
          // skip two empty lines
-         o << endl;
+         o << std::endl;
       }
    }
    for (Int_t layer=0; layer<fParam_1.layerm; layer++) {
-      o << "Del.temp in layer " << layer << " :  " << fDel_1.temp[layer] << endl;
+      o << "Del.temp in layer " << layer << " :  " << fDel_1.temp[layer] << std::endl;
    }      
 }
 //_______________________________________________________________________
@@ -679,8 +682,8 @@ TMVA::MethodCFMlpANN* TMVA::MethodCFMlpANN::This( void )
 void TMVA::MethodCFMlpANN::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write specific classifier response
-   fout << "   // not implemented for class: \"" << className << "\"" << endl;
-   fout << "};" << endl;
+   fout << "   // not implemented for class: \"" << className << "\"" << std::endl;
+   fout << "};" << std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodCommittee.cxx b/tmva/src/MethodCommittee.cxx
index fb3d437c474..bfcc783da3a 100644
--- a/tmva/src/MethodCommittee.cxx
+++ b/tmva/src/MethodCommittee.cxx
@@ -183,7 +183,7 @@ void TMVA::MethodCommittee::WriteStateToFile() const
    std::ofstream* fout = new std::ofstream( fname );
    if (!fout->good()) { // file not found --> Error
       Log() << kFATAL << "<WriteStateToFile> "
-              << "unable to open output  weight file: " << fname << endl;
+              << "unable to open output  weight file: " << fname << std::endl;
    }
    
    WriteStateToStream( *fout );
@@ -260,7 +260,7 @@ Double_t TMVA::MethodCommittee::AdaBoost( TMVA::MethodBase* method )
    if (Data()->GetNTrainingEvents()) Log() << kFATAL << "<AdaBoost> Data().TrainingTree() is zero pointer" << Endl;
 
    Double_t err=0, sumw=0, sumwfalse=0, count=0;
-   vector<Char_t> correctSelected;
+   std::vector<Char_t> correctSelected;
 
    // loop over all events in training tree
    MethodBase* mbase = (MethodBase*)method;
@@ -370,7 +370,7 @@ void TMVA::MethodCommittee::AddWeightsXMLTo( void* /*parent*/ ) const {
 }
   
 //_______________________________________________________________________
-void  TMVA::MethodCommittee::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodCommittee::ReadWeightsFromStream( std::istream& istr )
 {
    // read the state of the method from an input stream
 
@@ -472,7 +472,7 @@ vector< Double_t > TMVA::MethodCommittee::GetVariableImportance()
    fVariableImportance.resize(GetNvar());
    //    Double_t  sum=0;
    //    for (int itree = 0; itree < fNMembers; itree++){
-   //       vector<Double_t> relativeImportance(GetCommittee()[itree]->GetVariableImportance());
+   //       std::vector<Double_t> relativeImportance(GetCommittee()[itree]->GetVariableImportance());
    //       for (unsigned int i=0; i< relativeImportance.size(); i++) {
    //          fVariableImportance[i] += relativeImportance[i] ;
    //       } 
@@ -487,7 +487,7 @@ vector< Double_t > TMVA::MethodCommittee::GetVariableImportance()
 Double_t TMVA::MethodCommittee::GetVariableImportance(UInt_t ivar)
 {
    // return the variable importance
-   vector<Double_t> relativeImportance = this->GetVariableImportance();
+   std::vector<Double_t> relativeImportance = this->GetVariableImportance();
    if (ivar < (UInt_t)relativeImportance.size()) return relativeImportance[ivar];
    else  Log() << kFATAL << "<GetVariableImportance> ivar = " << ivar << " is out of range " << Endl;
 
@@ -514,8 +514,8 @@ const TMVA::Ranking* TMVA::MethodCommittee::CreateRanking()
 void TMVA::MethodCommittee::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write specific classifier response
-   fout << "   // not implemented for class: \"" << className << "\"" << endl;
-   fout << "};" << endl;
+   fout << "   // not implemented for class: \"" << className << "\"" << std::endl;
+   fout << "};" << std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodCompositeBase.cxx b/tmva/src/MethodCompositeBase.cxx
index e851631e76f..350a994afe1 100644
--- a/tmva/src/MethodCompositeBase.cxx
+++ b/tmva/src/MethodCompositeBase.cxx
@@ -81,8 +81,8 @@ TMVA::MethodCompositeBase::MethodCompositeBase( Types::EMVA methodType,
 TMVA::IMethod* TMVA::MethodCompositeBase::GetMethod( const TString &methodTitle ) const
 {
    // returns pointer to MVA that corresponds to given method title
-   vector<IMethod*>::const_iterator itrMethod    = fMethods.begin();
-   vector<IMethod*>::const_iterator itrMethodEnd = fMethods.end();
+   std::vector<IMethod*>::const_iterator itrMethod    = fMethods.begin();
+   std::vector<IMethod*>::const_iterator itrMethodEnd = fMethods.end();
 
    for (; itrMethod != itrMethodEnd; itrMethod++) {
       MethodBase* mva = dynamic_cast<MethodBase*>(*itrMethod);
@@ -95,7 +95,7 @@ TMVA::IMethod* TMVA::MethodCompositeBase::GetMethod( const TString &methodTitle
 TMVA::IMethod* TMVA::MethodCompositeBase::GetMethod( const Int_t index ) const
 {
    // returns pointer to MVA that corresponds to given method index
-   vector<IMethod*>::const_iterator itrMethod = fMethods.begin()+index;
+   std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin()+index;
    if (itrMethod<fMethods.end()) return *itrMethod;
    else                          return 0;
 }
@@ -130,7 +130,7 @@ void TMVA::MethodCompositeBase::AddWeightsXMLTo( void* parent ) const
 TMVA::MethodCompositeBase::~MethodCompositeBase( void )
 {
    // delete methods
-   vector<IMethod*>::iterator itrMethod = fMethods.begin();
+   std::vector<IMethod*>::iterator itrMethod = fMethods.begin();
    for (; itrMethod != fMethods.end(); itrMethod++) {
       Log() << kVERBOSE << "Delete method: " << (*itrMethod)->GetName() << Endl;
       delete (*itrMethod);
@@ -206,7 +206,7 @@ void TMVA::MethodCompositeBase::ReadWeightsFromXML( void* wghtnode )
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodCompositeBase::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodCompositeBase::ReadWeightsFromStream( std::istream& istr )
 {
    // text streamer
    TString var, dummy;
diff --git a/tmva/src/MethodCuts.cxx b/tmva/src/MethodCuts.cxx
index dab8b515179..bc8ebed7358 100644
--- a/tmva/src/MethodCuts.cxx
+++ b/tmva/src/MethodCuts.cxx
@@ -222,16 +222,16 @@ void TMVA::MethodCuts::Init( void )
 
    // vector with fit results
    fNpar      = 2*GetNvar();
-   fRangeSign = new vector<Int_t>   ( GetNvar() );
+   fRangeSign = new std::vector<Int_t>   ( GetNvar() );
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) (*fRangeSign)[ivar] = +1;
 
-   fMeanS     = new vector<Double_t>( GetNvar() ); 
-   fMeanB     = new vector<Double_t>( GetNvar() ); 
-   fRmsS      = new vector<Double_t>( GetNvar() );  
-   fRmsB      = new vector<Double_t>( GetNvar() );  
+   fMeanS     = new std::vector<Double_t>( GetNvar() ); 
+   fMeanB     = new std::vector<Double_t>( GetNvar() ); 
+   fRmsS      = new std::vector<Double_t>( GetNvar() );  
+   fRmsB      = new std::vector<Double_t>( GetNvar() );  
 
    // get the variable specific options, first initialize default
-   fFitParams = new vector<EFitParameters>( GetNvar() );
+   fFitParams = new std::vector<EFitParameters>( GetNvar() );
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) (*fFitParams)[ivar] = kNotEnforced;
 
    fFitMethod = kUseMonteCarlo;
@@ -505,12 +505,12 @@ void TMVA::MethodCuts::PrintCuts( Double_t effS ) const
    Log() << Endl;
    for (UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
       Log() << kINFO 
-              << "Cut[" << setw(2) << ivar << "]: " 
-              << setw(10) << cutsMin[ivar] 
+              << "Cut[" << std::setw(2) << ivar << "]: " 
+              << std::setw(10) << cutsMin[ivar] 
               << " < " 
-              << setw(maxL) << (*varVec)[ivar]
+              << std::setw(maxL) << (*varVec)[ivar]
               << " <= " 
-              << setw(10) << cutsMax[ivar] << Endl;
+              << std::setw(10) << cutsMax[ivar] << Endl;
    }
    for (UInt_t i=0; i<maxLine; i++) Log() << "-";
    Log() << Endl;
@@ -606,7 +606,7 @@ void  TMVA::MethodCuts::Train( void )
       else if (xmax < fCutRange[ivar]->GetMax()) fCutRange[ivar]->SetMax( xmax );
    }   
 
-   vector<TH1F*> signalDist, bkgDist;
+   std::vector<TH1F*> signalDist, bkgDist;
 
    // this is important: reset the branch addresses of the training tree to the current event
    delete fEffBvsSLocal;
@@ -624,7 +624,7 @@ void  TMVA::MethodCuts::Train( void )
        fFitMethod == kUseSimulatedAnnealing) {
 
       // ranges
-      vector<Interval*> ranges;
+      std::vector<Interval*> ranges;
 
       for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
 
@@ -1072,12 +1072,12 @@ void TMVA::MethodCuts::CreateVariablePDFs( void )
    // for PDF method: create efficiency reference histograms and PDFs
 
    // create list of histograms and PDFs
-   fVarHistS        = new vector<TH1*>( GetNvar() );
-   fVarHistB        = new vector<TH1*>( GetNvar() );
-   fVarHistS_smooth = new vector<TH1*>( GetNvar() );
-   fVarHistB_smooth = new vector<TH1*>( GetNvar() );
-   fVarPdfS         = new vector<PDF*>( GetNvar() );
-   fVarPdfB         = new vector<PDF*>( GetNvar() );
+   fVarHistS        = new std::vector<TH1*>( GetNvar() );
+   fVarHistB        = new std::vector<TH1*>( GetNvar() );
+   fVarHistS_smooth = new std::vector<TH1*>( GetNvar() );
+   fVarHistB_smooth = new std::vector<TH1*>( GetNvar() );
+   fVarPdfS         = new std::vector<PDF*>( GetNvar() );
+   fVarPdfB         = new std::vector<PDF*>( GetNvar() );
 
    Int_t nsmooth = 0;
 
@@ -1178,7 +1178,7 @@ void TMVA::MethodCuts::CreateVariablePDFs( void )
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodCuts::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodCuts::ReadWeightsFromStream( std::istream& istr )
 {
    // read the cuts from stream
    TString dummy;
@@ -1668,8 +1668,8 @@ Double_t TMVA::MethodCuts::GetEfficiency( const TString& theString, Types::ETree
 void TMVA::MethodCuts::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write specific classifier response
-   fout << "   // not implemented for class: \"" << className << "\"" << endl;
-   fout << "};" << endl;
+   fout << "   // not implemented for class: \"" << className << "\"" << std::endl;
+   fout << "};" << std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodDT.cxx b/tmva/src/MethodDT.cxx
index 133dd66204f..fef939b88d4 100644
--- a/tmva/src/MethodDT.cxx
+++ b/tmva/src/MethodDT.cxx
@@ -409,7 +409,7 @@ Double_t TMVA::MethodDT::PruneTree(const Int_t /* methodIndex */ )
       Double_t delta = fDeltaPruneStrength;
       
       DecisionTree*  dcopy;
-      vector<Double_t> q;
+      std::vector<Double_t> q;
       multimap<Double_t,Double_t> quality;
       Int_t nnodes=fTree->GetNNodes();
 
@@ -424,7 +424,7 @@ Double_t TMVA::MethodDT::PruneTree(const Int_t /* methodIndex */ )
          dcopy->SetPruneStrength(alpha+=delta);
          dcopy->PruneTree();
          q.push_back(TestTreeQuality(dcopy));
-         quality.insert(pair<const Double_t,Double_t>(q.back(),alpha));
+         quality.insert(std::pair<const Double_t,Double_t>(q.back(),alpha));
          nnodes=dcopy->GetNNodes();
          if (previousNnodes == nnodes) troubleCount++;
          else { 
@@ -518,7 +518,7 @@ void TMVA::MethodDT::ReadWeightsFromXML( void* wghtnode)
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodDT::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodDT::ReadWeightsFromStream( std::istream& istr )
 {
    delete fTree;
    fTree = new DecisionTree();
diff --git a/tmva/src/MethodFDA.cxx b/tmva/src/MethodFDA.cxx
index dd56c7fa285..f80c51f0e4c 100644
--- a/tmva/src/MethodFDA.cxx
+++ b/tmva/src/MethodFDA.cxx
@@ -61,6 +61,8 @@
 #include "TMVA/MCFitter.h"
 #include "TMVA/Config.h"
 
+using std::stringstream;
+
 REGISTER_METHOD(FDA)
 
 ClassImp(TMVA::MethodFDA)
@@ -402,7 +404,7 @@ void TMVA::MethodFDA::PrintResults( const TString& fitter, std::vector<Double_t>
    // check maximum length of variable name
    Log() << kINFO;
    Log() << "Results for parameter fit using \"" << fitter << "\" fitter:" << Endl;
-   vector<TString>  parNames;
+   std::vector<TString>  parNames;
    for (UInt_t ipar=0; ipar<pars.size(); ipar++) parNames.push_back( Form("Par(%i)",ipar ) );
    gTools().FormattedOutput( pars, parNames, "Parameter" , "Fit result", Log(), "%g" );   
    Log() << "Discriminator expression: \"" << fFormulaStringP << "\"" << Endl;
@@ -581,7 +583,7 @@ void TMVA::MethodFDA::CalculateMulticlassValues( const TMVA::Event*& evt, std::v
 
 
 //_______________________________________________________________________
-void  TMVA::MethodFDA::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodFDA::ReadWeightsFromStream( std::istream& istr )
 {
    // read back the training results from a file (stream)
 
@@ -655,19 +657,19 @@ void TMVA::MethodFDA::ReadWeightsFromXML( void* wghtnode )
 void TMVA::MethodFDA::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write FDA-specific classifier response
-   fout << "   double              fParameter[" << fNPars << "];" << endl;
-   fout << "};" << endl;
-   fout << "" << endl;
-   fout << "inline void " << className << "::Initialize() " << endl;
-   fout << "{" << endl;
+   fout << "   double              fParameter[" << fNPars << "];" << std::endl;
+   fout << "};" << std::endl;
+   fout << "" << std::endl;
+   fout << "inline void " << className << "::Initialize() " << std::endl;
+   fout << "{" << std::endl;
    for(UInt_t ipar=0; ipar<fNPars; ipar++) {
-      fout << "   fParameter[" << ipar << "] = " << fBestPars[ipar] << ";" << endl;
+      fout << "   fParameter[" << ipar << "] = " << fBestPars[ipar] << ";" << std::endl;
    }
-   fout << "}" << endl;
-   fout << endl;
-   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   // interpret the formula" << endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // interpret the formula" << std::endl;
 
    // replace parameters
    TString str = fFormulaStringT;
@@ -680,16 +682,16 @@ void TMVA::MethodFDA::MakeClassSpecific( std::ostream& fout, const TString& clas
       str.ReplaceAll( Form("[%i]", ivar+fNPars), Form("inputValues[%i]", ivar) );
    }
 
-   fout << "   double retval = " << str << ";" << endl;
-   fout << endl;
-   fout << "   return retval; " << endl;
-   fout << "}" << endl;
-   fout << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // nothing to clear" << endl;
-   fout << "}" << endl;
+   fout << "   double retval = " << str << ";" << std::endl;
+   fout << std::endl;
+   fout << "   return retval; " << std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // nothing to clear" << std::endl;
+   fout << "}" << std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodFisher.cxx b/tmva/src/MethodFisher.cxx
index ef9b5775df4..3004735b653 100644
--- a/tmva/src/MethodFisher.cxx
+++ b/tmva/src/MethodFisher.cxx
@@ -555,12 +555,12 @@ void TMVA::MethodFisher::PrintCoefficients( void )
       // Print normalisation expression (see Tools.cxx): "2*(x - xmin)/(xmax - xmin) - 1.0"
       for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
          Log() << kINFO 
-                 << setw(maxL+9) << TString("[") + GetInputLabel(ivar) + "]' = 2*(" 
-                 << setw(maxL+2) << TString("[") + GetInputLabel(ivar) + "]"
-                 << setw(3) << (GetXmin(ivar) > 0 ? " - " : " + ")
-                 << setw(6) << TMath::Abs(GetXmin(ivar)) << setw(3) << ")/"
-                 << setw(6) << (GetXmax(ivar) -  GetXmin(ivar) )
-                 << setw(3) << " - 1"
+                 << std::setw(maxL+9) << TString("[") + GetInputLabel(ivar) + "]' = 2*(" 
+                 << std::setw(maxL+2) << TString("[") + GetInputLabel(ivar) + "]"
+                 << std::setw(3) << (GetXmin(ivar) > 0 ? " - " : " + ")
+                 << std::setw(6) << TMath::Abs(GetXmin(ivar)) << std::setw(3) << ")/"
+                 << std::setw(6) << (GetXmax(ivar) -  GetXmin(ivar) )
+                 << std::setw(3) << " - 1"
                  << Endl;
       }
       Log() << kINFO << "The TMVA Reader will properly account for this normalisation, but if the" << Endl;
@@ -571,7 +571,7 @@ void TMVA::MethodFisher::PrintCoefficients( void )
 }
   
 //_______________________________________________________________________
-void TMVA::MethodFisher::ReadWeightsFromStream( istream& istr )
+void TMVA::MethodFisher::ReadWeightsFromStream( std::istream& istr )
 {
    // read Fisher coefficients from weight file
    istr >> fF0;
@@ -619,41 +619,41 @@ void TMVA::MethodFisher::MakeClassSpecific( std::ostream& fout, const TString& c
 {
    // write Fisher-specific classifier response
    Int_t dp = fout.precision();
-   fout << "   double              fFisher0;" << endl;
-   fout << "   std::vector<double> fFisherCoefficients;" << endl;
-   fout << "};" << endl;
-   fout << "" << endl;
-   fout << "inline void " << className << "::Initialize() " << endl;
-   fout << "{" << endl;
-   fout << "   fFisher0 = " << std::setprecision(12) << fF0 << ";" << endl;
+   fout << "   double              fFisher0;" << std::endl;
+   fout << "   std::vector<double> fFisherCoefficients;" << std::endl;
+   fout << "};" << std::endl;
+   fout << "" << std::endl;
+   fout << "inline void " << className << "::Initialize() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   fFisher0 = " << std::setprecision(12) << fF0 << ";" << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
-      fout << "   fFisherCoefficients.push_back( " << std::setprecision(12) << (*fFisherCoeff)[ivar] << " );" << endl;
+      fout << "   fFisherCoefficients.push_back( " << std::setprecision(12) << (*fFisherCoeff)[ivar] << " );" << std::endl;
    }
-   fout << endl;
-   fout << "   // sanity check" << endl;
-   fout << "   if (fFisherCoefficients.size() != fNvars) {" << endl;
-   fout << "      std::cout << \"Problem in class \\\"\" << fClassName << \"\\\"::Initialize: mismatch in number of input values\"" << endl;
-   fout << "                << fFisherCoefficients.size() << \" != \" << fNvars << std::endl;" << endl;
-   fout << "      fStatusIsClean = false;" << endl;
-   fout << "   }         " << endl;
-   fout << "}" << endl;
-   fout << endl;
-   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   double retval = fFisher0;" << endl;
-   fout << "   for (size_t ivar = 0; ivar < fNvars; ivar++) {" << endl;
-   fout << "      retval += fFisherCoefficients[ivar]*inputValues[ivar];" << endl;
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   return retval;" << endl;
-   fout << "}" << endl;
-   fout << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // clear coefficients" << endl;
-   fout << "   fFisherCoefficients.clear(); " << endl;
-   fout << "}" << endl;
+   fout << std::endl;
+   fout << "   // sanity check" << std::endl;
+   fout << "   if (fFisherCoefficients.size() != fNvars) {" << std::endl;
+   fout << "      std::cout << \"Problem in class \\\"\" << fClassName << \"\\\"::Initialize: mismatch in number of input values\"" << std::endl;
+   fout << "                << fFisherCoefficients.size() << \" != \" << fNvars << std::endl;" << std::endl;
+   fout << "      fStatusIsClean = false;" << std::endl;
+   fout << "   }         " << std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   double retval = fFisher0;" << std::endl;
+   fout << "   for (size_t ivar = 0; ivar < fNvars; ivar++) {" << std::endl;
+   fout << "      retval += fFisherCoefficients[ivar]*inputValues[ivar];" << std::endl;
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   return retval;" << std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // clear coefficients" << std::endl;
+   fout << "   fFisherCoefficients.clear(); " << std::endl;
+   fout << "}" << std::endl;
    fout << std::setprecision(dp);
 }
 
diff --git a/tmva/src/MethodHMatrix.cxx b/tmva/src/MethodHMatrix.cxx
index 47ebef42d4b..4fb54d7ea71 100644
--- a/tmva/src/MethodHMatrix.cxx
+++ b/tmva/src/MethodHMatrix.cxx
@@ -265,7 +265,7 @@ Double_t TMVA::MethodHMatrix::GetChi2( Types::ESBType type )
 
    // loop over variables
    UInt_t ivar(0), jvar(0), nvar(GetNvar());
-   vector<Double_t> val( nvar );
+   std::vector<Double_t> val( nvar );
 
    // transform the event according to the given type (signal/background)
    if (type==Types::kSignal)
@@ -323,7 +323,7 @@ void TMVA::MethodHMatrix::ReadWeightsFromXML( void* wghtnode )
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodHMatrix::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodHMatrix::ReadWeightsFromStream( std::istream& istr )
 {
    // read variable names and min/max
    // NOTE: the latter values are mandatory for the normalisation 
@@ -352,91 +352,91 @@ void  TMVA::MethodHMatrix::ReadWeightsFromStream( istream& istr )
 void TMVA::MethodHMatrix::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write Fisher-specific classifier response
-   fout << "   // arrays of input evt vs. variable " << endl;
-   fout << "   double fInvHMatrixS[" << GetNvar() << "][" << GetNvar() << "]; // inverse H-matrix (signal)" << endl;
-   fout << "   double fInvHMatrixB[" << GetNvar() << "][" << GetNvar() << "]; // inverse H-matrix (background)" << endl;
-   fout << "   double fVecMeanS[" << GetNvar() << "];    // vector of mean values (signal)" << endl;
-   fout << "   double fVecMeanB[" << GetNvar() << "];    // vector of mean values (background)" << endl;
-   fout << "   " << endl;
-   fout << "   double GetChi2( const std::vector<double>& inputValues, int type ) const;" << endl;
-   fout << "};" << endl;
-   fout << "   " << endl;
-   fout << "void " << className << "::Initialize() " << endl;
-   fout << "{" << endl;
-   fout << "   // init vectors with mean values" << endl;
+   fout << "   // arrays of input evt vs. variable " << std::endl;
+   fout << "   double fInvHMatrixS[" << GetNvar() << "][" << GetNvar() << "]; // inverse H-matrix (signal)" << std::endl;
+   fout << "   double fInvHMatrixB[" << GetNvar() << "][" << GetNvar() << "]; // inverse H-matrix (background)" << std::endl;
+   fout << "   double fVecMeanS[" << GetNvar() << "];    // vector of mean values (signal)" << std::endl;
+   fout << "   double fVecMeanB[" << GetNvar() << "];    // vector of mean values (background)" << std::endl;
+   fout << "   " << std::endl;
+   fout << "   double GetChi2( const std::vector<double>& inputValues, int type ) const;" << std::endl;
+   fout << "};" << std::endl;
+   fout << "   " << std::endl;
+   fout << "void " << className << "::Initialize() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // init vectors with mean values" << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
-      fout << "   fVecMeanS[" << ivar << "] = " << (*fVecMeanS)(ivar) << ";" << endl;
-      fout << "   fVecMeanB[" << ivar << "] = " << (*fVecMeanB)(ivar) << ";" << endl;
+      fout << "   fVecMeanS[" << ivar << "] = " << (*fVecMeanS)(ivar) << ";" << std::endl;
+      fout << "   fVecMeanB[" << ivar << "] = " << (*fVecMeanB)(ivar) << ";" << std::endl;
    }
-   fout << "   " << endl;
-   fout << "   // init H-matrices" << endl;
+   fout << "   " << std::endl;
+   fout << "   // init H-matrices" << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
       for (UInt_t jvar=0; jvar<GetNvar(); jvar++) {
          fout << "   fInvHMatrixS[" << ivar << "][" << jvar << "] = " 
-              << (*fInvHMatrixS)(ivar,jvar) << ";" << endl;
+              << (*fInvHMatrixS)(ivar,jvar) << ";" << std::endl;
          fout << "   fInvHMatrixB[" << ivar << "][" << jvar << "] = " 
-              << (*fInvHMatrixB)(ivar,jvar) << ";" << endl;
+              << (*fInvHMatrixB)(ivar,jvar) << ";" << std::endl;
       }
    }
-   fout << "}" << endl;
-   fout << "   " << endl;
-   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   // returns the H-matrix signal estimator" << endl;
-   fout << "   std::vector<double> inputValuesSig = inputValues;" << endl;
-   fout << "   std::vector<double> inputValuesBgd = inputValues;" << endl;
+   fout << "}" << std::endl;
+   fout << "   " << std::endl;
+   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // returns the H-matrix signal estimator" << std::endl;
+   fout << "   std::vector<double> inputValuesSig = inputValues;" << std::endl;
+   fout << "   std::vector<double> inputValuesBgd = inputValues;" << std::endl;
    if (GetTransformationHandler().GetTransformationList().GetSize() != 0) {
 
       UInt_t signalClass    =DataInfo().GetClassInfo("Signal")->GetNumber();
       UInt_t backgroundClass=DataInfo().GetClassInfo("Background")->GetNumber();
 
-      fout << "   Transform(inputValuesSig," << signalClass << ");" << endl;
-      fout << "   Transform(inputValuesBgd," << backgroundClass << ");" << endl;
+      fout << "   Transform(inputValuesSig," << signalClass << ");" << std::endl;
+      fout << "   Transform(inputValuesBgd," << backgroundClass << ");" << std::endl;
    }
 
-//   fout << "   for(uint i=0; i<GetNvar(); ++i) std::cout << inputValuesSig.at(i) << \"  \" << inputValuesBgd.at(i) << std::endl; " << endl;
-
-   fout << "   double s = GetChi2( inputValuesSig, " << Types::kSignal << " );" << endl;
-   fout << "   double b = GetChi2( inputValuesBgd, " << Types::kBackground << " );" << endl;
-
-//   fout << "   std::cout << s << \"  \" << b << std::endl; " << endl;
-
-   fout << "   " << endl;
-   fout << "   if (s+b <= 0) std::cout << \"Problem in class " << className << "::GetMvaValue__: s+b = \"" << endl;
-   fout << "                           << s+b << \" <= 0 \"  << std::endl;" << endl;
-   fout << "   " << endl;
-   fout << "   return (b - s)/(s + b);" << endl;
-   fout << "}" << endl;
-   fout << "   " << endl;
-   fout << "inline double " << className << "::GetChi2( const std::vector<double>& inputValues, int type ) const" << endl;
-   fout << "{" << endl;
-   fout << "   // compute chi2-estimator for event according to type (signal/background)" << endl;
-   fout << "   " << endl;
-   fout << "   size_t ivar,jvar;" << endl;
-   fout << "   double chi2 = 0;" << endl;
-   fout << "   for (ivar=0; ivar<GetNvar(); ivar++) {" << endl;
-   fout << "      for (jvar=0; jvar<GetNvar(); jvar++) {" << endl;
-   fout << "         if (type == " << Types::kSignal << ") " << endl;
-   fout << "            chi2 += ( (inputValues[ivar] - fVecMeanS[ivar])*(inputValues[jvar] - fVecMeanS[jvar])" << endl;
-   fout << "                      * fInvHMatrixS[ivar][jvar] );" << endl;
-   fout << "         else" << endl;
-   fout << "            chi2 += ( (inputValues[ivar] - fVecMeanB[ivar])*(inputValues[jvar] - fVecMeanB[jvar])" << endl;
-   fout << "                      * fInvHMatrixB[ivar][jvar] );" << endl;
-   fout << "      }" << endl;
-   fout << "   }   // loop over variables   " << endl;
-   fout << "   " << endl;
-   fout << "   // sanity check" << endl;
-   fout << "   if (chi2 < 0) std::cout << \"Problem in class " << className << "::GetChi2: chi2 = \"" << endl;
-   fout << "                           << chi2 << \" < 0 \"  << std::endl;" << endl;
-   fout << "   " << endl;
-   fout << "   return chi2;" << endl;
-   fout << "}" << endl;
-   fout << "   " << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // nothing to clear" << endl;
-   fout << "}" << endl;
+//   fout << "   for(uint i=0; i<GetNvar(); ++i) std::cout << inputValuesSig.at(i) << \"  \" << inputValuesBgd.at(i) << std::endl; " << std::endl;
+
+   fout << "   double s = GetChi2( inputValuesSig, " << Types::kSignal << " );" << std::endl;
+   fout << "   double b = GetChi2( inputValuesBgd, " << Types::kBackground << " );" << std::endl;
+
+//   fout << "   std::cout << s << \"  \" << b << std::endl; " << std::endl;
+
+   fout << "   " << std::endl;
+   fout << "   if (s+b <= 0) std::cout << \"Problem in class " << className << "::GetMvaValue__: s+b = \"" << std::endl;
+   fout << "                           << s+b << \" <= 0 \"  << std::endl;" << std::endl;
+   fout << "   " << std::endl;
+   fout << "   return (b - s)/(s + b);" << std::endl;
+   fout << "}" << std::endl;
+   fout << "   " << std::endl;
+   fout << "inline double " << className << "::GetChi2( const std::vector<double>& inputValues, int type ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // compute chi2-estimator for event according to type (signal/background)" << std::endl;
+   fout << "   " << std::endl;
+   fout << "   size_t ivar,jvar;" << std::endl;
+   fout << "   double chi2 = 0;" << std::endl;
+   fout << "   for (ivar=0; ivar<GetNvar(); ivar++) {" << std::endl;
+   fout << "      for (jvar=0; jvar<GetNvar(); jvar++) {" << std::endl;
+   fout << "         if (type == " << Types::kSignal << ") " << std::endl;
+   fout << "            chi2 += ( (inputValues[ivar] - fVecMeanS[ivar])*(inputValues[jvar] - fVecMeanS[jvar])" << std::endl;
+   fout << "                      * fInvHMatrixS[ivar][jvar] );" << std::endl;
+   fout << "         else" << std::endl;
+   fout << "            chi2 += ( (inputValues[ivar] - fVecMeanB[ivar])*(inputValues[jvar] - fVecMeanB[jvar])" << std::endl;
+   fout << "                      * fInvHMatrixB[ivar][jvar] );" << std::endl;
+   fout << "      }" << std::endl;
+   fout << "   }   // loop over variables   " << std::endl;
+   fout << "   " << std::endl;
+   fout << "   // sanity check" << std::endl;
+   fout << "   if (chi2 < 0) std::cout << \"Problem in class " << className << "::GetChi2: chi2 = \"" << std::endl;
+   fout << "                           << chi2 << \" < 0 \"  << std::endl;" << std::endl;
+   fout << "   " << std::endl;
+   fout << "   return chi2;" << std::endl;
+   fout << "}" << std::endl;
+   fout << "   " << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // nothing to clear" << std::endl;
+   fout << "}" << std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodKNN.cxx b/tmva/src/MethodKNN.cxx
index 501e1bc4e38..4d0417ab370 100644
--- a/tmva/src/MethodKNN.cxx
+++ b/tmva/src/MethodKNN.cxx
@@ -572,10 +572,10 @@ void TMVA::MethodKNN::ReadWeightsFromXML( void* wghtnode ) {
 }
 
 //_______________________________________________________________________
-void TMVA::MethodKNN::ReadWeightsFromStream(istream& is)
+void TMVA::MethodKNN::ReadWeightsFromStream(std::istream& is)
 {
    // read the weights
-   Log() << kINFO << "Starting ReadWeightsFromStream(istream& is) function..." << Endl;
+   Log() << kINFO << "Starting ReadWeightsFromStream(std::istream& is) function..." << Endl;
 
    if (!fEvent.empty()) {
       Log() << kINFO << "Erasing " << fEvent.size() << " previously stored events" << Endl;
diff --git a/tmva/src/MethodLD.cxx b/tmva/src/MethodLD.cxx
index f64e4787a06..e9b7023c975 100644
--- a/tmva/src/MethodLD.cxx
+++ b/tmva/src/MethodLD.cxx
@@ -42,6 +42,8 @@
 #include "TMVA/PDF.h"
 #include "TMVA/ClassifierFactory.h"
 
+using std::vector;
+
 REGISTER_METHOD(LD)
 
 ClassImp(TMVA::MethodLD)
@@ -304,7 +306,7 @@ void TMVA::MethodLD::GetLDCoeff( void )
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodLD::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodLD::ReadWeightsFromStream( std::istream& istr )
 {
    // read LD coefficients from weight file
    for (Int_t iout=0; iout<fNRegOut; iout++)
@@ -370,42 +372,42 @@ void TMVA::MethodLD::ReadWeightsFromXML( void* wghtnode )
 void TMVA::MethodLD::MakeClassSpecific( std::ostream& fout, const TString& className ) const
 {
    // write LD-specific classifier response
-   fout << "   std::vector<double> fLDCoefficients;" << endl;
-   fout << "};" << endl;
-   fout << "" << endl;
-   fout << "inline void " << className << "::Initialize() " << endl;
-   fout << "{" << endl;
+   fout << "   std::vector<double> fLDCoefficients;" << std::endl;
+   fout << "};" << std::endl;
+   fout << "" << std::endl;
+   fout << "inline void " << className << "::Initialize() " << std::endl;
+   fout << "{" << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar()+1; ivar++) {
       Int_t dp = fout.precision();
       fout << "   fLDCoefficients.push_back( "
            << std::setprecision(12) << (*(*fLDCoeff)[0])[ivar]
-           << std::setprecision(dp) << " );" << endl;
+           << std::setprecision(dp) << " );" << std::endl;
    }
-   fout << endl;
-   fout << "   // sanity check" << endl;
-   fout << "   if (fLDCoefficients.size() != fNvars+1) {" << endl;
-   fout << "      std::cout << \"Problem in class \\\"\" << fClassName << \"\\\"::Initialize: mismatch in number of input values\"" << endl;
-   fout << "                << fLDCoefficients.size() << \" != \" << fNvars+1 << std::endl;" << endl;
-   fout << "      fStatusIsClean = false;" << endl;
-   fout << "   }         " << endl;
-   fout << "}" << endl;
-   fout << endl;
-   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   double retval = fLDCoefficients[0];" << endl;
-   fout << "   for (size_t ivar = 1; ivar < fNvars+1; ivar++) {" << endl;
-   fout << "      retval += fLDCoefficients[ivar]*inputValues[ivar-1];" << endl;
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   return retval;" << endl;
-   fout << "}" << endl;
-   fout << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // clear coefficients" << endl;
-   fout << "   fLDCoefficients.clear(); " << endl;
-   fout << "}" << endl;
+   fout << std::endl;
+   fout << "   // sanity check" << std::endl;
+   fout << "   if (fLDCoefficients.size() != fNvars+1) {" << std::endl;
+   fout << "      std::cout << \"Problem in class \\\"\" << fClassName << \"\\\"::Initialize: mismatch in number of input values\"" << std::endl;
+   fout << "                << fLDCoefficients.size() << \" != \" << fNvars+1 << std::endl;" << std::endl;
+   fout << "      fStatusIsClean = false;" << std::endl;
+   fout << "   }         " << std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+   fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   double retval = fLDCoefficients[0];" << std::endl;
+   fout << "   for (size_t ivar = 1; ivar < fNvars+1; ivar++) {" << std::endl;
+   fout << "      retval += fLDCoefficients[ivar]*inputValues[ivar-1];" << std::endl;
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   return retval;" << std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // clear coefficients" << std::endl;
+   fout << "   fLDCoefficients.clear(); " << std::endl;
+   fout << "}" << std::endl;
 }
 //_______________________________________________________________________
 const TMVA::Ranking* TMVA::MethodLD::CreateRanking()
@@ -468,12 +470,12 @@ void TMVA::MethodLD::PrintCoefficients( void )
       // Print normalisation expression (see Tools.cxx): "2*(x - xmin)/(xmax - xmin) - 1.0"
       for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
          Log() << kINFO 
-                 << setw(maxL+9) << TString("[") + GetInputLabel(ivar) + "]' = 2*(" 
-                 << setw(maxL+2) << TString("[") + GetInputLabel(ivar) + "]"
-                 << setw(3) << (GetXmin(ivar) > 0 ? " - " : " + ")
-                 << setw(6) << TMath::Abs(GetXmin(ivar)) << setw(3) << ")/"
-                 << setw(6) << (GetXmax(ivar) -  GetXmin(ivar) )
-                 << setw(3) << " - 1"
+                 << std::setw(maxL+9) << TString("[") + GetInputLabel(ivar) + "]' = 2*(" 
+                 << std::setw(maxL+2) << TString("[") + GetInputLabel(ivar) + "]"
+                 << std::setw(3) << (GetXmin(ivar) > 0 ? " - " : " + ")
+                 << std::setw(6) << TMath::Abs(GetXmin(ivar)) << std::setw(3) << ")/"
+                 << std::setw(6) << (GetXmax(ivar) -  GetXmin(ivar) )
+                 << std::setw(3) << " - 1"
                  << Endl;
       }
       Log() << kINFO << "The TMVA Reader will properly account for this normalisation, but if the" << Endl;
diff --git a/tmva/src/MethodLikelihood.cxx b/tmva/src/MethodLikelihood.cxx
index 9696f310c2a..1bab2bf7ecb 100644
--- a/tmva/src/MethodLikelihood.cxx
+++ b/tmva/src/MethodLikelihood.cxx
@@ -312,7 +312,7 @@ void TMVA::MethodLikelihood::Train( void )
    // the transformations are applied using both classes, also the corresponding boundaries
    // need to take this into account
    UInt_t nvar=GetNvar();
-   vector<Double_t> xmin(nvar), xmax(nvar);
+   std::vector<Double_t> xmin(nvar), xmax(nvar);
    for (UInt_t ivar=0; ivar<nvar; ivar++) {xmin[ivar]=1e30; xmax[ivar]=-1e30;}
 
    UInt_t nevents=Data()->GetNEvents();
@@ -527,23 +527,23 @@ Double_t TMVA::MethodLikelihood::TransformLikelihoodOutput( Double_t ps, Double_
 }
 
 //______________________________________________________________________
-void TMVA::MethodLikelihood::WriteOptionsToStream( ostream& o, const TString& prefix ) const
+void TMVA::MethodLikelihood::WriteOptionsToStream( std::ostream& o, const TString& prefix ) const
 {
    // write options to stream
    Configurable::WriteOptionsToStream( o, prefix);
 
    // writing the options defined for the different pdfs
    if (fDefaultPDFLik != 0) {
-      o << prefix << endl << prefix << "#Default Likelihood PDF Options:" << endl << prefix << endl;
+      o << prefix << std::endl << prefix << "#Default Likelihood PDF Options:" << std::endl << prefix << std::endl;
       fDefaultPDFLik->WriteOptionsToStream( o, prefix );
    }
    for (UInt_t ivar = 0; ivar < fPDFSig->size(); ivar++) {
       if ((*fPDFSig)[ivar] != 0) {
-         o << prefix << endl << prefix << Form("#Signal[%d] Likelihood PDF Options:",ivar) << endl << prefix << endl;
+         o << prefix << std::endl << prefix << Form("#Signal[%d] Likelihood PDF Options:",ivar) << std::endl << prefix << std::endl;
          (*fPDFSig)[ivar]->WriteOptionsToStream( o, prefix );
       }
       if ((*fPDFBgd)[ivar] != 0) {
-         o << prefix << endl << prefix << "#Background[%d] Likelihood PDF Options:" << endl << prefix << endl;
+         o << prefix << std::endl << prefix << "#Background[%d] Likelihood PDF Options:" << std::endl << prefix << std::endl;
          (*fPDFBgd)[ivar]->WriteOptionsToStream( o, prefix );
       }
    }
@@ -660,7 +660,7 @@ void  TMVA::MethodLikelihood::ReadWeightsFromXML(void* wghtnode)
    TH1::AddDirectory(addDirStatus);
 }
 //_______________________________________________________________________
-void  TMVA::MethodLikelihood::ReadWeightsFromStream( istream & istr )
+void  TMVA::MethodLikelihood::ReadWeightsFromStream( std::istream & istr )
 {
    // read weight info from file
    // nothing to do for this method
@@ -747,8 +747,8 @@ void  TMVA::MethodLikelihood::WriteMonitoringHistosToFile( void ) const
 void TMVA::MethodLikelihood::MakeClassSpecificHeader( std::ostream& fout, const TString& ) const
 {
    // write specific header of the classifier (mostly include files)
-   fout << "#include <math.h>" << endl;
-   fout << "#include <cstdlib>" << endl;
+   fout << "#include <math.h>" << std::endl;
+   fout << "#include <cstdlib>" << std::endl;
 }
 
 //_______________________________________________________________________
@@ -756,7 +756,7 @@ void TMVA::MethodLikelihood::MakeClassSpecific( std::ostream& fout, const TStrin
 {
    // write specific classifier response
    Int_t dp = fout.precision();
-   fout << "   double       fEpsilon;" << endl;
+   fout << "   double       fEpsilon;" << std::endl;
 
    Int_t * nbin = new Int_t[GetNvar()];
 
@@ -767,26 +767,26 @@ void TMVA::MethodLikelihood::MakeClassSpecific( std::ostream& fout, const TStrin
    }
 
    fout << "   static float fRefS[][" << nbinMax << "]; "
-        << "// signal reference vector [nvars][max_nbins]" << endl;
+        << "// signal reference vector [nvars][max_nbins]" << std::endl;
    fout << "   static float fRefB[][" << nbinMax << "]; "
-        << "// backgr reference vector [nvars][max_nbins]" << endl << endl;
-   fout << "// if a variable has its PDF encoded as a spline0 --> treat it like an Integer valued one" <<endl;
-   fout << "   bool    fHasDiscretPDF[" << GetNvar() <<"]; "<< endl;
+        << "// backgr reference vector [nvars][max_nbins]" << std::endl << std::endl;
+   fout << "// if a variable has its PDF encoded as a spline0 --> treat it like an Integer valued one" <<std::endl;
+   fout << "   bool    fHasDiscretPDF[" << GetNvar() <<"]; "<< std::endl;
    fout << "   int    fNbin[" << GetNvar() << "]; "
-        << "// number of bins (discrete variables may have less bins)" << endl;
-   fout << "   double    fHistMin[" << GetNvar() << "]; " << endl;
-   fout << "   double    fHistMax[" << GetNvar() << "]; " << endl;
-
-   fout << "   double TransformLikelihoodOutput( double, double ) const;" << endl;
-   fout << "};" << endl;
-   fout << "" << endl;
-   fout << "inline void " << className << "::Initialize() " << endl;
-   fout << "{" << endl;
-   fout << "   fEpsilon = " << fEpsilon << ";" << endl;
+        << "// number of bins (discrete variables may have less bins)" << std::endl;
+   fout << "   double    fHistMin[" << GetNvar() << "]; " << std::endl;
+   fout << "   double    fHistMax[" << GetNvar() << "]; " << std::endl;
+
+   fout << "   double TransformLikelihoodOutput( double, double ) const;" << std::endl;
+   fout << "};" << std::endl;
+   fout << "" << std::endl;
+   fout << "inline void " << className << "::Initialize() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   fEpsilon = " << fEpsilon << ";" << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
-      fout << "   fNbin[" << ivar << "] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() << ";" << endl;
-      fout << "   fHistMin[" << ivar << "] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetXaxis()->GetXmin() << ";" << endl;
-      fout << "   fHistMax[" << ivar << "] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetXaxis()->GetXmax() << ";" << endl;
+      fout << "   fNbin[" << ivar << "] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() << ";" << std::endl;
+      fout << "   fHistMin[" << ivar << "] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetXaxis()->GetXmin() << ";" << std::endl;
+      fout << "   fHistMax[" << ivar << "] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetXaxis()->GetXmax() << ";" << std::endl;
       // sanity check (for previous code lines)
       if ((((*fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() != nbin[ivar] ||
             (*fPDFBgd)[ivar]->GetPDFHist()->GetNbinsX() != nbin[ivar])
@@ -803,116 +803,116 @@ void TMVA::MethodLikelihood::MakeClassSpecific( std::ostream& fout, const TStrin
    }
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++){
       if ((*fPDFSig)[ivar]->GetInterpolMethod() == TMVA::PDF::kSpline0)
-         fout << "   fHasDiscretPDF[" << ivar <<"] = true;  " << endl;
+         fout << "   fHasDiscretPDF[" << ivar <<"] = true;  " << std::endl;
       else
-         fout << "   fHasDiscretPDF[" << ivar <<"] = false; " << endl;
+         fout << "   fHasDiscretPDF[" << ivar <<"] = false; " << std::endl;
    }
 
-   fout << "}" << endl << endl;
+   fout << "}" << std::endl << std::endl;
 
    fout << "inline double " << className
-        << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   double ps(1), pb(1);" << endl;
-   fout << "   std::vector<double> inputValuesSig = inputValues;" << endl;
-   fout << "   std::vector<double> inputValuesBgd = inputValues;" << endl;
+        << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   double ps(1), pb(1);" << std::endl;
+   fout << "   std::vector<double> inputValuesSig = inputValues;" << std::endl;
+   fout << "   std::vector<double> inputValuesBgd = inputValues;" << std::endl;
    if (GetTransformationHandler().GetTransformationList().GetSize() != 0) {
-      fout << "   Transform(inputValuesSig,0);" << endl;
-      fout << "   Transform(inputValuesBgd,1);" << endl;
+      fout << "   Transform(inputValuesSig,0);" << std::endl;
+      fout << "   Transform(inputValuesBgd,1);" << std::endl;
    }
-   fout << "   for (size_t ivar = 0; ivar < GetNvar(); ivar++) {" << endl;
-   fout << endl;
-   fout << "      // dummy at present... will be used for variable transforms" << endl;
-   fout << "      double x[2] = { inputValuesSig[ivar], inputValuesBgd[ivar] };" << endl;
-   fout << endl;
-   fout << "      for (int itype=0; itype < 2; itype++) {" << endl;
-   fout << endl;
-   fout << "         // interpolate linearly between adjacent bins" << endl;
-   fout << "         // this is not useful for discrete variables (or forced Spline0)" << endl;
-   fout << "         int bin = int((x[itype] - fHistMin[ivar])/(fHistMax[ivar] - fHistMin[ivar])*fNbin[ivar]) + 0;" << endl;
-   fout << endl;
-   fout << "         // since the test data sample is in general different from the training sample" << endl;
-   fout << "         // it can happen that the min/max of the training sample are trespassed --> correct this" << endl;
-   fout << "         if      (bin < 0) {" << endl;
-   fout << "            bin = 0;" << endl;
-   fout << "            x[itype] = fHistMin[ivar];" << endl;
-   fout << "         }" << endl;
-   fout << "         else if (bin >= fNbin[ivar]) {" << endl;
-   fout << "            bin = fNbin[ivar]-1;" << endl;
-   fout << "            x[itype] = fHistMax[ivar];" << endl;
-   fout << "         }" << endl;
-   fout << endl;
-   fout << "         // find corresponding histogram from cached indices" << endl;
-   fout << "         float ref = (itype == 0) ? fRefS[ivar][bin] : fRefB[ivar][bin];" << endl;
-   fout << endl;
-   fout << "         // sanity check" << endl;
-   fout << "         if (ref < 0) {" << endl;
+   fout << "   for (size_t ivar = 0; ivar < GetNvar(); ivar++) {" << std::endl;
+   fout << std::endl;
+   fout << "      // dummy at present... will be used for variable transforms" << std::endl;
+   fout << "      double x[2] = { inputValuesSig[ivar], inputValuesBgd[ivar] };" << std::endl;
+   fout << std::endl;
+   fout << "      for (int itype=0; itype < 2; itype++) {" << std::endl;
+   fout << std::endl;
+   fout << "         // interpolate linearly between adjacent bins" << std::endl;
+   fout << "         // this is not useful for discrete variables (or forced Spline0)" << std::endl;
+   fout << "         int bin = int((x[itype] - fHistMin[ivar])/(fHistMax[ivar] - fHistMin[ivar])*fNbin[ivar]) + 0;" << std::endl;
+   fout << std::endl;
+   fout << "         // since the test data sample is in general different from the training sample" << std::endl;
+   fout << "         // it can happen that the min/max of the training sample are trespassed --> correct this" << std::endl;
+   fout << "         if      (bin < 0) {" << std::endl;
+   fout << "            bin = 0;" << std::endl;
+   fout << "            x[itype] = fHistMin[ivar];" << std::endl;
+   fout << "         }" << std::endl;
+   fout << "         else if (bin >= fNbin[ivar]) {" << std::endl;
+   fout << "            bin = fNbin[ivar]-1;" << std::endl;
+   fout << "            x[itype] = fHistMax[ivar];" << std::endl;
+   fout << "         }" << std::endl;
+   fout << std::endl;
+   fout << "         // find corresponding histogram from cached indices" << std::endl;
+   fout << "         float ref = (itype == 0) ? fRefS[ivar][bin] : fRefB[ivar][bin];" << std::endl;
+   fout << std::endl;
+   fout << "         // sanity check" << std::endl;
+   fout << "         if (ref < 0) {" << std::endl;
    fout << "            std::cout << \"Fatal error in " << className
-        << ": bin entry < 0 ==> abort\" << std::endl;" << endl;
-   fout << "            std::exit(1);" << endl;
-   fout << "         }" << endl;
-   fout << endl;
-   fout << "         double p = ref;" << endl;
-   fout << endl;
-   fout << "         if (GetType(ivar) != 'I' && !fHasDiscretPDF[ivar]) {" << endl;
-   fout << "            float bincenter = (bin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << endl;
-   fout << "            int nextbin = bin;" << endl;
-   fout << "            if ((x[itype] > bincenter && bin != fNbin[ivar]-1) || bin == 0) " << endl;
-   fout << "               nextbin++;" << endl;
-   fout << "            else" << endl;
-   fout << "               nextbin--;  " << endl;
-   fout << endl;
-   fout << "            double refnext      = (itype == 0) ? fRefS[ivar][nextbin] : fRefB[ivar][nextbin];" << endl;
-   fout << "            float nextbincenter = (nextbin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << endl;
-   fout << endl;
-   fout << "            double dx = bincenter - nextbincenter;" << endl;
-   fout << "            double dy = ref - refnext;" << endl;
-   fout << "            p += (x[itype] - bincenter) * dy/dx;" << endl;
-   fout << "         }" << endl;
-   fout << endl;
-   fout << "         if (p < fEpsilon) p = fEpsilon; // avoid zero response" << endl;
-   fout << endl;
-   fout << "         if (itype == 0) ps *= p;" << endl;
-   fout << "         else            pb *= p;" << endl;
-   fout << "      }            " << endl;
-   fout << "   }     " << endl;
-   fout << endl;
-   fout << "   // the likelihood ratio (transform it ?)" << endl;
-   fout << "   return TransformLikelihoodOutput( ps, pb );   " << endl;
-   fout << "}" << endl << endl;
-
-   fout << "inline double " << className << "::TransformLikelihoodOutput( double ps, double pb ) const" << endl;
-   fout << "{" << endl;
-   fout << "   // returns transformed or non-transformed output" << endl;
-   fout << "   if (ps < fEpsilon) ps = fEpsilon;" << endl;
-   fout << "   if (pb < fEpsilon) pb = fEpsilon;" << endl;
-   fout << "   double r = ps/(ps + pb);" << endl;
-   fout << "   if (r >= 1.0) r = 1. - 1.e-15;" << endl;
-   fout << endl;
-   fout << "   if (" << (fTransformLikelihoodOutput ? "true" : "false") << ") {" << endl;
-   fout << "      // inverse Fermi function" << endl;
-   fout << endl;
-   fout << "      // sanity check" << endl;
-   fout << "      if      (r <= 0.0) r = fEpsilon;" << endl;
-   fout << "      else if (r >= 1.0) r = 1. - 1.e-15;" << endl;
-   fout << endl;
-   fout << "      double tau = 15.0;" << endl;
-   fout << "      r = - log(1.0/r - 1.0)/tau;" << endl;
-   fout << "   }" << endl;
-   fout << endl;
-   fout << "   return r;" << endl;
-   fout << "}" << endl;
-   fout << endl;
-
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // nothing to clear" << endl;
-   fout << "}" << endl << endl;
-
-   fout << "// signal map" << endl;
-   fout << "float " << className << "::fRefS[][" << nbinMax << "] = " << endl;
-   fout << "{ " << endl;
+        << ": bin entry < 0 ==> abort\" << std::endl;" << std::endl;
+   fout << "            std::exit(1);" << std::endl;
+   fout << "         }" << std::endl;
+   fout << std::endl;
+   fout << "         double p = ref;" << std::endl;
+   fout << std::endl;
+   fout << "         if (GetType(ivar) != 'I' && !fHasDiscretPDF[ivar]) {" << std::endl;
+   fout << "            float bincenter = (bin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
+   fout << "            int nextbin = bin;" << std::endl;
+   fout << "            if ((x[itype] > bincenter && bin != fNbin[ivar]-1) || bin == 0) " << std::endl;
+   fout << "               nextbin++;" << std::endl;
+   fout << "            else" << std::endl;
+   fout << "               nextbin--;  " << std::endl;
+   fout << std::endl;
+   fout << "            double refnext      = (itype == 0) ? fRefS[ivar][nextbin] : fRefB[ivar][nextbin];" << std::endl;
+   fout << "            float nextbincenter = (nextbin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
+   fout << std::endl;
+   fout << "            double dx = bincenter - nextbincenter;" << std::endl;
+   fout << "            double dy = ref - refnext;" << std::endl;
+   fout << "            p += (x[itype] - bincenter) * dy/dx;" << std::endl;
+   fout << "         }" << std::endl;
+   fout << std::endl;
+   fout << "         if (p < fEpsilon) p = fEpsilon; // avoid zero response" << std::endl;
+   fout << std::endl;
+   fout << "         if (itype == 0) ps *= p;" << std::endl;
+   fout << "         else            pb *= p;" << std::endl;
+   fout << "      }            " << std::endl;
+   fout << "   }     " << std::endl;
+   fout << std::endl;
+   fout << "   // the likelihood ratio (transform it ?)" << std::endl;
+   fout << "   return TransformLikelihoodOutput( ps, pb );   " << std::endl;
+   fout << "}" << std::endl << std::endl;
+
+   fout << "inline double " << className << "::TransformLikelihoodOutput( double ps, double pb ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // returns transformed or non-transformed output" << std::endl;
+   fout << "   if (ps < fEpsilon) ps = fEpsilon;" << std::endl;
+   fout << "   if (pb < fEpsilon) pb = fEpsilon;" << std::endl;
+   fout << "   double r = ps/(ps + pb);" << std::endl;
+   fout << "   if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
+   fout << std::endl;
+   fout << "   if (" << (fTransformLikelihoodOutput ? "true" : "false") << ") {" << std::endl;
+   fout << "      // inverse Fermi function" << std::endl;
+   fout << std::endl;
+   fout << "      // sanity check" << std::endl;
+   fout << "      if      (r <= 0.0) r = fEpsilon;" << std::endl;
+   fout << "      else if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
+   fout << std::endl;
+   fout << "      double tau = 15.0;" << std::endl;
+   fout << "      r = - log(1.0/r - 1.0)/tau;" << std::endl;
+   fout << "   }" << std::endl;
+   fout << std::endl;
+   fout << "   return r;" << std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
+
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // nothing to clear" << std::endl;
+   fout << "}" << std::endl << std::endl;
+
+   fout << "// signal map" << std::endl;
+   fout << "float " << className << "::fRefS[][" << nbinMax << "] = " << std::endl;
+   fout << "{ " << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
       fout << "   { ";
       for (Int_t ibin=1; ibin<=nbinMax; ibin++) {
@@ -923,14 +923,14 @@ void TMVA::MethodLikelihood::MakeClassSpecific( std::ostream& fout, const TStrin
 
          if (ibin < nbinMax) fout << ", ";
       }
-      fout << "   }, " << endl;
+      fout << "   }, " << std::endl;
    }
-   fout << "}; " << endl;
-   fout << endl;
+   fout << "}; " << std::endl;
+   fout << std::endl;
 
-   fout << "// background map" << endl;
-   fout << "float " << className << "::fRefB[][" << nbinMax << "] = " << endl;
-   fout << "{ " << endl;
+   fout << "// background map" << std::endl;
+   fout << "float " << className << "::fRefB[][" << nbinMax << "] = " << std::endl;
+   fout << "{ " << std::endl;
    for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
       fout << "   { ";
       fout << std::setprecision(8);
@@ -942,10 +942,10 @@ void TMVA::MethodLikelihood::MakeClassSpecific( std::ostream& fout, const TStrin
 
          if (ibin < nbinMax) fout << ", ";
       }
-      fout << "   }, " << endl;
+      fout << "   }, " << std::endl;
    }
-   fout << "}; " << endl;
-   fout << endl;
+   fout << "}; " << std::endl;
+   fout << std::endl;
    fout << std::setprecision(dp);
 
    delete[] nbin;
diff --git a/tmva/src/MethodMLP.cxx b/tmva/src/MethodMLP.cxx
index f9e61d1b3ae..b379a1aa5fb 100644
--- a/tmva/src/MethodMLP.cxx
+++ b/tmva/src/MethodMLP.cxx
@@ -1286,7 +1286,7 @@ void TMVA::MethodMLP::GeneticMinimize()
    fGA_nsteps    = 30;
 
    // ranges
-   vector<Interval*> ranges;
+   std::vector<Interval*> ranges;
 
    Int_t numWeights = fSynapses->GetEntriesFast();
    for (Int_t ivar=0; ivar< numWeights; ivar++) {
@@ -1391,8 +1391,8 @@ void TMVA::MethodMLP::UpdateRegulators()  //zjh
    Int_t numRegulators=fRegulators.size();
    Float_t gamma=0,
       variance=1.;    // Gaussian noise
-   vector<Int_t> nWDP(numRegulators);
-   vector<Double_t> trace(numRegulators),weightSum(numRegulators);
+   std::vector<Int_t> nWDP(numRegulators);
+   std::vector<Double_t> trace(numRegulators),weightSum(numRegulators);
    for (int i=0;i<numSynapses;i++) {
       TSynapse* synapses = (TSynapse*)fSynapses->At(i);
       Int_t idx=fRegulatorIdx[i];
diff --git a/tmva/src/MethodPDEFoam.cxx b/tmva/src/MethodPDEFoam.cxx
index 3607f54c34a..4ea1402fc5e 100644
--- a/tmva/src/MethodPDEFoam.cxx
+++ b/tmva/src/MethodPDEFoam.cxx
@@ -1198,7 +1198,7 @@ void TMVA::MethodPDEFoam::WriteFoamsToFile() const
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodPDEFoam::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodPDEFoam::ReadWeightsFromStream( std::istream& istr )
 {
    // read options and internal parameters
 
diff --git a/tmva/src/MethodPDERS.cxx b/tmva/src/MethodPDERS.cxx
index ec2d0f28705..a5daa555e95 100644
--- a/tmva/src/MethodPDERS.cxx
+++ b/tmva/src/MethodPDERS.cxx
@@ -1102,7 +1102,7 @@ void TMVA::MethodPDERS::ReadWeightsFromXML( void* wghtnode)
 }
 
 //_______________________________________________________________________
-void TMVA::MethodPDERS::ReadWeightsFromStream( istream& istr)
+void TMVA::MethodPDERS::ReadWeightsFromStream( std::istream& istr)
 {
    // read weight info from file
    if (NULL != fBinaryTree) delete fBinaryTree;
diff --git a/tmva/src/MethodRuleFit.cxx b/tmva/src/MethodRuleFit.cxx
index 30568214d0f..2614d5ddead 100644
--- a/tmva/src/MethodRuleFit.cxx
+++ b/tmva/src/MethodRuleFit.cxx
@@ -51,6 +51,8 @@
 #include "TMVA/Config.h"
 #include "TMVA/MsgLogger.h"
 
+using std::min;
+
 REGISTER_METHOD(RuleFit)
 
 ClassImp(TMVA::MethodRuleFit)
@@ -565,9 +567,9 @@ void TMVA::MethodRuleFit::AddWeightsXMLTo( void* parent ) const
 }
 
 //_______________________________________________________________________
-void TMVA::MethodRuleFit::ReadWeightsFromStream( istream & istr )
+void TMVA::MethodRuleFit::ReadWeightsFromStream( std::istream & istr )
 {
-   // read rules from an istream
+   // read rules from an std::istream
 
    fRuleFit.GetRuleEnsemblePtr()->ReadRaw( istr );
 }
@@ -609,7 +611,7 @@ void TMVA::MethodRuleFit::MakeClassSpecific( std::ostream& fout, const TString&
    fout << "void   " << className << "::Initialize(){}" << std::endl;
    fout << "void   " << className << "::Clear(){}" << std::endl;
    fout << "double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const {" << std::endl;
-   fout << "   double rval=" << setprecision(10) << fRuleFit.GetRuleEnsemble().GetOffset() << ";" << std::endl;
+   fout << "   double rval=" << std::setprecision(10) << fRuleFit.GetRuleEnsemble().GetOffset() << ";" << std::endl;
    MakeClassRuleCuts(fout);
    MakeClassLinear(fout);
    fout << "   return rval;" << std::endl;
@@ -659,16 +661,16 @@ void TMVA::MethodRuleFit::MakeClassRuleCuts( std::ostream& fout ) const
          //
          if (ic>0) fout << "&&" << std::flush;
          if (domin) {
-            fout << "(" << setprecision(10) << valmin << std::flush;
+            fout << "(" << std::setprecision(10) << valmin << std::flush;
             fout << "<inputValues[" << sel << "])" << std::flush;
          }
          if (domax) {
             if (domin) fout << "&&" << std::flush;
             fout << "(inputValues[" << sel << "]" << std::flush;
-            fout << "<" << setprecision(10) << valmax << ")" <<std::flush;
+            fout << "<" << std::setprecision(10) << valmax << ")" <<std::flush;
          }
       }
-      fout << ") rval+=" << setprecision(10) << (*rules)[ir]->GetCoefficient() << ";" << std::flush;
+      fout << ") rval+=" << std::setprecision(10) << (*rules)[ir]->GetCoefficient() << ";" << std::flush;
       fout << "   // importance = " << Form("%3.3f",impr) << std::endl;
    }
    fout << std::setprecision(dp);
@@ -695,11 +697,11 @@ void TMVA::MethodRuleFit::MakeClassLinear( std::ostream& fout ) const
          Double_t norm = rens->GetLinNorm(il);
          Double_t imp  = rens->GetLinImportance(il)/rens->GetImportanceRef();
          fout << "   rval+="
-   //           << setprecision(10) << rens->GetLinCoefficients(il)*norm << "*std::min(" << setprecision(10) << rens->GetLinDP(il)
-   //           << ", std::max( inputValues[" << il << "]," << setprecision(10) << rens->GetLinDM(il) << "));"
-              << setprecision(10) << rens->GetLinCoefficients(il)*norm 
-              << "*std::min( double(" << setprecision(10) << rens->GetLinDP(il)
-              << "), std::max( double(inputValues[" << il << "]), double(" << setprecision(10) << rens->GetLinDM(il) << ")));"
+   //           << std::setprecision(10) << rens->GetLinCoefficients(il)*norm << "*std::min(" << setprecision(10) << rens->GetLinDP(il)
+   //           << ", std::max( inputValues[" << il << "]," << std::setprecision(10) << rens->GetLinDM(il) << "));"
+              << std::setprecision(10) << rens->GetLinCoefficients(il)*norm 
+              << "*std::min( double(" << std::setprecision(10) << rens->GetLinDP(il)
+              << "), std::max( double(inputValues[" << il << "]), double(" << std::setprecision(10) << rens->GetLinDM(il) << ")));"
               << std::flush;
          fout << "   // importance = " << Form("%3.3f",imp) << std::endl;
       }
diff --git a/tmva/src/MethodSVM.cxx b/tmva/src/MethodSVM.cxx
index 65f28305f17..b6f6378f254 100644
--- a/tmva/src/MethodSVM.cxx
+++ b/tmva/src/MethodSVM.cxx
@@ -65,6 +65,8 @@
 
 #include <string>
 
+using std::vector;
+
 const Int_t basketsize__ = 1280000;
 REGISTER_METHOD(SVM)
 
@@ -310,7 +312,7 @@ void TMVA::MethodSVM::WriteWeightsToStream( TFile& ) const
 }
 
 //_______________________________________________________________________
-void  TMVA::MethodSVM::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodSVM::ReadWeightsFromStream( std::istream& istr )
 {
    if (fSupportVectors !=0) { delete fSupportVectors; fSupportVectors = 0;}
    fSupportVectors = new std::vector<TMVA::SVEvent*>(0);
@@ -432,75 +434,75 @@ void TMVA::MethodSVM::MakeClassSpecific( std::ostream& fout, const TString& clas
 {
    // write specific classifier response
    const int fNsupv = fSupportVectors->size();
-   fout << "   // not implemented for class: \"" << className << "\"" << endl;
-   fout << "   float        fBparameter;" << endl;
-   fout << "   int          fNOfSuppVec;" << endl;
-   fout << "   static float fAllSuppVectors[][" << fNsupv << "];" << endl;
-   fout << "   static float fAlphaTypeCoef[" << fNsupv << "];" << endl;
-   fout << endl;
-   fout << "   // Kernel parameter(s) " << endl;
-   fout << "   float fGamma;"  << endl;
-   fout << "};" << endl;
-   fout << "" << endl;
+   fout << "   // not implemented for class: \"" << className << "\"" << std::endl;
+   fout << "   float        fBparameter;" << std::endl;
+   fout << "   int          fNOfSuppVec;" << std::endl;
+   fout << "   static float fAllSuppVectors[][" << fNsupv << "];" << std::endl;
+   fout << "   static float fAlphaTypeCoef[" << fNsupv << "];" << std::endl;
+   fout << std::endl;
+   fout << "   // Kernel parameter(s) " << std::endl;
+   fout << "   float fGamma;"  << std::endl;
+   fout << "};" << std::endl;
+   fout << "" << std::endl;
 
    //Initialize function definition
-   fout << "inline void " << className << "::Initialize() " << endl;
-   fout << "{" << endl;
-   fout << "   fBparameter = " << fBparm << ";" << endl;
-   fout << "   fNOfSuppVec = " << fNsupv << ";" << endl;
-   fout << "   fGamma = " << fGamma << ";" <<endl;
-   fout << "}" << endl;
-   fout << endl;
+   fout << "inline void " << className << "::Initialize() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   fBparameter = " << fBparm << ";" << std::endl;
+   fout << "   fNOfSuppVec = " << fNsupv << ";" << std::endl;
+   fout << "   fGamma = " << fGamma << ";" <<std::endl;
+   fout << "}" << std::endl;
+   fout << std::endl;
 
    // GetMvaValue__ function defninition
-   fout << "inline double " << className << "::GetMvaValue__(const std::vector<double>& inputValues ) const" << endl;
-   fout << "{" << endl;
-   fout << "   double mvaval = 0; " << endl;
-   fout << "   double temp = 0; " << endl;
-   fout << endl;
-   fout << "   for (int ievt = 0; ievt < fNOfSuppVec; ievt++ ){" << endl;
-   fout << "      temp = 0;" << endl;
-   fout << "      for ( unsigned int ivar = 0; ivar < GetNvar(); ivar++ ) {" << endl;
-
-   fout << "         temp += (fAllSuppVectors[ivar][ievt] - inputValues[ivar])  " << endl;
-   fout << "               * (fAllSuppVectors[ivar][ievt] - inputValues[ivar]); " << endl;
-   fout << "      }" << endl;
-   fout << "      mvaval += fAlphaTypeCoef[ievt] * exp( -fGamma * temp ); " << endl;
-
-   fout << "   }" << endl;
-   fout << "   mvaval -= fBparameter;" << endl;
-   fout << "   return 1./(1. + exp(mvaval));" << endl;
-   fout << "}" << endl;
-   fout << "// Clean up" << endl;
-   fout << "inline void " << className << "::Clear() " << endl;
-   fout << "{" << endl;
-   fout << "   // nothing to clear " << endl;
-   fout << "}" << endl;
-   fout << "" << endl;
+   fout << "inline double " << className << "::GetMvaValue__(const std::vector<double>& inputValues ) const" << std::endl;
+   fout << "{" << std::endl;
+   fout << "   double mvaval = 0; " << std::endl;
+   fout << "   double temp = 0; " << std::endl;
+   fout << std::endl;
+   fout << "   for (int ievt = 0; ievt < fNOfSuppVec; ievt++ ){" << std::endl;
+   fout << "      temp = 0;" << std::endl;
+   fout << "      for ( unsigned int ivar = 0; ivar < GetNvar(); ivar++ ) {" << std::endl;
+
+   fout << "         temp += (fAllSuppVectors[ivar][ievt] - inputValues[ivar])  " << std::endl;
+   fout << "               * (fAllSuppVectors[ivar][ievt] - inputValues[ivar]); " << std::endl;
+   fout << "      }" << std::endl;
+   fout << "      mvaval += fAlphaTypeCoef[ievt] * exp( -fGamma * temp ); " << std::endl;
+
+   fout << "   }" << std::endl;
+   fout << "   mvaval -= fBparameter;" << std::endl;
+   fout << "   return 1./(1. + exp(mvaval));" << std::endl;
+   fout << "}" << std::endl;
+   fout << "// Clean up" << std::endl;
+   fout << "inline void " << className << "::Clear() " << std::endl;
+   fout << "{" << std::endl;
+   fout << "   // nothing to clear " << std::endl;
+   fout << "}" << std::endl;
+   fout << "" << std::endl;
 
    // define support vectors
-   fout << "float " << className << "::fAlphaTypeCoef[] =" << endl;
+   fout << "float " << className << "::fAlphaTypeCoef[] =" << std::endl;
    fout << "{ ";
    for (Int_t isv = 0; isv < fNsupv; isv++) {
       fout << fSupportVectors->at(isv)->GetDeltaAlpha() * fSupportVectors->at(isv)->GetTypeFlag();
       if (isv < fNsupv-1) fout << ", ";
    }
-   fout << " };" << endl << endl;
+   fout << " };" << std::endl << std::endl;
 
-   fout << "float " << className << "::fAllSuppVectors[][" << fNsupv << "] =" << endl;
+   fout << "float " << className << "::fAllSuppVectors[][" << fNsupv << "] =" << std::endl;
    fout << "{";
    for (UInt_t ivar = 0; ivar < GetNvar(); ivar++) {
-      fout << endl;
+      fout << std::endl;
       fout << "   { ";
       for (Int_t isv = 0; isv < fNsupv; isv++){
          fout << fSupportVectors->at(isv)->GetDataVector()->at(ivar);
          if (isv < fNsupv-1) fout << ", ";
       }
       fout << " }";
-      if (ivar < GetNvar()-1) fout << ", " << endl;
-      else                    fout << endl;
+      if (ivar < GetNvar()-1) fout << ", " << std::endl;
+      else                    fout << std::endl;
    }
-   fout << "};" << endl<< endl;
+   fout << "};" << std::endl<< std::endl;
 }
 
 //_______________________________________________________________________
diff --git a/tmva/src/MethodTMlpANN.cxx b/tmva/src/MethodTMlpANN.cxx
index c5afab19029..234d994be84 100644
--- a/tmva/src/MethodTMlpANN.cxx
+++ b/tmva/src/MethodTMlpANN.cxx
@@ -425,7 +425,7 @@ void  TMVA::MethodTMlpANN::ReadWeightsFromXML( void* wghtnode )
 }
  
 //_______________________________________________________________________
-void  TMVA::MethodTMlpANN::ReadWeightsFromStream( istream& istr )
+void  TMVA::MethodTMlpANN::ReadWeightsFromStream( std::istream& istr )
 {
    // read weights from stream
    // since the MLP can not read from the stream, we
diff --git a/tmva/src/ModulekNN.cxx b/tmva/src/ModulekNN.cxx
index 53e3f90b496..0018a579bc1 100644
--- a/tmva/src/ModulekNN.cxx
+++ b/tmva/src/ModulekNN.cxx
@@ -646,7 +646,7 @@ void TMVA::kNN::ModulekNN::Print() const
 }
 
 //-------------------------------------------------------------------------------------------
-void TMVA::kNN::ModulekNN::Print(ostream &os) const
+void TMVA::kNN::ModulekNN::Print(std::ostream &os) const
 {
    // print
    os << "----------------------------------------------------------------------"<< std::endl;
diff --git a/tmva/src/Node.cxx b/tmva/src/Node.cxx
index edbdf1e7eb6..0c10ae133da 100644
--- a/tmva/src/Node.cxx
+++ b/tmva/src/Node.cxx
@@ -121,7 +121,7 @@ Int_t TMVA::Node::CountMeAndAllDaughters() const
 
 // print a node
 //_______________________________________________________________________
-ostream& TMVA::operator<<( ostream& os, const TMVA::Node& node )
+std::ostream& TMVA::operator<<( std::ostream& os, const TMVA::Node& node )
 { 
    // output operator for a node  
    node.Print(os);
@@ -129,7 +129,7 @@ ostream& TMVA::operator<<( ostream& os, const TMVA::Node& node )
 }
 
 //_______________________________________________________________________
-ostream& TMVA::operator<<( ostream& os, const TMVA::Node* node )
+std::ostream& TMVA::operator<<( std::ostream& os, const TMVA::Node* node )
 { 
    // output operator with a pointer to the node (which still prints the node itself)
    if (node!=NULL) node->Print(os);
diff --git a/tmva/src/PDF.cxx b/tmva/src/PDF.cxx
index 5779d27b395..3495c4d369f 100644
--- a/tmva/src/PDF.cxx
+++ b/tmva/src/PDF.cxx
@@ -593,8 +593,8 @@ void TMVA::PDF::ValidatePDF( TH1* originalHist ) const
       if (y > 0) {
          ndof++;
          Double_t d = TMath::Abs( (y - yref*rref)/ey );
-         //         cout << "bin: " << bin << "  val: " << x << "  data(err): " << y << "(" << ey << ")   pdf: " 
-         //              << yref << "  dev(chi2): " << d << "(" << chi2 << ")  rref: " << rref << endl;
+         //         std::cout << "bin: " << bin << "  val: " << x << "  data(err): " << y << "(" << ey << ")   pdf: " 
+         //              << yref << "  dev(chi2): " << d << "(" << chi2 << ")  rref: " << rref << std::endl;
          chi2 += d*d;
          if (d > 1) { nc1++; if (d > 2) { nc2++; if (d > 3) { nc3++; if (d > 6) nc6++; } } }
       }
@@ -1009,7 +1009,7 @@ void TMVA::PDF::ReadXML( void* pdfnode )
 }
 
 //_______________________________________________________________________
-ostream& TMVA::operator<< ( ostream& os, const PDF& pdf )
+std::ostream& TMVA::operator<< ( std::ostream& os, const PDF& pdf )
 {
    // write the pdf
    Int_t dp = os.precision();
@@ -1046,9 +1046,9 @@ ostream& TMVA::operator<< ( ostream& os, const PDF& pdf )
 }
 
 //_______________________________________________________________________
-istream& TMVA::operator>> ( istream& istr, PDF& pdf )
+std::istream& TMVA::operator>> ( std::istream& istr, PDF& pdf )
 {
-   // read the tree from an istream
+   // read the tree from an std::istream
    TString devnullS;
    Int_t   valI;
    Int_t   nbins=-1; // default binning will cause an exit
diff --git a/tmva/src/Reader.cxx b/tmva/src/Reader.cxx
index 94a5175c498..c197d9aab6d 100644
--- a/tmva/src/Reader.cxx
+++ b/tmva/src/Reader.cxx
@@ -324,7 +324,7 @@ TString TMVA::Reader::GetMethodTypeFromFile( const TString& filename )
 {
    // read the method type from the file
 
-   ifstream fin( filename );
+   std::ifstream fin( filename );
    if (!fin.good()) { // file not found --> Error
       Log() << kFATAL << "<BookMVA> fatal error: "
             << "unable to open input weight file: " << filename << Endl;
@@ -459,7 +459,7 @@ TMVA::IMethod* TMVA::Reader::BookMVA( TMVA::Types::EMVA methodType, const char*
 //_______________________________________________________________________
 Double_t TMVA::Reader::EvaluateMVA( const std::vector<Float_t>& inputVec, const TString& methodTag, Double_t aux )
 {
-   // Evaluate a vector<float> of input data for a given method
+   // Evaluate a std::vector<float> of input data for a given method
    // The parameter aux is obligatory for the cuts method where it represents the efficiency cutoff
 
    // create a temporary event from the vector.
@@ -483,7 +483,7 @@ Double_t TMVA::Reader::EvaluateMVA( const std::vector<Float_t>& inputVec, const
 //_______________________________________________________________________
 Double_t TMVA::Reader::EvaluateMVA( const std::vector<Double_t>& inputVec, const TString& methodTag, Double_t aux )
 {
-   // Evaluate a vector<double> of input data for a given method
+   // Evaluate a std::vector<double> of input data for a given method
    // The parameter aux is obligatory for the cuts method where it represents the efficiency cutoff
 
    // performs a copy to float values which are internally used by all methods
diff --git a/tmva/src/Rule.cxx b/tmva/src/Rule.cxx
index 4e4b8181b62..977ad1e0516 100644
--- a/tmva/src/Rule.cxx
+++ b/tmva/src/Rule.cxx
@@ -245,9 +245,9 @@ Bool_t TMVA::Rule::operator<( const Rule& other ) const
 }
 
 //_______________________________________________________________________
-ostream& TMVA::operator<< ( ostream& os, const Rule& rule )
+std::ostream& TMVA::operator<< ( std::ostream& os, const Rule& rule )
 {
-   // ostream operator
+   // std::ostream operator
    rule.Print( os );
    return os;
 }
@@ -279,7 +279,7 @@ void TMVA::Rule::Copy( const Rule& other )
 }
 
 //_______________________________________________________________________
-void TMVA::Rule::Print( ostream& os ) const
+void TMVA::Rule::Print( std::ostream& os ) const
 {
    // print function
    const UInt_t nvars = fCut->GetNvars();
@@ -341,7 +341,7 @@ void TMVA::Rule::PrintLogger(const char *title) const
 }
 
 //_______________________________________________________________________
-void TMVA::Rule::PrintRaw( ostream& os ) const
+void TMVA::Rule::PrintRaw( std::ostream& os ) const
 {
    // extensive print function used to print info for the weight file
    Int_t dp = os.precision();
@@ -448,7 +448,7 @@ void TMVA::Rule::ReadFromXML( void* wghtnode )
 }
 
 //_______________________________________________________________________
-void TMVA::Rule::ReadRaw( istream& istr )
+void TMVA::Rule::ReadRaw( std::istream& istr )
 {
    // read function (format is the same as written by PrintRaw)
 
diff --git a/tmva/src/RuleEnsemble.cxx b/tmva/src/RuleEnsemble.cxx
index a64f2c77d0c..52b356452f6 100644
--- a/tmva/src/RuleEnsemble.cxx
+++ b/tmva/src/RuleEnsemble.cxx
@@ -1032,7 +1032,7 @@ void TMVA::RuleEnsemble::Print() const
 }
 
 //_______________________________________________________________________
-void TMVA::RuleEnsemble::PrintRaw( ostream & os ) const
+void TMVA::RuleEnsemble::PrintRaw( std::ostream & os ) const
 {
    // write rules to stream
    Int_t dp = os.precision();
@@ -1149,7 +1149,7 @@ void TMVA::RuleEnsemble::ReadFromXML( void* wghtnode )
 }
 
 //_______________________________________________________________________
-void TMVA::RuleEnsemble::ReadRaw( istream & istr )
+void TMVA::RuleEnsemble::ReadRaw( std::istream & istr )
 {
    // read rule ensemble from stream
    UInt_t nrules;
@@ -1384,9 +1384,9 @@ void TMVA::RuleEnsemble::MakeRuleMap(const std::vector<Event *> *events, UInt_t
 }
 
 //_______________________________________________________________________
-ostream& TMVA::operator<< ( ostream& os, const RuleEnsemble & rules )
+std::ostream& TMVA::operator<< ( std::ostream& os, const RuleEnsemble & rules )
 {
-   // ostream operator
+   // std::ostream operator
    os << "DON'T USE THIS - TO BE REMOVED" << std::endl;
    rules.Print();
    return os;
diff --git a/tmva/src/VariableDecorrTransform.cxx b/tmva/src/VariableDecorrTransform.cxx
index 9104bbd82e0..d2a37871eef 100644
--- a/tmva/src/VariableDecorrTransform.cxx
+++ b/tmva/src/VariableDecorrTransform.cxx
@@ -401,7 +401,7 @@ void TMVA::VariableDecorrTransform::ReadTransformationFromStream( std::istream&
 }
 
 //_______________________________________________________________________
-void TMVA::VariableDecorrTransform::PrintTransformation( ostream& ) 
+void TMVA::VariableDecorrTransform::PrintTransformation( std::ostream& ) 
 {
    // prints the transformation matrix
    Int_t cls = 0;
diff --git a/tmva/src/VariableGaussTransform.cxx b/tmva/src/VariableGaussTransform.cxx
index 3640172d307..cbf3c20b586 100644
--- a/tmva/src/VariableGaussTransform.cxx
+++ b/tmva/src/VariableGaussTransform.cxx
@@ -674,7 +674,7 @@ Double_t TMVA::VariableGaussTransform::OldCumulant(Float_t x, TH1* h ) const {
 
 
 //_______________________________________________________________________
-void TMVA::VariableGaussTransform::PrintTransformation( ostream& ) 
+void TMVA::VariableGaussTransform::PrintTransformation( std::ostream& ) 
 {
    // prints the transformation 
    Int_t cls = 0;
diff --git a/tmva/src/VariableNormalizeTransform.cxx b/tmva/src/VariableNormalizeTransform.cxx
index 88865f39d16..a698a30cd5c 100644
--- a/tmva/src/VariableNormalizeTransform.cxx
+++ b/tmva/src/VariableNormalizeTransform.cxx
@@ -519,7 +519,7 @@ void TMVA::VariableNormalizeTransform::ReadTransformationFromStream( std::istrea
 }
 
 //_______________________________________________________________________
-void TMVA::VariableNormalizeTransform::PrintTransformation( ostream& /* o */ ) 
+void TMVA::VariableNormalizeTransform::PrintTransformation( std::ostream& /* o */ ) 
 {
    // prints the transformation ranges
 
diff --git a/tmva/src/VariableRearrangeTransform.cxx b/tmva/src/VariableRearrangeTransform.cxx
index a183470b6ca..b044ddabe9c 100644
--- a/tmva/src/VariableRearrangeTransform.cxx
+++ b/tmva/src/VariableRearrangeTransform.cxx
@@ -149,7 +149,7 @@ void TMVA::VariableRearrangeTransform::ReadFromXML( void* trfnode )
 }
 
 //_______________________________________________________________________
-void TMVA::VariableRearrangeTransform::PrintTransformation( ostream& ) 
+void TMVA::VariableRearrangeTransform::PrintTransformation( std::ostream& ) 
 {
    // prints the transformation ranges
 }
diff --git a/tmva/test/TMVAMulticlass.cxx b/tmva/test/TMVAMulticlass.cxx
index 1077d9726e2..92b1b434f38 100644
--- a/tmva/test/TMVAMulticlass.cxx
+++ b/tmva/test/TMVAMulticlass.cxx
@@ -80,10 +80,10 @@ int main(int argc, char** argv )
       input = TFile::Open( fname );
    }
    else {
-      cout << "Creating testdata...." << std::endl;
+      std::cout << "Creating testdata...." << std::endl;
       gROOT->ProcessLine(".L createData.C+");
       gROOT->ProcessLine("create_MultipleBackground(2000)");
-      cout << " created tmva_example_multiple_background.root for tests of the multiclass features"<<endl;
+      std::cout << " created tmva_example_multiple_background.root for tests of the multiclass features"<<std::endl;
       input = TFile::Open( fname );
    }
    if (!input) {
diff --git a/tree/tree/inc/TLeaf.h b/tree/tree/inc/TLeaf.h
index b0fc975a2bc..48bbace92ba 100644
--- a/tree/tree/inc/TLeaf.h
+++ b/tree/tree/inc/TLeaf.h
@@ -83,7 +83,7 @@ public:
    virtual void     PrintValue(Int_t i = 0) const;
    virtual void     ReadBasket(TBuffer&) {}
    virtual void     ReadBasketExport(TBuffer&, TClonesArray*, Int_t) {}
-   virtual void     ReadValue(istream& /*s*/, Char_t /*delim*/ = ' ') {
+   virtual void     ReadValue(std::istream& /*s*/, Char_t /*delim*/ = ' ') {
       Error("ReadValue", "Not implemented!");
    }
            Int_t    ResetAddress(void* add, Bool_t destructor = kFALSE);
diff --git a/tree/tree/inc/TLeafB.h b/tree/tree/inc/TLeafB.h
index 05bbeafc298..4dee7d6a1d5 100644
--- a/tree/tree/inc/TLeafB.h
+++ b/tree/tree/inc/TLeafB.h
@@ -49,7 +49,7 @@ public:
    virtual void    PrintValue(Int_t i = 0) const;
    virtual void    ReadBasket(TBuffer&);
    virtual void    ReadBasketExport(TBuffer&, TClonesArray* list, Int_t n);
-   virtual void    ReadValue(istream &s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream &s, Char_t delim = ' ');
    virtual void    SetAddress(void* addr = 0);
    virtual void    SetMaximum(Char_t max) { fMaximum = max; }
    virtual void    SetMinimum(Char_t min) { fMinimum = min; }
diff --git a/tree/tree/inc/TLeafC.h b/tree/tree/inc/TLeafC.h
index 992bed2ea93..a2ffa2f7748 100644
--- a/tree/tree/inc/TLeafC.h
+++ b/tree/tree/inc/TLeafC.h
@@ -50,7 +50,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    virtual void    SetMaximum(Int_t max) {fMaximum = max;}
    virtual void    SetMinimum(Int_t min) {fMinimum = min;}
diff --git a/tree/tree/inc/TLeafD.h b/tree/tree/inc/TLeafD.h
index 8ed60895acc..9780855e73c 100644
--- a/tree/tree/inc/TLeafD.h
+++ b/tree/tree/inc/TLeafD.h
@@ -47,7 +47,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    
    ClassDef(TLeafD,1);  //A TLeaf for a 64 bit floating point data type.
diff --git a/tree/tree/inc/TLeafF.h b/tree/tree/inc/TLeafF.h
index edb1edfb842..e4438a519fd 100644
--- a/tree/tree/inc/TLeafF.h
+++ b/tree/tree/inc/TLeafF.h
@@ -47,7 +47,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    
    ClassDef(TLeafF,1);  //A TLeaf for a 32 bit floating point data type.
diff --git a/tree/tree/inc/TLeafI.h b/tree/tree/inc/TLeafI.h
index cbc68239004..5c9aef7b14e 100644
--- a/tree/tree/inc/TLeafI.h
+++ b/tree/tree/inc/TLeafI.h
@@ -50,7 +50,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    virtual void    SetMaximum(Int_t max) {fMaximum = max;}
    virtual void    SetMinimum(Int_t min) {fMinimum = min;}
diff --git a/tree/tree/inc/TLeafL.h b/tree/tree/inc/TLeafL.h
index 8933dc6d36b..3539a3e8763 100644
--- a/tree/tree/inc/TLeafL.h
+++ b/tree/tree/inc/TLeafL.h
@@ -50,7 +50,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    virtual void    SetMaximum(Long64_t max) {fMaximum = max;}
    virtual void    SetMinimum(Long64_t min) {fMinimum = min;}
diff --git a/tree/tree/inc/TLeafO.h b/tree/tree/inc/TLeafO.h
index cde57c9f5bc..22ae80ba351 100644
--- a/tree/tree/inc/TLeafO.h
+++ b/tree/tree/inc/TLeafO.h
@@ -49,7 +49,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    virtual void    SetMaximum(Bool_t max) { fMaximum = max; }
    virtual void    SetMinimum(Bool_t min) { fMinimum = min; }
diff --git a/tree/tree/inc/TLeafS.h b/tree/tree/inc/TLeafS.h
index f3ab0bfb778..92ba416537f 100644
--- a/tree/tree/inc/TLeafS.h
+++ b/tree/tree/inc/TLeafS.h
@@ -49,7 +49,7 @@ public:
    virtual void    PrintValue(Int_t i=0) const;
    virtual void    ReadBasket(TBuffer &b);
    virtual void    ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n);
-   virtual void    ReadValue(istream& s, Char_t delim = ' ');
+   virtual void    ReadValue(std::istream& s, Char_t delim = ' ');
    virtual void    SetAddress(void *add=0);
    virtual void    SetMaximum(Short_t max) { fMaximum = max; }
    virtual void    SetMinimum(Short_t min) { fMinimum = min; }
diff --git a/tree/tree/inc/TNtuple.h b/tree/tree/inc/TNtuple.h
index 10ba21bb68e..28ae9f128ff 100644
--- a/tree/tree/inc/TNtuple.h
+++ b/tree/tree/inc/TNtuple.h
@@ -56,7 +56,7 @@ public:
                           Float_t x14=0);
    virtual Int_t     GetNvar() const { return fNvar; }
            Float_t  *GetArgs() const { return fArgs; }
-   virtual Long64_t  ReadStream(istream& inputStream, const char *branchDescriptor="", char delimiter = ' ');
+   virtual Long64_t  ReadStream(std::istream& inputStream, const char *branchDescriptor="", char delimiter = ' ');
    virtual void      ResetBranchAddress(TBranch *);
            void      ResetBranchAddresses();
 
diff --git a/tree/tree/inc/TNtupleD.h b/tree/tree/inc/TNtupleD.h
index e8014ecb655..97bc83dbac4 100644
--- a/tree/tree/inc/TNtupleD.h
+++ b/tree/tree/inc/TNtupleD.h
@@ -53,7 +53,7 @@ public:
                           Double_t x14=0);
    virtual Int_t     GetNvar() const { return fNvar; }
            Double_t *GetArgs() const { return fArgs; }
-   virtual Long64_t  ReadStream(istream& inputstream, const char *branchDescriptor="", char delimiter = ' ');
+   virtual Long64_t  ReadStream(std::istream& inputstream, const char *branchDescriptor="", char delimiter = ' ');
    virtual void      ResetBranchAddress(TBranch *);
            void      ResetBranchAddresses();
 
diff --git a/tree/tree/inc/TTree.h b/tree/tree/inc/TTree.h
index ca34ece4782..e0569037a85 100644
--- a/tree/tree/inc/TTree.h
+++ b/tree/tree/inc/TTree.h
@@ -161,7 +161,7 @@ protected:
    Int_t    SetBranchAddressImp(TBranch *branch, void* addr, TBranch** ptr);
    virtual TLeaf   *GetLeafImpl(const char* branchname, const char* leafname);
 
-   char             GetNewlineValue(istream &inputStream);
+   char             GetNewlineValue(std::istream &inputStream);
    void             ImportClusterRanges(TTree *fromtree);
 
    class TFriendLock {
@@ -472,7 +472,7 @@ public:
    virtual Long64_t        Project(const char* hname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
    virtual TSQLResult     *Query(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
    virtual Long64_t        ReadFile(const char* filename, const char* branchDescriptor = "", char delimiter = ' ');
-   virtual Long64_t        ReadStream(istream& inputStream, const char* branchDescriptor = "", char delimiter = ' ');
+   virtual Long64_t        ReadStream(std::istream& inputStream, const char* branchDescriptor = "", char delimiter = ' ');
    virtual void            Refresh();
    virtual void            RecursiveRemove(TObject *obj);
    virtual void            RemoveFriend(TTree*);
diff --git a/tree/tree/src/TBasketSQL.cxx b/tree/tree/src/TBasketSQL.cxx
index 4d3d9840c5f..f41574ecf75 100644
--- a/tree/tree/src/TBasketSQL.cxx
+++ b/tree/tree/src/TBasketSQL.cxx
@@ -45,7 +45,7 @@ TBasketSQL::TBasketSQL() : TBasket(), fResultPtr(0), fRowPtr(0), fInsertQuery(0)
 //_________________________________________________________________________
 TBasketSQL::TBasketSQL(const char *name, const char *title, TBranch *branch, 
                          TSQLResult ** rs, TString *insert_query, 
-                         vector<Int_t> *vc, TSQLRow **r) :
+                         std::vector<Int_t> *vc, TSQLRow **r) :
   fResultPtr(rs),fRowPtr(r)
 { 
    // Regular constructor.
@@ -84,7 +84,7 @@ TBasketSQL::~TBasketSQL()
 
 //_________________________________________________________________________
 void TBasketSQL::CreateBuffer(const char *name, TString title, 
-                              vector<Int_t> *vc, 
+                              std::vector<Int_t> *vc, 
                               TBranch *branch, TSQLResult ** rs)
 {
    // Create a TSQLBuffer for this basket.
diff --git a/tree/tree/src/TBufferSQL.cxx b/tree/tree/src/TBufferSQL.cxx
index 04a162e3b51..ce5b6d6c289 100644
--- a/tree/tree/src/TBufferSQL.cxx
+++ b/tree/tree/src/TBufferSQL.cxx
@@ -30,7 +30,7 @@
 ClassImp(TBufferSQL);
 
 //________________________________________________________________________
-TBufferSQL::TBufferSQL(TBuffer::EMode mode, vector<Int_t> *vc, 
+TBufferSQL::TBufferSQL(TBuffer::EMode mode, std::vector<Int_t> *vc, 
                        TString *insert_query, TSQLRow ** r) : 
    TBufferFile(mode),
    fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r) 
@@ -41,7 +41,7 @@ TBufferSQL::TBufferSQL(TBuffer::EMode mode, vector<Int_t> *vc,
 }
 
 //________________________________________________________________________
-TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, vector<Int_t> *vc, 
+TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, std::vector<Int_t> *vc, 
                        TString *insert_query, TSQLRow ** r) : 
    TBufferFile(mode,bufsiz), 
    fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r) 
@@ -52,7 +52,7 @@ TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, vector<Int_t> *vc,
 }
 
 //________________________________________________________________________
-TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, vector<Int_t> *vc, 
+TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, std::vector<Int_t> *vc, 
                        TString *insert_query, TSQLRow ** r,
                        void *buf, Bool_t adopt) : 
    TBufferFile(mode,bufsiz,buf,adopt),
@@ -464,7 +464,7 @@ void TBufferSQL::WriteFastArray(const Int_t     *ii, Int_t n)
 {
    // WriteFastArray SQL implementation.   
 
-    //   cerr << "Column: " <<*fIter << "   i:" << *ii << endl;
+    //   std::cerr << "Column: " <<*fIter << "   i:" << *ii << std::endl;
    for(int i=0; i<n; ++i) {
       (*fInsertQuery) += ii[i];
       (*fInsertQuery) += ",";
@@ -771,7 +771,7 @@ void TBufferSQL::insert_test(const char* dsn, const char* usr,
 
    ptr->Next();
    ptr->MoveToInsertRow();
-   cerr << "IsAfterLast(): " << ptr->IsAfterLast() << endl;
+   std::cerr << "IsAfterLast(): " << ptr->IsAfterLast() << std::endl;
    ptr->UpdateInt(1, 5555);
    ptr->InsertRow();
    con->Commit();
diff --git a/tree/tree/src/TChainElement.cxx b/tree/tree/src/TChainElement.cxx
index c94d02c9ed9..b39e9bd7b65 100644
--- a/tree/tree/src/TChainElement.cxx
+++ b/tree/tree/src/TChainElement.cxx
@@ -78,7 +78,7 @@ void TChainElement::ls(Option_t *) const
    // List files in the chain.
 
    TROOT::IndentLevel();
-   cout << GetTitle() << "tree:" << GetName() << " entries=" << fEntries << '\n';
+   std::cout << GetTitle() << "tree:" << GetName() << " entries=" << fEntries << '\n';
 }
 
 //_______________________________________________________________________
diff --git a/tree/tree/src/TLeafB.cxx b/tree/tree/src/TLeafB.cxx
index 8a93b6b18a7..751a745fa07 100644
--- a/tree/tree/src/TLeafB.cxx
+++ b/tree/tree/src/TLeafB.cxx
@@ -164,9 +164,9 @@ void TLeafB::ReadBasketExport(TBuffer& b, TClonesArray* list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafB::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafB::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-   // -- Read a string from istream s and store it into the branch buffer.
+   // -- Read a string from std::istream s and store it into the branch buffer.
    char* value = (char*) GetValuePointer();
    s >> value;
 }
diff --git a/tree/tree/src/TLeafC.cxx b/tree/tree/src/TLeafC.cxx
index 3c3dda04f8f..bc93a7a80b8 100644
--- a/tree/tree/src/TLeafC.cxx
+++ b/tree/tree/src/TLeafC.cxx
@@ -184,12 +184,12 @@ void TLeafC::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafC::ReadValue(istream &s, Char_t delim /*= ' '*/)
+void TLeafC::ReadValue(std::istream &s, Char_t delim /*= ' '*/)
 {
-   // Read a string from istream s up to delimiter and store it into the branch
+   // Read a string from std::istream s up to delimiter and store it into the branch
    // buffer.
 
-   string temp;
+   std::string temp;
    std::getline(s, temp, delim);
    if (TestBit(kNewValue) &&
         (temp.length()+1 > ((UInt_t)fNdata))) {
diff --git a/tree/tree/src/TLeafD.cxx b/tree/tree/src/TLeafD.cxx
index 805c2462265..4d805f4197b 100644
--- a/tree/tree/src/TLeafD.cxx
+++ b/tree/tree/src/TLeafD.cxx
@@ -154,9 +154,9 @@ void TLeafD::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafD::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafD::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-// read a double from istream s and store it into the branch buffer
+// read a double from std::istream s and store it into the branch buffer
    Double_t *value = (Double_t*)GetValuePointer();
    for (Int_t i=0;i<fLen;i++) s >> value[i];
 }
diff --git a/tree/tree/src/TLeafF.cxx b/tree/tree/src/TLeafF.cxx
index 2cf70bc2510..f010c82299b 100644
--- a/tree/tree/src/TLeafF.cxx
+++ b/tree/tree/src/TLeafF.cxx
@@ -166,9 +166,9 @@ void TLeafF::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafF::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafF::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-// read a float from istream s and store it into the branch buffer
+// read a float from std::istream s and store it into the branch buffer
    Float_t *value = (Float_t*)GetValuePointer();
    for (Int_t i=0;i<fLen;i++) s >> value[i];
 }
diff --git a/tree/tree/src/TLeafI.cxx b/tree/tree/src/TLeafI.cxx
index bceaffdd7f0..8260ea4f75b 100644
--- a/tree/tree/src/TLeafI.cxx
+++ b/tree/tree/src/TLeafI.cxx
@@ -200,9 +200,9 @@ void TLeafI::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafI::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafI::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-// read an integer from istream s and store it into the branch buffer
+// read an integer from std::istream s and store it into the branch buffer
    if (fIsUnsigned) {
       UInt_t *uvalue = (UInt_t*)GetValuePointer();
       for (Int_t i=0;i<fLen;i++) s >> uvalue[i];
diff --git a/tree/tree/src/TLeafL.cxx b/tree/tree/src/TLeafL.cxx
index 4bbce00d224..e97c756d5c9 100644
--- a/tree/tree/src/TLeafL.cxx
+++ b/tree/tree/src/TLeafL.cxx
@@ -200,9 +200,9 @@ void TLeafL::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafL::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafL::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-// read a long integer from istream s and store it into the branch buffer
+// read a long integer from std::istream s and store it into the branch buffer
 #if defined(_MSC_VER) && (_MSC_VER<1300)
    printf("Due to a bug in VC++6, the function TLeafL::ReadValue is dummy\n");
 #else
diff --git a/tree/tree/src/TLeafO.cxx b/tree/tree/src/TLeafO.cxx
index cbef95dc304..09722be6ec5 100644
--- a/tree/tree/src/TLeafO.cxx
+++ b/tree/tree/src/TLeafO.cxx
@@ -164,9 +164,9 @@ void TLeafO::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafO::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafO::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-// read a string from istream s and store it into the branch buffer
+// read a string from std::istream s and store it into the branch buffer
    char *value = (char*)GetValuePointer();
    s >> value;
 }
diff --git a/tree/tree/src/TLeafS.cxx b/tree/tree/src/TLeafS.cxx
index 48cf5882548..628dd06b5ba 100644
--- a/tree/tree/src/TLeafS.cxx
+++ b/tree/tree/src/TLeafS.cxx
@@ -193,9 +193,9 @@ void TLeafS::ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n)
 }
 
 //______________________________________________________________________________
-void TLeafS::ReadValue(istream &s, Char_t /*delim = ' '*/)
+void TLeafS::ReadValue(std::istream &s, Char_t /*delim = ' '*/)
 {
-// read a integer integer from istream s and store it into the branch buffer
+// read a integer integer from std::istream s and store it into the branch buffer
    if (fIsUnsigned) {
       UShort_t *uvalue = (UShort_t*)GetValuePointer();
       for (Int_t i=0;i<fLen;i++) s >> uvalue[i];
diff --git a/tree/tree/src/TNtuple.cxx b/tree/tree/src/TNtuple.cxx
index cacfe862298..2dd728cb6fd 100644
--- a/tree/tree/src/TNtuple.cxx
+++ b/tree/tree/src/TNtuple.cxx
@@ -212,7 +212,7 @@ Int_t TNtuple::Fill(Float_t x0,Float_t x1,Float_t x2,Float_t x3,Float_t x4
 }
 
 //_______________________________________________________________________
-Long64_t TNtuple::ReadStream(istream &inputStream, const char * /*branchDescriptor*/, char delimiter)
+Long64_t TNtuple::ReadStream(std::istream &inputStream, const char * /*branchDescriptor*/, char delimiter)
 {
    // Read from filename as many columns as variables in the ntuple
    // the function returns the number of rows found in the file
diff --git a/tree/tree/src/TNtupleD.cxx b/tree/tree/src/TNtupleD.cxx
index 158c367f69a..ec4f9a95974 100644
--- a/tree/tree/src/TNtupleD.cxx
+++ b/tree/tree/src/TNtupleD.cxx
@@ -193,7 +193,7 @@ Int_t TNtupleD::Fill(Double_t x0,Double_t x1,Double_t x2,Double_t x3,Double_t x4
 }
 
 //_______________________________________________________________________
-Long64_t TNtupleD::ReadStream(istream &inputStream, const char * /*branchDescriptor*/, char delimiter)
+Long64_t TNtupleD::ReadStream(std::istream &inputStream, const char * /*branchDescriptor*/, char delimiter)
 {
 // read from filename as many columns as variables in the ntuple
 // the function returns the number of rows found in the file
diff --git a/tree/tree/src/TTree.cxx b/tree/tree/src/TTree.cxx
index 50ec582155d..ed3241f1844 100644
--- a/tree/tree/src/TTree.cxx
+++ b/tree/tree/src/TTree.cxx
@@ -6322,7 +6322,7 @@ Long64_t TTree::ReadFile(const char* filename, const char* branchDescriptor, cha
 }
 
 //______________________________________________________________________________
-char TTree::GetNewlineValue(istream &inputStream)
+char TTree::GetNewlineValue(std::istream &inputStream)
 {
    // Determine which newline this file is using.
    // Return '\r' for Windows '\r\n' as that already terminates.
@@ -6348,7 +6348,7 @@ char TTree::GetNewlineValue(istream &inputStream)
 }
 
 //______________________________________________________________________________
-Long64_t TTree::ReadStream(istream& inputStream, const char *branchDescriptor, char delimiter)
+Long64_t TTree::ReadStream(std::istream& inputStream, const char *branchDescriptor, char delimiter)
 {
    // Create or simply read branches from an input stream.
    //
diff --git a/tree/tree/src/TTreeSQL.cxx b/tree/tree/src/TTreeSQL.cxx
index b0516be0cde..ee057921980 100644
--- a/tree/tree/src/TTreeSQL.cxx
+++ b/tree/tree/src/TTreeSQL.cxx
@@ -190,7 +190,7 @@ void TTreeSQL::CheckBasket(TBranch *branch)
    TBuffer * buffer = basket->GetBufferRef();
 
    if(buffer == 0){
-      vector<Int_t> *columns = GetColumnIndice(branch);
+      std::vector<Int_t> *columns = GetColumnIndice(branch);
       if (columns) basket->CreateBuffer(branch->GetName(),"A", columns, branch, &fResult);
    }
 
@@ -343,7 +343,7 @@ TBasket * TTreeSQL::CreateBasket(TBranch * tb)
       Error("CreateBasket","No TSQLServer specified");
       return 0;
    }
-   vector<Int_t> *columnVec = GetColumnIndice(tb);
+   std::vector<Int_t> *columnVec = GetColumnIndice(tb);
    if (columnVec) {
       return new TBasketSQL(tb->GetName(), tb->GetName(), tb,
                             &fResult, &fInsertQuery, columnVec, &fRow);
@@ -609,7 +609,7 @@ Int_t TTreeSQL::Fill()
 }
 
 //______________________________________________________________________________
-vector<Int_t> *TTreeSQL::GetColumnIndice(TBranch *branch)
+std::vector<Int_t> *TTreeSQL::GetColumnIndice(TBranch *branch)
 {
    // Return a vector of columns index corresponding to the
    // current SQL table and the branch given as argument
@@ -618,17 +618,17 @@ vector<Int_t> *TTreeSQL::GetColumnIndice(TBranch *branch)
 
    if (!CheckTable(fTable)) return 0;
 
-   vector<Int_t> *columns = new vector<Int_t>;
+   std::vector<Int_t> *columns = new std::vector<Int_t>;
 
    Int_t nl = branch->GetNleaves();
 
-   vector<TString> names;
+   std::vector<TString> names;
 
    TSQLResult *rs = fServer->GetColumns(fDB,fTable);
    if (rs==0) { delete columns; return 0; }
    Int_t rows = rs->GetRowCount();
 
-   pair<TString,Int_t> value;
+   std::pair<TString,Int_t> value;
 
    for (Int_t i=0;i<rows;++i) {
       TSQLRow *row = rs->Next();
diff --git a/tree/treeplayer/inc/TBranchProxy.h b/tree/treeplayer/inc/TBranchProxy.h
index b6eac78a2a0..2f5c51954bd 100644
--- a/tree/treeplayer/inc/TBranchProxy.h
+++ b/tree/treeplayer/inc/TBranchProxy.h
@@ -310,8 +310,8 @@ namespace ROOT {
    public:
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
-         if (fWhere) cout << "value? " << *(unsigned char*)GetStart() << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
+         if (fWhere) std::cout << "value? " << *(unsigned char*)GetStart() << std::endl;
       }
 
       TArrayCharProxy() : TBranchProxy() {}
@@ -368,12 +368,12 @@ namespace ROOT {
    public:
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
          if (fWhere) {
             if (IsaPointer()) {
-               cout << "location " << *(TClonesArray**)fWhere << endl;
+               std::cout << "location " << *(TClonesArray**)fWhere << std::endl;
             } else {
-               cout << "location " << fWhere << endl;
+               std::cout << "location " << fWhere << std::endl;
             }
          }
       }
@@ -410,12 +410,12 @@ namespace ROOT {
    public:
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
          if (fWhere) {
             if (IsaPointer()) {
-               cout << "location " << *(TClonesArray**)fWhere << endl;
+               std::cout << "location " << *(TClonesArray**)fWhere << std::endl;
             } else {
-               cout << "location " << fWhere << endl;
+               std::cout << "location " << fWhere << std::endl;
             }
          }
       }
@@ -451,8 +451,8 @@ namespace ROOT {
    public:
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
-         if (fWhere) cout << "value? " << *(T*)GetStart() << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
+         if (fWhere) std::cout << "value? " << *(T*)GetStart() << std::endl;
       }
 
       TImpProxy() : TBranchProxy() {};
@@ -525,8 +525,8 @@ namespace ROOT {
 
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << GetWhere() << endl;
-         if (GetWhere()) cout << "value? " << *(type_t*)GetWhere() << endl;
+         std::cout << "fWhere " << GetWhere() << std::endl;
+         if (GetWhere()) std::cout << "value? " << *(type_t*)GetWhere() << std::endl;
       }
 
       const array_t &At(UInt_t i) {
@@ -551,8 +551,8 @@ namespace ROOT {
 
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
-         if (fWhere) cout << "value? " << *(T*)GetStart() << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
+         if (fWhere) std::cout << "value? " << *(T*)GetStart() << std::endl;
       }
 
       TClaImpProxy() : TBranchProxy() {};
@@ -603,8 +603,8 @@ namespace ROOT {
 
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
-         if (fWhere) cout << "value? " << *(T*)GetStart() << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
+         if (fWhere) std::cout << "value? " << *(T*)GetStart() << std::endl;
       }
 
       TStlImpProxy() : TBranchProxy() {};
@@ -656,8 +656,8 @@ namespace ROOT {
 
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
-         if (fWhere) cout << "value? " << *(type_t*)GetStart() << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
+         if (fWhere) std::cout << "value? " << *(type_t*)GetStart() << std::endl;
       }
 
       TClaArrayProxy() : TBranchProxy() {}
@@ -693,8 +693,8 @@ namespace ROOT {
 
       void Print() {
          TBranchProxy::Print();
-         cout << "fWhere " << fWhere << endl;
-         if (fWhere) cout << "value? " << *(type_t*)GetStart() << endl;
+         std::cout << "fWhere " << fWhere << std::endl;
+         if (fWhere) std::cout << "value? " << *(type_t*)GetStart() << std::endl;
       }
 
       TStlArrayProxy() : TBranchProxy() {}
diff --git a/tree/treeplayer/inc/TBranchProxyTemplate.h b/tree/treeplayer/inc/TBranchProxyTemplate.h
index f6cfee7767d..74f6ce8b19a 100644
--- a/tree/treeplayer/inc/TBranchProxyTemplate.h
+++ b/tree/treeplayer/inc/TBranchProxyTemplate.h
@@ -45,8 +45,8 @@ namespace ROOT {
 
       void Print() {
          obj.Print();
-         cout << "fWhere " << obj.GetWhere() << endl;
-         if (obj.GetWhere()) cout << "address? " << (T*)obj.GetWhere() << endl;
+         std::cout << "fWhere " << obj.GetWhere() << std::endl;
+         if (obj.GetWhere()) std::cout << "address? " << (T*)obj.GetWhere() << std::endl;
       }
 
       T* GetPtr() {
@@ -71,8 +71,8 @@ namespace ROOT {
 
       void Print() {
          obj.Print();
-         cout << "obj.GetWhere() " << obj.GetWhere() << endl;
-         //if (obj.GetWhere()) cout << "value? " << *(T*)obj.GetWhere() << endl;
+         std::cout << "obj.GetWhere() " << obj.GetWhere() << std::endl;
+         //if (obj.GetWhere()) std::cout << "value? " << *(T*)obj.GetWhere() << std::endl;
       }
 
       TClaObjProxy() : obj() {};
@@ -113,8 +113,8 @@ namespace ROOT {
 
       void Print() {
          obj.Print();
-         cout << "obj.GetWhere() " << obj.GetWhere() << endl;
-         //if (obj.GetWhere()) cout << "value? " << *(T*)obj.GetWhere() << endl;
+         std::cout << "obj.GetWhere() " << obj.GetWhere() << std::endl;
+         //if (obj.GetWhere()) std::cout << "value? " << *(T*)obj.GetWhere() << std::endl;
       }
 
       TStlObjProxy() : obj() {};
diff --git a/tree/treeplayer/inc/TTreePerfStats.h b/tree/treeplayer/inc/TTreePerfStats.h
index d78c1f9b3b0..0828fe4a48f 100644
--- a/tree/treeplayer/inc/TTreePerfStats.h
+++ b/tree/treeplayer/inc/TTreePerfStats.h
@@ -102,7 +102,7 @@ public:
    virtual void     RateEvent(Double_t , Double_t , Long64_t , Long64_t) {}
 
    virtual void     SaveAs(const char *filename="",Option_t *option="") const;
-   virtual void     SavePrimitive(ostream &out, Option_t *option = "");
+   virtual void     SavePrimitive(std::ostream &out, Option_t *option = "");
    virtual void     SetBytesRead(Long64_t nbytes) {fBytesRead = nbytes;}
    virtual void     SetBytesReadExtra(Long64_t nbytes) {fBytesReadExtra = nbytes;}
    virtual void     SetCompress(Double_t cx) {fCompress = cx;}
diff --git a/tree/treeplayer/src/TBranchProxy.cxx b/tree/treeplayer/src/TBranchProxy.cxx
index b74ef5b1767..3decf60d394 100644
--- a/tree/treeplayer/src/TBranchProxy.cxx
+++ b/tree/treeplayer/src/TBranchProxy.cxx
@@ -118,10 +118,10 @@ void ROOT::TBranchProxy::Print()
 {
    // Display the content of the object
 
-   cout << "fBranchName " << fBranchName << endl;
-   //cout << "fTree " << fDirector->fTree << endl;
-   cout << "fBranch " << fBranch << endl;
-   if (fBranchCount) cout << "fBranchCount " << fBranchCount << endl;
+   std::cout << "fBranchName " << fBranchName << std::endl;
+   //std::cout << "fTree " << fDirector->fTree << std::endl;
+   std::cout << "fBranch " << fBranch << std::endl;
+   if (fBranchCount) std::cout << "fBranchCount " << fBranchCount << std::endl;
 }
 
 Bool_t ROOT::TBranchProxy::Setup()
diff --git a/tree/treeplayer/src/TTreePerfStats.cxx b/tree/treeplayer/src/TTreePerfStats.cxx
index 302eb27f55d..8584ff322bc 100644
--- a/tree/treeplayer/src/TTreePerfStats.cxx
+++ b/tree/treeplayer/src/TTreePerfStats.cxx
@@ -465,57 +465,57 @@ void TTreePerfStats::SaveAs(const char *filename, Option_t * /*option*/) const
 }
 
 //______________________________________________________________________________
-void TTreePerfStats::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
+void TTreePerfStats::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
 {
     // Save primitive as a C++ statement(s) on output stream out
 
    char quote = '"';
-   out<<"   "<<endl;
+   out<<"   "<<std::endl;
    if (gROOT->ClassSaved(TTreePerfStats::Class())) {
       out<<"   ";
    } else {
       out<<"   TTreePerfStats *";
    }
-   out<<"ps = new TTreePerfStats();"<<endl;
-   out<<"   ps->SetName("<<quote<<GetName()<<quote<<");"<<endl;
-   out<<"   ps->SetHostInfo("<<quote<<GetHostInfo()<<quote<<");"<<endl;
-   out<<"   ps->SetTreeCacheSize("<<fTreeCacheSize<<");"<<endl;
-   out<<"   ps->SetNleaves("<<fNleaves<<");"<<endl;
-   out<<"   ps->SetReadCalls("<<fReadCalls<<");"<<endl;
-   out<<"   ps->SetReadaheadSize("<<fReadaheadSize<<");"<<endl;
-   out<<"   ps->SetBytesRead("<<fBytesRead<<");"<<endl;
-   out<<"   ps->SetBytesReadExtra("<<fBytesReadExtra<<");"<<endl;
-   out<<"   ps->SetRealNorm("<<fRealNorm<<");"<<endl;
-   out<<"   ps->SetRealTime("<<fRealTime<<");"<<endl;
-   out<<"   ps->SetCpuTime("<<fCpuTime<<");"<<endl;
-   out<<"   ps->SetDiskTime("<<fDiskTime<<");"<<endl;
-   out<<"   ps->SetUnzipTime("<<fUnzipTime<<");"<<endl;
-   out<<"   ps->SetCompress("<<fCompress<<");"<<endl;
+   out<<"ps = new TTreePerfStats();"<<std::endl;
+   out<<"   ps->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
+   out<<"   ps->SetHostInfo("<<quote<<GetHostInfo()<<quote<<");"<<std::endl;
+   out<<"   ps->SetTreeCacheSize("<<fTreeCacheSize<<");"<<std::endl;
+   out<<"   ps->SetNleaves("<<fNleaves<<");"<<std::endl;
+   out<<"   ps->SetReadCalls("<<fReadCalls<<");"<<std::endl;
+   out<<"   ps->SetReadaheadSize("<<fReadaheadSize<<");"<<std::endl;
+   out<<"   ps->SetBytesRead("<<fBytesRead<<");"<<std::endl;
+   out<<"   ps->SetBytesReadExtra("<<fBytesReadExtra<<");"<<std::endl;
+   out<<"   ps->SetRealNorm("<<fRealNorm<<");"<<std::endl;
+   out<<"   ps->SetRealTime("<<fRealTime<<");"<<std::endl;
+   out<<"   ps->SetCpuTime("<<fCpuTime<<");"<<std::endl;
+   out<<"   ps->SetDiskTime("<<fDiskTime<<");"<<std::endl;
+   out<<"   ps->SetUnzipTime("<<fUnzipTime<<");"<<std::endl;
+   out<<"   ps->SetCompress("<<fCompress<<");"<<std::endl;
 
    Int_t i, npoints = fGraphIO->GetN();
-   out<<"   TGraphErrors *psGraphIO = new TGraphErrors("<<npoints<<");"<<endl;
-   out<<"   psGraphIO->SetName("<<quote<<fGraphIO->GetName()<<quote<<");"<<endl;
-   out<<"   psGraphIO->SetTitle("<<quote<<fGraphIO->GetTitle()<<quote<<");"<<endl;
-   out<<"   ps->SetGraphIO(psGraphIO);"<<endl;
+   out<<"   TGraphErrors *psGraphIO = new TGraphErrors("<<npoints<<");"<<std::endl;
+   out<<"   psGraphIO->SetName("<<quote<<fGraphIO->GetName()<<quote<<");"<<std::endl;
+   out<<"   psGraphIO->SetTitle("<<quote<<fGraphIO->GetTitle()<<quote<<");"<<std::endl;
+   out<<"   ps->SetGraphIO(psGraphIO);"<<std::endl;
    fGraphIO->SaveFillAttributes(out,"psGraphIO",0,1001);
    fGraphIO->SaveLineAttributes(out,"psGraphIO",1,1,1);
    fGraphIO->SaveMarkerAttributes(out,"psGraphIO",1,1,1);
    for (i=0;i<npoints;i++) {
-      out<<"   psGraphIO->SetPoint("<<i<<","<<fGraphIO->GetX()[i]<<","<<fGraphIO->GetY()[i]<<");"<<endl;
-      out<<"   psGraphIO->SetPointError("<<i<<",0,"<<fGraphIO->GetEY()[i]<<");"<<endl;
+      out<<"   psGraphIO->SetPoint("<<i<<","<<fGraphIO->GetX()[i]<<","<<fGraphIO->GetY()[i]<<");"<<std::endl;
+      out<<"   psGraphIO->SetPointError("<<i<<",0,"<<fGraphIO->GetEY()[i]<<");"<<std::endl;
    }
    npoints = fGraphTime->GetN();
-   out<<"   TGraphErrors *psGraphTime = new TGraphErrors("<<npoints<<");"<<endl;
-   out<<"   psGraphTime->SetName("<<quote<<fGraphTime->GetName()<<quote<<");"<<endl;
-   out<<"   psGraphTime->SetTitle("<<quote<<fGraphTime->GetTitle()<<quote<<");"<<endl;
-   out<<"   ps->SetGraphTime(psGraphTime);"<<endl;
+   out<<"   TGraphErrors *psGraphTime = new TGraphErrors("<<npoints<<");"<<std::endl;
+   out<<"   psGraphTime->SetName("<<quote<<fGraphTime->GetName()<<quote<<");"<<std::endl;
+   out<<"   psGraphTime->SetTitle("<<quote<<fGraphTime->GetTitle()<<quote<<");"<<std::endl;
+   out<<"   ps->SetGraphTime(psGraphTime);"<<std::endl;
    fGraphTime->SaveFillAttributes(out,"psGraphTime",0,1001);
    fGraphTime->SaveLineAttributes(out,"psGraphTime",1,1,1);
    fGraphTime->SaveMarkerAttributes(out,"psGraphTime",1,1,1);
    for (i=0;i<npoints;i++) {
-      out<<"   psGraphTime->SetPoint("<<i<<","<<fGraphTime->GetX()[i]<<","<<fGraphTime->GetY()[i]<<");"<<endl;
-      out<<"   psGraphTime->SetPointError("<<i<<",0,"<<fGraphTime->GetEY()[i]<<");"<<endl;
+      out<<"   psGraphTime->SetPoint("<<i<<","<<fGraphTime->GetX()[i]<<","<<fGraphTime->GetY()[i]<<");"<<std::endl;
+      out<<"   psGraphTime->SetPointError("<<i<<",0,"<<fGraphTime->GetEY()[i]<<");"<<std::endl;
    }
 
-   out<<"   ps->Draw("<<quote<<option<<quote<<");"<<endl;
+   out<<"   ps->Draw("<<quote<<option<<quote<<");"<<std::endl;
 }
diff --git a/tree/treeplayer/src/TTreePlayer.cxx b/tree/treeplayer/src/TTreePlayer.cxx
index 9aa533602ce..9148a69a42e 100644
--- a/tree/treeplayer/src/TTreePlayer.cxx
+++ b/tree/treeplayer/src/TTreePlayer.cxx
@@ -2286,8 +2286,8 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
    UInt_t lenmax = 0;
    UInt_t colDefaultSize = 9;
    UInt_t colPrecision = 9;
-   vector<TString> colFormats;
-   vector<Int_t> colSizes;
+   std::vector<TString> colFormats;
+   std::vector<Int_t> colSizes;
 
    if (opt.Contains("lenmax=")) {
       int start = opt.Index("lenmax=");
@@ -2382,7 +2382,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
    Long64_t entry,entryNumber;
    Int_t i,nch;
    UInt_t ncols = 8;   // by default first 8 columns are printed only
-   ofstream out;
+   std::ofstream out;
    Int_t lenfile = 0;
    char * fname = 0;
    if (fScanRedirect) {
@@ -2396,7 +2396,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
          strlcpy(fname, fTree->GetName(),nch2+10);
          strlcat(fname, "-scan.dat",nch2+10);
       }
-      out.open(fname, ios::out);
+      out.open(fname, std::ios::out);
       if (!out.good ()) {
          if (!lenfile) delete [] fname;
          Error("Scan","Can not open file for redirection");
@@ -2514,7 +2514,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
       onerow += Form(starFormat.Data(),var[ui]->PrintValue(-2));
    }
    if (fScanRedirect)
-      out<<onerow.Data()<<"*"<<endl;
+      out<<onerow.Data()<<"*"<<std::endl;
    else
       printf("%s*\n",onerow.Data());
    onerow = "*    Row   ";
@@ -2524,7 +2524,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
       onerow += Form(numbFormat.Data(),var[ui]->PrintValue(-1));
    }
    if (fScanRedirect)
-      out<<onerow.Data()<<"*"<<endl;
+      out<<onerow.Data()<<"*"<<std::endl;
    else
       printf("%s*\n",onerow.Data());
    onerow = "***********";
@@ -2534,7 +2534,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
       onerow += Form(starFormat.Data(),var[ui]->PrintValue(-2));
    }
    if (fScanRedirect)
-      out<<onerow.Data()<<"*"<<endl;
+      out<<onerow.Data()<<"*"<<std::endl;
    else
       printf("%s*\n",onerow.Data());
 //*-*- loop on all selected entries
@@ -2609,7 +2609,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
          }
          fSelectedRows++;
          if (fScanRedirect)
-            out<<onerow.Data()<<"*"<<endl;
+            out<<onerow.Data()<<"*"<<std::endl;
          else
             printf("%s*\n",onerow.Data());
          if (fTree->GetScanField() > 0 && fSelectedRows > 0) {
@@ -2634,7 +2634,7 @@ Long64_t TTreePlayer::Scan(const char *varexp, const char *selection,
       onerow += Form(starFormat.Data(),var[ui]->PrintValue(-2));
    }
    if (fScanRedirect)
-      out<<onerow.Data()<<"*"<<endl;
+      out<<onerow.Data()<<"*"<<std::endl;
    else
       printf("%s*\n",onerow.Data());
    if (select) Printf("==> %lld selected %s", fSelectedRows,
diff --git a/tree/treeviewer/inc/TParallelCoord.h b/tree/treeviewer/inc/TParallelCoord.h
index 1b2c28e15d2..c45bd79d9ae 100644
--- a/tree/treeviewer/inc/TParallelCoord.h
+++ b/tree/treeviewer/inc/TParallelCoord.h
@@ -109,7 +109,7 @@ public:
    virtual void   Paint(Option_t* options="");
    void           ResetTree();
    void           SaveEntryLists(const char* filename="", Bool_t overwrite=kFALSE); // *MENU*
-   void           SavePrimitive(ostream & out,Option_t *options);
+   void           SavePrimitive(std::ostream & out,Option_t *options);
    void           SaveTree(const char* filename="", Bool_t overwrite=kFALSE); // *MENU*
    void           SetAxisHistogramBinning(Int_t n=100); // *MENU*
    void           SetAxisHistogramHeight(Double_t h=0.5); // *MENU*
diff --git a/tree/treeviewer/inc/TParallelCoordVar.h b/tree/treeviewer/inc/TParallelCoordVar.h
index 3da9fba6e47..fe4d85d970c 100644
--- a/tree/treeviewer/inc/TParallelCoordVar.h
+++ b/tree/treeviewer/inc/TParallelCoordVar.h
@@ -101,7 +101,7 @@ public:
    void           PaintHistogram();
    void           PaintLabels();
    virtual void   Print(Option_t* option="") const; // *MENU*
-   void           SavePrimitive(ostream & out, Option_t *options);
+   void           SavePrimitive(std::ostream & out, Option_t *options);
    void           SetBoxPlot(Bool_t box); // *TOGGLE* *GETTER=GetBoxPlot
    void           SetBarHisto(Bool_t h) {SetBit(kShowBarHisto,h);} // *TOGGLE* *GETTER=GetBarHisto
    void           SetHistogramLineWidth(Int_t lw=2) {fHistoLW = lw;} // *MENU*
diff --git a/tree/treeviewer/inc/TTVSession.h b/tree/treeviewer/inc/TTVSession.h
index 68117479656..ccfe27ef1d3 100644
--- a/tree/treeviewer/inc/TTVSession.h
+++ b/tree/treeviewer/inc/TTVSession.h
@@ -63,7 +63,7 @@ public:
    void           SetOption(const char *option = "")             {fOption = option;}
    void           SetRC(Bool_t redirect = kFALSE, Bool_t cut = kTRUE) {fScanRedirected = redirect; fCutEnabled = cut;}
    void           SetUserCode(const char *code, Bool_t autoexec=kTRUE) {fUserCode = code; fAutoexec=autoexec;} // *MENU*
-   void           SaveSource(ofstream &out);
+   void           SaveSource(std::ofstream &out);
 
    ClassDef(TTVRecord, 0)    // A draw record for TTreeViewer
 };
@@ -94,7 +94,7 @@ public:
 
    void           RemoveLastRecord();
    void           Show(TTVRecord *rec);
-   void           SaveSource(ofstream &out);
+   void           SaveSource(std::ofstream &out);
    void           UpdateRecord(const char *name);
 
    ClassDef(TTVSession, 0)   // A tree viewer session
diff --git a/tree/treeviewer/src/TParallelCoord.cxx b/tree/treeviewer/src/TParallelCoord.cxx
index 66dc3e36aba..15b349e8a61 100644
--- a/tree/treeviewer/src/TParallelCoord.cxx
+++ b/tree/treeviewer/src/TParallelCoord.cxx
@@ -807,7 +807,7 @@ void TParallelCoord::SaveEntryLists(const char* filename, Bool_t overwrite)
 
 
 //______________________________________________________________________________
-void TParallelCoord::SavePrimitive(ostream & out, Option_t* options)
+void TParallelCoord::SavePrimitive(std::ostream & out, Option_t* options)
 {
    // Save the TParallelCoord in a macro.
 
@@ -818,61 +818,61 @@ void TParallelCoord::SavePrimitive(ostream & out, Option_t* options)
    const char* filename = Form("%s_parallelcoord_entries.root",fTree->GetName());
    SaveEntryLists(filename,kTRUE); // FIXME overwriting by default.
    SaveTree(fTreeFileName,kTRUE);  // FIXME overwriting by default.
-   out<<"   // Create a TParallelCoord."<<endl;
-   out<<"   TFile *f = TFile::Open(\""<<fTreeFileName.Data()<<"\");"<<endl;
-   out<<"   TTree* tree = (TTree*)f->Get(\""<<fTreeName.Data()<<"\");"<<endl;
-   out<<"   TParallelCoord* para = new TParallelCoord(tree,"<<fNentries<<");"<<endl;
-   out<<"   // Load the entrylists."<<endl;
-   out<<"   TFile *entries = TFile::Open(\""<<filename<<"\");"<<endl;
-   out<<"   TEntryList *currententries = (TEntryList*)entries->Get(\"currententries\");"<<endl;
-   out<<"   tree->SetEntryList(currententries);"<<endl;
-   out<<"   para->SetInitEntries((TEntryList*)entries->Get(\"initentries\"));"<<endl;
-   out<<"   para->SetCurrentEntries(currententries);"<<endl;
+   out<<"   // Create a TParallelCoord."<<std::endl;
+   out<<"   TFile *f = TFile::Open(\""<<fTreeFileName.Data()<<"\");"<<std::endl;
+   out<<"   TTree* tree = (TTree*)f->Get(\""<<fTreeName.Data()<<"\");"<<std::endl;
+   out<<"   TParallelCoord* para = new TParallelCoord(tree,"<<fNentries<<");"<<std::endl;
+   out<<"   // Load the entrylists."<<std::endl;
+   out<<"   TFile *entries = TFile::Open(\""<<filename<<"\");"<<std::endl;
+   out<<"   TEntryList *currententries = (TEntryList*)entries->Get(\"currententries\");"<<std::endl;
+   out<<"   tree->SetEntryList(currententries);"<<std::endl;
+   out<<"   para->SetInitEntries((TEntryList*)entries->Get(\"initentries\"));"<<std::endl;
+   out<<"   para->SetCurrentEntries(currententries);"<<std::endl;
    TIter next(fSelectList);
    TParallelCoordSelect* sel;
-   out<<"   TParallelCoordSelect* sel;"<<endl;
-   out<<"   para->GetSelectList()->Delete();"<<endl;
+   out<<"   TParallelCoordSelect* sel;"<<std::endl;
+   out<<"   para->GetSelectList()->Delete();"<<std::endl;
    while ((sel = (TParallelCoordSelect*)next())) {
-      out<<"   para->AddSelection(\""<<sel->GetTitle()<<"\");"<<endl;
-      out<<"   sel = (TParallelCoordSelect*)para->GetSelectList()->Last();"<<endl;
-      out<<"   sel->SetLineColor("<<sel->GetLineColor()<<");"<<endl;
-      out<<"   sel->SetLineWidth("<<sel->GetLineWidth()<<");"<<endl;
+      out<<"   para->AddSelection(\""<<sel->GetTitle()<<"\");"<<std::endl;
+      out<<"   sel = (TParallelCoordSelect*)para->GetSelectList()->Last();"<<std::endl;
+      out<<"   sel->SetLineColor("<<sel->GetLineColor()<<");"<<std::endl;
+      out<<"   sel->SetLineWidth("<<sel->GetLineWidth()<<");"<<std::endl;
    }
    TIter nextbis(fVarList);
    TParallelCoordVar* var;
    TString varexp = "";
    while ((var = (TParallelCoordVar*)nextbis())) varexp.Append(Form(":%s",var->GetTitle()));
    varexp.Remove(TString::kLeading,':');
-   out<<"   tree->Draw(\""<<varexp.Data()<<"\",\"\",\"goff para\");"<<endl;
-   out<<"   TSelectorDraw* selector = (TSelectorDraw*)((TTreePlayer*)tree->GetPlayer())->GetSelector();"<<endl;
+   out<<"   tree->Draw(\""<<varexp.Data()<<"\",\"\",\"goff para\");"<<std::endl;
+   out<<"   TSelectorDraw* selector = (TSelectorDraw*)((TTreePlayer*)tree->GetPlayer())->GetSelector();"<<std::endl;
    nextbis.Reset();
    Int_t i=0;
-   out<<"   TParallelCoordVar* var;"<<endl;
+   out<<"   TParallelCoordVar* var;"<<std::endl;
    while ((var = (TParallelCoordVar*)nextbis())) {
-      out<<"   //***************************************"<<endl;
-      out<<"   // Create the axis \""<<var->GetTitle()<<"\"."<<endl;
-      out<<"   para->AddVariable(selector->GetVal("<<i<<"),\""<<var->GetTitle()<<"\");"<<endl;
-      out<<"   var = (TParallelCoordVar*)para->GetVarList()->Last();"<<endl;
+      out<<"   //***************************************"<<std::endl;
+      out<<"   // Create the axis \""<<var->GetTitle()<<"\"."<<std::endl;
+      out<<"   para->AddVariable(selector->GetVal("<<i<<"),\""<<var->GetTitle()<<"\");"<<std::endl;
+      out<<"   var = (TParallelCoordVar*)para->GetVarList()->Last();"<<std::endl;
       var->SavePrimitive(out,"pcalled");
       ++i;
    }
-   out<<"   //***************************************"<<endl;
-   out<<"   // Set the TParallelCoord parameters."<<endl;
-   out<<"   para->SetCurrentFirst("<<fCurrentFirst<<");"<<endl;
-   out<<"   para->SetCurrentN("<<fCurrentN<<");"<<endl;
-   out<<"   para->SetWeightCut("<<fWeightCut<<");"<<endl;
-   out<<"   para->SetDotsSpacing("<<fDotsSpacing<<");"<<endl;
-   out<<"   para->SetLineColor("<<GetLineColor()<<");"<<endl;
-   out<<"   para->SetLineWidth("<<GetLineWidth()<<");"<<endl;
-   out<<"   para->SetBit(TParallelCoord::kVertDisplay,"<<TestBit(kVertDisplay)<<");"<<endl;
-   out<<"   para->SetBit(TParallelCoord::kCurveDisplay,"<<TestBit(kCurveDisplay)<<");"<<endl;
-   out<<"   para->SetBit(TParallelCoord::kPaintEntries,"<<TestBit(kPaintEntries)<<");"<<endl;
-   out<<"   para->SetBit(TParallelCoord::kLiveUpdate,"<<TestBit(kLiveUpdate)<<");"<<endl;
-   out<<"   para->SetBit(TParallelCoord::kGlobalLogScale,"<<TestBit(kGlobalLogScale)<<");"<<endl;
-   if (TestBit(kGlobalScale)) out<<"   para->SetGlobalScale(kTRUE);"<<endl;
-   if (TestBit(kCandleChart)) out<<"   para->SetCandleChart(kTRUE);"<<endl;
-   if (TestBit(kGlobalLogScale)) out<<"   para->SetGlobalLogScale(kTRUE);"<<endl;
-   out<<endl<<"   para->Draw();"<<endl;
+   out<<"   //***************************************"<<std::endl;
+   out<<"   // Set the TParallelCoord parameters."<<std::endl;
+   out<<"   para->SetCurrentFirst("<<fCurrentFirst<<");"<<std::endl;
+   out<<"   para->SetCurrentN("<<fCurrentN<<");"<<std::endl;
+   out<<"   para->SetWeightCut("<<fWeightCut<<");"<<std::endl;
+   out<<"   para->SetDotsSpacing("<<fDotsSpacing<<");"<<std::endl;
+   out<<"   para->SetLineColor("<<GetLineColor()<<");"<<std::endl;
+   out<<"   para->SetLineWidth("<<GetLineWidth()<<");"<<std::endl;
+   out<<"   para->SetBit(TParallelCoord::kVertDisplay,"<<TestBit(kVertDisplay)<<");"<<std::endl;
+   out<<"   para->SetBit(TParallelCoord::kCurveDisplay,"<<TestBit(kCurveDisplay)<<");"<<std::endl;
+   out<<"   para->SetBit(TParallelCoord::kPaintEntries,"<<TestBit(kPaintEntries)<<");"<<std::endl;
+   out<<"   para->SetBit(TParallelCoord::kLiveUpdate,"<<TestBit(kLiveUpdate)<<");"<<std::endl;
+   out<<"   para->SetBit(TParallelCoord::kGlobalLogScale,"<<TestBit(kGlobalLogScale)<<");"<<std::endl;
+   if (TestBit(kGlobalScale)) out<<"   para->SetGlobalScale(kTRUE);"<<std::endl;
+   if (TestBit(kCandleChart)) out<<"   para->SetCandleChart(kTRUE);"<<std::endl;
+   if (TestBit(kGlobalLogScale)) out<<"   para->SetGlobalLogScale(kTRUE);"<<std::endl;
+   out<<std::endl<<"   para->Draw();"<<std::endl;
 }
 
 
diff --git a/tree/treeviewer/src/TParallelCoordEditor.cxx b/tree/treeviewer/src/TParallelCoordEditor.cxx
index ee1638f8245..5c75cd17acd 100644
--- a/tree/treeviewer/src/TParallelCoordEditor.cxx
+++ b/tree/treeviewer/src/TParallelCoordEditor.cxx
@@ -897,7 +897,7 @@ void TParallelCoordEditor::DoVariableSelect(const char* /*var*/)
 {
    // Slot to select a variable.
 
-   //cout<<((TGTextLBEntry*)fVariables->GetSelectedEntry())->GetTitle()<<endl;
+   //std::cout<<((TGTextLBEntry*)fVariables->GetSelectedEntry())->GetTitle()<<std::endl;
 }
 
 
diff --git a/tree/treeviewer/src/TParallelCoordRange.cxx b/tree/treeviewer/src/TParallelCoordRange.cxx
index 98c49b6ab4e..3b48c692cb6 100644
--- a/tree/treeviewer/src/TParallelCoordRange.cxx
+++ b/tree/treeviewer/src/TParallelCoordRange.cxx
@@ -316,7 +316,7 @@ void TParallelCoordRange::ExecuteEvent(Int_t entry, Int_t px, Int_t py)
          pyold = py;
          break;
       default:
-         //cout<<"entry: "<<entry<<endl;
+         //std::cout<<"entry: "<<entry<<std::endl;
          break;
    }
 }
diff --git a/tree/treeviewer/src/TParallelCoordVar.cxx b/tree/treeviewer/src/TParallelCoordVar.cxx
index 4b5ee62d29e..c4a7f99ca66 100644
--- a/tree/treeviewer/src/TParallelCoordVar.cxx
+++ b/tree/treeviewer/src/TParallelCoordVar.cxx
@@ -844,7 +844,7 @@ void TParallelCoordVar::Print(Option_t* /*option*/) const
 
 
 //______________________________________________________________________________
-void TParallelCoordVar::SavePrimitive(ostream & out, Option_t* options)
+void TParallelCoordVar::SavePrimitive(std::ostream & out, Option_t* options)
 {
    // Save the TParallelCoordVar as a macro. Can be used only in the context
    // of TParallelCoord::SavePrimitive (pointer "TParallelCoord* para" is
@@ -852,32 +852,32 @@ void TParallelCoordVar::SavePrimitive(ostream & out, Option_t* options)
 
    TString opt = options;
    if (opt.Contains("pcalled")) {
-      out<<"   var->SetBit(TParallelCoordVar::kLogScale,"<<TestBit(kLogScale)<<");"<<endl;
-      out<<"   var->SetBit(TParallelCoordVar::kShowBox,"<<TestBit(kShowBox)<<");"<<endl;
-      out<<"   var->SetBit(TParallelCoordVar::kShowBarHisto,"<<TestBit(kShowBarHisto)<<");"<<endl;
-      out<<"   var->SetHistogramBinning("<<fNbins<<");"<<endl;
-      out<<"   var->SetHistogramLineWidth("<<fHistoLW<<");"<<endl;
-      out<<"   var->SetInitMin("<<fMinInit<<");"<<endl;
-      out<<"   var->SetInitMax("<<fMaxInit<<");"<<endl;
-      out<<"   var->SetHistogramHeight("<<fHistoHeight<<");"<<endl;
-      out<<"   var->GetMinMaxMean();"<<endl;
-      out<<"   var->GetHistogram();"<<endl;
-      out<<"   var->SetFillStyle("<<GetFillStyle()<<");"<<endl;
-      out<<"   var->SetFillColor("<<GetFillColor()<<");"<<endl;
-      out<<"   var->SetLineColor("<<GetLineColor()<<");"<<endl;
-      out<<"   var->SetLineWidth("<<GetLineWidth()<<");"<<endl;
-      out<<"   var->SetLineStyle("<<GetLineStyle()<<");"<<endl;
-      if (TestBit(kShowBox)) out<<"   var->GetQuantiles();"<<endl;
+      out<<"   var->SetBit(TParallelCoordVar::kLogScale,"<<TestBit(kLogScale)<<");"<<std::endl;
+      out<<"   var->SetBit(TParallelCoordVar::kShowBox,"<<TestBit(kShowBox)<<");"<<std::endl;
+      out<<"   var->SetBit(TParallelCoordVar::kShowBarHisto,"<<TestBit(kShowBarHisto)<<");"<<std::endl;
+      out<<"   var->SetHistogramBinning("<<fNbins<<");"<<std::endl;
+      out<<"   var->SetHistogramLineWidth("<<fHistoLW<<");"<<std::endl;
+      out<<"   var->SetInitMin("<<fMinInit<<");"<<std::endl;
+      out<<"   var->SetInitMax("<<fMaxInit<<");"<<std::endl;
+      out<<"   var->SetHistogramHeight("<<fHistoHeight<<");"<<std::endl;
+      out<<"   var->GetMinMaxMean();"<<std::endl;
+      out<<"   var->GetHistogram();"<<std::endl;
+      out<<"   var->SetFillStyle("<<GetFillStyle()<<");"<<std::endl;
+      out<<"   var->SetFillColor("<<GetFillColor()<<");"<<std::endl;
+      out<<"   var->SetLineColor("<<GetLineColor()<<");"<<std::endl;
+      out<<"   var->SetLineWidth("<<GetLineWidth()<<");"<<std::endl;
+      out<<"   var->SetLineStyle("<<GetLineStyle()<<");"<<std::endl;
+      if (TestBit(kShowBox)) out<<"   var->GetQuantiles();"<<std::endl;
       TIter next(fRanges);
       TParallelCoordRange* range;
       Int_t i = 1;
       while ((range = (TParallelCoordRange*)next())) {
-         out<<"   //***************************************"<<endl;
-         out<<"   // Create the "<<i<<"th range owned by the axis \""<<GetTitle()<<"\"."<<endl;
-         out<<"   TParallelCoordSelect* sel = para->GetSelection(\""<<range->GetSelection()->GetTitle()<<"\");"<<endl;
-         out<<"   TParallelCoordRange* newrange = new TParallelCoordRange(var,"<<range->GetMin()<<","<<range->GetMax()<<",sel);"<<endl;
-         out<<"   var->AddRange(newrange);"<<endl;
-         out<<"   sel->Add(newrange);"<<endl;
+         out<<"   //***************************************"<<std::endl;
+         out<<"   // Create the "<<i<<"th range owned by the axis \""<<GetTitle()<<"\"."<<std::endl;
+         out<<"   TParallelCoordSelect* sel = para->GetSelection(\""<<range->GetSelection()->GetTitle()<<"\");"<<std::endl;
+         out<<"   TParallelCoordRange* newrange = new TParallelCoordRange(var,"<<range->GetMin()<<","<<range->GetMax()<<",sel);"<<std::endl;
+         out<<"   var->AddRange(newrange);"<<std::endl;
+         out<<"   sel->Add(newrange);"<<std::endl;
          ++i;
       }
    }
diff --git a/tree/treeviewer/src/TTVSession.cxx b/tree/treeviewer/src/TTVSession.cxx
index 7bcd3439db4..571e79b9d80 100644
--- a/tree/treeviewer/src/TTVSession.cxx
+++ b/tree/treeviewer/src/TTVSession.cxx
@@ -85,35 +85,35 @@ void TTVRecord::PlugIn(TTreeViewer *tv)
       item->SetSmallPic(gClient->GetPicture("cut-disable_t.xpm"));
 }
 //______________________________________________________________________________
-void TTVRecord::SaveSource(ofstream &out)
+void TTVRecord::SaveSource(std::ofstream &out)
 {
    // Save the TTVRecord in a C++ macro file
 
    char quote = '"';
-   out <<"//--- tree viewer record"<<endl;
-   out <<"   tv_record = tv_session->AddRecord(kTRUE);"<<endl;
-   out <<"   tv_session->SetRecordName("<<quote<<GetName()<<quote<<");"<<endl;
-   out <<"   tv_record->fX        = "<<quote<<fX.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fY        = "<<quote<<fY.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fZ        = "<<quote<<fZ.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fCut      = "<<quote<<fCut.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fXAlias   = "<<quote<<fXAlias.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fYAlias   = "<<quote<<fYAlias.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fZAlias   = "<<quote<<fZAlias.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fCutAlias = "<<quote<<fCutAlias.Data()<<quote<<";"<<endl;
-   out <<"   tv_record->fOption   = "<<quote<<fOption.Data()<<quote<<";"<<endl;
+   out <<"//--- tree viewer record"<<std::endl;
+   out <<"   tv_record = tv_session->AddRecord(kTRUE);"<<std::endl;
+   out <<"   tv_session->SetRecordName("<<quote<<GetName()<<quote<<");"<<std::endl;
+   out <<"   tv_record->fX        = "<<quote<<fX.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fY        = "<<quote<<fY.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fZ        = "<<quote<<fZ.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fCut      = "<<quote<<fCut.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fXAlias   = "<<quote<<fXAlias.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fYAlias   = "<<quote<<fYAlias.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fZAlias   = "<<quote<<fZAlias.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fCutAlias = "<<quote<<fCutAlias.Data()<<quote<<";"<<std::endl;
+   out <<"   tv_record->fOption   = "<<quote<<fOption.Data()<<quote<<";"<<std::endl;
    if (fScanRedirected)
-      out <<"   tv_record->fScanRedirected = kTRUE;"<<endl;
+      out <<"   tv_record->fScanRedirected = kTRUE;"<<std::endl;
    else
-      out <<"   tv_record->fScanRedirected = kFALSE;"<<endl;
+      out <<"   tv_record->fScanRedirected = kFALSE;"<<std::endl;
    if (fCutEnabled)
-      out <<"   tv_record->fCutEnabled = kTRUE;"<<endl;
+      out <<"   tv_record->fCutEnabled = kTRUE;"<<std::endl;
    else
-      out <<"   tv_record->fCutEnabled = kFALSE;"<<endl;
+      out <<"   tv_record->fCutEnabled = kFALSE;"<<std::endl;
    if (fUserCode.Length()) {
-      out <<"   tv_record->SetUserCode(\""<<fUserCode.Data()<<"\");"<<endl;
+      out <<"   tv_record->SetUserCode(\""<<fUserCode.Data()<<"\");"<<std::endl;
       if (fAutoexec) {
-         out <<"   tv_record->SetAutoexec();"<<endl;
+         out <<"   tv_record->SetAutoexec();"<<std::endl;
       }
    }
 }
@@ -229,20 +229,20 @@ void TTVSession::Show(TTVRecord *rec)
    fViewer->SetHistogramTitle(rec->GetName());
 }
 //______________________________________________________________________________
-void TTVSession::SaveSource(ofstream &out)
+void TTVSession::SaveSource(std::ofstream &out)
 {
    // Save the TTVSession in a C++ macro file
 
-   out<<"//--- session object"<<endl;
-   out<<"   tv_session = new TTVSession(treeview);"<<endl;
-   out<<"   treeview->SetSession(tv_session);"<<endl;
+   out<<"//--- session object"<<std::endl;
+   out<<"   tv_session = new TTVSession(treeview);"<<std::endl;
+   out<<"   treeview->SetSession(tv_session);"<<std::endl;
    TTVRecord *record;
    for (Int_t i=0; i<fRecords; i++) {
       record = GetRecord(i);
       record->SaveSource(out);
    }
-   out<<"//--- Connect first record"<<endl;
-   out<<"   tv_session->First();"<<endl;
+   out<<"//--- Connect first record"<<std::endl;
+   out<<"   tv_session->First();"<<std::endl;
 }
 //______________________________________________________________________________
 void TTVSession::UpdateRecord(const char *name)
diff --git a/tree/treeviewer/src/TTreeViewer.cxx b/tree/treeviewer/src/TTreeViewer.cxx
index 335c19d14ed..834ca83dae9 100644
--- a/tree/treeviewer/src/TTreeViewer.cxx
+++ b/tree/treeviewer/src/TTreeViewer.cxx
@@ -529,7 +529,7 @@ void TTreeViewer::SetFile()
          tree = (TTree*)file->Get(fTree->GetName());
          if (tree) {
             fFilename = file->GetName();
-            cout << "File name : "<< fFilename << endl;
+            std::cout << "File name : "<< fFilename << std::endl;
             return;
          } else {
             fFilename = "";
@@ -1423,10 +1423,10 @@ void TTreeViewer::ExecuteDraw()
                return;
             }
             if (dimension == 3 && strlen(gopt)) {
-               cout << "Graphics option " << gopt << " not valid for 3D histograms" << endl;
+               std::cout << "Graphics option " << gopt << " not valid for 3D histograms" << std::endl;
                return;
             }
-            cout << " Graphics option for current histogram changed to " << gopt << endl;
+            std::cout << " Graphics option for current histogram changed to " << gopt << std::endl;
             hist->Draw(gopt);
             fLastOption = fBarOption->GetText();
             gPad->Update();
@@ -1442,7 +1442,7 @@ void TTreeViewer::ExecuteDraw()
    //   fLastOption = "hist";
    //}
    if (dimension == 3 && strlen(gopt)) {
-      cout << "Graphics option " << gopt << " not valid for 3D histograms" << endl;
+      std::cout << "Graphics option " << gopt << " not valid for 3D histograms" << std::endl;
       gopt = "";
       fLastOption = "";
    }
@@ -1938,8 +1938,8 @@ Bool_t TTreeViewer::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
                            gSystem->UnixPathName(info.fFilename));
                         ExecuteCommand(command.Data());
                         ExecuteCommand("tv__tree_file->ls();");
-                        cout << "Use SetTreeName() from context menu and supply a tree name" << endl;
-                        cout << "The context menu is activated by right-clicking the panel from right" << endl;
+                        std::cout << "Use SetTreeName() from context menu and supply a tree name" << std::endl;
+                        std::cout << "The context menu is activated by right-clicking the panel from right" << std::endl;
                      }
                      break;
                   case kFileLoadLibrary:
@@ -2225,7 +2225,7 @@ Bool_t TTreeViewer::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
                }
                break;
             case 4:
-//               cout << "Dragging Item" << endl;
+//               std::cout << "Dragging Item" << std::endl;
             default:
                break;
          }
@@ -2651,7 +2651,7 @@ void TTreeViewer::SaveSource(const char* filename, Option_t *)
 
    if (!fTree) return;
    char quote = '"';
-   ofstream out;
+   std::ofstream out;
    Int_t lenfile = strlen(filename);
    char * fname;
    if (!lenfile) {
@@ -2664,11 +2664,11 @@ void TTreeViewer::SaveSource(const char* filename, Option_t *)
    // if filename is given, open this file, otherwise create a file
    // with a name : treeviewer.C
    if (lenfile) {
-      out.open(fname, ios::out);
+      out.open(fname, std::ios::out);
    } else {
       fname = new char[13];
       strlcpy(fname, "treeviewer.C",13);
-      out.open(fname, ios::out);
+      out.open(fname, std::ios::out);
    }
    if (!out.good ()) {
       printf("SaveSource cannot open file : %s\n", fname);
@@ -2680,61 +2680,61 @@ void TTreeViewer::SaveSource(const char* filename, Option_t *)
    TDatime t;
    TString sname(fname);
    sname = sname.ReplaceAll(".C", "");
-   out <<"void "<<sname.Data()<<"() {"<<endl;
-   out <<"//=========Macro generated by ROOT version"<<gROOT->GetVersion()<<endl;
-   out <<"//=========for tree "<<quote<<fTree->GetName()<<quote<<" ("<<t.AsString()<<")"<<endl;
-   out <<"//===This macro can be opened from a TreeViewer session after loading"<<endl;
-   out <<"//===the corresponding tree, or by running root with the macro name argument"<<endl<<endl;
-   out <<"   open_session();"<<endl;
-   out <<"}"<<endl<<endl;
-   out <<"open_session(void *p = 0) {"<<endl;
-   out <<"   gSystem->Load("<<quote<<"libTreeViewer"<<quote<<");"<<endl;
-   out <<"   TTreeViewer *treeview = (TTreeViewer *) p;"<<endl;
-   out <<"   if (!treeview) treeview = new TTreeViewer();"<<endl;
-   out <<"   TTree *tv_tree = (TTree*)gROOT->FindObject("<<quote<<fTree->GetName()<<quote<<");"<<endl;
-   out <<"   TFile *tv_file = (TFile*)gROOT->GetListOfFiles()->FindObject("<<quote<<fFilename<<quote<<");"<<endl;
-   out <<"   if (!tv_tree) {"<<endl;
-   out <<"      if (!tv_file) tv_file = new TFile("<<quote<<fFilename<<quote<<");"<<endl;
-   out <<"      if (tv_file)  tv_tree = (TTree*)tv_file->Get("<<quote<<fTree->GetName()<<quote<<");"<<endl;
-   out <<"      if(!tv_tree) {"<<endl;
-   out <<"         printf(\"Tree %s not found\", fTree->GetName());"<<endl;
-   out <<"         return;"<<endl;
-   out <<"      }"<<endl;
-   out <<"   }"<<endl<<endl;
-   out <<"   treeview->SetTreeName("<<quote<<fTree->GetName()<<quote<<");"<<endl;
-   out <<"   treeview->SetNexpressions("<<fNexpressions<<");"<<endl;
+   out <<"void "<<sname.Data()<<"() {"<<std::endl;
+   out <<"//=========Macro generated by ROOT version"<<gROOT->GetVersion()<<std::endl;
+   out <<"//=========for tree "<<quote<<fTree->GetName()<<quote<<" ("<<t.AsString()<<")"<<std::endl;
+   out <<"//===This macro can be opened from a TreeViewer session after loading"<<std::endl;
+   out <<"//===the corresponding tree, or by running root with the macro name argument"<<std::endl<<std::endl;
+   out <<"   open_session();"<<std::endl;
+   out <<"}"<<std::endl<<std::endl;
+   out <<"open_session(void *p = 0) {"<<std::endl;
+   out <<"   gSystem->Load("<<quote<<"libTreeViewer"<<quote<<");"<<std::endl;
+   out <<"   TTreeViewer *treeview = (TTreeViewer *) p;"<<std::endl;
+   out <<"   if (!treeview) treeview = new TTreeViewer();"<<std::endl;
+   out <<"   TTree *tv_tree = (TTree*)gROOT->FindObject("<<quote<<fTree->GetName()<<quote<<");"<<std::endl;
+   out <<"   TFile *tv_file = (TFile*)gROOT->GetListOfFiles()->FindObject("<<quote<<fFilename<<quote<<");"<<std::endl;
+   out <<"   if (!tv_tree) {"<<std::endl;
+   out <<"      if (!tv_file) tv_file = new TFile("<<quote<<fFilename<<quote<<");"<<std::endl;
+   out <<"      if (tv_file)  tv_tree = (TTree*)tv_file->Get("<<quote<<fTree->GetName()<<quote<<");"<<std::endl;
+   out <<"      if(!tv_tree) {"<<std::endl;
+   out <<"         printf(\"Tree %s not found\", fTree->GetName());"<<std::endl;
+   out <<"         return;"<<std::endl;
+   out <<"      }"<<std::endl;
+   out <<"   }"<<std::endl<<std::endl;
+   out <<"   treeview->SetTreeName("<<quote<<fTree->GetName()<<quote<<");"<<std::endl;
+   out <<"   treeview->SetNexpressions("<<fNexpressions<<");"<<std::endl;
    // get expressions
    TTVLVEntry *item;
-   out <<"//         Set expressions on axis and cut"<<endl;
-   out <<"   TTVLVEntry *item;"<<endl;
+   out <<"//         Set expressions on axis and cut"<<std::endl;
+   out <<"   TTVLVEntry *item;"<<std::endl;
    for (Int_t i=0; i<4; i++) {
       switch (i) {
          case 0:
-            out <<"//   X expression"<<endl;
+            out <<"//   X expression"<<std::endl;
             break;
          case 1:
-            out <<"//   Y expression"<<endl;
+            out <<"//   Y expression"<<std::endl;
             break;
          case 2:
-            out <<"//   Z expression"<<endl;
+            out <<"//   Z expression"<<std::endl;
             break;
          case 3:
-            out <<"//   Cut expression"<<endl;
+            out <<"//   Cut expression"<<std::endl;
             break;
          default:
             break;
       }
       item = ExpressionItem(i);
-      out <<"   item = treeview->ExpressionItem("<<i<<");"<<endl;
+      out <<"   item = treeview->ExpressionItem("<<i<<");"<<std::endl;
       out <<"   item->SetExpression("<<quote<<item->GetTrueName()<<quote
-          <<", "<<quote<<item->GetAlias()<<quote<<");"<<endl;
+          <<", "<<quote<<item->GetAlias()<<quote<<");"<<std::endl;
    }
-   out <<"//         Scan list"<<endl;
+   out <<"//         Scan list"<<std::endl;
    item = ExpressionItem(4);
-   out <<"   item = treeview->ExpressionItem(4);"<<endl;
+   out <<"   item = treeview->ExpressionItem(4);"<<std::endl;
    out <<"   item->SetExpression("<<quote<<item->GetTrueName()<<quote
-          <<", "<<quote<<"Scan box"<<quote<<");"<<endl;
-   out <<"//         User defined expressions"<<endl;
+          <<", "<<quote<<"Scan box"<<quote<<");"<<std::endl;
+   out <<"//         User defined expressions"<<std::endl;
    TString itemType;
    for (Int_t crt=5; crt<fNexpressions+5; crt++) {
       item = ExpressionItem(crt);
@@ -2742,12 +2742,12 @@ void TTreeViewer::SaveSource(const char* filename, Option_t *)
          itemType = "kTRUE";
       else
          itemType = "kFALSE";
-      out <<"   item = treeview->ExpressionItem("<<crt<<");"<<endl;
+      out <<"   item = treeview->ExpressionItem("<<crt<<");"<<std::endl;
       out <<"   item->SetExpression("<<quote<<item->GetTrueName()<<quote
-          <<", "<<quote<<item->GetAlias()<<quote<<", "<<itemType.Data()<<");"<<endl;
+          <<", "<<quote<<item->GetAlias()<<quote<<", "<<itemType.Data()<<");"<<std::endl;
    }
    fSession->SaveSource(out);
-   out <<"}"<<endl;
+   out <<"}"<<std::endl;
    out.close();
    printf("C++ Macro file: %s has been generated\n", fname);
    if (!lenfile) delete [] fname;
diff --git a/tutorials/proof/ProofStdVect.h b/tutorials/proof/ProofStdVect.h
index cb541fcc8dd..b4585150194 100644
--- a/tutorials/proof/ProofStdVect.h
+++ b/tutorials/proof/ProofStdVect.h
@@ -15,8 +15,8 @@
 
 #include <vector>
 #ifdef __MAKECINT__
-#pragma link C++ class vector<vector<bool> >+;
-#pragma link C++ class vector<vector<float> >+;
+#pragma link C++ class std::vector<std::vector<bool> >+;
+#pragma link C++ class std::vector<std::vector<float> >+;
 #endif
 
 class TFile;
diff --git a/tutorials/quadp/Quad.cxx b/tutorials/quadp/Quad.cxx
index fb5670c3de8..04b45e57446 100644
--- a/tutorials/quadp/Quad.cxx
+++ b/tutorials/quadp/Quad.cxx
@@ -11,8 +11,8 @@ Quad::Quad(Float_t a,Float_t b,Float_t c)
 
 Quad::~Quad()
 {
-   cout << "deleting object with coeffts: "
-        << fA << "," << fB << "," << fC << endl;
+   std::cout << "deleting object with coeffts: "
+        << fA << "," << fB << "," << fC << std::endl;
 }
 
 void Quad::Solve() const
@@ -20,17 +20,17 @@ void Quad::Solve() const
    Float_t temp = fB*fB -4*fA*fC;
    if (temp > 0) {
       temp = sqrt(temp);
-      cout << "There are two roots: "
+      std::cout << "There are two roots: "
            << ( -fB - temp ) / (2.*fA)
            << " and "
            << ( -fB + temp ) / (2.*fA)
-           << endl;
+           << std::endl;
    } else {
       if (temp == 0) {
-         cout << "There are two equal roots: "
-         << -fB / (2.*fA) << endl;
+         std::cout << "There are two equal roots: "
+         << -fB / (2.*fA) << std::endl;
       } else {
-         cout << "There are no roots" << endl;
+         std::cout << "There are no roots" << std::endl;
       }
    }
 }
diff --git a/tutorials/tree/clonesA_Event.cxx b/tutorials/tree/clonesA_Event.cxx
index 7356cf80b2c..48c6c8b2d4c 100644
--- a/tutorials/tree/clonesA_Event.cxx
+++ b/tutorials/tree/clonesA_Event.cxx
@@ -22,7 +22,7 @@ TUsrHitBuffer::TUsrHitBuffer(Int_t maxent) {
    fNofEntries = maxent;
    fNofHits = 0;
    fHits = new TClonesArray("TUsrHit", fNofEntries);
-   cout << "ctor TUsrHitBuffer " << this << endl;
+   std::cout << "ctor TUsrHitBuffer " << this << std::endl;
 }
 
 //______________________________________________________
@@ -44,7 +44,7 @@ void TUsrHitBuffer::Clear(Option_t *) {
 
 void TUsrSevtData1::SetEvent(Int_t ev) {
    Clear();
-   cout << "TUsrSevtData1: " << ev << endl;
+   std::cout << "TUsrSevtData1: " << ev << std::endl;
    fTimeStamp = 100+ev; //in TMrbSubevent_Caen
    fSevtName  = "SubEvent_1_";
    fSevtName += ev;
@@ -58,7 +58,7 @@ void TUsrSevtData1::SetEvent(Int_t ev) {
 
 void TUsrSevtData2::SetEvent(Int_t ev) {
    Clear();
-   cout << "TUsrSevtData2: " << ev << endl;
+   std::cout << "TUsrSevtData2: " << ev << std::endl;
    fTimeStamp = 100+ev; //in TMrbSubevent_Caen
    fSevtName  = "SubEvent_2_";
    fSevtName += ev;
diff --git a/tutorials/tree/clonesA_Event.h b/tutorials/tree/clonesA_Event.h
index 787ead87131..242a74ca8c9 100644
--- a/tutorials/tree/clonesA_Event.h
+++ b/tutorials/tree/clonesA_Event.h
@@ -22,7 +22,7 @@ class TUsrHitBuffer:public TObject {
 //                                                                                                                                                                                                                                                             TUsrHitBuffer(){};
    TUsrHitBuffer(Int_t maxent = 10);
    virtual ~TUsrHitBuffer() {
-      cout << "~~~~~~dtor TUsrHitBuffer " << this << endl;
+      std::cout << "~~~~~~dtor TUsrHitBuffer " << this << std::endl;
       delete fHits;
    }
    
@@ -46,7 +46,7 @@ class TUsrHitBuffer:public TObject {
 class TMrbSubevent_Caen:public TObject {
 
  public:
-   TMrbSubevent_Caen() {cout << "ctor  TMrbSubevent_Caen" << this << endl;}
+   TMrbSubevent_Caen() {std::cout << "ctor  TMrbSubevent_Caen" << this << std::endl;}
    virtual ~TMrbSubevent_Caen() {}
    void Clear(Option_t * /* opt */ ="") {fHitBuffer.Clear();};
    TUsrHitBuffer * GetHitBuffer() {return &fHitBuffer;};
-- 
GitLab