From 680cdb66d1355981c4400ec6ece0a1acda4c7e0a Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Wed, 15 Jul 2026 11:57:04 +0200 Subject: [PATCH 01/21] new geometry --- .../DetectorsCommonDataFormats/SimTraits.h | 10 +- .../ALICE3/FD3/include/DataFormatsFD3/Hit.h | 4 +- .../FD3/base/include/FD3Base/Constants.h | 20 +- .../FD3/base/include/FD3Base/FD3BaseParam.h | 12 +- .../include/FD3Simulation/Detector.h | 33 ++- .../ALICE3/FD3/simulation/src/Detector.cxx | 277 +++++++++++------- 6 files changed, 213 insertions(+), 143 deletions(-) diff --git a/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h b/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h index 37c4b790d181b..9807b2e06e6e4 100644 --- a/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h +++ b/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h @@ -100,7 +100,7 @@ class SimTraits /*RCH*/ VS{ "RCHHit" }, /*MI3*/ VS{ "MI3Hit" }, /*ECL*/ VS{ "ECLHit" }, - /*FD */ VS{ "FDHit" } + /*FD3*/ VS{ "FD3Hit" } #endif }; // clang-format on @@ -172,6 +172,10 @@ namespace focal { class Hit; } +namespace fd3 +{ +class Hit; +} namespace detectors { @@ -256,6 +260,10 @@ template <> struct DetIDToHitTypes { using HitType = o2::itsmft::Hit; }; +template <> +struct DetIDToHitTypes { + using HitType = o2::fd3::Hit; +}; #endif } // namespace detectors diff --git a/DataFormats/Detectors/Upgrades/ALICE3/FD3/include/DataFormatsFD3/Hit.h b/DataFormats/Detectors/Upgrades/ALICE3/FD3/include/DataFormatsFD3/Hit.h index 4fde2f6cde6b4..58ced0a163dc8 100644 --- a/DataFormats/Detectors/Upgrades/ALICE3/FD3/include/DataFormatsFD3/Hit.h +++ b/DataFormats/Detectors/Upgrades/ALICE3/FD3/include/DataFormatsFD3/Hit.h @@ -12,8 +12,8 @@ /// \file Hit.h /// \brief Definition of the FD3 Hit class (based on ITSMFT and FV0) -#ifndef ALICEO2_FVD_HIT_H_ -#define ALICEO2_FVD_HIT_H_ +#ifndef ALICEO2_FD3_HIT_H_ +#define ALICEO2_FD3_HIT_H_ #include #include "SimulationDataFormat/BaseHits.h" // for BasicXYZEHit diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 428a7a1f6d179..a7205888f4e6b 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -23,14 +23,22 @@ namespace fd3 { struct Constants { static constexpr unsigned int nsect = 8; - static constexpr unsigned int nringsA = 5; - static constexpr unsigned int nringsC = 6; + static constexpr unsigned int nringsScint = 5; + static constexpr unsigned int nringsCher = 1; - static constexpr float etaMax = 7.0f; - static constexpr float etaMin = 4.0f; + static constexpr float dzscint = 4.0f; + static constexpr float dzcher = 4.0f; - static constexpr unsigned int nringsA_withMG = 3; - static constexpr float etaMinA_withMG = 5.0f; + static constexpr float etaMin_scintA = 2.5f; + static constexpr float etaMax_scintA = 5.5f; + static constexpr float etaMin_scintC = -4.9f; + static constexpr float etaMax_scintC = -2.5f; + static constexpr float etaMin_cherA = 4.0f; + static constexpr float etaMax_cherA = 5.5f; + static constexpr float etaMin_cherC = -4.9f; + static constexpr float etaMax_cherC = -4.0f; + static constexpr float zscint = 410.0f; + static constexpr float zcher = 430.0f; }; } // namespace fd3 diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h index 9836cebbfa760..86eb48e926608 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h @@ -15,22 +15,14 @@ #include "FD3Base/GeometryTGeo.h" #include "FD3Base/Constants.h" #include "CommonUtils/ConfigurableParamHelper.h" +#include namespace o2 { namespace fd3 { -struct FD3BaseParam : public o2::conf::ConfigurableParamHelper { - - float zmodA = 1700.0f; - float zmodC = -1850.0f; - float dzscint = 4.0f; - bool withMG = false; // modified geometry with 3 rings on A side - - bool plateBehindA = false; - bool fullContainer = false; - float dzplate = 1.0f; // Aluminium plate width +struct FD3BaseParam : public o2::conf::ConfigurableParamHelper { O2ParamDef(FD3BaseParam, "FD3Base"); }; diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h index 2d17acbd4a0e8..a83ecab7bb899 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h @@ -57,8 +57,12 @@ class Detector : public o2::base::DetImpl o2::fd3::Hit* addHit(int trackId, unsigned int detId, const math_utils::Point3D& startPos, const math_utils::Point3D& endPos, - const math_utils::Vector3D& startMom, double startE, - double endTime, double eLoss, int particlePdg); + const math_utils::Vector3D& startMom, + double startE, + double endTime, + double eLoss, + int particlePdg); + // unsigned int startStatus, // unsigned int endStatus); @@ -86,7 +90,9 @@ class Detector : public o2::base::DetImpl enum EMedia { Scintillator, - Aluminium + Aluminium, + MCPGlass, + RadiatorOpticalGlass }; private: @@ -96,20 +102,19 @@ class Detector : public o2::base::DetImpl std::vector* mHits = nullptr; GeometryTGeo* mGeometryTGeo = nullptr; - TGeoVolumeAssembly* buildModuleA(); - TGeoVolumeAssembly* buildModuleC(); - - float ringSize(float zmod, float eta); - - unsigned int mNumberOfRingsA, mNumberOfRingsC, mNumberOfSectors; - float mDzScint, mDzPlate; + TGeoVolumeAssembly* buildModuleScintA(); + TGeoVolumeAssembly* buildModuleScintC(); + TGeoVolumeAssembly* buildModuleCherA(); + TGeoVolumeAssembly* buildModuleCherC(); - std::vector mRingSizesA = {}, mRingSizesC = {}; + float getRingSize(float zmod, float eta); - float mEtaMaxA, mEtaMaxC, mEtaMinA, mEtaMinC; - float mZA, mZC; + unsigned int mNumberOfRingsScint, mNumberOfRingsCher, mNumberOfSectors; + float mDzScint, mDzCher; - bool mPlateBehindA, mFullContainer; + float mEtaMinScintA, mEtaMaxScintA, mEtaMinScintC, mEtaMaxScintC; + float mEtaMaxCherA, mEtaMinCherA, mEtaMaxCherC, mEtaMinCherC; + float mZScint, mZCher; void defineSensitiveVolumes(); void definePassiveVolumes(); diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index bd79b1deaad80..9dcc7b72d9ec3 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -56,44 +56,24 @@ Detector::Detector(bool active) mGeometryTGeo(nullptr), mTrackData() { - mNumberOfRingsC = Constants::nringsC; + mNumberOfRingsScint = Constants::nringsScint; + mNumberOfRingsCher = Constants::nringsCher; mNumberOfSectors = Constants::nsect; - - mEtaMinA = Constants::etaMin; - mEtaMaxA = Constants::etaMax; - mEtaMinC = -Constants::etaMax; - mEtaMaxC = -Constants::etaMin; + mDzScint = Constants::dzscint / 2; + mDzCher = Constants::dzcher / 2; auto& baseParam = FD3BaseParam::Instance(); - if (baseParam.withMG) { - mNumberOfRingsA = Constants::nringsA_withMG; - mEtaMinA = Constants::etaMinA_withMG; - } else { - mNumberOfRingsA = Constants::nringsA; - mEtaMinA = Constants::etaMin; - } - - mDzScint = baseParam.dzscint / 2; - mDzPlate = baseParam.dzplate; - - mPlateBehindA = baseParam.plateBehindA; - mFullContainer = baseParam.fullContainer; - - mZA = baseParam.zmodA; - mZC = baseParam.zmodC; - - for (int i = 0; i <= mNumberOfRingsA + 1; i++) { - float eta = mEtaMaxA - i * (mEtaMaxA - mEtaMinA) / mNumberOfRingsA; - float r = ringSize(mZA, eta); - mRingSizesA.emplace_back(r); - } - - for (int i = 0; i <= mNumberOfRingsC + 1; i++) { - float eta = mEtaMinC + i * (mEtaMaxC - mEtaMinC) / mNumberOfRingsC; - float r = ringSize(mZC, eta); - mRingSizesC.emplace_back(r); - } + mEtaMinScintA = Constants::etaMin_scintA; + mEtaMinScintC = Constants::etaMin_scintC; + mEtaMinCherA = Constants::etaMin_cherA; + mEtaMinCherC = Constants::etaMin_cherC; + mEtaMaxScintA = Constants::etaMax_scintA; + mEtaMaxScintC = Constants::etaMax_scintC; + mEtaMaxCherA = Constants::etaMax_cherA; + mEtaMaxCherC = Constants::etaMax_cherC; + mZScint = Constants::zscint; + mZCher = Constants::zcher; } Detector::Detector(const Detector& rhs) @@ -105,7 +85,6 @@ Detector::Detector(const Detector& rhs) Detector& Detector::operator=(const Detector& rhs) { - if (this == &rhs) { return *this; } @@ -130,6 +109,7 @@ void Detector::InitializeO2Detector() LOG(info) << "Initialize Forward Detector"; mGeometryTGeo = GeometryTGeo::Instance(); defineSensitiveVolumes(); + definePassiveVolumes(); } bool Detector::ProcessHits(FairVolume* vol) @@ -202,12 +182,6 @@ o2::fd3::Hit* Detector::addHit(int trackId, unsigned int detId, return &(mHits->back()); } -void Detector::ConstructGeometry() -{ - createMaterials(); - buildModules(); -} - void Detector::EndOfEvent() { Reset(); @@ -231,6 +205,12 @@ void Detector::Reset() } } +void Detector::ConstructGeometry() +{ + createMaterials(); + buildModules(); +} + void Detector::createMaterials() { float density, as[11], zs[11], ws[11]; @@ -252,57 +232,85 @@ void Detector::createMaterials() int matId = 0; // tmp material id number const int unsens = 0, sens = 1; // sensitive or unsensitive medium // - int fieldType = 3; // Field type - float maxField = 5.0; // Field max. - float tmaxfd3 = -10.0; // max deflection angle due to magnetic field in one step - float stemax = 0.1; // max step allowed [cm] - float deemax = 1.0; // maximum fractional energy loss in one step 0Integ(); + maxField = 10.; // magneticField->Max(); + + // Radiator glass SiO2 + Float_t aglass[2] = {28.0855, 15.9994}; + Float_t zglass[2] = {14., 8.}; + Float_t wglass[2] = {1., 2.}; + Float_t dglass = 2.2; + // MCP glass SiO2 + Float_t dglass_mcp = 1.3; + + o2::base::Detector::Mixture(++matId, "MCP glass", aglass, zglass, dglass_mcp, -2, wglass); + o2::base::Detector::Medium(MCPGlass, "Glass", matId, unsens, fieldType, maxField, + 10., .01, .1, .003, .003); + o2::base::Detector::Mixture(++matId, "Radiator optical glass", aglass, zglass, dglass, -2, wglass); + o2::base::Detector::Medium(RadiatorOpticalGlass, "OpticalGlass$", matId, sens, fieldType, maxField, + 10., .01, .1, .003, .01); } void Detector::buildModules() { LOGP(info, "Creating FD3 geometry"); - TGeoVolume* vCave = gGeoManager->GetVolume("cave"); + auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel"); - if (!vCave) { - LOG(fatal) << "Could not find the top volume!"; - } + TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA(); + TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC(); + TGeoVolumeAssembly* vFD3_CherA = buildModuleCherA(); + TGeoVolumeAssembly* vFD3_CherC = buildModuleCherC(); - TGeoVolumeAssembly* vFD3A = buildModuleA(); - TGeoVolumeAssembly* vFD3C = buildModuleC(); + topVolume->AddNode(vFD3_ScintA, 1, new TGeoTranslation(0., 30.f, mZScint)); + topVolume->AddNode(vFD3_ScintC, 1, new TGeoTranslation(0., 30.f, -mZScint)); - vCave->AddNode(vFD3A, 1, new TGeoTranslation(0., 0., mZA)); - vCave->AddNode(vFD3C, 2, new TGeoTranslation(0., 0., mZC)); + topVolume->AddNode(vFD3_CherA, 1, new TGeoTranslation(0., 30.f, mZCher)); + topVolume->AddNode(vFD3_CherC, 1, new TGeoTranslation(0., 30.f, -mZCher)); } -TGeoVolumeAssembly* Detector::buildModuleA() +TGeoVolumeAssembly* Detector::buildModuleScintA() { - TGeoVolumeAssembly* mod = new TGeoVolumeAssembly("FD3A"); + auto mod = new TGeoVolumeAssembly("FD3_ScintA"); const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator"); float dphiDeg = 360. / mNumberOfSectors; - for (int ir = 0; ir < mNumberOfRingsA; ir++) { + for (int ir = 0; ir < mNumberOfRingsScint; ir++) { std::string rName = "fd3_ring" + std::to_string(ir + 1); - TGeoVolumeAssembly* ring = new TGeoVolumeAssembly(rName.c_str()); - float rmin = mRingSizesA[ir]; - float rmax = mRingSizesA[ir + 1]; - LOG(info) << "ring" << ir << ": from " << rmin << " to " << rmax; + auto ring = new TGeoVolumeAssembly(rName.c_str()); + float etaMin = mEtaMaxScintA - (ir + 1) * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint; + float etaMax = mEtaMaxScintA - ir * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint; + float zmod = mZScint; + float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); + LOG(info) << "Scintillator ring" << ir << ": from " << rmin << " to " << rmax; for (int ic = 0; ic < mNumberOfSectors; ic++) { int cellId = ic + mNumberOfSectors * ir; std::string nodeName = "fd3_node" + std::to_string(cellId); @@ -317,42 +325,30 @@ TGeoVolumeAssembly* Detector::buildModuleA() } ring->AddNode(nod, cellId); } - mod->AddNode(ring, ir + 1); + mod->AddNode(ring, 1); } - // Aluminium plates on one or both sides of the A side module - if (mPlateBehindA || mFullContainer) { - LOG(info) << "adding container on A side"; - auto pmed = (TGeoMedium*)gGeoManager->GetMedium("FD3_Aluminium"); - auto pvol = new TGeoTube("pvol_fd3a", mRingSizesA[0], mRingSizesA[mNumberOfRingsA], mDzPlate); - auto pnod1 = new TGeoVolume("pnod1_FD3A", pvol, pmed); - double dpz = 2. + mDzPlate / 2; - mod->AddNode(pnod1, 1, new TGeoTranslation(0, 0, dpz)); - - if (mFullContainer) { - auto pnod2 = new TGeoVolume("pnod2_FD3A", pvol, pmed); - mod->AddNode(pnod2, 1, new TGeoTranslation(0, 0, -dpz)); - } - } return mod; } -TGeoVolumeAssembly* Detector::buildModuleC() +TGeoVolumeAssembly* Detector::buildModuleScintC() { - TGeoVolumeAssembly* mod = new TGeoVolumeAssembly("FD3C"); + auto mod = new TGeoVolumeAssembly("FD3_ScintC"); const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator"); float dphiDeg = 360. / mNumberOfSectors; - for (int ir = 0; ir < mNumberOfRingsC; ir++) { - std::string rName = "fd3_ring" + std::to_string(ir + 1 + mNumberOfRingsA); - TGeoVolumeAssembly* ring = new TGeoVolumeAssembly(rName.c_str()); - float rmin = mRingSizesC[ir]; - float rmax = mRingSizesC[ir + 1]; - LOG(info) << "ring" << ir + mNumberOfRingsA << ": from " << rmin << " to " << rmax; + for (int ir = 0; ir < mNumberOfRingsScint; ir++) { + std::string rName = "fd3_ring" + std::to_string(ir + 1 + mNumberOfRingsScint); + auto ring = new TGeoVolumeAssembly(rName.c_str()); + float etaMin = mEtaMinScintC + ir * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint; + float etaMax = mEtaMinScintC + (ir + 1) * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint; + float zmod = -mZScint; + float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); + LOG(info) << "Scintillator ring" << ir + mNumberOfRingsScint << ": from " << rmin << " to " << rmax; for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * (ir + mNumberOfRingsA); + int cellId = ic + mNumberOfSectors * (ir + mNumberOfRingsScint); std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); @@ -365,20 +361,79 @@ TGeoVolumeAssembly* Detector::buildModuleC() } ring->AddNode(nod, cellId); } - mod->AddNode(ring, ir + 1); + mod->AddNode(ring, 1); + } + + return mod; +} + +TGeoVolumeAssembly* Detector::buildModuleCherA() +{ + auto mod = new TGeoVolumeAssembly("FD3_CherA"); + + const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); + + float dphiDeg = 360.; // / mNumberOfSectors; + + for (int ir = 0; ir < 1; ir++) { + std::string rName = "fd3_ring" + std::to_string(ir + 1 + 2 * mNumberOfRingsScint); + auto ring = new TGeoVolumeAssembly(rName.c_str()); + float etaMin = mEtaMaxCherA - (ir + 1) * (mEtaMaxCherA - mEtaMinCherA) / mNumberOfRingsCher; + float etaMax = mEtaMaxCherA - ir * (mEtaMaxCherA - mEtaMinCherA) / mNumberOfRingsCher; + float zmod = mZCher; + float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); + LOG(info) << "Radiator ring" << ir << ": from " << rmin << " to " << rmax; + for (int ic = 0; ic < mNumberOfSectors; ic++) { + int cellId = ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint); + std::string nodeName = "fd3_node" + std::to_string(cellId); + float phimin = dphiDeg * ic; + float phimax = dphiDeg * (ic + 1); + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax); + auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); + if ((ir + ic) % 2 == 0) { + nod->SetLineColor(kOrange); + } else { + nod->SetLineColor(kOrange - 7); + } + ring->AddNode(nod, cellId); + } + mod->AddNode(ring, 1); } - // Aluminium plates on both sides of the C side module - if (mFullContainer) { - LOG(info) << "adding container on C side"; - auto pmed = (TGeoMedium*)gGeoManager->GetMedium("FD3_Aluminium"); - auto pvol = new TGeoTube("pvol_fd3c", mRingSizesC[0], mRingSizesC[mNumberOfRingsC], mDzPlate); - auto pnod1 = new TGeoVolume("pnod1_FD3C", pvol, pmed); - auto pnod2 = new TGeoVolume("pnod2_FD3C", pvol, pmed); - double dpz = mDzScint / 2 + mDzPlate / 2; - - mod->AddNode(pnod1, 1, new TGeoTranslation(0, 0, dpz)); - mod->AddNode(pnod2, 2, new TGeoTranslation(0, 0, -dpz)); + return mod; +} + +TGeoVolumeAssembly* Detector::buildModuleCherC() +{ + auto mod = new TGeoVolumeAssembly("FD3_CherC"); + + const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); + + float dphiDeg = 360.; // / mNumberOfSectors; + + for (int ir = 0; ir < 1; ir++) { + std::string rName = "fd3_ring" + std::to_string(ir + 1 + 2 * mNumberOfRingsScint + mNumberOfRingsCher); + auto ring = new TGeoVolumeAssembly(rName.c_str()); + float etaMin = mEtaMinCherC + ir * (mEtaMaxCherC - mEtaMinCherC) / mNumberOfRingsCher; + float etaMax = mEtaMinCherC + (ir + 1) * (mEtaMaxCherC - mEtaMinCherC) / mNumberOfRingsCher; + float zmod = -mZCher; + float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); + LOG(info) << "Radiator ring" << ir + mNumberOfRingsCher << ": from " << rmin << " to " << rmax; + for (int ic = 0; ic < mNumberOfSectors; ic++) { + int cellId = ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint) + mNumberOfRingsCher; + std::string nodeName = "fd3_node" + std::to_string(cellId); + float phimin = dphiDeg * ic; + float phimax = dphiDeg * (ic + 1); + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax); + auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); + if ((ir + ic) % 2 == 0) { + nod->SetLineColor(kMagenta); + } else { + nod->SetLineColor(kMagenta - 7); + } + ring->AddNode(nod, cellId); + } + mod->AddNode(ring, 1); } return mod; @@ -389,23 +444,25 @@ void Detector::defineSensitiveVolumes() LOG(info) << "Adding FD3 Sentitive Volumes"; TGeoVolume* v; - TString volumeName; - int nCellsA = mNumberOfRingsA * mNumberOfSectors; - int nCellsC = mNumberOfRingsC * mNumberOfSectors; + int nv = 2 * mNumberOfRingsScint * mNumberOfSectors + 2 * mNumberOfRingsCher; - LOG(info) << "number of A rings = " << mNumberOfRingsA << " number of cells = " << nCellsA; - LOG(info) << "number of C rings = " << mNumberOfRingsC << " number of cells = " << nCellsC; + LOG(info) << "number of cells = " << nv; - for (int iv = 0; iv < nCellsA + nCellsC; iv++) { - volumeName = "fd3_node" + std::to_string(iv); + for (int iv = 0; iv < nv; iv++) { + TString volumeName = "fd3_node" + std::to_string(iv); + LOG(info) << "nr " << iv << " volume " << volumeName; v = gGeoManager->GetVolume(volumeName); - LOG(info) << "Adding sensitive volume => " << v->GetName(); AddSensitiveVolume(v); } } -float Detector::ringSize(float z, float eta) +void Detector::definePassiveVolumes() +{ + // To be added later +} + +float Detector::getRingSize(float z, float eta) { return z * TMath::Tan(2 * TMath::ATan(TMath::Exp(-eta))); } From de62c6ce9c0adeffefe89a8baaa1159d2d9c7373 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Wed, 15 Jul 2026 11:57:54 +0200 Subject: [PATCH 02/21] new geometry --- Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 9dcc7b72d9ec3..50c9df747580d 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -447,10 +447,7 @@ void Detector::defineSensitiveVolumes() int nv = 2 * mNumberOfRingsScint * mNumberOfSectors + 2 * mNumberOfRingsCher; - LOG(info) << "number of cells = " << nv; - for (int iv = 0; iv < nv; iv++) { - TString volumeName = "fd3_node" + std::to_string(iv); LOG(info) << "nr " << iv << " volume " << volumeName; v = gGeoManager->GetVolume(volumeName); AddSensitiveVolume(v); From 986b4c1412b2e3c8cfb1bb6e05b7638a8125801b Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sat, 18 Jul 2026 16:42:32 +0200 Subject: [PATCH 03/21] added asymmetric configuration --- .../FD3/base/include/FD3Base/Constants.h | 10 +++++++--- .../FD3/base/include/FD3Base/FD3BaseParam.h | 2 ++ .../ALICE3/FD3/simulation/src/Detector.cxx | 18 ++++++++++-------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index a7205888f4e6b..2c5ecb650b204 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -30,13 +30,17 @@ struct Constants { static constexpr float dzcher = 4.0f; static constexpr float etaMin_scintA = 2.5f; - static constexpr float etaMax_scintA = 5.5f; + static constexpr float etaMax_scintA_v1 = 4.9f; + static constexpr float etaMax_scintA_v2 = 5.5f; + static constexpr float etaMin_cherA = 4.0f; + static constexpr float etaMax_cherA_v1 = 4.9f; + static constexpr float etaMax_cherA_v2 = 5.5f; + static constexpr float etaMin_scintC = -4.9f; static constexpr float etaMax_scintC = -2.5f; - static constexpr float etaMin_cherA = 4.0f; - static constexpr float etaMax_cherA = 5.5f; static constexpr float etaMin_cherC = -4.9f; static constexpr float etaMax_cherC = -4.0f; + static constexpr float zscint = 410.0f; static constexpr float zcher = 430.0f; }; diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h index 86eb48e926608..ce8d08e758150 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h @@ -24,6 +24,8 @@ namespace fd3 struct FD3BaseParam : public o2::conf::ConfigurableParamHelper { + bool isSymmetric = true; + O2ParamDef(FD3BaseParam, "FD3Base"); }; diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 50c9df747580d..adb3e326b85de 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -65,13 +65,15 @@ Detector::Detector(bool active) auto& baseParam = FD3BaseParam::Instance(); mEtaMinScintA = Constants::etaMin_scintA; - mEtaMinScintC = Constants::etaMin_scintC; mEtaMinCherA = Constants::etaMin_cherA; + mEtaMaxScintA = baseParam.isSymmetric ? Constants::etaMax_scintA_v1 : Constants::etaMax_scintA_v2; + mEtaMaxCherA = baseParam.isSymmetric ? Constants::etaMax_cherA_v1 : Constants::etaMax_cherA_v2; + + mEtaMinScintC = Constants::etaMin_scintC; mEtaMinCherC = Constants::etaMin_cherC; - mEtaMaxScintA = Constants::etaMax_scintA; mEtaMaxScintC = Constants::etaMax_scintC; - mEtaMaxCherA = Constants::etaMax_cherA; mEtaMaxCherC = Constants::etaMax_cherC; + mZScint = Constants::zscint; mZCher = Constants::zcher; } @@ -445,12 +447,12 @@ void Detector::defineSensitiveVolumes() TGeoVolume* v; - int nv = 2 * mNumberOfRingsScint * mNumberOfSectors + 2 * mNumberOfRingsCher; + int nvol = 2 * mNumberOfRingsScint * mNumberOfSectors + 2 * mNumberOfRingsCher; - for (int iv = 0; iv < nv; iv++) { - LOG(info) << "nr " << iv << " volume " << volumeName; - v = gGeoManager->GetVolume(volumeName); - AddSensitiveVolume(v); + for (int ivol = 0; ivol < nvol; ivol++) { + TString volumeName = "fd3_node" + std::to_string(ivol); + v = gGeoManager->GetVolume(volumeName); + AddSensitiveVolume(v); } } From ce48a1cbaddf3e4ba34b43362816ef4e1088c2f1 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sat, 18 Jul 2026 16:44:49 +0200 Subject: [PATCH 04/21] added asymmetric configuration --- Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index adb3e326b85de..1819285cd8807 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -73,7 +73,7 @@ Detector::Detector(bool active) mEtaMinCherC = Constants::etaMin_cherC; mEtaMaxScintC = Constants::etaMax_scintC; mEtaMaxCherC = Constants::etaMax_cherC; - + mZScint = Constants::zscint; mZCher = Constants::zcher; } @@ -450,9 +450,9 @@ void Detector::defineSensitiveVolumes() int nvol = 2 * mNumberOfRingsScint * mNumberOfSectors + 2 * mNumberOfRingsCher; for (int ivol = 0; ivol < nvol; ivol++) { - TString volumeName = "fd3_node" + std::to_string(ivol); - v = gGeoManager->GetVolume(volumeName); - AddSensitiveVolume(v); + TString volumeName = "fd3_node" + std::to_string(ivol); + v = gGeoManager->GetVolume(volumeName); + AddSensitiveVolume(v); } } From e51e2532c46e98b7174493190e2dcc9f529f9c4c Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Mon, 20 Jul 2026 21:15:21 +0200 Subject: [PATCH 05/21] Added functions for Cherenkov module segmentation --- .../include/FD3Simulation/Detector.h | 8 +- .../ALICE3/FD3/simulation/src/Detector.cxx | 168 +++++++++++++++--- 2 files changed, 148 insertions(+), 28 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h index a83ecab7bb899..a437f64a678c9 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h @@ -104,8 +104,12 @@ class Detector : public o2::base::DetImpl TGeoVolumeAssembly* buildModuleScintA(); TGeoVolumeAssembly* buildModuleScintC(); - TGeoVolumeAssembly* buildModuleCherA(); - TGeoVolumeAssembly* buildModuleCherC(); + TGeoVolumeAssembly* buildModuleCherenkovA(); + TGeoVolumeAssembly* buildModuleCherenkovC(); + TGeoVolumeAssembly* buildModuleCherenkov_v1(); + TGeoVolumeAssembly* buildModuleCherenkov_v2(); + + int mChannelsCounter; float getRingSize(float zmod, float eta); diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 1819285cd8807..3ecdb0cc015c4 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -59,8 +59,8 @@ Detector::Detector(bool active) mNumberOfRingsScint = Constants::nringsScint; mNumberOfRingsCher = Constants::nringsCher; mNumberOfSectors = Constants::nsect; - mDzScint = Constants::dzscint / 2; - mDzCher = Constants::dzcher / 2; + mDzScint = Constants::dzscint; + mDzCher = Constants::dzcher; auto& baseParam = FD3BaseParam::Instance(); @@ -241,7 +241,7 @@ void Detector::createMaterials() fieldType = 3; // Field type maxField = 5.0; // Field max. // o2::base::Detector::initFieldTrackingParams(fieldType, maxField); - LOG(info) << "FV0: createMaterials(): fieldType " << fieldType << ", maxField " << maxField; + LOG(info) << "FD3: createMaterials(): fieldType " << fieldType << ", maxField " << maxField; float tmaxfd3 = -10.0; // max deflection angle due to magnetic field in one step float stepmax = 0.1; // max step allowed [cm] @@ -252,7 +252,7 @@ void Detector::createMaterials() LOG(info) << "FD3: CreateMaterials(): fieldType " << fieldType << ", maxField " << maxField; o2::base::Detector::Mixture(++matId, "Scintillator", aScint, zScint, dScint, nScint, wScint); - o2::base::Detector::Medium(Scintillator, "Scintillator", matId, unsens, fieldType, maxField, + o2::base::Detector::Medium(Scintillator, "Scintillator", matId, sens, fieldType, maxField, tmaxfd3, stepmax, deemax, epsil, stepmin); o2::base::Detector::Material(++matId, "Aluminium", aAlu, zAlu, dAlu, 8.9, 999); @@ -268,11 +268,12 @@ void Detector::createMaterials() Float_t zglass[2] = {14., 8.}; Float_t wglass[2] = {1., 2.}; Float_t dglass = 2.2; + // MCP glass SiO2 Float_t dglass_mcp = 1.3; o2::base::Detector::Mixture(++matId, "MCP glass", aglass, zglass, dglass_mcp, -2, wglass); - o2::base::Detector::Medium(MCPGlass, "Glass", matId, unsens, fieldType, maxField, + o2::base::Detector::Medium(MCPGlass, "Glass", matId, sens, fieldType, maxField, 10., .01, .1, .003, .003); o2::base::Detector::Mixture(++matId, "Radiator optical glass", aglass, zglass, dglass, -2, wglass); o2::base::Detector::Medium(RadiatorOpticalGlass, "OpticalGlass$", matId, sens, fieldType, maxField, @@ -285,10 +286,16 @@ void Detector::buildModules() auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel"); + mChannelsCounter = 0; + TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA(); TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC(); - TGeoVolumeAssembly* vFD3_CherA = buildModuleCherA(); - TGeoVolumeAssembly* vFD3_CherC = buildModuleCherC(); + TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkovA(); + TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkovC(); + // TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkov_v1(); + // TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkov_v1(); + vFD3_CherA->SetName("FD3_CherA"); + vFD3_CherC->SetName("FD3_CherC"); topVolume->AddNode(vFD3_ScintA, 1, new TGeoTranslation(0., 30.f, mZScint)); topVolume->AddNode(vFD3_ScintC, 1, new TGeoTranslation(0., 30.f, -mZScint)); @@ -314,11 +321,11 @@ TGeoVolumeAssembly* Detector::buildModuleScintA() float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); LOG(info) << "Scintillator ring" << ir << ": from " << rmin << " to " << rmax; for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * ir; + int cellId = mChannelsCounter++; // ic + mNumberOfSectors * ir; std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax); + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); if ((ir + ic) % 2 == 0) { nod->SetLineColor(kRed); @@ -350,11 +357,11 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); LOG(info) << "Scintillator ring" << ir + mNumberOfRingsScint << ": from " << rmin << " to " << rmax; for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * (ir + mNumberOfRingsScint); + int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + mNumberOfRingsScint); std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax); + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); if ((ir + ic) % 2 == 0) { nod->SetLineColor(kBlue); @@ -369,7 +376,7 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() return mod; } -TGeoVolumeAssembly* Detector::buildModuleCherA() +TGeoVolumeAssembly* Detector::buildModuleCherenkovA() { auto mod = new TGeoVolumeAssembly("FD3_CherA"); @@ -385,12 +392,12 @@ TGeoVolumeAssembly* Detector::buildModuleCherA() float zmod = mZCher; float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); LOG(info) << "Radiator ring" << ir << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint); + for (int ic = 0; ic < 1 /*mNumberOfSectors */; ic++) { + int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint); std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax); + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); if ((ir + ic) % 2 == 0) { nod->SetLineColor(kOrange); @@ -405,7 +412,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherA() return mod; } -TGeoVolumeAssembly* Detector::buildModuleCherC() +TGeoVolumeAssembly* Detector::buildModuleCherenkovC() { auto mod = new TGeoVolumeAssembly("FD3_CherC"); @@ -421,12 +428,12 @@ TGeoVolumeAssembly* Detector::buildModuleCherC() float zmod = -mZCher; float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); LOG(info) << "Radiator ring" << ir + mNumberOfRingsCher << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint) + mNumberOfRingsCher; + for (int ic = 0; ic < 1 /* mNumberOfSectors */; ic++) { + int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint) + mNumberOfRingsCher; std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax); + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); if ((ir + ic) % 2 == 0) { nod->SetLineColor(kMagenta); @@ -441,17 +448,126 @@ TGeoVolumeAssembly* Detector::buildModuleCherC() return mod; } -void Detector::defineSensitiveVolumes() +TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() { - LOG(info) << "Adding FD3 Sentitive Volumes"; + auto mod = new TGeoVolumeAssembly("FD3_Ch"); + + TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); + + const int N = 68; + + double x[N], y[N]; + + const double rr = 6.; // inner circle + const double rsize = 1.6; // transverse size of a channel + + for (int i = 0; i < 3; i++) { + x[i] = rsize * (2 * i + 1) + rr; + y[i] = 0.; + } + for (int i = 3; i < 6; i++) { + x[i] = rsize * (2 * (i - 3) + 1) + rr; + y[i] = -2 * rsize; + } + for (int i = 6; i < 9; i++) { + x[i] = rsize * (2 * (i - 6) + 1) + rr; + y[i] = 2 * rsize; + } + + for (int i = 9; i < 12; i++) { + x[i] = 4 * rsize + rsize * (2 * (i - 9)); + y[i] = 4 * rsize; + } + for (int i = 12; i < 15; i++) { + x[i] = 4 * rsize + rsize * (2 * (i - 12)); + y[i] = 6 * rsize; + } + for (int i = 15; i < 17; i++) { + x[i] = 4 * rsize + rsize * (2 * (i - 15)); + y[i] = 8 * rsize; + } + + for (int i = 0; i < 17; i++) { + x[i + 17] = -y[i]; + y[i + 17] = x[i]; + x[i + 34] = -x[i]; + y[i + 34] = -y[i]; + x[i + 51] = y[i]; + y[i + 51] = -x[i]; + } + + for (int i = 0; i < N; i++) { + int cellId = mChannelsCounter++; + std::string nodeName = "fd3_node" + std::to_string(cellId); + auto cell = (TGeoVolume*)gGeoManager->MakeBox(nodeName.c_str(), medium, rsize - 0.05, rsize - 0.05, mDzCher / 2); + cell->SetLineColor(kOrange + 7); + mod->AddNode(cell, 1, new TGeoTranslation(x[i], y[i], 0)); + } + + return mod; +} + +TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() +{ + auto mod = new TGeoVolumeAssembly("FD3_Ch"); + + TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); + + const int N = 68; - TGeoVolume* v; + double x[N], y[N]; - int nvol = 2 * mNumberOfRingsScint * mNumberOfSectors + 2 * mNumberOfRingsCher; + const double rr = 3.; // inner circle + const double rsize = 1.6; // transverse size of a channel + + for (int i = 0; i < 4; i++) { + x[i] = rsize * (2 * i + 1) + rr; + y[i] = 0.; + } + for (int i = 4; i < 8; i++) { + x[i] = rsize * (2 * (i - 4 + 1)); + y[i] = 2 * rsize; + } + for (int i = 8; i < 12; i++) { + x[i] = rsize * (2 * (i - 8 + 1)); + y[i] = 4 * rsize; + } + for (int i = 12; i < 15; i++) { + x[i] = rsize * (2 * (i - 12 + 1)); + y[i] = 6 * rsize; + } + for (int i = 15; i < 17; i++) { + x[i] = rsize * (2 * (i - 15 + 1)); + y[i] = 8 * rsize; + } + + for (int i = 0; i < 17; i++) { + x[i + 17] = -y[i]; + y[i + 17] = x[i]; + x[i + 34] = -x[i]; + y[i + 34] = -y[i]; + x[i + 51] = y[i]; + y[i + 51] = -x[i]; + } + + for (int i = 0; i < N; i++) { + int cellId = mChannelsCounter++; + std::string nodeName = "fd3_node" + std::to_string(cellId); + auto cell = (TGeoVolume*)gGeoManager->MakeBox(nodeName.c_str(), medium, rsize - 0.005, rsize - 0.05, mDzCher / 2); + cell->SetLineColor(kOrange + 7); + mod->AddNode(cell, 1, new TGeoTranslation(x[i], y[i], 0)); + } + + return mod; +} + +void Detector::defineSensitiveVolumes() +{ + LOG(info) << "Adding FD3 Sentitive Volumes"; - for (int ivol = 0; ivol < nvol; ivol++) { - TString volumeName = "fd3_node" + std::to_string(ivol); - v = gGeoManager->GetVolume(volumeName); + for (int ivol = 0; ivol < mChannelsCounter; ivol++) { + std::string volumeName = "fd3_node" + std::to_string(ivol); + auto v = (TGeoVolume*)gGeoManager->GetVolume(volumeName.c_str()); AddSensitiveVolume(v); } } From 71ee836970ddb0b007832099b7301689963b5d17 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Tue, 21 Jul 2026 11:54:22 +0200 Subject: [PATCH 06/21] Hits fixed --- .../include/FD3Simulation/Detector.h | 1 + .../ALICE3/FD3/simulation/src/Detector.cxx | 88 ++++++++----------- 2 files changed, 37 insertions(+), 52 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h index a437f64a678c9..9c6d2a5c21196 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h @@ -110,6 +110,7 @@ class Detector : public o2::base::DetImpl TGeoVolumeAssembly* buildModuleCherenkov_v2(); int mChannelsCounter; + std::map mChannelId; float getRingSize(float zmod, float eta); diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 3ecdb0cc015c4..f24285e8d3a70 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -121,8 +121,9 @@ bool Detector::ProcessHits(FairVolume* vol) return kFALSE; } - int detId; - int volID = fMC->CurrentVolID(detId); + int copy = 0; + int volId = fMC->CurrentVolID(copy); + int detId = mChannelId[volId]; auto stack = (o2::data::Stack*)fMC->GetStack(); @@ -290,10 +291,10 @@ void Detector::buildModules() TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA(); TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC(); - TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkovA(); - TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkovC(); - // TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkov_v1(); - // TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkov_v1(); + // TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkovA(); + // TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkovC(); + TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkov_v1(); + TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkov_v1(); vFD3_CherA->SetName("FD3_CherA"); vFD3_CherC->SetName("FD3_CherC"); @@ -314,7 +315,6 @@ TGeoVolumeAssembly* Detector::buildModuleScintA() for (int ir = 0; ir < mNumberOfRingsScint; ir++) { std::string rName = "fd3_ring" + std::to_string(ir + 1); - auto ring = new TGeoVolumeAssembly(rName.c_str()); float etaMin = mEtaMaxScintA - (ir + 1) * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint; float etaMax = mEtaMaxScintA - ir * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint; float zmod = mZScint; @@ -326,15 +326,10 @@ TGeoVolumeAssembly* Detector::buildModuleScintA() float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); - if ((ir + ic) % 2 == 0) { - nod->SetLineColor(kRed); - } else { - nod->SetLineColor(kRed - 7); - } - ring->AddNode(nod, cellId); + auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); + node->SetLineColor((ir + ic) % 2 == 0 ? kRed : kRed - 7); + mod->AddNode(node, 1); } - mod->AddNode(ring, 1); } return mod; @@ -350,7 +345,6 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() for (int ir = 0; ir < mNumberOfRingsScint; ir++) { std::string rName = "fd3_ring" + std::to_string(ir + 1 + mNumberOfRingsScint); - auto ring = new TGeoVolumeAssembly(rName.c_str()); float etaMin = mEtaMinScintC + ir * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint; float etaMax = mEtaMinScintC + (ir + 1) * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint; float zmod = -mZScint; @@ -362,15 +356,10 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); - if ((ir + ic) % 2 == 0) { - nod->SetLineColor(kBlue); - } else { - nod->SetLineColor(kBlue - 7); - } - ring->AddNode(nod, cellId); + auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); + node->SetLineColor((ir + ic) % 2 == 0 ? kBlue : kBlue - 7); + mod->AddNode(node, 1); } - mod->AddNode(ring, 1); } return mod; @@ -385,28 +374,21 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkovA() float dphiDeg = 360.; // / mNumberOfSectors; for (int ir = 0; ir < 1; ir++) { - std::string rName = "fd3_ring" + std::to_string(ir + 1 + 2 * mNumberOfRingsScint); - auto ring = new TGeoVolumeAssembly(rName.c_str()); float etaMin = mEtaMaxCherA - (ir + 1) * (mEtaMaxCherA - mEtaMinCherA) / mNumberOfRingsCher; float etaMax = mEtaMaxCherA - ir * (mEtaMaxCherA - mEtaMinCherA) / mNumberOfRingsCher; float zmod = mZCher; float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); LOG(info) << "Radiator ring" << ir << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < 1 /*mNumberOfSectors */; ic++) { + for (int ic = 0; ic < 1; ic++) { int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint); std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); - if ((ir + ic) % 2 == 0) { - nod->SetLineColor(kOrange); - } else { - nod->SetLineColor(kOrange - 7); - } - ring->AddNode(nod, cellId); + auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); + node->SetLineColor((ir + ic) % 2 == 0 ? kOrange : kOrange - 7); + mod->AddNode(node, 1); } - mod->AddNode(ring, 1); } return mod; @@ -421,8 +403,6 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkovC() float dphiDeg = 360.; // / mNumberOfSectors; for (int ir = 0; ir < 1; ir++) { - std::string rName = "fd3_ring" + std::to_string(ir + 1 + 2 * mNumberOfRingsScint + mNumberOfRingsCher); - auto ring = new TGeoVolumeAssembly(rName.c_str()); float etaMin = mEtaMinCherC + ir * (mEtaMaxCherC - mEtaMinCherC) / mNumberOfRingsCher; float etaMax = mEtaMinCherC + (ir + 1) * (mEtaMaxCherC - mEtaMinCherC) / mNumberOfRingsCher; float zmod = -mZCher; @@ -434,15 +414,10 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkovC() float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); - if ((ir + ic) % 2 == 0) { - nod->SetLineColor(kMagenta); - } else { - nod->SetLineColor(kMagenta - 7); - } - ring->AddNode(nod, cellId); + auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); + node->SetLineColor((ir + ic) % 2 == 0 ? kMagenta : kMagenta - 7); + mod->AddNode(node, 1); } - mod->AddNode(ring, 1); } return mod; @@ -499,9 +474,10 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() for (int i = 0; i < N; i++) { int cellId = mChannelsCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto cell = (TGeoVolume*)gGeoManager->MakeBox(nodeName.c_str(), medium, rsize - 0.05, rsize - 0.05, mDzCher / 2); - cell->SetLineColor(kOrange + 7); - mod->AddNode(cell, 1, new TGeoTranslation(x[i], y[i], 0)); + auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); + auto nod = new TGeoVolume(nodeName.c_str(), box, medium); + nod->SetLineColor(kOrange + 7); + mod->AddNode(nod, 1, new TGeoTranslation(x[i], y[i], 0)); } return mod; @@ -553,9 +529,10 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() for (int i = 0; i < N; i++) { int cellId = mChannelsCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto cell = (TGeoVolume*)gGeoManager->MakeBox(nodeName.c_str(), medium, rsize - 0.005, rsize - 0.05, mDzCher / 2); - cell->SetLineColor(kOrange + 7); - mod->AddNode(cell, 1, new TGeoTranslation(x[i], y[i], 0)); + auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); + auto nod = new TGeoVolume(nodeName.c_str(), box, medium); + nod->SetLineColor(kOrange + 7); + mod->AddNode(nod, 1, new TGeoTranslation(x[i], y[i], 0)); } return mod; @@ -565,10 +542,17 @@ void Detector::defineSensitiveVolumes() { LOG(info) << "Adding FD3 Sentitive Volumes"; + mChannelId = {}; + for (int ivol = 0; ivol < mChannelsCounter; ivol++) { std::string volumeName = "fd3_node" + std::to_string(ivol); auto v = (TGeoVolume*)gGeoManager->GetVolume(volumeName.c_str()); - AddSensitiveVolume(v); + if (!v) + continue; + // AddSensitiveVolume(v); + int volId = registerSensitiveVolumeAndGetVolID(v); + LOG(info) << "volumeName: " << volumeName << ", volume ID = " << volId; + mChannelId[volId] = ivol; } } From 184aadc5b9b00ca8dedd0adf56c301330ac5dda6 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Tue, 21 Jul 2026 12:25:48 +0200 Subject: [PATCH 07/21] Hits fixed --- .../Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index f24285e8d3a70..a40f439713f74 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -475,9 +475,9 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() int cellId = mChannelsCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); - auto nod = new TGeoVolume(nodeName.c_str(), box, medium); - nod->SetLineColor(kOrange + 7); - mod->AddNode(nod, 1, new TGeoTranslation(x[i], y[i], 0)); + auto node = new TGeoVolume(nodeName.c_str(), box, medium); + node->SetLineColor(kOrange + 7); + mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); } return mod; @@ -530,9 +530,9 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() int cellId = mChannelsCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); - auto nod = new TGeoVolume(nodeName.c_str(), box, medium); - nod->SetLineColor(kOrange + 7); - mod->AddNode(nod, 1, new TGeoTranslation(x[i], y[i], 0)); + auto node = new TGeoVolume(nodeName.c_str(), box, medium); + node->SetLineColor(kOrange + 7); + mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); } return mod; From c818493977bad93934d44d8dc8c39ea256488de1 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Wed, 22 Jul 2026 14:41:27 +0200 Subject: [PATCH 08/21] Three differen functions for building Cherenkov modules --- .../FD3/base/include/FD3Base/FD3BaseParam.h | 1 + .../include/FD3Simulation/Detector.h | 3 +- .../ALICE3/FD3/simulation/src/Detector.cxx | 121 ++++++++---------- 3 files changed, 52 insertions(+), 73 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h index ce8d08e758150..91aa41d5c30b8 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h @@ -25,6 +25,7 @@ namespace fd3 struct FD3BaseParam : public o2::conf::ConfigurableParamHelper { bool isSymmetric = true; + bool isCherenkovSegmented = true; O2ParamDef(FD3BaseParam, "FD3Base"); }; diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h index 9c6d2a5c21196..c065d900fdd85 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h @@ -104,8 +104,7 @@ class Detector : public o2::base::DetImpl TGeoVolumeAssembly* buildModuleScintA(); TGeoVolumeAssembly* buildModuleScintC(); - TGeoVolumeAssembly* buildModuleCherenkovA(); - TGeoVolumeAssembly* buildModuleCherenkovC(); + TGeoVolumeAssembly* buildModuleCherenkov_v0(float etaMin, float etaMax, float zMod); TGeoVolumeAssembly* buildModuleCherenkov_v1(); TGeoVolumeAssembly* buildModuleCherenkov_v2(); diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index a40f439713f74..d25b02b373a80 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -56,26 +56,6 @@ Detector::Detector(bool active) mGeometryTGeo(nullptr), mTrackData() { - mNumberOfRingsScint = Constants::nringsScint; - mNumberOfRingsCher = Constants::nringsCher; - mNumberOfSectors = Constants::nsect; - mDzScint = Constants::dzscint; - mDzCher = Constants::dzcher; - - auto& baseParam = FD3BaseParam::Instance(); - - mEtaMinScintA = Constants::etaMin_scintA; - mEtaMinCherA = Constants::etaMin_cherA; - mEtaMaxScintA = baseParam.isSymmetric ? Constants::etaMax_scintA_v1 : Constants::etaMax_scintA_v2; - mEtaMaxCherA = baseParam.isSymmetric ? Constants::etaMax_cherA_v1 : Constants::etaMax_cherA_v2; - - mEtaMinScintC = Constants::etaMin_scintC; - mEtaMinCherC = Constants::etaMin_cherC; - mEtaMaxScintC = Constants::etaMax_scintC; - mEtaMaxCherC = Constants::etaMax_cherC; - - mZScint = Constants::zscint; - mZCher = Constants::zcher; } Detector::Detector(const Detector& rhs) @@ -285,16 +265,47 @@ void Detector::buildModules() { LOGP(info, "Creating FD3 geometry"); + mNumberOfRingsScint = Constants::nringsScint; + mNumberOfRingsCher = Constants::nringsCher; + mNumberOfSectors = Constants::nsect; + mDzScint = Constants::dzscint; + mDzCher = Constants::dzcher; + + auto& baseParam = FD3BaseParam::Instance(); + + mEtaMinScintA = Constants::etaMin_scintA; + mEtaMinCherA = Constants::etaMin_cherA; + mEtaMaxScintA = baseParam.isSymmetric ? Constants::etaMax_scintA_v1 : Constants::etaMax_scintA_v2; + mEtaMaxCherA = baseParam.isSymmetric ? Constants::etaMax_cherA_v1 : Constants::etaMax_cherA_v2; + + mEtaMinScintC = Constants::etaMin_scintC; + mEtaMinCherC = Constants::etaMin_cherC; + mEtaMaxScintC = Constants::etaMax_scintC; + mEtaMaxCherC = Constants::etaMax_cherC; + + mZScint = Constants::zscint; + mZCher = Constants::zcher; + auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel"); mChannelsCounter = 0; TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA(); TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC(); - // TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkovA(); - // TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkovC(); - TGeoVolumeAssembly* vFD3_CherA = buildModuleCherenkov_v1(); - TGeoVolumeAssembly* vFD3_CherC = buildModuleCherenkov_v1(); + TGeoVolumeAssembly *vFD3_CherA, *vFD3_CherC; + + if (baseParam.isCherenkovSegmented) { + if (baseParam.isSymmetric) { + vFD3_CherA = buildModuleCherenkov_v1(); + } else { + vFD3_CherA = buildModuleCherenkov_v2(); + } + vFD3_CherC = buildModuleCherenkov_v1(); + } else { + vFD3_CherA = buildModuleCherenkov_v0(mEtaMaxCherA, mEtaMaxCherA, mZCher); + vFD3_CherC = buildModuleCherenkov_v0(mEtaMinCherC, mEtaMaxCherC, -mZCher); + } + vFD3_CherA->SetName("FD3_CherA"); vFD3_CherC->SetName("FD3_CherC"); @@ -365,60 +376,28 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() return mod; } -TGeoVolumeAssembly* Detector::buildModuleCherenkovA() +TGeoVolumeAssembly* Detector::buildModuleCherenkov_v0(float etaMin, float etaMax, float zmod) { - auto mod = new TGeoVolumeAssembly("FD3_CherA"); + auto mod = new TGeoVolumeAssembly(""); const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - float dphiDeg = 360.; // / mNumberOfSectors; - - for (int ir = 0; ir < 1; ir++) { - float etaMin = mEtaMaxCherA - (ir + 1) * (mEtaMaxCherA - mEtaMinCherA) / mNumberOfRingsCher; - float etaMax = mEtaMaxCherA - ir * (mEtaMaxCherA - mEtaMinCherA) / mNumberOfRingsCher; - float zmod = mZCher; - float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); - LOG(info) << "Radiator ring" << ir << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < 1; ic++) { - int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint); - std::string nodeName = "fd3_node" + std::to_string(cellId); - float phimin = dphiDeg * ic; - float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); - node->SetLineColor((ir + ic) % 2 == 0 ? kOrange : kOrange - 7); - mod->AddNode(node, 1); - } + float rmin, rmax; + if (zmod >= 0) { + rmin = getRingSize(zmod, etaMin); + rmax = getRingSize(zmod, etaMax); + } else { + rmin = getRingSize(zmod, etaMin); + rmax = getRingSize(zmod, etaMax); } - return mod; -} - -TGeoVolumeAssembly* Detector::buildModuleCherenkovC() -{ - auto mod = new TGeoVolumeAssembly("FD3_CherC"); - - const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - - float dphiDeg = 360.; // / mNumberOfSectors; + int cellId = mChannelsCounter++; + std::string nodeName = "fd3_node" + std::to_string(cellId); - for (int ir = 0; ir < 1; ir++) { - float etaMin = mEtaMinCherC + ir * (mEtaMaxCherC - mEtaMinCherC) / mNumberOfRingsCher; - float etaMax = mEtaMinCherC + (ir + 1) * (mEtaMaxCherC - mEtaMinCherC) / mNumberOfRingsCher; - float zmod = -mZCher; - float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); - LOG(info) << "Radiator ring" << ir + mNumberOfRingsCher << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < 1 /* mNumberOfSectors */; ic++) { - int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + 2 * mNumberOfRingsScint) + mNumberOfRingsCher; - std::string nodeName = "fd3_node" + std::to_string(cellId); - float phimin = dphiDeg * ic; - float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); - node->SetLineColor((ir + ic) % 2 == 0 ? kMagenta : kMagenta - 7); - mod->AddNode(node, 1); - } - } + auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, 0, 360); + auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); + node->SetLineColor(zmod > 0 ? kOrange : kMagenta); + mod->AddNode(node, 1); return mod; } From f877601f6715b3afef316ac5061cbf67b676f367 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Fri, 24 Jul 2026 10:43:15 +0200 Subject: [PATCH 09/21] introduced new constants --- .../Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h | 4 ++++ Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 2c5ecb650b204..d38777f1608a5 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -43,6 +43,10 @@ struct Constants { static constexpr float zscint = 410.0f; static constexpr float zcher = 430.0f; + + static constexpr float rsize = 3.2f; // quartz radiator transverse size + static constexpr float r_v1 = 6.0f; // circle size + static constexpr float r_v2 = 3.0f; // circle size }; } // namespace fd3 diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index d25b02b373a80..8ad3b193e5c79 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -412,8 +412,8 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() double x[N], y[N]; - const double rr = 6.; // inner circle - const double rsize = 1.6; // transverse size of a channel + const float rr = Constants::r_v1; + const float rsize = Constants::rsize; for (int i = 0; i < 3; i++) { x[i] = rsize * (2 * i + 1) + rr; @@ -453,7 +453,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() for (int i = 0; i < N; i++) { int cellId = mChannelsCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); + auto box = new TGeoBBox((rsize - 0.1) / 2, (rsize - 0.1) /2, mDzCher / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); node->SetLineColor(kOrange + 7); mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); From eaadb0c46c6121c7ba034e72cf7df868e2a6cde1 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Thu, 6 Aug 2026 17:18:08 +0200 Subject: [PATCH 10/21] fix cherenkov geometry --- .../FD3/base/include/FD3Base/Constants.h | 12 +++++------- .../FD3/base/include/FD3Base/GeometryTGeo.h | 3 ++- .../include/FD3Simulation/Detector.h | 4 ++-- .../ALICE3/FD3/simulation/src/Detector.cxx | 18 +++++++++--------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index d38777f1608a5..342f3ce7b813e 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -1,4 +1,4 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// Copyright 2019-2026 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // @@ -10,9 +10,7 @@ // or submit itself to any jurisdiction. /// \file Constants.h -/// \brief General constants in FV0 -/// -/// \author Maciej Slupecki, University of Jyvaskyla, Finland +/// \brief General constants in FD3 #ifndef ALICEO2_FD3_CONSTANTS_ #define ALICEO2_FD3_CONSTANTS_ @@ -44,9 +42,9 @@ struct Constants { static constexpr float zscint = 410.0f; static constexpr float zcher = 430.0f; - static constexpr float rsize = 3.2f; // quartz radiator transverse size - static constexpr float r_v1 = 6.0f; // circle size - static constexpr float r_v2 = 3.0f; // circle size + static constexpr float rsize = 1.6f; // quartz radiator transverse size + static constexpr float r_v1 = 6.0f; // circle size + static constexpr float r_v2 = 3.0f; // circle size }; } // namespace fd3 diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/GeometryTGeo.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/GeometryTGeo.h index 0e38bd4ccd21f..5075b32aa912b 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/GeometryTGeo.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/GeometryTGeo.h @@ -1,4 +1,4 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// Copyright 2019-2026 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // @@ -8,6 +8,7 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + #ifndef ALICEO2_FD3_GEOMETRYTGEO_H_ #define ALICEO2_FD3_GEOMETRYTGEO_H_ diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h index c065d900fdd85..34aff5bbc5324 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h @@ -1,4 +1,4 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// Copyright 2019-2026 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // @@ -108,7 +108,7 @@ class Detector : public o2::base::DetImpl TGeoVolumeAssembly* buildModuleCherenkov_v1(); TGeoVolumeAssembly* buildModuleCherenkov_v2(); - int mChannelsCounter; + int mChannelCounter; std::map mChannelId; float getRingSize(float zmod, float eta); diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 8ad3b193e5c79..3861caac5c9f6 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -1,4 +1,4 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// Copyright 2019-2026 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // @@ -288,7 +288,7 @@ void Detector::buildModules() auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel"); - mChannelsCounter = 0; + mChannelCounter = 0; TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA(); TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC(); @@ -332,7 +332,7 @@ TGeoVolumeAssembly* Detector::buildModuleScintA() float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); LOG(info) << "Scintillator ring" << ir << ": from " << rmin << " to " << rmax; for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = mChannelsCounter++; // ic + mNumberOfSectors * ir; + int cellId = mChannelCounter++; // ic + mNumberOfSectors * ir; std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); @@ -362,7 +362,7 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); LOG(info) << "Scintillator ring" << ir + mNumberOfRingsScint << ": from " << rmin << " to " << rmax; for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = mChannelsCounter++; // ic + mNumberOfSectors * (ir + mNumberOfRingsScint); + int cellId = mChannelCounter++; // ic + mNumberOfSectors * (ir + mNumberOfRingsScint); std::string nodeName = "fd3_node" + std::to_string(cellId); float phimin = dphiDeg * ic; float phimax = dphiDeg * (ic + 1); @@ -391,7 +391,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v0(float etaMin, float etaMax rmax = getRingSize(zmod, etaMax); } - int cellId = mChannelsCounter++; + int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, 0, 360); @@ -451,9 +451,9 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() } for (int i = 0; i < N; i++) { - int cellId = mChannelsCounter++; + int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto box = new TGeoBBox((rsize - 0.1) / 2, (rsize - 0.1) /2, mDzCher / 2); + auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); node->SetLineColor(kOrange + 7); mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); @@ -506,7 +506,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() } for (int i = 0; i < N; i++) { - int cellId = mChannelsCounter++; + int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); @@ -523,7 +523,7 @@ void Detector::defineSensitiveVolumes() mChannelId = {}; - for (int ivol = 0; ivol < mChannelsCounter; ivol++) { + for (int ivol = 0; ivol < mChannelCounter; ivol++) { std::string volumeName = "fd3_node" + std::to_string(ivol); auto v = (TGeoVolume*)gGeoManager->GetVolume(volumeName.c_str()); if (!v) From 3e7d675c8bf3f6a17a1ebf137886ee250b1a0f9d Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Mon, 24 Aug 2026 07:09:34 +0200 Subject: [PATCH 11/21] remove unnecessary logs --- Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 3861caac5c9f6..8a5de03281fad 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -519,7 +519,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() void Detector::defineSensitiveVolumes() { - LOG(info) << "Adding FD3 Sentitive Volumes"; + LOG(info) << "Adding FD3 sentitive volumes..."; mChannelId = {}; @@ -528,11 +528,10 @@ void Detector::defineSensitiveVolumes() auto v = (TGeoVolume*)gGeoManager->GetVolume(volumeName.c_str()); if (!v) continue; - // AddSensitiveVolume(v); int volId = registerSensitiveVolumeAndGetVolID(v); - LOG(info) << "volumeName: " << volumeName << ", volume ID = " << volId; mChannelId[volId] = ivol; } + LOG(info) << "Done"; } void Detector::definePassiveVolumes() From 19389d4d32bc2ec36f654e4e89bba37ef41e33a2 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Fri, 28 Aug 2026 05:41:46 +0200 Subject: [PATCH 12/21] Changed Cherenkov modules numbering --- .../ALICE3/FD3/simulation/src/Detector.cxx | 206 ++++++++++++++---- 1 file changed, 160 insertions(+), 46 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 8a5de03281fad..b353f2dc77b6e 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -415,39 +415,85 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() const float rr = Constants::r_v1; const float rsize = Constants::rsize; - for (int i = 0; i < 3; i++) { - x[i] = rsize * (2 * i + 1) + rr; - y[i] = 0.; + x[0] = rr + rsize; + y[0] = 0.; + x[1] = x[0]; + y[1] = 2 * rsize; + x[2] = 4 * rsize; + y[2] = 4 * rsize; + x[3] = 2 * rsize; + y[3] = rr + rsize; + + for (int i = 0; i < 4; i++) { + x[i + 4] = -y[i]; + y[i + 4] = x[i]; + } + + for (int i = 0; i < 4; i++) { + x[i + 8] = -x[i]; + y[i + 8] = -y[i]; + } + for (int i = 0; i < 4; i++) { + x[i + 12] = y[i]; + y[i + 12] = -x[i]; } - for (int i = 3; i < 6; i++) { - x[i] = rsize * (2 * (i - 3) + 1) + rr; - y[i] = -2 * rsize; + + x[16] = x[0] + 2 * rsize; + y[16] = y[0]; + x[17] = x[1] + 2 * rsize; + y[17] = y[1]; + x[18] = x[2] + 2 * rsize; + y[18] = y[2]; + x[19] = x[18]; + y[19] = y[18] + 2 * rsize; + x[20] = x[2]; + y[20] = y[19]; + x[21] = x[3]; + y[21] = y[3] + 2 * rsize; + + for (int i = 16; i < 22; i++) { + x[i + 6] = -y[i]; + y[i + 6] = x[i]; } - for (int i = 6; i < 9; i++) { - x[i] = rsize * (2 * (i - 6) + 1) + rr; - y[i] = 2 * rsize; + + for (int i = 16; i < 22; i++) { + x[i + 12] = -x[i]; + y[i + 12] = -y[i]; } - for (int i = 9; i < 12; i++) { - x[i] = 4 * rsize + rsize * (2 * (i - 9)); - y[i] = 4 * rsize; + for (int i = 16; i < 22; i++) { + x[i + 18] = y[i]; + y[i + 18] = -x[i]; } - for (int i = 12; i < 15; i++) { - x[i] = 4 * rsize + rsize * (2 * (i - 12)); - y[i] = 6 * rsize; + + x[40] = x[0] + 4 * rsize; + y[40] = y[0]; + x[41] = x[1] + 4 * rsize; + y[41] = y[1]; + x[42] = x[2] + 4 * rsize; + y[42] = y[2]; + x[43] = x[2] + 4 * rsize; + y[43] = y[2] + 2 * rsize; + x[44] = x[2] + 2 * rsize; + y[44] = y[2] + 4 * rsize; + x[45] = x[2]; + y[45] = y[2] + 4 * rsize; + x[46] = x[3]; + y[46] = y[3] + 4 * rsize; + + for (int i = 40; i < 47; i++) { + x[i + 7] = -y[i]; + y[i + 7] = x[i]; } - for (int i = 15; i < 17; i++) { - x[i] = 4 * rsize + rsize * (2 * (i - 15)); - y[i] = 8 * rsize; + + for (int i = 40; i < 47; i++) { + x[i + 14] = -x[i]; + y[i + 14] = -y[i]; } - for (int i = 0; i < 17; i++) { - x[i + 17] = -y[i]; - y[i + 17] = x[i]; - x[i + 34] = -x[i]; - y[i + 34] = -y[i]; - x[i + 51] = y[i]; - y[i + 51] = -x[i]; + for (int i = 40; i < 47; i++) { + x[i + 21] = y[i]; + y[i + 21] = -x[i]; } for (int i = 0; i < N; i++) { @@ -475,34 +521,102 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() const double rr = 3.; // inner circle const double rsize = 1.6; // transverse size of a channel - for (int i = 0; i < 4; i++) { - x[i] = rsize * (2 * i + 1) + rr; - y[i] = 0.; + x[0] = rsize + rr; + y[0] = 0.; + x[1] = 2 * rsize; + y[1] = 2 * rsize; + + for (int i = 0; i < 2; i++) { + x[i + 2] = -y[i]; + y[i + 2] = x[i]; + } + + for (int i = 0; i < 2; i++) { + x[i + 4] = -x[i]; + y[i + 4] = -y[i]; + } + + for (int i = 0; i < 2; i++) { + x[i + 6] = y[i]; + y[i + 6] = -x[i]; + } + + x[8] = x[0] + 2 * rsize; + y[8] = y[0]; + x[9] = x[1] + 2 * rsize; + y[9] = y[1]; + x[10] = x[9]; + y[10] = y[9] + 2 * rsize; + x[11] = x[1]; + y[11] = y[10]; + + for (int i = 8; i < 12; i++) { + x[i + 4] = -y[i]; + y[i + 4] = x[i]; } - for (int i = 4; i < 8; i++) { - x[i] = rsize * (2 * (i - 4 + 1)); - y[i] = 2 * rsize; + + for (int i = 8; i < 12; i++) { + x[i + 8] = -x[i]; + y[i + 8] = -y[i]; } + for (int i = 8; i < 12; i++) { - x[i] = rsize * (2 * (i - 8 + 1)); - y[i] = 4 * rsize; + x[i + 12] = y[i]; + y[i + 12] = -x[i]; } - for (int i = 12; i < 15; i++) { - x[i] = rsize * (2 * (i - 12 + 1)); - y[i] = 6 * rsize; + + x[24] = x[0] + 4 * rsize; + y[24] = y[0]; + x[25] = x[1] + 4 * rsize; + y[25] = y[1]; + x[26] = x[25]; + y[26] = y[25] + 2 * rsize; + x[27] = x[25]; + y[27] = y[26] + 2 * rsize; + x[28] = x[1] + 2 * rsize; + y[28] = y[27]; + x[29] = x[1]; + y[29] = y[27]; + + for (int i = 24; i < 30; i++) { + x[i + 6] = -y[i]; + y[i + 6] = x[i]; + } + + for (int i = 24; i < 30; i++) { + x[i + 12] = -x[i]; + y[i + 12] = -y[i]; + } + + for (int i = 24; i < 30; i++) { + x[i + 18] = y[i]; + y[i + 18] = -x[i]; + } + + x[48] = x[0] + 6 * rsize; + y[48] = y[0]; + x[49] = x[1] + 6 * rsize; + y[49] = y[48] + 2 * rsize; + x[50] = x[49]; + y[50] = y[49] + 2 * rsize; + x[51] = x[1] + 2 * rsize; + y[51] = y[50] + 4 * rsize; + x[52] = x[1]; + y[52] = y[51]; + + for (int i = 48; i < 53; i++) { + x[i + 5] = -y[i]; + y[i + 5] = x[i]; } - for (int i = 15; i < 17; i++) { - x[i] = rsize * (2 * (i - 15 + 1)); - y[i] = 8 * rsize; + + for (int i = 48; i < 53; i++) { + x[i + 10] = -x[i]; + y[i + 10] = -y[i]; } - for (int i = 0; i < 17; i++) { - x[i + 17] = -y[i]; - y[i + 17] = x[i]; - x[i + 34] = -x[i]; - y[i + 34] = -y[i]; - x[i + 51] = y[i]; - y[i + 51] = -x[i]; + for (int i = 48; i < 53; i++) { + x[i + 15] = y[i]; + y[i + 15] = -x[i]; } for (int i = 0; i < N; i++) { From e4a37eb3174c72271942ed88c1655414965b3e3a Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Fri, 28 Aug 2026 13:14:47 +0200 Subject: [PATCH 13/21] Cherenkov channels numbering --- .../FD3/base/files/fd3_cherenkov_xy_v1.dat | 68 ++++++ .../FD3/base/files/fd3_cherenkov_xy_v2.dat | 68 ++++++ .../FD3/base/include/FD3Base/Constants.h | 2 - .../ALICE3/FD3/simulation/src/Detector.cxx | 215 +++--------------- 4 files changed, 165 insertions(+), 188 deletions(-) create mode 100644 Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat create mode 100644 Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat diff --git a/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat b/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat new file mode 100644 index 0000000000000..4da9b94a10574 --- /dev/null +++ b/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat @@ -0,0 +1,68 @@ +7.5 0 +7.5 3.2 +6.4 6.4 +3.2 7.5 +-0 7.5 +-3.2 7.5 +-6.4 6.4 +-7.5 3.2 +-7.5 -0 +-7.5 -3.2 +-6.4 -6.4 +-3.2 -7.5 +0 -7.5 +3.2 -7.5 +6.4 -6.4 +7.5 -3.2 +10.7 0 +10.7 3.2 +9.6 6.4 +9.6 9.6 +6.4 9.6 +3.2 10.7 +-0 10.7 +-3.2 10.7 +-6.4 9.6 +-9.6 9.6 +-9.6 6.4 +-10.7 3.2 +-10.7 -0 +-10.7 -3.2 +-9.6 -6.4 +-9.6 -9.6 +-6.4 -9.6 +-3.2 -10.7 +0 -10.7 +3.2 -10.7 +6.4 -9.6 +9.6 -9.6 +9.6 -6.4 +10.7 -3.2 +13.9 0 +13.9 3.2 +12.8 6.4 +12.8 9.6 +9.6 12.8 +6.4 12.8 +3.2 13.9 +-0 13.9 +-3.2 13.9 +-6.4 12.8 +-9.6 12.8 +-12.8 9.6 +-12.8 6.4 +-13.9 3.2 +-13.9 -0 +-13.9 -3.2 +-12.8 -6.4 +-12.8 -9.6 +-9.6 -12.8 +-6.4 -12.8 +-3.2 -13.9 +0 -13.9 +3.2 -13.9 +6.4 -12.8 +9.6 -12.8 +12.8 -9.6 +12.8 -6.4 +13.9 -3.2 diff --git a/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat b/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat new file mode 100644 index 0000000000000..7a0d670f5cf79 --- /dev/null +++ b/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat @@ -0,0 +1,68 @@ +4.6 0 +3.2 3.2 +-0 4.6 +-3.2 3.2 +-4.6 -0 +-3.2 -3.2 +0 -4.6 +3.2 -3.2 +7.8 0 +6.4 3.2 +6.4 6.4 +3.2 6.4 +-0 7.8 +-3.2 6.4 +-6.4 6.4 +-6.4 3.2 +-7.8 -0 +-6.4 -3.2 +-6.4 -6.4 +-3.2 -6.4 +0 -7.8 +3.2 -6.4 +6.4 -6.4 +6.4 -3.2 +11 0 +9.6 3.2 +9.6 6.4 +9.6 9.6 +6.4 9.6 +3.2 9.6 +-0 11 +-3.2 9.6 +-6.4 9.6 +-9.6 9.6 +-9.6 6.4 +-9.6 3.2 +-11 -0 +-9.6 -3.2 +-9.6 -6.4 +-9.6 -9.6 +-6.4 -9.6 +-3.2 -9.6 +0 -11 +3.2 -9.6 +6.4 -9.6 +9.6 -9.6 +9.6 -6.4 +9.6 -3.2 +14.2 0 +12.8 3.2 +12.8 6.4 +6.4 12.8 +3.2 12.8 +-0 14.2 +-3.2 12.8 +-6.4 12.8 +-12.8 6.4 +-12.8 3.2 +-14.2 -0 +-12.8 -3.2 +-12.8 -6.4 +-6.4 -12.8 +-3.2 -12.8 +0 -14.2 +3.2 -12.8 +6.4 -12.8 +12.8 -6.4 +12.8 -3.2 diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 342f3ce7b813e..6ad71e70dd045 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -43,8 +43,6 @@ struct Constants { static constexpr float zcher = 430.0f; static constexpr float rsize = 1.6f; // quartz radiator transverse size - static constexpr float r_v1 = 6.0f; // circle size - static constexpr float r_v2 = 3.0f; // circle size }; } // namespace fd3 diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index b353f2dc77b6e..c7b4d103ed8be 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -408,93 +408,23 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - const int N = 68; - - double x[N], y[N]; - - const float rr = Constants::r_v1; - const float rsize = Constants::rsize; - - x[0] = rr + rsize; - y[0] = 0.; - x[1] = x[0]; - y[1] = 2 * rsize; - x[2] = 4 * rsize; - y[2] = 4 * rsize; - x[3] = 2 * rsize; - y[3] = rr + rsize; - - for (int i = 0; i < 4; i++) { - x[i + 4] = -y[i]; - y[i + 4] = x[i]; - } + double rsize = Constants::rsize; - for (int i = 0; i < 4; i++) { - x[i + 8] = -x[i]; - y[i + 8] = -y[i]; - } - for (int i = 0; i < 4; i++) { - x[i + 12] = y[i]; - y[i + 12] = -x[i]; - } - - x[16] = x[0] + 2 * rsize; - y[16] = y[0]; - x[17] = x[1] + 2 * rsize; - y[17] = y[1]; - x[18] = x[2] + 2 * rsize; - y[18] = y[2]; - x[19] = x[18]; - y[19] = y[18] + 2 * rsize; - x[20] = x[2]; - y[20] = y[19]; - x[21] = x[3]; - y[21] = y[3] + 2 * rsize; - - for (int i = 16; i < 22; i++) { - x[i + 6] = -y[i]; - y[i + 6] = x[i]; - } - - for (int i = 16; i < 22; i++) { - x[i + 12] = -x[i]; - y[i + 12] = -y[i]; - } - - for (int i = 16; i < 22; i++) { - x[i + 18] = y[i]; - y[i + 18] = -x[i]; - } + const int N = 68; - x[40] = x[0] + 4 * rsize; - y[40] = y[0]; - x[41] = x[1] + 4 * rsize; - y[41] = y[1]; - x[42] = x[2] + 4 * rsize; - y[42] = y[2]; - x[43] = x[2] + 4 * rsize; - y[43] = y[2] + 2 * rsize; - x[44] = x[2] + 2 * rsize; - y[44] = y[2] + 4 * rsize; - x[45] = x[2]; - y[45] = y[2] + 4 * rsize; - x[46] = x[3]; - y[46] = y[3] + 4 * rsize; - - for (int i = 40; i < 47; i++) { - x[i + 7] = -y[i]; - y[i + 7] = x[i]; - } + double x[N] = {7.5, 7.5, 6.4, 3.2, 0, -3.2, -6.4, -7.5, -7.5, -7.5, -6.4, -3.2, + 0, 3.2, 6.4, 7.5, 10.7, 10.7, 9.6, 9.6, 6.4, 3.2, 0, -3.2, + -6.4, -9.6, -9.6, -10.7, -10.7, -10.7, -9.6, -9.6, -6.4, -3.2, 0, 3.2, + 6.4, 9.6, 9.6, 10.7, 13.9, 13.9, 12.8, 12.8, 9.6, 6.4, 3.2, 0, + -3.2, -6.4, -9.6, -12.8, -12.8, -13.9, -13.9, -13.9, -12.8, -12.8, -9.6, -6.4, + -3.2, 0, 3.2, 6.4, 9.6, 12.8, 12.8, 13.9}; - for (int i = 40; i < 47; i++) { - x[i + 14] = -x[i]; - y[i + 14] = -y[i]; - } - - for (int i = 40; i < 47; i++) { - x[i + 21] = y[i]; - y[i + 21] = -x[i]; - } + double y[N] = {0, 3.2, 6.4, 7.5, 7.5, 7.5, 6.4, 3.2, 0, -3.2, -6.4, -7.5, + -7.5, -7.5, -6.4, -3.2, 0, 3.2, 6.4, 9.6, 9.6, 10.7, 10.7, 10.7, + 9.6, 9.6, 6.4, 3.2, 0, -3.2, -6.4, -9.6, -9.6, -10.7, -10.7, -10.7, + -9.6, -9.6, -6.4, -3.2, 0, 3.2, 6.4, 9.6, 12.8, 12.8, 13.9, 13.9, + 13.9, 12.8, 12.8, 9.6, 6.4, 3.2, 0, -3.2, -6.4, -9.6, -12.8, -12.8, + -13.9, -13.9, -13.9, -12.8, -12.8, -9.6, -6.4, -3.2}; for (int i = 0; i < N; i++) { int cellId = mChannelCounter++; @@ -514,110 +444,23 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - const int N = 68; - - double x[N], y[N]; - - const double rr = 3.; // inner circle - const double rsize = 1.6; // transverse size of a channel - - x[0] = rsize + rr; - y[0] = 0.; - x[1] = 2 * rsize; - y[1] = 2 * rsize; + double rsize = Constants::rsize; - for (int i = 0; i < 2; i++) { - x[i + 2] = -y[i]; - y[i + 2] = x[i]; - } - - for (int i = 0; i < 2; i++) { - x[i + 4] = -x[i]; - y[i + 4] = -y[i]; - } - - for (int i = 0; i < 2; i++) { - x[i + 6] = y[i]; - y[i + 6] = -x[i]; - } - - x[8] = x[0] + 2 * rsize; - y[8] = y[0]; - x[9] = x[1] + 2 * rsize; - y[9] = y[1]; - x[10] = x[9]; - y[10] = y[9] + 2 * rsize; - x[11] = x[1]; - y[11] = y[10]; - - for (int i = 8; i < 12; i++) { - x[i + 4] = -y[i]; - y[i + 4] = x[i]; - } - - for (int i = 8; i < 12; i++) { - x[i + 8] = -x[i]; - y[i + 8] = -y[i]; - } - - for (int i = 8; i < 12; i++) { - x[i + 12] = y[i]; - y[i + 12] = -x[i]; - } - - x[24] = x[0] + 4 * rsize; - y[24] = y[0]; - x[25] = x[1] + 4 * rsize; - y[25] = y[1]; - x[26] = x[25]; - y[26] = y[25] + 2 * rsize; - x[27] = x[25]; - y[27] = y[26] + 2 * rsize; - x[28] = x[1] + 2 * rsize; - y[28] = y[27]; - x[29] = x[1]; - y[29] = y[27]; - - for (int i = 24; i < 30; i++) { - x[i + 6] = -y[i]; - y[i + 6] = x[i]; - } - - for (int i = 24; i < 30; i++) { - x[i + 12] = -x[i]; - y[i + 12] = -y[i]; - } - - for (int i = 24; i < 30; i++) { - x[i + 18] = y[i]; - y[i + 18] = -x[i]; - } - - x[48] = x[0] + 6 * rsize; - y[48] = y[0]; - x[49] = x[1] + 6 * rsize; - y[49] = y[48] + 2 * rsize; - x[50] = x[49]; - y[50] = y[49] + 2 * rsize; - x[51] = x[1] + 2 * rsize; - y[51] = y[50] + 4 * rsize; - x[52] = x[1]; - y[52] = y[51]; - - for (int i = 48; i < 53; i++) { - x[i + 5] = -y[i]; - y[i + 5] = x[i]; - } - - for (int i = 48; i < 53; i++) { - x[i + 10] = -x[i]; - y[i + 10] = -y[i]; - } + const int N = 68; - for (int i = 48; i < 53; i++) { - x[i + 15] = y[i]; - y[i + 15] = -x[i]; - } + double x[N] = {4.6, 3.2, 0, -3.2, -4.6, -3.2, 0, 3.2, 7.8, 6.4, 6.4, 3.2, + 0, -3.2, -6.4, -6.4, -7.8, -6.4, -6.4, -3.2, 0, 3.2, 6.4, 6.4, + 11, 9.6, 9.6, 9.6, 6.4, 3.2, 0, -3.2, -6.4, -9.6, -9.6, -9.6, + -11, -9.6, -9.6, -9.6, -6.4, -3.2, 0, 3.2, 6.4, 9.6, 9.6, 9.6, + 14.2, 12.8, 12.8, 6.4, 3.2, 0, -3.2, -6.4, -12.8, -12.8, -14.2, -12.8, + -12.8, -6.4, -3.2, 0, 3.2, 6.4, 12.8, 12.8}; + + double y[N] = {0, 3.2, 4.6, 3.2, 0, -3.2, -4.6, -3.2, 0, 3.2, 6.4, 6.4, + 7.8, 6.4, 6.4, 3.2, 0, -3.2, -6.4, -6.4, -7.8, -6.4, -6.4, -3.2, + 0, 3.2, 6.4, 9.6, 9.6, 9.6, 11, 9.6, 9.6, 9.6, 6.4, 3.2, + 0, -3.2, -6.4, -9.6, -9.6, -9.6, -11, -9.6, -9.6, -9.6, -6.4, -3.2, + 0, 3.2, 6.4, 12.8, 12.8, 14.2, 12.8, 12.8, 6.4, 3.2, 0, -3.2, + -6.4, -12.8, -12.8, -14.2, -12.8, -12.8, -6.4, -3.2}; for (int i = 0; i < N; i++) { int cellId = mChannelCounter++; From 23d6e28a1cc731af6effa154d11f795a037929f5 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sat, 29 Aug 2026 16:09:08 +0200 Subject: [PATCH 14/21] Set sizes of quartz radiators --- .../Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h | 3 ++- Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 6ad71e70dd045..5090063c6a631 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -42,7 +42,8 @@ struct Constants { static constexpr float zscint = 410.0f; static constexpr float zcher = 430.0f; - static constexpr float rsize = 1.6f; // quartz radiator transverse size + static constexpr float rsize = 1.6f; // characteristic distance for building cherenkov segments + static constexpr float rsizeq = 1.025f; // quartz radiator transverse size }; } // namespace fd3 diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index c7b4d103ed8be..547b855f9ef7e 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -408,7 +408,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - double rsize = Constants::rsize; + double rsizeq = Constants::rsizeq; const int N = 68; @@ -429,7 +429,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() for (int i = 0; i < N; i++) { int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); + auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, mDzCher / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); node->SetLineColor(kOrange + 7); mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); @@ -444,7 +444,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - double rsize = Constants::rsize; + double rsizeq = Constants::rsizeq; const int N = 68; @@ -465,7 +465,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() for (int i = 0; i < N; i++) { int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto box = new TGeoBBox(rsize - 0.05, rsize - 0.05, mDzCher / 2); + auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, mDzCher / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); node->SetLineColor(kOrange + 7); mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); From 8aa625fef8f377a78c205bc1108bf747cf56d154 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Tue, 1 Sep 2026 10:49:15 +0200 Subject: [PATCH 15/21] corrected radiator module distance --- Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 5090063c6a631..58c3fa1325010 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -40,7 +40,7 @@ struct Constants { static constexpr float etaMax_cherC = -4.0f; static constexpr float zscint = 410.0f; - static constexpr float zcher = 430.0f; + static constexpr float zcher = 440.0f; static constexpr float rsize = 1.6f; // characteristic distance for building cherenkov segments static constexpr float rsizeq = 1.025f; // quartz radiator transverse size From b2c77b21a33c9431e38efc9f4c8f33419d904788 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Thu, 3 Sep 2026 07:12:55 +0200 Subject: [PATCH 16/21] corrected radiator module distance --- Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 58c3fa1325010..5090063c6a631 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -40,7 +40,7 @@ struct Constants { static constexpr float etaMax_cherC = -4.0f; static constexpr float zscint = 410.0f; - static constexpr float zcher = 440.0f; + static constexpr float zcher = 430.0f; static constexpr float rsize = 1.6f; // characteristic distance for building cherenkov segments static constexpr float rsizeq = 1.025f; // quartz radiator transverse size From 0a7a7503d6cb6e4720b0ad74c91e7031f1a2ee3a Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Thu, 3 Sep 2026 18:49:49 +0200 Subject: [PATCH 17/21] corrected scintillator module position --- Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index 5090063c6a631..efa315e4fd73e 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -39,7 +39,7 @@ struct Constants { static constexpr float etaMin_cherC = -4.9f; static constexpr float etaMax_cherC = -4.0f; - static constexpr float zscint = 410.0f; + static constexpr float zscint = 420.0f; static constexpr float zcher = 430.0f; static constexpr float rsize = 1.6f; // characteristic distance for building cherenkov segments From 8dde3a84cea08d930c3bba7bcf57f1b5e4c3a995 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sat, 12 Sep 2026 09:51:28 +0200 Subject: [PATCH 18/21] removed obsolete variables and funcions --- .../FD3/base/include/FD3Base/Constants.h | 28 +--- .../FD3/base/include/FD3Base/FD3BaseParam.h | 1 - .../include/FD3Simulation/Detector.h | 15 +- .../ALICE3/FD3/simulation/src/Detector.cxx | 157 +++++------------- 4 files changed, 55 insertions(+), 146 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h index efa315e4fd73e..067ff93eadbf4 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h @@ -20,29 +20,19 @@ namespace o2 namespace fd3 { struct Constants { - static constexpr unsigned int nsect = 8; - static constexpr unsigned int nringsScint = 5; - static constexpr unsigned int nringsCher = 1; + static constexpr unsigned int nSectScint = 8; + static constexpr unsigned int nRingsScint = 5; - static constexpr float dzscint = 4.0f; - static constexpr float dzcher = 4.0f; + static constexpr float zScint = 420.0f; + static constexpr float zCher = 430.0f; - static constexpr float etaMin_scintA = 2.5f; - static constexpr float etaMax_scintA_v1 = 4.9f; - static constexpr float etaMax_scintA_v2 = 5.5f; - static constexpr float etaMin_cherA = 4.0f; - static constexpr float etaMax_cherA_v1 = 4.9f; - static constexpr float etaMax_cherA_v2 = 5.5f; + static constexpr float dzScint = 4.0f; + static constexpr float dzCher = 2.0f; - static constexpr float etaMin_scintC = -4.9f; - static constexpr float etaMax_scintC = -2.5f; - static constexpr float etaMin_cherC = -4.9f; - static constexpr float etaMax_cherC = -4.0f; + static constexpr float etaMin = 2.5f; + static constexpr float etaMax = 4.9f; + static constexpr float etaMax2 = 5.5f; // asymmetric configuration - static constexpr float zscint = 420.0f; - static constexpr float zcher = 430.0f; - - static constexpr float rsize = 1.6f; // characteristic distance for building cherenkov segments static constexpr float rsizeq = 1.025f; // quartz radiator transverse size }; diff --git a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h index 91aa41d5c30b8..ce8d08e758150 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h @@ -25,7 +25,6 @@ namespace fd3 struct FD3BaseParam : public o2::conf::ConfigurableParamHelper { bool isSymmetric = true; - bool isCherenkovSegmented = true; O2ParamDef(FD3BaseParam, "FD3Base"); }; diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h index 34aff5bbc5324..ce4c1c448e7cc 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h @@ -90,9 +90,9 @@ class Detector : public o2::base::DetImpl enum EMedia { Scintillator, + RadiatorOpticalGlass, Aluminium, - MCPGlass, - RadiatorOpticalGlass + MCPGlass }; private: @@ -102,9 +102,7 @@ class Detector : public o2::base::DetImpl std::vector* mHits = nullptr; GeometryTGeo* mGeometryTGeo = nullptr; - TGeoVolumeAssembly* buildModuleScintA(); - TGeoVolumeAssembly* buildModuleScintC(); - TGeoVolumeAssembly* buildModuleCherenkov_v0(float etaMin, float etaMax, float zMod); + TGeoVolumeAssembly* buildModuleScint(float etaMin, float etaMax); TGeoVolumeAssembly* buildModuleCherenkov_v1(); TGeoVolumeAssembly* buildModuleCherenkov_v2(); @@ -113,13 +111,6 @@ class Detector : public o2::base::DetImpl float getRingSize(float zmod, float eta); - unsigned int mNumberOfRingsScint, mNumberOfRingsCher, mNumberOfSectors; - float mDzScint, mDzCher; - - float mEtaMinScintA, mEtaMaxScintA, mEtaMinScintC, mEtaMaxScintC; - float mEtaMaxCherA, mEtaMinCherA, mEtaMaxCherC, mEtaMinCherC; - float mZScint, mZCher; - void defineSensitiveVolumes(); void definePassiveVolumes(); diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 547b855f9ef7e..99f994c989b7b 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -218,10 +218,12 @@ void Detector::createMaterials() int fieldType; float maxField; + // TODO: Comment out two lines below once tested that the above function assigns field type and max correctly - fieldType = 3; // Field type - maxField = 5.0; // Field max. - // o2::base::Detector::initFieldTrackingParams(fieldType, maxField); + fieldType = 2; // Field type + maxField = 10.; // Field max. + + o2::base::Detector::initFieldTrackingParams(fieldType, maxField); LOG(info) << "FD3: createMaterials(): fieldType " << fieldType << ", maxField " << maxField; float tmaxfd3 = -10.0; // max deflection angle due to magnetic field in one step @@ -265,110 +267,63 @@ void Detector::buildModules() { LOGP(info, "Creating FD3 geometry"); - mNumberOfRingsScint = Constants::nringsScint; - mNumberOfRingsCher = Constants::nringsCher; - mNumberOfSectors = Constants::nsect; - mDzScint = Constants::dzscint; - mDzCher = Constants::dzcher; - auto& baseParam = FD3BaseParam::Instance(); - mEtaMinScintA = Constants::etaMin_scintA; - mEtaMinCherA = Constants::etaMin_cherA; - mEtaMaxScintA = baseParam.isSymmetric ? Constants::etaMax_scintA_v1 : Constants::etaMax_scintA_v2; - mEtaMaxCherA = baseParam.isSymmetric ? Constants::etaMax_cherA_v1 : Constants::etaMax_cherA_v2; - - mEtaMinScintC = Constants::etaMin_scintC; - mEtaMinCherC = Constants::etaMin_cherC; - mEtaMaxScintC = Constants::etaMax_scintC; - mEtaMaxCherC = Constants::etaMax_cherC; - - mZScint = Constants::zscint; - mZCher = Constants::zcher; - auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel"); mChannelCounter = 0; - TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA(); - TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC(); - TGeoVolumeAssembly *vFD3_CherA, *vFD3_CherC; + TGeoVolumeAssembly *vFD3_ScintA, *vFD3_ScintC, *vFD3_CherA, *vFD3_CherC; - if (baseParam.isCherenkovSegmented) { - if (baseParam.isSymmetric) { - vFD3_CherA = buildModuleCherenkov_v1(); - } else { - vFD3_CherA = buildModuleCherenkov_v2(); - } - vFD3_CherC = buildModuleCherenkov_v1(); + if (baseParam.isSymmetric) { + vFD3_ScintA = buildModuleScint(Constants::etaMin, Constants::etaMax); + vFD3_CherA = buildModuleCherenkov_v1(); } else { - vFD3_CherA = buildModuleCherenkov_v0(mEtaMaxCherA, mEtaMaxCherA, mZCher); - vFD3_CherC = buildModuleCherenkov_v0(mEtaMinCherC, mEtaMaxCherC, -mZCher); + vFD3_ScintA = buildModuleScint(Constants::etaMin, Constants::etaMax2); + vFD3_CherA = buildModuleCherenkov_v2(); } + vFD3_ScintC = buildModuleScint(Constants::etaMin, Constants::etaMax); + vFD3_CherC = buildModuleCherenkov_v1(); + + vFD3_ScintA->SetName("FD3_ScintA"); + vFD3_ScintC->SetName("FD3_ScintC"); vFD3_CherA->SetName("FD3_CherA"); vFD3_CherC->SetName("FD3_CherC"); - topVolume->AddNode(vFD3_ScintA, 1, new TGeoTranslation(0., 30.f, mZScint)); - topVolume->AddNode(vFD3_ScintC, 1, new TGeoTranslation(0., 30.f, -mZScint)); + topVolume->AddNode(vFD3_ScintA, 1, new TGeoTranslation(0., 30.f, Constants::zScint)); + topVolume->AddNode(vFD3_ScintC, 1, new TGeoTranslation(0., 30.f, -Constants::zScint)); - topVolume->AddNode(vFD3_CherA, 1, new TGeoTranslation(0., 30.f, mZCher)); - topVolume->AddNode(vFD3_CherC, 1, new TGeoTranslation(0., 30.f, -mZCher)); + topVolume->AddNode(vFD3_CherA, 1, new TGeoTranslation(0., 30.f, Constants::zCher)); + topVolume->AddNode(vFD3_CherC, 1, new TGeoTranslation(0., 30.f, -Constants::zCher)); } -TGeoVolumeAssembly* Detector::buildModuleScintA() +TGeoVolumeAssembly* Detector::buildModuleScint(float etaMin, float etaMax) { - auto mod = new TGeoVolumeAssembly("FD3_ScintA"); + auto mod = new TGeoVolumeAssembly("FD3_Scint"); const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator"); - float dphiDeg = 360. / mNumberOfSectors; - - for (int ir = 0; ir < mNumberOfRingsScint; ir++) { - std::string rName = "fd3_ring" + std::to_string(ir + 1); - float etaMin = mEtaMaxScintA - (ir + 1) * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint; - float etaMax = mEtaMaxScintA - ir * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint; - float zmod = mZScint; - float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin); - LOG(info) << "Scintillator ring" << ir << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = mChannelCounter++; // ic + mNumberOfSectors * ir; - std::string nodeName = "fd3_node" + std::to_string(cellId); - float phimin = dphiDeg * ic; - float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); - auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); - node->SetLineColor((ir + ic) % 2 == 0 ? kRed : kRed - 7); - mod->AddNode(node, 1); - } - } - - return mod; -} + int nrings = Constants::nRingsScint, nsect = Constants::nSectScint; + float zmod = Constants::zScint, dz = Constants::dzScint; -TGeoVolumeAssembly* Detector::buildModuleScintC() -{ - auto mod = new TGeoVolumeAssembly("FD3_ScintC"); - - const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator"); - - float dphiDeg = 360. / mNumberOfSectors; - - for (int ir = 0; ir < mNumberOfRingsScint; ir++) { - std::string rName = "fd3_ring" + std::to_string(ir + 1 + mNumberOfRingsScint); - float etaMin = mEtaMinScintC + ir * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint; - float etaMax = mEtaMinScintC + (ir + 1) * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint; - float zmod = -mZScint; - float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax); - LOG(info) << "Scintillator ring" << ir + mNumberOfRingsScint << ": from " << rmin << " to " << rmax; - for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = mChannelCounter++; // ic + mNumberOfSectors * (ir + mNumberOfRingsScint); + for (int ir = 0; ir < nrings; ir++) { + float eta1 = etaMax - ir * (etaMax - etaMin) / nrings; + float eta2 = etaMax - (ir + 1) * (etaMax - etaMin) / nrings; + float r1 = getRingSize(zmod, eta1), r2 = getRingSize(zmod, eta2); + LOG(info) << "Scintillator ring " << ir + 1 << ": from " << r1 << " to " << r2; + for (int ic = 0; ic < nsect; ic++) { + int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - float phimin = dphiDeg * ic; - float phimax = dphiDeg * (ic + 1); - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax); + float phi1 = ic * 360. / nsect; + float phi2 = (ic + 1) * 360. / nsect; + auto tbs = new TGeoTubeSeg("tbs", r1, r2, dz / 2, phi1, phi2); auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); - node->SetLineColor((ir + ic) % 2 == 0 ? kBlue : kBlue - 7); + if (cellId < nrings * nsect) { + node->SetLineColor((ir + ic) % 2 == 0 ? kRed : kRed - 7); + } else { + node->SetLineColor((ir + ic) % 2 == 0 ? kBlue : kBlue - 7); + } mod->AddNode(node, 1); } } @@ -376,39 +331,13 @@ TGeoVolumeAssembly* Detector::buildModuleScintC() return mod; } -TGeoVolumeAssembly* Detector::buildModuleCherenkov_v0(float etaMin, float etaMax, float zmod) -{ - auto mod = new TGeoVolumeAssembly(""); - - const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - - float rmin, rmax; - if (zmod >= 0) { - rmin = getRingSize(zmod, etaMin); - rmax = getRingSize(zmod, etaMax); - } else { - rmin = getRingSize(zmod, etaMin); - rmax = getRingSize(zmod, etaMax); - } - - int cellId = mChannelCounter++; - std::string nodeName = "fd3_node" + std::to_string(cellId); - - auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, 0, 360); - auto node = new TGeoVolume(nodeName.c_str(), tbs, medium); - node->SetLineColor(zmod > 0 ? kOrange : kMagenta); - mod->AddNode(node, 1); - - return mod; -} - TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() { auto mod = new TGeoVolumeAssembly("FD3_Ch"); TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - double rsizeq = Constants::rsizeq; + float rsizeq = Constants::rsizeq, dz = Constants::dzCher; const int N = 68; @@ -429,7 +358,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() for (int i = 0; i < N; i++) { int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, mDzCher / 2); + auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, dz / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); node->SetLineColor(kOrange + 7); mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); @@ -444,7 +373,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); - double rsizeq = Constants::rsizeq; + float rsizeq = Constants::rsizeq, dz = Constants::dzCher; const int N = 68; @@ -465,7 +394,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() for (int i = 0; i < N; i++) { int cellId = mChannelCounter++; std::string nodeName = "fd3_node" + std::to_string(cellId); - auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, mDzCher / 2); + auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, dz / 2); auto node = new TGeoVolume(nodeName.c_str(), box, medium); node->SetLineColor(kOrange + 7); mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0)); From fd042a4ce79187958cef0a213427dd035edca999 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sat, 12 Sep 2026 13:23:31 +0200 Subject: [PATCH 19/21] removed obsolete variables and funcions --- .../Upgrades/ALICE3/FD3/simulation/src/Detector.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index 99f994c989b7b..f717acf83cec3 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -214,16 +214,15 @@ void Detector::createMaterials() int matId = 0; // tmp material id number const int unsens = 0, sens = 1; // sensitive or unsensitive medium - // int fieldType; float maxField; + o2::base::Detector::initFieldTrackingParams(fieldType, maxField); // TODO: Comment out two lines below once tested that the above function assigns field type and max correctly - fieldType = 2; // Field type - maxField = 10.; // Field max. + fieldType = 3; // Field type + maxField = 5.0; // Field max. - o2::base::Detector::initFieldTrackingParams(fieldType, maxField); LOG(info) << "FD3: createMaterials(): fieldType " << fieldType << ", maxField " << maxField; float tmaxfd3 = -10.0; // max deflection angle due to magnetic field in one step @@ -242,9 +241,9 @@ void Detector::createMaterials() o2::base::Detector::Medium(Aluminium, "Aluminium", matId, unsens, fieldType, maxField, tmaxfd3, stepmax, deemax, epsil, stepmin); - // Cherenkov radiator - fieldType = 2; // magneticField->Integ(); - maxField = 10.; // magneticField->Max(); + // Cherenkov radiator glass, modify fieldType and maxField parameters + fieldType = 2; + maxField = 10.; // Radiator glass SiO2 Float_t aglass[2] = {28.0855, 15.9994}; From 07b3e74a86149e78f9dec238272d6152af7a706d Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sat, 12 Sep 2026 18:09:12 +0200 Subject: [PATCH 20/21] removed obsolete variables and funcions --- .../ALICE3/FD3/simulation/src/Detector.cxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx index f717acf83cec3..e96387b658ea0 100644 --- a/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FD3/simulation/src/Detector.cxx @@ -242,7 +242,7 @@ void Detector::createMaterials() tmaxfd3, stepmax, deemax, epsil, stepmin); // Cherenkov radiator glass, modify fieldType and maxField parameters - fieldType = 2; + fieldType = 2; maxField = 10.; // Radiator glass SiO2 @@ -274,15 +274,9 @@ void Detector::buildModules() TGeoVolumeAssembly *vFD3_ScintA, *vFD3_ScintC, *vFD3_CherA, *vFD3_CherC; - if (baseParam.isSymmetric) { - vFD3_ScintA = buildModuleScint(Constants::etaMin, Constants::etaMax); - vFD3_CherA = buildModuleCherenkov_v1(); - } else { - vFD3_ScintA = buildModuleScint(Constants::etaMin, Constants::etaMax2); - vFD3_CherA = buildModuleCherenkov_v2(); - } - + vFD3_ScintA = buildModuleScint(Constants::etaMin, baseParam.isSymmetric ? Constants::etaMax : Constants::etaMax2); vFD3_ScintC = buildModuleScint(Constants::etaMin, Constants::etaMax); + vFD3_CherA = baseParam.isSymmetric ? buildModuleCherenkov_v1() : buildModuleCherenkov_v2(); vFD3_CherC = buildModuleCherenkov_v1(); vFD3_ScintA->SetName("FD3_ScintA"); @@ -299,7 +293,7 @@ void Detector::buildModules() TGeoVolumeAssembly* Detector::buildModuleScint(float etaMin, float etaMax) { - auto mod = new TGeoVolumeAssembly("FD3_Scint"); + auto mod = new TGeoVolumeAssembly(""); const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator"); @@ -332,7 +326,7 @@ TGeoVolumeAssembly* Detector::buildModuleScint(float etaMin, float etaMax) TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() { - auto mod = new TGeoVolumeAssembly("FD3_Ch"); + auto mod = new TGeoVolumeAssembly(""); TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); @@ -368,7 +362,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1() TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2() { - auto mod = new TGeoVolumeAssembly("FD3_Ch"); + auto mod = new TGeoVolumeAssembly(""); TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); From d7ce7e2cdcd1b09709bca88f3e3a3a0090a8f138 Mon Sep 17 00:00:00 2001 From: Podist Kurashvili Date: Sun, 13 Sep 2026 06:54:50 +0200 Subject: [PATCH 21/21] remove dat files --- .../FD3/base/files/fd3_cherenkov_xy_v1.dat | 68 ------------------- .../FD3/base/files/fd3_cherenkov_xy_v2.dat | 68 ------------------- 2 files changed, 136 deletions(-) delete mode 100644 Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat delete mode 100644 Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat diff --git a/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat b/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat deleted file mode 100644 index 4da9b94a10574..0000000000000 --- a/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v1.dat +++ /dev/null @@ -1,68 +0,0 @@ -7.5 0 -7.5 3.2 -6.4 6.4 -3.2 7.5 --0 7.5 --3.2 7.5 --6.4 6.4 --7.5 3.2 --7.5 -0 --7.5 -3.2 --6.4 -6.4 --3.2 -7.5 -0 -7.5 -3.2 -7.5 -6.4 -6.4 -7.5 -3.2 -10.7 0 -10.7 3.2 -9.6 6.4 -9.6 9.6 -6.4 9.6 -3.2 10.7 --0 10.7 --3.2 10.7 --6.4 9.6 --9.6 9.6 --9.6 6.4 --10.7 3.2 --10.7 -0 --10.7 -3.2 --9.6 -6.4 --9.6 -9.6 --6.4 -9.6 --3.2 -10.7 -0 -10.7 -3.2 -10.7 -6.4 -9.6 -9.6 -9.6 -9.6 -6.4 -10.7 -3.2 -13.9 0 -13.9 3.2 -12.8 6.4 -12.8 9.6 -9.6 12.8 -6.4 12.8 -3.2 13.9 --0 13.9 --3.2 13.9 --6.4 12.8 --9.6 12.8 --12.8 9.6 --12.8 6.4 --13.9 3.2 --13.9 -0 --13.9 -3.2 --12.8 -6.4 --12.8 -9.6 --9.6 -12.8 --6.4 -12.8 --3.2 -13.9 -0 -13.9 -3.2 -13.9 -6.4 -12.8 -9.6 -12.8 -12.8 -9.6 -12.8 -6.4 -13.9 -3.2 diff --git a/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat b/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat deleted file mode 100644 index 7a0d670f5cf79..0000000000000 --- a/Detectors/Upgrades/ALICE3/FD3/base/files/fd3_cherenkov_xy_v2.dat +++ /dev/null @@ -1,68 +0,0 @@ -4.6 0 -3.2 3.2 --0 4.6 --3.2 3.2 --4.6 -0 --3.2 -3.2 -0 -4.6 -3.2 -3.2 -7.8 0 -6.4 3.2 -6.4 6.4 -3.2 6.4 --0 7.8 --3.2 6.4 --6.4 6.4 --6.4 3.2 --7.8 -0 --6.4 -3.2 --6.4 -6.4 --3.2 -6.4 -0 -7.8 -3.2 -6.4 -6.4 -6.4 -6.4 -3.2 -11 0 -9.6 3.2 -9.6 6.4 -9.6 9.6 -6.4 9.6 -3.2 9.6 --0 11 --3.2 9.6 --6.4 9.6 --9.6 9.6 --9.6 6.4 --9.6 3.2 --11 -0 --9.6 -3.2 --9.6 -6.4 --9.6 -9.6 --6.4 -9.6 --3.2 -9.6 -0 -11 -3.2 -9.6 -6.4 -9.6 -9.6 -9.6 -9.6 -6.4 -9.6 -3.2 -14.2 0 -12.8 3.2 -12.8 6.4 -6.4 12.8 -3.2 12.8 --0 14.2 --3.2 12.8 --6.4 12.8 --12.8 6.4 --12.8 3.2 --14.2 -0 --12.8 -3.2 --12.8 -6.4 --6.4 -12.8 --3.2 -12.8 -0 -14.2 -3.2 -12.8 -6.4 -12.8 -12.8 -6.4 -12.8 -3.2