FairShip
Loading...
Searching...
No Matches
pyFairModule.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#ifndef MUONSHIELDOPTIMIZATION_PYFAIRMODULE_H_
6#define MUONSHIELDOPTIMIZATION_PYFAIRMODULE_H_
7
8struct _object;
9typedef _object PyObject;
10#include <stdexcept>
11
12#include "FairModule.h"
13void call_python_method(PyObject* self, const char* method);
14
15class pyFairModule : public FairModule {
16 public:
17 explicit pyFairModule(PyObject* self) : fSelf(self) {}
18 ~pyFairModule() override = default;
19 void ConstructGeometry() override {
20 call_python_method(fSelf, "ConstructGeometry");
21 }
22
23 private:
25 ClassDefOverride(pyFairModule, 0)
26};
27
28#endif // MUONSHIELDOPTIMIZATION_PYFAIRMODULE_H_
~pyFairModule() override=default
void ConstructGeometry() override
Definition: pyFairModule.h:19
pyFairModule(PyObject *self)
Definition: pyFairModule.h:17
PyObject * fSelf
Definition: pyFairModule.h:24
void call_python_method(PyObject *self, const char *method)
_object PyObject
Definition: pyFairModule.h:9