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
MaterialJsonConverter.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MaterialJsonConverter.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2021 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/Definitions/Algebra.hpp
"
12
#include "
Acts/Material/ISurfaceMaterial.hpp
"
13
#include "
Acts/Material/IVolumeMaterial.hpp
"
14
#include "
Acts/Material/Material.hpp
"
15
#include "
Acts/Material/MaterialSlab.hpp
"
16
#include "
Acts/Plugins/Json/ActsJson.hpp
"
17
18
#include <nlohmann/json.hpp>
19
20
// Custom Json encoder/decoders. Naming is mandated by nlohmann::json and thus
21
// can not match our naming guidelines.
22
namespace
Acts {
23
class
IVolumeMaterial;
24
25
using
volumeMaterialPointer
=
const
Acts::IVolumeMaterial
*;
26
using
surfaceMaterialPointer
=
const
Acts::ISurfaceMaterial
*;
27
28
void
to_json
(nlohmann::json&
j
,
const
Material
&
t
);
29
30
void
from_json
(
const
nlohmann::json&
j
,
Material
&
t
);
31
32
void
to_json
(nlohmann::json&
j
,
const
MaterialSlab
&
t
);
33
34
void
from_json
(
const
nlohmann::json&
j
,
MaterialSlab
&
t
);
35
36
void
from_json
(
const
nlohmann::json&
j
,
MaterialSlabMatrix
&
t
);
37
38
void
to_json
(nlohmann::json&
j
,
const
volumeMaterialPointer
&
material
);
39
40
void
from_json
(
const
nlohmann::json&
j
,
volumeMaterialPointer
&
material
);
41
42
void
to_json
(nlohmann::json&
j
,
const
surfaceMaterialPointer
&
material
);
43
44
void
from_json
(
const
nlohmann::json&
j
,
surfaceMaterialPointer
&
material
);
45
46
// This macro create a conversion for the mapping type enum
47
NLOHMANN_JSON_SERIALIZE_ENUM(
Acts::MappingType
,
48
{
49
{
Acts::MappingType::PreMapping
,
"PreMapping"
},
50
{
Acts::MappingType::Default
,
"Default"
},
51
{
Acts::MappingType::PostMapping
,
52
"PostMapping"
},
53
{
Acts::MappingType::Sensor
,
"Sensor"
},
54
})
55
56
}
// namespace Acts
acts
blob
sPHENIX
Plugins
Json
include
Acts
Plugins
Json
MaterialJsonConverter.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:41
using
1.8.2 with
sPHENIX GitHub integration