ATLAS Offline Software
GeoMaterialConverter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // GeoMaterialConverter.cxx, (c) ATLAS Detector software
8 
9 // Trk
11 // GeoModelKernel
12 #include "GeoModelKernel/GeoElement.h"
13 #include "GeoModelKernel/GeoMaterial.h"
14 #include "GeoModelKernel/Units.h"
15 namespace {
16  constexpr double s_densityCnvFactor = 1. / GeoModelKernelUnits::gram;
17 }
19  // get the obvious things
20  float x0 = gm->getRadLength();
21  float l0 = gm->getIntLength();
22  float rho = gm->getDensity() * s_densityCnvFactor;
23  // float dEdX = gm->getDeDxMin();
24  float A = 0.;
25  float Z = 0.;
26  // get the number of elements that build the material
27  int numberOfElements = gm->getNumElements();
28  // loop over the elements
29  for (int iEl = 0; iEl < numberOfElements; iEl++) {
30  const GeoElement* geoEl = gm->getElement(iEl);
31  float fraction = gm->getFraction(iEl);
32  A += fraction * (geoEl->getA() / (GeoModelKernelUnits::gram));
33  Z += fraction * (geoEl->getZ());
34  }
35  // return the result
36  return {x0, l0, A, Z, rho};
37 }
38 
40 
41  bool dummyMat = false;
42 
43  const std::string& matName = mat->getName();
44 
45  if (matName == "special::Ether")
46  dummyMat = true;
47  if (matName == "WorldLog:Air")
48  dummyMat = true;
49  if (matName == "std::Air")
50  dummyMat = true;
51  if (matName == "Air")
52  dummyMat = true;
53 
54  return dummyMat;
55 }
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
Trk::GeoMaterialConverter::convert
static Material convert(const GeoMaterial *gm)
Single conversion , input type GeoMaterial - output type Trk::MaterialProperties.
Definition: GeoMaterialConverter.cxx:18
python.SystemOfUnits.gram
int gram
Definition: SystemOfUnits.py:165
A
GeoMaterialConverter.h
ReadCellNoiseFromCoolCompare.l0
l0
Definition: ReadCellNoiseFromCoolCompare.py:359
Trk::Material
Definition: Material.h:116
Trk::GeoMaterialConverter::dummy_material
static bool dummy_material(const GeoMaterial *)
hardcoded dummy materials : TODO : find generic criterium ( density ? radiation length ?...
Definition: GeoMaterialConverter.cxx:39
fitman.rho
rho
Definition: fitman.py:532