ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::GeoMaterialConverter Class Reference

A Simple Helper Class that convertes the GeoMaterial object used in GeoModel full detector description to an appropriate Trk::ExtendedMaterialProperties object. More...

#include <GeoMaterialConverter.h>

Collaboration diagram for Trk::GeoMaterialConverter:

Public Member Functions

 GeoMaterialConverter ()=default
 Default constructor.
 ~GeoMaterialConverter ()=default
 Destructor.

Static Public Member Functions

static Material convert (const GeoMaterial *gm)
 Single conversion , input type GeoMaterial - output type Trk::MaterialProperties.
static bool dummy_material (const GeoMaterial *)
 hardcoded dummy materials : TODO : find generic criterium ( density ?

Detailed Description

A Simple Helper Class that convertes the GeoMaterial object used in GeoModel full detector description to an appropriate Trk::ExtendedMaterialProperties object.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 30 of file GeoMaterialConverter.h.

Constructor & Destructor Documentation

◆ GeoMaterialConverter()

Trk::GeoMaterialConverter::GeoMaterialConverter ( )
default

Default constructor.

◆ ~GeoMaterialConverter()

Trk::GeoMaterialConverter::~GeoMaterialConverter ( )
default

Destructor.

Member Function Documentation

◆ convert()

Trk::Material Trk::GeoMaterialConverter::convert ( const GeoMaterial * gm)
static

Single conversion , input type GeoMaterial - output type Trk::MaterialProperties.

Definition at line 18 of file GeoMaterialConverter.cxx.

18 {
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}

◆ dummy_material()

bool Trk::GeoMaterialConverter::dummy_material ( const GeoMaterial * mat)
static

hardcoded dummy materials : TODO : find generic criterium ( density ?

radiation length ? )

Definition at line 39 of file GeoMaterialConverter.cxx.

39 {
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}

The documentation for this class was generated from the following files: