diff --git a/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h b/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h index 72782d4ed7bdf..08c1f3a3097a5 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 @@ -176,6 +176,10 @@ namespace focal { class Hit; } +namespace fd3 +{ +class Hit; +} namespace detectors { @@ -260,6 +264,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..067ff93eadbf4 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_ @@ -22,15 +20,20 @@ namespace o2 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 nSectScint = 8; + static constexpr unsigned int nRingsScint = 5; - static constexpr float etaMax = 7.0f; - static constexpr float etaMin = 4.0f; + static constexpr float zScint = 420.0f; + static constexpr float zCher = 430.0f; - static constexpr unsigned int nringsA_withMG = 3; - static constexpr float etaMinA_withMG = 5.0f; + static constexpr float dzScint = 4.0f; + static constexpr float dzCher = 2.0f; + + static constexpr float etaMin = 2.5f; + static constexpr float etaMax = 4.9f; + static constexpr float etaMax2 = 5.5f; // asymmetric configuration + + static constexpr float rsizeq = 1.025f; // quartz radiator transverse size }; } // 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..ce8d08e758150 100644 --- a/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h +++ b/Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h @@ -15,22 +15,16 @@ #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 +struct FD3BaseParam : public o2::conf::ConfigurableParamHelper { - bool plateBehindA = false; - bool fullContainer = false; - float dzplate = 1.0f; // Aluminium plate width + bool isSymmetric = true; O2ParamDef(FD3BaseParam, "FD3Base"); }; 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 2d17acbd4a0e8..ce4c1c448e7cc 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. // @@ -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 + RadiatorOpticalGlass, + Aluminium, + MCPGlass }; private: @@ -96,20 +102,14 @@ 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; - - std::vector mRingSizesA = {}, mRingSizesC = {}; + TGeoVolumeAssembly* buildModuleScint(float etaMin, float etaMax); + TGeoVolumeAssembly* buildModuleCherenkov_v1(); + TGeoVolumeAssembly* buildModuleCherenkov_v2(); - float mEtaMaxA, mEtaMaxC, mEtaMinA, mEtaMinC; - float mZA, mZC; + int mChannelCounter; + std::map mChannelId; - bool mPlateBehindA, mFullContainer; + float getRingSize(float zmod, float eta); 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..e96387b658ea0 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. // @@ -56,44 +56,6 @@ Detector::Detector(bool active) mGeometryTGeo(nullptr), mTrackData() { - mNumberOfRingsC = Constants::nringsC; - mNumberOfSectors = Constants::nsect; - - mEtaMinA = Constants::etaMin; - mEtaMaxA = Constants::etaMax; - mEtaMinC = -Constants::etaMax; - mEtaMaxC = -Constants::etaMin; - - 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); - } } Detector::Detector(const Detector& rhs) @@ -105,7 +67,6 @@ Detector::Detector(const Detector& rhs) Detector& Detector::operator=(const Detector& rhs) { - if (this == &rhs) { return *this; } @@ -130,6 +91,7 @@ void Detector::InitializeO2Detector() LOG(info) << "Initialize Forward Detector"; mGeometryTGeo = GeometryTGeo::Instance(); defineSensitiveVolumes(); + definePassiveVolumes(); } bool Detector::ProcessHits(FairVolume* vol) @@ -139,8 +101,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(); @@ -202,12 +165,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 +188,12 @@ void Detector::Reset() } } +void Detector::ConstructGeometry() +{ + createMaterials(); + buildModules(); +} + void Detector::createMaterials() { float density, as[11], zs[11], ws[11]; @@ -251,134 +214,183 @@ 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 0GetVolume("cave"); + auto& baseParam = FD3BaseParam::Instance(); - if (!vCave) { - LOG(fatal) << "Could not find the top volume!"; - } + auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel"); + + mChannelCounter = 0; + + TGeoVolumeAssembly *vFD3_ScintA, *vFD3_ScintC, *vFD3_CherA, *vFD3_CherC; + + 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(); - TGeoVolumeAssembly* vFD3A = buildModuleA(); - TGeoVolumeAssembly* vFD3C = buildModuleC(); + vFD3_ScintA->SetName("FD3_ScintA"); + vFD3_ScintC->SetName("FD3_ScintC"); + vFD3_CherA->SetName("FD3_CherA"); + vFD3_CherC->SetName("FD3_CherC"); - vCave->AddNode(vFD3A, 1, new TGeoTranslation(0., 0., mZA)); - vCave->AddNode(vFD3C, 2, new TGeoTranslation(0., 0., mZC)); + 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, Constants::zCher)); + topVolume->AddNode(vFD3_CherC, 1, new TGeoTranslation(0., 30.f, -Constants::zCher)); } -TGeoVolumeAssembly* Detector::buildModuleA() +TGeoVolumeAssembly* Detector::buildModuleScint(float etaMin, float etaMax) { - TGeoVolumeAssembly* mod = new TGeoVolumeAssembly("FD3A"); + auto mod = new TGeoVolumeAssembly(""); const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator"); - float dphiDeg = 360. / mNumberOfSectors; + int nrings = Constants::nRingsScint, nsect = Constants::nSectScint; + float zmod = Constants::zScint, dz = Constants::dzScint; - for (int ir = 0; ir < mNumberOfRingsA; 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; - for (int ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * ir; + 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, phimin, phimax); - auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium); - if ((ir + ic) % 2 == 0) { - nod->SetLineColor(kRed); + 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); + if (cellId < nrings * nsect) { + node->SetLineColor((ir + ic) % 2 == 0 ? kRed : kRed - 7); } else { - nod->SetLineColor(kRed - 7); + node->SetLineColor((ir + ic) % 2 == 0 ? kBlue : kBlue - 7); } - ring->AddNode(nod, cellId); + mod->AddNode(node, 1); } - mod->AddNode(ring, ir + 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::buildModuleCherenkov_v1() { - TGeoVolumeAssembly* mod = new TGeoVolumeAssembly("FD3C"); - - 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 ic = 0; ic < mNumberOfSectors; ic++) { - int cellId = ic + mNumberOfSectors * (ir + mNumberOfRingsA); - 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(kBlue); - } else { - nod->SetLineColor(kBlue - 7); - } - ring->AddNode(nod, cellId); - } - mod->AddNode(ring, ir + 1); + auto mod = new TGeoVolumeAssembly(""); + + TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); + + float rsizeq = Constants::rsizeq, dz = Constants::dzCher; + + const int N = 68; + + 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}; + + 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++; + std::string nodeName = "fd3_node" + std::to_string(cellId); + 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)); } - // 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::buildModuleCherenkov_v2() +{ + auto mod = new TGeoVolumeAssembly(""); + + TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass"); + + float rsizeq = Constants::rsizeq, dz = Constants::dzCher; + + const int N = 68; + + 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++; + std::string nodeName = "fd3_node" + std::to_string(cellId); + 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)); } return mod; @@ -386,26 +398,27 @@ TGeoVolumeAssembly* Detector::buildModuleC() void Detector::defineSensitiveVolumes() { - LOG(info) << "Adding FD3 Sentitive Volumes"; - - TGeoVolume* v; - TString volumeName; - - int nCellsA = mNumberOfRingsA * mNumberOfSectors; - int nCellsC = mNumberOfRingsC * mNumberOfSectors; + LOG(info) << "Adding FD3 sentitive volumes..."; - LOG(info) << "number of A rings = " << mNumberOfRingsA << " number of cells = " << nCellsA; - LOG(info) << "number of C rings = " << mNumberOfRingsC << " number of cells = " << nCellsC; + mChannelId = {}; - for (int iv = 0; iv < nCellsA + nCellsC; iv++) { - volumeName = "fd3_node" + std::to_string(iv); - v = gGeoManager->GetVolume(volumeName); - LOG(info) << "Adding sensitive volume => " << v->GetName(); - AddSensitiveVolume(v); + 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) + continue; + int volId = registerSensitiveVolumeAndGetVolID(v); + mChannelId[volId] = ivol; } + LOG(info) << "Done"; +} + +void Detector::definePassiveVolumes() +{ + // To be added later } -float Detector::ringSize(float z, float eta) +float Detector::getRingSize(float z, float eta) { return z * TMath::Tan(2 * TMath::ATan(TMath::Exp(-eta))); }