diff --git a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp index 4bac7738..791f300d 100644 --- a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp +++ b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp @@ -58,7 +58,7 @@ StatusCode CalibrateBenchmarkMethod::initialize() { { bool readoutMissing = false; for (size_t i = 0; i < m_readoutNames.size(); ++i) { - auto readouts = m_geoSvc->lcdd()->readouts(); + auto readouts = m_geoSvc->getDetector()->readouts(); if (readouts.find(m_readoutNames.value().at(i)) == readouts.end()) { readoutMissing = true; } @@ -135,8 +135,8 @@ StatusCode CalibrateBenchmarkMethod::execute() { } // decoders for ECal and HCal - auto decoder_ECal = m_geoSvc->lcdd()->readout(m_readoutNames[ecal_index]).idSpec().decoder(); - auto decoder_HCal = m_geoSvc->lcdd()->readout(m_readoutNames[hcal_index]).idSpec().decoder(); + auto decoder_ECal = m_geoSvc->getDetector()->readout(m_readoutNames[ecal_index]).idSpec().decoder(); + auto decoder_HCal = m_geoSvc->getDetector()->readout(m_readoutNames[hcal_index]).idSpec().decoder(); std::vector cellIDs; diff --git a/RecCalorimeter/src/components/CalibrateInLayersTool.cpp b/RecCalorimeter/src/components/CalibrateInLayersTool.cpp index 3e959100..743ab8b6 100644 --- a/RecCalorimeter/src/components/CalibrateInLayersTool.cpp +++ b/RecCalorimeter/src/components/CalibrateInLayersTool.cpp @@ -19,7 +19,7 @@ StatusCode CalibrateInLayersTool::initialize() { return StatusCode::FAILURE; } // 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; } @@ -27,7 +27,7 @@ StatusCode CalibrateInLayersTool::initialize() { } void CalibrateInLayersTool::calibrate(std::unordered_map& aHits) { - auto decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); // Loop through energy deposits, multiply energy to get cell energy at electromagnetic scale std::for_each(aHits.begin(), aHits.end(), [this, decoder](std::pair& p) { dd4hep::DDSegmentation::CellID cID = p.first; diff --git a/RecCalorimeter/src/components/CaloTowerTool.cpp b/RecCalorimeter/src/components/CaloTowerTool.cpp index 826088df..ee1d0596 100644 --- a/RecCalorimeter/src/components/CaloTowerTool.cpp +++ b/RecCalorimeter/src/components/CaloTowerTool.cpp @@ -49,7 +49,7 @@ StatusCode CaloTowerTool::initialize() { return StatusCode::FAILURE; } if (m_useHalfTower) { - m_decoder = m_geoSvc->lcdd()->readout(m_ecalBarrelReadoutName).idSpec().decoder(); + m_decoder = m_geoSvc->getDetector()->readout(m_ecalBarrelReadoutName).idSpec().decoder(); } info() << "Retrieving Ecal endcap segmentation" << endmsg; tmpPair = retrieveSegmentation(m_ecalEndcapReadoutName); @@ -412,15 +412,15 @@ void CaloTowerTool::CellsIntoTowers(std::vector>& aTowers, std::pair CaloTowerTool::retrieveSegmentation(std::string aReadoutName) { dd4hep::DDSegmentation::Segmentation* segmentation = nullptr; - if (m_geoSvc->lcdd()->readouts().find(aReadoutName) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(aReadoutName) == m_geoSvc->getDetector()->readouts().end()) { info() << "Readout does not exist! Please check if it is correct. Processing without it." << endmsg; } else { info() << "Readout " << aReadoutName << " found." << endmsg; segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(aReadoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(aReadoutName).segmentation().segmentation()); if (segmentation == nullptr) { segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(aReadoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(aReadoutName).segmentation().segmentation()); if (segmentation == nullptr) { error() << "There is no phi-eta or multi- segmentation for the readout " << aReadoutName << " defined." << endmsg; } else { diff --git a/RecCalorimeter/src/components/CorrectCaloClusters.cpp b/RecCalorimeter/src/components/CorrectCaloClusters.cpp index 7cb67ae5..2890ae70 100644 --- a/RecCalorimeter/src/components/CorrectCaloClusters.cpp +++ b/RecCalorimeter/src/components/CorrectCaloClusters.cpp @@ -46,7 +46,7 @@ StatusCode CorrectCaloClusters::initialize() { { bool readoutMissing = false; for (size_t i = 0; i < m_readoutNames.size(); ++i) { - auto readouts = m_geoSvc->lcdd()->readouts(); + auto readouts = m_geoSvc->getDetector()->readouts(); if (readouts.find(m_readoutNames.value().at(i)) == readouts.end()) { readoutMissing = true; } @@ -309,7 +309,7 @@ double CorrectCaloClusters::getEnergyInLayer(edm4hep::Cluster cluster, const std::string& readoutName, size_t systemID, size_t layerID) { - dd4hep::DDSegmentation::BitFieldCoder* decoder = m_geoSvc->lcdd()->readout(readoutName).idSpec().decoder(); + dd4hep::DDSegmentation::BitFieldCoder* decoder = m_geoSvc->getDetector()->readout(readoutName).idSpec().decoder(); double energy = 0; for (auto cell = cluster.hits_begin(); cell != cluster.hits_end(); ++cell) { diff --git a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp index 03b47096..1d0e9c43 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp @@ -139,20 +139,20 @@ StatusCode CorrectECalBarrelSliWinCluster::initialize() { } for (uint iSys = 0; iSys < m_systemId.size(); iSys++) { // check if readouts exist - if (m_geoSvc->lcdd()->readouts().find(m_readoutName[iSys]) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutName[iSys]) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutName[iSys] << ">> does not exist." << endmsg; return StatusCode::FAILURE; } // retrieve PhiEta segmentation m_segmentationPhiEta[m_systemId[iSys]] = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName[iSys]).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName[iSys]).segmentation().segmentation()); m_segmentationMulti[m_systemId[iSys]] = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName[iSys]).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName[iSys]).segmentation().segmentation()); if (m_segmentationPhiEta[m_systemId[iSys]] == nullptr && m_segmentationMulti[m_systemId[iSys]] == nullptr) { error() << "There is no phi-eta or multi- segmentation." << endmsg; return StatusCode::FAILURE; } - m_decoder.insert (std::make_pair(m_systemId[iSys], m_geoSvc->lcdd()->readout(m_readoutName[iSys]).idSpec().decoder())); + m_decoder.insert (std::make_pair(m_systemId[iSys], m_geoSvc->getDetector()->readout(m_readoutName[iSys]).idSpec().decoder())); } // Initialize random service if (service("RndmGenSvc", m_randSvc).isFailure()) { diff --git a/RecCalorimeter/src/components/CreateCaloCells.cpp b/RecCalorimeter/src/components/CreateCaloCells.cpp index bdfe04d9..cc12b1a4 100644 --- a/RecCalorimeter/src/components/CreateCaloCells.cpp +++ b/RecCalorimeter/src/components/CreateCaloCells.cpp @@ -61,7 +61,7 @@ StatusCode CreateCaloCells::initialize() { } } if (m_addPosition){ - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_volman = m_geoSvc->getDetector()->volumeManager(); } // Copy over the CellIDEncoding string from the input collection to the output collection diff --git a/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp b/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp index ec6de505..3ca52015 100644 --- a/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp +++ b/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp @@ -61,7 +61,7 @@ StatusCode CreateCaloCellsNoise::initialize() { } } if (m_addPosition){ - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_volman = m_geoSvc->getDetector()->volumeManager(); } return StatusCode::SUCCESS; } diff --git a/RecCalorimeter/src/components/CreateCaloClusters.cpp b/RecCalorimeter/src/components/CreateCaloClusters.cpp index 79041124..38ae17bc 100644 --- a/RecCalorimeter/src/components/CreateCaloClusters.cpp +++ b/RecCalorimeter/src/components/CreateCaloClusters.cpp @@ -135,8 +135,8 @@ StatusCode CreateCaloClusters::initialize() { return StatusCode::FAILURE; } - m_decoderECal = m_geoSvc->lcdd()->readout(m_readoutECal).idSpec().decoder(); - m_decoderHCal = m_geoSvc->lcdd()->readout(m_readoutHCal).idSpec().decoder(); + m_decoderECal = m_geoSvc->getDetector()->readout(m_readoutECal).idSpec().decoder(); + m_decoderHCal = m_geoSvc->getDetector()->readout(m_readoutHCal).idSpec().decoder(); info() << "CreateCaloClusters initialized" << endmsg; diff --git a/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp b/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp index 20ddf0f9..45465ebe 100644 --- a/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp +++ b/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp @@ -25,7 +25,7 @@ StatusCode LayerPhiEtaCaloTool::initialize() { if (m_readoutName != "") { // Check if readouts exist info() << "Readout: " << m_readoutName << endmsg; - 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; } @@ -50,7 +50,7 @@ StatusCode LayerPhiEtaCaloTool::prepareEmptyCells(std::unordered_map( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; @@ -61,7 +61,7 @@ StatusCode LayerPhiEtaCaloTool::prepareEmptyCells(std::unordered_mapoffsetPhi() << endmsg; // Take readout bitfield decoder from GeoSvc - auto decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); if (m_fieldNames.size() != m_fieldValues.size()) { error() << "Volume readout field descriptors (names and values) have different size." << endmsg; return StatusCode::FAILURE; diff --git a/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp b/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp index 2b3e7c63..8cb148cb 100644 --- a/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp +++ b/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp @@ -32,20 +32,20 @@ StatusCode LayeredCaloTowerTool::initialize() { return StatusCode::FAILURE; } // check if readouts exist - 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; } // retrieve PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation." << endmsg; return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc m_decoder = - std::shared_ptr(m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder()); + std::shared_ptr(m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder()); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecCalorimeter/src/components/MassInv.cpp b/RecCalorimeter/src/components/MassInv.cpp index a790bfbd..a4f8ab2c 100644 --- a/RecCalorimeter/src/components/MassInv.cpp +++ b/RecCalorimeter/src/components/MassInv.cpp @@ -301,20 +301,20 @@ StatusCode MassInv::initialize() { } for (uint iSys = 0; iSys < m_systemId.size(); iSys++) { // check if readouts exist - if (m_geoSvc->lcdd()->readouts().find(m_readoutName[iSys]) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutName[iSys]) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutName[iSys] << ">> does not exist." << endmsg; return StatusCode::FAILURE; } // retrieve PhiEta segmentation m_segmentationPhiEta[m_systemId[iSys]] = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName[iSys]).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName[iSys]).segmentation().segmentation()); m_segmentationMulti[m_systemId[iSys]] = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName[iSys]).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName[iSys]).segmentation().segmentation()); if (m_segmentationPhiEta[m_systemId[iSys]] == nullptr && m_segmentationMulti[m_systemId[iSys]] == nullptr) { error() << "There is no phi-eta or multi- segmentation." << endmsg; return StatusCode::FAILURE; } - m_decoder.insert (std::make_pair(m_systemId[iSys], m_geoSvc->lcdd()->readout(m_readoutName[iSys]).idSpec().decoder())); + m_decoder.insert (std::make_pair(m_systemId[iSys], m_geoSvc->getDetector()->readout(m_readoutName[iSys]).idSpec().decoder())); } // Initialize random service if (service("RndmGenSvc", m_randSvc).isFailure()) { diff --git a/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp b/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp index 4a02fee9..86efba55 100644 --- a/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp +++ b/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp @@ -23,7 +23,7 @@ StatusCode NestedVolumesCaloTool::initialize() { } // Check if readouts exist info() << "Readout: " << m_readoutName << endmsg; - 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; } @@ -34,7 +34,7 @@ StatusCode NestedVolumesCaloTool::finalize() { return GaudiTool::finalize(); } StatusCode NestedVolumesCaloTool::prepareEmptyCells(std::unordered_map& aCells) { // Take readout bitfield decoder from GeoSvc - auto decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); if (m_fieldNames.size() != m_fieldValues.size()) { error() << "Volume readout field descriptors (names and values) have different size." << endmsg; return StatusCode::FAILURE; diff --git a/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp b/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp index 157a4150..2666625d 100644 --- a/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp +++ b/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp @@ -51,7 +51,7 @@ StatusCode NoiseCaloCellsFromFileTool::initialize() { info() << "Unable to retrieve cell positions tool, try eta-phi segmentation." << endmsg; // Get PhiEta segmentation m_segmentationPhiEta = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentationPhiEta == nullptr) { error() << "There is no phi-eta segmentation." << endmsg; return StatusCode::FAILURE; @@ -61,10 +61,10 @@ StatusCode NoiseCaloCellsFromFileTool::initialize() { } // Get PhiEta segmentation m_segmentationPhiEta = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentationPhiEta == nullptr) { m_segmentationMulti = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentationMulti == nullptr) { error() << "There is no phi-eta or multi- segmentation for the readout " << m_readoutName << " defined." << endmsg; return StatusCode::FAILURE; @@ -81,7 +81,7 @@ StatusCode NoiseCaloCellsFromFileTool::initialize() { } } - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); m_index_activeField = m_decoder->index(m_activeFieldName); debug() << "Filter noise threshold: " << m_filterThreshold << "*sigma" << endmsg; diff --git a/RecCalorimeter/src/components/PreparePileup.cpp b/RecCalorimeter/src/components/PreparePileup.cpp index 55a61eed..cdc40dfb 100644 --- a/RecCalorimeter/src/components/PreparePileup.cpp +++ b/RecCalorimeter/src/components/PreparePileup.cpp @@ -37,19 +37,19 @@ StatusCode PreparePileup::initialize() { return StatusCode::FAILURE; } // check if readouts exist - 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; } // retrieve PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation." << endmsg; return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); // Histogram service m_histSvc = service("THistSvc"); if (!m_histSvc) { diff --git a/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp b/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp index fda4b6c5..032b88b9 100644 --- a/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp +++ b/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp @@ -29,7 +29,7 @@ StatusCode ReadNoiseFromFileTool::initialize() { << "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << endmsg; return StatusCode::FAILURE; } - m_segmentation = dynamic_cast(m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_segmentation = dynamic_cast(m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; @@ -42,7 +42,7 @@ StatusCode ReadNoiseFromFileTool::initialize() { } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); StatusCode sc = GaudiTool::initialize(); if (sc.isFailure()) return sc; diff --git a/RecCalorimeter/src/components/SplitClusters.cpp b/RecCalorimeter/src/components/SplitClusters.cpp index e0095c26..41b32195 100644 --- a/RecCalorimeter/src/components/SplitClusters.cpp +++ b/RecCalorimeter/src/components/SplitClusters.cpp @@ -48,8 +48,8 @@ StatusCode SplitClusters::initialize() { return StatusCode::FAILURE; } - m_decoderECal = m_geoSvc->lcdd()->readout(m_readoutECal).idSpec().decoder(); - m_decoderHCal = m_geoSvc->lcdd()->readout(m_readoutHCal).idSpec().decoder(); + m_decoderECal = m_geoSvc->getDetector()->readout(m_readoutECal).idSpec().decoder(); + m_decoderHCal = m_geoSvc->getDetector()->readout(m_readoutHCal).idSpec().decoder(); // Read neighbours map if (!m_neighboursTool.retrieve()) { diff --git a/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp b/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp index e565208f..0553ec8c 100644 --- a/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp +++ b/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp @@ -26,7 +26,7 @@ StatusCode TubeLayerPhiEtaCaloTool::initialize() { if (m_readoutName != "") { // Check if readouts exist info() << "Readout: " << m_readoutName << endmsg; - 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; } @@ -52,10 +52,10 @@ StatusCode TubeLayerPhiEtaCaloTool::prepareEmptyCells(std::unordered_map( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (segmentation == nullptr) { segmentationMulti = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (segmentationMulti == nullptr) { error() << "There is no phi-eta or multi- segmentation for the readout " << m_readoutName << " defined." << endmsg; return StatusCode::FAILURE; @@ -81,7 +81,7 @@ StatusCode TubeLayerPhiEtaCaloTool::prepareEmptyCells(std::unordered_mapoffsetPhi() << endmsg; } // Take readout bitfield decoder from GeoSvc - auto decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); if (m_fieldNames.size() != m_fieldValues.size()) { error() << "Volume readout field descriptors (names and values) have different size." << endmsg; return StatusCode::FAILURE; diff --git a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp index 001c90b6..646db5f6 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp +++ b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp @@ -77,7 +77,7 @@ StatusCode CaloTopoClusterFCCee::initialize() { } } - m_decoder_ecal = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); + m_decoder_ecal = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); m_index_layer_ecal = m_decoder_ecal->index("layer"); return StatusCode::SUCCESS; diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp index 84284c8c..96163d64 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp +++ b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp @@ -23,7 +23,7 @@ StatusCode CellPositionsECalBarrelModuleThetaSegTool::initialize() { } // get segmentation - m_segmentation = dynamic_cast(m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_segmentation = dynamic_cast(m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no module-theta segmentation!!!!" << endmsg; return StatusCode::FAILURE; @@ -43,8 +43,8 @@ StatusCode CellPositionsECalBarrelModuleThetaSegTool::initialize() { // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; diff --git a/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.cpp index 6d018af3..324ab092 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.cpp @@ -20,14 +20,14 @@ StatusCode CellPositionsCaloDiscsTool::initialize() { } // get PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName.value()).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName.value()).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName.value()).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName.value()).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp index 67d34b49..f195817a 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp @@ -21,14 +21,14 @@ StatusCode CellPositionsECalBarrelTool::initialize() { } // get PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp index 7a8a7e7c..cb070705 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp @@ -20,14 +20,14 @@ StatusCode CellPositionsHCalBarrelNoSegTool::initialize() { } // get PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; // return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp index 7e66360b..da989fd1 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp @@ -20,13 +20,13 @@ StatusCode CellPositionsHCalBarrelPhiSegTool::initialize() { } // get PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp index 9e67c7fb..aa502939 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp @@ -20,14 +20,14 @@ StatusCode CellPositionsHCalBarrelTool::initialize() { } // get PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; // return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp index b421598c..9a11d11a 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp @@ -21,14 +21,14 @@ StatusCode CellPositionsTailCatcherTool::initialize() { } // get PhiEta segmentation m_segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutName).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutName).segmentation().segmentation()); if (m_segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; } // Take readout bitfield decoder from GeoSvc - m_decoder = m_geoSvc->lcdd()->readout(m_readoutName).idSpec().decoder(); - m_volman = m_geoSvc->lcdd()->volumeManager(); + m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); + m_volman = m_geoSvc->getDetector()->volumeManager(); // check if decoder contains "layer" std::vector fields; for (uint itField = 0; itField < m_decoder->size(); itField++) { diff --git a/RecFCChhCalorimeter/src/components/CreateFCChhCaloNeighbours.cpp b/RecFCChhCalorimeter/src/components/CreateFCChhCaloNeighbours.cpp index 16af4f48..15e18327 100644 --- a/RecFCChhCalorimeter/src/components/CreateFCChhCaloNeighbours.cpp +++ b/RecFCChhCalorimeter/src/components/CreateFCChhCaloNeighbours.cpp @@ -55,14 +55,14 @@ StatusCode CreateFCChhCaloNeighbours::initialize() { for (uint iSys = 0; iSys < m_readoutNamesSegmented.size(); iSys++) { // Check if readouts exist info() << "Readout: " << m_readoutNamesSegmented[iSys] << endmsg; - if (m_geoSvc->lcdd()->readouts().find(m_readoutNamesSegmented[iSys]) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutNamesSegmented[iSys]) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutNamesSegmented[iSys] << ">> does not exist." << endmsg; return StatusCode::FAILURE; } // get PhiEta segmentation dd4hep::DDSegmentation::FCCSWGridPhiEta* segmentation; segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutNamesSegmented[iSys]).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).segmentation().segmentation()); if (segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; @@ -73,7 +73,7 @@ StatusCode CreateFCChhCaloNeighbours::initialize() { info() << "GridPhiEta: offset in eta " << segmentation->offsetEta() << " , offset in phi " << segmentation->offsetPhi() << endmsg; - auto decoder = m_geoSvc->lcdd()->readout(m_readoutNamesSegmented[iSys]).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).idSpec().decoder(); // will be used for volume connecting if (m_fieldNamesSegmented[iSys] == "system" && m_fieldValuesSegmented[iSys] == 5) { decoderECalBarrel = decoder; @@ -166,11 +166,11 @@ StatusCode CreateFCChhCaloNeighbours::initialize() { } // Check if readouts exist info() << "Readout: " << m_readoutNamesNested[iSys] << endmsg; - if (m_geoSvc->lcdd()->readouts().find(m_readoutNamesNested[iSys]) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutNamesNested[iSys]) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutNamesNested[iSys] << ">> does not exist." << endmsg; return StatusCode::FAILURE; } - auto decoder = m_geoSvc->lcdd()->readout(m_readoutNamesNested[iSys]).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutNamesNested[iSys]).idSpec().decoder(); // will be used for volume connecting if (m_fieldNameNested == "system" && m_fieldValuesNested[iSys] == 8) { decoderHCalBarrel = decoder; diff --git a/RecFCChhCalorimeter/src/components/CreateFCChhCaloNoiseLevelMap.cpp b/RecFCChhCalorimeter/src/components/CreateFCChhCaloNoiseLevelMap.cpp index 7f73c166..40ab14e3 100644 --- a/RecFCChhCalorimeter/src/components/CreateFCChhCaloNoiseLevelMap.cpp +++ b/RecFCChhCalorimeter/src/components/CreateFCChhCaloNoiseLevelMap.cpp @@ -39,14 +39,14 @@ StatusCode CreateFCChhCaloNoiseLevelMap::initialize() { for (uint iSys = 0; iSys < m_readoutNamesSegmented.size(); iSys++) { // Check if readouts exist info() << "Readout: " << m_readoutNamesSegmented[iSys] << endmsg; - if (m_geoSvc->lcdd()->readouts().find(m_readoutNamesSegmented[iSys]) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutNamesSegmented[iSys]) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutNamesSegmented[iSys] << ">> does not exist." << endmsg; return StatusCode::FAILURE; } // get PhiEta segmentation dd4hep::DDSegmentation::FCCSWGridPhiEta* segmentation; segmentation = dynamic_cast( - m_geoSvc->lcdd()->readout(m_readoutNamesSegmented[iSys]).segmentation().segmentation()); + m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).segmentation().segmentation()); if (segmentation == nullptr) { error() << "There is no phi-eta segmentation!!!!" << endmsg; return StatusCode::FAILURE; @@ -57,7 +57,7 @@ StatusCode CreateFCChhCaloNoiseLevelMap::initialize() { info() << "GridPhiEta: offset in eta " << segmentation->offsetEta() << " , offset in phi " << segmentation->offsetPhi() << endmsg; - auto decoder = m_geoSvc->lcdd()->readout(m_readoutNamesSegmented[iSys]).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).idSpec().decoder(); // Loop over all cells in the calorimeter and retrieve existing cellIDs // Loop over active layers std::vector> extrema; @@ -116,11 +116,11 @@ StatusCode CreateFCChhCaloNoiseLevelMap::initialize() { } // Check if readouts exist info() << "Readout: " << m_readoutNamesNested[iSys] << endmsg; - if (m_geoSvc->lcdd()->readouts().find(m_readoutNamesNested[iSys]) == m_geoSvc->lcdd()->readouts().end()) { + if (m_geoSvc->getDetector()->readouts().find(m_readoutNamesNested[iSys]) == m_geoSvc->getDetector()->readouts().end()) { error() << "Readout <<" << m_readoutNamesNested[iSys] << ">> does not exist." << endmsg; return StatusCode::FAILURE; } - auto decoder = m_geoSvc->lcdd()->readout(m_readoutNamesNested[iSys]).idSpec().decoder(); + auto decoder = m_geoSvc->getDetector()->readout(m_readoutNamesNested[iSys]).idSpec().decoder(); // Get VolumeID dd4hep::DDSegmentation::CellID volumeId = 0; decoder->set(volumeId, m_fieldNameNested, m_fieldValuesNested[iSys]);