From 1550d70024bdf0fdbaaee78f416e93a2ed9a3f38 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Mon, 13 May 2024 17:37:47 +0200 Subject: [PATCH 1/3] Typos: fix some randomly spotted typos --- DDG4/include/DDG4/Geant4Particle.h | 8 +++++--- DDG4/python/DDSim/Helper/Meta.py | 2 +- DDG4/src/Geant4Action.cpp | 2 +- DDG4/src/Geant4InputAction.cpp | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/DDG4/include/DDG4/Geant4Particle.h b/DDG4/include/DDG4/Geant4Particle.h index 77bfc5586..bb4e2b12d 100644 --- a/DDG4/include/DDG4/Geant4Particle.h +++ b/DDG4/include/DDG4/Geant4Particle.h @@ -221,11 +221,13 @@ namespace dd4hep { std::string processName() const; /// Access to the creator process type name std::string processTypeName() const; - /// Access patricle momentum, energy as 4 vector + /// Access particle momentum, energy as 4 vector FourVector pxPyPzM() const; - /// Access patricle momentum, energy as 4 vector + /// Access particle momentum, energy as 4 vector + template std::vector pxPyPzM(T unit) const; + /// Access particle momentum, energy as 4 vector ThreeVector startVertex() const; - /// Access patricle momentum, energy as 4 vector + /// Access particle momentum, energy as 4 vector ThreeVector endVertex() const; /// Access the Geant4 particle definition object (expensive!) const G4ParticleDefinition *definition() const; diff --git a/DDG4/python/DDSim/Helper/Meta.py b/DDG4/python/DDSim/Helper/Meta.py index c7db1cd59..6b86ce1b3 100644 --- a/DDG4/python/DDSim/Helper/Meta.py +++ b/DDG4/python/DDSim/Helper/Meta.py @@ -31,7 +31,7 @@ def __init__(self): def parseEventParameters(self): """ - Parse the event parameters and return 3 event parameter dictionnaries, respectively + Parse the event parameters and return 3 event parameter dictionaries, respectively for string, int and float parameters """ stringParameters, intParameters, floatParameters, allParameters = {}, {}, {}, [] diff --git a/DDG4/src/Geant4Action.cpp b/DDG4/src/Geant4Action.cpp index c8dbd2327..6dd934fb9 100644 --- a/DDG4/src/Geant4Action.cpp +++ b/DDG4/src/Geant4Action.cpp @@ -45,7 +45,7 @@ void Geant4Action::ContextUpdate::operator()(Geant4Action* action) const { action->m_context = context; if ( 0 == action->m_context ) { - cout << "EERIOR" << endl; + cout << "ERROR" << endl; } } diff --git a/DDG4/src/Geant4InputAction.cpp b/DDG4/src/Geant4InputAction.cpp index 07ed4e0a9..eac615a96 100644 --- a/DDG4/src/Geant4InputAction.cpp +++ b/DDG4/src/Geant4InputAction.cpp @@ -184,7 +184,7 @@ int Geant4InputAction::readParticles(int evt_number, Vertices& vertices, std::vector& particles) { - //in case readParticles is called diractly outside of having a run, we make sure a reader exists + //in case readParticles is called directly outside of having a run, we make sure a reader exists createReader(); int evid = evt_number + m_firstEvent; int status = m_reader->moveToEvent(evid); From adc139914a1f99ed9d9f774602d5c0b121cb602a Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Mon, 13 May 2024 17:38:04 +0200 Subject: [PATCH 2/3] Geant4Handle: correct error message when casting does not work --- DDG4/src/Geant4Handle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DDG4/src/Geant4Handle.cpp b/DDG4/src/Geant4Handle.cpp index 25a73c67c..0ca48825e 100644 --- a/DDG4/src/Geant4Handle.cpp +++ b/DDG4/src/Geant4Handle.cpp @@ -88,8 +88,9 @@ namespace dd4hep { if (ptr) { return ptr; } - except("Geant4Handle", "Failed to convert object of type %s to handle of type %s!", - typ.first.c_str(),typ.second.c_str()); + std::string _t = typeName(typeid(TYPE)); + except("Geant4Handle", "Failed to convert object of type '%s' with name '%s' to handle of type '%s'!", + typ.first.c_str(),typ.second.c_str(),_t.c_str()); } except("Geant4Handle", "Failed to create object of type %s!", typ.first.c_str()); return 0; From 04847f082b385ec4dff4a576ef81357b3890a40f Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Thu, 16 May 2024 14:10:26 +0200 Subject: [PATCH 3/3] DDG4/ddsim: change so that user plugin config documentation comes to the steering file --- DDG4/python/DDSim/Helper/Physics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DDG4/python/DDSim/Helper/Physics.py b/DDG4/python/DDSim/Helper/Physics.py index 6a3d93754..8b41c9ca2 100644 --- a/DDG4/python/DDSim/Helper/Physics.py +++ b/DDG4/python/DDSim/Helper/Physics.py @@ -10,7 +10,7 @@ class Physics(ConfigHelper): - """Configuration for the PhysicsList""" + """Configuration for the PhysicsList and Monte Carlo particle selection.""" def __init__(self): super(Physics, self).__init__() @@ -29,6 +29,7 @@ def __init__(self): self._alternativeDecayStatuses = set() self._userFunctions = [] self._closeProperties() + Physics.__doc__ += "\n\n" + self.setupUserPhysics.__doc__ @property def rejectPDGs(self): @@ -161,7 +162,7 @@ def setupPhysics(self, kernel, name=None): return seq def setupUserPhysics(self, userFunction): - """Add a function to setup physics plugins. + """To load arbitrary plugins, add a function to be executed. The function must take the DDG4.Kernel() object as the only argument. @@ -185,5 +186,7 @@ def setupCerenkov(kernel): return None SIM.physics.setupUserPhysics(setupCerenkov) + + # End of example """ self._userFunctions.append(userFunction)