Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:27

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Plugins/TGeo/TGeoMaterialConverter.hpp"
0010 
0011 #include "Acts/Material/Material.hpp"
0012 
0013 #include "TGeoMaterial.h"
0014 
0015 Acts::MaterialSlab Acts::TGeoMaterialConverter::materialSlab(
0016     const TGeoMaterial& tgMaterial, double thicknessIn, double thicknessOut,
0017     const Options& options) {
0018   // Scalable properties
0019   double matX0 = tgMaterial.GetRadLen();
0020   double matL0 = tgMaterial.GetIntLen();
0021   double matRho = tgMaterial.GetDensity();
0022 
0023   // X0, L0, rho scale with the thickness
0024   double cFactor = thicknessIn / thicknessOut;
0025   double uScalor = options.unitLengthScalor;
0026   double rScalar = options.unitMassScalor / pow(options.unitLengthScalor, 3);
0027 
0028   auto material = Material::fromMassDensity(
0029       matX0 * uScalor / cFactor, matL0 * uScalor / cFactor, tgMaterial.GetA(),
0030       tgMaterial.GetZ(), matRho * rScalar * cFactor);
0031 
0032   return MaterialSlab(material, thicknessOut);
0033 }