From ba18575cd57e67dd34f62b4cb0602d1a06d61a5f Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Mon, 10 Feb 2025 20:14:14 +0100 Subject: [PATCH 1/7] ALICE3: TRK now hosts IRIS tracker which is divided into petal cases and made retractable --- .../ALICE3/FT3/simulation/src/Detector.cxx | 17 +- .../include/Alice3DetectorsPassive/Pipe.h | 12 +- .../Upgrades/ALICE3/Passive/src/Pipe.cxx | 138 +----------- .../TRK/base/include/TRKBase/TRKBaseParam.h | 1 + .../ALICE3/TRK/simulation/CMakeLists.txt | 42 ++-- .../include/TRKSimulation/Detector.h | 4 +- .../include/TRKSimulation/TRKPetalCase.h | 93 ++++++++ .../include/TRKSimulation/TRKPetalDisk.h | 62 ++++++ .../include/TRKSimulation/TRKPetalLayer.h | 61 ++++++ .../include/TRKSimulation/TRKServices.h | 12 +- .../ALICE3/TRK/simulation/src/Detector.cxx | 42 +++- .../TRK/simulation/src/TRKPetalCase.cxx | 204 ++++++++++++++++++ .../TRK/simulation/src/TRKPetalDisk.cxx | 92 ++++++++ .../TRK/simulation/src/TRKPetalLayer.cxx | 78 +++++++ .../ALICE3/TRK/simulation/src/TRKServices.cxx | 104 ++++----- .../TRK/simulation/src/TRKSimulationLinkDef.h | 3 + macro/build_geometry.C | 2 +- 17 files changed, 735 insertions(+), 232 deletions(-) create mode 100644 Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalCase.h create mode 100644 Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h create mode 100644 Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h create mode 100644 Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx create mode 100644 Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx create mode 100644 Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx diff --git a/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx index 296bec8aa8922..ce132fdb33cd3 100644 --- a/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx @@ -184,8 +184,8 @@ void Detector::buildBasicFT3(const FT3BaseParam& param) //_________________________________________________________________________________________________ void Detector::buildFT3V1() { - //Build FT3 detector according to - //https://indico.cern.ch/event/992488/contributions/4174473/attachments/2168881/3661331/tracker_parameters_werner_jan_11_2021.pdf + // Build FT3 detector according to + // https://indico.cern.ch/event/992488/contributions/4174473/attachments/2168881/3661331/tracker_parameters_werner_jan_11_2021.pdf LOG(info) << "Building FT3 Detector: V1"; @@ -284,17 +284,15 @@ void Detector::buildFT3NewVacuumVessel() // to adhere to the changes that were presented at the ALICE 3 Upgrade days in March 2024 // Inner radius at C-side to 7 cm // Inner radius at A-side stays at 5 cm + // 06.02.2025 update: IRIS layers are now in TRK LOG(info) << "Building FT3 Detector: After Upgrade Days March 2024 version"; - mNumberOfLayers = 12; + mNumberOfLayers = 9; float sensorThickness = 30.e-4; float layersx2X0 = 1.e-2; std::vector> layersConfigCSide{ - {26., .5, 2.5, 0.1f * layersx2X0}, // {z_layer, r_in, r_out, Layerx2X0} - {30., .5, 2.5, 0.1f * layersx2X0}, - {34., .5, 2.5, 0.1f * layersx2X0}, - {77., 7.0, 35., layersx2X0}, + {77., 7.0, 35., layersx2X0}, // {z_layer, r_in, r_out, Layerx2X0} {100., 7.0, 35., layersx2X0}, {122., 7.0, 35., layersx2X0}, {150., 7.0, 68.f, layersx2X0}, @@ -305,10 +303,7 @@ void Detector::buildFT3NewVacuumVessel() {350., 7.0, 68.f, layersx2X0}}; std::vector> layersConfigASide{ - {26., .5, 2.5, 0.1f * layersx2X0}, // {z_layer, r_in, r_out, Layerx2X0} - {30., .5, 2.5, 0.1f * layersx2X0}, - {34., .5, 2.5, 0.1f * layersx2X0}, - {77., 5.0, 35., layersx2X0}, + {77., 5.0, 35., layersx2X0}, // {z_layer, r_in, r_out, Layerx2X0} {100., 5.0, 35., layersx2X0}, {122., 5.0, 35., layersx2X0}, {150., 5.0, 68.f, layersx2X0}, diff --git a/Detectors/Upgrades/ALICE3/Passive/include/Alice3DetectorsPassive/Pipe.h b/Detectors/Upgrades/ALICE3/Passive/include/Alice3DetectorsPassive/Pipe.h index 1d9858e2dfec3..b13d9ab68780a 100644 --- a/Detectors/Upgrades/ALICE3/Passive/include/Alice3DetectorsPassive/Pipe.h +++ b/Detectors/Upgrades/ALICE3/Passive/include/Alice3DetectorsPassive/Pipe.h @@ -26,8 +26,6 @@ class Alice3Pipe : public Alice3PassiveBase ~Alice3Pipe() override; Alice3Pipe(const char* name, const char* title = "Alice 3 Pipe", - const bool isTRKActivated = false, - const bool isFT3Activated = false, const float pipeRIn = 0.f, const float pipeThickness = 0.f, const float a3ipLength = 0.f, @@ -50,9 +48,6 @@ class Alice3Pipe : public Alice3PassiveBase float getVacuumVesselWidth() const { return mVacuumVesselThick; } float getVacuumVesselLength() const { return mVacuumVesselASideLength; } - bool IsTRKActivated() const { return mIsTRKActivated; } - bool IsFT3Activated() const { return mIsFT3Activated; } - private: void createMaterials(); Alice3Pipe(const Alice3Pipe& orig) = default; @@ -62,13 +57,10 @@ class Alice3Pipe : public Alice3PassiveBase float mPipeThick = 0.; // inner beam pipe section thickness float mA3IPLength = 0.; // Length of A3IP - float mVacuumVesselRIn = 0.; // inner diameter of the vacuum vessel - float mVacuumVesselThick = 0.; // outer beam pipe section thickness + float mVacuumVesselRIn = 0.; // inner diameter of the vacuum vessel + float mVacuumVesselThick = 0.; // outer beam pipe section thickness float mVacuumVesselASideLength = 0.; // Length of the A Side of the vacuum vessel around the IP - bool mIsTRKActivated = true; // If TRK is not active don't create TRK layers allocations in the vacuum volume - bool mIsFT3Activated = true; - ClassDefOverride(Alice3Pipe, 1); }; } // namespace passive diff --git a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx index 57f30241bd4ff..4ba73a59ceffa 100644 --- a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx +++ b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx @@ -12,8 +12,8 @@ #include "Alice3DetectorsPassive/Pipe.h" #include #include -#include -#include +#include "TGeoTube.h" +#include "TVirtualMC.h" #include "TGeoManager.h" // for TGeoManager, gGeoManager #include "TGeoMaterial.h" // for TGeoMaterial #include "TGeoMedium.h" // for TGeoMedium @@ -31,8 +31,6 @@ using namespace o2::passive; Alice3Pipe::Alice3Pipe() : Alice3PassiveBase{"Alice3PIPE", ""} {} Alice3Pipe::Alice3Pipe(const char* name, const char* title, - bool isTRKActivated, - bool isFT3Activated, float pipeRIn, float pipeThickness, float a3ipLength, @@ -40,8 +38,6 @@ Alice3Pipe::Alice3Pipe(const char* name, float vacuumVesselThickness, float vacuumVesselASideLength) : Alice3PassiveBase{name, title}, - mIsTRKActivated{isTRKActivated}, - mIsFT3Activated{isFT3Activated}, mPipeRIn{pipeRIn}, mPipeThick{pipeThickness}, mA3IPLength{a3ipLength}, @@ -85,7 +81,6 @@ void Alice3Pipe::ConstructGeometry() auto& matmgr = o2::base::MaterialManager::Instance(); const TGeoMedium* kMedBe = matmgr.getTGeoMedium("ALICE3_PIPE_BE"); - const TGeoMedium* kMedVac = matmgr.getTGeoMedium("ALICE3_PIPE_VACUUM"); // Top volume TGeoVolume* top = gGeoManager->GetVolume("cave"); @@ -96,96 +91,11 @@ void Alice3Pipe::ConstructGeometry() // We split the naming of the parts if the beam pipe for ALICE 3 into parts // - pipe A Side - // - vacuum vessel (which hosts the primary vacuum and covers all C Side as well) - // - iris vacuum vessel (which hosts the secondary vacuum) + // - pipe C Side (which hosts the primary vacuum vessel and covers all C Side as well) // A3IP update - // Vacuum Double_t pipeASideLength = mA3IPLength / 2. - mVacuumVesselThick - mVacuumVesselASideLength; Double_t pipeCSideLength = mA3IPLength / 2. + mVacuumVesselASideLength; - TGeoTube* vacuumBasePipe = new TGeoTube("PIPEVACUUM_BASEsh", 0., mPipeRIn, mA3IPLength / 2.); - TGeoTube* vacuumBaseVacuumVessel = new TGeoTube("VACUUM_VESSELVACUUM_BASEsh", mPipeRIn, mVacuumVesselRIn, pipeCSideLength / 2.); - - TGeoTranslation* posPipeCSide = new TGeoTranslation("PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength - pipeCSideLength / 2.); - posPipeCSide->RegisterYourself(); - // Excavate volumes from the vacuum such that there is place for the TRK barrel layers and FT3 disc layers of the IRIS tracker - // And the other passive shapes: coldplate, iris tracker vacuum vessel - TGeoCompositeShape* vacuumComposite; - TGeoVolume* vacuumVolume; - TString compositeFormula{"PIPEVACUUM_BASEsh+VACUUM_VESSELVACUUM_BASEsh:PIPE_CSIDE_POSITION"}; - TString subtractorsFormula; - - if (!mIsTRKActivated) { - std::vector trkLayerShapes; - - std::vector> layersQuotas = {std::array{0.5f, 50.f, 100.e-4}, // TODO: Set layers dynamically. {radius, zLen, thickness} - std::array{1.2f, 50.f, 100.e-4}, - std::array{2.5f, 50.f, 100.e-4}}; - - for (auto iLayer{0}; iLayer < layersQuotas.size(); ++iLayer) { // Create TRK layers shapes - auto& layerData = layersQuotas[iLayer]; - trkLayerShapes.emplace_back(new TGeoTube(Form("TRKLAYER_%dsh", iLayer), layerData[0], layerData[0] + layerData[2], layerData[1] / 2.)); - if (iLayer != 0) { - subtractorsFormula += "+"; - } - subtractorsFormula += Form("TRKLAYER_%dsh", iLayer); - } - - // IRIS vacuum vessel and coldplate dimensions - float coldplateRIn = 2.6f; // cm - float coldplateThick = 150.e-3; // cm - float coldplateLength = 50.f; // cm - float irisVacuumVesselInnerRIn = 0.48f; // cm - float irisVacuumVesselOuterRIn = coldplateRIn + coldplateThick; - float irisVacuumVesselLength = 70.f; // cm - float irisVacuumVesselThick = 150.e-4; // cm - - // Excavate vacuum for hosting cold plate and IRIS tracker - TGeoTube* coldPlate = new TGeoTube("TRK_COLDPLATEsh", coldplateRIn, coldplateRIn + coldplateThick, coldplateLength / 2.); - subtractorsFormula += "+TRK_COLDPLATEsh"; - - TGeoTube* irisVacuumVesselInner = new TGeoTube("TRK_IRISVACUUMVESSELINNERsh", irisVacuumVesselInnerRIn, irisVacuumVesselInnerRIn + irisVacuumVesselThick, irisVacuumVesselLength / 2.); - subtractorsFormula += "+TRK_IRISVACUUMVESSELINNERsh"; - - TGeoTube* irisVacuumVesselOuter = new TGeoTube("TRK_IRISVACUUMVESSELOUTERsh", irisVacuumVesselOuterRIn, irisVacuumVesselOuterRIn + irisVacuumVesselThick, irisVacuumVesselLength / 2.); - subtractorsFormula += "+TRK_IRISVACUUMVESSELOUTERsh"; - - TGeoTube* irisVacuumVesselWall = new TGeoTube("TRK_IRISVACUUMVESSELWALLsh", irisVacuumVesselInnerRIn, irisVacuumVesselOuterRIn + irisVacuumVesselThick, irisVacuumVesselThick / 2.); - TGeoTranslation* posIrisVacVWallNegZSide = new TGeoTranslation("IRISWALLNEGZ", 0., 0., -irisVacuumVesselLength / 2. - irisVacuumVesselThick / 2.); - posIrisVacVWallNegZSide->RegisterYourself(); - subtractorsFormula += "+TRK_IRISVACUUMVESSELWALLsh:IRISWALLNEGZ"; - - TGeoTranslation* posIrisVacVWallPosZSide = new TGeoTranslation("IRISWALLPOSZ", 0., 0., irisVacuumVesselLength / 2. + irisVacuumVesselThick / 2.); - posIrisVacVWallPosZSide->RegisterYourself(); - subtractorsFormula += "+TRK_IRISVACUUMVESSELWALLsh:IRISWALLPOSZ"; - } - - if (!mIsFT3Activated) { - std::vector ft3DiscShapes; - std::vector ft3DiscPositions; - - std::vector> discsQuotas = {std::array{0.5f, 2.5f, 100.e-4, 26.}, // TODO: Set discs dynamically. {rIn, rOut, thickness, zpos} - std::array{0.5f, 2.5f, 100.e-4, 30.}, - std::array{0.5f, 2.5f, 100.e-4, 34.}, - std::array{0.5f, 2.5f, 100.e-4, -26.}, - std::array{0.5f, 2.5f, 100.e-4, -30.}, - std::array{0.5f, 2.5f, 100.e-4, -34.}}; - TString tempSubtractorsFormula = ""; - if (!mIsTRKActivated) { - tempSubtractorsFormula = "+"; - } - for (auto iDisc{0}; iDisc < discsQuotas.size(); ++iDisc) { - auto& discData = discsQuotas[iDisc]; - ft3DiscShapes.emplace_back(new TGeoTube(Form("FT3DISC_%dsh", iDisc), discData[0], discData[1], discData[2] / 2.)); - ft3DiscPositions.emplace_back(new TGeoTranslation(Form("t%d", iDisc), 0., 0., discData[3])); - ft3DiscPositions[iDisc]->RegisterYourself(); - if (iDisc != 0) { - tempSubtractorsFormula += "+"; - } - tempSubtractorsFormula += Form("FT3DISC_%dsh:t%d", iDisc, iDisc); - } - subtractorsFormula += tempSubtractorsFormula; - } // Pipe tubes TGeoTube* pipeASide = new TGeoTube("PIPE_Ash", mPipeRIn, mPipeRIn + mPipeThick, pipeASideLength / 2.); @@ -193,37 +103,25 @@ void Alice3Pipe::ConstructGeometry() TGeoTube* vacuumVesselWall = new TGeoTube("VACUUM_VESSEL_WALLsh", mPipeRIn, mVacuumVesselRIn + mVacuumVesselThick, mVacuumVesselThick / 2.); // Pipe and vacuum vessel positions - TGeoTranslation* posVacuumVesselWall = new TGeoTranslation("WALL_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick / 2.); - posVacuumVesselWall->RegisterYourself(); TGeoTranslation* posPipeASide = new TGeoTranslation("PIPE_ASIDE_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick + pipeASideLength / 2.); posPipeASide->RegisterYourself(); + TGeoTranslation* posPipeCSide = new TGeoTranslation("PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength - pipeCSideLength / 2.); + posPipeCSide->RegisterYourself(); + TGeoTranslation* posVacuumVesselWall = new TGeoTranslation("WALL_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick / 2.); + posVacuumVesselWall->RegisterYourself(); // Pipe composite shape and volume TString pipeCompositeFormula = - "VACUUM_VESSEL_WALLsh:WALL_POSITION" - "+PIPE_Ash:PIPE_ASIDE_POSITION" - "+PIPE_Csh:PIPE_CSIDE_POSITION"; - - if (subtractorsFormula.Length()) { - LOG(info) << "Subtractors formula before : " << subtractorsFormula; - subtractorsFormula = Form("-(%s)", subtractorsFormula.Data()); - LOG(info) << "Subtractors formula after: " << subtractorsFormula; - - vacuumComposite = new TGeoCompositeShape("VACUUM_BASEsh", (compositeFormula + subtractorsFormula).Data()); - vacuumVolume = new TGeoVolume("VACUUM_BASE", vacuumComposite, kMedVac); - } else { - vacuumComposite = new TGeoCompositeShape("VACUUM_BASEsh", compositeFormula.Data()); - vacuumVolume = new TGeoVolume("VACUUM_BASE", vacuumComposite, kMedVac); - } + "PIPE_Ash:PIPE_ASIDE_POSITION" + "+PIPE_Csh:PIPE_CSIDE_POSITION" + "+VACUUM_VESSEL_WALLsh:WALL_POSITION"; TGeoCompositeShape* pipeComposite = new TGeoCompositeShape("A3IPsh", pipeCompositeFormula); TGeoVolume* pipeVolume = new TGeoVolume("A3IP", pipeComposite, kMedBe); // Add everything to the barrel - barrel->AddNode(vacuumVolume, 1, new TGeoTranslation(0, 30.f, 0)); barrel->AddNode(pipeVolume, 1, new TGeoTranslation(0, 30.f, 0)); - vacuumVolume->SetLineColor(kGreen + 3); pipeVolume->SetLineColor(kGreen + 3); } @@ -236,15 +134,6 @@ void Alice3Pipe::createMaterials() float sxmgmx = 10.; o2::base::Detector::initFieldTrackingParams(isxfld, sxmgmx); - // - // Air - // - float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948}; - float zAir[4] = {6., 7., 8., 18.}; - float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827}; - float dAir = 1.20479E-3; - float dAir1 = 1.20479E-11; - // **************** // Defines tracking media parameters. // @@ -258,13 +147,8 @@ void Alice3Pipe::createMaterials() auto& matmgr = o2::base::MaterialManager::Instance(); // Beryllium - matmgr.Material("ALICE3_PIPE", 5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7); + matmgr.Material("ALICE3_PIPE", 5, "BERYLLIUM$", 9.01, 4., 1.848, 35.3, 36.7); matmgr.Medium("ALICE3_PIPE", 5, "BE", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - - // Vacuum - matmgr.Mixture("ALICE3_PIPE", 16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir); - - matmgr.Medium("ALICE3_PIPE", 16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); } // ---------------------------------------------------------------------------- diff --git a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/TRKBaseParam.h b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/TRKBaseParam.h index 6c655571b3e4e..79485b8c8707c 100644 --- a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/TRKBaseParam.h +++ b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/TRKBaseParam.h @@ -29,6 +29,7 @@ struct TRKBaseParam : public o2::conf::ConfigurableParamHelper { std::string configFile = ""; float serviceTubeX0 = 0.02f; // X0 Al2O3 eLayout layout = kCylinder; // Type of segmentation of the layers into staves + Bool_t irisOpen = false; O2ParamDef(TRKBaseParam, "TRKBase"); }; diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt b/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt index 7706c0e10d778..1abe3ae367870 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt @@ -1,23 +1,31 @@ -# Copyright 2019-2020 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. +#Copyright 2019 - 2020 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. # -# This software is distributed under the terms of the GNU General Public -# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +#This software is distributed under the terms of the GNU General Public +#License v3(GPL Version 3), copied verbatim in the file "COPYING". # -# In applying this license CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization +#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. o2_add_library(TRKSimulation - SOURCES src/TRKLayer.cxx - src/Detector.cxx - src/TRKServices.cxx - PUBLIC_LINK_LIBRARIES O2::TRKBase - O2::FT3Simulation - O2::ITSMFTSimulation) + SOURCES src / + TRKLayer.cxx + src / + TRKPetalCase.cxx + src / + TRKPetalLayer.cxx + src / + TRKPetalDisk.cxx + src / + Detector.cxx + src / + TRKServices.cxx + PUBLIC_LINK_LIBRARIES O2::TRKBase + O2::FT3Simulation + O2::ITSMFTSimulation) -o2_target_root_dictionary(TRKSimulation - HEADERS include/TRKSimulation/Detector.h - include/TRKSimulation/TRKLayer.h - include/TRKSimulation/TRKServices.h) \ No newline at end of file + o2_target_root_dictionary(TRKSimulation + HEADERS include / + TRKSimulation / Detector.h include / TRKSimulation / TRKLayer.h include / TRKSimulation / TRKServices.h include / TRKSimulation / TRKPetalCase.h include / TRKSimulation / TRKPetalLayer.h include / TRKSimulation / TRKPetalDisk.h) \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h index 5b777641dbe99..aa853b483a867 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h @@ -17,6 +17,7 @@ #include "TRKSimulation/TRKLayer.h" #include "TRKSimulation/TRKServices.h" +#include "TRKSimulation/TRKPetalCase.h" #include "TRKBase/GeometryTGeo.h" #include @@ -87,7 +88,8 @@ class Detector : public o2::base::DetImpl GeometryTGeo* mGeometryTGeo; //! std::vector* mHits; // ITSMFT ones for the moment std::vector mLayers; - TRKServices mServices; + TRKServices mServices; // Houses the services of the TRK, but not the Iris tracker + std::vector mPetalCases; // Houses the Iris tracker and its services. Created fully in the beam pipe void defineSensitiveVolumes(); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalCase.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalCase.h new file mode 100644 index 0000000000000..cd45cc98fd177 --- /dev/null +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalCase.h @@ -0,0 +1,93 @@ +// Copyright 2019-2020 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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_TRK_PETALCASE_H +#define ALICEO2_TRK_PETALCASE_H + +#include + +#include "TRKSimulation/TRKPetalLayer.h" +#include "TRKSimulation/TRKPetalDisk.h" +#include "TGeoCompositeShape.h" + +namespace o2 +{ +namespace trk +{ +class TRKPetalCase +{ + public: + TRKPetalCase() = default; + TRKPetalCase(Int_t number, TGeoVolume* motherVolume, Bool_t irisOpen); + ~TRKPetalCase() = default; + + // Sensitive volume list + std::vector mPetalLayers; + std::vector mPetalDisks; + + auto getPetalCaseName() { return mPetalCaseName; } + TString getFullName(); + + private: + void constructCase(TGeoVolume* motherVolume); + void constructColdPlate(TGeoVolume* motherVolume); + void constructDetectionPetals(TGeoVolume* motherVolume); + void addDetectionPetelsToFullComposite(); + + void addToPetalCaseComposite(TString shape) { mFullCompositeFormula += ("+" + shape); } + + Int_t mPetalCaseNumber; // Used to determine rotation and position. 0-3 + Bool_t mOpenState; // At injection energy, the iris tracker is in the open position. During stable beams, it is closed + + TString mPetalCaseName; + TString mFullCompositeFormula; // Used to excavate the petal and all its components from the vacuum + + // Center position of the petal case. 0,0,0 at stable beams (a.k.a. closed state) + Double_t mXPos, mYPos, mZPos; + + Double_t mWallThickness; // cm // Assume all the walls have the same thickness for now + Double_t mRIn; // cm + Double_t mROut; // cm + Double_t mRInOpenState; // cm + Double_t mPetalCaseLength; // cm + + Double_t mAngularCoverageAzimuthalWall; // Rad // Angular coverage of azimuthal part of wall (equivalent to that of the sensitive volumes) + Double_t mAngularCoverageRadialWall; // Rad // Angular coverage of radial part of wall + Double_t mToDeg; + + // Petal case parts -> In one composite shape + TGeoTubeSeg* mInnerAzimuthalWall; + TGeoTubeSeg* mOuterAzimuthalWall; + TGeoTubeSeg* mRadialWall; + TGeoTubeSeg* mForwardWall; + + TGeoRotation* mAzimuthalWallRot; + TGeoRotation* mRadialWall1Rot; + TGeoRotation* mRadialWall2Rot; + + TGeoCombiTrans* mAzimuthalWallCombiTrans; + TGeoCombiTrans* mRadialWall1CombiTrans; + TGeoCombiTrans* mRadialWall2CombiTrans; + TGeoCombiTrans* mForwardWall1CombiTrans; + TGeoCombiTrans* mForwardWall2CombiTrans; + + TGeoVolume* mPetalCaseVolume; + + // Cold plate + TGeoTubeSeg* mColdPlate; + TGeoVolume* mColdPlateVolume; + + ClassDef(TRKPetalCase, 1); +}; + +} // namespace trk +} // namespace o2 +#endif // ALICEO2_TRK_PETALCASE_H \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h new file mode 100644 index 0000000000000..0b01e6d393aaf --- /dev/null +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h @@ -0,0 +1,62 @@ +// Copyright 2019-2020 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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. + +/// \file TRKPetalDisk.h +/// \brief Definition of the TRKPetalDisk class + +#ifndef ALICEO2_TRK_PETAL_DISK_H_ +#define ALICEO2_TRK_PETAL_DISK_H_ + +#include "TGeoManager.h" // for gGeoManager +#include "Rtypes.h" // for Double_t, Int_t, Bool_t, etc +#include // for LOG + +namespace o2 +{ +namespace trk +{ + +/// This class defines the Geometry for the TRK Disk TGeo. +class TRKPetalDisk +{ + public: + TRKPetalDisk() = default; + TRKPetalDisk(Int_t diskNumber, std::string diskName, Float_t z, Float_t rIn, Float_t rOut, Float_t angularCoverage, Float_t Diskx2X0); + ~TRKPetalDisk() = default; + + auto getInnerRadius() const { return mInnerRadius; } + auto getOuterRadius() const { return mOuterRadius; } + auto getThickness() const { return mChipThickness; } + auto getAngularCoverage() const { return mAngularCoverage; } + auto getZ() const { return mZ; } + auto getx2X0() const { return mx2X0; } + auto getName() const { return mDiskName; } + + /// Creates the actual Disk and places inside its mother volume + /// \param motherVolume the TGeoVolume owing the volume structure + void createDisk(TGeoVolume* motherVolume, TGeoCombiTrans* combiTrans); + + private: + Int_t mDiskNumber = -1; ///< Current disk number + std::string mDiskName; ///< Current disk name + Double_t mInnerRadius; ///< Inner radius of this disk + Double_t mOuterRadius; ///< Outer radius of this disk + Double_t mAngularCoverage; + Double_t mZ; ///< Z position of the disk + Double_t mChipThickness; ///< Chip thickness + Double_t mx2X0; ///< Disk material budget x/X0 + + ClassDef(TRKPetalDisk, 1); +}; +} // namespace trk +} // namespace o2 + +#endif // ALICEO2_TRK_PETAL_DISK_H diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h new file mode 100644 index 0000000000000..85956f34191eb --- /dev/null +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h @@ -0,0 +1,61 @@ +// Copyright 2019-2020 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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_TRK_PETAL_LAYER_H +#define ALICEO2_TRK_PETAL_LAYER_H + +#include "TGeoManager.h" +#include +#include "TGeoTube.h" + +#include "TRKBase/TRKBaseParam.h" + +namespace o2 +{ +namespace trk +{ +class TRKPetalLayer +{ + public: + TRKPetalLayer() = default; + TRKPetalLayer(Int_t layerNumber, std::string layerName, Float_t rIn, Float_t angularCoverage, Float_t zLength, Float_t layerX2X0); + ~TRKPetalLayer() = default; + + auto getInnerRadius() const { return mInnerRadius; } + auto getAngularCoverage() const { return mAngularCoverage; } + auto getZLength() { return mZ; } + auto getx2X0() const { return mX2X0; } + auto getChipThickness() const { return mChipThickness; } + auto getNumber() const { return mLayerNumber; } + auto getName() const { return mLayerName; } + + auto getShapeName() const { return mLayer->GetName(); } + + void createLayer(TGeoVolume* motherVolume, TGeoCombiTrans* combiTrans); + + private: + Int_t mLayerNumber; + std::string mLayerName; + Float_t mInnerRadius; + Float_t mZ; + Float_t mX2X0; + Float_t mChipThickness; + Float_t mModuleWidth; // u.m. = cm + Float_t mAngularCoverage; // rad + + TGeoTubeSeg* mLayer; + + ClassDef(TRKPetalLayer, 1); +}; + +} // namespace trk +} // namespace o2 +#endif // ALICEO2_TRK_PETAL_LAYER_H \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h index 4a12be8572ed5..8dd3968743024 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h @@ -46,15 +46,18 @@ class TRKServices : public FairModule // =================================================== ---> createOuterServices public: TRKServices() = default; - TRKServices(float rMin, float zLength, float thickness); void createMaterials(); void createServices(TGeoVolume* motherVolume); - void createColdplate(TGeoVolume* motherVolume); void createMiddleServices(TGeoVolume* motherVolume); void createOuterDisksServices(TGeoVolume* motherVolume); void createOuterBarrelServices(TGeoVolume* motherVolume); + void createVacuumCompositeShape(); + void excavateFromVacuum(TString shapeToExcavate); + void registerVacuum(TGeoVolume* motherVolume); protected: + // Vacuum + TString mVacuumCompositeFormula; // Coldplate float mColdPlateRMin; // cm float mColdPlateZLength; // cm @@ -70,11 +73,6 @@ class TRKServices : public FairModule float mMiddleDiskThickness = 1.0; // cm std::vector mCableFanWeights = {0.5, 0.3, 0.2}; // relative weights of the fan layers - // IRIS vacuum vessel - float mRInIRISVacV; // cm - float mROutIRISVacV; // cm - float mZLengthIRISVacV; // cm - float mThicknessIRISVacV; // cm ClassDefOverride(TRKServices, 1); }; } // namespace trk diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx index 9e69a3bd8a88f..d8d51af87f92f 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx @@ -80,9 +80,9 @@ void Detector::configDefault() mLayers.clear(); LOGP(warning, "Loading Scoping Document configuration for ALICE3 TRK"); - mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 0.5f, 50.f, 100.e-4); - mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); - mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); + // mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 0.5f, 50.f, 100.e-4); + // mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); + // mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 3.78f, 124.f, 100.e-3); mLayers.emplace_back(4, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(4)}, 7.f, 124.f, 100.e-3); mLayers.emplace_back(5, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(5)}, 12.f, 124.f, 100.e-3); @@ -103,9 +103,9 @@ void Detector::buildTRKNewVacuumVessel() mLayers.clear(); LOGP(warning, "Loading \"After Upgrade Days March 2024\" configuration for ALICE3 TRK"); - mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 0.5f, 50.f, 100.e-4); - mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); - mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); + // mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 0.5f, 50.f, 100.e-4); + // mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); + // mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 7.f, 124.f, 100.e-3); mLayers.emplace_back(4, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(4)}, 9.f, 124.f, 100.e-3); mLayers.emplace_back(5, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(5)}, 12.f, 124.f, 100.e-3); @@ -164,7 +164,7 @@ void Detector::configToFile(std::string fileName) void Detector::configServices() { - mServices = TRKServices{2.6f, 50.f, 150.e-3}; + mServices = TRKServices(); } void Detector::createMaterials() @@ -228,6 +228,14 @@ void Detector::createGeometry() // Add service for inner tracker mServices.createServices(vTRK); + mPetalCases.clear(); + // Add petal cases (the sensitive layers inside the petal cases get constructed here too) + auto& trkPars = TRKBaseParam::Instance(); + for (Int_t petalCaseNumber = 0; petalCaseNumber < 4; ++petalCaseNumber) { + mPetalCases.emplace_back(petalCaseNumber, vTRK, trkPars.irisOpen); + mServices.excavateFromVacuum(mPetalCases[petalCaseNumber].getFullName()); + } + mServices.registerVacuum(vTRK); } void Detector::InitializeO2Detector() @@ -245,6 +253,26 @@ void Detector::defineSensitiveVolumes() TString volumeName; LOGP(info, "Adding TRK Sensitive Volumes"); + // Add petal case sensitive volumes + for (int petalCase = 0; petalCase < 4; ++petalCase) { + // Petal layers + for (int petalLayer = 0; petalLayer < mPetalCases[petalCase].mPetalLayers.size(); ++petalLayer) { + volumeName = mPetalCases[petalCase].mPetalLayers[petalLayer].getName(); + LOGP(info, "Trying {}", volumeName.Data()); + v = geoManager->GetVolume(volumeName.Data()); + LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); + AddSensitiveVolume(v); + } + // Petal disks + for (int petalDisk = 0; petalDisk < mPetalCases[petalCase].mPetalDisks.size(); ++petalDisk) { + volumeName = mPetalCases[petalCase].mPetalDisks[petalDisk].getName(); + LOGP(info, "Trying {}", volumeName.Data()); + v = geoManager->GetVolume(volumeName.Data()); + LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); + AddSensitiveVolume(v); + } + } + // The names of the TRK sensitive volumes have the format: TRKLayer(0...mLayers.size()-1) for (int j{0}; j < mLayers.size(); j++) { volumeName = GeometryTGeo::getTRKSensorPattern() + TString::Itoa(j, 10); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx new file mode 100644 index 0000000000000..1a9765158f558 --- /dev/null +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx @@ -0,0 +1,204 @@ +// Copyright 2019-2020 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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. + +#include "TRKSimulation/TRKPetalCase.h" +#include "TRKBase/GeometryTGeo.h" +#include + +#include "Framework/Logger.h" + +#include "TGeoTube.h" +#include "TGeoMatrix.h" +#include "TGeoCompositeShape.h" +#include "TGeoVolume.h" +#include "TString.h" +#include "TMath.h" + +namespace o2 +{ +namespace trk +{ +TRKPetalCase::TRKPetalCase(Int_t number, TGeoVolume* motherVolume, Bool_t irisOpen) : mPetalCaseNumber(number), mOpenState(irisOpen) +{ + + mWallThickness = .15e-1; // cm // Assume all the walls have the same thickness for now. + mRIn = 0.48; // cm + mROut = 3; // cm + mRInOpenState = 1.5; // cm + mPetalCaseLength = 70.; // cm + + // Calculate angular coverages of azimuthal part of wall (equivalent to that of the sensitive volumes) + mAngularCoverageAzimuthalWall = (0.25 * (2 * mRIn * TMath::Pi()) - 2 * mWallThickness) / mRIn; + mAngularCoverageRadialWall = mWallThickness / mRIn; + mToDeg = 180 / TMath::Pi(); + + // Calculate the center of the petal (x_c, y_c, z_c) based on whether it is open or not + mZPos = 0; + if (mOpenState) { + Double_t rHalfPetal = 0.5 * (mRIn + mROut); + Double_t rOpenStateCenter = TMath::Sqrt(rHalfPetal * rHalfPetal + mRInOpenState * mRInOpenState); + mXPos = rOpenStateCenter * TMath::Cos(0.25 * TMath::Pi() + (mPetalCaseNumber - 1) * 0.5 * TMath::Pi()); + mYPos = rOpenStateCenter * TMath::Sin(0.25 * TMath::Pi() + (mPetalCaseNumber - 1) * 0.5 * TMath::Pi()); + } else { + mXPos = 0.; + mYPos = 0.; + } + + // Make the petal case + constructCase(motherVolume); + // Make coldplate + constructColdPlate(motherVolume); + // Add the detection petals (quarter disks and barrel layers) + constructDetectionPetals(motherVolume); +} + +TString TRKPetalCase::getFullName() +{ + TString fullCompositeName = Form("PETALCASE%d_FULLCOMPOSITE", mPetalCaseNumber); + TGeoCompositeShape* fullCompositeShape = new TGeoCompositeShape(fullCompositeName, mFullCompositeFormula); + return fullCompositeName; +} + +void TRKPetalCase::constructCase(TGeoVolume* motherVolume) +{ + + // Petal case parts in TGeoTubeSeg + mInnerAzimuthalWall = new TGeoTubeSeg(Form("PETAL%d_INNER_AZIMUTHAL_WALL", mPetalCaseNumber), mRIn, mRIn + mWallThickness, mPetalCaseLength / 2., -0.5 * mAngularCoverageAzimuthalWall * mToDeg, 0.5 * mAngularCoverageAzimuthalWall * mToDeg); + mOuterAzimuthalWall = new TGeoTubeSeg(Form("PETAL%d_OUTER_AZIMUTHAL_WALL", mPetalCaseNumber), mROut, mROut + mWallThickness, mPetalCaseLength / 2., -0.5 * mAngularCoverageAzimuthalWall * mToDeg, 0.5 * mAngularCoverageAzimuthalWall * mToDeg); + mRadialWall = new TGeoTubeSeg(Form("PETAL%d_RADIAL_WALL", mPetalCaseNumber), mRIn, mROut + mWallThickness, mPetalCaseLength / 2., -0.5 * mAngularCoverageRadialWall * mToDeg, 0.5 * mAngularCoverageRadialWall * mToDeg); + mForwardWall = new TGeoTubeSeg(Form("PETAL%d_FORWARD_WALL", mPetalCaseNumber), mRIn, mROut + mWallThickness, mWallThickness / 2., -0.5 * (mAngularCoverageAzimuthalWall + 2 * mAngularCoverageRadialWall) * mToDeg, 0.5 * (mAngularCoverageAzimuthalWall + 2 * mAngularCoverageRadialWall) * mToDeg); + + // Rotate to correct section : 0-3 + mAzimuthalWallRot = new TGeoRotation((TString)Form("PETAL%d_AZIMUTHAL_WALL_ROT", mPetalCaseNumber), (mPetalCaseNumber * 0.5 * TMath::Pi() + 0.5 * mAngularCoverageAzimuthalWall + mAngularCoverageRadialWall) * mToDeg, 0., 0.); + mAzimuthalWallRot->RegisterYourself(); + mRadialWall1Rot = new TGeoRotation((TString)Form("PETAL%d_RADIAL_WALL1_ROT", mPetalCaseNumber), (mPetalCaseNumber * 0.5 * TMath::Pi() + 0.5 * mAngularCoverageRadialWall) * mToDeg, 0., 0.); + mRadialWall1Rot->RegisterYourself(); + mRadialWall2Rot = new TGeoRotation((TString)Form("PETAL%d_RADIAL_WALL2_ROT", mPetalCaseNumber), (mPetalCaseNumber * 0.5 * TMath::Pi() + mAngularCoverageAzimuthalWall + 1.5 * mAngularCoverageRadialWall) * mToDeg, 0., 0.); + mRadialWall2Rot->RegisterYourself(); + + // Place to correct position (open or closed) + mAzimuthalWallCombiTrans = new TGeoCombiTrans((TString)Form("PETAL%d_AZIMUTHAL_WALL_COMBITRANS", mPetalCaseNumber), mXPos, mYPos, mZPos, mAzimuthalWallRot); + mAzimuthalWallCombiTrans->RegisterYourself(); + mRadialWall1CombiTrans = new TGeoCombiTrans((TString)Form("PETAL%d_RADIAL_WALL1_COMBITRANS", mPetalCaseNumber), mXPos, mYPos, mZPos, mRadialWall1Rot); + mRadialWall1CombiTrans->RegisterYourself(); + mRadialWall2CombiTrans = new TGeoCombiTrans((TString)Form("PETAL%d_RADIAL_WALL2_COMBITRANS", mPetalCaseNumber), mXPos, mYPos, mZPos, mRadialWall2Rot); + mRadialWall2CombiTrans->RegisterYourself(); + mForwardWall1CombiTrans = new TGeoCombiTrans((TString)Form("PETAL%d_FORWARD_WALL1_COMBITRANS", mPetalCaseNumber), mXPos, mYPos, (mPetalCaseLength + mWallThickness) / 2., mAzimuthalWallRot); + mForwardWall1CombiTrans->RegisterYourself(); + mForwardWall2CombiTrans = new TGeoCombiTrans((TString)Form("PETAL%d_FORWARD_WALL2_COMBITRANS", mPetalCaseNumber), mXPos, mYPos, -(mPetalCaseLength + mWallThickness) / 2., mAzimuthalWallRot); + mForwardWall2CombiTrans->RegisterYourself(); + + TString petalCaseCompositeFormula = (TString)Form("PETAL%d_INNER_AZIMUTHAL_WALL:PETAL%d_AZIMUTHAL_WALL_COMBITRANS", mPetalCaseNumber, mPetalCaseNumber) + (TString)Form("+PETAL%d_OUTER_AZIMUTHAL_WALL:PETAL%d_AZIMUTHAL_WALL_COMBITRANS", mPetalCaseNumber, mPetalCaseNumber) + (TString)Form("+PETAL%d_RADIAL_WALL:PETAL%d_RADIAL_WALL1_COMBITRANS", mPetalCaseNumber, mPetalCaseNumber) + (TString)Form("+PETAL%d_RADIAL_WALL:PETAL%d_RADIAL_WALL2_COMBITRANS", mPetalCaseNumber, mPetalCaseNumber) + (TString)Form("+PETAL%d_FORWARD_WALL:PETAL%d_FORWARD_WALL1_COMBITRANS", mPetalCaseNumber, mPetalCaseNumber) + (TString)Form("+PETAL%d_FORWARD_WALL:PETAL%d_FORWARD_WALL2_COMBITRANS", mPetalCaseNumber, mPetalCaseNumber); + + TGeoCompositeShape* petalCaseComposite = new TGeoCompositeShape((TString)Form("PETALCASE%dsh", mPetalCaseNumber), petalCaseCompositeFormula); + mFullCompositeFormula = petalCaseComposite->GetName(); + auto& matmgr = o2::base::MaterialManager::Instance(); + const TGeoMedium* kMedBe = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_BERYLLIUM"); + + mPetalCaseName = Form("PETALCASE%d", mPetalCaseNumber); + mPetalCaseVolume = new TGeoVolume(mPetalCaseName, petalCaseComposite, kMedBe); + mPetalCaseVolume->SetVisibility(1); + mPetalCaseVolume->SetLineColor(kGray); + + LOGP(info, "Creating IRIS Tracker vacuum petal case {}", mPetalCaseNumber); + LOGP(info, "Inserting {} in {} ", mPetalCaseVolume->GetName(), motherVolume->GetName()); + motherVolume->AddNode(mPetalCaseVolume, 1, nullptr); +} + +void TRKPetalCase::constructColdPlate(TGeoVolume* motherVolume) +{ + Double_t coldPlateRadius = 2.6; // cm + Double_t coldPlateThickness = 0.15; // cm + Double_t coldPlateLength = 50.; // cm + + mColdPlate = new TGeoTubeSeg((TString)Form("PETAL%d_COLDPLATE", mPetalCaseNumber), coldPlateRadius, coldPlateRadius + coldPlateThickness, coldPlateLength / 2., -0.5 * mAngularCoverageAzimuthalWall * mToDeg, 0.5 * mAngularCoverageAzimuthalWall * mToDeg); + auto& matmgr = o2::base::MaterialManager::Instance(); + const TGeoMedium* medCeramic = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_CERAMIC"); + mColdPlateVolume = new TGeoVolume(Form("COLDPLATE%d", mPetalCaseNumber), mColdPlate, medCeramic); + + TString coldPlateCompositeFormula = mColdPlate->GetName(); + coldPlateCompositeFormula += ":"; + coldPlateCompositeFormula += mAzimuthalWallCombiTrans->GetName(); + addToPetalCaseComposite(coldPlateCompositeFormula); + + mColdPlateVolume->SetVisibility(1); + mColdPlateVolume->SetLineColor(kGray); + + LOGP(info, "Creating cold plate service"); + LOGP(info, "Inserting {} in {} ", mColdPlateVolume->GetName(), motherVolume->GetName()); + motherVolume->AddNode(mColdPlateVolume, 1, mAzimuthalWallCombiTrans); +} + +void TRKPetalCase::constructDetectionPetals(TGeoVolume* motherVolume) +{ + // Add petal layers + // layerNumber, layerName, rIn, angularCoverage, zLength, layerx2X0 + mPetalLayers.emplace_back(0, Form("%s_LAYER%d", mPetalCaseName.Data(), 0), 0.5f, mAngularCoverageAzimuthalWall, 50.f, 1.e-3); + mPetalLayers.emplace_back(1, Form("%s_LAYER%d", mPetalCaseName.Data(), 1), 1.2f, mAngularCoverageAzimuthalWall, 50.f, 1.e-3); + mPetalLayers.emplace_back(2, Form("%s_LAYER%d", mPetalCaseName.Data(), 2), 2.5f, mAngularCoverageAzimuthalWall, 50.f, 1.e-3); + for (Int_t i = 0; i < mPetalLayers.size(); ++i) { + mPetalLayers[i].createLayer(motherVolume, mAzimuthalWallCombiTrans); + } + + // Add petal disks + // diskNumber, diskName, zPos, rIn, rOut, angularCoverage, diskx2X0 + mPetalDisks.emplace_back(0, Form("%s_DISK%d", mPetalCaseName.Data(), 0), 26., .5, 2.5, mAngularCoverageAzimuthalWall, 1.e-3); + mPetalDisks.emplace_back(1, Form("%s_DISK%d", mPetalCaseName.Data(), 1), 30., .5, 2.5, mAngularCoverageAzimuthalWall, 1.e-3); + mPetalDisks.emplace_back(2, Form("%s_DISK%d", mPetalCaseName.Data(), 2), 34., .5, 2.5, mAngularCoverageAzimuthalWall, 1.e-3); + mPetalDisks.emplace_back(3, Form("%s_DISK%d", mPetalCaseName.Data(), 3), -26., .5, 2.5, mAngularCoverageAzimuthalWall, 1.e-3); + mPetalDisks.emplace_back(4, Form("%s_DISK%d", mPetalCaseName.Data(), 4), -30., .5, 2.5, mAngularCoverageAzimuthalWall, 1.e-3); + mPetalDisks.emplace_back(5, Form("%s_DISK%d", mPetalCaseName.Data(), 5), -34., .5, 2.5, mAngularCoverageAzimuthalWall, 1.e-3); + for (Int_t i = 0; i < mPetalDisks.size(); ++i) { + mPetalDisks[i].createDisk(motherVolume, mAzimuthalWallCombiTrans); + } + + addDetectionPetelsToFullComposite(); +} + +void TRKPetalCase::addDetectionPetelsToFullComposite() +{ + LOGP(info, "Excavating layers from vacuum"); + for (Int_t i = 0; i < mPetalLayers.size(); ++i) { + Double_t zLength = mPetalLayers[i].getZLength(); + Double_t rIn = mPetalLayers[i].getInnerRadius(); + Double_t thickness = mPetalLayers[i].getChipThickness(); + Double_t angularCoverage = mPetalLayers[i].getAngularCoverage(); + TGeoTubeSeg* layerForExcavation = new TGeoTubeSeg(Form("PETALCASE%d_EXCAVATIONLAYER%d", mPetalCaseNumber, i), rIn, rIn + thickness, zLength / 2., -0.5 * angularCoverage * mToDeg, 0.5 * angularCoverage * mToDeg); + + TString layerForExcavationCompositeFormula = layerForExcavation->GetName(); + layerForExcavationCompositeFormula += ":"; + layerForExcavationCompositeFormula += mAzimuthalWallCombiTrans->GetName(); + addToPetalCaseComposite(layerForExcavationCompositeFormula); + } + + LOGP(info, "Excavating disks vacuum"); + for (Int_t i = 0; i < mPetalDisks.size(); ++i) { + Double_t zPos = mPetalDisks[i].getZ(); + Double_t rIn = mPetalDisks[i].getInnerRadius(); + Double_t rOut = mPetalDisks[i].getOuterRadius(); + Double_t thickness = mPetalDisks[i].getThickness(); + Double_t angularCoverage = mPetalDisks[i].getAngularCoverage(); + TGeoTubeSeg* diskForExcavation = new TGeoTubeSeg(Form("PETALCASE%d_EXCAVATIONDISK%d", mPetalCaseNumber, i), rIn, rOut, thickness / 2., -0.5 * angularCoverage * mToDeg, 0.5 * angularCoverage * mToDeg); + TGeoCombiTrans* diskForExcavationCombiTrans = new TGeoCombiTrans(*(mAzimuthalWallCombiTrans->MakeClone())); // Copy from petal case + diskForExcavationCombiTrans->SetName((TString)Form("PETALCASE%d_EXCAVATIONDISK%d_COMBITRANS", mPetalCaseNumber, i)); + diskForExcavationCombiTrans->SetDz(zPos); // Overwrite z location + diskForExcavationCombiTrans->RegisterYourself(); + + TString diskForExcavationCompositeFormula = diskForExcavation->GetName(); + diskForExcavationCompositeFormula += ":"; + diskForExcavationCompositeFormula += diskForExcavationCombiTrans->GetName(); + addToPetalCaseComposite(diskForExcavationCompositeFormula); + } +} + +// ClassImp(TRKPetalCase); +} // namespace trk +} // namespace o2 \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx new file mode 100644 index 0000000000000..5df3a3cb0aa4d --- /dev/null +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx @@ -0,0 +1,92 @@ +// Copyright 2019-2020 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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. + +/// \file TRKPetalDisk.cxx +/// \brief Implementation of the TRKPetalDisk class + +#include "TRKSimulation/TRKPetalDisk.h" +#include "TRKBase/GeometryTGeo.h" + +#include // for LOG + +#include "TGeoManager.h" // for TGeoManager, gGeoManager +#include "TGeoMatrix.h" // for TGeoCombiTrans, TGeoRotation, etc +#include "TGeoTube.h" // for TGeoTube, TGeoTubeSeg +#include "TGeoVolume.h" // for TGeoVolume, TGeoVolumeAssembly +#include "TGeoCompositeShape.h" // for TGeoCompositeShape +#include "TMathBase.h" // for Abs +#include "TMath.h" // for Sin, RadToDeg, DegToRad, Cos, Tan, etc +#include "TGeoTube.h" + +#include // for snprintf + +namespace o2 +{ +namespace trk +{ + +TRKPetalDisk::TRKPetalDisk(Int_t diskNumber, std::string diskName, Float_t z, Float_t rIn, Float_t rOut, Float_t angularCoverage, Float_t Diskx2X0) +{ + // Creates a simple parametrized petal disk + mDiskNumber = diskNumber; + mDiskName = diskName; + mZ = z; + mAngularCoverage = angularCoverage; + mx2X0 = Diskx2X0; + mInnerRadius = rIn; + mOuterRadius = rOut; + Float_t Si_X0 = 9.5; + mChipThickness = Diskx2X0 * Si_X0; + + LOG(info) << "Creating TRK Disk " << mDiskNumber; + LOG(info) << " Using silicon X0 = " << Si_X0 << " to emulate disk radiation length."; + LOG(info) << " Disk z = " << mZ << " ; R_in = " << mInnerRadius << " ; R_out = " << mOuterRadius << " ; x2X0 = " << mx2X0 << " ; ChipThickness = " << mChipThickness; +} + +void TRKPetalDisk::createDisk(TGeoVolume* motherVolume, TGeoCombiTrans* combiTrans) +{ + // Create tube, set sensitive volume, add to mother volume + Double_t toDeg = 180 / TMath::Pi(); + std::string chipName = o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mDiskNumber), + sensName = Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mDiskNumber); + + TGeoTubeSeg* sensor = new TGeoTubeSeg(mInnerRadius, mOuterRadius, mChipThickness / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + TGeoTubeSeg* chip = new TGeoTubeSeg(mInnerRadius, mOuterRadius, mChipThickness / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + TGeoTubeSeg* disk = new TGeoTubeSeg(mInnerRadius, mOuterRadius, mChipThickness / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + + TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$"); + TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$"); + + TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); + sensVol->SetLineColor(kYellow); + TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi); + chipVol->SetLineColor(kYellow); + TGeoVolume* diskVol = new TGeoVolume(mDiskName.c_str(), disk, medAir); + diskVol->SetLineColor(kYellow); + + LOG(info) << "Inserting " << sensVol->GetName() << " inside " << chipVol->GetName(); + chipVol->AddNode(sensVol, 1, nullptr); + + LOG(info) << "Inserting " << chipVol->GetName() << " inside " << diskVol->GetName(); + diskVol->AddNode(chipVol, 1, nullptr); + + // Finally put everything in the mother volume + TGeoCombiTrans* fwdPetalCombiTrans = new TGeoCombiTrans(*(combiTrans->MakeClone())); // Copy from petal case + fwdPetalCombiTrans->SetDz(mZ); // Overwrite z location + fwdPetalCombiTrans->RegisterYourself(); + + LOG(info) << "Inserting " << diskVol->GetName() << " inside " << motherVolume->GetName(); + motherVolume->AddNode(diskVol, 1, fwdPetalCombiTrans); +} +// ClassImp(TRKPetalLayer); + +} // namespace trk +} // namespace o2 \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx new file mode 100644 index 0000000000000..2b21ecdc7ccf6 --- /dev/null +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx @@ -0,0 +1,78 @@ +// Copyright 2019-2020 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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. + +#include "TRKSimulation/TRKPetalLayer.h" +#include "TRKBase/GeometryTGeo.h" + +#include "Framework/Logger.h" + +#include "TGeoTube.h" +#include "TGeoBBox.h" +#include "TGeoVolume.h" +#include "TGeoTube.h" +#include "TGeoMatrix.h" + +#include "TMath.h" + +namespace o2 +{ +namespace trk +{ +TRKPetalLayer::TRKPetalLayer(Int_t layerNumber, std::string layerName, Float_t rIn, Float_t angularCoverage, Float_t zLength, Float_t layerX2X0) + : mLayerNumber(layerNumber), mLayerName(layerName), mInnerRadius(rIn), mAngularCoverage(angularCoverage), mZ(zLength), mX2X0(layerX2X0), mModuleWidth(4.54) +{ + Float_t Si_X0 = 9.5f; + mChipThickness = mX2X0 * Si_X0; + LOGP(info, "Creating layer: id: {} rInner: {} thickness: {} zLength: {} x2X0: {}", mLayerNumber, mInnerRadius, mChipThickness, mZ, mX2X0); +} + +void TRKPetalLayer::createLayer(TGeoVolume* motherVolume, TGeoCombiTrans* combiTrans) +{ + TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$"); + TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$"); + + std::string staveName = o2::trk::GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber), + chipName = o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mLayerNumber), + sensName = Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mLayerNumber); + + Double_t toDeg = 180 / TMath::Pi(); + mLayer = new TGeoTubeSeg(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + LOGP(info, "mLayerName: {}", mLayerName); + TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), mLayer, medAir); + layerVol->SetLineColor(kYellow); + + TGeoTubeSeg* stave = new TGeoTubeSeg(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + TGeoTubeSeg* chip = new TGeoTubeSeg(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + TGeoTubeSeg* sensor = new TGeoTubeSeg(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); + + TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); + sensVol->SetLineColor(kYellow); + TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi); + chipVol->SetLineColor(kYellow); + TGeoVolume* staveVol = new TGeoVolume(staveName.c_str(), stave, medSi); + staveVol->SetLineColor(kYellow); + + LOGP(info, "Inserting {} in {} ", sensVol->GetName(), chipVol->GetName()); + chipVol->AddNode(sensVol, 1, nullptr); + + LOGP(info, "Inserting {} in {} ", chipVol->GetName(), staveVol->GetName()); + staveVol->AddNode(chipVol, 1, nullptr); + + LOGP(info, "Inserting {} in {} ", staveVol->GetName(), layerVol->GetName()); + layerVol->AddNode(staveVol, 1, nullptr); + + LOGP(info, "Inserting {} in {} ", layerVol->GetName(), motherVolume->GetName()); + motherVolume->AddNode(layerVol, 1, combiTrans); +} +// ClassImp(TRKPetalLayer); + +} // namespace trk +} // namespace o2 \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index 7937e3b4de09a..393953b5e37f9 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -27,16 +27,6 @@ namespace o2 { namespace trk { -TRKServices::TRKServices(float rMin, float zLength, float thickness) -{ - mColdPlateRMin = rMin; - mColdPlateZLength = zLength; - mColdPlateThickness = thickness; - mZLengthIRISVacV = 70.; - mThicknessIRISVacV = 150.e-4; - mRInIRISVacV = 0.48; - mROutIRISVacV = mColdPlateRMin + mColdPlateThickness; -} void TRKServices::createMaterials() { @@ -63,6 +53,7 @@ void TRKServices::createMaterials() float zAir[4] = {6., 7., 8., 18.}; float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827}; float dAir = 1.20479E-3; + float dAir1 = 1.20479E-11; // vacuum denisity inside pipe // Water float aWater[2] = {1.00794, 15.9994}; @@ -115,6 +106,7 @@ void TRKServices::createMaterials() matmgr.Mixture("ALICE3_TRKSERVICES", 74, "ALUMINIUM5083", aAl5083, zAl5083, dAl5083, 9, wAl5083); // AL5083 - Candidate for IRIS vacuum vessel matmgr.Mixture("ALICE3_TRKSERVICES", 75, "ALUMINIUMBERYLLIUMMETAL", aAlBeMet, zAlBeMet, dAlBeMet, 2, wAlBeMet); // Aluminium-Beryllium metal - Candidate for IRIS vacuum vessel matmgr.Material("ALICE3_TRKSERVICES", 76, "CARBONFIBERM55J6K", 12.0107, 6, 1.92, 999, 999); // Carbon Fiber M55J + matmgr.Mixture("ALICE3_PIPE", 77, "VACUUM", aAir, zAir, dAir1, 4, wAir); matmgr.Medium("ALICE3_TRKSERVICES", 1, "CERAMIC", 66, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Ceramic for cold plate matmgr.Medium("ALICE3_TRKSERVICES", 2, "COPPER", 67, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Copper for cables @@ -127,56 +119,66 @@ void TRKServices::createMaterials() matmgr.Medium("ALICE3_TRKSERVICES", 9, "ALUMINIUM5083", 74, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Al5083 for IRIS vacuum vessel matmgr.Medium("ALICE3_TRKSERVICES", 10, "ALUMINIUMBERYLLIUMMETAL", 75, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // AlBeMet for IRIS vacuum vessel matmgr.Medium("ALICE3_TRKSERVICES", 11, "CARBONFIBERM55J6K", 76, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Carbon Fiber M55J + matmgr.Medium("ALICE3_PIPE", 12, "VACUUM", 77, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Vacuum inside the beam pipe } void TRKServices::createServices(TGeoVolume* motherVolume) { createMaterials(); - createColdplate(motherVolume); - createMiddleServices(motherVolume); - createOuterDisksServices(motherVolume); - createOuterBarrelServices(motherVolume); + createVacuumCompositeShape(); + // createMiddleServices(motherVolume); + // createOuterDisksServices(motherVolume); + // createOuterBarrelServices(motherVolume); +} + +void TRKServices::createVacuumCompositeShape() +{ + Double_t pipeRIn = 1.8f; + Double_t A3IPLength = 1000.f; + Double_t vacuumVesselRIn = 5.6f; + Double_t vacuumVesselThickness = 0.08f; + Double_t vacuumVesselLength = 76.f; + + // Vacuum for A and C Side + Double_t vacuumASideLength = A3IPLength / 2. - vacuumVesselThickness - vacuumVesselLength; + Double_t vacuumCSideLength = A3IPLength / 2. + vacuumVesselLength; + + // Vacuum tubes + TGeoTube* vacuumASide = new TGeoTube("VACUUM_Ash", 0., pipeRIn, vacuumASideLength / 2.); + TGeoTube* vacuumCSide = new TGeoTube("VACUUM_Csh", 0., vacuumVesselRIn, vacuumCSideLength / 2.); + + // Vacuum positions + TGeoTranslation* posVacuumASide = new TGeoTranslation("VACUUM_ASIDE_POSITION", 0, 0, vacuumVesselLength + vacuumVesselThickness + vacuumASideLength / 2.); + posVacuumASide->RegisterYourself(); + TGeoTranslation* posVacuumCSide = new TGeoTranslation("VACUUM_CSIDE_POSITION", 0, 0, vacuumVesselLength - vacuumCSideLength / 2.); + posVacuumCSide->RegisterYourself(); + + mVacuumCompositeFormula = + "VACUUM_Ash:VACUUM_ASIDE_POSITION" + "+VACUUM_Csh:VACUUM_CSIDE_POSITION"; } -void TRKServices::createColdplate(TGeoVolume* motherVolume) +void TRKServices::excavateFromVacuum(TString shapeToExcavate) +{ + LOGP(info, "vacuumCompositeFormula: {}", mVacuumCompositeFormula.Data()); + mVacuumCompositeFormula += "-"; + mVacuumCompositeFormula += shapeToExcavate; + LOGP(info, "vacuumCompositeFormula: {}", mVacuumCompositeFormula.Data()); +} + +void TRKServices::registerVacuum(TGeoVolume* motherVolume) { auto& matmgr = o2::base::MaterialManager::Instance(); - const TGeoMedium* medCeramic = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_CERAMIC"); - - TGeoTube* coldPlate = new TGeoTube("TRK_COLDPLATEsh", mColdPlateRMin, mColdPlateRMin + mColdPlateThickness, mColdPlateZLength / 2.); - TGeoVolume* coldPlateVolume = new TGeoVolume("TRK_COLDPLATE", coldPlate, medCeramic); - coldPlateVolume->SetVisibility(1); - coldPlateVolume->SetLineColor(kGray); - - LOGP(info, "Creating cold plate service"); - - LOGP(info, "Inserting {} in {} ", coldPlateVolume->GetName(), motherVolume->GetName()); - motherVolume->AddNode(coldPlateVolume, 1, nullptr); - - // IRIS Tracker Vacuum Vessel - TGeoTube* irisVacuumVesselInnerTube = new TGeoTube("TRK_IRISVACUUMVESSEL_INNERTUBEsh", mRInIRISVacV, mRInIRISVacV + mThicknessIRISVacV, mZLengthIRISVacV / 2.); - TGeoTube* irisVacuumVesselOuterTube = new TGeoTube("TRK_IRISVACUUMVESSEL_OUTERTUBEsh", mROutIRISVacV, mROutIRISVacV + mThicknessIRISVacV, mZLengthIRISVacV / 2.); - TGeoTube* irisVacuumVesselWall = new TGeoTube("TRK_IRISVACUUMVESSEL_WALLsh", mRInIRISVacV, mROutIRISVacV + mThicknessIRISVacV, mThicknessIRISVacV / 2.); - TGeoTranslation* irisVacVWallNegZ = new TGeoTranslation("IRISVACVWALLNEGZ", 0., 0., -mZLengthIRISVacV / 2. - mThicknessIRISVacV / 2.); - irisVacVWallNegZ->RegisterYourself(); - TGeoTranslation* irisVacVWallPosZ = new TGeoTranslation("IRISVACVWALLPOSZ", 0., 0., mZLengthIRISVacV / 2. + mThicknessIRISVacV / 2.); - irisVacVWallPosZ->RegisterYourself(); - TString irisCompositeFormula = - "TRK_IRISVACUUMVESSEL_INNERTUBEsh" - "+TRK_IRISVACUUMVESSEL_OUTERTUBEsh" - "+TRK_IRISVACUUMVESSEL_WALLsh:IRISVACVWALLNEGZ" - "+TRK_IRISVACUUMVESSEL_WALLsh:IRISVACVWALLPOSZ"; - TGeoCompositeShape* irisVacuumVesselComposite = new TGeoCompositeShape("TRK_IRISVACUUMVESSELsh", irisCompositeFormula); - - const TGeoMedium* medBe = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_BERYLLIUM"); - TGeoVolume* irisVacuumVesselVolume = new TGeoVolume("TRK_IRISVACUUMVESSEL", irisVacuumVesselComposite, medBe); - - irisVacuumVesselVolume->SetVisibility(1); - irisVacuumVesselVolume->SetLineColor(kGray); - - LOGP(info, "Creating IRIS Tracker vacuum vessel"); - LOGP(info, "Inserting {} in {} ", irisVacuumVesselVolume->GetName(), motherVolume->GetName()); - motherVolume->AddNode(irisVacuumVesselVolume, 1, nullptr); + const TGeoMedium* kMedVac = matmgr.getTGeoMedium("ALICE3_PIPE_VACUUM"); + + LOGP(info, "vacuumCompositeFormula: {}", mVacuumCompositeFormula.Data()); + + TGeoCompositeShape* vacuumComposite = new TGeoCompositeShape("A3IP_VACUUMsh", mVacuumCompositeFormula); + TGeoVolume* vacuumVolume = new TGeoVolume("A3IP_VACUUM", vacuumComposite, kMedVac); + + // Add the vacuum to the barrel + vacuumVolume->SetLineColor(kGreen - 3); + motherVolume->AddNode(vacuumVolume, 1, new TGeoTranslation(0, 0, 0)); } void TRKServices::createOuterDisksServices(TGeoVolume* motherVolume) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKSimulationLinkDef.h b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKSimulationLinkDef.h index 1b0181144b5d4..b82d8879e7dad 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKSimulationLinkDef.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKSimulationLinkDef.h @@ -15,7 +15,10 @@ #pragma link off all classes; #pragma link off all functions; +#pragma link C++ class o2::trk::TRKPetalCase + ; #pragma link C++ class o2::trk::TRKLayer + ; +#pragma link C++ class o2::trk::TRKPetalLayer + ; +#pragma link C++ class o2::trk::TRKPetalDisk + ; #pragma link C++ class o2::trk::TRKServices + ; #pragma link C++ class o2::trk::Detector + ; #pragma link C++ class o2::base::DetImpl < o2::trk::Detector> + ; diff --git a/macro/build_geometry.C b/macro/build_geometry.C index af74e7860ba3d..59133003e5849 100644 --- a/macro/build_geometry.C +++ b/macro/build_geometry.C @@ -166,7 +166,7 @@ void build_geometry(FairRunSim* run = nullptr) #ifdef ENABLE_UPGRADES // upgraded beampipe at the interaction point (IP) if (isActivated("A3IP")) { - run->AddModule(new o2::passive::Alice3Pipe("A3IP", "Alice 3 beam pipe", !isActivated("TRK"), !isActivated("FT3"), 1.8f, 0.08f, 1000.f, 5.6f, 0.08f, 76.f)); + run->AddModule(new o2::passive::Alice3Pipe("A3IP", "Alice 3 beam pipe", 1.8f, 0.08f, 1000.f, 5.6f, 0.08f, 76.f)); } // the absorber From 938d4c14e25a5d42f0dccf8caa223a87c80e71fa Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Wed, 12 Feb 2025 14:33:20 +0100 Subject: [PATCH 2/7] Fixed hits in sensitive volumes + fixed CMakeLists.txt --- .../ALICE3/TRK/simulation/CMakeLists.txt | 48 +++++++------- .../include/TRKSimulation/Detector.h | 3 + .../include/TRKSimulation/TRKPetalDisk.h | 2 + .../include/TRKSimulation/TRKPetalLayer.h | 4 +- .../ALICE3/TRK/simulation/src/Detector.cxx | 65 ++++++++++++------- .../TRK/simulation/src/TRKPetalCase.cxx | 2 - .../TRK/simulation/src/TRKPetalDisk.cxx | 6 +- .../TRK/simulation/src/TRKPetalLayer.cxx | 9 +-- .../ALICE3/TRK/simulation/src/TRKServices.cxx | 4 -- 9 files changed, 79 insertions(+), 64 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt b/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt index 1abe3ae367870..c21b7b9aebbf6 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt @@ -1,31 +1,29 @@ -#Copyright 2019 - 2020 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. +# Copyright 2019-2020 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. # -#This software is distributed under the terms of the GNU General Public -#License v3(GPL Version 3), copied verbatim in the file "COPYING". +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". # -#In applying this license CERN does not waive the privileges and immunities -#granted to it by virtue of its status as an Intergovernmental Organization +# 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. o2_add_library(TRKSimulation - SOURCES src / - TRKLayer.cxx - src / - TRKPetalCase.cxx - src / - TRKPetalLayer.cxx - src / - TRKPetalDisk.cxx - src / - Detector.cxx - src / - TRKServices.cxx - PUBLIC_LINK_LIBRARIES O2::TRKBase - O2::FT3Simulation - O2::ITSMFTSimulation) + SOURCES src/TRKLayer.cxx + src/Detector.cxx + src/TRKServices.cxx + src/TRKPetalCase.cxx + src/TRKPetalLayer.cxx + src/TRKPetalDisk.cxx + PUBLIC_LINK_LIBRARIES O2::TRKBase + O2::FT3Simulation + O2::ITSMFTSimulation) - o2_target_root_dictionary(TRKSimulation - HEADERS include / - TRKSimulation / Detector.h include / TRKSimulation / TRKLayer.h include / TRKSimulation / TRKServices.h include / TRKSimulation / TRKPetalCase.h include / TRKSimulation / TRKPetalLayer.h include / TRKSimulation / TRKPetalDisk.h) \ No newline at end of file +o2_target_root_dictionary(TRKSimulation + HEADERS include/TRKSimulation/Detector.h + include/TRKSimulation/TRKLayer.h + include/TRKSimulation/TRKServices.h + include/TRKSimulation/TRKPetalCase.h + include/TRKSimulation/TRKPetalLayer.h + include/TRKSimulation/TRKPetalDisk.h) \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h index aa853b483a867..31f3da7a00bb4 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h @@ -91,6 +91,9 @@ class Detector : public o2::base::DetImpl TRKServices mServices; // Houses the services of the TRK, but not the Iris tracker std::vector mPetalCases; // Houses the Iris tracker and its services. Created fully in the beam pipe + std::vector mFirstOrLastLayers; // Names of the first or last layers + bool InsideFirstOrLastLayer(std::string layerName); + void defineSensitiveVolumes(); template diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h index 0b01e6d393aaf..687c78bdf9d27 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h @@ -39,6 +39,7 @@ class TRKPetalDisk auto getZ() const { return mZ; } auto getx2X0() const { return mx2X0; } auto getName() const { return mDiskName; } + auto getSensorName() const { return mSensorName; } /// Creates the actual Disk and places inside its mother volume /// \param motherVolume the TGeoVolume owing the volume structure @@ -47,6 +48,7 @@ class TRKPetalDisk private: Int_t mDiskNumber = -1; ///< Current disk number std::string mDiskName; ///< Current disk name + std::string mSensorName; Double_t mInnerRadius; ///< Inner radius of this disk Double_t mOuterRadius; ///< Outer radius of this disk Double_t mAngularCoverage; diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h index 85956f34191eb..4e7a7735d51f0 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalLayer.h @@ -36,14 +36,14 @@ class TRKPetalLayer auto getChipThickness() const { return mChipThickness; } auto getNumber() const { return mLayerNumber; } auto getName() const { return mLayerName; } - - auto getShapeName() const { return mLayer->GetName(); } + auto getSensorName() const { return mSensorName; } void createLayer(TGeoVolume* motherVolume, TGeoCombiTrans* combiTrans); private: Int_t mLayerNumber; std::string mLayerName; + std::string mSensorName; Float_t mInnerRadius; Float_t mZ; Float_t mX2X0; diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx index 32c8c8afb381d..2eb63878fdf49 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx @@ -83,14 +83,14 @@ void Detector::configDefault() // mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 0.5f, 50.f, 100.e-4); // mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); // mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); - mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 3.78f, 124.f, 100.e-3); - mLayers.emplace_back(4, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(4)}, 7.f, 124.f, 100.e-3); - mLayers.emplace_back(5, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(5)}, 12.f, 124.f, 100.e-3); - mLayers.emplace_back(6, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(6)}, 20.f, 124.f, 100.e-3); - mLayers.emplace_back(7, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(7)}, 30.f, 124.f, 100.e-3); - mLayers.emplace_back(8, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(8)}, 45.f, 258.f, 100.e-3); - mLayers.emplace_back(9, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(9)}, 60.f, 258.f, 100.e-3); - mLayers.emplace_back(10, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(10)}, 80.f, 258.f, 100.e-3); + mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 3.78f, 124.f, 100.e-3); + mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 7.f, 124.f, 100.e-3); + mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 12.f, 124.f, 100.e-3); + mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 20.f, 124.f, 100.e-3); + mLayers.emplace_back(4, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(4)}, 30.f, 124.f, 100.e-3); + mLayers.emplace_back(5, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(5)}, 45.f, 258.f, 100.e-3); + mLayers.emplace_back(6, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(6)}, 60.f, 258.f, 100.e-3); + mLayers.emplace_back(7, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(7)}, 80.f, 258.f, 100.e-3); } void Detector::buildTRKNewVacuumVessel() @@ -106,28 +106,29 @@ void Detector::buildTRKNewVacuumVessel() // mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 0.5f, 50.f, 100.e-4); // mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); // mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); - mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 7.f, 124.f, 100.e-3); - mLayers.emplace_back(4, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(4)}, 9.f, 124.f, 100.e-3); - mLayers.emplace_back(5, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(5)}, 12.f, 124.f, 100.e-3); - mLayers.emplace_back(6, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(6)}, 20.f, 124.f, 100.e-3); - mLayers.emplace_back(7, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(7)}, 30.f, 124.f, 100.e-3); - mLayers.emplace_back(8, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(8)}, 45.f, 258.f, 100.e-3); - mLayers.emplace_back(9, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(9)}, 60.f, 258.f, 100.e-3); - mLayers.emplace_back(10, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(10)}, 80.f, 258.f, 100.e-3); + mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 7.f, 124.f, 100.e-3); + LOGP(info, "TRKLayer created. Name: {}", std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}); + mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 9.f, 124.f, 100.e-3); + mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 12.f, 124.f, 100.e-3); + mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 20.f, 124.f, 100.e-3); + mLayers.emplace_back(4, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(4)}, 30.f, 124.f, 100.e-3); + mLayers.emplace_back(5, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(5)}, 45.f, 258.f, 100.e-3); + mLayers.emplace_back(6, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(6)}, 60.f, 258.f, 100.e-3); + mLayers.emplace_back(7, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(7)}, 80.f, 258.f, 100.e-3); auto& trkPars = TRKBaseParam::Instance(); // Middle layers + mLayers[0].setLayout(trkPars.layoutML); + mLayers[1].setLayout(trkPars.layoutML); + mLayers[2].setLayout(trkPars.layoutML); mLayers[3].setLayout(trkPars.layoutML); - mLayers[4].setLayout(trkPars.layoutML); - mLayers[5].setLayout(trkPars.layoutML); - mLayers[6].setLayout(trkPars.layoutML); // Outer tracker + mLayers[4].setLayout(trkPars.layoutOL); + mLayers[5].setLayout(trkPars.layoutOL); + mLayers[6].setLayout(trkPars.layoutOL); mLayers[7].setLayout(trkPars.layoutOL); - mLayers[8].setLayout(trkPars.layoutOL); - mLayers[9].setLayout(trkPars.layoutOL); - mLayers[10].setLayout(trkPars.layoutOL); } void Detector::configFromFile(std::string fileName) @@ -266,7 +267,8 @@ void Detector::defineSensitiveVolumes() for (int petalCase = 0; petalCase < 4; ++petalCase) { // Petal layers for (int petalLayer = 0; petalLayer < mPetalCases[petalCase].mPetalLayers.size(); ++petalLayer) { - volumeName = mPetalCases[petalCase].mPetalLayers[petalLayer].getName(); + volumeName = mPetalCases[petalCase].mPetalLayers[petalLayer].getSensorName(); + if(petalLayer == 0){mFirstOrLastLayers.push_back(volumeName.Data());} LOGP(info, "Trying {}", volumeName.Data()); v = geoManager->GetVolume(volumeName.Data()); LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); @@ -274,7 +276,7 @@ void Detector::defineSensitiveVolumes() } // Petal disks for (int petalDisk = 0; petalDisk < mPetalCases[petalCase].mPetalDisks.size(); ++petalDisk) { - volumeName = mPetalCases[petalCase].mPetalDisks[petalDisk].getName(); + volumeName = mPetalCases[petalCase].mPetalDisks[petalDisk].getSensorName(); LOGP(info, "Trying {}", volumeName.Data()); v = geoManager->GetVolume(volumeName.Data()); LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); @@ -285,6 +287,7 @@ void Detector::defineSensitiveVolumes() // The names of the TRK sensitive volumes have the format: TRKLayer(0...mLayers.size()-1) for (int j{0}; j < mLayers.size(); j++) { volumeName = GeometryTGeo::getTRKSensorPattern() + TString::Itoa(j, 10); + if(j == mLayers.size() - 1){mFirstOrLastLayers.push_back(volumeName.Data());} LOGP(info, "Trying {}", volumeName.Data()); v = geoManager->GetVolume(volumeName.Data()); LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); @@ -312,6 +315,17 @@ void Detector::Reset() } } +bool Detector::InsideFirstOrLastLayer(std::string layerName){ + bool inside = false; + for(auto &firstOrLastLayer: mFirstOrLastLayers){ + if(firstOrLastLayer == layerName){ + inside = true; + break; + } + } + return inside; +} + bool Detector::ProcessHits(FairVolume* vol) { // This method is called from the MC stepping @@ -324,7 +338,8 @@ bool Detector::ProcessHits(FairVolume* vol) // Is it needed to keep a track reference when the outer ITS volume is encountered? auto stack = (o2::data::Stack*)fMC->GetStack(); - if (fMC->IsTrackExiting() && (lay == 0 || lay == mLayers.size() - 1)) { + // if (fMC->IsTrackExiting() && (lay == 0 || lay == mLayers.size() - 1)) { + if (fMC->IsTrackExiting() && InsideFirstOrLastLayer(vol->GetName())) { // Keep the track refs for the innermost and outermost layers only o2::TrackReference tr(*fMC, GetDetId()); tr.setTrackID(stack->GetCurrentTrackNumber()); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx index 1a9765158f558..c729d7d1ec4dd 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalCase.cxx @@ -165,7 +165,6 @@ void TRKPetalCase::constructDetectionPetals(TGeoVolume* motherVolume) void TRKPetalCase::addDetectionPetelsToFullComposite() { - LOGP(info, "Excavating layers from vacuum"); for (Int_t i = 0; i < mPetalLayers.size(); ++i) { Double_t zLength = mPetalLayers[i].getZLength(); Double_t rIn = mPetalLayers[i].getInnerRadius(); @@ -179,7 +178,6 @@ void TRKPetalCase::addDetectionPetelsToFullComposite() addToPetalCaseComposite(layerForExcavationCompositeFormula); } - LOGP(info, "Excavating disks vacuum"); for (Int_t i = 0; i < mPetalDisks.size(); ++i) { Double_t zPos = mPetalDisks[i].getZ(); Double_t rIn = mPetalDisks[i].getInnerRadius(); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx index 5df3a3cb0aa4d..284e129ea7313 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx @@ -55,8 +55,10 @@ void TRKPetalDisk::createDisk(TGeoVolume* motherVolume, TGeoCombiTrans* combiTra { // Create tube, set sensitive volume, add to mother volume Double_t toDeg = 180 / TMath::Pi(); - std::string chipName = o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mDiskNumber), - sensName = Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mDiskNumber); + std::string chipName = mDiskName + "_" + o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mDiskNumber), + sensName = mDiskName + "_" + Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mDiskNumber); + + mSensorName = sensName; TGeoTubeSeg* sensor = new TGeoTubeSeg(mInnerRadius, mOuterRadius, mChipThickness / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); TGeoTubeSeg* chip = new TGeoTubeSeg(mInnerRadius, mOuterRadius, mChipThickness / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx index 2b21ecdc7ccf6..4511c91a2b791 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx @@ -39,13 +39,14 @@ void TRKPetalLayer::createLayer(TGeoVolume* motherVolume, TGeoCombiTrans* combiT TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$"); - std::string staveName = o2::trk::GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber), - chipName = o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mLayerNumber), - sensName = Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mLayerNumber); + std::string staveName = mLayerName + "_" + o2::trk::GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber), + chipName = mLayerName + "_" + o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mLayerNumber), + sensName = mLayerName + "_" + Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mLayerNumber); + + mSensorName = sensName; Double_t toDeg = 180 / TMath::Pi(); mLayer = new TGeoTubeSeg(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); - LOGP(info, "mLayerName: {}", mLayerName); TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), mLayer, medAir); layerVol->SetLineColor(kYellow); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index 393953b5e37f9..42640b86433b1 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -160,10 +160,8 @@ void TRKServices::createVacuumCompositeShape() void TRKServices::excavateFromVacuum(TString shapeToExcavate) { - LOGP(info, "vacuumCompositeFormula: {}", mVacuumCompositeFormula.Data()); mVacuumCompositeFormula += "-"; mVacuumCompositeFormula += shapeToExcavate; - LOGP(info, "vacuumCompositeFormula: {}", mVacuumCompositeFormula.Data()); } void TRKServices::registerVacuum(TGeoVolume* motherVolume) @@ -171,8 +169,6 @@ void TRKServices::registerVacuum(TGeoVolume* motherVolume) auto& matmgr = o2::base::MaterialManager::Instance(); const TGeoMedium* kMedVac = matmgr.getTGeoMedium("ALICE3_PIPE_VACUUM"); - LOGP(info, "vacuumCompositeFormula: {}", mVacuumCompositeFormula.Data()); - TGeoCompositeShape* vacuumComposite = new TGeoCompositeShape("A3IP_VACUUMsh", mVacuumCompositeFormula); TGeoVolume* vacuumVolume = new TGeoVolume("A3IP_VACUUM", vacuumComposite, kMedVac); From fcf17c97b2804adbbcb79085794a7435ac842c0e Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Wed, 12 Feb 2025 14:45:44 +0100 Subject: [PATCH 3/7] Applied clang --- .../include/TRKSimulation/TRKPetalDisk.h | 4 ++-- .../ALICE3/TRK/simulation/src/Detector.cxx | 17 +++++++++++------ .../ALICE3/TRK/simulation/src/TRKPetalDisk.cxx | 2 +- .../ALICE3/TRK/simulation/src/TRKPetalLayer.cxx | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h index 687c78bdf9d27..465f52eb8d41b 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKPetalDisk.h @@ -49,8 +49,8 @@ class TRKPetalDisk Int_t mDiskNumber = -1; ///< Current disk number std::string mDiskName; ///< Current disk name std::string mSensorName; - Double_t mInnerRadius; ///< Inner radius of this disk - Double_t mOuterRadius; ///< Outer radius of this disk + Double_t mInnerRadius; ///< Inner radius of this disk + Double_t mOuterRadius; ///< Outer radius of this disk Double_t mAngularCoverage; Double_t mZ; ///< Z position of the disk Double_t mChipThickness; ///< Chip thickness diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx index 2eb63878fdf49..9b8ffc07b2d0e 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx @@ -107,7 +107,7 @@ void Detector::buildTRKNewVacuumVessel() // mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 1.2f, 50.f, 100.e-4); // mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 2.5f, 50.f, 100.e-4); mLayers.emplace_back(0, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}, 7.f, 124.f, 100.e-3); - LOGP(info, "TRKLayer created. Name: {}", std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}); + LOGP(info, "TRKLayer created. Name: {}", std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(0)}); mLayers.emplace_back(1, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(1)}, 9.f, 124.f, 100.e-3); mLayers.emplace_back(2, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(2)}, 12.f, 124.f, 100.e-3); mLayers.emplace_back(3, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(3)}, 20.f, 124.f, 100.e-3); @@ -268,7 +268,9 @@ void Detector::defineSensitiveVolumes() // Petal layers for (int petalLayer = 0; petalLayer < mPetalCases[petalCase].mPetalLayers.size(); ++petalLayer) { volumeName = mPetalCases[petalCase].mPetalLayers[petalLayer].getSensorName(); - if(petalLayer == 0){mFirstOrLastLayers.push_back(volumeName.Data());} + if (petalLayer == 0) { + mFirstOrLastLayers.push_back(volumeName.Data()); + } LOGP(info, "Trying {}", volumeName.Data()); v = geoManager->GetVolume(volumeName.Data()); LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); @@ -287,7 +289,9 @@ void Detector::defineSensitiveVolumes() // The names of the TRK sensitive volumes have the format: TRKLayer(0...mLayers.size()-1) for (int j{0}; j < mLayers.size(); j++) { volumeName = GeometryTGeo::getTRKSensorPattern() + TString::Itoa(j, 10); - if(j == mLayers.size() - 1){mFirstOrLastLayers.push_back(volumeName.Data());} + if (j == mLayers.size() - 1) { + mFirstOrLastLayers.push_back(volumeName.Data()); + } LOGP(info, "Trying {}", volumeName.Data()); v = geoManager->GetVolume(volumeName.Data()); LOGP(info, "Adding TRK Sensitive Volume {}", v->GetName()); @@ -315,10 +319,11 @@ void Detector::Reset() } } -bool Detector::InsideFirstOrLastLayer(std::string layerName){ +bool Detector::InsideFirstOrLastLayer(std::string layerName) +{ bool inside = false; - for(auto &firstOrLastLayer: mFirstOrLastLayers){ - if(firstOrLastLayer == layerName){ + for (auto& firstOrLastLayer : mFirstOrLastLayers) { + if (firstOrLastLayer == layerName) { inside = true; break; } diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx index 284e129ea7313..e24b24b48c882 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalDisk.cxx @@ -57,7 +57,7 @@ void TRKPetalDisk::createDisk(TGeoVolume* motherVolume, TGeoCombiTrans* combiTra Double_t toDeg = 180 / TMath::Pi(); std::string chipName = mDiskName + "_" + o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mDiskNumber), sensName = mDiskName + "_" + Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mDiskNumber); - + mSensorName = sensName; TGeoTubeSeg* sensor = new TGeoTubeSeg(mInnerRadius, mOuterRadius, mChipThickness / 2., -0.5 * mAngularCoverage * toDeg, 0.5 * mAngularCoverage * toDeg); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx index 4511c91a2b791..c8ff0d957bb19 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKPetalLayer.cxx @@ -42,7 +42,7 @@ void TRKPetalLayer::createLayer(TGeoVolume* motherVolume, TGeoCombiTrans* combiT std::string staveName = mLayerName + "_" + o2::trk::GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber), chipName = mLayerName + "_" + o2::trk::GeometryTGeo::getTRKChipPattern() + std::to_string(mLayerNumber), sensName = mLayerName + "_" + Form("%s%d", GeometryTGeo::getTRKSensorPattern(), mLayerNumber); - + mSensorName = sensName; Double_t toDeg = 180 / TMath::Pi(); From a9b5d1bf4790e6e77d82be1d294cc437abe29052 Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Mon, 24 Feb 2025 18:00:35 +0100 Subject: [PATCH 4/7] Uncommented services --- .../Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index 42640b86433b1..c8904b9182d0f 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -126,9 +126,9 @@ void TRKServices::createServices(TGeoVolume* motherVolume) { createMaterials(); createVacuumCompositeShape(); - // createMiddleServices(motherVolume); - // createOuterDisksServices(motherVolume); - // createOuterBarrelServices(motherVolume); + createMiddleServices(motherVolume); + createOuterDisksServices(motherVolume); + createOuterBarrelServices(motherVolume); } void TRKServices::createVacuumCompositeShape() From bfa50c6b9271330de9f8d47f007877c235e0efba Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Mon, 24 Feb 2025 18:42:00 +0100 Subject: [PATCH 5/7] Final bug fix --- Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index c8904b9182d0f..9cc9c4c12c623 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -457,7 +457,7 @@ void TRKServices::createOuterBarrelServices(TGeoVolume* motherVolume) // Fiber 0.269 cm const float siO2FiberThick = 0.5 * 0.269; const float peFiberThick = 0.5 * 0.269; - float rMinOuterBarrelServices = ((TGeoTube*)motherVolume->GetNode(Form("%s10_1", GeometryTGeo::getTRKLayerPattern()))->GetVolume()->GetShape())->GetRmax(); + float rMinOuterBarrelServices = ((TGeoTube*)motherVolume->GetNode(Form("%s7_1", GeometryTGeo::getTRKLayerPattern()))->GetVolume()->GetShape())->GetRmax(); const float zLengthOuterBarrelServices = 350.f; // 175cm TGeoTube* outerBarrelFiberSIO2 = new TGeoTube("TRK_OUTERBARREL_FIBER_SIO2sh", rMinOuterBarrelServices, rMinOuterBarrelServices + siO2FiberThick, zLengthOuterBarrelServices); From 7b7e07d103d4237095cbb4e6e76be335106c758e Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Mon, 24 Feb 2025 19:40:02 +0100 Subject: [PATCH 6/7] Fixed placement of the beam pipe from earlier PR --- Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx | 10 +++++----- .../Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx index 4ba73a59ceffa..7aefd46fd93e4 100644 --- a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx +++ b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx @@ -94,8 +94,8 @@ void Alice3Pipe::ConstructGeometry() // - pipe C Side (which hosts the primary vacuum vessel and covers all C Side as well) // A3IP update - Double_t pipeASideLength = mA3IPLength / 2. - mVacuumVesselThick - mVacuumVesselASideLength; - Double_t pipeCSideLength = mA3IPLength / 2. + mVacuumVesselASideLength; + Double_t pipeASideLength = mA3IPLength / 2. - mVacuumVesselThick - mVacuumVesselASideLength/2.; + Double_t pipeCSideLength = mA3IPLength / 2. + mVacuumVesselASideLength/2.; // Pipe tubes TGeoTube* pipeASide = new TGeoTube("PIPE_Ash", mPipeRIn, mPipeRIn + mPipeThick, pipeASideLength / 2.); @@ -103,11 +103,11 @@ void Alice3Pipe::ConstructGeometry() TGeoTube* vacuumVesselWall = new TGeoTube("VACUUM_VESSEL_WALLsh", mPipeRIn, mVacuumVesselRIn + mVacuumVesselThick, mVacuumVesselThick / 2.); // Pipe and vacuum vessel positions - TGeoTranslation* posPipeASide = new TGeoTranslation("PIPE_ASIDE_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick + pipeASideLength / 2.); + TGeoTranslation* posPipeASide = new TGeoTranslation("PIPE_ASIDE_POSITION", 0, 0, mVacuumVesselASideLength/2. + mVacuumVesselThick + pipeASideLength / 2.); posPipeASide->RegisterYourself(); - TGeoTranslation* posPipeCSide = new TGeoTranslation("PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength - pipeCSideLength / 2.); + TGeoTranslation* posPipeCSide = new TGeoTranslation("PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength/2. - pipeCSideLength / 2.); posPipeCSide->RegisterYourself(); - TGeoTranslation* posVacuumVesselWall = new TGeoTranslation("WALL_POSITION", 0, 0, mVacuumVesselASideLength + mVacuumVesselThick / 2.); + TGeoTranslation* posVacuumVesselWall = new TGeoTranslation("WALL_POSITION", 0, 0, mVacuumVesselASideLength/2. + mVacuumVesselThick / 2.); posVacuumVesselWall->RegisterYourself(); // Pipe composite shape and volume diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index 9cc9c4c12c623..f565f0e6efbc4 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -140,17 +140,17 @@ void TRKServices::createVacuumCompositeShape() Double_t vacuumVesselLength = 76.f; // Vacuum for A and C Side - Double_t vacuumASideLength = A3IPLength / 2. - vacuumVesselThickness - vacuumVesselLength; - Double_t vacuumCSideLength = A3IPLength / 2. + vacuumVesselLength; + Double_t vacuumASideLength = A3IPLength / 2. - vacuumVesselThickness - vacuumVesselLength/2.; + Double_t vacuumCSideLength = A3IPLength / 2. + vacuumVesselLength/2.; // Vacuum tubes TGeoTube* vacuumASide = new TGeoTube("VACUUM_Ash", 0., pipeRIn, vacuumASideLength / 2.); TGeoTube* vacuumCSide = new TGeoTube("VACUUM_Csh", 0., vacuumVesselRIn, vacuumCSideLength / 2.); // Vacuum positions - TGeoTranslation* posVacuumASide = new TGeoTranslation("VACUUM_ASIDE_POSITION", 0, 0, vacuumVesselLength + vacuumVesselThickness + vacuumASideLength / 2.); + TGeoTranslation* posVacuumASide = new TGeoTranslation("VACUUM_ASIDE_POSITION", 0, 0, vacuumVesselLength/2. + vacuumVesselThickness + vacuumASideLength / 2.); posVacuumASide->RegisterYourself(); - TGeoTranslation* posVacuumCSide = new TGeoTranslation("VACUUM_CSIDE_POSITION", 0, 0, vacuumVesselLength - vacuumCSideLength / 2.); + TGeoTranslation* posVacuumCSide = new TGeoTranslation("VACUUM_CSIDE_POSITION", 0, 0, vacuumVesselLength/2. - vacuumCSideLength / 2.); posVacuumCSide->RegisterYourself(); mVacuumCompositeFormula = From 5ff8c90cc52994fbb145c975a9ccf5d62b5fcb46 Mon Sep 17 00:00:00 2001 From: Casper van Veen Date: Mon, 24 Feb 2025 19:50:21 +0100 Subject: [PATCH 7/7] Applied clang --- Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx | 10 +++++----- .../Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx index 7aefd46fd93e4..7dfd26a79b38d 100644 --- a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx +++ b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx @@ -94,8 +94,8 @@ void Alice3Pipe::ConstructGeometry() // - pipe C Side (which hosts the primary vacuum vessel and covers all C Side as well) // A3IP update - Double_t pipeASideLength = mA3IPLength / 2. - mVacuumVesselThick - mVacuumVesselASideLength/2.; - Double_t pipeCSideLength = mA3IPLength / 2. + mVacuumVesselASideLength/2.; + Double_t pipeASideLength = mA3IPLength / 2. - mVacuumVesselThick - mVacuumVesselASideLength / 2.; + Double_t pipeCSideLength = mA3IPLength / 2. + mVacuumVesselASideLength / 2.; // Pipe tubes TGeoTube* pipeASide = new TGeoTube("PIPE_Ash", mPipeRIn, mPipeRIn + mPipeThick, pipeASideLength / 2.); @@ -103,11 +103,11 @@ void Alice3Pipe::ConstructGeometry() TGeoTube* vacuumVesselWall = new TGeoTube("VACUUM_VESSEL_WALLsh", mPipeRIn, mVacuumVesselRIn + mVacuumVesselThick, mVacuumVesselThick / 2.); // Pipe and vacuum vessel positions - TGeoTranslation* posPipeASide = new TGeoTranslation("PIPE_ASIDE_POSITION", 0, 0, mVacuumVesselASideLength/2. + mVacuumVesselThick + pipeASideLength / 2.); + TGeoTranslation* posPipeASide = new TGeoTranslation("PIPE_ASIDE_POSITION", 0, 0, mVacuumVesselASideLength / 2. + mVacuumVesselThick + pipeASideLength / 2.); posPipeASide->RegisterYourself(); - TGeoTranslation* posPipeCSide = new TGeoTranslation("PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength/2. - pipeCSideLength / 2.); + TGeoTranslation* posPipeCSide = new TGeoTranslation("PIPE_CSIDE_POSITION", 0, 0, mVacuumVesselASideLength / 2. - pipeCSideLength / 2.); posPipeCSide->RegisterYourself(); - TGeoTranslation* posVacuumVesselWall = new TGeoTranslation("WALL_POSITION", 0, 0, mVacuumVesselASideLength/2. + mVacuumVesselThick / 2.); + TGeoTranslation* posVacuumVesselWall = new TGeoTranslation("WALL_POSITION", 0, 0, mVacuumVesselASideLength / 2. + mVacuumVesselThick / 2.); posVacuumVesselWall->RegisterYourself(); // Pipe composite shape and volume diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index f565f0e6efbc4..1fb966425f974 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -140,17 +140,17 @@ void TRKServices::createVacuumCompositeShape() Double_t vacuumVesselLength = 76.f; // Vacuum for A and C Side - Double_t vacuumASideLength = A3IPLength / 2. - vacuumVesselThickness - vacuumVesselLength/2.; - Double_t vacuumCSideLength = A3IPLength / 2. + vacuumVesselLength/2.; + Double_t vacuumASideLength = A3IPLength / 2. - vacuumVesselThickness - vacuumVesselLength / 2.; + Double_t vacuumCSideLength = A3IPLength / 2. + vacuumVesselLength / 2.; // Vacuum tubes TGeoTube* vacuumASide = new TGeoTube("VACUUM_Ash", 0., pipeRIn, vacuumASideLength / 2.); TGeoTube* vacuumCSide = new TGeoTube("VACUUM_Csh", 0., vacuumVesselRIn, vacuumCSideLength / 2.); // Vacuum positions - TGeoTranslation* posVacuumASide = new TGeoTranslation("VACUUM_ASIDE_POSITION", 0, 0, vacuumVesselLength/2. + vacuumVesselThickness + vacuumASideLength / 2.); + TGeoTranslation* posVacuumASide = new TGeoTranslation("VACUUM_ASIDE_POSITION", 0, 0, vacuumVesselLength / 2. + vacuumVesselThickness + vacuumASideLength / 2.); posVacuumASide->RegisterYourself(); - TGeoTranslation* posVacuumCSide = new TGeoTranslation("VACUUM_CSIDE_POSITION", 0, 0, vacuumVesselLength/2. - vacuumCSideLength / 2.); + TGeoTranslation* posVacuumCSide = new TGeoTranslation("VACUUM_CSIDE_POSITION", 0, 0, vacuumVesselLength / 2. - vacuumCSideLength / 2.); posVacuumCSide->RegisterYourself(); mVacuumCompositeFormula =