~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/map/MapCppSimulation/MapCppSimulation.cc

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <vector>
21
21
#include <string>
22
22
 
23
 
#include "Interface/Squeal.hh"
 
23
#include "Utils/Exception.hh"
24
24
 
25
25
#include "src/common_cpp/Utils/Globals.hh"
26
26
#include "src/common_cpp/Utils/JsonWrapper.hh"
41
41
    _doVis = MAUSGeant4Manager::GetInstance()->GetVisManager() != NULL;
42
42
    return true;  // Sucessful completion
43
43
  // Normal session, no visualization
44
 
  } catch(Squeal& squee) {
45
 
    MAUS::CppErrorHandler::getInstance()->HandleSquealNoJson(squee, _classname);
46
 
  } catch(std::exception& exc) {
 
44
  } catch (Exception& exception) {
 
45
    MAUS::CppErrorHandler::getInstance()->HandleExceptionNoJson(exception, _classname);
 
46
  } catch (std::exception& exc) {
47
47
    MAUS::CppErrorHandler::getInstance()->HandleStdExcNoJson(exc, _classname);
48
48
  }
49
49
  return false;
52
52
std::string MapCppSimulation::process(std::string document) {
53
53
  Json::Value spill;
54
54
  try {spill = JsonWrapper::StringToJson(document);}
55
 
  catch(...) {
 
55
  catch (...) {
56
56
    return std::string("{\"errors\":{\"bad_json_document\":")+
57
57
           std::string("\"Failed to parse input document\"}}");
58
58
  }
67
67
    if (_doVis)
68
68
        MAUS::MAUSGeant4Manager::GetInstance()->GetVisManager()->TearDownRun();
69
69
  }
70
 
  catch(Squeal& squee) {
 
70
  catch (Exception& exception) {
71
71
    spill = MAUS::CppErrorHandler::getInstance()
72
 
                                       ->HandleSqueal(spill, squee, _classname);
73
 
  } catch(std::exception& exc) {
 
72
                                       ->HandleException(spill, exception, _classname);
 
73
  } catch (std::exception& exc) {
74
74
    spill = MAUS::CppErrorHandler::getInstance()
75
75
                                         ->HandleStdExc(spill, exc, _classname);
76
76
  }