Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v38r1p1 (ae26267b)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
ParsersVct.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
// ============================================================================
12
// Include files
13
// ============================================================================
14
#include "
GaudiKernel/VectorsAsProperty.h
"
15
// ============================================================================
16
#include "
GaudiKernel/ToStream.h
"
17
#include <
Gaudi/Parsers/Factory.h
>
18
// ============================================================================
19
namespace
{
20
// ==========================================================================
21
typedef
std::map<std::string, double>
MAP;
22
23
template
<
unsigned
int
N>
24
inline
MAP::const_iterator
find
(
const
MAP&
m
,
const
std::string
( &
keys
)[
N
] ) {
25
for
(
unsigned
int
i = 0; i <
N
; ++i ) {
26
auto
found =
m
.find(
keys
[i] );
27
if
(
m
.end() != found ) {
return
found; }
28
}
29
return
m
.end();
30
}
31
// ==========================================================================
32
}
// namespace
33
// ============================================================================
34
namespace
Gaudi
{
35
namespace
Parsers {
36
template
<
typename
T1,
typename
T2>
37
inline
StatusCode
parse_
(
ROOT::Math::PositionVector3D<T1, T2>
& result,
const
std::string
& input ) {
38
Skipper
skipper;
39
typename
Grammar_<IteratorT, ROOT::Math::PositionVector3D<T1, T2>
,
Skipper
>::Grammar
g
;
40
IteratorT
iter = input.
begin
(),
end
= input.
end
();
41
if
( qi::phrase_parse( iter,
end
,
g
, skipper, result ) ) {
return
StatusCode::SUCCESS
; }
42
//@attention always
43
return
StatusCode::SUCCESS
;
44
}
45
// ==========================================================================
46
47
StatusCode
parse
(
Gaudi::XYZPoint
& result,
const
std::string
& input ) {
return
parse_
( result, input ); }
48
49
// ==========================================================================
50
/* parse 3D-vector
51
* @param result (output) the parsed vector
52
* @param input (input) the input string
53
* @return status code
54
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
55
* @date 2009-09-05
56
*/
57
StatusCode
parse
(
Gaudi::XYZVector
& result,
const
std::string
& input ) {
58
59
Gaudi::XYZPoint
point;
60
StatusCode
sc =
parse
( point, input );
61
if
( sc.
isFailure
() ) {
return
sc; }
// RETURN
62
result = point;
63
return
StatusCode::SUCCESS
;
// RETURN
64
}
65
66
StatusCode
parse
(
Gaudi::LorentzVector
& result,
const
std::string
& input ) {
return
parse_
( result, input ); }
67
68
// ==========================================================================
69
/* parse the vector of points
70
* @param resut (OUTPUT) the parser vector
71
* @param input (INPIUT) the string to be parsed
72
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
73
* @date 2009-09-05
74
*/
75
// ==========================================================================
76
StatusCode
parse
(
std::vector<Gaudi::XYZPoint>
& result,
const
std::string
& input ) {
77
result.
clear
();
78
return
parse_
( result, input );
79
}
80
// ==========================================================================
81
/* parse the vector of vectors
82
* @param resut (OUTPUT) the parser vector
83
* @param input (INPIUT) the string to be parsed
84
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
85
* @date 2009-09-05
86
*/
87
// ==========================================================================
88
StatusCode
parse
(
std::vector<Gaudi::XYZVector>
& result,
const
std::string
& input ) {
89
result.
clear
();
90
return
parse_
( result, input );
91
}
92
93
#ifndef _WIN32
94
// ==========================================================================
95
/* parse the vector of vectors
96
* @param resut (OUTPUT) the parser vector
97
* @param input (INPIUT) the string to be parsed
98
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
99
* @date 2009-09-05
100
*/
101
// ==========================================================================
102
StatusCode
parse
(
std::vector<Gaudi::LorentzVector>
& result,
const
std::string
& input ) {
103
return
parse_
( result, input );
104
}
105
#endif
106
}
// namespace Parsers
107
}
// namespace Gaudi
108
// ============================================================================
109
// print XYZ-point
110
// ============================================================================
111
std::ostream
&
Gaudi::Utils::toStream
(
const
Gaudi::XYZPoint
& obj,
std::ostream
&
s
) {
112
s
<<
"( "
;
113
toStream
( obj.X(),
s
);
114
s
<<
" , "
;
115
toStream
( obj.Y(),
s
);
116
s
<<
" , "
;
117
toStream
( obj.Z(),
s
);
118
s
<<
" )"
;
119
return
s
;
120
}
121
// ============================================================================
122
// print XYZ-vector
123
// ============================================================================
124
std::ostream
&
Gaudi::Utils::toStream
(
const
Gaudi::XYZVector
& obj,
std::ostream
&
s
) {
125
s
<<
"( "
;
126
toStream
( obj.X(),
s
);
127
s
<<
" , "
;
128
toStream
( obj.Y(),
s
);
129
s
<<
" , "
;
130
toStream
( obj.Z(),
s
);
131
s
<<
" )"
;
132
133
return
s
;
134
}
135
// ============================================================================
136
// print LorentzVector
137
// ============================================================================
138
std::ostream
&
Gaudi::Utils::toStream
(
const
Gaudi::LorentzVector
& obj,
std::ostream
&
s
) {
139
140
s
<<
"( "
;
141
toStream
( obj.Px(),
s
, 12 );
142
s
<<
" , "
;
143
toStream
( obj.Py(),
s
, 12 );
144
s
<<
" , "
;
145
toStream
( obj.Pz(),
s
, 13 );
146
s
<<
" , "
;
147
toStream
( obj.E(),
s
, 14 );
148
s
<<
" )"
;
149
150
return
s
;
151
}
152
// ============================================================================
VectorsAsProperty.h
Gaudi::Parsers::IteratorT
std::string::const_iterator IteratorT
Definition:
Factory.h:34
std::string
STL class.
IOTest.N
N
Definition:
IOTest.py:110
ROOT::Math::PositionVector3D
Definition:
IMagneticFieldSvc.h:25
gaudirun.s
string s
Definition:
gaudirun.py:346
Gaudi::XYZVector
ROOT::Math::XYZVector XYZVector
Cartesian 3D vector (double)
Definition:
Vector3DTypes.h:39
std::vector< Gaudi::XYZPoint >
std::find
T find(T... args)
ToStream.h
std::vector::clear
T clear(T... args)
StatusCode
Definition:
StatusCode.h:65
gaudirun.g
dictionary g
Definition:
gaudirun.py:579
Gaudi::Units::m
constexpr double m
Definition:
SystemOfUnits.h:108
std::ostream
STL class.
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition:
Factory.h:39
Gaudi::Parsers::SkipperGrammar
Definition:
Grammar.h:51
std::map< std::string, double >
Gaudi
Header file for std:chrono::duration-based Counters.
Definition:
__init__.py:1
Factory.h
StatusCode::isFailure
bool isFailure() const
Definition:
StatusCode.h:129
toStream
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition:
DataObjID.cpp:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:100
Gaudi::Parsers::Grammar_
Definition:
Grammars.h:68
StringKeyEx.keys
keys
Definition:
StringKeyEx.py:63
std::string::begin
T begin(T... args)
Gaudi::Utils::toStream
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition:
ToStream.h:300
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition:
DODBasicMapper.cpp:21
std::string::end
T end(T... args)
IOTest.end
end
Definition:
IOTest.py:123
Gaudi::LorentzVector
ROOT::Math::PxPyPzEVector LorentzVector
Cartesian 4 Vector.
Definition:
Vector4DTypes.h:40
Gaudi::XYZPoint
ROOT::Math::XYZPoint XYZPoint
3D cartesian point (double)
Definition:
Point3DTypes.h:39
GaudiKernel
src
Lib
ParsersVct.cpp
Generated on Fri Oct 18 2024 13:27:50 for The Gaudi Framework by
1.8.18