Skip to content

Commit

Permalink
Merge branch 'master' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusFrankATcernch authored Dec 14, 2023
2 parents 4ceeec9 + e0889e6 commit 01a9fb1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DDCore/src/segmentations/HexGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
20 changes: 11 additions & 9 deletions DDG4/python/DDSim/DD4hepSimulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion examples/CLICSiD/sim/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
</attributes>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion examples/ClientTests/src/NestedBoxReflection_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 01a9fb1

Please sign in to comment.