The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
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
13using namespace Gaudi::TestSuite;
14
15namespace {
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
24static InstanceCount s_instances;
25
27MyVertex::MyVertex() : m_x( 0.0 ), m_y( 0.0 ), m_z( 0.0 ) { s_instances.count++; }
28
30MyVertex::MyVertex( float x, float y, float z ) : m_x( x ), m_y( y ), m_z( z ) { s_instances.count++; }
31
33MyVertex::~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}
MyVertex()
Standard constructor.
Definition MyVertex.cpp:27
float y() const
Accessors: Retrieve y-component of the track momentum.
Definition MyVertex.h:59
SmartRef< Event > m_event
Link to Top level event.
Definition MyVertex.h:38
float m_x
The vertex location.
Definition MyVertex.h:36
float x() const
Accessors: Retrieve x-component of the track momentum.
Definition MyVertex.h:57
~MyVertex() override
Standard Destructor.
Definition MyVertex.cpp:33
float z() const
Accessors: Retrieve z-component of the track momentum.
Definition MyVertex.h:61
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.
Definition MyVertex.cpp:36
SmartRefVector< MyTrack > m_decayParticles
Links to all daughter particles.
Definition MyVertex.h:42
SmartRefVector< Collision > m_collisions
Vector of collisions this object belongs to.
Definition MyVertex.h:44
SmartRef< MyTrack > m_motherParticle
Link to mother track.
Definition MyVertex.h:40
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.
The stream buffer is a small object collecting object data.