Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TGeoMaterialConverter.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TGeoMaterialConverter.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
12 
13 #include "TGeoMaterial.h"
14 
16  const TGeoMaterial& tgMaterial, ActsScalar thicknessIn,
17  ActsScalar thicknessOut, const Options& options) {
18  // Scalable properties
19  ActsScalar matX0 = tgMaterial.GetRadLen();
20  ActsScalar matL0 = tgMaterial.GetIntLen();
21  ActsScalar matRho = tgMaterial.GetDensity();
22 
23  // X0, L0, rho scale with the thickness
24  ActsScalar cFactor = thicknessIn / thicknessOut;
25  ActsScalar uScalor = options.unitLengthScalor;
26  ActsScalar rScalar =
27  options.unitMassScalor / pow(options.unitLengthScalor, 3);
28 
30  matX0 * uScalor / cFactor, matL0 * uScalor / cFactor, tgMaterial.GetA(),
31  tgMaterial.GetZ(), matRho * rScalar * cFactor);
32 
33  return MaterialSlab(material, thicknessOut);
34 }