From 954582227912735fc06fd568e41cc3dc23313c4e Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Fri, 10 Feb 2017 10:24:30 +0100
Subject: [PATCH] DDRec: Restore flags in DetectorData ostream operators

---
 DDRec/CMakeLists.txt       |  2 +-
 DDRec/src/DetectorData.cpp | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/DDRec/CMakeLists.txt b/DDRec/CMakeLists.txt
index 37ae59486..162922c54 100644
--- a/DDRec/CMakeLists.txt
+++ b/DDRec/CMakeLists.txt
@@ -12,7 +12,7 @@
 #
 #==========================================================================
 dd4hep_package(DDRec
-  USES             DDCore DDSurfaces
+  USES             DDCore DDSurfaces boost
                   [ROOT REQUIRED COMPONENTS Geom]
   INCLUDE_DIRS     include
   INSTALL_INCLUDES include/DDRec)
diff --git a/DDRec/src/DetectorData.cpp b/DDRec/src/DetectorData.cpp
index 4576a619a..56259b3d5 100644
--- a/DDRec/src/DetectorData.cpp
+++ b/DDRec/src/DetectorData.cpp
@@ -1,10 +1,14 @@
 #include "DDRec/DetectorData.h"
 
+#include <boost/io/ios_state.hpp>
+
 namespace DD4hep {
   namespace DDRec {
 
 
     std::ostream& operator<<( std::ostream& io , const FixedPadSizeTPCData& d ){
+      boost::io::ios_base_all_saver ifs(io);
+
       io <<  " --FixedPadSizeTPCData: "  << std::scientific << std::endl ; 
       io <<  "   zHalf : "              <<  d.zHalf  << std::endl ; 
       io <<  "   rMin : "               <<  d.rMin << std::endl ; 
@@ -25,6 +29,7 @@ namespace DD4hep {
 
 
     std::ostream& operator<<( std::ostream& io , const ZPlanarData& d ) {
+      boost::io::ios_base_all_saver ifs(io);
 
       io <<  " -- ZPlanarData: "  << std::scientific << std::endl ; 
       io <<  " zHalfShell  : " <<  d.zHalfShell  << std::endl ; 
@@ -68,6 +73,7 @@ namespace DD4hep {
     }
 
     std::ostream& operator<<( std::ostream& io , const ZDiskPetalsData& d ) {
+      boost::io::ios_base_all_saver ifs(io);
 
       io <<  " -- ZDiskPetalsData: "  << std::scientific << std::endl ; 
       io <<  "  widthStrip : " <<  d.widthStrip  << std::endl ; 
@@ -116,6 +122,7 @@ namespace DD4hep {
 
     
     std::ostream& operator<<( std::ostream& io , const ConicalSupportData& d ) {
+      boost::io::ios_base_all_saver ifs(io);
 
       io <<  " -- ConicalSupportData : "  << std::scientific << std::endl ; 
       io <<  "  isSymmetricInZ : " <<  d.isSymmetricInZ  << std::endl ; 
@@ -139,6 +146,7 @@ namespace DD4hep {
 
     
     std::ostream& operator<<( std::ostream& io , const LayeredCalorimeterData& d ) {
+      boost::io::ios_base_all_saver ifs(io);
 
       io <<  " -- LayeredCalorimeterData : "  << std::scientific << std::endl ; 
       io <<  "  LayoutType : " <<  ( d.layoutType == LayeredCalorimeterStruct::BarrelLayout ?
@@ -180,6 +188,8 @@ namespace DD4hep {
 
 
     std::ostream& operator<<( std::ostream& io , const NeighbourSurfacesData& d ){
+      boost::io::ios_base_all_saver ifs(io);
+
       io <<  " --NeighbourSurfacesData: "  << std::scientific << std::endl ; 
       io <<  "   sameLayer.size() : " << d.sameLayer.size() << std::endl ; 
       return io ;
-- 
GitLab