From d75de82efa771210384a858706cae80a1759ec57 Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Thu, 21 Mar 2024 11:45:43 +0100 Subject: [PATCH 1/7] Add crosstalk neighbour class --- .../CreateFCCeeCaloXTalkNeighbours.cpp | 256 ++++++++++++++++++ .../CreateFCCeeCaloXTalkNeighbours.h | 86 ++++++ 2 files changed, 342 insertions(+) create mode 100644 RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp create mode 100644 RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h diff --git a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp new file mode 100644 index 00000000..951af7ae --- /dev/null +++ b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp @@ -0,0 +1,256 @@ +#include "CreateFCCeeCaloXTalkNeighbours.h" + +// DD4hep +#include "DD4hep/Detector.h" + +// k4FWCore +#include "k4Interface/IGeoSvc.h" + +// k4geo +#include "detectorCommon/DetUtils_k4geo.h" +#include "detectorSegmentations/GridTheta_k4geo.h" +#include "detectorSegmentations/FCCSWGridPhiTheta_k4geo.h" +#include "detectorSegmentations/FCCSWGridModuleThetaMerged_k4geo.h" + +// ROOT +#include "TFile.h" +#include "TTree.h" + +#define DEBUGCELLINFO 1 + +DECLARE_COMPONENT(CreateFCCeeCaloXTalkNeighbours) + +CreateFCCeeCaloXTalkNeighbours::CreateFCCeeCaloXTalkNeighbours(const std::string &aName, ISvcLocator *aSL) + : base_class(aName, aSL) +{ + declareProperty("outputFileName", m_outputFileName, "Name of the output file"); +} + +CreateFCCeeCaloXTalkNeighbours::~CreateFCCeeCaloXTalkNeighbours() {} + +StatusCode CreateFCCeeCaloXTalkNeighbours::initialize() +{ + // Initialize necessary Gaudi components + if (Service::initialize().isFailure()) + { + error() << "Unable to initialize Service()" << endmsg; + return StatusCode::FAILURE; + } + m_geoSvc = service("GeoSvc"); + if (!m_geoSvc) + { + error() << "Unable to locate Geometry Service. " + << "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << endmsg; + return StatusCode::FAILURE; + } + std::unordered_map>> map; +#if DEBUGCELLINFO ==1 + std::unordered_map> CellInfo; +#endif + + for (uint iSys = 0; iSys < m_readoutNamesSegmented.size(); iSys++) + { + // Check if readout exists + info() << "Readout: " << m_readoutNamesSegmented[iSys] << endmsg; + 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 theta-based segmentation + dd4hep::DDSegmentation::Segmentation *aSegmentation = m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).segmentation().segmentation(); + if (aSegmentation == nullptr) + { + error() << "Segmentation does not exist." << endmsg; + return StatusCode::FAILURE; + } + + std::string segmentationType = aSegmentation->type(); + info() << "Segmentation type : " << segmentationType << endmsg; + + dd4hep::DDSegmentation::GridTheta_k4geo *segmentation = nullptr; + dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged_k4geo *moduleThetaSegmentation = nullptr; + if (segmentationType == "FCCSWGridModuleThetaMerged_k4geo") + { + segmentation = dynamic_cast(aSegmentation); + moduleThetaSegmentation = dynamic_cast(aSegmentation); + } + else + { + error() << "Segmentation type not handled." << endmsg; + return StatusCode::FAILURE; + } + + if (segmentation == nullptr || moduleThetaSegmentation == nullptr) + { + error() << "Unable to cast segmentation pointer!!!!" << endmsg; + return StatusCode::FAILURE; + } + + info() << "Segmentation: size in Theta " << segmentation->gridSizeTheta() << endmsg; + info() << "Segmentation: offset in Theta " << segmentation->offsetTheta() << endmsg; + if (segmentationType == "FCCSWGridModuleThetaMerged_k4geo") + { + info() << "Segmentation: bins in Module " << moduleThetaSegmentation->nModules() << endmsg; + } + + // retrieve decoders for the crosstalk neighbour finding + auto decoder = m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).idSpec().decoder(); + + // Loop over all cells in the calorimeter and retrieve existing cellIDs and find neihbours + if (segmentationType == "FCCSWGridModuleThetaMerged_k4geo") + { + std::vector>> extrema_layer; + for (unsigned int ilayer = 0; ilayer < m_activeVolumesNumbersSegmented[iSys]; ilayer++) + { + dd4hep::DDSegmentation::CellID volumeId = 0; + (*decoder)[m_fieldNamesSegmented[iSys]].set(volumeId, m_fieldValuesSegmented[iSys]); + (*decoder)[m_activeFieldNamesSegmented[iSys]].set(volumeId, ilayer); + (*decoder)["theta"].set(volumeId, 0); + (*decoder)["module"].set(volumeId, 0); + auto numCells = det::utils::numberOfCells(volumeId, *moduleThetaSegmentation); + + std::vector> extrema; + // extrema[0]: min layer, n layers + extrema.emplace_back(std::make_pair(0, m_activeVolumesNumbersSegmented[iSys] - 1)); + // extrema[1]: min module number (0), max module number + extrema.emplace_back(std::make_pair(0, (numCells[0] - 1) * moduleThetaSegmentation->mergedModules(ilayer))); + // extrema[2]: min theta ID, n (merged) theta cells + extrema.emplace_back(std::make_pair(numCells[2], numCells[2] + (numCells[1] - 1) * moduleThetaSegmentation->mergedThetaCells(ilayer))); + debug() << "Layer: " << ilayer << endmsg; + debug() << "Extrema[0]: " << extrema[0].first << " , " << extrema[0].second << endmsg; + debug() << "Extrema[1]: " << extrema[1].first << " , " << extrema[1].second << endmsg; + debug() << "Extrema[2]: " << extrema[2].first << " , " << extrema[2].second << endmsg; + debug() << "Number of segmentation cells in (module,theta): " << numCells << endmsg; + extrema_layer.emplace_back(extrema); + } + + for (unsigned int ilayer = 0; ilayer < m_activeVolumesNumbersSegmented[iSys]; ilayer++) + { + dd4hep::DDSegmentation::CellID volumeId = 0; + // Get VolumeID + (*decoder)[m_fieldNamesSegmented[iSys]].set(volumeId, m_fieldValuesSegmented[iSys]); + (*decoder)[m_activeFieldNamesSegmented[iSys]].set(volumeId, ilayer); + (*decoder)["theta"].set(volumeId, 0); + (*decoder)["module"].set(volumeId, 0); + // Loop over segmentation cells to find crosstalk neighbours in ECAL + for (int imodule = extrema_layer[ilayer][1].first; imodule <= extrema_layer[ilayer][1].second; imodule += moduleThetaSegmentation->mergedModules(ilayer)) + { + for (int itheta = extrema_layer[ilayer][2].first; itheta <= extrema_layer[ilayer][2].second; itheta += moduleThetaSegmentation->mergedThetaCells(ilayer)) + { + dd4hep::DDSegmentation::CellID cellId = volumeId; + decoder->set(cellId, "module", imodule); + decoder->set(cellId, "theta", itheta); // start from the minimum existing theta cell in this layer + uint64_t id = cellId; + map.insert(std::pair>>( + id, + det::xtalk::xtalk_neighbours_ModuleThetaMerged( + *moduleThetaSegmentation, + *decoder, + {m_activeFieldNamesSegmented[iSys], + "module", "theta"}, + extrema_layer, + id))); + } + } + } + } + + if (msgLevel() <= MSG::DEBUG) + { + std::vector counter; + counter.assign(40, 0); + for (const auto &item : map) + { + counter[item.second.size()]++; + } + for (uint iCount = 0; iCount < counter.size(); iCount++) + { + if (counter[iCount] != 0) + { + info() << counter[iCount] << " cells have " << iCount << " neighbours" << endmsg; + } + } + } + info() << "total number of cells: " << map.size() << endmsg; + } + + if (msgLevel() <= MSG::DEBUG) + { + std::vector counter; + counter.assign(40, 0); + for (const auto &item : map) + { + counter[item.second.size()]++; + } + for (uint iCount = 0; iCount < counter.size(); iCount++) + { + if (counter[iCount] != 0) + { + debug() << counter[iCount] << " cells have " << iCount << " neighbours" << endmsg; + } + } + } + //debug() << "cells with neighbours across Calo boundaries: " << count << endmsg; + + std::unique_ptr file(TFile::Open(m_outputFileName.c_str(), "RECREATE")); + file->cd(); + TTree tree("crosstalk_neighbours", "Tree with map of neighbours"); + uint64_t saveCellId; + std::vector saveNeighbours; + std::vector saveCrosstalks; + tree.Branch("cellId", &saveCellId, "cellId/l"); + tree.Branch("list_crosstalk_neighbours", &saveNeighbours); + tree.Branch("list_crosstalks", &saveCrosstalks); + + // Debug: save cell position +#if DEBUGCELLINFO==1 + std::vector saveCellInfo; + tree.Branch("CellInfo", &saveCellInfo); +#endif + + int count_map=0; + for (const auto &item : map) + { + saveCellId = item.first; + std::vector> temp_pair=item.second; + std::vector temp_neighbours; + std::vector temp_crosstalks; + for (const auto &this_temp : temp_pair) + { + temp_neighbours.push_back(this_temp.first); + temp_crosstalks.push_back(this_temp.second); + } + saveNeighbours = temp_neighbours; + saveCrosstalks = temp_crosstalks; + // Debug: save cell position +#if DEBUGCELLINFO==1 + for (uint iSys = 0; iSys < m_readoutNamesSegmented.size(); iSys++) + { + dd4hep::DDSegmentation::Segmentation *aSegmentation = m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).segmentation().segmentation(); + std::string segmentationType = aSegmentation->type(); + dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged_k4geo *moduleThetaSegmentation = nullptr; + auto decoder = m_geoSvc->getDetector()->readout(m_readoutNamesSegmented[iSys]).idSpec().decoder(); + if (segmentationType == "FCCSWGridModuleThetaMerged_k4geo") + { + moduleThetaSegmentation = dynamic_cast(aSegmentation); + } + saveCellInfo=det::xtalk::xtalk_get_cell_position( + *moduleThetaSegmentation, + *decoder, + {m_activeFieldNamesSegmented[iSys],"module", "theta"}, + saveCellId); + } +#endif + tree.Fill(); + count_map++; + if(!count_map%1000) std::cout<<"Number of cells: "<Write(); + file->Close(); + + return StatusCode::SUCCESS; +} + +StatusCode CreateFCCeeCaloXTalkNeighbours::finalize() { return Service::finalize(); } diff --git a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h new file mode 100644 index 00000000..b73898a4 --- /dev/null +++ b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h @@ -0,0 +1,86 @@ +#ifndef RECFCCEECALORIMETER_CREATEFCCEECALOXTALKNEIGHBOURS_H +#define RECFCCEECALORIMETER_CREATEFCCEECALOXTALKNEIGHBOURS_H + +// Gaudi +#include "GaudiKernel/Service.h" + +// k4FWCore +#include "k4Interface/ICaloCreateMap.h" +#include "k4Interface/IGeoSvc.h" +#include "k4FWCore/DataHandle.h" +#include "k4Interface/ICellPositionsTool.h" + +// k4geo +#include "detectorCommon/DetUtils_k4geo.h" +#include "detectorCommon/xtalk_k4geo.h" + +// DD4hep +#include "DD4hep/Readout.h" +#include "DD4hep/Volumes.h" +#include "DDSegmentation/Segmentation.h" + +// ROOT +#include "TGeoManager.h" + +class IGeoSvc; + +/** @class CreateFCCeeCaloXTalkNeighbours + * + * Service building a map of crosstalk neighbours for all existing cells in the geometry. + * Only applicable to the ALLEGRO ECAL barrel with the theta-merged segmentation + * + * @author Zhibo Wu + */ + +class CreateFCCeeCaloXTalkNeighbours : public extends1 { +public: + /// Standard constructor + explicit CreateFCCeeCaloXTalkNeighbours(const std::string& aName, ISvcLocator* aSL); + /// Standard destructor + virtual ~CreateFCCeeCaloXTalkNeighbours(); + /** Initialize the map creator service. + * @return status code + */ + virtual StatusCode initialize() final; + /** Finalize the map creator service. + * @return status code + */ + virtual StatusCode finalize() final; + +private: + /// Pointer to the geometry service + SmartIF m_geoSvc; + + /// Names of the detector readout for the volumes + Gaudi::Property> m_readoutNamesSegmented{this, "readoutNames", {"ECalBarrelModuleThetaMerged", "BarHCal_Readout_phitheta"}}; + /// Name of the fields describing the segmented volume + Gaudi::Property> m_fieldNamesSegmented{this, "systemNames", {"system", "system"}}; + /// Values of the fields describing the segmented volume + Gaudi::Property> m_fieldValuesSegmented{this, "systemValues", {4, 8}}; + /// Names of the active volume in geometry along radial axis (e.g. layer), the others are "module" or "phi", "theta" + Gaudi::Property> m_activeFieldNamesSegmented{this, "activeFieldNames", {"layer", "layer"}}; + /// Number of layers in the segmented volumes + Gaudi::Property> m_activeVolumesNumbersSegmented{this, "activeVolumesNumbers", {12, 13}}; + // Theta ranges of layers in the segmented volumes + Gaudi::Property>> m_activeVolumesTheta{this, "activeVolumesTheta"}; + + // System ID of ECAL and HCAL barrels + Gaudi::Property m_ecalBarrelSysId{this, "ecalBarrelSysId", 4}; + Gaudi::Property m_hcalBarrelSysId{this, "hcalBarrelSysId", 8}; + + // For combination of barrels: flag if ECal and HCal barrels should be merged + Gaudi::Property m_connectBarrels{this, "connectBarrels", true}; + // For combination of barrels: size of HCal cell along z axis + Gaudi::Property m_hCalZSize{this, "hCalZsize", 18}; + // For combination of barrels: offset of HCal detector in z (lower edge) + Gaudi::Property m_hCalZOffset{this, "hCalZoffset", -4590}; + // For combination of barrels: HCal inner radius for calculation of eta from z ??? + Gaudi::Property m_hCalRinner{this, "hCalRinner", 2850}; + // For combination of barrels: offset of HCal modules in phi (lower edge) + Gaudi::Property m_hCalPhiOffset{this, "hCalPhiOffset"}; + + /// Name of output file + std::string m_outputFileName; +}; + +#endif /* RECFCCEECALORIMETER_CREATEFCCEECALOXTALKNEIGHBOURS_H */ From 0bee6c23eddf90c0b2a359a197a9ca067c6d1d8c Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Fri, 5 Apr 2024 17:23:10 +0200 Subject: [PATCH 2/7] Use c++ static_cast --- .../CreateFCCeeCaloXTalkNeighbours.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp index 951af7ae..fc3ad0ad 100644 --- a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp +++ b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp @@ -105,10 +105,10 @@ StatusCode CreateFCCeeCaloXTalkNeighbours::initialize() for (unsigned int ilayer = 0; ilayer < m_activeVolumesNumbersSegmented[iSys]; ilayer++) { dd4hep::DDSegmentation::CellID volumeId = 0; - (*decoder)[m_fieldNamesSegmented[iSys]].set(volumeId, m_fieldValuesSegmented[iSys]); - (*decoder)[m_activeFieldNamesSegmented[iSys]].set(volumeId, ilayer); - (*decoder)["theta"].set(volumeId, 0); - (*decoder)["module"].set(volumeId, 0); + static_cast(*decoder)[m_fieldNamesSegmented[iSys]].set(volumeId, m_fieldValuesSegmented[iSys]); + static_cast(*decoder)[m_activeFieldNamesSegmented[iSys]].set(volumeId, ilayer); + static_cast(*decoder)["theta"].set(volumeId, 0); + static_cast(*decoder)["module"].set(volumeId, 0); auto numCells = det::utils::numberOfCells(volumeId, *moduleThetaSegmentation); std::vector> extrema; @@ -130,10 +130,10 @@ StatusCode CreateFCCeeCaloXTalkNeighbours::initialize() { dd4hep::DDSegmentation::CellID volumeId = 0; // Get VolumeID - (*decoder)[m_fieldNamesSegmented[iSys]].set(volumeId, m_fieldValuesSegmented[iSys]); - (*decoder)[m_activeFieldNamesSegmented[iSys]].set(volumeId, ilayer); - (*decoder)["theta"].set(volumeId, 0); - (*decoder)["module"].set(volumeId, 0); + static_cast(*decoder)[m_fieldNamesSegmented[iSys]].set(volumeId, m_fieldValuesSegmented[iSys]); + static_cast(*decoder)[m_activeFieldNamesSegmented[iSys]].set(volumeId, ilayer); + static_cast(*decoder)["theta"].set(volumeId, 0); + static_cast(*decoder)["module"].set(volumeId, 0); // Loop over segmentation cells to find crosstalk neighbours in ECAL for (int imodule = extrema_layer[ilayer][1].first; imodule <= extrema_layer[ilayer][1].second; imodule += moduleThetaSegmentation->mergedModules(ilayer)) { From 9f736230795b635fd0b97ef50cbb9f0432f29f5a Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Fri, 12 Apr 2024 13:43:17 +0200 Subject: [PATCH 3/7] Attempt to add automatic test --- RecFCCeeCalorimeter/CMakeLists.txt | 5 +++ .../tests/options/runCaloXTalkNeighbours.py | 37 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py diff --git a/RecFCCeeCalorimeter/CMakeLists.txt b/RecFCCeeCalorimeter/CMakeLists.txt index b9be7b18..c34a118e 100644 --- a/RecFCCeeCalorimeter/CMakeLists.txt +++ b/RecFCCeeCalorimeter/CMakeLists.txt @@ -58,3 +58,8 @@ add_test(NAME FCCeeLAr_benchmarkCalibration ) set_test_env(FCCeeLAr_benchmarkCalibration) +add_test(NAME FCCeeLAr_xtalkNeighbours + COMMAND k4run RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} +) +set_test_env(FCCeeLAr_xtalkNeighbours) diff --git a/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py b/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py new file mode 100644 index 00000000..3f9d7afe --- /dev/null +++ b/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py @@ -0,0 +1,37 @@ +from Configurables import GeoSvc +from Configurables import ApplicationMgr +from Configurables import CreateFCCeeCaloXTalkNeighbours +import os +from Gaudi.Configuration import INFO, DEBUG + +# Detector geometry +geoservice = GeoSvc("GeoSvc") +# if K4GEO is empty, this should use relative path to working directory +path_to_detector = os.environ.get("K4GEO", "") +print(path_to_detector) +detectors_to_use = [ + 'FCCee/ALLEGRO/compact/ALLEGRO_o1_v02/ALLEGRO_o1_v02.xml' +] + +# prefix all xmls with path_to_detector +geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use] +geoservice.OutputLevel = INFO + +# create the crosstalk neighbour file for ECAL barrel cells +neighbours = CreateFCCeeCaloXTalkNeighbours("xtalk_neighbours", + outputFileName="xtalk_neighbours_map_ecalB_thetamodulemerged.root", + readoutNames=["ECalBarrelModuleThetaMerged"], + systemNames=["system"], + systemValues=[4], + activeFieldNames=["layer"], + activeVolumesNumbers=[12], + OutputLevel=DEBUG) + +# ApplicationMgr +ApplicationMgr(TopAlg=[], + EvtSel='NONE', + EvtMax=1, + # order is important, as GeoSvc is needed by G4SimSvc + ExtSvc=[geoservice, neighbours], + OutputLevel=INFO + ) From 0f2f7c8d61ca95ebde7eb03401cc30c0f2dd4950 Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Tue, 16 Apr 2024 14:26:32 +0200 Subject: [PATCH 4/7] Adapt to the new headfile name of the k4geo update --- .../src/components/CreateFCCeeCaloXTalkNeighbours.h | 2 +- RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h index b73898a4..772da5d4 100644 --- a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h +++ b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.h @@ -12,7 +12,7 @@ // k4geo #include "detectorCommon/DetUtils_k4geo.h" -#include "detectorCommon/xtalk_k4geo.h" +#include "detectorCommon/xtalk_neighbors_moduleThetaMergedSegmentation.h" // DD4hep #include "DD4hep/Readout.h" diff --git a/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py b/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py index 3f9d7afe..6bf040e6 100644 --- a/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py +++ b/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py @@ -28,10 +28,10 @@ OutputLevel=DEBUG) # ApplicationMgr -ApplicationMgr(TopAlg=[], +ApplicationMgr(TopAlg=[neighbours], EvtSel='NONE', EvtMax=1, # order is important, as GeoSvc is needed by G4SimSvc - ExtSvc=[geoservice, neighbours], + ExtSvc=[geoservice], OutputLevel=INFO ) From f6695f3629b63d19618f718f06b4e62ddff8a46f Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Tue, 16 Apr 2024 14:30:24 +0200 Subject: [PATCH 5/7] revert neighbours to ExtSvc in the test --- RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py b/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py index 6bf040e6..3f9d7afe 100644 --- a/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py +++ b/RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py @@ -28,10 +28,10 @@ OutputLevel=DEBUG) # ApplicationMgr -ApplicationMgr(TopAlg=[neighbours], +ApplicationMgr(TopAlg=[], EvtSel='NONE', EvtMax=1, # order is important, as GeoSvc is needed by G4SimSvc - ExtSvc=[geoservice], + ExtSvc=[geoservice, neighbours], OutputLevel=INFO ) From e773b7cd4adec85cbd40e507cfaad768d86f452d Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Wed, 17 Apr 2024 11:57:33 +0200 Subject: [PATCH 6/7] change function name: xtalk_get_cell_indices --- .../src/components/CreateFCCeeCaloXTalkNeighbours.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp index fc3ad0ad..88d58e26 100644 --- a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp +++ b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp @@ -236,7 +236,7 @@ StatusCode CreateFCCeeCaloXTalkNeighbours::initialize() { moduleThetaSegmentation = dynamic_cast(aSegmentation); } - saveCellInfo=det::xtalk::xtalk_get_cell_position( + saveCellInfo=det::xtalk::xtalk_get_cell_indices( *moduleThetaSegmentation, *decoder, {m_activeFieldNamesSegmented[iSys],"module", "theta"}, From 2684b5c068131166a5ad975d3ee4f62290e89217 Mon Sep 17 00:00:00 2001 From: zwu0922 Date: Fri, 19 Apr 2024 10:45:57 +0200 Subject: [PATCH 7/7] Adapt to new k4geo function names for the crosstalk neighbours --- .../src/components/CreateFCCeeCaloXTalkNeighbours.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp index 88d58e26..28076a54 100644 --- a/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp +++ b/RecFCCeeCalorimeter/src/components/CreateFCCeeCaloXTalkNeighbours.cpp @@ -145,7 +145,7 @@ StatusCode CreateFCCeeCaloXTalkNeighbours::initialize() uint64_t id = cellId; map.insert(std::pair>>( id, - det::xtalk::xtalk_neighbours_ModuleThetaMerged( + det::crosstalk::getNeighboursModuleThetaMerged( *moduleThetaSegmentation, *decoder, {m_activeFieldNamesSegmented[iSys], @@ -236,7 +236,7 @@ StatusCode CreateFCCeeCaloXTalkNeighbours::initialize() { moduleThetaSegmentation = dynamic_cast(aSegmentation); } - saveCellInfo=det::xtalk::xtalk_get_cell_indices( + saveCellInfo=det::crosstalk::getCellIndices( *moduleThetaSegmentation, *decoder, {m_activeFieldNamesSegmented[iSys],"module", "theta"},