Skip to content

Commit

Permalink
Using getDetector() instead of lcdd()
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvbrt committed Feb 22, 2024
1 parent fb830a0 commit 0804b36
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ QMTest/
InstallArea/
patches/
test_results/
install/

*-slc[56]-*/
i686-winxp-vc9-dbg/
Expand Down
2 changes: 1 addition & 1 deletion DRreco/src/DRcalib2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ StatusCode DRcalib2D::initialize() {
return StatusCode::FAILURE;
}

pSeg = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo*>(m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation());
pSeg = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo*>(m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation());

readCSV(m_calibPath);

Expand Down
2 changes: 1 addition & 1 deletion DRreco/src/DRcalib3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ StatusCode DRcalib3D::initialize() {
return StatusCode::FAILURE;
}

pSeg = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo*>(m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation());
pSeg = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo*>(m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation());

auto veloFile = std::make_unique<TFile>(m_veloFile.value().c_str(),"READ");
m_veloC.reset( static_cast<TH1D*>(veloFile->Get(m_cherenProf.value().c_str())) );
Expand Down
4 changes: 2 additions & 2 deletions DRsim/DRsimG4Components/src/SimG4SaveDRcaloHits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ StatusCode SimG4SaveDRcaloHits::initialize() {
return StatusCode::FAILURE;
}

auto lcdd = m_geoSvc->lcdd();
auto allReadouts = lcdd->readouts();
auto det = m_geoSvc->getDetector();
auto allReadouts = det->readouts();
for (auto& readoutName : m_readoutNames) {
if (allReadouts.find(readoutName) == allReadouts.end()) {
error() << "Readout " << readoutName << " not found! Please check tool configuration." << endmsg;
Expand Down
2 changes: 1 addition & 1 deletion DRsim/DRsimG4Full/src/components/SimG4DRcaloActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ StatusCode SimG4DRcaloActions::initialize() {
return StatusCode::FAILURE;
}

pSeg = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo*>(m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation());
pSeg = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo*>(m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation());

return StatusCode::SUCCESS;
}
Expand Down
6 changes: 3 additions & 3 deletions Detector/DRsensitive/src/SDWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace dd4hep {
namespace sim {
static G4VSensitiveDetector* create_DRcaloSiPM_sd(const std::string& aDetectorName, dd4hep::Detector& aLcdd) {
std::string readoutName = aLcdd.sensitiveDetector(aDetectorName).readout().name();
return new drc::DRcaloSiPMSD(aDetectorName,readoutName,aLcdd.sensitiveDetector(aDetectorName).readout().segmentation());
static G4VSensitiveDetector* create_DRcaloSiPM_sd(const std::string& aDetectorName, dd4hep::Detector& aDet) {
std::string readoutName = aDet.sensitiveDetector(aDetectorName).readout().name();
return new drc::DRcaloSiPMSD(aDetectorName,readoutName,aDet.sensitiveDetector(aDetectorName).readout().segmentation());
}
}
}
Expand Down

0 comments on commit 0804b36

Please sign in to comment.