The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
ExtendedProperties2.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 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
// STD & STL
15
// ============================================================================
16
#include <map>
17
#include <string>
18
#include <utility>
19
#include <vector>
20
// ============================================================================
21
// GaudiKernel
22
// ============================================================================
23
#include <
GaudiKernel/GenericVectorTypes.h
>
24
#include <
GaudiKernel/Point3DTypes.h
>
25
#include <
GaudiKernel/Point4DTypes.h
>
26
#include <
GaudiKernel/Vector3DTypes.h
>
27
#include <
GaudiKernel/Vector4DTypes.h
>
28
// ============================================================================
29
#include <
GaudiKernel/SVectorAsProperty.h
>
30
#include <
GaudiKernel/VectorsAsProperty.h
>
31
// ============================================================================
32
#include <
Gaudi/TestSuite/TestAlg.h
>
33
// ============================================================================
34
41
// ============================================================================
42
namespace
Gaudi
{
43
// ==========================================================================
44
namespace
TestSuite
{
45
// ========================================================================
51
class
ExtendedProperties2
:
public
TestAlg
{
52
public
:
53
// ======================================================================
54
StatusCode
execute
()
override
;
55
// ======================================================================
56
public
:
57
// ======================================================================
62
ExtendedProperties2
(
const
std::string&
name
,
ISvcLocator
* pSvc ) :
TestAlg
(
name
, pSvc ) {
63
setProperty
(
"PropertiesPrint"
,
true
).ignore();
64
}
65
// ======================================================================
66
private
:
67
// ======================================================================
68
Gaudi::Property<Gaudi::XYZPoint>
m_point3D
{
this
,
"Point3D"
, { 0, 1, 2 },
"3D-point"
};
69
Gaudi::Property<Gaudi::XYZVector>
m_vector3D
{
this
,
"Vector3D"
, { 1, 2, 3 },
"3D-vector"
};
70
Gaudi::Property<Gaudi::LorentzVector>
m_vector4D
{
this
,
"Vector4D"
, { 1, 2, 3, 4 },
"Lorentz-vector"
};
71
Gaudi::Property<Gaudi::Vector5>
m_vector5
{
this
,
"SVector5"
, {},
"Generic-vector"
};
72
Gaudi::Property<std::vector<Gaudi::XYZPoint>
>
m_points
{
this
,
"Points3D"
, {},
"Vector of 3D-points"
};
73
Gaudi::Property<std::vector<Gaudi::XYZVector>
>
m_vectors
{
this
,
"Vectors3D"
, {},
"Vector of 3D-vectors"
};
74
Gaudi::Property<std::vector<Gaudi::LorentzVector>
>
m_lvs
{
this
,
"Vectors4D"
, {},
"Vector of 4D-vectors"
};
75
// ======================================================================
76
};
77
// ========================================================================
78
}
// namespace TestSuite
79
// ==========================================================================
80
}
// end of namespace Gaudi
81
// ============================================================================
82
StatusCode
Gaudi::TestSuite::ExtendedProperties2::execute
() {
83
always
() <<
"3D-Point : "
<<
Gaudi::Utils::toString
(
m_point3D
.value() ) <<
endmsg
;
84
always
() <<
"3D-Vector: "
<<
Gaudi::Utils::toString
(
m_vector3D
.value() ) <<
endmsg
;
85
always
() <<
"4D-Vector: "
<<
Gaudi::Utils::toString
(
m_vector4D
.value() ) <<
endmsg
;
86
always
() <<
" 5-Vector: "
<<
Gaudi::Utils::toString
(
m_vector5
.value() ) <<
endmsg
;
87
88
always
() <<
"Vector of 3D-Points "
<<
Gaudi::Utils::toString
(
m_points
.value() ) <<
endmsg
;
89
always
() <<
"Vector of 3D-Vectors "
<<
Gaudi::Utils::toString
(
m_vectors
.value() ) <<
endmsg
;
90
always
() <<
"Vector of 4D-Vectors "
<<
Gaudi::Utils::toString
(
m_lvs
.value() ) <<
endmsg
;
91
92
return
StatusCode::SUCCESS
;
93
}
94
// ============================================================================
95
// the factory
96
// ============================================================================
97
using
Gaudi::TestSuite::ExtendedProperties2
;
98
DECLARE_COMPONENT
(
ExtendedProperties2
)
99
// ============================================================================
100
// The END
101
// ============================================================================
setProperty
bool PyHelper setProperty(IInterface *p, char *name, char *value)
Definition
Bootstrap.cpp:211
GenericVectorTypes.h
General vectors.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
Point3DTypes.h
3D point typedefs
Point4DTypes.h
4D point typedefs
SVectorAsProperty.h
Declaration of parsing functions for generic vectors to allow their usage as properties for Gaudi com...
TestAlg.h
Vector3DTypes.h
Vector4DTypes.h
VectorsAsProperty.h
Declaration of parsing functions for various ROOT::Math objects to allow their usage as properties fo...
CommonMessagingBase::always
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Definition
CommonMessaging.h:100
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition
Algorithm.cpp:518
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
Gaudi::TestSuite::ExtendedProperties2
simple DEMO-file for "extended vector properties",
Definition
ExtendedProperties2.cpp:51
Gaudi::TestSuite::ExtendedProperties2::ExtendedProperties2
ExtendedProperties2(const std::string &name, ISvcLocator *pSvc)
standard constructor
Definition
ExtendedProperties2.cpp:62
Gaudi::TestSuite::ExtendedProperties2::m_vector4D
Gaudi::Property< Gaudi::LorentzVector > m_vector4D
Definition
ExtendedProperties2.cpp:70
Gaudi::TestSuite::ExtendedProperties2::m_vector5
Gaudi::Property< Gaudi::Vector5 > m_vector5
Definition
ExtendedProperties2.cpp:71
Gaudi::TestSuite::ExtendedProperties2::m_vector3D
Gaudi::Property< Gaudi::XYZVector > m_vector3D
Definition
ExtendedProperties2.cpp:69
Gaudi::TestSuite::ExtendedProperties2::m_vectors
Gaudi::Property< std::vector< Gaudi::XYZVector > > m_vectors
Definition
ExtendedProperties2.cpp:73
Gaudi::TestSuite::ExtendedProperties2::m_points
Gaudi::Property< std::vector< Gaudi::XYZPoint > > m_points
Definition
ExtendedProperties2.cpp:72
Gaudi::TestSuite::ExtendedProperties2::m_lvs
Gaudi::Property< std::vector< Gaudi::LorentzVector > > m_lvs
Definition
ExtendedProperties2.cpp:74
Gaudi::TestSuite::ExtendedProperties2::execute
StatusCode execute() override
Definition
ExtendedProperties2.cpp:82
Gaudi::TestSuite::ExtendedProperties2::m_point3D
Gaudi::Property< Gaudi::XYZPoint > m_point3D
Definition
ExtendedProperties2.cpp:68
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
ExtendedProperties2
Definition
ExtendedProperties2.py:1
Gaudi::TestSuite
Definition
ConditionAccessorHolder.h:21
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition
ToStream.h:329
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
Gaudi::TestSuite::TestAlg
Simple algorithm useful as base class for tests.
Definition
TestAlg.h:19
TestAlg
Simple algorithm useful as base class for tests.
Definition
TestAlg.h:19
GaudiTestSuite
src
ExtendedProperties
ExtendedProperties2.cpp
Generated on
for The Gaudi Framework by
1.17.0