From 89c15c575c838a970371e1e1eefc496754abd0ac Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Fri, 24 Nov 2023 17:08:58 +0100 Subject: [PATCH 1/5] HexGrid: use std::abs instead of abs --- DDCore/src/segmentations/HexGrid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DDCore/src/segmentations/HexGrid.cpp b/DDCore/src/segmentations/HexGrid.cpp index 0e9224e52..5be6ea355 100644 --- a/DDCore/src/segmentations/HexGrid.cpp +++ b/DDCore/src/segmentations/HexGrid.cpp @@ -123,7 +123,7 @@ namespace dd4hep { double a=positive_modulo(y/(std::sqrt(3)*_sideLength),1); double b=positive_modulo(x/(3*_sideLength),1); int ix = std::floor(x/(3*_sideLength/2.))+ - (b<0.5)*(-abs(a-.5)<(b-.5)*3)+(b>0.5)*(abs(a-.5)-.5<(b-1)*3); + (b<0.5)*(-std::abs(a-.5)<(b-.5)*3)+(b>0.5)*(std::abs(a-.5)-.5<(b-1)*3); int iy=std::floor(y/(std::sqrt(3)*_sideLength/2.)); iy-=(ix+iy)&1; From 1a1aff3e62f14f9ca7dce23fc33ba1f38734ec24 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Fri, 24 Nov 2023 17:09:22 +0100 Subject: [PATCH 2/5] NestedBoxReflection_geo.cpp: use std::abs instead of abs --- examples/ClientTests/src/NestedBoxReflection_geo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ClientTests/src/NestedBoxReflection_geo.cpp b/examples/ClientTests/src/NestedBoxReflection_geo.cpp index e38b6b755..9c4e933f0 100644 --- a/examples/ClientTests/src/NestedBoxReflection_geo.cpp +++ b/examples/ClientTests/src/NestedBoxReflection_geo.cpp @@ -36,7 +36,7 @@ namespace { constexpr double tol = 1.0e-3; // Geant4 compatible double check = (x.Cross(y)).Dot(z); // in case of a LEFT-handed orthogonal system this must be -1 - if (abs(1. + check) > tol) { + if (std::abs(1. + check) > tol) { except("NestedBoxReflection", "+++ FAILED to construct Rotation is not LEFT-handed!"); } printout(INFO, "NestedBoxReflection", "+++ Constructed LEFT-handed reflection rotation."); From fd78aa3cbbaef13f66c76791fd6626fe09a49b96 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Thu, 7 Dec 2023 17:01:19 +0100 Subject: [PATCH 3/5] DDSim: better logging of which sensitive detector is used when defaults are used --- DDG4/python/DDSim/DD4hepSimulation.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/DDG4/python/DDSim/DD4hepSimulation.py b/DDG4/python/DDSim/DD4hepSimulation.py index b0af0d847..ddc7b93a5 100644 --- a/DDG4/python/DDSim/DD4hepSimulation.py +++ b/DDG4/python/DDSim/DD4hepSimulation.py @@ -277,11 +277,13 @@ def getDetectorLists(self, detectorDescription): detType = sd.type() logger.info('getDetectorLists - found active detector %s type: %s', name, detType) if any(pat.lower() in detType.lower() for pat in self.action.trackerSDTypes): + logger.info('getDetectorLists - Identified %s as a tracker', name) trackers.append(det.name()) elif any(pat.lower() in detType.lower() for pat in self.action.calorimeterSDTypes): + logger.info('getDetectorLists - Identified %s as a calorimeter', name) calos.append(det.name()) else: - logger.warning('Unknown sensitive detector type: %s', detType) + logger.warning('getDetectorLists - Unknown sensitive detector type: %s', detType) unknown.append(det.name()) return trackers, calos, unknown @@ -464,13 +466,13 @@ def run(self): # get lists of trackers and calorimeters in detectorDescription trk, cal, unk = self.getDetectorLists(detectorDescription) - - for detectors, function, defFilter, abort in [(trk, geant4.setupTracker, self.filter.tracker, False), - (cal, geant4.setupCalorimeter, self.filter.calo, False), - (unk, geant4.setupDetector, None, True), - ]: + for detectors, function, defFilter, defAction, abort in \ + [(trk, geant4.setupTracker, self.filter.tracker, self.action.tracker, False), + (cal, geant4.setupCalorimeter, self.filter.calo, self.action.calo, False), + (unk, geant4.setupDetector, None, "No Default", True), + ]: try: - self.__setupSensitiveDetectors(detectors, function, defFilter, abort) + self.__setupSensitiveDetectors(detectors, function, defFilter, defAction, abort) except Exception as e: logger.error("Failed setting up sensitive detector %s", e) raise @@ -580,7 +582,7 @@ def __checkOutputLevel(self, level): return -1 def __setupSensitiveDetectors(self, detectors, setupFunction, defaultFilter=None, - abortForMissingAction=False, + defaultAction=None, abortForMissingAction=False, ): """Attach sensitive detector actions for all subdetectors. @@ -592,7 +594,7 @@ def __setupSensitiveDetectors(self, detectors, setupFunction, defaultFilter=None :param abortForMissingAction: if true end program if there is no action found """ for det in detectors: - logger.info('Setting up SD for %s', det) + logger.info('Setting up SD for %s with %s', det, defaultAction) action = None for pattern in self.action.mapActions: if pattern.lower() in det.lower(): From e0889e67cf502f277fec7770df3b013e78965991 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Mon, 11 Dec 2023 10:18:36 +0100 Subject: [PATCH 4/5] ClicSiD: use different stepper, try to solve issue in test, which fails due to bad accuracy --- examples/CLICSiD/sim/field.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CLICSiD/sim/field.xml b/examples/CLICSiD/sim/field.xml index 6ac71a42d..daee5488b 100644 --- a/examples/CLICSiD/sim/field.xml +++ b/examples/CLICSiD/sim/field.xml @@ -24,7 +24,7 @@ delta_one_step="0.001*mm" eps_min="5e-05*mm" eps_max="0.001*mm" - stepper="HelixSimpleRunge" + stepper="ClassicalRK4" equation="Mag_UsualEqRhs"> From eb029b717f8004ec79410cf9138dc380a7794d3e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 13 Dec 2023 18:32:57 -0500 Subject: [PATCH 5/5] README.md: fix a typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49f79a19d..688ee2fba 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ DD4hep is a software framework for providing a complete solution for full detect For information about how to install DD4hep see [this page](https://dd4hep.web.cern.ch/dd4hep/page/installation/) ## Documentation -Use's Manuals can be found [here](https://dd4hep.web.cern.ch/dd4hep/page/users-manual/). +User's Manuals can be found [here](https://dd4hep.web.cern.ch/dd4hep/page/users-manual/). The Code Reference can be found [here](https://dd4hep.web.cern.ch/dd4hep/reference/).