The Gaudi Framework  master (37c0b60a)
MyVertex.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 \***********************************************************************************/
12 
13 using namespace Gaudi::TestSuite;
14 
15 namespace {
16  struct InstanceCount {
17  long count;
18  InstanceCount() : count( 0 ) {}
19  ~InstanceCount() {
20  if ( count ) std::cout << "Number of MyVertex instances:" << count << std::endl;
21  }
22  };
23 } // namespace
24 static InstanceCount s_instances;
25 
27 MyVertex::MyVertex() : m_x( 0.0 ), m_y( 0.0 ), m_z( 0.0 ) { s_instances.count++; }
28 
30 MyVertex::MyVertex( float x, float y, float z ) : m_x( x ), m_y( y ), m_z( z ) { s_instances.count++; }
31 
33 MyVertex::~MyVertex() { s_instances.count--; }
34 
38  s << m_motherParticle( this );
39  s << m_decayParticles( this );
40  s << m_event( this );
41  s << m_collisions( this );
42  s << m_x << m_y << m_z;
43  return s;
44 }
45 
49  s >> m_motherParticle( this );
50  s >> m_decayParticles( this );
51  s >> m_event( this );
52  s >> m_collisions( this );
53  s >> m_x >> m_y >> m_z;
54  return s;
55 }
KeyedObject::serialize
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.
Definition: KeyedObject.h:143
Gaudi::TestSuite::MyVertex::MyVertex
MyVertex()
Standard constructor.
Definition: MyVertex.cpp:27
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::TestSuite::MyVertex::m_x
float m_x
The vertex location.
Definition: MyVertex.h:36
Gaudi::TestSuite::MyVertex::m_z
float m_z
Definition: MyVertex.h:36
Gaudi::TestSuite::MyVertex::m_event
SmartRef< Event > m_event
Link to Top level event.
Definition: MyVertex.h:38
StreamBuffer
Definition: StreamBuffer.h:52
std::cout
Gaudi::TestSuite::MyVertex::~MyVertex
~MyVertex() override
Standard Destructor.
Definition: MyVertex.cpp:33
Gaudi::TestSuite
Definition: ConditionAccessorHolder.h:21
Gaudi::TestSuite::MyVertex::m_motherParticle
SmartRef< MyTrack > m_motherParticle
Link to mother track.
Definition: MyVertex.h:40
Gaudi::TestSuite::MyVertex::m_collisions
SmartRefVector< Collision > m_collisions
Vector of collisions this object belongs to.
Definition: MyVertex.h:44
std::endl
T endl(T... args)
MyVertex.h
std::count
T count(T... args)
Gaudi::TestSuite::MyVertex::serialize
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.
Definition: MyVertex.cpp:36
Gaudi::TestSuite::MyVertex::m_decayParticles
SmartRefVector< MyTrack > m_decayParticles
Links to all daughter particles.
Definition: MyVertex.h:42
Gaudi::TestSuite::MyVertex::m_y
float m_y
Definition: MyVertex.h:36