Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v38r0 (2143aa4c)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ExtendedProperties2.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 // STD & STL
15 // ============================================================================
16 #include <map>
17 #include <string>
18 #include <utility>
19 #include <vector>
20 // ============================================================================
21 // GaudiKernel
22 // ============================================================================
28 // ============================================================================
31 // ============================================================================
32 // GaudiAlg
33 // ============================================================================
34 #include <Gaudi/Examples/TestAlg.h>
35 // ============================================================================
36 
43 // ============================================================================
44 namespace Gaudi {
45  // ==========================================================================
46  namespace Examples {
47  // ========================================================================
53  class ExtendedProperties2 : public TestAlg {
54  public:
55  // ======================================================================
56  StatusCode execute() override;
57  // ======================================================================
58  public:
59  // ======================================================================
65  setProperty( "PropertiesPrint", true ).ignore();
66  }
67  // ======================================================================
68  private:
69  // ======================================================================
70  Gaudi::Property<Gaudi::XYZPoint> m_point3D{ this, "Point3D", { 0, 1, 2 }, "3D-point" };
71  Gaudi::Property<Gaudi::XYZVector> m_vector3D{ this, "Vector3D", { 1, 2, 3 }, "3D-vector" };
72  Gaudi::Property<Gaudi::LorentzVector> m_vector4D{ this, "Vector4D", { 1, 2, 3, 4 }, "Lorentz-vector" };
73  Gaudi::Property<Gaudi::Vector5> m_vector5{ this, "SVector5", {}, "Generic-vector" };
74  Gaudi::Property<std::vector<Gaudi::XYZPoint>> m_points{ this, "Points3D", {}, "Vector of 3D-points" };
75  Gaudi::Property<std::vector<Gaudi::XYZVector>> m_vectors{ this, "Vectors3D", {}, "Vector of 3D-vectors" };
76  Gaudi::Property<std::vector<Gaudi::LorentzVector>> m_lvs{ this, "Vectors4D", {}, "Vector of 4D-vectors" };
77  // ======================================================================
78  };
79  // ========================================================================
80  } // namespace Examples
81  // ==========================================================================
82 } // end of namespace Gaudi
83 // ============================================================================
85  always() << "3D-Point : " << Gaudi::Utils::toString( m_point3D.value() ) << endmsg;
86  always() << "3D-Vector: " << Gaudi::Utils::toString( m_vector3D.value() ) << endmsg;
87  always() << "4D-Vector: " << Gaudi::Utils::toString( m_vector4D.value() ) << endmsg;
88  always() << " 5-Vector: " << Gaudi::Utils::toString( m_vector5.value() ) << endmsg;
89 
90  always() << "Vector of 3D-Points " << Gaudi::Utils::toString( m_points.value() ) << endmsg;
91  always() << "Vector of 3D-Vectors " << Gaudi::Utils::toString( m_vectors.value() ) << endmsg;
92  always() << "Vector of 4D-Vectors " << Gaudi::Utils::toString( m_lvs.value() ) << endmsg;
93 
94  return StatusCode::SUCCESS;
95 }
96 // ============================================================================
97 // the factory
98 // ============================================================================
101 // ============================================================================
102 // The END
103 // ============================================================================
VectorsAsProperty.h
Gaudi::Examples::ExtendedProperties2::m_point3D
Gaudi::Property< Gaudi::XYZPoint > m_point3D
Definition: ExtendedProperties2.cpp:70
std::string
STL class.
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:528
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:39
ISvcLocator
Definition: ISvcLocator.h:46
TestAlg.h
Gaudi::Examples::TestAlg
Simple algorithm useful as base class for tests.
Definition: TestAlg.h:19
Vector3DTypes.h
Gaudi::Examples::ExtendedProperties2::ExtendedProperties2
ExtendedProperties2(const std::string &name, ISvcLocator *pSvc)
standard constructor
Definition: ExtendedProperties2.cpp:64
Gaudi::Examples::ExtendedProperties2::m_vector3D
Gaudi::Property< Gaudi::XYZVector > m_vector3D
Definition: ExtendedProperties2.cpp:71
StatusCode
Definition: StatusCode.h:65
Gaudi::Examples::ExtendedProperties2::execute
StatusCode execute() override
Definition: ExtendedProperties2.cpp:84
Gaudi::Examples::ExtendedProperties2::m_vector4D
Gaudi::Property< Gaudi::LorentzVector > m_vector4D
Definition: ExtendedProperties2.cpp:72
GenericVectorTypes.h
SVectorAsProperty.h
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:239
Point3DTypes.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
Gaudi::Examples::ExtendedProperties2::m_vectors
Gaudi::Property< std::vector< Gaudi::XYZVector > > m_vectors
Definition: ExtendedProperties2.cpp:75
Gaudi::Examples::ExtendedProperties2::m_points
Gaudi::Property< std::vector< Gaudi::XYZPoint > > m_points
Definition: ExtendedProperties2.cpp:74
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:354
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Examples::ExtendedProperties2::m_vector5
Gaudi::Property< Gaudi::Vector5 > m_vector5
Definition: ExtendedProperties2.cpp:73
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
Vector4DTypes.h
Point4DTypes.h
ExtendedProperties2
Definition: ExtendedProperties2.py:1
Gaudi::Examples::ExtendedProperties2
Definition: ExtendedProperties2.cpp:53
Gaudi::Examples::ExtendedProperties2::m_lvs
Gaudi::Property< std::vector< Gaudi::LorentzVector > > m_lvs
Definition: ExtendedProperties2.cpp:76
Gaudi::Property< Gaudi::XYZPoint >