├── .clang-format
├── .github
└── workflows
│ ├── tests.yml
│ └── wheels.yml
├── .gitignore
├── .gitmodules
├── CMakeLists.txt
├── DESIGN.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── examples
├── B1
│ ├── README
│ ├── exampleB1.in
│ ├── exampleB1.out
│ ├── exampleB1.py
│ ├── exampleB1MT.py
│ ├── init_vis.mac
│ ├── run1.mac
│ ├── run2.mac
│ └── vis.mac
├── B2
│ ├── README
│ ├── exampleB2.in
│ ├── exampleB2a.out
│ ├── exampleB2a.py
│ ├── exampleB2b.out
│ ├── exampleB2b.py
│ ├── gui.mac
│ ├── init_vis.mac
│ ├── run1.mac
│ ├── run2.mac
│ ├── startup.mac
│ └── vis.mac
├── B3
│ ├── README
│ ├── debug.mac
│ ├── exampleB3.in
│ ├── exampleB3a.out
│ ├── exampleB3a.py
│ ├── exampleB3b.out
│ ├── exampleB3b.py
│ ├── init_vis.mac
│ ├── run1.mac
│ ├── run2.mac
│ └── vis.mac
├── B4
│ ├── README
│ ├── exampleB4.in
│ ├── exampleB4a.out
│ ├── exampleB4a.py
│ ├── exampleB4b.out
│ ├── exampleB4b.py
│ ├── exampleB4c.out
│ ├── exampleB4c.py
│ ├── exampleB4d.out
│ ├── exampleB4d.py
│ ├── gui.mac
│ ├── init_vis.mac
│ ├── run1.mac
│ ├── run2.mac
│ └── vis.mac
├── B5
│ ├── README
│ ├── exampleB5.in
│ ├── exampleB5.out
│ ├── exampleB5.py
│ ├── gui.mac
│ ├── icons.mac
│ ├── init.mac
│ ├── init_vis.mac
│ ├── run.png
│ ├── run1.mac
│ ├── run2.mac
│ └── vis.mac
└── gdml
│ ├── README
│ ├── auxiliary.gdml
│ ├── g04.mac
│ ├── g04.py
│ └── vis.mac
├── pyproject.toml
├── setup.py
├── source
├── CMakeLists.txt
├── analysis
│ ├── accumulables
│ │ ├── pyG4Accumulable.cc
│ │ ├── pyG4AccumulableManager.cc
│ │ ├── pyG4MergeMode.cc
│ │ └── pyG4VAccumulable.cc
│ ├── pyG4AnalysisManager.cc
│ ├── pyG4TScoreNtupleWriter.cc
│ ├── pyG4VAnalysisManager.cc
│ ├── pyhisto.cc
│ └── pymodG4analysis.cc
├── datainit.py
├── digits_hits
│ ├── pyG4HCofThisEvent.cc
│ ├── pyG4MultiFunctionalDetector.cc
│ ├── pyG4MultiSensitiveDetector.cc
│ ├── pyG4SDFilter.cc
│ ├── pyG4SDManager.cc
│ ├── pyG4Scorer.cc
│ ├── pyG4VHit.cc
│ ├── pyG4VHitsCollection.cc
│ ├── pyG4VPrimitivePlotter.cc
│ ├── pyG4VPrimitiveScorer.cc
│ ├── pyG4VSDFilter.cc
│ ├── pyG4VSensitiveDetector.cc
│ └── pymodG4digits_hits.cc
├── event
│ ├── pyG4AdjointPosOnPhysVolGenerator.cc
│ ├── pyG4AdjointPrimaryGenerator.cc
│ ├── pyG4AdjointStackingAction.cc
│ ├── pyG4ClassificationOfNewTrack.cc
│ ├── pyG4EvManMessenger.cc
│ ├── pyG4Event.cc
│ ├── pyG4EventManager.cc
│ ├── pyG4GeneralParticleSource.cc
│ ├── pyG4GeneralParticleSourceData.cc
│ ├── pyG4GeneralParticleSourceMessenger.cc
│ ├── pyG4HEPEvtInterface.cc
│ ├── pyG4HEPEvtParticle.cc
│ ├── pyG4MultiEventAction.cc
│ ├── pyG4ParticleGun.cc
│ ├── pyG4ParticleGunMessenger.cc
│ ├── pyG4PrimaryTransformer.cc
│ ├── pyG4RayShooter.cc
│ ├── pyG4SPSAngDistribution.cc
│ ├── pyG4SPSEneDistribution.cc
│ ├── pyG4SPSPosDistribution.cc
│ ├── pyG4SPSRandomGenerator.cc
│ ├── pyG4SingleParticleSource.cc
│ ├── pyG4SmartTrackStack.cc
│ ├── pyG4StackChecker.cc
│ ├── pyG4StackManager.cc
│ ├── pyG4StackedTrack.cc
│ ├── pyG4StackingMessenger.cc
│ ├── pyG4TrackStack.cc
│ ├── pyG4TrajectoryContainer.cc
│ ├── pyG4UserEventAction.cc
│ ├── pyG4UserStackingAction.cc
│ ├── pyG4VPrimaryGenerator.cc
│ ├── pyG4VUserEventInformation.cc
│ └── pymodG4event.cc
├── geant4_pybind.cc
├── geometry
│ ├── biasing
│ │ ├── pyG4GeometryCell.cc
│ │ ├── pyG4GeometryCellComp.cc
│ │ ├── pyG4GeometryCellStep.cc
│ │ ├── pyG4IStore.cc
│ │ ├── pyG4ImportanceAlgorithm.cc
│ │ ├── pyG4VGCellFinder.cc
│ │ ├── pyG4VIStore.cc
│ │ ├── pyG4VImportanceAlgorithm.cc
│ │ ├── pyG4VImportanceSplitExaminer.cc
│ │ ├── pyG4VWeightWindowAlgorithm.cc
│ │ ├── pyG4VWeightWindowStore.cc
│ │ ├── pyG4WeightWindowAlgorithm.cc
│ │ └── pyG4WeightWindowStore.cc
│ ├── divisions
│ │ ├── pyG4PVDivision.cc
│ │ ├── pyG4PVDivisionFactory.cc
│ │ ├── pyG4ParameterisationBox.cc
│ │ ├── pyG4ParameterisationCons.cc
│ │ ├── pyG4ParameterisationPara.cc
│ │ ├── pyG4ParameterisationPolycone.cc
│ │ ├── pyG4ParameterisationPolyhedra.cc
│ │ ├── pyG4ParameterisationTrd.cc
│ │ ├── pyG4ParameterisationTubs.cc
│ │ ├── pyG4ReplicatedSlice.cc
│ │ └── pyG4VDivisionParameterisation.cc
│ ├── magneticfield
│ │ ├── pyG4BFieldIntegrationDriver.cc
│ │ ├── pyG4BogackiShampine23.cc
│ │ ├── pyG4BogackiShampine45.cc
│ │ ├── pyG4BulirschStoer.cc
│ │ ├── pyG4CachedMagneticField.cc
│ │ ├── pyG4CashKarpRKF45.cc
│ │ ├── pyG4ChargeState.cc
│ │ ├── pyG4ChordFinder.cc
│ │ ├── pyG4ClassicalRK4.cc
│ │ ├── pyG4ConstRK4.cc
│ │ ├── pyG4DELPHIMagField.cc
│ │ ├── pyG4DoLoMcPriRK34.cc
│ │ ├── pyG4DormandPrince745.cc
│ │ ├── pyG4DormandPrinceRK56.cc
│ │ ├── pyG4DormandPrinceRK78.cc
│ │ ├── pyG4DriverReporter.cc
│ │ ├── pyG4ElectricField.cc
│ │ ├── pyG4ElectroMagneticField.cc
│ │ ├── pyG4EqEMFieldWithEDM.cc
│ │ ├── pyG4EqEMFieldWithSpin.cc
│ │ ├── pyG4EqGravityField.cc
│ │ ├── pyG4EqMagElectricField.cc
│ │ ├── pyG4EquationOfMotion.cc
│ │ ├── pyG4ErrorMag_UsualEqRhs.cc
│ │ ├── pyG4ExactHelixStepper.cc
│ │ ├── pyG4ExplicitEuler.cc
│ │ ├── pyG4FSALBogackiShampine45.cc
│ │ ├── pyG4FSALDormandPrince745.cc
│ │ ├── pyG4Field.cc
│ │ ├── pyG4FieldManager.cc
│ │ ├── pyG4FieldManagerStore.cc
│ │ ├── pyG4FieldTrack.cc
│ │ ├── pyG4FieldUtils.cc
│ │ ├── pyG4HarmonicPolMagField.cc
│ │ ├── pyG4HelixExplicitEuler.cc
│ │ ├── pyG4HelixHeum.cc
│ │ ├── pyG4HelixImplicitEuler.cc
│ │ ├── pyG4HelixMixedStepper.cc
│ │ ├── pyG4HelixSimpleRunge.cc
│ │ ├── pyG4ImplicitEuler.cc
│ │ ├── pyG4LineCurrentMagField.cc
│ │ ├── pyG4LineSection.cc
│ │ ├── pyG4MagErrorStepper.cc
│ │ ├── pyG4MagHelicalStepper.cc
│ │ ├── pyG4MagIntegratorDriver.cc
│ │ ├── pyG4MagIntegratorStepper.cc
│ │ ├── pyG4Mag_EqRhs.cc
│ │ ├── pyG4Mag_SpinEqRhs.cc
│ │ ├── pyG4Mag_UsualEqRhs.cc
│ │ ├── pyG4MagneticField.cc
│ │ ├── pyG4ModifiedMidpoint.cc
│ │ ├── pyG4MonopoleEq.cc
│ │ ├── pyG4NystromRK4.cc
│ │ ├── pyG4OldMagIntDriver.cc
│ │ ├── pyG4QuadrupoleMagField.cc
│ │ ├── pyG4RK547FEq1.cc
│ │ ├── pyG4RK547FEq2.cc
│ │ ├── pyG4RK547FEq3.cc
│ │ ├── pyG4RKG3_Stepper.cc
│ │ ├── pyG4RepleteEofM.cc
│ │ ├── pyG4SextupoleMagField.cc
│ │ ├── pyG4SimpleHeum.cc
│ │ ├── pyG4SimpleRunge.cc
│ │ ├── pyG4TQuadrupoleMagField.cc
│ │ ├── pyG4TrialsCounter.cc
│ │ ├── pyG4TsitourasRK45.cc
│ │ ├── pyG4UniformElectricField.cc
│ │ ├── pyG4UniformGravityField.cc
│ │ ├── pyG4UniformMagField.cc
│ │ ├── pyG4VFSALIntegrationStepper.cc
│ │ └── pyG4VIntegrationDriver.cc
│ ├── management
│ │ ├── pyG4AffineTransform.cc
│ │ ├── pyG4BlockingList.cc
│ │ ├── pyG4BoundingEnvelope.cc
│ │ ├── pyG4ErrorCylSurfaceTarget.cc
│ │ ├── pyG4ErrorPlaneSurfaceTarget.cc
│ │ ├── pyG4ErrorSurfaceTarget.cc
│ │ ├── pyG4ErrorTanPlaneTarget.cc
│ │ ├── pyG4ErrorTarget.cc
│ │ ├── pyG4GeomTools.cc
│ │ ├── pyG4GeometryManager.cc
│ │ ├── pyG4IdentityTrajectoryFilter.cc
│ │ ├── pyG4LogicalCrystalVolume.cc
│ │ ├── pyG4LogicalSurface.cc
│ │ ├── pyG4LogicalVolume.cc
│ │ ├── pyG4LogicalVolumeStore.cc
│ │ ├── pyG4PhysicalVolumeStore.cc
│ │ ├── pyG4ReflectedSolid.cc
│ │ ├── pyG4Region.cc
│ │ ├── pyG4RegionStore.cc
│ │ ├── pyG4SmartVoxelHeader.cc
│ │ ├── pyG4SmartVoxelNode.cc
│ │ ├── pyG4SmartVoxelProxy.cc
│ │ ├── pyG4SmartVoxelStat.cc
│ │ ├── pyG4SolidStore.cc
│ │ ├── pyG4VCurvedTrajectoryFilter.cc
│ │ ├── pyG4VNestedParameterisation.cc
│ │ ├── pyG4VPVDivisionFactory.cc
│ │ ├── pyG4VPVParameterisation.cc
│ │ ├── pyG4VPhysicalVolume.cc
│ │ ├── pyG4VPhysicalVolume.hh
│ │ ├── pyG4VSolid.cc
│ │ ├── pyG4VTouchable.cc
│ │ ├── pyG4VUserRegionInformation.cc
│ │ ├── pyG4VVolumeMaterialScanner.cc
│ │ └── pyG4VoxelLimits.cc
│ ├── navigation
│ │ ├── pyG4AuxiliaryNavServices.cc
│ │ ├── pyG4BrentLocator.cc
│ │ ├── pyG4DrawVoxels.cc
│ │ ├── pyG4ErrorPropagationNavigator.cc
│ │ ├── pyG4GeomTestVolume.cc
│ │ ├── pyG4GeometryMessenger.cc
│ │ ├── pyG4GlobalMagFieldMessenger.cc
│ │ ├── pyG4LocatorChangeLogger.cc
│ │ ├── pyG4LocatorChangeRecord.cc
│ │ ├── pyG4MultiLevelLocator.cc
│ │ ├── pyG4MultiNavigator.cc
│ │ ├── pyG4NavigationLogger.cc
│ │ ├── pyG4Navigator.cc
│ │ ├── pyG4NormalNavigation.cc
│ │ ├── pyG4ParameterisedNavigation.cc
│ │ ├── pyG4PartialPhantomParameterisation.cc
│ │ ├── pyG4PathFinder.cc
│ │ ├── pyG4PhantomParameterisation.cc
│ │ ├── pyG4PropagatorInField.cc
│ │ ├── pyG4RegularNavigation.cc
│ │ ├── pyG4RegularNavigationHelper.cc
│ │ ├── pyG4ReplicaNavigation.cc
│ │ ├── pyG4SafetyHelper.cc
│ │ ├── pyG4SimpleLocator.cc
│ │ ├── pyG4TransportationManager.cc
│ │ ├── pyG4VExternalNavigation.cc
│ │ ├── pyG4VIntersectionLocator.cc
│ │ ├── pyG4VoxelNavigation.cc
│ │ └── pyG4VoxelSafety.cc
│ ├── pymodG4geometry.cc
│ ├── solids
│ │ ├── Boolean
│ │ │ ├── pyG4BooleanSolid.cc
│ │ │ ├── pyG4DisplacedSolid.cc
│ │ │ ├── pyG4IntersectionSolid.cc
│ │ │ ├── pyG4MultiUnion.cc
│ │ │ ├── pyG4ScaledSolid.cc
│ │ │ ├── pyG4SubtractionSolid.cc
│ │ │ └── pyG4UnionSolid.cc
│ │ ├── CSG
│ │ │ ├── pyG4Box.cc
│ │ │ ├── pyG4CSGSolid.cc
│ │ │ ├── pyG4Cons.cc
│ │ │ ├── pyG4CutTubs.cc
│ │ │ ├── pyG4Orb.cc
│ │ │ ├── pyG4Para.cc
│ │ │ ├── pyG4Sphere.cc
│ │ │ ├── pyG4Torus.cc
│ │ │ ├── pyG4Trap.cc
│ │ │ ├── pyG4Trd.cc
│ │ │ └── pyG4Tubs.cc
│ │ └── specific
│ │ │ ├── pyG4ClippablePolygon.cc
│ │ │ ├── pyG4Ellipsoid.cc
│ │ │ ├── pyG4EllipticalCone.cc
│ │ │ ├── pyG4EllipticalTube.cc
│ │ │ ├── pyG4EnclosingCylinder.cc
│ │ │ ├── pyG4ExtrudedSolid.cc
│ │ │ ├── pyG4GenericPolycone.cc
│ │ │ ├── pyG4GenericTrap.cc
│ │ │ ├── pyG4Hype.cc
│ │ │ ├── pyG4IntersectingCone.cc
│ │ │ ├── pyG4Paraboloid.cc
│ │ │ ├── pyG4PolyPhiFace.cc
│ │ │ ├── pyG4Polycone.cc
│ │ │ ├── pyG4PolyconeHistorical.cc
│ │ │ ├── pyG4PolyconeSide.cc
│ │ │ ├── pyG4Polyhedra.cc
│ │ │ ├── pyG4PolyhedraHistorical.cc
│ │ │ ├── pyG4PolyhedraSide.cc
│ │ │ ├── pyG4QuadrangularFacet.cc
│ │ │ ├── pyG4ReduciblePolygon.cc
│ │ │ ├── pyG4SolidExtentList.cc
│ │ │ ├── pyG4SolidsWorkspace.cc
│ │ │ ├── pyG4SurfBits.cc
│ │ │ ├── pyG4TessellatedGeometryAlgorithms.cc
│ │ │ ├── pyG4TessellatedSolid.cc
│ │ │ ├── pyG4Tet.cc
│ │ │ ├── pyG4TriangularFacet.cc
│ │ │ ├── pyG4TwistBoxSide.cc
│ │ │ ├── pyG4TwistTrapAlphaSide.cc
│ │ │ ├── pyG4TwistTrapFlatSide.cc
│ │ │ ├── pyG4TwistTrapParallelSide.cc
│ │ │ ├── pyG4TwistTubsFlatSide.cc
│ │ │ ├── pyG4TwistTubsHypeSide.cc
│ │ │ ├── pyG4TwistTubsSide.cc
│ │ │ ├── pyG4TwistedBox.cc
│ │ │ ├── pyG4TwistedTrap.cc
│ │ │ ├── pyG4TwistedTrd.cc
│ │ │ ├── pyG4TwistedTubs.cc
│ │ │ ├── pyG4VCSGface.cc
│ │ │ ├── pyG4VCSGfaceted.cc
│ │ │ ├── pyG4VFacet.cc
│ │ │ ├── pyG4VTwistSurface.cc
│ │ │ ├── pyG4VTwistedFaceted.cc
│ │ │ └── pyG4Voxelizer.cc
│ └── volumes
│ │ ├── pyG4AssemblyStore.cc
│ │ ├── pyG4AssemblyTriplet.cc
│ │ ├── pyG4AssemblyVolume.cc
│ │ ├── pyG4GeometryWorkspace.cc
│ │ ├── pyG4LogicalBorderSurface.cc
│ │ ├── pyG4LogicalSkinSurface.cc
│ │ ├── pyG4NavigationHistory.cc
│ │ ├── pyG4NavigationHistoryPool.cc
│ │ ├── pyG4NavigationLevel.cc
│ │ ├── pyG4NavigationLevelRep.cc
│ │ ├── pyG4PVParameterised.cc
│ │ ├── pyG4PVPlacement.cc
│ │ ├── pyG4PVReplica.cc
│ │ ├── pyG4ReflectionFactory.cc
│ │ ├── pyG4TouchableHistory.cc
│ │ └── pyG4VExternalPhysicalVolume.cc
├── global
│ ├── pyG4ApplicationState.cc
│ ├── pyG4Exception.cc
│ ├── pyG4ExceptionHandler.cc
│ ├── pyG4ExceptionSeverity.cc
│ ├── pyG4GeometryTolerance.cc
│ ├── pyG4PhysicalConstants.cc
│ ├── pyG4PhysicsFreeVector.cc
│ ├── pyG4PhysicsVector.cc
│ ├── pyG4RandomDirection.cc
│ ├── pyG4RotationMatrix.cc
│ ├── pyG4StatAnalysis.cc
│ ├── pyG4StateManager.cc
│ ├── pyG4SystemOfUnits.cc
│ ├── pyG4ThreeVector.cc
│ ├── pyG4Timer.cc
│ ├── pyG4Transform3D.cc
│ ├── pyG4TwoVector.cc
│ ├── pyG4UnitsTable.cc
│ ├── pyG4UserLimits.cc
│ ├── pyG4Version.cc
│ ├── pyRandomEngines.cc
│ ├── pyRandomize.cc
│ ├── pygeomdefs.cc
│ ├── pyglobals.cc
│ └── pymodG4global.cc
├── graphics_reps
│ ├── pyG4AttDef.cc
│ ├── pyG4AttDefStore.cc
│ ├── pyG4AttValue.cc
│ ├── pyG4Circle.cc
│ ├── pyG4Colour.cc
│ ├── pyG4Square.cc
│ ├── pyG4Text.cc
│ ├── pyG4TypeKey.cc
│ ├── pyG4VMarker.cc
│ ├── pyG4VVisManager.cc
│ ├── pyG4VisAttributes.cc
│ ├── pyG4Visible.cc
│ └── pymodG4graphics_reps.cc
├── intercoms
│ ├── pyG4GenericMessenger.cc
│ ├── pyG4UIcmdWith3Vector.cc
│ ├── pyG4UIcmdWith3VectorAndUnit.cc
│ ├── pyG4UIcmdWithABool.cc
│ ├── pyG4UIcmdWithADouble.cc
│ ├── pyG4UIcmdWithADoubleAndUnit.cc
│ ├── pyG4UIcmdWithALongInt.cc
│ ├── pyG4UIcmdWithAString.cc
│ ├── pyG4UIcmdWithAnInteger.cc
│ ├── pyG4UIcmdWithoutParameter.cc
│ ├── pyG4UIcommand.cc
│ ├── pyG4UIcommandStatus.cc
│ ├── pyG4UIcommandTree.cc
│ ├── pyG4UIdirectory.cc
│ ├── pyG4UImanager.cc
│ ├── pyG4UImessenger.cc
│ ├── pyG4UIparameter.cc
│ └── pymodG4intercoms.cc
├── interface
│ ├── pyG4UIExecutive.cc
│ ├── pyG4VUIshell.cc
│ └── pymodG4interface.cc
├── materials
│ ├── pyG4AtomicBond.cc
│ ├── pyG4AtomicFormFactor.cc
│ ├── pyG4AtomicShells.cc
│ ├── pyG4AtomicShells_XDB_EADL.cc
│ ├── pyG4CrystalAtomBase.cc
│ ├── pyG4CrystalExtension.cc
│ ├── pyG4CrystalUnitCell.cc
│ ├── pyG4DensityEffectCalculator.cc
│ ├── pyG4DensityEffectData.cc
│ ├── pyG4Element.cc
│ ├── pyG4ElementData.cc
│ ├── pyG4ElementTable.cc
│ ├── pyG4ExtDEDXTable.cc
│ ├── pyG4ExtendedMaterial.cc
│ ├── pyG4ICRU90StoppingData.cc
│ ├── pyG4IonStoppingData.cc
│ ├── pyG4IonisParamElm.cc
│ ├── pyG4IonisParamMat.cc
│ ├── pyG4Isotope.cc
│ ├── pyG4LatticeLogical.cc
│ ├── pyG4LatticePhysical.cc
│ ├── pyG4Material.cc
│ ├── pyG4MaterialPropertiesIndex.cc
│ ├── pyG4MaterialPropertiesTable.cc
│ ├── pyG4MaterialPropertyVector.cc
│ ├── pyG4MaterialTable.cc
│ ├── pyG4MicroElecMaterialStructure.cc
│ ├── pyG4MicroElecSiStructure.cc
│ ├── pyG4NistElementBuilder.cc
│ ├── pyG4NistManager.cc
│ ├── pyG4NistMaterialBuilder.cc
│ ├── pyG4NistMessenger.cc
│ ├── pyG4OpticalMaterialProperties.cc
│ ├── pyG4OpticalSurface.cc
│ ├── pyG4SandiaTable.cc
│ ├── pyG4SurfaceProperty.cc
│ ├── pyG4UCNMaterialPropertiesTable.cc
│ ├── pyG4UCNMicroRoughnessHelper.cc
│ ├── pyG4VIonDEDXTable.cc
│ ├── pyG4VMaterialExtension.cc
│ └── pymodG4materials.cc
├── opaques.hh
├── particles
│ ├── pyG4Adjoint.cc
│ ├── pyG4Barions.cc
│ ├── pyG4Bosons.cc
│ ├── pyG4DecayTable.cc
│ ├── pyG4DynamicParticle.cc
│ ├── pyG4IonTable.cc
│ ├── pyG4Ions.cc
│ ├── pyG4Leptons.cc
│ ├── pyG4Mesons.cc
│ ├── pyG4ParticleDefinition.cc
│ ├── pyG4ParticleList.cc
│ ├── pyG4ParticleTable.cc
│ ├── pyG4PrimaryParticle.cc
│ ├── pyG4PrimaryVertex.cc
│ └── pymodG4particles.cc
├── persistency
│ ├── pyG4GDMLAuxStructType.cc
│ ├── pyG4GDMLParser.cc
│ └── pymodG4persistency.cc
├── physics_lists
│ ├── pyG4DecayPhysics.cc
│ ├── pyG4EmPhysics.cc
│ ├── pyG4FastSimulationPhysics.cc
│ ├── pyG4GammaLeptoNuclearPhysics.cc
│ ├── pyG4GenericBiasingPhysics.cc
│ ├── pyG4HadronElasticPhysics.cc
│ ├── pyG4HadronInelasticPhysics.cc
│ ├── pyG4ImportanceBiasing.cc
│ ├── pyG4IonPhysics.cc
│ ├── pyG4NeutronTrackingCut.cc
│ ├── pyG4ParallelWorldPhysics.cc
│ ├── pyG4StepLimiterPhysics.cc
│ ├── pyG4StoppingPhysics.cc
│ ├── pyG4WeightWindowBiasing.cc
│ ├── pyPhysListFactory.cc
│ ├── pyPhysicsLists.cc
│ └── pymodG4physicslists.cc
├── processes
│ ├── electromagnetic
│ │ └── pyG4EmParameters.cc
│ ├── hadronic
│ │ └── pyG4HadronicParameters.cc
│ ├── pyG4CrossSectionHandler.cc
│ ├── pyG4EmCalculator.cc
│ ├── pyG4ProcVector.cc
│ ├── pyG4ProcessManager.cc
│ ├── pyG4ProcessTable.cc
│ ├── pyG4ProcessType.cc
│ ├── pyG4ProductionCutsTable.cc
│ ├── pyG4VCrossSectionHandler.cc
│ ├── pyG4VProcess.cc
│ └── pymodG4processes.cc
├── run
│ ├── pyG4MTRunManager.cc
│ ├── pyG4Run.cc
│ ├── pyG4RunManager.cc
│ ├── pyG4RunManagerKernel.cc
│ ├── pyG4UserRunAction.cc
│ ├── pyG4VModularPhysicsList.cc
│ ├── pyG4VPhysicsConstructor.cc
│ ├── pyG4VUserActionInitialization.cc
│ ├── pyG4VUserDetectorConstruction.cc
│ ├── pyG4VUserParallelWorld.cc
│ ├── pyG4VUserPhysicsList.cc
│ ├── pyG4VUserPrimaryGeneratorAction.cc
│ └── pymodG4run.cc
├── tasking
│ ├── pyG4RunManagerFactory.cc
│ ├── pyG4TaskRunManager.cc
│ ├── pyG4VUserTaskQueue.cc
│ └── pymodG4tasking.cc
├── track
│ ├── pyG4Step.cc
│ ├── pyG4StepPoint.cc
│ ├── pyG4StepStatus.cc
│ ├── pyG4Track.cc
│ ├── pyG4TrackStatus.cc
│ └── pymodG4track.cc
├── tracking
│ ├── pyG4SteppingVerbose.cc
│ ├── pyG4TrackingManager.cc
│ ├── pyG4Trajectory.cc
│ ├── pyG4TrajectoryPoint.cc
│ ├── pyG4UserSteppingAction.cc
│ ├── pyG4UserTrackingAction.cc
│ ├── pyG4VSteppingVerbose.cc
│ ├── pyG4VTrajectory.cc
│ ├── pyG4VTrajectoryPoint.cc
│ └── pymodG4tracking.cc
├── typecast.hh
└── visualization
│ ├── pyG4ASCIITree.cc
│ ├── pyG4DAWNFILE.cc
│ ├── pyG4HepRepFile.cc
│ ├── pyG4OpenGLImmediateQt.cc
│ ├── pyG4OpenGLImmediateWin32.cc
│ ├── pyG4OpenGLImmediateX.cc
│ ├── pyG4OpenGLImmediateXm.cc
│ ├── pyG4OpenGLStoredX.cc
│ ├── pyG4OpenGLStoredXm.cc
│ ├── pyG4RayTracer.cc
│ ├── pyG4RayTracerX.cc
│ ├── pyG4VGraphicsSystem.cc
│ ├── pyG4VRML2File.cc
│ ├── pyG4VisExecutive.cc
│ ├── pyG4VisManager.cc
│ └── pymodG4visualization.cc
└── tests
├── CMakeLists.txt
├── test_B1.py
├── test_destruction.py
└── test_examples.py
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | dist/
3 | _build/
4 | _generate/
5 | *.so
6 | *.py[cod]
7 | *.egg-info
8 | /*env*
9 | .vscode/
10 |
11 | # Generated files
12 | examples/**/*.macro
13 | examples/**/*.root
14 | examples/**/*.csv
15 | examples/**/*.xml
16 |
17 | tests/*.macro
18 | tests/*.root
19 | tests/*.csv
20 | tests/*.xml
21 |
22 | # Generated 3rd party LICENSE file
23 | LICENSE-3RD-PARTY
24 | EXTRA_LICENSES
25 | MANIFEST.in
26 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "pybind11"]
2 | path = pybind11
3 | url = https://github.com/HaarigerHarald/pybind11
4 | branch = smart_holder
5 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.16)
2 | project(geant4_pybind)
3 |
4 | set(CMAKE_CXX_STANDARD 17)
5 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
6 | set(CMAKE_CXX_VISIBILITY_PRESET hidden)
7 |
8 | if(MSVC)
9 | if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
10 | string(REGEX REPLACE "/W[0-4]" "/W3" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
11 | else()
12 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
13 | endif()
14 | elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long")
16 | endif()
17 |
18 | find_package(Geant4 11.0 REQUIRED)
19 | find_package(Geant4 OPTIONAL_COMPONENTS gdml ui_tcsh motif vis_raytracer_x11 vis_opengl_x11 vis_opengl_win32 qt)
20 |
21 | set(PYBIND11_PYTHON_VERSION 3.5)
22 | add_subdirectory(pybind11)
23 |
24 | add_subdirectory(source)
25 |
26 | include(CTest)
27 | if(BUILD_TESTING)
28 | add_subdirectory(tests)
29 | endif()
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include README.md DESIGN.md LICENSE pybind11/LICENSE doc/*.py
2 | exclude LICENSE-3RD-PARTY EXTRA_LICENSES
3 | graft pybind11/include
4 | graft pybind11/tools
5 | recursive-include source *
6 | global-include CMakeLists.txt *.cmake
7 |
--------------------------------------------------------------------------------
/examples/B1/exampleB1.in:
--------------------------------------------------------------------------------
1 | # Macro file for example B1 test
2 |
3 | /run/initialize
4 |
5 | # gamma 6 MeV
6 | /gun/particle gamma
7 | /gun/energy 6 MeV
8 | #
9 | /run/printProgress 100
10 | /run/beamOn 1000
11 | #
12 | # proton 210 MeV
13 | /gun/particle proton
14 | /gun/energy 210 MeV
15 | #
16 | /run/beamOn 1000
17 |
--------------------------------------------------------------------------------
/examples/B1/init_vis.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the initialization of example B1
2 | # in interactive session
3 | #
4 | # Set some default verbose
5 | /control/verbose 2
6 | /control/saveHistory
7 | /run/verbose 2
8 | #
9 | # Change the default number of threads (in multi-threaded mode)
10 | #/run/numberOfThreads 4
11 | #
12 | # Initialize kernel
13 | /run/initialize
14 | #
15 | # Visualization setting
16 | /control/execute vis.mac
17 |
--------------------------------------------------------------------------------
/examples/B1/run1.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B1
2 | #
3 | # Can be run in batch, without graphic
4 | # or interactively: Idle> /control/execute run1.mac
5 | #
6 | # Change the default number of workers (in multi-threading mode)
7 | #/run/numberOfThreads 4
8 | #
9 | # Initialize kernel
10 | /run/initialize
11 | #
12 | /control/verbose 2
13 | /run/verbose 2
14 | /event/verbose 0
15 | /tracking/verbose 1
16 | #
17 | # gamma 6 MeV to the direction (0.,0.,1.)
18 | #
19 | #/gun/particle gamma
20 | #/gun/energy 6 MeV
21 | #
22 | /run/beamOn 5
23 | #
24 | # proton 210 MeV to the direction (0.,0.,1.)
25 | #
26 | /gun/particle proton
27 | /gun/energy 210 MeV
28 | /tracking/verbose 2
29 | #
30 | /run/beamOn 1
31 |
--------------------------------------------------------------------------------
/examples/B1/run2.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B1
2 | #
3 | # To be run preferably in batch, without graphics:
4 | # % exampleB1 run2.mac
5 | #
6 | #/run/numberOfThreads 4
7 | /run/initialize
8 | #
9 | /control/verbose 2
10 | /run/verbose 2
11 | #
12 | # gamma 6 MeV to the direction (0.,0.,1.)
13 | # 10000 events
14 | #
15 | /gun/particle gamma
16 | /gun/energy 6 MeV
17 | #
18 | /run/printProgress 100
19 | /run/beamOn 1000
20 | #
21 | # proton 210 MeV to the direction (0.,0.,1.)
22 | # 1000 events
23 | #
24 | /gun/particle proton
25 | /gun/energy 210 MeV
26 | #
27 | /run/beamOn 1000
28 |
--------------------------------------------------------------------------------
/examples/B2/exampleB2.in:
--------------------------------------------------------------------------------
1 | # Macro file for example B2 test
2 |
3 | /run/initialize
4 |
5 | /tracking/verbose 0
6 |
7 | # e+ 200MeV
8 | /gun/energy 200 MeV
9 | /gun/particle e+
10 | /run/beamOn 100
11 |
12 | # mu+ 1TeV
13 | /gun/energy 1 TeV
14 | /gun/particle mu+
15 | /run/beamOn 100
16 |
17 | /tracking/verbose 1
18 |
19 | # geantino
20 | /gun/particle geantino
21 | /run/beamOn 1
22 |
--------------------------------------------------------------------------------
/examples/B2/init_vis.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the initialization of example B2
2 | # in interactive session
3 | #
4 | # Set some default verbose
5 | /control/verbose 2
6 | /control/saveHistory
7 | /run/verbose 2
8 | #
9 | # Change the default number of threads (in multi-threaded mode)
10 | #/run/numberOfThreads 4
11 | #
12 | # Initialize kernel
13 | /run/initialize
14 | #
15 | # Visualization setting
16 | /control/execute vis.mac
17 |
--------------------------------------------------------------------------------
/examples/B2/run1.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B2
2 | #
3 | # Can be run in batch, without graphic
4 | # or interactively: Idle> /control/execute run1.mac
5 | #
6 | # Change the default number of workers (in multi-threading mode)
7 | #/run/numberOfThreads 4
8 | #
9 | # Initialize kernel
10 | /run/initialize
11 | #
12 | # Default kinematics:
13 | # proton 3 GeV in direction (0.,0.,1.)
14 | # 1 event with tracking/verbose
15 | #
16 | /tracking/verbose 1
17 | /run/beamOn 1
18 | #
19 | # 1 event with printing hits
20 | #
21 | /tracking/verbose 0
22 | /hits/verbose 2
23 | /run/beamOn 1
24 | #
25 | # set target and chamber material
26 | #
27 | /B2/det/setTargetMaterial G4_WATER
28 | /B2/det/setChamberMaterial G4_Ar
29 | /run/beamOn 3
30 | #
31 | # set a magnetic field and max allowed step length
32 | # 3 event with printing hits
33 | #
34 | /globalField/verbose 1
35 | /globalField/setValue 0.2 0 0 tesla
36 | /B2/det/stepMax 1.0 mm
37 | /gun/energy 0.3 GeV
38 | /run/beamOn 3
39 | #
40 | # muon 300 MeV in the direction (0.,0.,1.)
41 | # 3 event with detailed printing
42 | #
43 | /gun/particle mu-
44 | /gun/energy 300 MeV
45 | /run/beamOn 3
46 |
--------------------------------------------------------------------------------
/examples/B2/run2.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B2
2 | #
3 | # To be run preferably in batch, without graphics:
4 | # % exampleB2[a,b] run2.mac
5 | #
6 | #/run/numberOfThreads 4
7 | /run/initialize
8 | /run/beamOn 500
9 |
--------------------------------------------------------------------------------
/examples/B2/startup.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the pre-initialization phase of example B2
2 | #
3 | # Set some default verbose
4 | /control/verbose 2
5 | /control/saveHistory
6 | /run/verbose 2
7 | #
8 | # Change the default number of threads (in multi-threaded mode)
9 | #/run/numberOfThreads 4
10 | #
11 | # Initialize kernel
12 | /run/initialize
13 |
--------------------------------------------------------------------------------
/examples/B3/debug.mac:
--------------------------------------------------------------------------------
1 | #
2 | # Macro file for "exampleB3.cc"
3 | #
4 | # can be run in batch, without graphic
5 | # or interactively: Idle> /control/execute debug.mac
6 | #
7 | /run/initialize
8 | #
9 | /tracking/verbose 1
10 | #
11 | /gun/particle geantino
12 | /run/beamOn 1
13 |
--------------------------------------------------------------------------------
/examples/B3/exampleB3.in:
--------------------------------------------------------------------------------
1 | #
2 | # Macro file for example B3 test
3 | #
4 | /run/initialize
5 | #
6 | /control/verbose 2
7 | #
8 | /run/printProgress 1000
9 | /run/beamOn 10000
10 |
--------------------------------------------------------------------------------
/examples/B3/init_vis.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the initialization of example B3
2 | # in interactive session
3 | #
4 | # Set some default verbose
5 | #
6 | /control/verbose 2
7 | /control/saveHistory
8 | /run/verbose 2
9 | #
10 | # Change the default number of threads (in multi-threaded mode)
11 | #/run/numberOfThreads 4
12 | #
13 | # Initialize kernel
14 | /run/initialize
15 | #
16 | # Visualization setting
17 | /control/execute vis.mac
18 |
--------------------------------------------------------------------------------
/examples/B3/run1.mac:
--------------------------------------------------------------------------------
1 | #
2 | # Macro file of "exampleB3.cc"
3 | #
4 | # Change the default number of workers (in multi-threading mode)
5 | #/run/numberOfThreads 4
6 | #
7 | # Initialize kernel
8 | /run/initialize
9 | #
10 | /control/verbose 2
11 | /tracking/verbose 2
12 | #
13 | /run/beamOn 1
14 | #
15 | /tracking/verbose 0
16 | /run/beamOn 20
17 |
--------------------------------------------------------------------------------
/examples/B3/run2.mac:
--------------------------------------------------------------------------------
1 | #
2 | # Macro file of "exampleB3.cc"
3 | # To be run preferably in batch, without graphics:
4 | # % exampleB3 run3.mac
5 | #
6 | #/run/numberOfThreads 4
7 | /run/initialize
8 | #
9 | /control/verbose 2
10 | #
11 | /run/beamOn 40000
12 | #
13 | # change beta source
14 | #
15 | /gun/particle ion
16 | /gun/ion 6 11
17 | #
18 | /run/printProgress 10000
19 | /run/beamOn 40000
20 |
--------------------------------------------------------------------------------
/examples/B4/exampleB4.in:
--------------------------------------------------------------------------------
1 | # Macro file for example B4 test
2 |
3 | /run/initialize
4 |
5 | # e+ 300MeV
6 | /gun/particle e+
7 | /gun/energy 300 MeV
8 | /run/beamOn 1
9 | #
10 | # list the existing physics processes
11 | /process/list
12 | #
13 | # switch off MultipleScattering
14 | /process/inactivate msc
15 | /run/beamOn 1
16 | #
17 | # switch on MultipleScattering
18 | /process/activate msc
19 | #
20 | # change detector parameter
21 | /gun/particle gamma
22 | /gun/energy 500 MeV
23 | /run/beamOn 1
24 |
--------------------------------------------------------------------------------
/examples/B4/gui.mac:
--------------------------------------------------------------------------------
1 | #
2 | # This file permits to customize, with commands,
3 | # the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
4 | # It has no effect with G4UIterminal.
5 | #
6 | # File menu :
7 | /gui/addMenu file File
8 | /gui/addButton file Quit exit
9 | #
10 | # Run menu :
11 | /gui/addMenu run Run
12 | /gui/addButton run "beamOn 1" "/run/beamOn 1"
13 | /gui/addButton run run1 "/control/execute run1.mac"
14 | #
15 | # Gun menu :
16 | /gui/addMenu gun Gun
17 | /gui/addButton gun "50 MeV" "/gun/energy 50 MeV"
18 | /gui/addButton gun "1 GeV" "/gun/energy 1 GeV"
19 | /gui/addButton gun "10 GeV" "/gun/energy 10 GeV"
20 | /gui/addButton gun "e-" "/gun/particle e-"
21 | /gui/addButton gun "pi0" "/gun/particle pi0"
22 | /gui/addButton gun "pi+" "/gun/particle pi+"
23 | /gui/addButton gun "neutron" "/gun/particle neutron"
24 | /gui/addButton gun "proton" "/gun/particle proton"
25 | #
26 | # Viewer menu :
27 | /gui/addMenu viewer Viewer
28 | /gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface"
29 | /gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wireframe"
30 | /gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh"
31 | /gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update"
32 | /gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush"
33 | /gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers"
34 | #
35 | # To limit the output flow in the "dump" widget :
36 | /run/printProgress 100
37 | #
38 |
--------------------------------------------------------------------------------
/examples/B4/init_vis.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the initialization of example B4
2 | # in interactive session
3 | #
4 | # Set some default verbose
5 | #
6 | /control/verbose 2
7 | /control/saveHistory
8 | /run/verbose 2
9 | #
10 | # Change the default number of threads (in multi-threaded mode)
11 | #/run/numberOfThreads 4
12 | #
13 | # Initialize kernel
14 | /run/initialize
15 | #
16 | # Visualization setting
17 | /control/execute vis.mac
18 |
--------------------------------------------------------------------------------
/examples/B4/run1.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B4
2 | #
3 | # Can be run in batch, without graphic
4 | # or interactively: Idle> /control/execute run1.mac
5 | #
6 | # Change the default number of workers (in multi-threading mode)
7 | #/run/numberOfThreads 4
8 | #
9 | # Initialize kernel
10 | /run/initialize
11 | #
12 | # Default kinematics:
13 | # electron 50 MeV in direction (0.,0.,1.)
14 | # 1 event with tracking/verbose
15 | #
16 | /tracking/verbose 1
17 | /run/beamOn 1
18 | #
19 | #
20 | # muon 300 MeV in direction (0.,0.,1.)
21 | # 3 events
22 | #
23 | /gun/particle mu+
24 | /gun/energy 3 MeV
25 | /run/beamOn 3
26 | #
27 | # 20 events
28 | #
29 | /tracking/verbose 0
30 | /run/printProgress 5
31 | /run/beamOn 20
32 | #
33 | # Magnetic field
34 | #
35 | /globalField/setValue 0.2 0 0 tesla
36 | /run/beamOn 3
37 | #
38 | # Activate/inactivate physics processes
39 | #
40 | /process/list
41 | /process/inactivate eBrem
42 | #
43 | /run/beamOn 20
44 | #
45 |
--------------------------------------------------------------------------------
/examples/B4/run2.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B4
2 | #
3 | # To be run preferably in batch, without graphics:
4 | # % exampleB4[a,b,c,d] run2.mac
5 | #
6 | #/run/numberOfThreads 4
7 | #/control/cout/ignoreThreadsExcept 0
8 | #
9 | /run/initialize
10 | #
11 | # Default kinemtics:
12 | # electron 50 MeV in direction (0.,0.,1.)
13 | # 1000 events
14 | #
15 | /run/printProgress 100
16 | /run/beamOn 1000
17 |
18 |
--------------------------------------------------------------------------------
/examples/B5/exampleB5.in:
--------------------------------------------------------------------------------
1 | #
2 | # Test macro file for exampleB5
3 | #
4 |
5 | /run/initialize
6 |
7 | # Turn off randomization
8 | /B5/generator/randomizePrimary false
9 | /B5/generator/sigmaMomentum 0.
10 | /B5/generator/sigmaAngle 0.
11 | /run/printProgress 5
12 | #
13 | /analysis/ntuple/setFileName 0 B5ntuple
14 | #
15 | /B5/detector/armAngle 30. deg
16 | /gun/particle proton
17 | /B5/generator/momentum 100. GeV
18 | /B5/field/value 100. tesla
19 | /run/beamOn 5
20 | #
21 | /B5/detector/armAngle 60. deg
22 | /gun/particle pi+
23 | /B5/generator/momentum 100. GeV
24 | /B5/field/value 200. tesla
25 | /run/beamOn 5
26 | #
27 | /gun/particle e+
28 | /B5/detector/armAngle 30. deg
29 | /B5/generator/momentum 100. GeV
30 | /B5/field/value 100. tesla
31 | /run/beamOn 5
32 | #
33 | /B5/detector/armAngle 30. deg
34 | /gun/particle proton
35 | /B5/generator/momentum 10. GeV
36 | /B5/field/value 10. tesla
37 | /run/beamOn 5
38 | #
39 | /B5/detector/armAngle 60. deg
40 | /gun/particle pi+
41 | /B5/generator/momentum 10. GeV
42 | /B5/field/value 20. tesla
43 | /run/beamOn 5
44 | #
45 | /gun/particle e+
46 | /B5/detector/armAngle 30. deg
47 | /B5/generator/momentum 10. GeV
48 | /B5/field/value 10. tesla
49 | /run/beamOn 5
50 | #
51 | #
52 | /B5/detector/armAngle 30. deg
53 | /gun/particle proton
54 | /B5/generator/momentum 1. GeV
55 | /B5/field/value 1. tesla
56 | /run/beamOn 5
57 | #
58 | /B5/detector/armAngle 60. deg
59 | /gun/particle pi+
60 | /B5/generator/momentum 1. GeV
61 | /B5/field/value 2. tesla
62 | /run/beamOn 5
63 | #
64 | /gun/particle e+
65 | /B5/detector/armAngle 30. deg
66 | /B5/generator/momentum 1. GeV
67 | /B5/field/value 1. tesla
68 | /run/beamOn 5
69 |
--------------------------------------------------------------------------------
/examples/B5/icons.mac:
--------------------------------------------------------------------------------
1 | #
2 | # This file permits to customize, with commands,
3 | # the icon menu bar of the G4UIQt sessions not yet implemented other UI drivers (geant4-09-05-ref-09)
4 | # It has no effect with G4UIterminal.
5 |
6 | # disable default icons
7 | /gui/defaultIcons false
8 |
9 | # open/save icons
10 | /gui/addIcon "Open macro file" open /control/execute
11 | /gui/addIcon "Save viewer state" save /vis/viewer/save
12 |
13 | # Cursors style icons
14 | /gui/addIcon "Move" move
15 | /gui/addIcon "Pick" pick
16 | /gui/addIcon "Zoom out" zoom_out
17 | /gui/addIcon "Zoom in" zoom_in
18 | /gui/addIcon "Rotate" rotate
19 |
20 | # Surface Style icons
21 | # Surface Style icons
22 | /gui/addIcon "Hidden line removal" hidden_line_removal
23 | /gui/addIcon "Hidden line and hidden surface removal" hidden_line_and_surface_removal
24 | /gui/addIcon "Surfaces" solid
25 | /gui/addIcon "Wireframe" wireframe
26 |
27 | # Perspective/Ortho icons
28 | /gui/addIcon "Perspective" perspective
29 | /gui/addIcon "Orthographic" ortho
30 |
--------------------------------------------------------------------------------
/examples/B5/init.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the initialization of example B1
2 | # when running in interactive mode without visualization
3 | #
4 | # Set some default verbose
5 | /control/verbose 2
6 | /control/saveHistory
7 | /run/verbose 2
8 | #
9 | # Change the default number of threads (in multi-threaded mode)
10 | #/run/numberOfThreads 4
11 | #
12 | # Initialize kernel
13 | /run/initialize
14 |
--------------------------------------------------------------------------------
/examples/B5/init_vis.mac:
--------------------------------------------------------------------------------
1 | # Macro file for the initialization phase of example B5
2 | # when running in interactive mode with visualization
3 | #
4 | # Set some default verbose
5 | #
6 | /control/verbose 2
7 | /control/saveHistory
8 | /run/verbose 2
9 | #
10 | # Change the default number of threads (in multi-threaded mode)
11 | #/run/numberOfThreads 4
12 | #
13 | # Initialize kernel
14 | /run/initialize
15 | #
16 | # Visualization setting
17 | /control/execute vis.mac
18 |
--------------------------------------------------------------------------------
/examples/B5/run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HaarigerHarald/geant4_pybind/1e6181b4a83ac15797140d28c356a2877d7a2592/examples/B5/run.png
--------------------------------------------------------------------------------
/examples/B5/run1.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B5
2 | #
3 | # Can be run in batch, without graphic
4 | # or interactively: Idle> /control/execute run1.mac
5 | #
6 | # Change the default number of workers (in multi-threading mode)
7 | #/run/numberOfThreads 4
8 | #
9 | # Initialize kernel
10 | /run/initialize
11 | #
12 | # Defaults:
13 | # armAngle 30. deg
14 | # field value: 1.0*tesla
15 | /run/beamOn 3
16 | #
17 | /B5/detector/armAngle 0. deg
18 | /B5/field/value 0. tesla
19 | /run/beamOn 3
20 | #
21 | /B5/detector/armAngle 60. deg
22 | /B5/field/value 2. tesla
23 | /run/beamOn 3
24 | #
25 | /B5/detector/armAngle 30. deg
26 | /B5/field/value 1. tesla
27 | /B5/generator/momentum 2. GeV
28 | /B5/generator/sigmaMomentum 0.
29 | /B5/generator/sigmaAngle 0.
30 | /B5/generator/sigmaAngle 2. deg
31 | /run/beamOn 3
32 |
33 |
--------------------------------------------------------------------------------
/examples/B5/run2.mac:
--------------------------------------------------------------------------------
1 | # Macro file for example B5
2 | #
3 | # To be run preferably in batch, without graphics:
4 | # % exampleB5 run2.mac
5 | #
6 | #/run/numberOfThreads 4
7 | /control/cout/ignoreThreadsExcept 0
8 | #
9 | /run/initialize
10 | #
11 | # turn off randomization
12 | #
13 | /B5/generator/randomizePrimary FALSE
14 | /B5/generator/sigmaMomentum 0.
15 | /B5/generator/sigmaAngle 0.
16 | /run/verbose 1
17 | /run/printProgress 0
18 | #
19 | /B5/detector/armAngle 30. deg
20 | /gun/particle proton
21 | /B5/generator/momentum 100. GeV
22 | /B5/field/value 100. tesla
23 | /analysis/setFileName B5_proton
24 | /analysis/ntuple/setFileName 0 B5ntuple_proton
25 | /run/beamOn 30
26 | #
27 | /B5/detector/armAngle 60. deg
28 | /gun/particle pi+
29 | /B5/generator/momentum 100. GeV
30 | /B5/field/value 200. tesla
31 | /analysis/setFileName B5_pi+
32 | /analysis/ntuple/setFileName 0 B5ntuple_pi+
33 | /run/beamOn 30
34 | #
35 | /gun/particle e+
36 | /B5/detector/armAngle 30. deg
37 | /B5/generator/momentum 100. GeV
38 | /B5/field/value 100. tesla
39 | /analysis/setFileName B5_e+
40 | /analysis/ntuple/setFileName 0 B5ntuple_e+
41 | /run/beamOn 30
42 |
43 |
--------------------------------------------------------------------------------
/examples/gdml/README:
--------------------------------------------------------------------------------
1 | -------------------------------------------------------------------
2 |
3 | =========================================================
4 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP
5 | =========================================================
6 |
7 | GDML detector sensitivity
8 | -------------------------
9 |
10 | This example demonstrates the usage of the GDML auxiliary information for
11 | associating a sensitive detector to a volume.
12 |
13 | The detector construction consists of a call to GDMLProcessor which parses a
14 | GDML file and returns the pointer to the world volume. The user can also write
15 | her/his own GDML file and use it as the primary input format for her/his Geant4
16 | application.
17 |
18 | A simple GDML files is provided:
19 | - auxiliary.gdml, showing association of a volume with the auxiliary
20 | information, related to the sensitive detector.
21 |
22 | HOW TO BUILD THE EXAMPLE ?
23 |
24 | - You need to have built the persistency/gdml module by having
25 | set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
26 | as well as the -DXERCESC_ROOT_DIR= flag pointing to
27 | the path where the XercesC XML parser package is installed in your system.
28 |
29 | - Execute the application.
30 | o For parsing interactively the GDML file:
31 | % python3 g04.py auxiliary.gdml
32 |
--------------------------------------------------------------------------------
/examples/gdml/g04.mac:
--------------------------------------------------------------------------------
1 | ###################################################
2 | # Batch running of events
3 | ###################################################
4 |
5 | # verbosity
6 | /tracking/verbose 1
7 | /control/verbose 1
8 | /run/verbose 2
9 |
10 | # Shoot along Z direction
11 | /run/beamOn 20
12 | /gun/direction 0 0 -1
13 | /run/beamOn 20
14 |
15 | # Shoot along various directions
16 | /tracking/verbose 0
17 | /gun/direction 0.3 0.2 1
18 | /run/beamOn 20
19 | /gun/direction 0.3 -0.2 1
20 | /run/beamOn 20
21 | /gun/direction -0.3 0.2 0.6
22 | /run/beamOn 20
23 |
24 | exit
25 |
--------------------------------------------------------------------------------
/examples/gdml/vis.mac:
--------------------------------------------------------------------------------
1 | ###################################################
2 | # Visualization of detector geometry and events
3 | ###################################################
4 |
5 | # create empty scene
6 | /vis/scene/create
7 |
8 | # Create a scene handler for a specific graphics system
9 | /vis/open OGL
10 |
11 | # draw scene
12 | /vis/viewer/zoom 1.4
13 | /vis/viewer/flush
14 |
15 | # (if you prefer not refreshing each event, uncomment next line)
16 | # /vis/scene/endOfEventAction accumulate
17 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = [
3 | "setuptools>=42",
4 | "wheel",
5 | "cmake>=3.16",
6 | "ninja; sys_platform != 'win32'",
7 | "pybind11-stubgen~=2.5",
8 | ]
9 | build-backend = "setuptools.build_meta"
10 |
--------------------------------------------------------------------------------
/source/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | file(GLOB_RECURSE SOURCE CONFIGURE_DEPENDS
3 | analysis/*.cc
4 | digits_hits/*.cc
5 | event/*.cc
6 | geometry/*.cc
7 | global/*.cc
8 | graphics_reps/*.cc
9 | intercoms/*.cc
10 | interface/*.cc
11 | materials/*.cc
12 | particles/*.cc
13 | persistency/*.cc
14 | physics_lists/*.cc
15 | processes/*.cc
16 | run/*.cc
17 | tasking/*.cc
18 | track/*.cc
19 | tracking/*.cc
20 | visualization/*.cc
21 | )
22 |
23 | pybind11_add_module(geant4_pybind
24 | ${SOURCE}
25 | geant4_pybind.cc
26 | )
27 |
28 | target_include_directories(geant4_pybind PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
29 |
30 | target_compile_definitions(geant4_pybind
31 | PRIVATE
32 | PYBIND11_USE_SMART_HOLDER_AS_DEFAULT
33 | $<$:G4_HAS_GDML>
34 | $<$:G4_HAS_TCSH>
35 | $<$:G4_HAS_OPENGLX>
36 | $<$:G4_HAS_RAYTRACERX>
37 | $<$:G4_HAS_OPENGLXM>
38 | $<$:G4_HAS_OPENGLWIN>
39 | $<$:G4_HAS_QT>
40 | )
41 |
42 | target_link_libraries(geant4_pybind PRIVATE ${Geant4_LIBRARIES})
43 |
--------------------------------------------------------------------------------
/source/analysis/accumulables/pyG4MergeMode.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | void export_G4MergeMode(py::module &m)
12 | {
13 | py::enum_(m, "G4MergeMode")
14 | .value("kAddition", G4MergeMode::kAddition)
15 | .value("kMultiplication", G4MergeMode::kMultiplication)
16 | .value("kMaximum", G4MergeMode::kMaximum)
17 | .value("kMinimum", G4MergeMode::kMinimum);
18 |
19 | struct ScopedG4Accumulables {};
20 |
21 | py::class_(m, "G4Accumulables")
22 | .def_static("GetMergeMode", &G4Accumulables::GetMergeMode, py::arg("mergeModeName"));
23 | }
24 |
--------------------------------------------------------------------------------
/source/analysis/accumulables/pyG4VAccumulable.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4VAccumulable : public G4VAccumulable, public py::trampoline_self_life_support {
13 | public:
14 | using G4VAccumulable::G4VAccumulable;
15 |
16 | void Merge(const G4VAccumulable &other) override { PYBIND11_OVERRIDE_PURE(void, G4VAccumulable, Merge, other); }
17 |
18 | void Reset() override { PYBIND11_OVERRIDE_PURE(void, G4VAccumulable, Reset, ); }
19 | };
20 |
21 | void export_G4VAccumulable(py::module &m)
22 | {
23 | py::class_(m, "G4VAccumulable")
24 |
25 | .def(py::init(), py::arg("name") = "")
26 | .def("__copy__", [](const PyG4VAccumulable &self) { return new PyG4VAccumulable(self); })
27 | .def("__deepcopy__", [](const PyG4VAccumulable &self, py::dict) { return new PyG4VAccumulable(self); })
28 | .def("GetName", &G4VAccumulable::GetName)
29 | .def("Merge", &G4VAccumulable::Merge, py::arg("other"))
30 | .def("Reset", &G4VAccumulable::Reset);
31 | }
32 |
--------------------------------------------------------------------------------
/source/analysis/pymodG4analysis.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "typecast.hh"
5 | #include "opaques.hh"
6 |
7 | namespace py = pybind11;
8 |
9 | void export_histo(py::module &);
10 | void export_G4VAnalysisManager(py::module &);
11 | void export_G4AnalysisManager(py::module &);
12 | void export_G4TScoreNtupleWriter(py::module &);
13 | void export_G4MergeMode(py::module &m);
14 | void export_G4VAccumulable(py::module &m);
15 | void export_G4Accumulable(py::module &m);
16 | void export_G4AccumulableManager(py::module &m);
17 |
18 | void export_modG4analysis(py::module &m)
19 | {
20 | export_histo(m);
21 | export_G4VAnalysisManager(m);
22 | export_G4AnalysisManager(m);
23 | export_G4TScoreNtupleWriter(m);
24 | export_G4MergeMode(m);
25 | export_G4VAccumulable(m);
26 | export_G4Accumulable(m);
27 | export_G4AccumulableManager(m);
28 | }
29 |
--------------------------------------------------------------------------------
/source/digits_hits/pyG4HCofThisEvent.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | void export_G4HCofThisEvent(py::module &m)
12 | {
13 | py::class_(m, "G4HCofThisEvent")
14 | .def(py::init<>())
15 | .def(py::init())
16 | .def(py::init())
17 | .def("AddHitsCollection", [](G4HCofThisEvent &self, G4int HCID,
18 | py::disown_ptr aHC) { self.AddHitsCollection(HCID, aHC); })
19 |
20 | .def("GetHC", &G4HCofThisEvent::GetHC, py::return_value_policy::reference_internal)
21 | .def("GetNumberOfCollections", &G4HCofThisEvent::GetNumberOfCollections)
22 | .def("GetCapacity", &G4HCofThisEvent::GetCapacity);
23 | }
24 |
--------------------------------------------------------------------------------
/source/digits_hits/pyG4VSDFilter.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4VSDFilter : public G4VSDFilter, public py::trampoline_self_life_support {
13 | public:
14 | using G4VSDFilter::G4VSDFilter;
15 |
16 | G4bool Accept(const G4Step *step) const override { PYBIND11_OVERRIDE_PURE(G4bool, G4VSDFilter, Accept, step); }
17 | };
18 |
19 | void export_G4VSDFilter(py::module &m)
20 | {
21 | // TODO
22 | py::class_(m, "G4VSDFilter")
23 |
24 | .def(py::init(), py::arg("name"))
25 | .def("Accept", &G4VSDFilter::Accept)
26 | .def("GetName", &G4VSDFilter::GetName);
27 | }
28 |
--------------------------------------------------------------------------------
/source/digits_hits/pymodG4digits_hits.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "typecast.hh"
5 | #include "opaques.hh"
6 |
7 | namespace py = pybind11;
8 |
9 | void export_G4VSensitiveDetector(py::module &);
10 | void export_G4VHit(py::module &);
11 | void export_G4SDManager(py::module &);
12 | void export_G4VHitsCollection(py::module &);
13 | void export_G4HCofThisEvent(py::module &);
14 | void export_G4MultiFunctionalDetector(py::module &);
15 | void export_G4MultiSensitiveDetector(py::module &);
16 | void export_G4VSDFilter(py::module &);
17 | void export_G4SDFilter(py::module &);
18 | void export_G4VPrimitiveScorer(py::module &);
19 | void export_G4VPrimitivePlotter(py::module &);
20 | void export_G4Scorer(py::module &);
21 |
22 | void export_modG4digit_hits(py::module &m)
23 | {
24 | export_G4VSensitiveDetector(m);
25 | export_G4VHit(m);
26 | export_G4SDManager(m);
27 | export_G4VHitsCollection(m);
28 | export_G4HCofThisEvent(m);
29 | export_G4MultiFunctionalDetector(m);
30 | export_G4MultiSensitiveDetector(m);
31 | export_G4VSDFilter(m);
32 | export_G4SDFilter(m);
33 | export_G4VPrimitiveScorer(m);
34 | export_G4VPrimitivePlotter(m);
35 | export_G4Scorer(m);
36 | }
37 |
--------------------------------------------------------------------------------
/source/event/pyG4ClassificationOfNewTrack.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | void export_G4ClassificationOfNewTrack(py::module &m)
12 | {
13 | py::enum_(m, "G4ClassificationOfNewTrack")
14 | .value("fUrgent", fUrgent)
15 | .value("fWaiting", fWaiting)
16 | .value("fPostpone", fPostpone)
17 | .value("fKill", fKill)
18 | .value("fWaiting_1", fWaiting_1)
19 | .value("fWaiting_2", fWaiting_2)
20 | .value("fWaiting_3", fWaiting_3)
21 | .value("fWaiting_4", fWaiting_4)
22 | .value("fWaiting_5", fWaiting_5)
23 | .value("fWaiting_6", fWaiting_6)
24 | .value("fWaiting_7", fWaiting_7)
25 | .value("fWaiting_8", fWaiting_8)
26 | .value("fWaiting_9", fWaiting_9)
27 | .value("fWaiting_10", fWaiting_10)
28 | .export_values();
29 | }
30 |
--------------------------------------------------------------------------------
/source/event/pyG4HEPEvtInterface.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include "typecast.hh"
11 | #include "opaques.hh"
12 |
13 | namespace py = pybind11;
14 |
15 | class PyG4HEPEvtInterface : public G4HEPEvtInterface, public py::trampoline_self_life_support {
16 | public:
17 | using G4HEPEvtInterface::G4HEPEvtInterface;
18 |
19 | void GeneratePrimaryVertex(G4Event *evt) override
20 | {
21 | PYBIND11_OVERRIDE(void, G4HEPEvtInterface, GeneratePrimaryVertex, evt);
22 | }
23 | };
24 |
25 | void export_G4HEPEvtInterface(py::module &m)
26 | {
27 | py::class_(m, "G4HEPEvtInterface")
28 |
29 | .def(py::init(), py::arg("evfile"), py::arg("vl") = 0)
30 | .def("GeneratePrimaryVertex", &G4HEPEvtInterface::GeneratePrimaryVertex, py::arg("evt"));
31 | }
32 |
--------------------------------------------------------------------------------
/source/event/pyG4HEPEvtParticle.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include
6 | #include
7 | #include
8 |
9 | #include "typecast.hh"
10 | #include "opaques.hh"
11 |
12 | namespace py = pybind11;
13 |
14 | void export_G4HEPEvtParticle(py::module &m)
15 | {
16 | py::class_(m, "G4HEPEvtParticle")
17 |
18 | .def("__copy__", [](const G4HEPEvtParticle &self) { return new G4HEPEvtParticle(self); })
19 | .def("__deepcopy__", [](const G4HEPEvtParticle &self, py::dict) { return new G4HEPEvtParticle(self); })
20 | .def(py::init<>())
21 | .def(py::init(), py::arg("pp"), py::arg("isthep"), py::arg("jdahep1"),
22 | py::arg("jdahep2"))
23 |
24 | .def("Done", &G4HEPEvtParticle::Done)
25 | .def("GetISTHEP", &G4HEPEvtParticle::GetISTHEP)
26 | .def("GetJDAHEP1", &G4HEPEvtParticle::GetJDAHEP1)
27 | .def("GetJDAHEP2", &G4HEPEvtParticle::GetJDAHEP2)
28 | .def("GetTheParticle", &G4HEPEvtParticle::GetTheParticle, py::return_value_policy::reference)
29 | .def(py::self != py::self)
30 | .def(py::self == py::self);
31 | }
32 |
--------------------------------------------------------------------------------
/source/event/pyG4MultiEventAction.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | class PyG4MultiEventAction : public G4MultiEventAction, public py::trampoline_self_life_support {
14 | public:
15 | using G4MultiEventAction::G4MultiEventAction;
16 |
17 | void BeginOfEventAction(const G4Event *arg0) override
18 | {
19 | PYBIND11_OVERRIDE(void, G4MultiEventAction, BeginOfEventAction, arg0);
20 | }
21 |
22 | void EndOfEventAction(const G4Event *arg0) override
23 | {
24 | PYBIND11_OVERRIDE(void, G4MultiEventAction, EndOfEventAction, arg0);
25 | }
26 |
27 | void SetEventManager(G4EventManager *arg0) override
28 | {
29 | PYBIND11_OVERRIDE(void, G4MultiEventAction, SetEventManager, arg0);
30 | }
31 | };
32 |
33 | void export_G4MultiEventAction(py::module &m)
34 | {
35 | py::class_(m, "G4MultiEventAction",
36 | py::multiple_inheritance())
37 |
38 | .def(py::init<>())
39 | .def("BeginOfEventAction", &G4MultiEventAction::BeginOfEventAction)
40 | .def("EndOfEventAction", &G4MultiEventAction::EndOfEventAction)
41 | .def("SetEventManager", &G4MultiEventAction::SetEventManager);
42 | }
43 |
--------------------------------------------------------------------------------
/source/event/pyG4RayShooter.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | #include "typecast.hh"
15 | #include "opaques.hh"
16 |
17 | namespace py = pybind11;
18 |
19 | void export_G4RayShooter(py::module &m)
20 | {
21 | py::class_(m, "G4RayShooter")
22 |
23 | .def("__copy__", [](const G4RayShooter &self) { return new G4RayShooter(self); })
24 | .def("__deepcopy__", [](const G4RayShooter &self, py::dict) { return new G4RayShooter(self); })
25 | .def(py::init<>())
26 | .def("Shoot", &G4RayShooter::Shoot, py::arg("evt"), py::arg("vtx"), py::arg("direc"));
27 | }
28 |
--------------------------------------------------------------------------------
/source/event/pyG4SmartTrackStack.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | void export_G4SmartTrackStack(py::module &m)
14 | {
15 | py::class_(m, "G4SmartTrackStack")
16 |
17 | .def("__copy__", [](const G4SmartTrackStack &self) { return new G4SmartTrackStack(self); })
18 | .def("__deepcopy__", [](const G4SmartTrackStack &self, py::dict) { return new G4SmartTrackStack(self); })
19 | .def(py::init<>())
20 | .def("GetMaxNTrack", &G4SmartTrackStack::GetMaxNTrack)
21 | .def("GetNTrack", &G4SmartTrackStack::GetNTrack)
22 | .def("PopFromStack", &G4SmartTrackStack::PopFromStack)
23 | .def("PushToStack", &G4SmartTrackStack::PushToStack, py::arg("aStackedTrack"))
24 | .def("TransferTo", &G4SmartTrackStack::TransferTo, py::arg("aStack"))
25 | .def("clear", &G4SmartTrackStack::clear)
26 | .def("clearAndDestroy", &G4SmartTrackStack::clearAndDestroy)
27 | .def("dumpStatistics", &G4SmartTrackStack::dumpStatistics);
28 | //.def("getEnergyOfStack", &G4SmartTrackStack::getEnergyOfStack, py::arg("aTrackStack"));
29 | }
30 |
--------------------------------------------------------------------------------
/source/event/pyG4StackedTrack.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | void export_G4StackedTrack(py::module &m)
14 | {
15 | py::class_(m, "G4StackedTrack")
16 |
17 | .def(py::init<>())
18 | .def(py::init(), py::arg("aTrack"),
19 | py::arg("aTraj") = static_cast(nullptr))
20 |
21 | .def("__copy__", [](const G4StackedTrack &self) { return new G4StackedTrack(self); })
22 | .def("__deepcopy__", [](const G4StackedTrack &self, py::dict) { return new G4StackedTrack(self); })
23 | .def("GetTrack", &G4StackedTrack::GetTrack, py::return_value_policy::reference)
24 | .def("GetTrajectory", &G4StackedTrack::GetTrajectory, py::return_value_policy::reference);
25 | }
26 |
--------------------------------------------------------------------------------
/source/event/pyG4TrackStack.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include "typecast.hh"
11 | #include "opaques.hh"
12 |
13 | namespace py = pybind11;
14 |
15 | void export_G4TrackStack(py::module &m)
16 | {
17 | py::bind_vector(m, "G4TrackStack")
18 |
19 | .def("__copy__", [](const G4TrackStack &self) { return new G4TrackStack(self); })
20 | .def("__deepcopy__", [](const G4TrackStack &self, py::dict) { return new G4TrackStack(self); })
21 | .def(py::init<>())
22 | .def(py::init(), py::arg("n"))
23 | .def("GetMaxNTrack", &G4TrackStack::GetMaxNTrack)
24 | .def("GetNStick", &G4TrackStack::GetNStick)
25 | .def("GetNTrack", &G4TrackStack::GetNTrack)
26 | .def("GetSafetyValue1", &G4TrackStack::GetSafetyValue1)
27 | .def("GetSafetyValue2", &G4TrackStack::GetSafetyValue2)
28 | .def("PopFromStack", &G4TrackStack::PopFromStack)
29 | .def("PushToStack", &G4TrackStack::PushToStack, py::arg("aStackedTrack"))
30 | .def("SetSafetyValue2", &G4TrackStack::SetSafetyValue2, py::arg("x"))
31 | .def("TransferTo", py::overload_cast(&G4TrackStack::TransferTo), py::arg("aStack"))
32 | .def("TransferTo", py::overload_cast(&G4TrackStack::TransferTo), py::arg("aStack"))
33 | .def("clearAndDestroy", &G4TrackStack::clearAndDestroy)
34 | .def("getTotalEnergy", &G4TrackStack::getTotalEnergy);
35 | }
36 |
--------------------------------------------------------------------------------
/source/event/pyG4TrajectoryContainer.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | void export_G4TrajectoryContainer(py::module &m)
14 | {
15 | py::bind_vector(m, "TrajectoryVector");
16 |
17 | py::class_(m, "G4TrajectoryContainer")
18 |
19 | .def(py::init<>())
20 | .def(py::self == py::self)
21 | .def(py::self != py::self)
22 | .def("size", &G4TrajectoryContainer::size)
23 | .def(
24 | "push_back", [](G4TrajectoryContainer &self, py::disown_ptr p) { self.push_back(p); },
25 | py::arg("p"))
26 |
27 | .def("entries", &G4TrajectoryContainer::entries)
28 | .def(
29 | "insert", [](G4TrajectoryContainer &self, py::disown_ptr p) { return self.insert(p); },
30 | py::arg("p"))
31 |
32 | .def("clearAndDestroy", &G4TrajectoryContainer::clearAndDestroy)
33 | .def("__getitem__", &G4TrajectoryContainer::operator[], py::is_operator(),
34 | py::return_value_policy::reference_internal)
35 |
36 | .def("GetVector", &G4TrajectoryContainer::GetVector, py::return_value_policy::reference_internal);
37 | }
38 |
--------------------------------------------------------------------------------
/source/event/pyG4VPrimaryGenerator.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4VPrimaryGenerator : public G4VPrimaryGenerator, public py::trampoline_self_life_support {
13 | public:
14 | using G4VPrimaryGenerator::G4VPrimaryGenerator;
15 |
16 | void GeneratePrimaryVertex(G4Event *evt) override
17 | {
18 | PYBIND11_OVERRIDE_PURE(void, G4VPrimaryGenerator, GeneratePrimaryVertex, evt);
19 | }
20 | };
21 |
22 | void export_G4VPrimaryGenerator(py::module &m)
23 | {
24 | py::class_(m, "G4VPrimaryGenerator")
25 |
26 | .def("__copy__", [](const PyG4VPrimaryGenerator &self) { return new PyG4VPrimaryGenerator(self); })
27 | .def("__deepcopy__", [](const PyG4VPrimaryGenerator &self, py::dict) { return new PyG4VPrimaryGenerator(self); })
28 | .def(py::init<>())
29 | .def_static("CheckVertexInsideWorld", &G4VPrimaryGenerator::CheckVertexInsideWorld, py::arg("pos"))
30 | .def("GeneratePrimaryVertex", &G4VPrimaryGenerator::GeneratePrimaryVertex, py::arg("evt"))
31 | .def("GetParticlePosition", &G4VPrimaryGenerator::GetParticlePosition)
32 | .def("GetParticleTime", &G4VPrimaryGenerator::GetParticleTime)
33 | .def("SetParticlePosition", &G4VPrimaryGenerator::SetParticlePosition, py::arg("aPosition"))
34 | .def("SetParticleTime", &G4VPrimaryGenerator::SetParticleTime, py::arg("aTime"));
35 | }
36 |
--------------------------------------------------------------------------------
/source/event/pyG4VUserEventInformation.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4VUserEventInformation : public G4VUserEventInformation, public py::trampoline_self_life_support {
12 | public:
13 | using G4VUserEventInformation::G4VUserEventInformation;
14 |
15 | void Print() const override { PYBIND11_OVERRIDE_PURE(void, G4VUserEventInformation, Print, ); }
16 | };
17 |
18 | void export_G4VUserEventInformation(py::module &m)
19 | {
20 | py::class_(m, "G4VUserEventInformation")
21 |
22 | .def(py::init<>())
23 | .def("__copy__", [](const PyG4VUserEventInformation &self) { return new PyG4VUserEventInformation(self); })
24 | .def("__deepcopy__",
25 | [](const PyG4VUserEventInformation &self, py::dict) { return new PyG4VUserEventInformation(self); })
26 |
27 | .def("Print", &G4VUserEventInformation::Print);
28 | }
29 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4GeometryCell.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | void export_G4GeometryCell(py::module &m)
13 | {
14 | py::class_(m, "G4GeometryCell")
15 |
16 | .def(py::init(), py::arg("aVolume"), py::arg("RepNum"))
17 | .def("__copy__", [](const G4GeometryCell &self) { return G4GeometryCell(self); })
18 | .def("__deepcopy__", [](const G4GeometryCell &self, py::dict) { return G4GeometryCell(self); })
19 | .def("GetPhysicalVolume", &G4GeometryCell::GetPhysicalVolume)
20 | .def("GetReplicaNumber", &G4GeometryCell::GetReplicaNumber);
21 | }
22 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4GeometryCellComp.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | void export_G4GeometryCellComp(py::module &m)
14 | {
15 | py::class_(m, "G4GeometryCellComp")
16 |
17 | .def(py::init<>())
18 | .def("__copy__", [](const G4GeometryCellComp &self) { return G4GeometryCellComp(self); })
19 | .def("__deepcopy__", [](const G4GeometryCellComp &self, py::dict) { return G4GeometryCellComp(self); })
20 | .def("__call__", &G4GeometryCellComp::operator(), py::arg("g1"), py::arg("g2"), py::is_operator());
21 | }
22 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4GeometryCellStep.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | void export_G4GeometryCellStep(py::module &m)
13 | {
14 | py::class_(m, "G4GeometryCellStep")
15 |
16 | .def(py::init(), py::arg("preCell"), py::arg("postCell"))
17 | .def("__copy__", [](const G4GeometryCellStep &self) { return G4GeometryCellStep(self); })
18 | .def("__deepcopy__", [](const G4GeometryCellStep &self, py::dict) { return G4GeometryCellStep(self); })
19 | .def("GetPreGeometryCell", &G4GeometryCellStep::GetPreGeometryCell)
20 | .def("GetPostGeometryCell", &G4GeometryCellStep::GetPostGeometryCell)
21 | .def("GetCrossBoundary", &G4GeometryCellStep::GetCrossBoundary)
22 | .def("SetPreGeometryCell", &G4GeometryCellStep::SetPreGeometryCell, py::arg("preCell"))
23 | .def("SetPostGeometryCell", &G4GeometryCellStep::SetPostGeometryCell, py::arg("postCell"))
24 | .def("SetCrossBoundary", &G4GeometryCellStep::SetCrossBoundary, py::arg("b"));
25 | }
26 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4ImportanceAlgorithm.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4ImportanceAlgorithm : public G4ImportanceAlgorithm, public py::trampoline_self_life_support {
12 | public:
13 | using G4ImportanceAlgorithm::G4ImportanceAlgorithm;
14 |
15 | G4Nsplit_Weight Calculate(G4double ipre, G4double ipost, G4double init_w) const override
16 | {
17 | PYBIND11_OVERRIDE(G4Nsplit_Weight, G4ImportanceAlgorithm, Calculate, ipre, ipost, init_w);
18 | }
19 | };
20 |
21 | void export_G4ImportanceAlgorithm(py::module &m)
22 | {
23 | py::class_(m, "G4ImportanceAlgorithm")
24 |
25 | .def(py::init<>())
26 | .def("__copy__", [](const PyG4ImportanceAlgorithm &self) { return PyG4ImportanceAlgorithm(self); })
27 | .def("__deepcopy__", [](const PyG4ImportanceAlgorithm &self, py::dict) { return PyG4ImportanceAlgorithm(self); })
28 | .def("Calculate", &G4ImportanceAlgorithm::Calculate, py::arg("ipre"), py::arg("ipost"), py::arg("init_w"));
29 | }
30 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4VGCellFinder.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | class PyG4VGCellFinder : public G4VGCellFinder, public py::trampoline_self_life_support {
14 | public:
15 | using G4VGCellFinder::G4VGCellFinder;
16 |
17 | G4GeometryCell GetPreGeometryCell(const G4Step &aStep) const override
18 | {
19 | PYBIND11_OVERRIDE_PURE(G4GeometryCell, G4VGCellFinder, GetPreGeometryCell, aStep);
20 | }
21 |
22 | G4GeometryCell GetPostGeometryCell(const G4Step &aStep) const override
23 | {
24 | PYBIND11_OVERRIDE_PURE(G4GeometryCell, G4VGCellFinder, GetPostGeometryCell, aStep);
25 | }
26 | };
27 |
28 | void export_G4VGCellFinder(py::module &m)
29 | {
30 | py::class_(m, "G4VGCellFinder")
31 |
32 | .def(py::init<>())
33 | .def("__copy__", [](const PyG4VGCellFinder &self) { return PyG4VGCellFinder(self); })
34 | .def("__deepcopy__", [](const PyG4VGCellFinder &self, py::dict) { return PyG4VGCellFinder(self); })
35 | .def("GetPreGeometryCell", &G4VGCellFinder::GetPreGeometryCell, py::arg("aStep"))
36 | .def("GetPostGeometryCell", &G4VGCellFinder::GetPostGeometryCell, py::arg("aStep"));
37 | }
38 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4VIStore.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "typecast.hh"
9 | #include "opaques.hh"
10 |
11 | namespace py = pybind11;
12 |
13 | class PyG4VIStore : public G4VIStore, public py::trampoline_self_life_support {
14 | public:
15 | using G4VIStore::G4VIStore;
16 |
17 | G4double GetImportance(const G4GeometryCell &gCell) const override
18 | {
19 | PYBIND11_OVERRIDE_PURE(G4double, G4VIStore, GetImportance, gCell);
20 | }
21 |
22 | G4bool IsKnown(const G4GeometryCell &gCell) const override
23 | {
24 | PYBIND11_OVERRIDE_PURE(G4bool, G4VIStore, IsKnown, gCell);
25 | }
26 |
27 | const G4VPhysicalVolume &GetWorldVolume() const override
28 | {
29 | PYBIND11_OVERRIDE_PURE(const G4VPhysicalVolume &, G4VIStore, GetWorldVolume, );
30 | }
31 | };
32 |
33 | void export_G4VIStore(py::module &m)
34 | {
35 | py::class_(m, "G4VIStore")
36 |
37 | .def(py::init<>())
38 | .def("__copy__", [](const PyG4VIStore &self) { return PyG4VIStore(self); })
39 | .def("__deepcopy__", [](const PyG4VIStore &self, py::dict) { return PyG4VIStore(self); })
40 | .def("GetImportance", &G4VIStore::GetImportance, py::arg("gCell"))
41 | .def("IsKnown", &G4VIStore::IsKnown, py::arg("gCell"))
42 | .def("GetWorldVolume", &G4VIStore::GetWorldVolume);
43 | }
44 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4VImportanceAlgorithm.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4VImportanceAlgorithm : public G4VImportanceAlgorithm, public py::trampoline_self_life_support {
12 | public:
13 | using G4VImportanceAlgorithm::G4VImportanceAlgorithm;
14 |
15 | G4Nsplit_Weight Calculate(G4double ipre, G4double ipost, G4double init_w) const override
16 | {
17 | PYBIND11_OVERRIDE_PURE(G4Nsplit_Weight, G4VImportanceAlgorithm, Calculate, ipre, ipost, init_w);
18 | }
19 | };
20 |
21 | void export_G4VImportanceAlgorithm(py::module &m)
22 | {
23 | py::class_(m, "G4VImportanceAlgorithm")
24 |
25 | .def(py::init<>())
26 | .def("__copy__", [](const PyG4VImportanceAlgorithm &self) { return PyG4VImportanceAlgorithm(self); })
27 | .def("__deepcopy__",
28 | [](const PyG4VImportanceAlgorithm &self, py::dict) { return PyG4VImportanceAlgorithm(self); })
29 |
30 | .def("Calculate", &G4VImportanceAlgorithm::Calculate, py::arg("ipre"), py::arg("ipost"), py::arg("init_w"));
31 | }
32 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4VImportanceSplitExaminer.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4VImportanceSplitExaminer : public G4VImportanceSplitExaminer, public py::trampoline_self_life_support {
12 | public:
13 | using G4VImportanceSplitExaminer::G4VImportanceSplitExaminer;
14 |
15 | G4Nsplit_Weight Examine(G4double w) const override
16 | {
17 | PYBIND11_OVERRIDE_PURE(G4Nsplit_Weight, G4VImportanceSplitExaminer, Examine, w);
18 | }
19 | };
20 |
21 | void export_G4VImportanceSplitExaminer(py::module &m)
22 | {
23 | py::class_(m, "G4VImportanceSplitExaminer")
24 |
25 | .def(py::init<>())
26 | .def("__copy__", [](const PyG4VImportanceSplitExaminer &self) { return PyG4VImportanceSplitExaminer(self); })
27 | .def("__deepcopy__",
28 | [](const PyG4VImportanceSplitExaminer &self, py::dict) { return PyG4VImportanceSplitExaminer(self); })
29 |
30 | .def("Examine", &G4VImportanceSplitExaminer::Examine, py::arg("w"));
31 | }
32 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4VWeightWindowAlgorithm.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4VWeightWindowAlgorithm : public G4VWeightWindowAlgorithm, public py::trampoline_self_life_support {
12 | public:
13 | using G4VWeightWindowAlgorithm::G4VWeightWindowAlgorithm;
14 |
15 | G4Nsplit_Weight Calculate(G4double init_w, G4double lowerWeightBound) const override
16 | {
17 | PYBIND11_OVERRIDE_PURE(G4Nsplit_Weight, G4VWeightWindowAlgorithm, Calculate, init_w, lowerWeightBound);
18 | }
19 | };
20 |
21 | void export_G4VWeightWindowAlgorithm(py::module &m)
22 | {
23 | py::class_(m, "G4VWeightWindowAlgorithm")
24 |
25 | .def(py::init<>())
26 | .def("__copy__", [](const PyG4VWeightWindowAlgorithm &self) { return PyG4VWeightWindowAlgorithm(self); })
27 | .def("__deepcopy__",
28 | [](const PyG4VWeightWindowAlgorithm &self, py::dict) { return PyG4VWeightWindowAlgorithm(self); })
29 |
30 | .def("Calculate", &G4VWeightWindowAlgorithm::Calculate, py::arg("init_w"), py::arg("lowerWeightBound"));
31 | }
32 |
--------------------------------------------------------------------------------
/source/geometry/biasing/pyG4WeightWindowAlgorithm.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4WeightWindowAlgorithm : public G4WeightWindowAlgorithm, public py::trampoline_self_life_support {
12 | public:
13 | using G4WeightWindowAlgorithm::G4WeightWindowAlgorithm;
14 |
15 | G4Nsplit_Weight Calculate(G4double init_w, G4double lowerWeightBound) const override
16 | {
17 | PYBIND11_OVERRIDE(G4Nsplit_Weight, G4WeightWindowAlgorithm, Calculate, init_w, lowerWeightBound);
18 | }
19 | };
20 |
21 | void export_G4WeightWindowAlgorithm(py::module &m)
22 | {
23 | py::class_(m,
24 | "G4WeightWindowAlgorithm")
25 |
26 | .def(py::init(), py::arg("upperLimitFactor") = 5, py::arg("survivalFactor") = 3,
27 | py::arg("maxNumberOfSplits") = 5)
28 |
29 | .def("__copy__", [](const PyG4WeightWindowAlgorithm &self) { return PyG4WeightWindowAlgorithm(self); })
30 | .def("__deepcopy__",
31 | [](const PyG4WeightWindowAlgorithm &self, py::dict) { return PyG4WeightWindowAlgorithm(self); })
32 |
33 | .def("Calculate", &G4WeightWindowAlgorithm::Calculate, py::arg("init_w"), py::arg("lowerWeightBound"));
34 | }
35 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4CashKarpRKF45.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4CashKarpRKF45 : public G4CashKarpRKF45, public py::trampoline_self_life_support {
12 | public:
13 | using G4CashKarpRKF45::G4CashKarpRKF45;
14 |
15 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
16 | {
17 | PYBIND11_OVERRIDE(void, G4CashKarpRKF45, Stepper, y, dydx, h, yout, yerr);
18 | }
19 |
20 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4CashKarpRKF45, DistChord, ); }
21 |
22 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4CashKarpRKF45, IntegratorOrder, ); }
23 | };
24 |
25 | void export_G4CashKarpRKF45(py::module &m)
26 | {
27 | py::class_(m, "G4CashKarpRKF45")
28 |
29 | .def(py::init(), py::arg("EqRhs"), py::arg("numberOfVariables") = 6,
30 | py::arg("primary") = true)
31 |
32 | .def("Stepper", &G4CashKarpRKF45::Stepper, py::arg("y"), py::arg("dydx"), py::arg("h"), py::arg("yout"),
33 | py::arg("yerr"))
34 |
35 | .def("DistChord", &G4CashKarpRKF45::DistChord)
36 | .def("IntegratorOrder", &G4CashKarpRKF45::IntegratorOrder);
37 | }
38 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4ClassicalRK4.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4ClassicalRK4 : public G4ClassicalRK4, public py::trampoline_self_life_support {
13 | public:
14 | using G4ClassicalRK4::G4ClassicalRK4;
15 |
16 | void DumbStepper(const G4double *yIn, const G4double *dydx, G4double h, G4double *yOut) override
17 | {
18 | PYBIND11_OVERRIDE(void, G4ClassicalRK4, DumbStepper, yIn, dydx, h, yOut);
19 | }
20 |
21 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4ClassicalRK4, IntegratorOrder, ); }
22 |
23 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
24 | {
25 | PYBIND11_OVERRIDE(void, G4ClassicalRK4, Stepper, y, dydx, h, yout, yerr);
26 | }
27 |
28 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4ClassicalRK4, DistChord, ); }
29 | };
30 |
31 | void export_G4ClassicalRK4(py::module &m)
32 | {
33 | py::class_(m, "G4ClassicalRK4")
34 |
35 | .def(py::init(), py::arg("EquationMotion"), py::arg("numberOfVariables") = 6)
36 | .def("DumbStepper", &G4ClassicalRK4::DumbStepper, py::arg("yIn"), py::arg("dydx"), py::arg("h"), py::arg("yOut"))
37 | .def("IntegratorOrder", &G4ClassicalRK4::IntegratorOrder);
38 | }
39 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4DormandPrinceRK78.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4DormandPrinceRK78 : public G4DormandPrinceRK78, public py::trampoline_self_life_support {
12 | public:
13 | using G4DormandPrinceRK78::G4DormandPrinceRK78;
14 |
15 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
16 | {
17 | PYBIND11_OVERRIDE(void, G4DormandPrinceRK78, Stepper, y, dydx, h, yout, yerr);
18 | }
19 |
20 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4DormandPrinceRK78, DistChord, ); }
21 |
22 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4DormandPrinceRK78, IntegratorOrder, ); }
23 | };
24 |
25 | void export_G4DormandPrinceRK78(py::module &m)
26 | {
27 | py::class_(m, "G4DormandPrinceRK78")
28 |
29 | .def(py::init(), py::arg("EqRhs"), py::arg("numberOfVariables") = 6,
30 | py::arg("primary") = true)
31 |
32 | .def("Stepper", &G4DormandPrinceRK78::Stepper, py::arg("y"), py::arg("dydx"), py::arg("h"), py::arg("yout"),
33 | py::arg("yerr"))
34 |
35 | .def("DistChord", &G4DormandPrinceRK78::DistChord)
36 | .def("IntegratorOrder", &G4DormandPrinceRK78::IntegratorOrder);
37 | }
38 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4DriverReporter.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | void export_G4DriverReporter(py::module &m)
12 | {
13 | py::class_(m, "G4DriverReporter")
14 |
15 | .def(py::init<>())
16 | .def("__copy__", [](const G4DriverReporter &self) { return G4DriverReporter(self); })
17 | .def("__deepcopy__", [](const G4DriverReporter &self, py::dict) { return G4DriverReporter(self); })
18 |
19 | .def_static("PrintStatus",
20 | py::overload_cast(&G4DriverReporter::PrintStatus),
22 | py::arg("StartArr"), py::arg("xstart"), py::arg("CurrentArr"), py::arg("xcurrent"),
23 | py::arg("requestStep"), py::arg("subStepNo"), py::arg("noIntegrationVariables"))
24 |
25 | .def_static("PrintStatus",
26 | py::overload_cast(
27 | &G4DriverReporter::PrintStatus),
28 | py::arg("StartFT"), py::arg("CurrentFT"), py::arg("requestStep"), py::arg("subStepNo"))
29 |
30 | .def_static("PrintStat_Aux", &G4DriverReporter::PrintStat_Aux, py::arg("aFieldTrack"), py::arg("requestStep"),
31 | py::arg("actualStep"), py::arg("subStepNo"), py::arg("subStepSize"), py::arg("dotVelocities"));
32 | }
33 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4EqGravityField.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4EqGravityField : public G4EqGravityField, public py::trampoline_self_life_support {
12 | public:
13 | using G4EqGravityField::G4EqGravityField;
14 |
15 | void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double mass) override
16 | {
17 | PYBIND11_OVERRIDE(void, G4EqGravityField, SetChargeMomentumMass, particleCharge, MomentumXc, mass);
18 | }
19 |
20 | void EvaluateRhsGivenB(const G4double *y, const G4double *Field, G4double *dydx) const override
21 | {
22 | PYBIND11_OVERRIDE(void, G4EqGravityField, EvaluateRhsGivenB, y, Field, dydx);
23 | }
24 | };
25 |
26 | void export_G4EqGravityField(py::module &m)
27 | {
28 | py::class_(m, "G4EqGravityField")
29 |
30 | .def(py::init(), py::arg("gField"))
31 | .def("__copy__", [](const PyG4EqGravityField &self) { return PyG4EqGravityField(self); })
32 | .def("__deepcopy__", [](const PyG4EqGravityField &self, py::dict) { return PyG4EqGravityField(self); })
33 | .def("SetChargeMomentumMass", &G4EqGravityField::SetChargeMomentumMass, py::arg("particleCharge"),
34 | py::arg("MomentumXc"), py::arg("mass"))
35 |
36 | .def("EvaluateRhsGivenB", &G4EqGravityField::EvaluateRhsGivenB, py::arg("y"), py::arg("Field"), py::arg("dydx"));
37 | }
38 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4ErrorMag_UsualEqRhs.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | class PyG4ErrorMag_UsualEqRhs : public G4ErrorMag_UsualEqRhs, public py::trampoline_self_life_support {
12 | public:
13 | using G4ErrorMag_UsualEqRhs::G4ErrorMag_UsualEqRhs;
14 |
15 | void EvaluateRhsGivenB(const G4double *y, const G4double *B, G4double *dydx) const override
16 | {
17 | PYBIND11_OVERRIDE(void, G4ErrorMag_UsualEqRhs, EvaluateRhsGivenB, y, B, dydx);
18 | }
19 |
20 | void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double mass) override
21 | {
22 | PYBIND11_OVERRIDE(void, G4ErrorMag_UsualEqRhs, SetChargeMomentumMass, particleCharge, MomentumXc, mass);
23 | }
24 | };
25 |
26 | void export_G4ErrorMag_UsualEqRhs(py::module &m)
27 | {
28 | py::class_(m, "G4ErrorMag_UsualEqRhs")
29 |
30 | .def(py::init(), py::arg("MagField"))
31 | .def("__copy__", [](const PyG4ErrorMag_UsualEqRhs &self) { return PyG4ErrorMag_UsualEqRhs(self); })
32 | .def("__deepcopy__", [](const PyG4ErrorMag_UsualEqRhs &self, py::dict) { return PyG4ErrorMag_UsualEqRhs(self); })
33 | .def("EvaluateRhsGivenB", &G4ErrorMag_UsualEqRhs::EvaluateRhsGivenB, py::arg("y"), py::arg("B"), py::arg("dydx"));
34 | }
35 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4ExplicitEuler.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4ExplicitEuler : public G4ExplicitEuler, public py::trampoline_self_life_support {
13 | public:
14 | using G4ExplicitEuler::G4ExplicitEuler;
15 |
16 | void DumbStepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout) override
17 | {
18 | PYBIND11_OVERRIDE(void, G4ExplicitEuler, DumbStepper, y, dydx, h, yout);
19 | }
20 |
21 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4ExplicitEuler, IntegratorOrder, ); }
22 |
23 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
24 | {
25 | PYBIND11_OVERRIDE(void, G4ExplicitEuler, Stepper, y, dydx, h, yout, yerr);
26 | }
27 |
28 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4ExplicitEuler, DistChord, ); }
29 | };
30 |
31 | void export_G4ExplicitEuler(py::module &m)
32 | {
33 | py::class_(m, "G4ExplicitEuler")
34 |
35 | .def(py::init(), py::arg("EqRhs"), py::arg("numberOfVariables") = 6)
36 | .def("DumbStepper", &G4ExplicitEuler::DumbStepper, py::arg("y"), py::arg("dydx"), py::arg("h"), py::arg("yout"))
37 | .def("IntegratorOrder", &G4ExplicitEuler::IntegratorOrder);
38 | }
39 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4FieldManagerStore.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include "typecast.hh"
11 | #include "opaques.hh"
12 |
13 | namespace py = pybind11;
14 |
15 | void export_G4FieldManagerStore(py::module &m)
16 | {
17 | py::class_(m, "G4FieldManagerStore")
18 |
19 | .def("__copy__", [](const G4FieldManagerStore &self) { return G4FieldManagerStore(self); })
20 | .def("__deepcopy__", [](const G4FieldManagerStore &self, py::dict) { return G4FieldManagerStore(self); })
21 | .def_static("Register", &G4FieldManagerStore::Register, py::arg("pVolume"))
22 | .def_static("DeRegister", &G4FieldManagerStore::DeRegister, py::arg("pVolume"))
23 | .def_static("GetInstance", &G4FieldManagerStore::GetInstance, py::return_value_policy::reference)
24 | .def_static("GetInstanceIfExist", &G4FieldManagerStore::GetInstanceIfExist, py::return_value_policy::reference)
25 | .def_static("Clean", &G4FieldManagerStore::Clean)
26 | .def("ClearAllChordFindersState", &G4FieldManagerStore::ClearAllChordFindersState);
27 | }
28 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4HelixHeum.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4HelixHeum : public G4HelixHeum, public py::trampoline_self_life_support {
13 | public:
14 | using G4HelixHeum::G4HelixHeum;
15 |
16 | void DumbStepper(const G4double *y, G4ThreeVector Bfld, G4double h, G4double *yout) override
17 | {
18 | PYBIND11_OVERRIDE(void, G4HelixHeum, DumbStepper, y, Bfld, h, yout);
19 | }
20 |
21 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4HelixHeum, IntegratorOrder, ); }
22 |
23 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
24 | {
25 | PYBIND11_OVERRIDE(void, G4HelixHeum, Stepper, y, dydx, h, yout, yerr);
26 | }
27 |
28 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4HelixHeum, DistChord, ); }
29 | };
30 |
31 | void export_G4HelixHeum(py::module &m)
32 | {
33 | py::class_(m, "G4HelixHeum")
34 |
35 | .def(py::init(), py::arg("EqRhs"))
36 | .def("DumbStepper", &G4HelixHeum::DumbStepper, py::arg("y"), py::arg("Bfld"), py::arg("h"), py::arg("yout"))
37 | .def("IntegratorOrder", &G4HelixHeum::IntegratorOrder);
38 | }
39 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4HelixImplicitEuler.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4HelixImplicitEuler : public G4HelixImplicitEuler, public py::trampoline_self_life_support {
13 | public:
14 | using G4HelixImplicitEuler::G4HelixImplicitEuler;
15 |
16 | void DumbStepper(const G4double *y, G4ThreeVector Bfld, G4double h, G4double *yout) override
17 | {
18 | PYBIND11_OVERRIDE(void, G4HelixImplicitEuler, DumbStepper, y, Bfld, h, yout);
19 | }
20 |
21 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4HelixImplicitEuler, IntegratorOrder, ); }
22 |
23 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
24 | {
25 | PYBIND11_OVERRIDE(void, G4HelixImplicitEuler, Stepper, y, dydx, h, yout, yerr);
26 | }
27 |
28 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4HelixImplicitEuler, DistChord, ); }
29 | };
30 |
31 | void export_G4HelixImplicitEuler(py::module &m)
32 | {
33 | py::class_(m, "G4HelixImplicitEuler")
34 |
35 | .def(py::init(), py::arg("EqRhs"))
36 | .def("DumbStepper", &G4HelixImplicitEuler::DumbStepper, py::arg("y"), py::arg("Bfld"), py::arg("h"),
37 | py::arg("yout"))
38 |
39 | .def("IntegratorOrder", &G4HelixImplicitEuler::IntegratorOrder);
40 | }
41 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4HelixSimpleRunge.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4HelixSimpleRunge : public G4HelixSimpleRunge, public py::trampoline_self_life_support {
13 | public:
14 | using G4HelixSimpleRunge::G4HelixSimpleRunge;
15 |
16 | void DumbStepper(const G4double *y, G4ThreeVector Bfld, G4double h, G4double *yout) override
17 | {
18 | PYBIND11_OVERRIDE(void, G4HelixSimpleRunge, DumbStepper, y, Bfld, h, yout);
19 | }
20 |
21 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4HelixSimpleRunge, IntegratorOrder, ); }
22 |
23 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
24 | {
25 | PYBIND11_OVERRIDE(void, G4HelixSimpleRunge, Stepper, y, dydx, h, yout, yerr);
26 | }
27 |
28 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4HelixSimpleRunge, DistChord, ); }
29 | };
30 |
31 | void export_G4HelixSimpleRunge(py::module &m)
32 | {
33 | py::class_(m, "G4HelixSimpleRunge")
34 |
35 | .def(py::init(), py::arg("EqRhs"))
36 | .def("DumbStepper", &G4HelixSimpleRunge::DumbStepper, py::arg("y"), py::arg("Bfld"), py::arg("h"),
37 | py::arg("yout"))
38 |
39 | .def("IntegratorOrder", &G4HelixSimpleRunge::IntegratorOrder);
40 | }
41 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4ImplicitEuler.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4ImplicitEuler : public G4ImplicitEuler, public py::trampoline_self_life_support {
13 | public:
14 | using G4ImplicitEuler::G4ImplicitEuler;
15 |
16 | void DumbStepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout) override
17 | {
18 | PYBIND11_OVERRIDE(void, G4ImplicitEuler, DumbStepper, y, dydx, h, yout);
19 | }
20 |
21 | G4int IntegratorOrder() const override { PYBIND11_OVERRIDE(G4int, G4ImplicitEuler, IntegratorOrder, ); }
22 |
23 | void Stepper(const G4double *y, const G4double *dydx, G4double h, G4double *yout, G4double *yerr) override
24 | {
25 | PYBIND11_OVERRIDE(void, G4ImplicitEuler, Stepper, y, dydx, h, yout, yerr);
26 | }
27 |
28 | G4double DistChord() const override { PYBIND11_OVERRIDE(G4double, G4ImplicitEuler, DistChord, ); }
29 | };
30 |
31 | void export_G4ImplicitEuler(py::module &m)
32 | {
33 | py::class_(m, "G4ImplicitEuler")
34 |
35 | .def(py::init(), py::arg("EqRhs"), py::arg("numberOfVariables") = 6)
36 | .def("DumbStepper", &G4ImplicitEuler::DumbStepper, py::arg("y"), py::arg("dydx"), py::arg("h"), py::arg("yout"))
37 | .def("IntegratorOrder", &G4ImplicitEuler::IntegratorOrder);
38 | }
39 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4LineSection.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 |
6 | #include "typecast.hh"
7 | #include "opaques.hh"
8 |
9 | namespace py = pybind11;
10 |
11 | void export_G4LineSection(py::module &m)
12 | {
13 | py::class_(m, "G4LineSection")
14 |
15 | .def(py::init(), py::arg("PntA"), py::arg("PntB"))
16 | .def("__copy__", [](const G4LineSection &self) { return G4LineSection(self); })
17 | .def("__deepcopy__", [](const G4LineSection &self, py::dict) { return G4LineSection(self); })
18 | .def("Dist", &G4LineSection::Dist, py::arg("OtherPnt"))
19 | .def("GetABdistanceSq", &G4LineSection::GetABdistanceSq)
20 | .def_static("Distline", &G4LineSection::Distline, py::arg("OtherPnt"), py::arg("LinePntA"), py::arg("LinePntB"));
21 | }
22 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4Mag_EqRhs.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4Mag_EqRhs : public G4Mag_EqRhs, public py::trampoline_self_life_support {
13 | public:
14 | using G4Mag_EqRhs::G4Mag_EqRhs;
15 |
16 | void EvaluateRhsGivenB(const G4double *y, const G4double *B, G4double *dydx) const override
17 | {
18 | PYBIND11_OVERRIDE_PURE(void, G4Mag_EqRhs, EvaluateRhsGivenB, y, B, dydx);
19 | }
20 |
21 | void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double mass) override
22 | {
23 | PYBIND11_OVERRIDE(void, G4Mag_EqRhs, SetChargeMomentumMass, particleCharge, MomentumXc, mass);
24 | }
25 | };
26 |
27 | void export_G4Mag_EqRhs(py::module &m)
28 | {
29 | py::class_(m, "G4Mag_EqRhs")
30 |
31 | .def(py::init(), py::arg("magField"))
32 | .def("__copy__", [](const PyG4Mag_EqRhs &self) { return PyG4Mag_EqRhs(self); })
33 | .def("__deepcopy__", [](const PyG4Mag_EqRhs &self, py::dict) { return PyG4Mag_EqRhs(self); })
34 | .def("EvaluateRhsGivenB", &G4Mag_EqRhs::EvaluateRhsGivenB, py::arg("y"), py::arg("B"), py::arg("dydx"))
35 | .def("FCof", &G4Mag_EqRhs::FCof)
36 | .def("SetChargeMomentumMass", &G4Mag_EqRhs::SetChargeMomentumMass, py::arg("particleCharge"),
37 | py::arg("MomentumXc"), py::arg("mass"));
38 | }
39 |
--------------------------------------------------------------------------------
/source/geometry/magneticfield/pyG4Mag_UsualEqRhs.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #include "typecast.hh"
8 | #include "opaques.hh"
9 |
10 | namespace py = pybind11;
11 |
12 | class PyG4Mag_UsualEqRhs : public G4Mag_UsualEqRhs, public py::trampoline_self_life_support {
13 | public:
14 | using G4Mag_UsualEqRhs::G4Mag_UsualEqRhs;
15 |
16 | void EvaluateRhsGivenB(const G4double *y, const G4double *B, G4double *dydx) const override
17 | {
18 | PYBIND11_OVERRIDE(void, G4Mag_UsualEqRhs, EvaluateRhsGivenB, y, B, dydx);
19 | }
20 |
21 | void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double mass) override
22 | {
23 | PYBIND11_OVERRIDE(void, G4Mag_UsualEqRhs, SetChargeMomentumMass, particleCharge, MomentumXc, mass);
24 | }
25 | };
26 |
27 | void export_G4Mag_UsualEqRhs(py::module &m)
28 | {
29 | py::class_