From 1962f7d1ace4484efb8886d66a6759a83c5107a3 Mon Sep 17 00:00:00 2001 From: Dhevan Gangadharan <43478603+dhevang@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:16:58 -0500 Subject: [PATCH 01/18] dumpBField: Extend usage to asymmetric ranges. (#1170) Co-authored-by: Andre Sailer --- UtilityApps/src/dumpBfield.cpp | 65 ++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/UtilityApps/src/dumpBfield.cpp b/UtilityApps/src/dumpBfield.cpp index 39d8fb65a..1b582c2d3 100644 --- a/UtilityApps/src/dumpBfield.cpp +++ b/UtilityApps/src/dumpBfield.cpp @@ -29,8 +29,9 @@ using namespace dd4hep::detail; static int invoke_dump_B_field(int argc, char** argv ){ if( argc != 8 ) { - std::cout << " usage: dumpBfield compact.xml x y z dx dy dz [in cm]" << std::endl - << " will dump the B-field in volume [-x:x,-y:y,-z,z] with steps [dx,dy,dz] " + std::cout << " usage: dumpBfield compact.xml xmin[:xmax] ymin[:ymax] zmin[:zmax] dx dy dz [in cm]" << std::endl + << " will dump the B-field in volume (xmin:xmax, ymin:ymax, zmin:zmax) with steps (dx,dy,dz). All values are in cm." + << " If a single value is given for a range, symmetric boundaries are used" << std::endl ; exit(1) ; @@ -41,12 +42,56 @@ static int invoke_dump_B_field(int argc, char** argv ){ std::stringstream sstr ; sstr << argv[2] << " " << argv[3] << " " << argv[4] << " " << argv[5] << " " << argv[6] << " " << argv[7] ; - float xRange , yRange , zRange , dx , dy, dz ; - sstr >> xRange >> yRange >> zRange >> dx >> dy >> dz; + std::string RangeX , RangeY , RangeZ; + float dx , dy, dz ; - xRange *= dd4hep::cm; - yRange *= dd4hep::cm; - zRange *= dd4hep::cm; + sstr >> RangeX >> RangeY >> RangeZ >> dx >> dy >> dz; + + size_t colon_posX = RangeX.find(':'); + size_t colon_posY = RangeY.find(':'); + size_t colon_posZ = RangeZ.find(':'); + + float minX=0, maxX=0, minY=0, maxY=0, minZ=0, maxZ=0; + + if( colon_posX == std::string::npos ) { + std::cout << "X Interval not specified as xmin:xmax" << std::endl + << " setting xmin = -xmax " << std::endl; + maxX = std::stof( RangeX ); + minX = -maxX; + } + else { + minX = std::stof( RangeX.substr(0, colon_posX) ); + maxX = std::stof( RangeX.substr(colon_posX+1) ); + } + + if( colon_posY == std::string::npos ) { + std::cout << "Y Interval not specified as ymin:ymax" << std::endl + << " setting ymin = -ymax " << std::endl; + maxY = std::stof( RangeY ); + minY = -maxY; + } + else { + minY = std::stof( RangeY.substr(0, colon_posY) ); + maxY = std::stof( RangeY.substr(colon_posY+1) ); + } + +if( colon_posZ == std::string::npos ) { + std::cout << "Z Interval not specified as zmin:zmax" << std::endl + << " setting zmin = -zmax " << std::endl; + maxZ = std::stof( RangeZ ); + minZ = -maxZ; + } + else { + minZ = std::stof( RangeZ.substr(0, colon_posZ) ); + maxZ = std::stof( RangeZ.substr(colon_posZ+1) ); + } + + minX *= dd4hep::cm; + maxX *= dd4hep::cm; + minY *= dd4hep::cm; + maxY *= dd4hep::cm; + minZ *= dd4hep::cm; + maxZ *= dd4hep::cm; dx *= dd4hep::cm; dy *= dd4hep::cm; dz *= dd4hep::cm; @@ -57,9 +102,9 @@ static int invoke_dump_B_field(int argc, char** argv ){ printf("#######################################################################################################\n"); printf(" x[cm] y[cm] z[cm] Bx[Tesla] By[Tesla] Bz[Tesla] \n"); - for( float x = -xRange ; x <=xRange ; x += dx ){ - for( float y = -yRange ; y <=yRange ; y += dy ){ - for( float z = -zRange ; z <=zRange ; z += dz ){ + for( float x = minX ; x <= maxX ; x += dx ){ + for( float y = minY ; y <= maxY ; y += dy ){ + for( float z = minZ ; z <= maxZ ; z += dz ){ double posV[3] = { x, y, z } ; double bfieldV[3] ; From 0c222649d04686a5e915da07c5cca8c7d95e4b74 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Wed, 11 Oct 2023 14:44:22 +0200 Subject: [PATCH 02/18] G4VTouchable: for Geant4 11.1.ref09 cannot forward declare the class any more --- DDG4/include/DDG4/Geant4SensDetAction.h | 2 +- DDG4/include/DDG4/Geant4TouchableHandler.h | 3 ++- DDG4/include/DDG4/Geant4VolumeManager.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DDG4/include/DDG4/Geant4SensDetAction.h b/DDG4/include/DDG4/Geant4SensDetAction.h index a192bc366..c15040281 100644 --- a/DDG4/include/DDG4/Geant4SensDetAction.h +++ b/DDG4/include/DDG4/Geant4SensDetAction.h @@ -20,6 +20,7 @@ // Geant4 include files #include +#include // C/C++ include files #include @@ -28,7 +29,6 @@ class G4HCofThisEvent; class G4Step; class G4Event; -class G4VTouchable; class G4TouchableHistory; class G4VHitsCollection; class G4VReadOutGeometry; diff --git a/DDG4/include/DDG4/Geant4TouchableHandler.h b/DDG4/include/DDG4/Geant4TouchableHandler.h index 042f30405..0be5a58c1 100644 --- a/DDG4/include/DDG4/Geant4TouchableHandler.h +++ b/DDG4/include/DDG4/Geant4TouchableHandler.h @@ -13,13 +13,14 @@ #ifndef DDG4_GEANT4TOUCHABLEHANDLER_H #define DDG4_GEANT4TOUCHABLEHANDLER_H +#include + // C/C++ include files #include #include // Forward declarations class G4VPhysicalVolume; -class G4VTouchable; class G4Step; /// Namespace for the AIDA detector description toolkit diff --git a/DDG4/include/DDG4/Geant4VolumeManager.h b/DDG4/include/DDG4/Geant4VolumeManager.h index 6cbee9517..02027ad3e 100644 --- a/DDG4/include/DDG4/Geant4VolumeManager.h +++ b/DDG4/include/DDG4/Geant4VolumeManager.h @@ -18,8 +18,8 @@ #include #include +#include // Geant4 forward declarations -class G4VTouchable; class G4VPhysicalVolume; From fbc39bbbcb1e1590dd270dff5ee8cd66879d5a9a Mon Sep 17 00:00:00 2001 From: Markus Frank Date: Mon, 9 Oct 2023 16:28:57 +0200 Subject: [PATCH 03/18] Allow to load CAD files with relative path w/r to declaring xml file (Issue 1166) --- DDCAD/src/plugins/CADPlugins.cpp | 31 +++++++++++++++++-- examples/DDCAD/CMakeLists.txt | 2 +- .../compact/Check_Shape_RelativePath.xml | 30 ++++++++++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 examples/DDCAD/compact/Check_Shape_RelativePath.xml diff --git a/DDCAD/src/plugins/CADPlugins.cpp b/DDCAD/src/plugins/CADPlugins.cpp index 8a646ebe9..17f9c037a 100644 --- a/DDCAD/src/plugins/CADPlugins.cpp +++ b/DDCAD/src/plugins/CADPlugins.cpp @@ -20,11 +20,36 @@ #include // C/C++ include files +#include using namespace std; using namespace dd4hep; using namespace dd4hep::detail; +/// If the path to the CAD file does not directly exist try to resolve it: +static string resolve_path(xml_h e, const string& file) { + error_code errc; + std::string fname; + /// Use the xml utilities in the DocumentHandler to resolve the relative path + if ( file.length() > 7 && file.substr(0,7) == "file://" ) + fname = file.substr(7); + else + fname = file; + if ( !filesystem::exists(fname, errc) ) { + string fn = xml::DocumentHandler::system_path(e, fname); + if ( fn.length() > 7 && fn.substr(0,7) == "file://" ) + fn = fn.substr(7); + if ( !std::filesystem::exists(fn, errc) ) { + auto fp = filesystem::path(xml::DocumentHandler::system_path(e)).parent_path(); + except("CAD_Shape","+++ CAD file: %s (= %s + %s) is not accessible [%d: %s]", + fn.c_str(), fp.c_str(), fname.c_str(), + errc.value(), errc.message().c_str()); + } + return fn; + } + return fname; +} + static void* read_CAD_Volume(Detector& dsc, int argc, char** argv) { string fname; double scale = 1.0; @@ -61,7 +86,7 @@ DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_read_CAD_volumes,read_CAD_Volume) static Handle create_CAD_Shape(Detector& dsc, xml_h e) { xml_elt_t elt(e); cad::ASSIMPReader rdr(dsc); - string fname = elt.attr(_U(ref)); + string fname = resolve_path(e, elt.attr(_U(ref))); long flags = elt.hasAttr(_U(flags)) ? elt.attr(_U(flags)) : 0; double unit = elt.hasAttr(_U(unit)) ? elt.attr(_U(unit)) : dd4hep::cm; @@ -97,7 +122,7 @@ DECLARE_XML_SHAPE(CAD_Shape__shape_constructor,create_CAD_Shape) static Handle create_CAD_Assembly(Detector& dsc, xml_h e) { xml_elt_t elt(e); - string fname = elt.attr(_U(ref)); + string fname = resolve_path(e, elt.attr(_U(ref))); double unit = elt.hasAttr(_U(unit)) ? elt.attr(_U(unit)) : dd4hep::cm; auto volumes = cad::ASSIMPReader(dsc).readVolumes(fname, unit); if ( volumes.empty() ) { @@ -159,8 +184,8 @@ DECLARE_XML_VOLUME(CAD_Assembly__volume_constructor,create_CAD_Assembly) */ static Handle create_CAD_Volume(Detector& dsc, xml_h e) { xml_elt_t elt(e); - string fname = elt.attr(_U(ref)); double unit = elt.attr(_U(unit)); + string fname = resolve_path(e, elt.attr(_U(ref))); long flags = elt.hasAttr(_U(flags)) ? elt.attr(_U(flags)) : 0; cad::ASSIMPReader rdr(dsc); diff --git a/examples/DDCAD/CMakeLists.txt b/examples/DDCAD/CMakeLists.txt index 91f2d8a2f..0d9e38ec7 100644 --- a/examples/DDCAD/CMakeLists.txt +++ b/examples/DDCAD/CMakeLists.txt @@ -72,7 +72,7 @@ endforeach() # # Multi-shape tests # Not working: OBJ_spider -list(APPEND DDCAD_Tests_MV COB_dwarf MS3D_jeep) +list(APPEND DDCAD_Tests_MV COB_dwarf MS3D_jeep RelativePath) foreach (test ${DDCAD_Tests_MV}) dd4hep_add_test_reg( DDCAD_Check_Shape_${test} COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCAD.sh" diff --git a/examples/DDCAD/compact/Check_Shape_RelativePath.xml b/examples/DDCAD/compact/Check_Shape_RelativePath.xml new file mode 100644 index 000000000..39b1627b2 --- /dev/null +++ b/examples/DDCAD/compact/Check_Shape_RelativePath.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + From 8e1d0be969e6401a67cd2aa4eb3bdb00db44e86b Mon Sep 17 00:00:00 2001 From: Alvaro Tolosa Delgado Date: Mon, 16 Oct 2023 20:48:35 +0200 Subject: [PATCH 04/18] Typo in printout fixed --- DDG4/python/DDSim/Helper/Gun.py | 2 +- DDTest/python/userSteeringFile.PY | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DDG4/python/DDSim/Helper/Gun.py b/DDG4/python/DDSim/Helper/Gun.py index 608b41f7c..c3cfb7cf7 100644 --- a/DDG4/python/DDSim/Helper/Gun.py +++ b/DDG4/python/DDSim/Helper/Gun.py @@ -35,7 +35,7 @@ def __init__(self): self.momentumMin = 0 * GeV self._momentumMax_EXTRA = {'help': "Maximal momentum when using distribution (default = 0.0)"} self.momentumMax = 10 * GeV - self._energy_EXTRA = {'help': "The kinetic energy for the particle gun.\n\n" + self._energy_EXTRA = {'help': "Total energy (including mass) for the particle gun.\n\n" "If not None, it will overwrite the setting of momentumMin and momentumMax"} self.energy = None diff --git a/DDTest/python/userSteeringFile.PY b/DDTest/python/userSteeringFile.PY index e21e6e66c..11a8eee6e 100644 --- a/DDTest/python/userSteeringFile.PY +++ b/DDTest/python/userSteeringFile.PY @@ -211,7 +211,7 @@ SIM.gun.direction = (0, 0, 1) ## SIM.gun.distribution = None -## The kinetic energy for the particle gun. +## Total energy (including mass) for the particle gun. ## ## If not None, it will overwrite the setting of momentumMin and momentumMax SIM.gun.energy = None From 88ed20d5fbf8970852ac6f462ccc63f8a626dc5d Mon Sep 17 00:00:00 2001 From: Markus Frank Date: Wed, 18 Oct 2023 11:29:28 +0200 Subject: [PATCH 05/18] Allow for XML processing of files relative to xml tag location (See issue https://github.com/AIDASoft/DD4hep/issues/1180 for details) --- DDCore/src/plugins/Compact2Objects.cpp | 33 ++++++++++++++++--- .../ClientTests/compact/IncludePlugins.xml | 4 +++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/DDCore/src/plugins/Compact2Objects.cpp b/DDCore/src/plugins/Compact2Objects.cpp index aae992573..20a286f2b 100644 --- a/DDCore/src/plugins/Compact2Objects.cpp +++ b/DDCore/src/plugins/Compact2Objects.cpp @@ -50,9 +50,10 @@ #include // C/C++ include files -#include +#include #include #include +#include #include using namespace std; @@ -1443,17 +1444,38 @@ template <> void Converter::operator()(xml_h element) const { template <> void Converter::operator()(xml_h element) const { string base = xml::DocumentHandler::system_directory(element); string file = element.attr(_U(ref)); - vector argv{&file[0],&base[0]}; + vector argv{&file[0], &base[0]}; description.apply("DD4hep_JsonProcessor",int(argv.size()), &argv[0]); } /// Read alignment entries from a seperate file in one of the include sections of the geometry template <> void Converter::operator()(xml_h element) const { + PrintLevel level = s_debug.includes ? ALWAYS : DEBUG; string fname = element.attr(_U(ref)); - if ( s_debug.includes ) { - printout(ALWAYS, "Compact","++ Processing xml document %s.", fname.c_str()); + size_t idx = fname.find("://"); + std::error_code ec; + + if ( idx == string::npos && filesystem::exists(fname, ec) ) { + // Regular file without protocol specification + printout(level, "Compact","++ Processing xml document %s.", fname.c_str()); + this->description.fromXML(fname); + } + else if ( idx == string::npos ) { + // File relative to location of xml tag (protocol specification not possible) + string location = xml::DocumentHandler::system_path(element, fname); + printout(level, "Compact","++ Processing xml document %s.", location.c_str()); + this->description.fromXML(location); + } + else if ( idx > 0 ) { + // File with protocol specification: must trust the location and the parser capabilities + printout(level, "Compact","++ Processing xml document %s.", fname.c_str()); + this->description.fromXML(fname); + } + else { + // Are there any other possibilities ? + printout(level, "Compact","++ Processing xml document %s.", fname.c_str()); + this->description.fromXML(fname); } - this->description.fromXML(fname); } /// Read material entries from a seperate file in one of the include sections of the geometry @@ -1716,6 +1738,7 @@ template <> void Converter::operator()(xml_h element) const { } xml_coll_t(compact, _U(plugins)).for_each(_U(plugin), Converter (description)); xml_coll_t(compact, _U(plugins)).for_each(_U(include), Converter (description)); + xml_coll_t(compact, _U(plugins)).for_each(_U(xml), Converter (description)); } #ifdef _WIN32 diff --git a/examples/ClientTests/compact/IncludePlugins.xml b/examples/ClientTests/compact/IncludePlugins.xml index b527abfb0..08a00248b 100644 --- a/examples/ClientTests/compact/IncludePlugins.xml +++ b/examples/ClientTests/compact/IncludePlugins.xml @@ -42,6 +42,10 @@ + + + + From 611633c01da573aac5e968d961c5783e4d1d3523 Mon Sep 17 00:00:00 2001 From: Alvaro Tolosa Delgado Date: Sat, 30 Sep 2023 21:10:50 +0200 Subject: [PATCH 06/18] Kill photons as soon they enter into a OpticalTracker --- DDG4/plugins/Geant4SDActions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DDG4/plugins/Geant4SDActions.cpp b/DDG4/plugins/Geant4SDActions.cpp index c9bc75ecd..a16796513 100644 --- a/DDG4/plugins/Geant4SDActions.cpp +++ b/DDG4/plugins/Geant4SDActions.cpp @@ -163,7 +163,7 @@ namespace dd4hep { double hit_deposit = contrib.deposit; Hit* hit = new Hit(contrib, hit_momentum, hit_deposit); - if (h.trackDef() != G4OpticalPhoton::OpticalPhotonDefinition()) { + if (h.trackDef() == G4OpticalPhoton::OpticalPhotonDefinition()) { step->GetTrack()->SetTrackStatus(fStopAndKill); } hit->cellID = cellID(step); From 2d4845fa729b7837dd573f780cd4614a5fff723a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 26 Jul 2023 11:57:34 -0500 Subject: [PATCH 07/18] feat: add m_detectorTypes[""]={} to return on failed lookup --- DDCore/src/DetectorImp.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DDCore/src/DetectorImp.cpp b/DDCore/src/DetectorImp.cpp index ee1680a62..9ab77d86d 100644 --- a/DDCore/src/DetectorImp.cpp +++ b/DDCore/src/DetectorImp.cpp @@ -540,6 +540,7 @@ Material DetectorImp::material(const string& name) const { /// Internal helper to map detector types once the geometry is closed void DetectorImp::mapDetectorTypes() { + m_detectorTypes[""] = {}; for( const auto& i : m_detectors ) { DetElement det(i.second); if ( det.parent().isValid() ) { // Exclude 'world' @@ -573,13 +574,13 @@ vector DetectorImp::detectorTypes() const { /// Access a set of subdetectors according to the sensitive type. const vector& DetectorImp::detectors(const string& type, bool throw_exc) { if ( m_manager->IsClosed() ) { + DetectorTypeMap::const_iterator i=m_detectorTypes.find(type); + if ( i != m_detectorTypes.end() ) return (*i).second; if ( throw_exc ) { - DetectorTypeMap::const_iterator i=m_detectorTypes.find(type); - if ( i != m_detectorTypes.end() ) return (*i).second; throw runtime_error("detectors("+type+"): Detectors of this type do not exist in the current setup!"); } // return empty vector instead of exception - return m_detectorTypes[ type ] ; + return m_detectorTypes.at("") ; } throw runtime_error("detectors("+type+"): Detectors can only selected by type once the geometry is closed!"); } From 80f65934efa6fc502986f51d5b2a44e9b5c6ab84 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 26 Jul 2023 11:58:41 -0500 Subject: [PATCH 08/18] feat: make Detector::detectors(type, throw_exc) const --- DDCore/include/DD4hep/Detector.h | 2 +- DDCore/include/DD4hep/DetectorImp.h | 2 +- DDCore/src/DetectorImp.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DDCore/include/DD4hep/Detector.h b/DDCore/include/DD4hep/Detector.h index 46a4c0d95..76d8b8021 100644 --- a/DDCore/include/DD4hep/Detector.h +++ b/DDCore/include/DD4hep/Detector.h @@ -194,7 +194,7 @@ namespace dd4hep { is not present. Otherwise an empty detector container is returned. */ virtual const std::vector& detectors(const std::string& type, - bool throw_exc=false) = 0; + bool throw_exc=false) const = 0; /// Access a set of subdetectors according to several sensitive types. virtual std::vector detectors(const std::string& type1, diff --git a/DDCore/include/DD4hep/DetectorImp.h b/DDCore/include/DD4hep/DetectorImp.h index 175940116..37dae4c5f 100644 --- a/DDCore/include/DD4hep/DetectorImp.h +++ b/DDCore/include/DD4hep/DetectorImp.h @@ -320,7 +320,7 @@ namespace dd4hep { - If throw_exc is set to true, an exception is thrown if the type is not present. Otherwise an empty detector container is returned. */ - virtual const std::vector& detectors(const std::string& type, bool throw_exc) override; + virtual const std::vector& detectors(const std::string& type, bool throw_exc) const override; /// Access a set of subdetectors according to several sensitive types. virtual std::vector detectors(const std::string& type1, diff --git a/DDCore/src/DetectorImp.cpp b/DDCore/src/DetectorImp.cpp index 9ab77d86d..7e5eeb4d3 100644 --- a/DDCore/src/DetectorImp.cpp +++ b/DDCore/src/DetectorImp.cpp @@ -572,7 +572,7 @@ vector DetectorImp::detectorTypes() const { } /// Access a set of subdetectors according to the sensitive type. -const vector& DetectorImp::detectors(const string& type, bool throw_exc) { +const vector& DetectorImp::detectors(const string& type, bool throw_exc) const { if ( m_manager->IsClosed() ) { DetectorTypeMap::const_iterator i=m_detectorTypes.find(type); if ( i != m_detectorTypes.end() ) return (*i).second; From f6d10f9a80c4bd29065224af75c89075e0effdfb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 26 Jul 2023 11:59:55 -0500 Subject: [PATCH 09/18] feat: use const Detector in several DDRec constructors --- DDRec/include/DDRec/CellIDPositionConverter.h | 2 +- DDRec/include/DDRec/MaterialScan.h | 4 ++-- DDRec/include/DDRec/SurfaceManager.h | 4 ++-- DDRec/src/MaterialScan.cpp | 2 +- DDRec/src/SurfaceManager.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DDRec/include/DDRec/CellIDPositionConverter.h b/DDRec/include/DDRec/CellIDPositionConverter.h index 5a9b2fbc5..7aace1d09 100644 --- a/DDRec/include/DDRec/CellIDPositionConverter.h +++ b/DDRec/include/DDRec/CellIDPositionConverter.h @@ -48,7 +48,7 @@ namespace dd4hep { public: /// The constructor - takes the main description object. - CellIDPositionConverter( Detector& description ) : _description( &description ) { + CellIDPositionConverter(const Detector& description ) : _description( &description ) { _volumeManager = VolumeManager::getVolumeManager(description); } diff --git a/DDRec/include/DDRec/MaterialScan.h b/DDRec/include/DDRec/MaterialScan.h index 512619026..31dc4ebc5 100644 --- a/DDRec/include/DDRec/MaterialScan.h +++ b/DDRec/include/DDRec/MaterialScan.h @@ -53,7 +53,7 @@ namespace dd4hep { private: /// Reference to detector setup - Detector& m_detector; + const Detector& m_detector; /// Material manager std::unique_ptr m_materialMgr; //! /// Local cache: subdetector placements @@ -64,7 +64,7 @@ namespace dd4hep { public: /// Standard constructor for the master instance - MaterialScan(Detector& description); + MaterialScan(const Detector& description); /// Default destructor virtual ~MaterialScan(); diff --git a/DDRec/include/DDRec/SurfaceManager.h b/DDRec/include/DDRec/SurfaceManager.h index 227645725..eb6d5b210 100644 --- a/DDRec/include/DDRec/SurfaceManager.h +++ b/DDRec/include/DDRec/SurfaceManager.h @@ -38,7 +38,7 @@ namespace dd4hep { public: /// The constructor - SurfaceManager(Detector& theDetector); + SurfaceManager(const Detector& theDetector); /// No default constructor #if defined(G__ROOT) @@ -69,7 +69,7 @@ namespace dd4hep { /// initialize all known surface maps - void initialize(Detector& theDetector) ; + void initialize(const Detector& theDetector) ; SurfaceMapsMap _map ; }; diff --git a/DDRec/src/MaterialScan.cpp b/DDRec/src/MaterialScan.cpp index d2969755c..cf1e7849e 100644 --- a/DDRec/src/MaterialScan.cpp +++ b/DDRec/src/MaterialScan.cpp @@ -35,7 +35,7 @@ MaterialScan::MaterialScan() } /// Default constructor -MaterialScan::MaterialScan(Detector& description) +MaterialScan::MaterialScan(const Detector& description) : m_detector(description) { m_materialMgr.reset(new MaterialManager(m_detector.world().volume())); diff --git a/DDRec/src/SurfaceManager.cpp b/DDRec/src/SurfaceManager.cpp index fd83a4d08..2576ebb41 100644 --- a/DDRec/src/SurfaceManager.cpp +++ b/DDRec/src/SurfaceManager.cpp @@ -25,7 +25,7 @@ namespace dd4hep { namespace rec { - SurfaceManager::SurfaceManager(Detector& theDetector){ + SurfaceManager::SurfaceManager(const Detector& theDetector){ // have to make sure the volume manager is populated once in order to have // the volumeIDs attached to the DetElements @@ -52,7 +52,7 @@ namespace dd4hep { return 0 ; } - void SurfaceManager::initialize(Detector& description) { + void SurfaceManager::initialize(const Detector& description) { const std::vector& types = description.detectorTypes() ; From d1bad7c5d0fde50aa8ab8d39d2ead838de18a597 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 24 Oct 2023 17:07:48 +0200 Subject: [PATCH 10/18] Release Notes for v01-27 --- doc/ReleaseNotes.md | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/doc/ReleaseNotes.md b/doc/ReleaseNotes.md index d83a2f7e9..2520513ff 100644 --- a/doc/ReleaseNotes.md +++ b/doc/ReleaseNotes.md @@ -1,3 +1,84 @@ +# v01-27 + +* 2023-10-19 Alvaro Tolosa Delgado ([PR#1174](https://github.com/aidasoft/dd4hep/pull/1174)) + - Geant4OpticalTracker: Kill optical photons (instead of all other particles) as soon they enter into a Optical Tracker sensitive detector + +* 2023-10-19 Wouter Deconinck ([PR#1148](https://github.com/aidasoft/dd4hep/pull/1148)) + - Allow several DDRec c'tors to work on `const Detector&` instead of `Detector&` + +* 2023-10-18 Markus Frank ([PR#1181](https://github.com/aidasoft/dd4hep/pull/1181)) + Allow for XML processing of files relative to xml tag location: + - For some tags the relative placement of include files was not possible. + This pull request is supposed to close these missing include features. + - See issue https://github.com/AIDASoft/DD4hep/issues/1180 for details) + - See the examples ClientTests: minitel_config_plugins_include_command_xml + with the compact file ClientTests/compact/IncludePlugins.xml for an example. + +* 2023-10-17 Alvaro Tolosa Delgado ([PR#1179](https://github.com/aidasoft/dd4hep/pull/1179)) + - DDSim: Corrected documentation of `--gun.energy`. This corresponds to the total energy including the mass of the particle + +* 2023-10-11 Andre Sailer ([PR#1176](https://github.com/aidasoft/dd4hep/pull/1176)) + - DDG4: G4VTouchable: for Geant4 11.1.ref09 cannot forward declare the class any more + +* 2023-10-11 Markus Frank ([PR#1175](https://github.com/aidasoft/dd4hep/pull/1175)) + - Handle request from issue 1166: Allow to load CAD files with relative path w/r to declaring xml file + - Add illustrating example: t_DDCAD_Check_Shape_RelativePath + +* 2023-09-20 Dhevan Gangadharan ([PR#1170](https://github.com/aidasoft/dd4hep/pull/1170)) + - Extend usage of dumpBfield to asymmetric X,Y,Z ranges. + +* 2023-09-20 Sebouh Paul ([PR#1161](https://github.com/aidasoft/dd4hep/pull/1161)) + - DDSegmentation: added segmentation HexGrid for hexagonal segmentation + - DDSegmentation: added CartesionGridXYStaggered for rectangular segmentation that can be staggered for every other layer + +* 2023-09-19 Dmitry Kalinkin ([PR#1171](https://github.com/aidasoft/dd4hep/pull/1171)) + + +* 2023-09-15 jmcarcell ([PR#1169](https://github.com/aidasoft/dd4hep/pull/1169)) + - CMake: DDG4: Check if the CLHEP target exists before creating it in DD4hepBuild.cmake, since if it exists cmake will error. + +* 2023-09-15 Wouter Deconinck ([PR#1168](https://github.com/aidasoft/dd4hep/pull/1168)) + - ddsim: handle run header exception when the user has no username. + +* 2023-08-31 Dmitry Kalinkin ([PR#1165](https://github.com/aidasoft/dd4hep/pull/1165)) + - DDG4: HepMC3Input: Fix loading of run info for RootTree HepMC3 input format + +* 2023-08-25 Andre Sailer ([PR#1162](https://github.com/aidasoft/dd4hep/pull/1162)) + - DDEve Webdisplay: fix issue with ROOT master with RGeomViewer no longer being in the experimental namespace. + +* 2023-08-24 Andre Sailer ([PR#1160](https://github.com/aidasoft/dd4hep/pull/1160)) + - SiliconBlockGFlash: add maximal energy for using parametrisation, for electron and positron, fixes #1153 + +* 2023-08-24 Markus Frank ([PR#1155](https://github.com/aidasoft/dd4hep/pull/1155)) + - Implement correct transparency handling of ROOT: + The transparency setting was connected to the material of the volume. + This led to the same transparency setting for all volumes of the same material. + It was not possible to change them at the level of the volume though + the API suggested so. + See: https://github.com/AIDASoft/DD4hep/issues/1117 + See: https://github.com/root-project/root/pull/13402 + - Add test examples/ClientTests/compact/visTestEx.xml and visTest.xml. + From the inversion of tubes with the same material, for ROOT >= 6.29 + the correct transparency settings are shown, whereas for ROOT < 6.29 + the transparency settings are the same for all volumes. + Also see scripts/visTest.C + +* 2023-08-23 Ben Couturier ([PR#1159](https://github.com/aidasoft/dd4hep/pull/1159)) + - Improved _getEnviron to deal with the case when multiple variables are to be evaluated in the string + +* 2023-08-22 Dmitry Kalinkin ([PR#1158](https://github.com/aidasoft/dd4hep/pull/1158)) + - DDSim: Fix reading HepMC3 input files via xrootd, fixes #1156 + +* 2023-08-22 Wouter Deconinck ([PR#1157](https://github.com/aidasoft/dd4hep/pull/1157)) + - Geant4Output2EDM4hep: allow use of identical collection names across multiple detectors + +* 2023-08-04 Andre Sailer ([PR#1152](https://github.com/aidasoft/dd4hep/pull/1152)) + - CI: use clang16 for header guards check + +* 2023-08-04 jmcarcell ([PR#1151](https://github.com/aidasoft/dd4hep/pull/1151)) + - Limits object: fix string creation of Limit::toString, this will now also print the relevant "particles" + - Shapes: remove "move" from return of dimensions() + # v01-26 * 2023-07-24 Andre Sailer ([PR#1147](https://github.com/aidasoft/DD4hep/pull/1147)) From ff4c726c90084b378cd9dc413ae2114e829002a7 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 24 Oct 2023 17:07:49 +0200 Subject: [PATCH 11/18] Updating version to v01-27 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbb371111..1ada9cbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ SET_PROPERTY(DIRECTORY . PROPERTY PACKAGE_NAME DD4hep) ################# SET( DD4hep_VERSION_MAJOR 1 ) -SET( DD4hep_VERSION_MINOR 26 ) +SET( DD4hep_VERSION_MINOR 27 ) SET( DD4hep_VERSION_PATCH 0 ) ####################### From ef0e4c63f2e84735b822ac730caaf6dca37ea3fb Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 27 Oct 2023 10:54:18 -0400 Subject: [PATCH 12/18] Move DECLARE_SEGMENTATIONs for CartesianGridXYStaggered and HexGrid to ReadoutSegmentations This fixes runtime errors like: libc++abi: __cxa_guard_acquire detected recursive initialization --- DDCore/src/plugins/ReadoutSegmentations.cpp | 6 ++++++ DDCore/src/segmentations/CartesianGridXYStaggered.cpp | 4 ---- DDCore/src/segmentations/HexGrid.cpp | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DDCore/src/plugins/ReadoutSegmentations.cpp b/DDCore/src/plugins/ReadoutSegmentations.cpp index 7462e7d93..578c3bfbb 100644 --- a/DDCore/src/plugins/ReadoutSegmentations.cpp +++ b/DDCore/src/plugins/ReadoutSegmentations.cpp @@ -40,6 +40,9 @@ DECLARE_SEGMENTATION(CartesianGridYZ,create_segmentation) +#include "DDSegmentation/CartesianGridXYStaggered.h" +DECLARE_SEGMENTATION(CartesianGridXYStaggered,dd4hep::create_segmentation) + #include "DDSegmentation/CartesianStripX.h" DECLARE_SEGMENTATION(CartesianStripX,create_segmentation) @@ -75,3 +78,6 @@ DECLARE_SEGMENTATION(ProjectiveCylinder,create_segmentation) + +#include "DDSegmentation/HexGrid.h" +DECLARE_SEGMENTATION(HexGrid,create_segmentation) diff --git a/DDCore/src/segmentations/CartesianGridXYStaggered.cpp b/DDCore/src/segmentations/CartesianGridXYStaggered.cpp index 871958ffe..69cf77236 100644 --- a/DDCore/src/segmentations/CartesianGridXYStaggered.cpp +++ b/DDCore/src/segmentations/CartesianGridXYStaggered.cpp @@ -96,7 +96,3 @@ std::vector CartesianGridXYStaggered::cellDimensions(const CellID& cellI } /* namespace DDSegmentation */ } /* namespace dd4hep */ - -// This is done DDCore/src/plugins/ReadoutSegmentations.cpp so the plugin is not part of libDDCore -// needs also #include "DD4hep/Factories.h" -// DECLARE_SEGMENTATION(CartesianGridXYStaggered,dd4hep::create_segmentation) diff --git a/DDCore/src/segmentations/HexGrid.cpp b/DDCore/src/segmentations/HexGrid.cpp index f051a8f61..0e9224e52 100644 --- a/DDCore/src/segmentations/HexGrid.cpp +++ b/DDCore/src/segmentations/HexGrid.cpp @@ -145,5 +145,3 @@ namespace dd4hep { } /* namespace DDSegmentation */ } /* namespace dd4hep */ - -DECLARE_SEGMENTATION(HexGrid, create_segmentation) From 740772f9f799450504d69c91736f876581f071df Mon Sep 17 00:00:00 2001 From: Markus Frank Date: Thu, 16 Nov 2023 16:38:53 +0100 Subject: [PATCH 13/18] Allow to set visualization depth to teveDisplay --- UtilityApps/src/run_plugin.h | 10 +++--- UtilityApps/src/teve_display.cpp | 56 ++++++++++++++++++++++---------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/UtilityApps/src/run_plugin.h b/UtilityApps/src/run_plugin.h index a62a84890..a0c2cf274 100644 --- a/UtilityApps/src/run_plugin.h +++ b/UtilityApps/src/run_plugin.h @@ -220,11 +220,11 @@ namespace { std::cout << "]" << std::endl << std::flush; } if ( name && name[0] ) { - result = run_plugin(description, name, a.first, a.second); - return result; + result = run_plugin(description, name, a.first, a.second); + return result; } std::cout << "WARNING: run_plugin: No plugin name supplied. " - << "Implicitly assuming execution steered by XML." << std::endl; + << "Implicitly assuming execution steered by XML." << std::endl; return ENOENT; } }; @@ -279,7 +279,7 @@ namespace dd4hep { } else { result = args.run(description, name); - } + } if ( result == EINVAL ) usage_default(name); } else { @@ -329,7 +329,7 @@ namespace dd4hep { !arguments.ui && !arguments.interpreter && arguments.plugins.empty() && - arguments.geo_files.empty() ) + arguments.geo_files.empty() ) { usage_plugin_runner(); } diff --git a/UtilityApps/src/teve_display.cpp b/UtilityApps/src/teve_display.cpp index 962997988..4272f279c 100644 --- a/UtilityApps/src/teve_display.cpp +++ b/UtilityApps/src/teve_display.cpp @@ -65,21 +65,32 @@ TEveStraightLineSet* getSurfaceVectors(bool addO=true, bool addU= true, bool add //===================================================================================== -static long teve_display(Detector& description, int /* argc */, char** /* argv */) { +static long teve_display(Detector& description, int argc, char** argv) { + int level = 4, visopt = 0, help = 0; + for( int i=0; i Visualization level [TGeoManager::SetVisLevel] Default: 4 \n" + " -visopt Visualization option [TGeoManager::SetVisOption] Default: 0 \n" + " -help Print this help output" << std::endl << std::flush; + ::exit(EINVAL); + } + TGeoManager* mgr = &description.manager(); mgr->SetNsegments(100); // Increase the visualization resolution. TEveManager::Create(); - // mgr->SetVisOption(1) ; - // mgr->SetVisLevel(4) ; - - // gEve->fGeometries->Add(new TObjString("DefaultGeometry"),mgr); - TEveGeoTopNode* tn = new TEveGeoTopNode(mgr, mgr->GetTopNode()); // option 0 in TEve seems to correspond to option 1 in TGeo ( used in geoDisplay ...) - tn->SetVisOption(0) ; - tn->SetVisLevel(4); + tn->SetVisOption(visopt) ; + tn->SetVisLevel(level); // // ---- try to set transparency - does not seem to work ... // TGeoNode* node1 = gGeoManager->GetTopNode(); @@ -130,13 +141,9 @@ static long teve_display(Detector& description, int /* argc */, char** /* argv * MultiView::instance()->ImportGeomRPhi( helperSurfaces ); MultiView::instance()->ImportGeomRhoZ( helperSurfaces ) ; - make_gui(); - next_event(); - gEve->FullRedraw3D(kTRUE); - return 1; } DECLARE_APPLY(DD4hepTEveDisplay,teve_display) @@ -145,18 +152,31 @@ DECLARE_APPLY(DD4hepTEveDisplay,teve_display) //===================================================================================================================== int main(int argc,char** argv) { - return dd4hep::execute::main_default("DD4hepTEveDisplay",argc,argv); + std::vector av; + std::string level, visopt, opt; + bool help = false; + for( int i=0; i Date: Sat, 18 Nov 2023 17:34:10 -0600 Subject: [PATCH 14/18] fix: use TROOT::GetIconPath instead of $ROOTSYS/icons --- DDEve/src/Display.cpp | 5 +++++ DDEve/src/EventControl.cpp | 5 +++++ DDEve/src/GenericEventHandler.cpp | 9 +++++++++ UtilityApps/src/teve_display.cpp | 5 +++++ 4 files changed, 24 insertions(+) diff --git a/DDEve/src/Display.cpp b/DDEve/src/Display.cpp index 1f98aa84c..140ce924a 100644 --- a/DDEve/src/Display.cpp +++ b/DDEve/src/Display.cpp @@ -30,6 +30,7 @@ #include "DD4hep/Printout.h" // ROOT include files +#include "TROOT.h" #include "TH2.h" #include "TFile.h" #include "TSystem.h" @@ -270,7 +271,11 @@ void Display::UnregisterEvents(View* view) { /// Open standard message box void Display::MessageBox(PrintLevel level, const string& text, const string& title) const { +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2) + string path = TString::Format("%s/", TROOT::GetIconPath().Data()).Data(); +#else string path = TString::Format("%s/icons/", gSystem->Getenv("ROOTSYS")).Data(); +#endif const TGPicture* pic = 0; if ( level == VERBOSE ) pic = client().GetPicture((path+"mb_asterisk_s.xpm").c_str()); diff --git a/DDEve/src/EventControl.cpp b/DDEve/src/EventControl.cpp index a41add5d0..a5c9e4ad9 100644 --- a/DDEve/src/EventControl.cpp +++ b/DDEve/src/EventControl.cpp @@ -18,6 +18,7 @@ #include "DD4hep/InstanceCount.h" // ROOT include files +#include #include #include #include @@ -158,7 +159,11 @@ void EventControl::OnNewEvent(EventHandler& handler) { /// User callback to add elements to the control void EventControl::OnBuild() { +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2) + string icondir = TString::Format("%s/", TROOT::GetIconPath().Data()).Data(); +#else string icondir = TString::Format("%s/icons/", gSystem->Getenv("ROOTSYS")).Data(); +#endif TGGroupFrame* group = new TGGroupFrame(m_frame,"Event I/O Control"); TGCompositeFrame* top = new TGHorizontalFrame(group); TGPictureButton* b = 0; diff --git a/DDEve/src/GenericEventHandler.cpp b/DDEve/src/GenericEventHandler.cpp index c5cbba92c..fa4f2043b 100644 --- a/DDEve/src/GenericEventHandler.cpp +++ b/DDEve/src/GenericEventHandler.cpp @@ -19,6 +19,7 @@ #include /// ROOT include files +#include "TROOT.h" #include "TGMsgBox.h" #include "TSystem.h" #include @@ -136,7 +137,11 @@ bool GenericEventHandler::Open(const string& file_type, const string& file_name) err = "\nAn exception occurred \n" "while opening event data:\n" + string(e.what()) + "\n\n"; } +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2) + string path = TString::Format("%s/stop_t.xpm", TROOT::GetIconPath().Data()).Data(); +#else string path = TString::Format("%s/icons/stop_t.xpm", gSystem->Getenv("ROOTSYS")).Data(); +#endif const TGPicture* pic = gClient->GetPicture(path.c_str()); new TGMsgBox(gClient->GetRoot(),0,"Failed to open event data",err.c_str(),pic, kMBDismiss,0,kVerticalFrame,kTextLeft|kTextCenterY); @@ -157,7 +162,11 @@ bool GenericEventHandler::NextEvent() { throw runtime_error("+++ EventHandler::readEvent: No file open!"); } catch(const exception& e) { +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2) + string path = TString::Format("%s/stop_t.xpm", TROOT::GetIconPath().Data()).Data(); +#else string path = TString::Format("%s/icons/stop_t.xpm", gSystem->Getenv("ROOTSYS")).Data(); +#endif string err = "\nAn exception occurred \n" "while reading a new event:\n" + string(e.what()) + "\n\n"; const TGPicture* pic = gClient->GetPicture(path.c_str()); diff --git a/UtilityApps/src/teve_display.cpp b/UtilityApps/src/teve_display.cpp index 4272f279c..8030b5307 100644 --- a/UtilityApps/src/teve_display.cpp +++ b/UtilityApps/src/teve_display.cpp @@ -22,6 +22,7 @@ #include "run_plugin.h" #include "TRint.h" +#include "TROOT.h" #include "TEveGeoNode.h" #include "TEveBrowser.h" #include "TGNumberEntry.h" @@ -282,7 +283,11 @@ void make_gui() { TGHorizontalFrame* hf = new TGHorizontalFrame(frmMain); { +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2) + TString icondir( Form("%s/", TROOT::GetIconPath().Data()) ); +#else TString icondir( Form("%s/icons/", gSystem->Getenv("ROOTSYS")) ); +#endif TGPictureButton* b = 0; EvNavHandler *fh = new EvNavHandler; From f2ad48f21583519b35a45854e0a4b10c1482cf8b Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 20 Nov 2023 18:54:44 +0100 Subject: [PATCH 15/18] Add a check for the standard that Geant4 was compiled with --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ada9cbc8..bd6f40dd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,6 +137,10 @@ if(DD4HEP_USE_GEANT4) IF(NOT Geant4_builtin_clhep_FOUND) SET(DD4HEP_USE_CLHEP TRUE) ENDIF() + if(Geant4_CXX_STANDARD MATCHES "[0-9]+" AND Geant4_CXX_STANDARD LESS ${CMAKE_CXX_STANDARD}) + message(FATAL_ERROR "Geant4 was compiled with C++${Geant4_CXX_STANDARD}, but DD4hep requires C++${CMAKE_CXX_STANDARD}") + endif() + DD4HEP_SETUP_GEANT4_TARGETS() # Geant4 sets the CLHEP include directory to include_directories, we undo this here # we don't do this inside DD4hep_SETUP_GEANT4_TARGETS, because that is also used in From d7d1fbfdf96fe28a3c1545d03f73bd66b4e4d442 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 21 Nov 2023 16:10:46 +0100 Subject: [PATCH 16/18] Release Notes for v01-27-01 --- doc/ReleaseNotes.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/ReleaseNotes.md b/doc/ReleaseNotes.md index 2520513ff..29bf1e213 100644 --- a/doc/ReleaseNotes.md +++ b/doc/ReleaseNotes.md @@ -1,3 +1,19 @@ +# v01-27-01 + +* 2023-11-20 jmcarcell ([PR#1191](https://github.com/aidasoft/DD4hep/pull/1191)) + - CMake: Add a check for the c++ standard that Geant4 was compiled with, and fail if it is + different from the one required for DD4hep. + +* 2023-11-19 Wouter Deconinck ([PR#1190](https://github.com/aidasoft/DD4hep/pull/1190)) + - Use TROOT::GetIconPath to find icons in DDEve + +* 2023-11-17 Markus Frank ([PR#1187](https://github.com/aidasoft/DD4hep/pull/1187)) + - Implement startup flags to set the visualization depth in teveDisplay like for geoDisplay. + See Issue: See deeper hierarchy in teveDisplay https://github.com/AIDASoft/DD4hep/issues/1186 for details. + +* 2023-11-17 Dmitry Kalinkin ([PR#1184](https://github.com/aidasoft/DD4hep/pull/1184)) + - Fixed runtime issues during initialization caused by incorrectly placed `DECLARE_SEGMENTATION` for CartesianGridXYStaggered and HexGrid. + # v01-27 * 2023-10-19 Alvaro Tolosa Delgado ([PR#1174](https://github.com/aidasoft/dd4hep/pull/1174)) From 04bb629ddab5344c8df69070c35573f2f8095c69 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 21 Nov 2023 16:10:47 +0100 Subject: [PATCH 17/18] Updating version to v01-27-01 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd6f40dd2..e282c31ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ SET_PROPERTY(DIRECTORY . PROPERTY PACKAGE_NAME DD4hep) SET( DD4hep_VERSION_MAJOR 1 ) SET( DD4hep_VERSION_MINOR 27 ) -SET( DD4hep_VERSION_PATCH 0 ) +SET( DD4hep_VERSION_PATCH 1 ) ####################### # Basic project setup # From e47d56922873a54f73ceb6df67a2d65e41e0c1c2 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Fri, 24 Nov 2023 15:41:24 +0100 Subject: [PATCH 18/18] DetectorChecksum: use fabs for checking null --- DDCore/src/plugins/DetectorChecksum.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DDCore/src/plugins/DetectorChecksum.cpp b/DDCore/src/plugins/DetectorChecksum.cpp index 5e1ab1184..daf9551a4 100644 --- a/DDCore/src/plugins/DetectorChecksum.cpp +++ b/DDCore/src/plugins/DetectorChecksum.cpp @@ -43,7 +43,7 @@ namespace { return v.data() != 0; } inline double check_null(double d) { - if ( abs(d) < 1e-12 ) + if ( fabs(d) < 1e-12 ) return 0e0; else return d;