The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
MyTrack.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 MyTrack instances:" << count << std::endl;
21 }
22 };
23} // namespace
24static InstanceCount s_instances;
25
27MyTrack::MyTrack() : m_px( 0.0 ), m_py( 0.0 ), m_pz( 0.0 ) {
28 // m_event(this);
29 // m_originVertex(this);
30 // m_decayVertices(this);
31 s_instances.count++;
32}
33
35MyTrack::MyTrack( float x, float y, float z ) : m_px( x ), m_py( y ), m_pz( z ) {
36 // m_event(this);
37 // m_originVertex(this);
38 // m_decayVertices(this);
39 s_instances.count++;
40}
41
42MyTrack::MyTrack( const MyTrack& t ) : KeyedObject<int>( t.key() ), m_px( t.m_px ), m_py( t.m_py ), m_pz( t.m_pz ) {
43 s_instances.count++;
44}
45
47MyTrack::~MyTrack() { s_instances.count--; }
float m_px
The track momentum.
Definition MyTrack.h:66
MyTrack()
Standard constructor.
Definition MyTrack.cpp:27
~MyTrack() override
Standard Destructor.
Definition MyTrack.cpp:47
KeyedObject()=default
const key_type & key() const
Definition KeyedObject.h:76