From dbb6ab0cd8a5b5fc1ea72fc94b310b97274f82f6 Mon Sep 17 00:00:00 2001 From: Brieuc Francois Date: Tue, 19 Dec 2023 20:13:48 +0100 Subject: [PATCH] Update recipes (#13) * Fix a CMake error * Fix warnings --- CMakeLists.txt | 7 ++++++- DCHdigi/src/DCHsimpleDigitizer.cpp | 8 ++++---- DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffd4e85..b1677cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,16 @@ set(PACKAGE_VERSION_PATCH 3) set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}") # dependencies +# For some reason, the find_package with DD4hep must be the first one +find_package(DD4hep REQUIRED COMPONENTS DDRec DDG4 DDParsers) +# dd4hep_set_compiler_flags() expects DD4hep_SET_RPATH to be set to ON +# otherwise it will not set the rpath when installing +set(DD4HEP_SET_RPATH ON) +dd4hep_set_compiler_flags() find_package(ROOT COMPONENTS RIO Tree MathCore) find_package(EDM4HEP) find_package(k4FWCore) find_package(Gaudi) -find_package(DD4hep) #--------------------------------------------------------------- include(GNUInstallDirs) diff --git a/DCHdigi/src/DCHsimpleDigitizer.cpp b/DCHdigi/src/DCHsimpleDigitizer.cpp index 5065c44..4587371 100644 --- a/DCHdigi/src/DCHsimpleDigitizer.cpp +++ b/DCHdigi/src/DCHsimpleDigitizer.cpp @@ -33,14 +33,14 @@ StatusCode DCHsimpleDigitizer::initialize() { } // check if readout exists - if (m_geoSvc->lcdd()->readouts().find(m_readoutName) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutName) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutName << ">> does not exist." << endmsg; return StatusCode::FAILURE; } // set the cellID decoder - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); // retrieve the volume manager - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_volman = m_geoSvc->getDetector()->volumeManager(); return StatusCode::SUCCESS; } @@ -60,7 +60,7 @@ StatusCode DCHsimpleDigitizer::execute() { auto cellDetElement = m_volman.lookupDetElement(cellID); // retrieve the wire (in DD4hep 1.23 there is no easy way to access the volume daughters we have to pass by detElements, in later versions volumes can be used) const std::string& wireDetElementName = - Form("superLayer_%d_layer_%d_phi_%d_wire", m_decoder->get(cellID, "superLayer"), + Form("superLayer_%ld_layer_%ld_phi_%ld_wire", m_decoder->get(cellID, "superLayer"), m_decoder->get(cellID, "layer"), m_decoder->get(cellID, "phi")); dd4hep::DetElement wireDetElement = cellDetElement.child(wireDetElementName); // get the transformation matrix used to place the wire diff --git a/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp b/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp index d3e3aca..a7d955f 100644 --- a/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp +++ b/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp @@ -33,14 +33,14 @@ StatusCode DCHsimpleDigitizerExtendedEdm::initialize() { } // check if readout exists - if (m_geoSvc->lcdd()->readouts().find(m_readoutName) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutName) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutName << ">> does not exist." << endmsg; return StatusCode::FAILURE; } // set the cellID decoder - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); // retrieve the volume manager - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_volman = m_geoSvc->getDetector()->volumeManager(); return StatusCode::SUCCESS; } @@ -60,7 +60,7 @@ StatusCode DCHsimpleDigitizerExtendedEdm::execute() { auto cellDetElement = m_volman.lookupDetElement(cellID); // retrieve the wire (in DD4hep 1.23 there is no easy way to access the volume daughters we have to pass by detElements, in later versions volumes can be used) const std::string& wireDetElementName = - Form("superLayer_%d_layer_%d_phi_%d_wire", m_decoder->get(cellID, "superLayer"), + Form("superLayer_%ld_layer_%ld_phi_%ld_wire", m_decoder->get(cellID, "superLayer"), m_decoder->get(cellID, "layer"), m_decoder->get(cellID, "phi")); dd4hep::DetElement wireDetElement = cellDetElement.child(wireDetElementName); // get the transformation matrix used to place the wire