From 999610529d72a05316b60b432ed26cb31f5118e6 Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 27 Oct 2025 16:16:21 +0100 Subject: [PATCH 1/2] Improve segmentation of material LUT generation See https://its.cern.ch/jira/browse/O2-6417 for difference. --- Detectors/Base/test/buildMatBudLUT.C | 48 ++++++++++++++++------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/Detectors/Base/test/buildMatBudLUT.C b/Detectors/Base/test/buildMatBudLUT.C index 800597d6166fd..f4c04a770bdc3 100644 --- a/Detectors/Base/test/buildMatBudLUT.C +++ b/Detectors/Base/test/buildMatBudLUT.C @@ -17,19 +17,21 @@ #include "DetectorsBase/MatLayerCyl.h" #include "DetectorsBase/GeometryManager.h" #include "ITSMFTReconstruction/ChipMappingITS.h" +#include "ITS3Simulation/DescriptorInnerBarrelITS3.h" +#include "ITS3Base/SpecsV2.h" #include "CommonUtils/NameConf.h" #include #include #include #endif -#ifndef GPUCA_ALIGPUCODE // this part is unvisible on GPU version +#ifndef GPUCA_ALIGPUCODE // this part is invisible on GPU version o2::base::MatLayerCylSet mbLUT; bool testMBLUT(const std::string& lutFile = "matbud.root"); -bool buildMatBudLUT(int nTst = 30, int maxLr = -1, const std::string& outFile = "matbud.root", const std::string& geomNamePrefix = "o2sim", const std::string& opts = ""); +bool buildMatBudLUT(int nTst = 60, int maxLr = -1, const std::string& outFile = "matbud.root", const std::string& geomName = "o2sim_geometry-aligned.root"); struct LrData { float rMin = 0.f; @@ -44,17 +46,14 @@ struct LrData { std::vector lrData; void configLayers(); -bool buildMatBudLUT(int nTst, int maxLr, const std::string& outFile, const std::string& geomNamePrefix, const std::string& opts) +bool buildMatBudLUT(int nTst, int maxLr, const std::string& outFile, const std::string& geomNameInput) { - auto geomName = o2::base::NameConf::getGeomFileName(geomNamePrefix); + auto geomName = o2::base::NameConf::getGeomFileName(geomNameInput); if (gSystem->AccessPathName(geomName.c_str())) { // if needed, create geometry - std::cout << geomName << " does not exist. Will create it on the fly\n"; - std::stringstream str; - // constructing an **unaligned** geom (Geant3 used since faster initialization) --> can be avoided by passing an existing geometry - str << "${O2_ROOT}/bin/o2-sim-serial -n 0 -e TGeant3 --configKeyValues \"" << opts << "\" --field 0 -o " << geomNamePrefix; - gSystem->Exec(str.str().c_str()); + std::cout << geomName << " does not exist. Will create it\n"; + gSystem->Exec("$O2_ROOT/bin/o2-sim -n 0 --detectorList ALICE2.1"); } - o2::base::GeometryManager::loadGeometry(geomNamePrefix); + o2::base::GeometryManager::loadGeometry(geomNameInput); configLayers(); if (maxLr < 1) { @@ -64,7 +63,7 @@ bool buildMatBudLUT(int nTst, int maxLr, const std::string& outFile, const std:: } for (int i = 0; i < maxLr; i++) { auto& l = lrData[i]; - printf("L:%3d %6.2f Date: Mon, 27 Oct 2025 15:18:50 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- Detectors/Base/test/buildMatBudLUT.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Detectors/Base/test/buildMatBudLUT.C b/Detectors/Base/test/buildMatBudLUT.C index f4c04a770bdc3..243a0c60ded6f 100644 --- a/Detectors/Base/test/buildMatBudLUT.C +++ b/Detectors/Base/test/buildMatBudLUT.C @@ -249,7 +249,7 @@ void configLayers() // air space between Middle and Outer Barrels zSpanH = 80.f; zBin = 10.; - rphiBin = lrData.back().rMax* TMath::Pi() * 2 / 18; + rphiBin = lrData.back().rMax * TMath::Pi() * 2 / 18; lrData.emplace_back(LrData(lrData.back().rMax, 33.5, zSpanH, zBin, rphiBin)); //=================================================================================== @@ -305,16 +305,16 @@ void configLayers() zBin = 10.; rphiBin = lrData.back().rMax * TMath::Pi() * 2 / 18; lrData.emplace_back(LrData(lrData.back().rMax, 56.5, zSpanH, zBin, rphiBin)); - rphiBin = lrData.back().rMax * TMath::Pi() * 2 / 18; + rphiBin = lrData.back().rMax * TMath::Pi() * 2 / 18; lrData.emplace_back(LrData(lrData.back().rMax, 60.5, zSpanH, zBin, rphiBin)); - rphiBin = lrData.back().rMax * TMath::Pi() * 2 / 18; + rphiBin = lrData.back().rMax * TMath::Pi() * 2 / 18; lrData.emplace_back(LrData(lrData.back().rMax, 61.5, zSpanH, zBin, rphiBin)); zSpanH = 150.f; drStep = 3.5; zBin = 15.; do { - auto rmean = lrData.back().rMax + drStep / 2; + auto rmean = lrData.back().rMax + drStep / 2; rphiBin = rmean * TMath::Pi() * 2 / (NSect * 2); lrData.emplace_back(LrData(lrData.back().rMax, lrData.back().rMax + drStep, zSpanH, zBin, rphiBin)); } while (lrData.back().rMax < 68.5 - kToler);