Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
JsonMaterialDecorator.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file JsonMaterialDecorator.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2019 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
9
#pragma once
10
11
#include "
Acts/Geometry/TrackingVolume.hpp
"
12
#include "
Acts/Material/IMaterialDecorator.hpp
"
13
#include "
Acts/Material/ISurfaceMaterial.hpp
"
14
#include "
Acts/Material/IVolumeMaterial.hpp
"
15
#include "
Acts/Plugins/Json/MaterialMapJsonConverter.hpp
"
16
#include "
Acts/Surfaces/Surface.hpp
"
17
18
#include <fstream>
19
#include <map>
20
#include <mutex>
21
22
// Convenience shorthand
23
24
namespace
Acts {
25
30
class
JsonMaterialDecorator
:
public
IMaterialDecorator
{
31
public
:
32
using
SurfaceMaterialMap
=
33
std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
34
35
using
VolumeMaterialMap
=
36
std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
37
38
JsonMaterialDecorator
(
const
MaterialMapJsonConverter::Config
& rConfig,
39
const
std::string
& jFileName,
40
Acts::Logging::Level
level
,
41
bool
clearSurfaceMaterial =
true
,
42
bool
clearVolumeMaterial =
true
);
43
47
void
decorate
(
Surface
&
surface
)
const
final
;
48
52
void
decorate
(
TrackingVolume
& volume)
const
final
;
53
54
private
:
55
MaterialMapJsonConverter::Config
m_readerConfig
;
56
SurfaceMaterialMap
m_surfaceMaterialMap
;
57
VolumeMaterialMap
m_volumeMaterialMap
;
58
59
bool
m_clearSurfaceMaterial
{
true
};
60
bool
m_clearVolumeMaterial
{
true
};
61
62
std::unique_ptr<const Logger>
m_logger
;
63
64
const
Logger
&
logger
()
const
{
return
*
m_logger
; }
65
};
66
}
// namespace Acts
acts
blob
sPHENIX
Plugins
Json
include
Acts
Plugins
Json
JsonMaterialDecorator.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:41
using
1.8.2 with
sPHENIX GitHub integration