Skip to content

Commit

Permalink
Update recipes (#13)
Browse files Browse the repository at this point in the history
* Fix a CMake error

* Fix warnings
  • Loading branch information
BrieucF authored Dec 19, 2023
1 parent 02cf300 commit dbb6ab0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions DCHdigi/src/DCHsimpleDigitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit dbb6ab0

Please sign in to comment.