~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/py_cpp/PyGlobals.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:
91
91
  const char* temp = NULL;
92
92
  if (!PyArg_ParseTuple(args, "s", &temp)) {
93
93
    PyErr_SetString(PyExc_TypeError,
94
 
         "Failed to recognise arghas_instanceuments to Globals.birth as a string");
 
94
         "Failed to recognise arguments to Globals.birth as a string");
95
95
    return NULL;
96
96
  }
97
97
  std::string cards(temp);
98
98
  try {
99
99
    GlobalsManager::InitialiseGlobals(cards);
100
 
  } catch(std::exception& exc) {
 
100
  } catch (std::exception& exc) {
101
101
    PyErr_SetString(PyExc_RuntimeError, (&exc)->what());
102
102
    return NULL;
103
103
  }
108
108
PyObject* Death(PyObject *dummy, PyObject *args) {
109
109
  try {
110
110
    GlobalsManager::DeleteGlobals();
111
 
  } catch(std::exception& exc) {  // shouldn't be able to throw an exception
 
111
  } catch (std::exception& exc) {  // shouldn't be able to throw an exception
112
112
    PyErr_SetString(PyExc_RuntimeError, (&exc)->what());
113
113
    return NULL;
114
114
  }
123
123
      return Py_BuildValue("i", 1);
124
124
    else
125
125
      return Py_BuildValue("i", 0);
126
 
  } catch(std::exception& exc) {  // shouldn't be able to throw an exception
 
126
  } catch (std::exception& exc) {  // shouldn't be able to throw an exception
127
127
    PyErr_SetString(PyExc_RuntimeError, (&exc)->what());
128
128
    return NULL;
129
129
  }
205
205
    }
206
206
    try {
207
207
        GlobalsManager::SetMonteCarloMiceModules(mod);
208
 
    } catch(std::exception& exc) {
 
208
    } catch (std::exception& exc) {
209
209
        std::string message = std::string("Failed to set MiceModules\n")+
210
210
                              std::string((&exc)->what());
211
211
        PyErr_SetString(PyExc_ValueError, message.c_str());