ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ObjSurfaceWriter.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ObjSurfaceWriter.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2018 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/Surfaces/Surface.hpp
>
12
#include <
Acts/Utilities/Logger.hpp
>
13
#include <fstream>
14
#include <iostream>
15
#include <mutex>
16
17
#include "
ACTFW/Framework/AlgorithmContext.hpp
"
18
#include "
ACTFW/Framework/ProcessCode.hpp
"
19
#include "
ACTFW/Plugins/Obj/ObjHelper.hpp
"
20
21
namespace
FW {
22
namespace
Obj {
23
28
class
ObjSurfaceWriter
{
29
public
:
30
// @class Config
31
//
32
// The nested config class for the Surface writer
33
class
Config
{
34
public
:
36
std::shared_ptr<const Acts::Logger>
logger
;
38
std::string
name
;
40
unsigned
int
outputPhiSegemnts
= 72;
42
double
outputThickness
= 2.;
44
bool
outputSensitive
=
true
;
46
bool
outputLayerSurface
=
true
;
48
double
outputScalor
= 1.;
50
unsigned
int
outputPrecision
= 6;
52
std::string
filePrefix
=
""
;
55
std::string
planarPrefix
=
""
;
56
std::string
cylinderPrefix
=
""
;
57
std::string
diskPrefix
=
""
;
59
std::shared_ptr<std::ofstream>
outputStream
=
nullptr
;
60
61
Config
(
const
std::string& lname =
"ObjSurfaceWriter"
,
62
Acts::Logging::Level
lvl =
Acts::Logging::INFO
)
63
:
logger
(Acts::
getDefaultLogger
(lname, lvl)),
name
(lname) {}
64
};
65
69
ObjSurfaceWriter
(
const
Config
& cfg);
70
72
std::string
name
()
const
;
73
77
FW::ProcessCode
write
(
const
AlgorithmContext
&
context
,
78
const
Acts::Surface
&
surface
);
79
82
FW::ProcessCode
write
(
const
std::string&
sinfo
);
83
84
private
:
85
Config
m_cfg
;
86
Obj::VtnCounter
m_vtnCounter
;
87
std::mutex
m_write_mutex
;
88
90
const
Acts::Logger
&
logger
()
const
{
return
*
m_cfg
.
logger
; }
91
};
92
93
inline
FW::ProcessCode
ObjSurfaceWriter::write
(
const
std::string&
sinfo
) {
94
// lock the mutex for writing
95
std::lock_guard<std::mutex> lock(
m_write_mutex
);
96
// and write
97
(*
m_cfg
.
outputStream
) << sinfo;
98
return
FW::ProcessCode::SUCCESS
;
99
}
100
101
}
// namespace Obj
102
}
// namespace FW
acts
blob
master
Examples
Io
Obj
include
ACTFW
Plugins
Obj
ObjSurfaceWriter.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:24
using
1.8.2 with
ECCE GitHub integration