FairShip
Loading...
Searching...
No Matches
pyFairModule Class Reference

#include <pyFairModule.h>

Inheritance diagram for pyFairModule:
[legend]
Collaboration diagram for pyFairModule:
[legend]

Public Member Functions

 pyFairModule (PyObject *self)
 ~pyFairModule () override=default
void ConstructGeometry () override

Static Public Member Functions

static std::vector< std::string > SensitiveVolumeNames (const std::string &module="")

Private Attributes

PyObject * fSelf

Detailed Description

Definition at line 17 of file pyFairModule.h.

Constructor & Destructor Documentation

◆ pyFairModule()

pyFairModule::pyFairModule ( PyObject * self)
inlineexplicit

Definition at line 19 of file pyFairModule.h.

19: fSelf(self) {}
PyObject * fSelf

◆ ~pyFairModule()

pyFairModule::~pyFairModule ( )
overridedefault

Member Function Documentation

◆ ConstructGeometry()

void pyFairModule::ConstructGeometry ( )
inlineoverride

Definition at line 21 of file pyFairModule.h.

21 {
22 call_python_method(fSelf, "ConstructGeometry");
23 }
void call_python_method(PyObject *self, const char *method)

◆ SensitiveVolumeNames()

std::vector< std::string > pyFairModule::SensitiveVolumeNames ( const std::string & module = "")
static

Names of the volumes that the modules of this run registered as sensitive so far, as FairDetector::Initialize() looks them up in the geometry given to Geant4 (without a "#" copy suffix). Compiled, because the list is thread_local, which the interpreter cannot reach reliably. With a module name, only the volumes that module registered.

Definition at line 11 of file pyFairModule.cxx.

12 {
13 std::vector<std::string> names;
14 names.reserve(fAllSensitiveVolumes.size());
15 for (const FairVolume* volume : fAllSensitiveVolumes) {
16 if (!volume) {
17 continue;
18 }
19 if (!module.empty() &&
20 (!volume->GetModule() || module != volume->GetModule()->GetName())) {
21 continue;
22 }
23 std::string name = volume->GetName();
24 // Same cut as in FairDetector::Initialize()
25 const auto pos = name.find('#', 1);
26 if (pos != std::string::npos && pos > 1) {
27 name.resize(pos);
28 }
29 names.push_back(name);
30 }
31 return names;
32}

Member Data Documentation

◆ fSelf

PyObject* pyFairModule::fSelf
private

Definition at line 33 of file pyFairModule.h.


The documentation for this class was generated from the following files: