From 0aa3c688c5fc2fe5974c1597892b3e44fa0e628d Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (office)" <j.wuttke@fz-juelich.de>
Date: Wed, 25 Jan 2012 15:53:37 +0100
Subject: [PATCH] now reading acq52

---
 pub/src/rssm.cpp | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/pub/src/rssm.cpp b/pub/src/rssm.cpp
index 196bb748..5dda414f 100644
--- a/pub/src/rssm.cpp
+++ b/pub/src/rssm.cpp
@@ -134,7 +134,7 @@ void CRawfileSpheres::RdRawYam( ifstream& F_in )
                     throw "DATA BUG: EnergyHistogram[" + strg(iEne) + "][" +
                         strg(i+1) + "] is not a SEQUENCE"; 
                 for( int j=0; j<ndet; ++j ) {
-                    *arr >> val;
+                    (*arr)[j] >> val;
                     if( !mystd::any2dbl( val, &num ) )
                         throw "E-Hist: invalid count " + val;
                     rawdata[i].push_back( num );
@@ -146,7 +146,7 @@ void CRawfileSpheres::RdRawYam( ifstream& F_in )
                     throw "DATA BUG: EnergyHistogram[" + strg(iEne) + "][" +
                         strg(i+1+4) + "] is not a SEQUENCE"; 
                 for( int j=0; j<ndet; ++j ) {
-                    *arr >> val;
+                    (*arr)[j] >> val;
                     if( !mystd::any2dbl( val, &num ) )
                         throw "E-Hist: invalid tstep " + val;
                     rawdata[i].push_back( num );
@@ -175,20 +175,28 @@ void CRawfileSpheres::RdRawYam( ifstream& F_in )
             for( int i=4; i<6; ++i )
                 rawdata[i].push_back( num );
             for( int i=4; i<6; ++i ){                        // 2 cnts lines
-                doc["ChopperHistograms"][iCho][i-4+1] >> val;//cnts line
-                if( !mystd::str2vec( val, &numvec ) )
-                    throw "DATA BUG: cnts line extraction failed";
-                if( numvec.size()!=ndet )
-                    throw "DATA BUG: hist: ndet incompatibility";
-                for( int ii=0; ii<numvec.size(); ++ii )
-                    rawdata[i].push_back( numvec[ii] );
+                arr = &(doc["ChopperHistograms"][iCho][i-4+1]);
+                if( arr->Type() != YAML::NodeType::Sequence )
+                    throw "DATA BUG: ChopperHistogram[" + strg(iCho) + "][" +
+                        strg(i-4+1) + "] is not a SEQUENCE"; 
+                for( int j=0; j<ndet; ++j ) {
+                    (*arr)[j] >> val;
+                    if( !mystd::any2dbl( val, &num ) )
+                        throw "E-Hist: invalid count " + val;
+                    rawdata[i].push_back( num );
+                }
             }
             for( int i=4; i<6; ++i ){            // 2 time lines
-                doc["ChopperHistograms"][iCho][i-4+1+2] >> val;//time line
-                if( !mystd::str2vec( val, &numvec ) )
-                    throw "DATA BUG: time line extraction failed";
-                for( int ii=0; ii<numvec.size(); ++ii )
-                    rawdata[i].push_back( numvec[ii] );
+                arr = &(doc["ChopperHistograms"][iCho][i-4+1+2]);
+                if( arr->Type() != YAML::NodeType::Sequence )
+                    throw "DATA BUG: ChopperHistogram[" + strg(iCho) + "][" +
+                        strg(i-4+1+2) + "] is not a SEQUENCE"; 
+                for( int j=0; j<ndet; ++j ) {
+                    (*arr)[j] >> val;
+                    if( !mystd::any2dbl( val, &num ) )
+                        throw "E-Hist: invalid count " + val;
+                    rawdata[i].push_back( num );
+                }
             }
         }
     } catch( exception& e ) {
-- 
GitLab