The Gaudi Framework
v36r16 (ea80daf8)
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
r
s
t
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
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
const
std::string
s_X[] = {
"x"
,
"X"
,
"px"
,
"pX"
,
"Px"
,
"PX"
};
33
const
std::string
s_Y[] = {
"y"
,
"Y"
,
"py"
,
"pY"
,
"Py"
,
"PY"
};
34
const
std::string
s_Z[] = {
"z"
,
"Z"
,
"pz"
,
"pZ"
,
"Pz"
,
"PZ"
};
35
const
std::string
s_E[] = {
"t"
,
"T"
,
"e"
,
"E"
};
36
// ==========================================================================
37
}
// namespace
38
// ============================================================================
39
namespace
Gaudi
{
40
namespace
Parsers {
41
template
<
typename
T1,
typename
T2>
42
inline
StatusCode
parse_
(
ROOT::Math::PositionVector3D<T1, T2>
& result,
const
std::string
& input ) {
43
Skipper
skipper;
44
typename
Grammar_<IteratorT, ROOT::Math::PositionVector3D<T1, T2>
,
Skipper
>::Grammar
g
;
45
IteratorT
iter = input.
begin
(),
end
= input.
end
();
46
if
( qi::phrase_parse( iter,
end
,
g
, skipper, result ) ) {
return
StatusCode::SUCCESS
; }
47
//@attention always
48
return
StatusCode::SUCCESS
;
49
}
50
// ==========================================================================
51
52
StatusCode
parse
(
Gaudi::XYZPoint
& result,
const
std::string
& input ) {
return
parse_
( result, input ); }
53
54
// ==========================================================================
55
/* parse 3D-vector
56
* @param result (output) the parsed vector
57
* @param input (input) the input string
58
* @return status code
59
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
60
* @date 2009-09-05
61
*/
62
StatusCode
parse
(
Gaudi::XYZVector
& result,
const
std::string
& input ) {
63
64
Gaudi::XYZPoint
point;
65
StatusCode
sc =
parse
( point, input );
66
if
( sc.
isFailure
() ) {
return
sc; }
// RETURN
67
result = point;
68
return
StatusCode::SUCCESS
;
// RETURN
69
}
70
71
StatusCode
parse
(
Gaudi::LorentzVector
& result,
const
std::string
& input ) {
return
parse_
( result, input ); }
72
73
// ==========================================================================
74
/* parse the vector of points
75
* @param resut (OUTPUT) the parser vector
76
* @param input (INPIUT) the string to be parsed
77
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
78
* @date 2009-09-05
79
*/
80
// ==========================================================================
81
StatusCode
parse
(
std::vector<Gaudi::XYZPoint>
& result,
const
std::string
& input ) {
82
result.
clear
();
83
return
parse_
( result, input );
84
}
85
// ==========================================================================
86
/* parse the vector of vectors
87
* @param resut (OUTPUT) the parser vector
88
* @param input (INPIUT) the string to be parsed
89
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
90
* @date 2009-09-05
91
*/
92
// ==========================================================================
93
StatusCode
parse
(
std::vector<Gaudi::XYZVector>
& result,
const
std::string
& input ) {
94
result.
clear
();
95
return
parse_
( result, input );
96
}
97
98
#ifndef _WIN32
99
// ==========================================================================
100
/* parse the vector of vectors
101
* @param resut (OUTPUT) the parser vector
102
* @param input (INPIUT) the string to be parsed
103
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
104
* @date 2009-09-05
105
*/
106
// ==========================================================================
107
StatusCode
parse
(
std::vector<Gaudi::LorentzVector>
& result,
const
std::string
& input ) {
108
return
parse_
( result, input );
109
}
110
#endif
111
}
// namespace Parsers
112
}
// namespace Gaudi
113
// ============================================================================
114
// print XYZ-point
115
// ============================================================================
116
std::ostream
&
Gaudi::Utils::toStream
(
const
Gaudi::XYZPoint
& obj,
std::ostream
&
s
) {
117
s
<<
"( "
;
118
toStream
( obj.X(),
s
);
119
s
<<
" , "
;
120
toStream
( obj.Y(),
s
);
121
s
<<
" , "
;
122
toStream
( obj.Z(),
s
);
123
s
<<
" )"
;
124
return
s
;
125
}
126
// ============================================================================
127
// print XYZ-vector
128
// ============================================================================
129
std::ostream
&
Gaudi::Utils::toStream
(
const
Gaudi::XYZVector
& obj,
std::ostream
&
s
) {
130
s
<<
"( "
;
131
toStream
( obj.X(),
s
);
132
s
<<
" , "
;
133
toStream
( obj.Y(),
s
);
134
s
<<
" , "
;
135
toStream
( obj.Z(),
s
);
136
s
<<
" )"
;
137
138
return
s
;
139
}
140
// ============================================================================
141
// print LorentzVector
142
// ============================================================================
143
std::ostream
&
Gaudi::Utils::toStream
(
const
Gaudi::LorentzVector
& obj,
std::ostream
&
s
) {
144
145
s
<<
"( "
;
146
toStream
( obj.Px(),
s
, 12 );
147
s
<<
" , "
;
148
toStream
( obj.Py(),
s
, 12 );
149
s
<<
" , "
;
150
toStream
( obj.Pz(),
s
, 13 );
151
s
<<
" , "
;
152
toStream
( obj.E(),
s
, 14 );
153
s
<<
" )"
;
154
155
return
s
;
156
}
157
// ============================================================================
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:348
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:581
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:64
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:299
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 Jul 28 2023 16:22:57 for The Gaudi Framework by
1.8.18