The Gaudi Framework  master (37c0b60a)
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 \***********************************************************************************/
11 #include <GaudiTestSuite/MyTrack.h>
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 MyTrack instances:" << count << std::endl;
21  }
22  };
23 } // namespace
24 static InstanceCount s_instances;
25 
27 MyTrack::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 
35 MyTrack::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 
42 MyTrack::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 
47 MyTrack::~MyTrack() { s_instances.count--; }
MyTrack.h
Gaudi::TestSuite::MyTrack
Definition: MyTrack.h:45
Gaudi::TestSuite::MyTrack::MyTrack
MyTrack()
Standard constructor.
Definition: MyTrack.cpp:27
bug_34121.t
t
Definition: bug_34121.py:31
std::cout
KeyedObject
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:39
Gaudi::TestSuite
Definition: ConditionAccessorHolder.h:21
Gaudi::TestSuite::MyTrack::~MyTrack
~MyTrack() override
Standard Destructor.
Definition: MyTrack.cpp:47
std::endl
T endl(T... args)
std::count
T count(T... args)
ProduceConsume.key
key
Definition: ProduceConsume.py:84