~mbogomilov/maus/devel3

« back to all changes in this revision

Viewing changes to src/common_cpp/FieldTools/SectorMagneticFieldMap.cc

  • Committer: Durga Rajaram
  • Date: 2014-01-14 07:07:02 UTC
  • mfrom: (659.1.80 relcand)
  • Revision ID: durga@fnal.gov-20140114070702-2l1fuj1w6rraw7xe
Tags: MAUS-v0.7.6
MAUS-v0.7.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <iostream>
22
22
 
23
23
#include "src/legacy/Interface/Squeak.hh"
24
 
#include "src/legacy/Interface/Squeal.hh"
 
24
#include "Utils/Exception.hh"
25
25
 
26
26
#include "src/legacy/Interface/Mesh.hh"
27
27
#include "src/legacy/Interface/STLUtils.hh"
51
51
        SectorMagneticFieldMap* tgt = _fields[file_name];
52
52
        if (_symmetry != tgt-> _symmetry || _units != tgt->_units ||
53
53
            _format != tgt->_format || _filename != tgt->_filename) {
54
 
            throw(Squeal(Squeal::recoverable,
 
54
            throw(Exception(Exception::recoverable,
55
55
               "Attempt to construct different SectorFieldMaps with same file "+
56
56
               std::string("but different settings"),
57
57
               "SectorMagneticFieldMap::SectorMagneticFieldMap(...)"));
111
111
    if (sym == "Dipole") {
112
112
        return dipole;
113
113
    }
114
 
    throw(Squeal(Squeal::recoverable,
 
114
    throw(Exception(Exception::recoverable,
115
115
          "Didn't recognise symmetry type "+sym,
116
116
          "SectorMagneticFieldMap::StringToSymmetry"));
117
117
}
124
124
    if (sym == dipole) {
125
125
        return "Dipole";
126
126
    }
127
 
    throw(Squeal(Squeal::recoverable,
 
127
    throw(Exception(Exception::recoverable,
128
128
                 "Didn't recognise symmetry type",
129
129
                 "SectorMagneticFieldMap::SymmetryToString"));
130
130
}
165
165
            return ReadToscaMap(file_name, units, symmetry);
166
166
        }
167
167
    } catch(std::exception& exc) {
168
 
        throw(Squeal(Squeal::recoverable,
 
168
        throw(Exception(Exception::recoverable,
169
169
                     "Failed to read file "+file_name+" with "+(&exc)->what(),
170
170
                     "SectorMagneticFieldMapIO::ReadMap"));
171
171
    }
172
 
    throw(Squeal(Squeal::recoverable,
 
172
    throw(Exception(Exception::recoverable,
173
173
                 "Didn't recognise map type "+file_type,
174
174
                 "SectorMagneticFieldMapIO::ReadMap"));
175
175
    return NULL;
260
260
    std::vector< std::vector<double> > field_points;
261
261
    std::string line;
262
262
    if (units.size() != 6) {
263
 
        throw(Squeal(Squeal::recoverable,
 
263
        throw(Exception(Exception::recoverable,
264
264
                    "Units should be of length 6",
265
265
                    "SectorMagneticFieldMapIO::ReadMap"));
266
266
    }
267
267
 
268
268
    std::ifstream fin(file_name.c_str());
269
269
    if (!fin || !fin.is_open()) {
270
 
        throw(Squeal(Squeal::recoverable,
 
270
        throw(Exception(Exception::recoverable,
271
271
                     "Failed to open file "+file_name,
272
272
                     "SectorMagneticFieldMapIO::ReadMap"));
273
273
    }