From 10a9a754167a1baeb821dcc2fc7045140018e262 Mon Sep 17 00:00:00 2001 From: Matteo Concas Date: Thu, 8 Feb 2024 09:11:30 +0100 Subject: [PATCH] ALICE3: Add TRK services (#12367) * Add TRK services * Add xX0 scan macro * Please consider the following formatting changes (#70) * Homogenize material naming * Add scan over all materials * Add polyurthane and polyethilene * Start synchronisation with Corrado's work * Finalise three structures for services --------- Co-authored-by: ALICE Builder --- Detectors/Upgrades/ALICE3/CMakeLists.txt | 3 +- .../ALICE3/FCT/simulation/src/Detector.cxx | 8 +- .../ALICE3/FCT/simulation/src/FCTLayer.cxx | 4 +- .../include/FT3Simulation/Detector.h | 1 + .../ALICE3/FT3/simulation/src/Detector.cxx | 134 ++++-- .../ALICE3/FT3/simulation/src/FT3Layer.cxx | 8 +- .../ALICE3/IOTOF/simulation/src/Detector.cxx | 4 +- .../ALICE3/IOTOF/simulation/src/Layer.cxx | 8 +- .../Upgrades/ALICE3/Passive/src/Absorber.cxx | 42 +- .../Upgrades/ALICE3/Passive/src/Magnet.cxx | 20 +- .../Upgrades/ALICE3/Passive/src/Pipe.cxx | 25 +- .../ALICE3/RICH/simulation/src/Detector.cxx | 4 +- .../ALICE3/RICH/simulation/src/RICHRing.cxx | 2 +- .../ALICE3/TRK/simulation/CMakeLists.txt | 1 + .../include/TRKSimulation/TRKServices.h | 45 +- .../ALICE3/TRK/simulation/src/Detector.cxx | 10 +- .../ALICE3/TRK/simulation/src/TRKLayer.cxx | 2 +- .../ALICE3/TRK/simulation/src/TRKServices.cxx | 350 +++++++++++++++- .../Upgrades/ALICE3/macros/CMakeLists.txt | 13 + Detectors/Upgrades/ALICE3/macros/scanXX0.C | 395 ++++++++++++++++++ 20 files changed, 953 insertions(+), 126 deletions(-) create mode 100644 Detectors/Upgrades/ALICE3/macros/CMakeLists.txt create mode 100644 Detectors/Upgrades/ALICE3/macros/scanXX0.C diff --git a/Detectors/Upgrades/ALICE3/CMakeLists.txt b/Detectors/Upgrades/ALICE3/CMakeLists.txt index c8cd09d5c1b1a..8330005c3b2e7 100644 --- a/Detectors/Upgrades/ALICE3/CMakeLists.txt +++ b/Detectors/Upgrades/ALICE3/CMakeLists.txt @@ -15,4 +15,5 @@ add_subdirectory(FT3) add_subdirectory(FCT) add_subdirectory(AOD) add_subdirectory(IOTOF) -add_subdirectory(RICH) \ No newline at end of file +add_subdirectory(RICH) +add_subdirectory(macros) \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/FCT/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FCT/simulation/src/Detector.cxx index d227e9f58d4c5..f5d5255be1c0c 100644 --- a/Detectors/Upgrades/ALICE3/FCT/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FCT/simulation/src/Detector.cxx @@ -434,12 +434,12 @@ void Detector::createMaterials() o2::base::Detector::Medium(1, "AIR$", 1, 0, ifield, fieldm, tmaxfdAir, stemaxAir, deemaxAir, epsilAir, stminAir); // Add Silicon - o2::base::Detector::Material(3, "SI$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); - o2::base::Detector::Medium(3, "SI$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); + o2::base::Detector::Material(3, "SILICON$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); + o2::base::Detector::Medium(3, "SILICON$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); // Add Lead (copied from EMCAL) - o2::base::Detector::Material(2, "Pb$", 207.2, 82, 11.35, 0.56, 0.); - o2::base::Detector::Medium(2, "Pb$", 2, 0, ifield, fieldm, tmaxfdPb, stemaxPb, deemaxPb, epsilPb, stminPb); + o2::base::Detector::Material(2, "LEAD$", 207.2, 82, 11.35, 0.56, 18.5); + o2::base::Detector::Medium(2, "LEAD$", 2, 0, ifield, fieldm, tmaxfdPb, stemaxPb, deemaxPb, epsilPb, stminPb); } //_________________________________________________________________________________________________ diff --git a/Detectors/Upgrades/ALICE3/FCT/simulation/src/FCTLayer.cxx b/Detectors/Upgrades/ALICE3/FCT/simulation/src/FCTLayer.cxx index 9448d353b4ec9..a0d1896c42266 100644 --- a/Detectors/Upgrades/ALICE3/FCT/simulation/src/FCTLayer.cxx +++ b/Detectors/Upgrades/ALICE3/FCT/simulation/src/FCTLayer.cxx @@ -95,7 +95,7 @@ void FCTLayer::createDiskLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("FCT_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("FCT_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("FCT_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); @@ -175,7 +175,7 @@ void FCTLayer::createConverterLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2); - TGeoMedium* medPb = gGeoManager->GetMedium("FCT_Pb$"); + TGeoMedium* medPb = gGeoManager->GetMedium("FCT_LEAD$"); TGeoMedium* medAir = gGeoManager->GetMedium("FCT_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medPb); diff --git a/Detectors/Upgrades/ALICE3/FT3/simulation/include/FT3Simulation/Detector.h b/Detectors/Upgrades/ALICE3/FT3/simulation/include/FT3Simulation/Detector.h index 1fbcd02272d30..ec735a66f4390 100644 --- a/Detectors/Upgrades/ALICE3/FT3/simulation/include/FT3Simulation/Detector.h +++ b/Detectors/Upgrades/ALICE3/FT3/simulation/include/FT3Simulation/Detector.h @@ -114,6 +114,7 @@ class Detector : public o2::base::DetImpl void buildBasicFT3(const FT3BaseParam& param); void buildFT3V1(); void buildFT3V3b(); + void buildFT3Scoping(); void buildFT3FromFile(std::string); GeometryTGeo* mGeometryTGeo; //! access to geometry details diff --git a/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx index 7c1691a9b0124..888be687b9f0f 100644 --- a/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx @@ -65,7 +65,7 @@ void Detector::buildFT3FromFile(std::string configFileName) // This simple file reader is not failproof. Do not add empty lines! /* - # Sample MFT configuration + # Sample FT3 configuration # z_layer r_in r_out Layerx2X0 -45.3 2.5 9.26 0.0042 -46.7 2.5 9.26 0.0042 @@ -160,15 +160,15 @@ void Detector::buildBasicFT3(const FT3BaseParam& param) mLayerID.clear(); mLayers.resize(2); - for (Int_t direction : {0, 1}) { - for (Int_t layerNumber = 0; layerNumber < mNumberOfLayers; layerNumber++) { + for (int direction : {0, 1}) { + for (int layerNumber = 0; layerNumber < mNumberOfLayers; layerNumber++) { std::string layerName = GeometryTGeo::getFT3LayerPattern() + std::to_string(layerNumber + mNumberOfLayers * direction); mLayerName[direction][layerNumber] = layerName; // Adds evenly spaced layers - Float_t layerZ = z_first + (layerNumber * z_length / (mNumberOfLayers - 1)) * std::copysign(1, z_first); - Float_t rIn = std::abs(layerZ * std::tan(2.f * std::atan(std::exp(-etaIn)))); - Float_t rOut = std::abs(layerZ * std::tan(2.f * std::atan(std::exp(-etaOut)))); + float layerZ = z_first + (layerNumber * z_length / (mNumberOfLayers - 1)) * std::copysign(1, z_first); + float rIn = std::abs(layerZ * std::tan(2.f * std::atan(std::exp(-etaIn)))); + float rOut = std::abs(layerZ * std::tan(2.f * std::atan(std::exp(-etaOut)))); auto& thisLayer = mLayers[direction].emplace_back(direction, layerNumber, layerName, layerZ, rIn, rOut, Layerx2X0); } } @@ -183,9 +183,9 @@ void Detector::buildFT3V1() LOG(info) << "Building FT3 Detector: V1"; mNumberOfLayers = 10; - Float_t sensorThickness = 30.e-4; - Float_t layersx2X0 = 1.e-2; - std::vector> layersConfig{ + float sensorThickness = 30.e-4; + float layersx2X0 = 1.e-2; + std::vector> layersConfig{ {26., .5, 3., 0.1f * layersx2X0}, // {z_layer, r_in, r_out, Layerx2X0} {30., .5, 3., 0.1f * layersx2X0}, {34., .5, 3., 0.1f * layersx2X0}, @@ -230,9 +230,9 @@ void Detector::buildFT3V3b() LOG(info) << "Building FT3 Detector: V3b"; mNumberOfLayers = 12; - Float_t sensorThickness = 30.e-4; - Float_t layersx2X0 = 1.e-2; - std::vector> layersConfig{ + float sensorThickness = 30.e-4; + float layersx2X0 = 1.e-2; + std::vector> layersConfig{ {26., .5, 3., 0.1f * layersx2X0}, // {z_layer, r_in, r_out, Layerx2X0} {30., .5, 3., 0.1f * layersx2X0}, {34., .5, 3., 0.1f * layersx2X0}, @@ -271,7 +271,55 @@ void Detector::buildFT3V3b() } //_________________________________________________________________________________________________ -Detector::Detector(Bool_t active) +void Detector::buildFT3Scoping() +{ + // Build FT3 detector according to the scoping document + + LOG(info) << "Building FT3 Detector: Scoping document version"; + + mNumberOfLayers = 12; + float sensorThickness = 30.e-4; + float layersx2X0 = 1.e-2; + std::vector> layersConfig{ + {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}, + {100., 5.0, 35., layersx2X0}, + {122., 5.0, 35., layersx2X0}, + {150., 5.0, 68.f, layersx2X0}, + {180., 5.0, 68.f, layersx2X0}, + {220., 5.0, 68.f, layersx2X0}, + {260., 5.0, 68.f, layersx2X0}, + {300., 5.0, 68.f, layersx2X0}, + {350., 5.0, 68.f, layersx2X0}}; + + mLayerName.resize(2); + mLayerName[0].resize(mNumberOfLayers); + mLayerName[1].resize(mNumberOfLayers); + mLayerID.clear(); + mLayers.resize(2); + + for (auto direction : {0, 1}) { + for (int layerNumber = 0; layerNumber < mNumberOfLayers; layerNumber++) { + std::string directionName = std::to_string(direction); + std::string layerName = GeometryTGeo::getFT3LayerPattern() + directionName + std::string("_") + std::to_string(layerNumber); + mLayerName[direction][layerNumber] = layerName; + auto& z = layersConfig[layerNumber][0]; + + auto& rIn = layersConfig[layerNumber][1]; + auto& rOut = layersConfig[layerNumber][2]; + auto& x0 = layersConfig[layerNumber][3]; + + LOG(info) << "Adding Layer " << layerName << " at z = " << z; + // Add layers + auto& thisLayer = mLayers[direction].emplace_back(direction, layerNumber, layerName, z, rIn, rOut, x0); + } + } +} + +//_________________________________________________________________________________________________ +Detector::Detector(bool active) : o2::base::DetImpl("FT3", active), mTrackData(), mHits(o2::utils::createSimVector()) @@ -287,7 +335,7 @@ Detector::Detector(Bool_t active) } else { switch (ft3BaseParam.geoModel) { case Default: - buildFT3V3b(); // FT3V3b + buildFT3Scoping(); // FT3Scoping break; case Telescope: buildBasicFT3(ft3BaseParam); // BasicFT3 = Parametrized telescopic detector (equidistant layers) @@ -365,14 +413,14 @@ void Detector::InitializeO2Detector() } //_________________________________________________________________________________________________ -Bool_t Detector::ProcessHits(FairVolume* vol) +bool Detector::ProcessHits(FairVolume* vol) { // This method is called from the MC stepping if (!(fMC->TrackCharge())) { return kFALSE; } - Int_t lay = 0, volID = vol->getMCid(); + int lay = 0, volID = vol->getMCid(); while ((lay <= mLayerID.size()) && (volID != mLayerID[lay])) { ++lay; } @@ -443,33 +491,33 @@ Bool_t Detector::ProcessHits(FairVolume* vol) //_________________________________________________________________________________________________ void Detector::createMaterials() { - Int_t ifield = 2; - Float_t fieldm = 10.0; + int ifield = 2; + float fieldm = 10.0; o2::base::Detector::initFieldTrackingParams(ifield, fieldm); - Float_t tmaxfdSi = 0.1; // .10000E+01; // Degree - Float_t stemaxSi = 0.0075; // .10000E+01; // cm - Float_t deemaxSi = 0.1; // 0.30000E-02; // Fraction of particle's energy 0AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.)); } else { // If beampipe is enabled append inner disks to beampipe filling volume, this should be temporary. - for (Int_t direction : {0, 1}) { + for (int direction : {0, 1}) { std::string directionString = direction ? "Forward" : "Backward"; LOG(info) << "Creating FT3 " << directionString << " layers:"; - for (Int_t iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) { + for (int iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) { if (iLayer < 3) { mLayers[direction][iLayer].createLayer(volIFT3); } else { @@ -569,7 +617,7 @@ void Detector::createGeometry() if (mLayers.size() == 1) { // All layers registered at mLayers[0], used when building from file LOG(info) << "Creating FT3 layers:"; if (A3IPvac) { - for (Int_t iLayer = 0; iLayer < mLayers[0].size(); iLayer++) { + for (int iLayer = 0; iLayer < mLayers[0].size(); iLayer++) { if (std::abs(mLayers[0][iLayer].getZ()) < 25) { mLayers[0][iLayer].createLayer(volIFT3); } else { @@ -579,7 +627,7 @@ void Detector::createGeometry() A3IPvac->AddNode(volIFT3, 2, new TGeoTranslation(0., 0., 0.)); vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.)); } else { - for (Int_t iLayer = 0; iLayer < mLayers[0].size(); iLayer++) { + for (int iLayer = 0; iLayer < mLayers[0].size(); iLayer++) { mLayers[0][iLayer].createLayer(volFT3); } vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.)); @@ -604,8 +652,8 @@ void Detector::defineSensitiveVolumes() // The names of the FT3 sensitive volumes have the format: FT3Sensor_(0,1)_(0...sNumberLayers-1) if (mLayers.size() == 2) { - for (Int_t direction : {0, 1}) { - for (Int_t iLayer = 0; iLayer < mNumberOfLayers; iLayer++) { + for (int direction : {0, 1}) { + for (int iLayer = 0; iLayer < mNumberOfLayers; iLayer++) { volumeName = o2::ft3::GeometryTGeo::getFT3SensorPattern() + std::to_string(iLayer); v = geoManager->GetVolume(Form("%s_%d_%d", GeometryTGeo::getFT3SensorPattern(), direction, iLayer)); LOG(info) << "Adding FT3 Sensitive Volume => " << v->GetName(); @@ -615,7 +663,7 @@ void Detector::defineSensitiveVolumes() } if (mLayers.size() == 1) { - for (Int_t iLayer = 0; iLayer < mLayers[0].size(); iLayer++) { + for (int iLayer = 0; iLayer < mLayers[0].size(); iLayer++) { volumeName = o2::ft3::GeometryTGeo::getFT3SensorPattern() + std::to_string(iLayer); v = geoManager->GetVolume(Form("%s_%d_%d", GeometryTGeo::getFT3SensorPattern(), 0, iLayer)); LOG(info) << "Adding FT3 Sensitive Volume => " << v->GetName(); diff --git a/Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Layer.cxx b/Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Layer.cxx index 064bfc2efd679..317dcd8c60aee 100644 --- a/Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Layer.cxx +++ b/Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Layer.cxx @@ -70,15 +70,15 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("FT3_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("FT3_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("FT3_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); - sensVol->SetLineColor(kBlue - 4); + sensVol->SetLineColor(kBlue - 7); TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi); - chipVol->SetLineColor(kBlue - 4); + chipVol->SetLineColor(kBlue - 7); TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir); - layerVol->SetLineColor(kBlue - 4); + layerVol->SetLineColor(kBlue - 7); LOG(info) << "Inserting " << sensVol->GetName() << " inside " << chipVol->GetName(); chipVol->AddNode(sensVol, 1, nullptr); diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx index fb53d3388e616..f30c1cb4a10c5 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx @@ -103,8 +103,8 @@ void Detector::createMaterials() o2::base::Detector::Mixture(1, "AIR$", aAir, zAir, dAir, 4, wAir); o2::base::Detector::Medium(1, "AIR$", 1, 0, ifield, fieldm, tmaxfdAir, stemaxAir, deemaxAir, epsilAir, stminAir); - o2::base::Detector::Material(3, "SI$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); - o2::base::Detector::Medium(3, "SI$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); + o2::base::Detector::Material(3, "SILICON$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); + o2::base::Detector::Medium(3, "SILICON$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); } void Detector::createGeometry() diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx index a6bfff03a7157..fc1b5f1607232 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx @@ -43,7 +43,7 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$"); LOGP(info, "Media: {} {}", (void*)medSi, (void*)medAir); @@ -74,7 +74,7 @@ void OTOFLayer::createLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); @@ -103,7 +103,7 @@ void FTOFLayer::createLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); @@ -135,7 +135,7 @@ void BTOFLayer::createLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mZLength / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("TF3_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("TF3_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); diff --git a/Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx b/Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx index 7b350c0131100..6226ab2425e34 100644 --- a/Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx +++ b/Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx @@ -53,16 +53,22 @@ void Alice3Absorber::createMaterials() auto& matmgr = o2::base::MaterialManager::Instance(); // Define materials for muon absorber // - Int_t isxfld = 2.; - Float_t sxmgmx = 10.; + int isxfld = 2.; + float sxmgmx = 10.; o2::base::Detector::initFieldTrackingParams(isxfld, sxmgmx); // // Steel // - Float_t asteel[4] = {55.847, 51.9961, 58.6934, 28.0855}; - Float_t zsteel[4] = {26., 24., 28., 14.}; - Float_t wsteel[4] = {.715, .18, .1, .005}; + float asteel[4] = {55.847, 51.9961, 58.6934, 28.0855}; + float zsteel[4] = {26., 24., 28., 14.}; + float wsteel[4] = {.715, .18, .1, .005}; + + // Iron + float airon[2] = {55.845, 56.}; + float ziron[2] = {26., 26.}; + float wiron[2] = {.923, .077}; + // // Air // @@ -75,7 +81,7 @@ void Alice3Absorber::createMaterials() // **************** // Defines tracking media parameters. // - Float_t epsil, stmin, tmaxfd, deemax, stemax; + float epsil, stmin, tmaxfd, deemax, stemax; epsil = .001; // Tracking precision, stemax = -0.01; // Maximum displacement for multiple scat tmaxfd = -20.; // Maximum angle due to field deflection @@ -84,17 +90,18 @@ void Alice3Absorber::createMaterials() // *************** // - matmgr.Mixture("ALICE3ABSO", 16, "VACUUM0$", aAir, zAir, dAir1, 4, wAir); - matmgr.Medium("ALICE3ABSO", 16, "VA_C0", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + matmgr.Mixture("ALICE3_ABSORBER", 16, "VACUUM$", aAir, zAir, dAir1, 4, wAir); + matmgr.Medium("ALICE3_ABSORBER", 16, "VA_C0", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // // Steel - matmgr.Mixture("ALICE3ABSO", 19, "STAINLESS STEEL0$", asteel, zsteel, 7.88, 4, wsteel); - matmgr.Mixture("ALICE3ABSO", 39, "STAINLESS STEEL1$", asteel, zsteel, 7.88, 4, wsteel); - matmgr.Mixture("ALICE3ABSO", 59, "STAINLESS STEEL2$", asteel, zsteel, 7.88, 4, wsteel); - matmgr.Medium("ALICE3ABSO", 19, "ST_C0", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("ALICE3ABSO", 39, "ST_C1", 39, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("ALICE3ABSO", 59, "ST_C3", 59, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // matmgr.Mixture("ALICE3_ABSORBER", 19, "STAINLESS_STEEL$", asteel, zsteel, 7.88, 4, wsteel); + // matmgr.Medium("ALICE3_ABSORBER", 19, "ST_C0", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + + // + // Iron + matmgr.Material("ALICE3_ABSORBER", 26, "IRON$", 55.845, 26., 7.874, 1.757, 17.1); + matmgr.Medium("ALICE3_ABSORBER", 26, "FE", 26, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); } void Alice3Absorber::ConstructGeometry() @@ -112,9 +119,8 @@ void Alice3Absorber::ConstructGeometry() // Media // - auto kMedVac = matmgr.getTGeoMedium("ALICE3ABSO_VA_C0"); - auto kMedSteel = matmgr.getTGeoMedium("ALICE3ABSO_ST_C0"); - auto kMedSteelSh = matmgr.getTGeoMedium("ALICE3ABSO_ST_C3"); + auto kMedVac = matmgr.getTGeoMedium("ALICE3_ABSORBER_VA_C0"); + auto kMedIron = matmgr.getTGeoMedium("ALICE3_ABSORBER_FE"); // The top volume TGeoVolume* top = gGeoManager->GetVolume("cave"); @@ -147,7 +153,7 @@ void Alice3Absorber::ConstructGeometry() // Insert absorings->SetName("absorings"); - TGeoVolume* abso = new TGeoVolume("Absorber", absorings, kMedSteel); + TGeoVolume* abso = new TGeoVolume("Absorber", absorings, kMedIron); abso->SetVisibility(1); abso->SetTransparency(50); diff --git a/Detectors/Upgrades/ALICE3/Passive/src/Magnet.cxx b/Detectors/Upgrades/ALICE3/Passive/src/Magnet.cxx index 69c5694851aa7..a44d922dba383 100644 --- a/Detectors/Upgrades/ALICE3/Passive/src/Magnet.cxx +++ b/Detectors/Upgrades/ALICE3/Passive/src/Magnet.cxx @@ -22,7 +22,7 @@ using namespace o2::passive; Alice3Magnet::~Alice3Magnet() = default; -Alice3Magnet::Alice3Magnet() : Alice3PassiveBase("A3MAG", "") {} +Alice3Magnet::Alice3Magnet() : Alice3PassiveBase("ALICE3_MAGNET", "") {} Alice3Magnet::Alice3Magnet(const char* name, const char* title) : Alice3PassiveBase(name, title) {} Alice3Magnet::Alice3Magnet(const Alice3Magnet& rhs) = default; @@ -77,13 +77,13 @@ void Alice3Magnet::createMaterials() deemax = -.3; // Maximum fractional energy loss, DLS stmin = -.8; - matmgr.Mixture("A3MAG", 1, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir); - matmgr.Material("A3MAG", 9, "Al1$", 26.98, 13., 2.7, 8.9, 37.2); - matmgr.Material("A3MAG", 19, "Cu1$", 63.55, 29., 8.96, 1.6, 18.8); + matmgr.Mixture("ALICE3_MAGNET", 1, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir); + matmgr.Material("ALICE3_MAGNET", 9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2); + matmgr.Material("ALICE3_MAGNET", 19, "COPPER$", 63.55, 29., 8.96, 1.436, 15.1); - matmgr.Medium("A3MAG", 1, "VACUUM", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("A3MAG", 9, "ALU_C0", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("A3MAG", 19, "CU_C0", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + matmgr.Medium("ALICE3_MAGNET", 1, "VACUUM", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + matmgr.Medium("ALICE3_MAGNET", 9, "ALUMINIUM", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + matmgr.Medium("ALICE3_MAGNET", 19, "COPPER", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); } void Alice3Magnet::ConstructGeometry() @@ -97,9 +97,9 @@ void Alice3Magnet::ConstructGeometry() } auto& matmgr = o2::base::MaterialManager::Instance(); - auto kMedAl = matmgr.getTGeoMedium("A3MAG_ALU_C0"); - auto kMedCu = matmgr.getTGeoMedium("A3MAG_CU_C0"); - auto kMedVac = matmgr.getTGeoMedium("A3MAG_VACUUM"); + auto kMedAl = matmgr.getTGeoMedium("ALICE3_MAGNET_ALUMINIUM"); + auto kMedCu = matmgr.getTGeoMedium("ALICE3_MAGNET_COPPER"); + auto kMedVac = matmgr.getTGeoMedium("ALICE3_MAGNET_VACUUM"); // inner wrap LOGP(debug, "Alice 3 magnet: creating inner wrap with inner radius {} and thickness {}", mInnerWrapInnerRadius, mInnerWrapThickness); diff --git a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx index 93b24c5f36d22..a5bc1d059fde0 100644 --- a/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx +++ b/Detectors/Upgrades/ALICE3/Passive/src/Pipe.cxx @@ -83,11 +83,8 @@ void Alice3Pipe::ConstructGeometry() // Media auto& matmgr = o2::base::MaterialManager::Instance(); - const TGeoMedium* kMedBe = matmgr.getTGeoMedium("ALICE3PIPE_BE"); - const TGeoMedium* kMedVac = matmgr.getTGeoMedium("ALICE3PIPE_VACUUM"); - const TGeoMedium* kMedVacNF = matmgr.getTGeoMedium("ALICE3PIPE_VACUUM_NF"); - const TGeoMedium* kMedVacHC = matmgr.getTGeoMedium("ALICE3PIPE_VACUUM_HC"); - const TGeoMedium* kMedVacNFHC = matmgr.getTGeoMedium("ALICE3PIPE_VACUUM_NFHC"); + const TGeoMedium* kMedBe = matmgr.getTGeoMedium("ALICE3_PIPE_BE"); + const TGeoMedium* kMedVac = matmgr.getTGeoMedium("ALICE3_PIPE_VACUUM"); // Top volume TGeoVolume* top = gGeoManager->GetVolume("cave"); @@ -197,20 +194,14 @@ void Alice3Pipe::createMaterials() auto& matmgr = o2::base::MaterialManager::Instance(); - // Beryllium - matmgr.Material("ALICE3PIPE", 5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7); - matmgr.Medium("ALICE3PIPE", 5, "BE", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // Beryllium + matmgr.Material("ALICE3_PIPE", 5, "BERILLIUM$", 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("ALICE3PIPE", 16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir); - matmgr.Mixture("ALICE3PIPE", 36, "VACUUM$_NF", aAir, zAir, dAir1, 4, wAir); - matmgr.Mixture("ALICE3PIPE", 56, "VACUUM$_HC ", aAir, zAir, dAir1, 4, wAir); - matmgr.Mixture("ALICE3PIPE", 76, "VACUUM$_NFHC", aAir, zAir, dAir1, 4, wAir); + // Vacuum + matmgr.Mixture("ALICE3_PIPE", 16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir); - matmgr.Medium("ALICE3PIPE", 16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("ALICE3PIPE", 36, "VACUUM_NF", 36, 0, 0, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("ALICE3PIPE", 56, "VACUUM_HC", 56, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); - matmgr.Medium("ALICE3PIPE", 76, "VACUUM_NFHC", 76, 0, 0, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + matmgr.Medium("ALICE3_PIPE", 16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); } // ---------------------------------------------------------------------------- diff --git a/Detectors/Upgrades/ALICE3/RICH/simulation/src/Detector.cxx b/Detectors/Upgrades/ALICE3/RICH/simulation/src/Detector.cxx index ef6761ab88f0b..68789cf5eb357 100644 --- a/Detectors/Upgrades/ALICE3/RICH/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/RICH/simulation/src/Detector.cxx @@ -120,8 +120,8 @@ void Detector::createMaterials() o2::base::Detector::Mixture(1, "AIR$", aAir, zAir, dAir, 4, wAir); o2::base::Detector::Medium(1, "AIR$", 1, 0, ifield, fieldm, tmaxfdAir, stemaxAir, deemaxAir, epsilAir, stminAir); - o2::base::Detector::Material(3, "SI$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); - o2::base::Detector::Medium(3, "SI$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); + o2::base::Detector::Material(3, "SILICON$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); + o2::base::Detector::Medium(3, "SILICON$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); o2::base::Detector::Mixture(2, "AEROGEL$", aAerogel, zAerogel, dAerogel, 3, wAerogel); o2::base::Detector::Medium(2, "AEROGEL$", 2, 0, ifield, fieldm, tmaxfdAerogel, stemaxAerogel, deemaxAerogel, epsilAerogel, stminAerogel); diff --git a/Detectors/Upgrades/ALICE3/RICH/simulation/src/RICHRing.cxx b/Detectors/Upgrades/ALICE3/RICH/simulation/src/RICHRing.cxx index 9843cf12154d4..091e03ec03a6c 100644 --- a/Detectors/Upgrades/ALICE3/RICH/simulation/src/RICHRing.cxx +++ b/Detectors/Upgrades/ALICE3/RICH/simulation/src/RICHRing.cxx @@ -49,7 +49,7 @@ Ring::Ring(int rPosId, if (!medAerogel) { LOGP(fatal, "RICH: Aerogel medium not found"); } - TGeoMedium* medSi = gGeoManager->GetMedium("RCH_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("RCH_SILICON$"); if (!medSi) { LOGP(fatal, "RICH: Silicon medium not found"); } diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt b/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt index bd39704203713..7706c0e10d778 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/CMakeLists.txt @@ -14,6 +14,7 @@ o2_add_library(TRKSimulation src/Detector.cxx src/TRKServices.cxx PUBLIC_LINK_LIBRARIES O2::TRKBase + O2::FT3Simulation O2::ITSMFTSimulation) o2_target_root_dictionary(TRKSimulation diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h index 99d2653c19fc2..129fb74d38867 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/TRKServices.h @@ -12,6 +12,14 @@ #ifndef O2_TRK_SERVICES_H #define O2_TRK_SERVICES_H +////// Inputs from F. Reidt, 11-2023 +// Material 1 Fraction X_0 (cm) Material 2 Fraction X_0 (cm) +// Fiber SiO2 0,5 12,29 PE 0,5 45 +// Power bundle, no jacket Cu 0,09 1,44 PE 0,91 45 +// Power bundle Cu 0,06 1,44 PE 0,94 45 +// Water bundle PU 0,56 19 H2O 0,44 36,08 +// Water bundle disk PU 0,44 19 H2O 0,56 36,08 + #include #include @@ -22,17 +30,46 @@ namespace trk class TRKServices : public FairModule { + enum class Orientation { kASide = 1, + kCSide = -1 }; + // TRK services overview: three componenets + // + // ================================================== + // ============|| Outer ||============ + // =========|| || Tracker || ||========= + // || ||======================|| || + // || Inner + Middle || + // || Tracker || + // || ||======================|| || + // =========|| || || ||========= ---> createDisksServices + // ============|| ||============ ---> createMiddleBarrelServices + // ================================================== ---> 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); protected: - float mRMin; - float mZLength; - float mThickness; - float mX0; + // Coldplate + float mColdPlateRMin; + float mColdPlateZLength; + float mColdPlateThickness; + float mColdPlateX0; + + // Services + float mFiberComposition[2] = {0.5, 0.5}; // SiO2, PE + float mPowerBundleComposition[2] = {0.09, 0.91}; // Cu, PE + float mPowerBundleJacketComposition[2] = {0.06, 0.94}; // Cu, PE + float mWaterBundleComposition[2] = {0.56, 0.44}; // PU, H2O + float mWaterBundleDiskComposition[2] = {0.44, 0.56}; // PU, H2O + float mMiddleDiskThickness = 1.0; // cm + std::vector mCableFanWeights = {0.5, 0.3, 0.2}; // relative weights of the fan layers + 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 0440ebeaa8fe3..5e46e791cf6b9 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/Detector.cxx @@ -85,9 +85,9 @@ void Detector::configDefault() 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, 264.f, 100.e-3); - mLayers.emplace_back(9, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(9)}, 60.f, 264.f, 100.e-3); - mLayers.emplace_back(10, std::string{GeometryTGeo::getTRKLayerPattern() + std::to_string(10)}, 80.f, 264.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); } void Detector::configFromFile(std::string fileName) @@ -173,8 +173,8 @@ void Detector::createMaterials() o2::base::Detector::Mixture(1, "AIR$", aAir, zAir, dAir, 4, wAir); o2::base::Detector::Medium(1, "AIR$", 1, 0, ifield, fieldm, tmaxfdAir, stemaxAir, deemaxAir, epsilAir, stminAir); - o2::base::Detector::Material(3, "SI$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); - o2::base::Detector::Medium(3, "SI$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); + o2::base::Detector::Material(3, "SILICON$", 0.28086E+02, 0.14000E+02, 0.23300E+01, 0.93600E+01, 0.99900E+03); + o2::base::Detector::Medium(3, "SILICON$", 3, 0, ifield, fieldm, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi); } void Detector::createGeometry() diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx index 4bd639c49c5dc..5e24181bb0fe0 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKLayer.cxx @@ -47,7 +47,7 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume) TGeoTube* chip = new TGeoTube(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2); TGeoTube* layer = new TGeoTube(mInnerRadius, mInnerRadius + mChipThickness, mZ / 2); - TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SI$"); + TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$"); TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$"); TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi); diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx index 59fcaf1f512da..99d7bee98f56b 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/src/TRKServices.cxx @@ -11,9 +11,14 @@ #include #include +#include +#include #include +#include #include +#include #include +#include #include @@ -23,9 +28,9 @@ namespace trk { TRKServices::TRKServices(float rMin, float zLength, float thickness) { - mRMin = rMin; - mZLength = zLength; - mThickness = thickness; + mColdPlateRMin = rMin; + mColdPlateZLength = zLength; + mColdPlateThickness = thickness; } void TRKServices::createMaterials() @@ -48,18 +53,81 @@ void TRKServices::createMaterials() float wCer[2] = {0.5294, 0.4706}; // Mass %, which makes sense. TODO: check if Mixture needs mass% or comp% float dCer = 3.97; - matmgr.Mixture("COLDPLATE", 66, "CERAMIC$", aCer, zCer, dCer, 2, wCer); // Ceramic for cold plate - matmgr.Medium("COLDPLATE", 66, "CER", 66, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); + // 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; + + // Water + float aWater[2] = {1.00794, 15.9994}; + float zWater[2] = {1., 8.}; + float wWater[2] = {0.111894, 0.888106}; + float dWater = 1.0; + + // Fused silica SiO2 https://pdg.lbl.gov/2023/AtomicNuclearProperties/HTML/silicon_dioxide_fused_quartz.html + float aSiO2[2] = {28.0855, 15.9990}; + float zSiO2[2] = {14., 8.}; + float wSiO2[2] = {0.467, 0.533}; + float dSiO2 = 2.2; + + // Polyethylene from alice 2 absorber + float aPolyethylene[2] = {12.01, 1.}; + float zPolyethylene[2] = {6., 1.}; + float wPolyethylene[2] = {.33, .67}; + + // Polyurethane [HN-CO-O] from alice 2 mft + int nPolyurethane = 4; + float aPolyurethane[4] = {1.00794, 14.010, 12.0107, 15.9994}; + float zPolyurethane[4] = {1.0, 7.0, 6.0, 8.0}; + float wPolyurethane[4] = {0.017077588, 0.237314387, 0.203327619, 0.542280405}; + float dPolyurethane = 1.25; + + matmgr.Mixture("ALICE3_TRKSERVICES", 66, "CERAMIC", aCer, zCer, dCer, 2, wCer); // Ceramic for cold plate + matmgr.Mixture("ALICE3_TRKSERVICES", 68, "AIR", aAir, zAir, dAir, 4, wAir); // Air for placeholding cables + matmgr.Mixture("ALICE3_TRKSERVICES", 69, "POLYETHYLENE", aPolyethylene, zPolyethylene, .95, 2, wPolyethylene); // Polyethylene for fibers + matmgr.Mixture("ALICE3_TRKSERVICES", 70, "POLYURETHANE", aPolyurethane, zPolyurethane, dPolyurethane, nPolyurethane, wPolyurethane); // Polyurethane for cooling pipes + matmgr.Mixture("ALICE3_TRKSERVICES", 71, "SILICONDIOXIDE", aSiO2, zSiO2, dSiO2, 2, wSiO2); // Fused silica SiO2 + matmgr.Mixture("ALICE3_TRKSERVICES", 72, "WATER", aWater, zWater, dWater, 2, wWater); // Water for cooling pipes + matmgr.Material("ALICE3_TRKSERVICES", 67, "COPPER", 63.546, 29, 8.96, 1.43, 15.1); // Copper for cables + + // Danger zone: following mixtures do not use the interface of MaterialManager + // TGeoMixture* fiber = new TGeoMixture("ALICE3_TRKSERVICES_FIBER", 2 /*nel*/); + // fiber->AddElement(gGeoManager->GetMaterial("SILICONDIOXIDE"), 0.5); + // fiber->AddElement(gGeoManager->GetMaterial("POLYETHYLENE"), 0.5); + + // TGeoMixture* powerBundleNoJacket = new TGeoMixture("ALICE3_TRKSERVICES_POWERBUNDLENOJACKET", 2 /*nel*/); + // powerBundleNoJacket->AddElement(gGeoManager->GetMaterial("COPPER"), 0.09); + // powerBundleNoJacket->AddElement(gGeoManager->GetMaterial("POLYETHYLENE"), 0.91); + + // TGeoMixture* coolingBundle = new TGeoMixture("ALICE3_TRKSERVICES_COOLINGBUNDLE", 2 /*nel*/); + // coolingBundle->AddElement(gGeoManager->GetMaterial("POLYURETHANE"), 0.56); + // coolingBundle->AddElement(gGeoManager->GetMaterial("WATER"), 0.44); + + 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 + matmgr.Medium("ALICE3_TRKSERVICES", 3, "AIR", 68, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Air for placeholding cables + matmgr.Medium("ALICE3_TRKSERVICES", 4, "POLYETHYLENE", 69, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Polyethylene for fibers + matmgr.Medium("ALICE3_TRKSERVICES", 5, "POLYURETHANE", 70, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Polyurethane for cooling pipes + matmgr.Medium("ALICE3_TRKSERVICES", 6, "SILICONDIOXIDE", 71, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Fused silica SiO2 + matmgr.Medium("ALICE3_TRKSERVICES", 7, "WATER", 72, 0, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin); // Water for cooling pipes } void TRKServices::createServices(TGeoVolume* motherVolume) { createMaterials(); + createColdplate(motherVolume); + createMiddleServices(motherVolume); + createOuterDisksServices(motherVolume); + createOuterBarrelServices(motherVolume); +} +void TRKServices::createColdplate(TGeoVolume* motherVolume) +{ auto& matmgr = o2::base::MaterialManager::Instance(); - const TGeoMedium* medCeramic = matmgr.getTGeoMedium("COLDPLATE_CER"); + const TGeoMedium* medCeramic = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_CERAMIC"); - TGeoTube* coldPlate = new TGeoTube("TRK_COLDPLATEsh", mRMin, mRMin + mThickness, mZLength / 2.); + TGeoTube* coldPlate = new TGeoTube("TRK_COLDPLATEsh", mColdPlateRMin, mColdPlateRMin + mColdPlateThickness, mColdPlateZLength / 2.); TGeoVolume* coldPlateVolume = new TGeoVolume("TRK_COLDPLATE", coldPlate, medCeramic); coldPlateVolume->SetVisibility(1); coldPlateVolume->SetLineColor(kYellow); @@ -69,6 +137,272 @@ void TRKServices::createServices(TGeoVolume* motherVolume) LOGP(info, "Inserting {} in {} ", coldPlateVolume->GetName(), motherVolume->GetName()); motherVolume->AddNode(coldPlateVolume, 1, nullptr); } -// ClassImp(o2::trk::TRKServices); + +void TRKServices::createOuterDisksServices(TGeoVolume* motherVolume) +{ + // This method hardcoes the pink shape for the inner services + auto& matmgr = o2::base::MaterialManager::Instance(); + + TGeoMedium* medSiO2 = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_SILICONDIOXIDE"); + TGeoMedium* medPE = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_POLYETHYLENE"); + TGeoMedium* medCu = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_COPPER"); + TGeoMedium* medPU = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_POLYURETHANE"); + TGeoMedium* medH2O = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_WATER"); + + for (auto& orientation : {Orientation::kASide, Orientation::kCSide}) { + // Create fibers: 2.12mm + float siO2FiberThick = 0.5 * 0.212; + float peFiberThick = 0.5 * 0.212; + + float rMinInnerServices = 68.5f; // 68.5cm + float zLengthInnerServices = 201.f; // 201cm + float translation = (int)orientation * (149.f + zLengthInnerServices / 2); // ±149cm + + TGeoTube* outerDisksFiberSIO2 = new TGeoTube("TRK_OUTERDISKS_FIBER_SIO2sh", rMinInnerServices, rMinInnerServices + siO2FiberThick, zLengthInnerServices / 2); + TGeoTube* outerDisksFiberPE = new TGeoTube("TRK_OUTERDISKS_FIBER_PEsh", rMinInnerServices + siO2FiberThick, rMinInnerServices + siO2FiberThick + peFiberThick, zLengthInnerServices / 2); + rMinInnerServices += siO2FiberThick + peFiberThick; + TGeoVolume* outerDisksFiberSIO2Volume = new TGeoVolume("TRK_OUTERDISKS_FIBER_SIO2", outerDisksFiberSIO2, medSiO2); + TGeoVolume* outerDisksFiberPEVolume = new TGeoVolume("TRK_OUTERDISKS_FIBER_PE", outerDisksFiberPE, medPE); + outerDisksFiberSIO2Volume->SetLineColor(kPink); + outerDisksFiberPEVolume->SetLineColor(kPink); + auto* combiTrans = new TGeoCombiTrans(0, 0, translation, nullptr); + motherVolume->AddNode(outerDisksFiberSIO2Volume, 1, combiTrans); + motherVolume->AddNode(outerDisksFiberPEVolume, 1, combiTrans); + + // Create power lines: 11.86mm + float cuPowerThick = 0.09 * 1.186; + float pePowerThick = 0.91 * 1.186; + + TGeoTube* outerDisksPowerCu = new TGeoTube("TRK_OUTERDISKS_POWER_CUsh", rMinInnerServices, rMinInnerServices + cuPowerThick, zLengthInnerServices / 2); + TGeoTube* outerDisksPowerPE = new TGeoTube("TRK_OUTERDISKS_POWER_PEsh", rMinInnerServices + cuPowerThick, rMinInnerServices + cuPowerThick + pePowerThick, zLengthInnerServices / 2); + rMinInnerServices += cuPowerThick + pePowerThick; + TGeoVolume* outerDisksPowerCuVolume = new TGeoVolume("TRK_OUTERDISKS_POWER_CU", outerDisksPowerCu, medCu); + TGeoVolume* outerDisksPowerPEVolume = new TGeoVolume("TRK_OUTERDISKS_POWER_PE", outerDisksPowerPE, medPE); + outerDisksPowerCuVolume->SetLineColor(kPink); + outerDisksPowerPEVolume->SetLineColor(kPink); + motherVolume->AddNode(outerDisksPowerCuVolume, 1, combiTrans); + motherVolume->AddNode(outerDisksPowerPEVolume, 1, combiTrans); + + // Create cooling: 6.47mm + float puCoolingThick = 0.56 * 0.647; + float h2oCoolingThick = 0.44 * 0.647; + + TGeoTube* outerDisksCoolingPU = new TGeoTube("TRK_OUTERDISKS_COOLING_PUsh", rMinInnerServices, rMinInnerServices + puCoolingThick, zLengthInnerServices / 2); + TGeoTube* outerDisksCoolingH2O = new TGeoTube("TRK_OUTERDISKS_COOLING_H2Osh", rMinInnerServices + puCoolingThick, rMinInnerServices + puCoolingThick + h2oCoolingThick, zLengthInnerServices / 2); + // rMinInnerServices += puCoolingThick + h2oCoolingThick; + TGeoVolume* outerDisksCoolingPUVolume = new TGeoVolume("TRK_OUTERDISKS_COOLING_PU", outerDisksCoolingPU, medPU); + TGeoVolume* outerDisksCoolingH2OVolume = new TGeoVolume("TRK_OUTERDISKS_COOLING_H2O", outerDisksCoolingH2O, medH2O); + outerDisksCoolingPUVolume->SetLineColor(kPink); + outerDisksCoolingH2OVolume->SetLineColor(kPink); + motherVolume->AddNode(outerDisksCoolingPUVolume, 1, combiTrans); + motherVolume->AddNode(outerDisksCoolingH2OVolume, 1, combiTrans); + } +} + +void TRKServices::createMiddleServices(TGeoVolume* motherVolume) +{ + // This method hardcoes the yellow shape for the middle services + auto& matmgr = o2::base::MaterialManager::Instance(); + + TGeoMedium* medSiO2 = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_SILICONDIOXIDE"); + TGeoMedium* medPE = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_POLYETHYLENE"); + TGeoMedium* medCu = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_COPPER"); + TGeoMedium* medPU = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_POLYURETHANE"); + TGeoMedium* medH2O = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_WATER"); + + // Create fibers: 3.07mm, 50% SiO2, 50% PE + float siO2FiberThick = 0.5 * 0.307; + float peFiberThick = 0.5 * 0.307; + float puCoolingThick = 0.56 * 0.474; + float h2oCoolingThick = 0.44 * 0.474; + float cuPowerThick = 0.09 * 1.09; + float pePowerThick = 0.91 * 1.09; + const float totalThickness = siO2FiberThick + peFiberThick + cuPowerThick + pePowerThick + puCoolingThick + h2oCoolingThick; + + // Get geometry information from TRK which is already present + float rMinMiddleServices = 35.f; // ((TGeoTube*)motherVolume->GetNode(Form("%s7_1", GeometryTGeo::getTRKLayerPattern()))->GetVolume()->GetShape())->GetRmax(); + const float rMinMiddleBarrel = rMinMiddleServices; + const float zLengthMiddleServices = 143.f; // ((TGeoTube*)motherVolume->GetNode(Form("%s7_1", GeometryTGeo::getTRKLayerPattern()))->GetVolume()->GetShape())->GetDz(); + + LOGP(info, "Building service disk for Middle Tracker rminMiddleServices is: {} Dz is {}", rMinMiddleServices, /* rMaxMiddleServices,*/ zLengthMiddleServices + totalThickness); + TGeoTube* middleBarrelFiberSIO2 = new TGeoTube("TRK_MID_FIBER_SIO2sh", rMinMiddleServices, rMinMiddleServices + siO2FiberThick, zLengthMiddleServices + totalThickness); + TGeoTube* middleBarrelFiberPE = new TGeoTube("TRK_MID_FIBER_PEsh", rMinMiddleServices + siO2FiberThick, rMinMiddleServices + siO2FiberThick + peFiberThick, zLengthMiddleServices + totalThickness); + rMinMiddleServices = rMinMiddleServices + siO2FiberThick + peFiberThick; + TGeoVolume* middleBarrelFiberSIO2Volume = new TGeoVolume("TRK_MID_FIBER_SIO2", middleBarrelFiberSIO2, medSiO2); + TGeoVolume* middleBarrelFiberPEVolume = new TGeoVolume("TRK_MID_FIBER_PE", middleBarrelFiberPE, medPE); + middleBarrelFiberSIO2Volume->SetLineColor(kYellow); + middleBarrelFiberPEVolume->SetLineColor(kYellow); + motherVolume->AddNode(middleBarrelFiberSIO2Volume, 1, nullptr); + motherVolume->AddNode(middleBarrelFiberPEVolume, 1, nullptr); + + // Create powerlines: 10.9mm, 9% Cu, 91% PE + TGeoTube* middleBarrelPowerCu = new TGeoTube("TRK_MID_POWER_CUsh", rMinMiddleServices, rMinMiddleServices + cuPowerThick, zLengthMiddleServices + totalThickness); + TGeoTube* middleBarrelPowerPE = new TGeoTube("TRK_MID_POWER_PEsh", rMinMiddleServices + cuPowerThick, rMinMiddleServices + cuPowerThick + pePowerThick, zLengthMiddleServices + totalThickness); + rMinMiddleServices = rMinMiddleServices + cuPowerThick + pePowerThick; + TGeoVolume* middleBarrelPowerCuVolume = new TGeoVolume("TRK_MID_POWER_CU", middleBarrelPowerCu, medCu); + TGeoVolume* middleBarrelPowerPEVolume = new TGeoVolume("TRK_MID_POWER_PE", middleBarrelPowerPE, medPE); + middleBarrelPowerCuVolume->SetLineColor(kYellow); + middleBarrelPowerPEVolume->SetLineColor(kYellow); + motherVolume->AddNode(middleBarrelPowerCuVolume, 1, nullptr); + motherVolume->AddNode(middleBarrelPowerPEVolume, 1, nullptr); + + // Create cooling pipes: 4.74mm, 56% PU, 44% H2O + TGeoTube* middleBarrelCoolingPU = new TGeoTube("TRK_MID_COOLING_PUsh", rMinMiddleServices, rMinMiddleServices + puCoolingThick, zLengthMiddleServices + totalThickness); + TGeoTube* middleBarrelCoolingH2O = new TGeoTube("TRK_MID_COOLING_H2Osh", rMinMiddleServices + puCoolingThick, rMinMiddleServices + puCoolingThick + h2oCoolingThick, zLengthMiddleServices + totalThickness); + rMinMiddleServices = rMinMiddleServices + puCoolingThick + h2oCoolingThick; + TGeoVolume* middleBarrelCoolingPUVolume = new TGeoVolume("TRK_MID_COOLING_PU", middleBarrelCoolingPU, medPU); + TGeoVolume* middleBarrelCoolingH2OVolume = new TGeoVolume("TRK_MID_COOLING_H2O", middleBarrelCoolingH2O, medH2O); + middleBarrelCoolingPUVolume->SetLineColor(kYellow); + middleBarrelCoolingH2OVolume->SetLineColor(kYellow); + motherVolume->AddNode(middleBarrelCoolingPUVolume, 1, nullptr); + motherVolume->AddNode(middleBarrelCoolingH2OVolume, 1, nullptr); + + // Barrel to forward connection disks + float rMaxMiddleServicesBarFwd = 74.5f + siO2FiberThick + peFiberThick + cuPowerThick + pePowerThick + puCoolingThick + h2oCoolingThick; + for (auto& orientation : {Orientation::kASide, Orientation::kCSide}) { + // Create fibers: 3.07mm, 50% SiO2, 50% PE + TGeoTube* middleBarFwdFiberSIO2 = new TGeoTube("TRK_MIDBARFWD_FIBER_SIO2sh", rMinMiddleBarrel, rMaxMiddleServicesBarFwd, siO2FiberThick); + TGeoTube* middleBarFwdFiberPE = new TGeoTube("TRK_MIDBARFWD_FIBER_PEsh", rMinMiddleBarrel, rMaxMiddleServicesBarFwd, peFiberThick); + TGeoVolume* middleBarFwdFiberSIO2Volume = new TGeoVolume("TRK_MIDBARFWD_FIBER_SIO2", middleBarFwdFiberSIO2, medSiO2); + TGeoVolume* middleBarFwdFiberPEVolume = new TGeoVolume("TRK_MIDBARFWD_FIBER_PE", middleBarFwdFiberPE, medPE); + middleBarFwdFiberSIO2Volume->SetLineColor(kYellow); + middleBarFwdFiberPEVolume->SetLineColor(kYellow); + auto* rot = new TGeoRotation("", 0, 0, 180); + auto* combiTransSIO2 = new TGeoCombiTrans(0, 0, (int)orientation * (siO2FiberThick / 2 + zLengthMiddleServices), rot); + auto* combiTransPE = new TGeoCombiTrans(0, 0, (int)orientation * (siO2FiberThick + peFiberThick / 2 + zLengthMiddleServices), rot); + motherVolume->AddNode(middleBarFwdFiberSIO2Volume, 1, combiTransSIO2); + motherVolume->AddNode(middleBarFwdFiberPEVolume, 1, combiTransPE); + + // Create powerlines: 10.9mm, 9% Cu, 91% PE + TGeoTube* middleBarFwdPowerCu = new TGeoTube("TRK_MIDBARFWD_POWER_CUsh", rMinMiddleBarrel, rMaxMiddleServicesBarFwd, cuPowerThick); + TGeoTube* middleBarFwdPowerPE = new TGeoTube("TRK_MIDBARFWD_POWER_PEsh", rMinMiddleBarrel, rMaxMiddleServicesBarFwd, pePowerThick); + TGeoVolume* middleBarFwdPowerCuVolume = new TGeoVolume("TRK_MIDBARFWD_POWER_CU", middleBarFwdPowerCu, medCu); + TGeoVolume* middleBarFwdPowerPEVolume = new TGeoVolume("TRK_MIDBARFWD_POWER_PE", middleBarFwdPowerPE, medPE); + middleBarFwdPowerCuVolume->SetLineColor(kYellow); + middleBarFwdPowerPEVolume->SetLineColor(kYellow); + auto* combiTransCu = new TGeoCombiTrans(0, 0, (int)orientation * (siO2FiberThick + peFiberThick + cuPowerThick / 2 + zLengthMiddleServices), rot); + auto* combiTransPEPower = new TGeoCombiTrans(0, 0, (int)orientation * (siO2FiberThick + peFiberThick + cuPowerThick + pePowerThick / 2 + zLengthMiddleServices), rot); + motherVolume->AddNode(middleBarFwdPowerCuVolume, 1, combiTransCu); + motherVolume->AddNode(middleBarFwdPowerPEVolume, 1, combiTransPEPower); + + // Create cooling pipes: 4.74mm, 56% PU, 44% H2O + TGeoTube* middleBarFwdCoolingPU = new TGeoTube("TRK_MIDBARFWD_COOLING_PUsh", rMinMiddleBarrel, rMaxMiddleServicesBarFwd, puCoolingThick); + TGeoTube* middleBarFwdCoolingH2O = new TGeoTube("TRK_MIDBARFWD_COOLING_H2Osh", rMinMiddleBarrel, rMaxMiddleServicesBarFwd, h2oCoolingThick); + TGeoVolume* middleBarFwdCoolingPUVolume = new TGeoVolume("TRK_MIDBARFWD_COOLING_PU", middleBarFwdCoolingPU, medPU); + TGeoVolume* middleBarFwdCoolingH2OVolume = new TGeoVolume("TRK_MIDBARFWD_COOLING_H2O", middleBarFwdCoolingH2O, medH2O); + middleBarFwdCoolingPUVolume->SetLineColor(kYellow); + middleBarFwdCoolingH2OVolume->SetLineColor(kYellow); + auto* combiTransCoolingPU = new TGeoCombiTrans(0, 0, (int)orientation * (siO2FiberThick + peFiberThick + cuPowerThick + pePowerThick + puCoolingThick / 2 + zLengthMiddleServices), rot); + auto* combiTransCoolingH2O = new TGeoCombiTrans(0, 0, (int)orientation * (siO2FiberThick + peFiberThick + cuPowerThick + pePowerThick + puCoolingThick + h2oCoolingThick / 2 + zLengthMiddleServices), rot); + motherVolume->AddNode(middleBarFwdCoolingPUVolume, 1, combiTransCoolingPU); + motherVolume->AddNode(middleBarFwdCoolingH2OVolume, 1, combiTransCoolingH2O); + } + + // Forward part + const float zLengthMiddleServicesFwd = 350.f - (143.f + totalThickness); + + for (auto& orientation : {Orientation::kASide, Orientation::kCSide}) { + // Create fibers: 3.07mm, 50% SiO2, 50% PE + float siO2FiberThick = 0.5 * 0.307; + float peFiberThick = 0.5 * 0.307; + float rMinMiddleServicesFwd = 74.5f; // 74.5cm + + float translation = (int)orientation * (143.f + totalThickness + zLengthMiddleServicesFwd / 2); + + TGeoTube* middleFwdFiberSIO2 = new TGeoTube("TRK_MIDFWD_FIBER_SIO2sh", rMinMiddleServicesFwd, rMinMiddleServicesFwd + siO2FiberThick, zLengthMiddleServicesFwd / 2); + TGeoTube* middleFwdFiberPE = new TGeoTube("TRK_MIDFWD_FIBER_PEsh", rMinMiddleServicesFwd + siO2FiberThick, rMinMiddleServicesFwd + siO2FiberThick + peFiberThick, zLengthMiddleServicesFwd / 2); + rMinMiddleServicesFwd += siO2FiberThick + peFiberThick; + TGeoVolume* middleFwdFiberSIO2Volume = new TGeoVolume("TRK_MIDFWD_FIBER_SIO2", middleFwdFiberSIO2, medSiO2); + TGeoVolume* middleFwdFiberPEVolume = new TGeoVolume("TRK_MIDFWD_FIBER_PE", middleFwdFiberPE, medPE); + middleFwdFiberSIO2Volume->SetLineColor(kYellow); + middleFwdFiberPEVolume->SetLineColor(kYellow); + auto* combiTrans = new TGeoCombiTrans(0, 0, translation, nullptr); + motherVolume->AddNode(middleFwdFiberSIO2Volume, 1, combiTrans); + motherVolume->AddNode(middleFwdFiberPEVolume, 1, combiTrans); + + // Create powerlines: 10.9mm, 9% Cu, 91% PE + float cuPowerThick = 0.09 * 1.09; + float pePowerThick = 0.91 * 1.09; + + TGeoTube* middleFwdPowerCu = new TGeoTube("TRK_MIDFWD_POWER_CUsh", rMinMiddleServicesFwd, rMinMiddleServicesFwd + cuPowerThick, zLengthMiddleServicesFwd / 2); + TGeoTube* middleFwdPowerPE = new TGeoTube("TRK_MIDFWD_POWER_PEsh", rMinMiddleServicesFwd + cuPowerThick, rMinMiddleServicesFwd + cuPowerThick + pePowerThick, zLengthMiddleServicesFwd / 2); + rMinMiddleServicesFwd += cuPowerThick + pePowerThick; + TGeoVolume* middleFwdPowerCuVolume = new TGeoVolume("TRK_MIDFWD_POWER_CU", middleFwdPowerCu, medCu); + TGeoVolume* middleFwdPowerPEVolume = new TGeoVolume("TRK_MIDFWD_POWER_PE", middleFwdPowerPE, medPE); + middleFwdPowerCuVolume->SetLineColor(kYellow); + middleFwdPowerPEVolume->SetLineColor(kYellow); + motherVolume->AddNode(middleFwdPowerCuVolume, 1, combiTrans); + motherVolume->AddNode(middleFwdPowerPEVolume, 1, combiTrans); + + // Create cooling pipes: 4.74mm, 56% PU, 44% H2O + float puCoolingThick = 0.56 * 0.474; + float h2oCoolingThick = 0.44 * 0.474; + + TGeoTube* middleFwdCoolingPU = new TGeoTube("TRK_MIDFWD_COOLING_PUsh", rMinMiddleServicesFwd, rMinMiddleServicesFwd + puCoolingThick, zLengthMiddleServicesFwd / 2); + TGeoTube* middleFwdCoolingH2O = new TGeoTube("TRK_MIDFWD_COOLING_H2Osh", rMinMiddleServicesFwd + puCoolingThick, rMinMiddleServicesFwd + puCoolingThick + h2oCoolingThick, zLengthMiddleServicesFwd / 2); + // rMinMiddleServicesFwd += puCoolingThick + h2oCoolingThick; + TGeoVolume* middleFwdCoolingPUVolume = new TGeoVolume("TRK_MIDFWD_COOLING_PU", middleFwdCoolingPU, medPU); + TGeoVolume* middleFwdCoolingH2OVolume = new TGeoVolume("TRK_MIDFWD_COOLING_H2O", middleFwdCoolingH2O, medH2O); + middleFwdCoolingPUVolume->SetLineColor(kYellow); + middleFwdCoolingH2OVolume->SetLineColor(kYellow); + motherVolume->AddNode(middleFwdCoolingPUVolume, 1, combiTrans); + motherVolume->AddNode(middleFwdCoolingH2OVolume, 1, combiTrans); + } +} + +void TRKServices::createOuterBarrelServices(TGeoVolume* motherVolume) +{ + auto& matmgr = o2::base::MaterialManager::Instance(); + + TGeoMedium* medSiO2 = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_SILICONDIOXIDE"); + TGeoMedium* medPE = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_POLYETHYLENE"); + TGeoMedium* medCu = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_COPPER"); + TGeoMedium* medPU = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_POLYURETHANE"); + TGeoMedium* medH2O = matmgr.getTGeoMedium("ALICE3_TRKSERVICES_WATER"); + + // 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(); + const float zLengthOuterBarrelServices = 350.f; // 175cm + + TGeoTube* outerBarrelFiberSIO2 = new TGeoTube("TRK_OUTERBARREL_FIBER_SIO2sh", rMinOuterBarrelServices, rMinOuterBarrelServices + siO2FiberThick, zLengthOuterBarrelServices); + TGeoTube* outerBarrelFiberPE = new TGeoTube("TRK_OUTERBARREL_FIBER_PEsh", rMinOuterBarrelServices + siO2FiberThick, rMinOuterBarrelServices + siO2FiberThick + peFiberThick, zLengthOuterBarrelServices); + rMinOuterBarrelServices += siO2FiberThick + peFiberThick; + TGeoVolume* outerBarrelFiberSIO2Volume = new TGeoVolume("TRK_OUTERBARREL_FIBER_SIO2", outerBarrelFiberSIO2, medSiO2); + TGeoVolume* outerBarrelFiberPEVolume = new TGeoVolume("TRK_OUTERBARREL_FIBER_PE", outerBarrelFiberPE, medPE); + outerBarrelFiberSIO2Volume->SetLineColor(kCyan); + outerBarrelFiberPEVolume->SetLineColor(kCyan); + motherVolume->AddNode(outerBarrelFiberSIO2Volume, 1, nullptr); + motherVolume->AddNode(outerBarrelFiberPEVolume, 1, nullptr); + + // Power 0.430 cm + const float cuPowerThick = 0.09 * 0.430; + const float pePowerThick = 0.91 * 0.430; + + TGeoTube* outerBarrelPowerCu = new TGeoTube("TRK_OUTERBARREL_POWER_CUsh", rMinOuterBarrelServices, rMinOuterBarrelServices + cuPowerThick, zLengthOuterBarrelServices); + TGeoTube* outerBarrelPowerPE = new TGeoTube("TRK_OUTERBARREL_POWER_PEsh", rMinOuterBarrelServices + cuPowerThick, rMinOuterBarrelServices + cuPowerThick + pePowerThick, zLengthOuterBarrelServices); + rMinOuterBarrelServices += cuPowerThick + pePowerThick; + TGeoVolume* outerBarrelPowerCuVolume = new TGeoVolume("TRK_OUTERBARREL_POWER_CU", outerBarrelPowerCu, medCu); + TGeoVolume* outerBarrelPowerPEVolume = new TGeoVolume("TRK_OUTERBARREL_POWER_PE", outerBarrelPowerPE, medPE); + outerBarrelPowerCuVolume->SetLineColor(kCyan); + outerBarrelPowerPEVolume->SetLineColor(kCyan); + motherVolume->AddNode(outerBarrelPowerCuVolume, 1, nullptr); + motherVolume->AddNode(outerBarrelPowerPEVolume, 1, nullptr); + + // Cooling 1.432 cm + const float puCoolingThick = 0.56 * 1.432; + const float h2oCoolingThick = 0.44 * 1.432; + + TGeoTube* outerBarrelCoolingPU = new TGeoTube("TRK_OUTERBARREL_COOLING_PUsh", rMinOuterBarrelServices, rMinOuterBarrelServices + puCoolingThick, zLengthOuterBarrelServices); + TGeoTube* outerBarrelCoolingH2O = new TGeoTube("TRK_OUTERBARREL_COOLING_H2Osh", rMinOuterBarrelServices + puCoolingThick, rMinOuterBarrelServices + puCoolingThick + h2oCoolingThick, zLengthOuterBarrelServices); + // rMinOuterBarrelServices += puCoolingThick + h2oCoolingThick; + TGeoVolume* outerBarrelCoolingPUVolume = new TGeoVolume("TRK_OUTERBARREL_COOLING_PU", outerBarrelCoolingPU, medPU); + TGeoVolume* outerBarrelCoolingH2OVolume = new TGeoVolume("TRK_OUTERBARREL_COOLING_H2O", outerBarrelCoolingH2O, medH2O); + outerBarrelCoolingPUVolume->SetLineColor(kCyan); + outerBarrelCoolingH2OVolume->SetLineColor(kCyan); + motherVolume->AddNode(outerBarrelCoolingPUVolume, 1, nullptr); + motherVolume->AddNode(outerBarrelCoolingH2OVolume, 1, nullptr); +} } // namespace trk } // namespace o2 \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/macros/CMakeLists.txt b/Detectors/Upgrades/ALICE3/macros/CMakeLists.txt new file mode 100644 index 0000000000000..4c6f16c9ffca4 --- /dev/null +++ b/Detectors/Upgrades/ALICE3/macros/CMakeLists.txt @@ -0,0 +1,13 @@ +# 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. + +o2_add_test_root_macro(scanXX0.C + LABELS alice3) \ No newline at end of file diff --git a/Detectors/Upgrades/ALICE3/macros/scanXX0.C b/Detectors/Upgrades/ALICE3/macros/scanXX0.C new file mode 100644 index 0000000000000..2cef4f0fe7dbc --- /dev/null +++ b/Detectors/Upgrades/ALICE3/macros/scanXX0.C @@ -0,0 +1,395 @@ +// 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. +// +// Original authors: M. Sitta, F. Grosa +// Author: M. Concas + +#if !defined(__CLING__) || defined(__ROOTCLING__) + +#include "DetectorsBase/GeometryManager.h" +#include "ITSBase/GeometryTGeo.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// #include "FairGeoParSet.h" // for FairGeoParSet +#include // for LOG, LOG_IF + +#include +#include +#include +#endif + +constexpr int nBinsPhiScan = 90; +constexpr int nBinsEtaScan = 200; +constexpr int nBinsZvtxScan = 300; +constexpr float maxEtaScan = 8.; +constexpr int n = 1e4; // testtracks +constexpr float len = 1000; // cm + +void vacuumFormMaterial(TGeoMaterial* mat) +{ + constexpr double kAirA = 14.00674; + constexpr double kAirZ = 7.; + constexpr double kAirDensity = 0.0; // set for vacuum + constexpr double kAirRadLen = std::numeric_limits::max(); + // LOGP(info, "Vacuum forming {} ...", mat->GetName()); + // std::cout << "\t A = " << mat->GetA() << " -> " << kAirA << std::endl; + // std::cout << "\t Z = " << mat->GetZ() << " -> " << kAirZ << std::endl; + // std::cout << "\t Density = " << mat->GetDensity() << " -> " << kAirDensity << std::endl; + // std::cout << "\t RadLen = " << mat->GetRadLen() << " -> " << kAirRadLen << std::endl; + + // Make this material air-like + mat->SetA(kAirA); + mat->SetZ(kAirZ); + mat->SetDensity(kAirDensity); + mat->SetRadLen(kAirRadLen); +} + +//______________________________________________________________________ +void ComputeMaterialBudget(double rmin, double rmax, double etaPos, + double phiMin, double phiMax, TH1F* xOverX0VsPhi, + TH1F* xOverX0VsEta, TH1F* xOverX0VsZvtx, TH2F* xOverX02d = nullptr) +{ + // Ancillary function to compute material budget between rmin and rmax + + TH1F* nParticlesVsPhi = new TH1F("", "", nBinsPhiScan, phiMin, phiMax); + TH1F* nParticlesVsEta = new TH1F("", "", nBinsEtaScan, -maxEtaScan, maxEtaScan); + TH1F* nParticlesVsZvtx = new TH1F("", "", nBinsZvtxScan, -len / 2, len / 2); + TH2F* nParticlesVsPhiEta = new TH2F("", "", nBinsZvtxScan, -maxEtaScan, maxEtaScan, nBinsPhiScan, phiMax, phiMax); + + double x1, y1, z1, x2, y2, z2; + + for (int it = 0; it < n; it++) { // we simulate flat in phi and eta, from Zvtx=0 + + // PHI VS ETA + double phi = gRandom->Uniform(phiMin, phiMax); + double eta = gRandom->Uniform(-maxEtaScan, maxEtaScan); + double theta = TMath::ATan(TMath::Exp(-eta)) * 2; + x1 = rmin * TMath::Cos(phi); + y1 = rmin * TMath::Sin(phi); + z1 = rmin / TMath::Tan(theta); + x2 = rmax * TMath::Cos(phi); + y2 = rmax * TMath::Sin(phi); + z2 = rmax / TMath::Tan(theta); + + auto mparam = o2::base::GeometryManager::meanMaterialBudget(x1, y1, z1, x2, y2, z2); + + if (std::abs(eta) < etaPos) { + xOverX0VsPhi->Fill(phi, mparam.meanX2X0 * 100); + nParticlesVsPhi->Fill(phi); + } + xOverX0VsEta->Fill(eta, mparam.meanX2X0 * 100); + nParticlesVsEta->Fill(eta); + + if (xOverX02d != 0) { + xOverX02d->Fill(eta, phi, mparam.meanX2X0 * 100); + nParticlesVsPhiEta->Fill(eta, phi); + } + } + + for (int it = 0; it < n; it++) { // then we simulate flat in Zvtx with eta = 0 and flat in phi + + double phi = TMath::Pi() / 2; + double eta = 0.; + double theta = TMath::ATan(TMath::Exp(-eta)) * 2; + double z = gRandom->Uniform(-len / 2, len / 2); + x1 = rmin * TMath::Cos(phi); + y1 = rmin * TMath::Sin(phi); + x2 = rmax * TMath::Cos(phi); + y2 = rmax * TMath::Sin(phi); + + auto mparam = o2::base::GeometryManager::meanMaterialBudget(x1, y1, z, x2, y2, z); + + xOverX0VsZvtx->Fill(z, mparam.meanX2X0 * 100); + nParticlesVsZvtx->Fill(z); + } + + // normalization to number of particles in case of phi vs eta + double theta = TMath::ATan(TMath::Exp(-etaPos / 2)) * 2; + LOGP(info, "<η>={} -> Sin(θ) {}", etaPos / 2, TMath::Sin(theta)); + + for (int ix = 1; ix <= nParticlesVsPhi->GetNbinsX(); ix++) { + if (nParticlesVsPhi->GetBinContent(ix) > 0) + xOverX0VsPhi->SetBinContent(ix, xOverX0VsPhi->GetBinContent(ix) / nParticlesVsPhi->GetBinContent(ix) * TMath::Sin(theta)); + } + + for (int ix = 1; ix <= nParticlesVsEta->GetNbinsX(); ix++) { + if (nParticlesVsEta->GetBinContent(ix) > 0) + xOverX0VsEta->SetBinContent(ix, xOverX0VsEta->GetBinContent(ix) / nParticlesVsEta->GetBinContent(ix)); + } + + for (int ix = 1; ix <= nParticlesVsZvtx->GetNbinsX(); ix++) { + if (nParticlesVsZvtx->GetBinContent(ix) > 0) + xOverX0VsZvtx->SetBinContent(ix, xOverX0VsZvtx->GetBinContent(ix) / nParticlesVsZvtx->GetBinContent(ix)); + } + + if (xOverX02d) { + for (int ix = 1; ix <= nParticlesVsPhiEta->GetNbinsX(); ix++) { + for (int iy = 1; iy <= nParticlesVsPhiEta->GetNbinsY(); iy++) { + if (nParticlesVsPhiEta->GetBinContent(ix, iy) > 0) + xOverX02d->SetBinContent(ix, iy, xOverX02d->GetBinContent(ix, iy) / nParticlesVsPhiEta->GetBinContent(ix, iy)); + } + } + } +} + +std::vector printMaterialDefinitions(TGeoManager* gman) +{ + std::vector materialNames; + TGeoMedium* med; + TGeoMaterial* mat; + char mediaName[50], matName[50], shortName[50]; + + int nMedia = gman->GetListOfMedia()->GetEntries(); + + LOGP(info, " =================== ALICE 3 Material Properties ================= "); + LOGP(info, " A Z d (g/cm3) RadLen (cm) IntLen (cm)\t Name\n"); + + for (int i = 0; i < nMedia; i++) { + med = (TGeoMedium*)(gman->GetListOfMedia()->At(i)); + mat = med->GetMaterial(); + LOGP(info, "{:5.1f} {:6.1f} {:8.3f} {:13.1f} {:11.1f}\t {}", mat->GetA(), mat->GetZ(), mat->GetDensity(), mat->GetRadLen(), mat->GetIntLen(), mat->GetName()); + + std::vector tokens; + std::string matNameStr(mat->GetName()); + if (matNameStr.back() == '$') { + matNameStr.pop_back(); + } + size_t pos = 0; + while ((pos = matNameStr.find("_")) != std::string::npos) { + std::string part = matNameStr.substr(0, pos); + tokens.push_back(part); + matNameStr.erase(0, pos + 1); + } + std::transform(matNameStr.begin(), matNameStr.end(), matNameStr.begin(), ::toupper); + tokens.push_back(matNameStr); + if (tokens.back() == "NF") { // Manually manage air_NF + continue; + } + if (std::find(materialNames.begin(), materialNames.end(), tokens.back()) == materialNames.end()) { + materialNames.push_back(tokens.back()); + } + } + + // print material names for debug + for (auto& name : materialNames) { + LOGP(info, "Unique material name: {}", name); + } + + return materialNames; +} + +void scanXX0(const float rmax = 200, const float rmin = 0.2, const std::string OnlyMat = "all", const string fileName = "o2sim_geometry.root", const string path = "./") +{ + gStyle->SetPadTopMargin(0.035); + gStyle->SetPadRightMargin(0.035); + gStyle->SetPadBottomMargin(0.14); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetTitleOffset(1.4, "y"); + gStyle->SetPadTickX(1); + gStyle->SetPadTickY(1); + gStyle->SetOptStat(0); + gStyle->SetOptTitle(0); + gStyle->SetPalette(kSolar); + + double etaPos = 1.; + + TCanvas* canvStack = new TCanvas("canvStack", "canvStack", 2400, 800); + canvStack->Divide(3, 1); + + TCanvas* canv = new TCanvas("canv", "canv", 2400, 800); + canv->Divide(3, 1); + + TLegend* legVsPhi = new TLegend(0.25, 0.6, 0.85, 0.9); + legVsPhi->SetFillColor(kWhite); + legVsPhi->SetTextSize(0.045); + legVsPhi->SetHeader(Form("ALICE 3, |#it{#eta}| < %0.f, #it{Z}_{vtx} = 0", etaPos)); + + TLegend* legVsEta = new TLegend(0.25, 0.6, 0.85, 0.9); + legVsEta->SetFillColor(kWhite); + legVsEta->SetTextSize(0.045); + legVsEta->SetHeader("ALICE 3, 0 < #it{#varphi} < #pi, #it{Z}_{vtx} = 0"); + + TLegend* legVsZvtx = new TLegend(0.25, 0.6, 0.85, 0.9); + legVsZvtx->SetFillColor(kWhite); + legVsZvtx->SetTextSize(0.045); + legVsZvtx->SetHeader("ALICE 3, #it{#varphi} = #pi/2, #it{#eta} = 0"); + + auto* xOverX0VsPhiStack = new THStack("xOverX0VsPhi", ""); + auto* xOverX0VsEtaStack = new THStack("xOverX0VsEta", ""); + auto* xOverX0VsZvtxStack = new THStack("xOverX0VsZvtx", ""); + + std::vector xOverX0VsPhi; + std::vector xOverX0VsEta; + std::vector xOverX0VsZvtx; + + TGeoManager::Import((path + fileName).c_str()); + auto materials = printMaterialDefinitions(gGeoManager); + + const double phiMin = 0; + const double phiMax = 2 * TMath::Pi(); + const double len = 1000.; + std::vector colors = {kAzure + 4, kRed + 1}; + + // delete gGeoManager; // We re-import the geometry at each iteration + int count = 2; + auto cols = TColor::GetPalette(); + + for (size_t iMaterial{0}; iMaterial < materials.size(); ++iMaterial) { + if (OnlyMat != "all" && materials[iMaterial] != OnlyMat) { + continue; + } + TGeoManager::Import((path + fileName).c_str()); + LOGP(info, " ********* Processing material: {} ********* ", materials[iMaterial]); + auto nMedia = gGeoManager->GetListOfMedia()->GetEntries(); + for (int i = 0; i < nMedia; i++) { + auto* med = (TGeoMedium*)(gGeoManager->GetListOfMedia()->At(i)); + auto* mat = med->GetMaterial(); + std::string matname{mat->GetName()}; + std::transform(matname.begin(), matname.end(), matname.begin(), ::toupper); + if (matname.find(materials[iMaterial]) == std::string::npos) { + vacuumFormMaterial(mat); + } else { + LOGP(info, "\t {} found as {} element.", materials[iMaterial], iMaterial); + } + } + + xOverX0VsPhi.emplace_back(new TH1F(Form("xOverX0VsPhi_step%zu", iMaterial), "", nBinsPhiScan, phiMin, phiMax)); + xOverX0VsEta.emplace_back(new TH1F(Form("xOverX0VsEta_step%zu", iMaterial), "", nBinsEtaScan, -maxEtaScan, maxEtaScan)); + xOverX0VsZvtx.emplace_back(new TH1F(Form("xOverX0VsZvtx_step%zu", iMaterial), "", nBinsZvtxScan, -len / 2, len / 2)); + + ComputeMaterialBudget(rmin, rmax, etaPos, phiMin, phiMax, xOverX0VsPhi.back(), xOverX0VsEta.back(), xOverX0VsZvtx.back()); + + double meanX0vsPhi = 0, meanX0vsEta = 0, meanX0vsZvtx = 0; + for (int ix = 1; ix <= xOverX0VsPhi.back()->GetNbinsX(); ix++) { + meanX0vsPhi += xOverX0VsPhi.back()->GetBinContent(ix); + } + meanX0vsPhi /= xOverX0VsPhi.back()->GetNbinsX(); + + for (int ix = 1; ix <= xOverX0VsEta.back()->GetNbinsX(); ix++) { + meanX0vsEta += xOverX0VsEta.back()->GetBinContent(ix); + } + meanX0vsEta /= xOverX0VsEta.back()->GetNbinsX(); + + for (int ix = 1; ix <= xOverX0VsZvtx.back()->GetNbinsX(); ix++) { + meanX0vsZvtx += xOverX0VsZvtx.back()->GetBinContent(ix); + } + meanX0vsZvtx /= xOverX0VsZvtx.back()->GetNbinsX(); + + LOGP(info, "Mean X/X0 vs. phi: {}", meanX0vsPhi); + LOGP(info, "Mean X/X0 vs. eta: {}", meanX0vsEta); + LOGP(info, "Mean X/X0 vs. Zvtx: {}", meanX0vsZvtx); + + xOverX0VsPhi.back()->GetXaxis()->SetTitle("#it{#varphi} (rad)"); + xOverX0VsPhi.back()->GetXaxis()->SetTitleSize(0.05); + xOverX0VsPhi.back()->GetXaxis()->SetLabelSize(0.045); + xOverX0VsPhi.back()->GetYaxis()->SetTitle("#it{X}/#it{X}_{0} (%)"); + xOverX0VsPhi.back()->GetYaxis()->SetTitleSize(0.05); + xOverX0VsPhi.back()->GetYaxis()->SetLabelSize(0.045); + xOverX0VsPhi.back()->GetYaxis()->SetDecimals(); + xOverX0VsPhi.back()->SetFillColorAlpha(iMaterial + 2, 0.5); + xOverX0VsPhi.back()->SetLineColor(iMaterial + 2); + xOverX0VsPhi.back()->SetLineWidth(2); + + xOverX0VsEta.back()->GetXaxis()->SetTitle("#it{#eta}"); + xOverX0VsEta.back()->GetXaxis()->SetTitleSize(0.05); + xOverX0VsEta.back()->GetXaxis()->SetLabelSize(0.045); + xOverX0VsEta.back()->GetYaxis()->SetTitle("#it{X}/#it{X}_{0} (%)"); + xOverX0VsEta.back()->GetYaxis()->SetTitleSize(0.05); + xOverX0VsEta.back()->GetYaxis()->SetLabelSize(0.045); + xOverX0VsEta.back()->GetYaxis()->SetDecimals(); + xOverX0VsEta.back()->SetFillColorAlpha(iMaterial + 2, 0.5); + xOverX0VsEta.back()->SetLineColor(iMaterial + 2); + xOverX0VsEta.back()->SetLineWidth(2); + + xOverX0VsZvtx.back()->GetXaxis()->SetTitle("#it{Z}_{vtx} (cm)"); + xOverX0VsZvtx.back()->GetXaxis()->SetTitleSize(0.05); + xOverX0VsZvtx.back()->GetXaxis()->SetLabelSize(0.045); + xOverX0VsZvtx.back()->GetYaxis()->SetTitle("#it{X}/#it{X}_{0} (%)"); + xOverX0VsZvtx.back()->GetYaxis()->SetTitleSize(0.05); + xOverX0VsZvtx.back()->GetYaxis()->SetLabelSize(0.045); + xOverX0VsZvtx.back()->GetYaxis()->SetDecimals(); + xOverX0VsZvtx.back()->SetFillColorAlpha(iMaterial + 2, 0.5); + xOverX0VsZvtx.back()->SetLineColor(iMaterial + 2); + xOverX0VsZvtx.back()->SetLineWidth(2); + + if (xOverX0VsPhi.size() == 1) { + legVsPhi->AddEntry("", Form("#LT #it{X}/#it{X}_{0} #GT = %0.3f %%", meanX0vsPhi), ""); + legVsEta->AddEntry("", Form("#LT #it{X}/#it{X}_{0} #GT = %0.3f %%", meanX0vsEta), ""); + legVsZvtx->AddEntry("", Form("#LT #it{X}/#it{X}_{0} #GT = %0.3f %%", meanX0vsZvtx), ""); + } + legVsPhi->AddEntry(xOverX0VsPhi.back(), materials[iMaterial].c_str(), "f"); + legVsEta->AddEntry(xOverX0VsPhi.back(), materials[iMaterial].c_str(), "f"); + legVsZvtx->AddEntry(xOverX0VsZvtx.back(), materials[iMaterial].c_str(), "f"); + + canv->cd(1)->SetGrid(); + if (xOverX0VsPhi.size() == 1) { + xOverX0VsPhi.back()->SetMinimum(1.e-4); + // xOverX0VsPhi.back()->SetMaximum(20.f); + xOverX0VsPhi.back()->DrawCopy("HISTO"); + legVsPhi->Draw(); + xOverX0VsPhiStack->Add(xOverX0VsPhi.back()); + } else { + xOverX0VsPhi.back()->DrawCopy("HISTO SAME"); + xOverX0VsPhiStack->Add(xOverX0VsPhi.back()); + } + + canv->cd(2)->SetGrid(); + if (xOverX0VsEta.size() == 1) { + xOverX0VsEta.back()->SetMinimum(1.e-4); + // xOverX0VsEta.back()->SetMaximum(60.f); + xOverX0VsEta.back()->DrawCopy("HISTO"); + legVsEta->Draw(); + xOverX0VsEtaStack->Add(xOverX0VsEta.back()); + } else { + xOverX0VsEta.back()->DrawCopy("HISTO SAME"); + xOverX0VsEtaStack->Add(xOverX0VsEta.back()); + } + + canv->cd(3)->SetGrid(); + if (xOverX0VsZvtx.size() == 1) { + xOverX0VsZvtx.back()->SetMinimum(1.e-4); + // xOverX0VsZvtx.back()->SetMaximum(120.f); + xOverX0VsZvtx.back()->DrawCopy("HISTO"); + legVsZvtx->Draw(); + xOverX0VsZvtxStack->Add(xOverX0VsZvtx.back()); + } else { + xOverX0VsZvtx.back()->DrawCopy("HISTO SAME"); + xOverX0VsZvtxStack->Add(xOverX0VsZvtx.back()); + } + delete gGeoManager; + } + canvStack->cd(1)->SetGrid(); + xOverX0VsPhiStack->Draw("HISTO"); + canvStack->cd(2)->SetGrid(); + xOverX0VsEtaStack->Draw("HISTO"); + canvStack->cd(3)->SetGrid(); + xOverX0VsZvtxStack->Draw("HISTO"); + canvStack->BuildLegend(0.25, 0.6, 0.85, 0.9); + + canv->SaveAs("alice3_material_vsphietaz.pdf"); + canvStack->SaveAs("alice3_material_vsphietaz_stack.pdf"); +} \ No newline at end of file