The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
MyVertex.h
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#pragma once
12
18
19namespace Gaudi {
20 namespace TestSuite {
21 // Forward declarations
22 // class MyTrack;
23
24 // CLID definition
25 static const CLID& CLID_MyVertex = 1356;
26
33 class GAUDI_API MyVertex : public KeyedObject<int> {
34 protected:
36 float m_x, m_y, m_z;
45
46 public:
48 MyVertex();
50 MyVertex( float x, float y, float z );
52 ~MyVertex() override;
54 const CLID& clID() const override { return classID(); }
55 static const CLID& classID() { return CLID_MyVertex; }
57 float x() const { return m_x; }
59 float y() const { return m_y; }
61 float z() const { return m_z; }
63 void setX( float x ) { m_x = x; }
65 void setY( float y ) { m_y = y; }
67 void setZ( float z ) { m_z = z; }
68
70 const Event* event() const { return m_event; }
72 void setEvent( Event* evt ) { m_event = evt; }
74 const MyTrack* motherParticle() const;
75
77 void setMotherParticle( MyTrack* mother );
78
80 const SmartRefVector<MyTrack>& decayParticles() const;
81
83 void addDecayParticle( MyTrack* track );
84
86 void removeDecayParticle( MyTrack* vtx );
87
89 const SmartRefVector<Collision>& collisions() const;
90
92 void addCollision( Collision* vtx );
93
95 void removeCollision( Collision* vtx );
96
98 StreamBuffer& serialize( StreamBuffer& s ) const override;
100 StreamBuffer& serialize( StreamBuffer& s ) override;
101 };
102
103 // Definition of all container types of MCParticle
105
107 inline const MyTrack* MyVertex::motherParticle() const { return m_motherParticle; }
108
110 inline void MyVertex::setMotherParticle( MyTrack* mother ) { m_motherParticle = mother; }
111
114
117
120 SmartRefVector<MyTrack>::iterator i;
121 for ( i = m_decayParticles.begin(); i != m_decayParticles.end(); ++i ) {
122 if ( i->target() == p ) {
123 m_decayParticles.erase( i );
124 return;
125 }
126 }
127 }
128
131
133 inline void MyVertex::addCollision( Collision* c ) { m_collisions.push_back( SmartRef<Collision>( c ) ); }
134
137 SmartRefVector<Collision>::iterator i;
138 for ( i = m_collisions.begin(); i != m_collisions.end(); ++i ) {
139 if ( i->target() == c ) {
140 m_collisions.erase( i );
141 return;
142 }
143 }
144 }
145 } // namespace TestSuite
146} // namespace Gaudi
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
#define GAUDI_API
Definition Kernel.h:49
Essential information of the event used in examples It can be identified by "/Event".
Definition Event.h:37
void setEvent(Event *evt)
Access to event object.
Definition MyVertex.h:72
void addDecayParticle(MyTrack *track)
Add decay particle.
Definition MyVertex.h:116
MyVertex()
Standard constructor.
Definition MyVertex.cpp:27
void addCollision(Collision *vtx)
Add collision.
Definition MyVertex.h:133
const MyTrack * motherParticle() const
Mother track.
Definition MyVertex.h:107
float y() const
Accessors: Retrieve y-component of the track momentum.
Definition MyVertex.h:59
const SmartRefVector< MyTrack > & decayParticles() const
Access to decay particles.
Definition MyVertex.h:113
SmartRef< Event > m_event
Link to Top level event.
Definition MyVertex.h:38
void setZ(float z)
Accessors: Update z-component of the track momentum.
Definition MyVertex.h:67
void removeDecayParticle(MyTrack *vtx)
Remove decay vertex.
Definition MyVertex.h:119
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
float z() const
Accessors: Retrieve z-component of the track momentum.
Definition MyVertex.h:61
void setX(float x)
Accessors: Update x-component of the track momentum.
Definition MyVertex.h:63
void setY(float y)
Accessors: Update y-component of the track momentum.
Definition MyVertex.h:65
void removeCollision(Collision *vtx)
Remove collision.
Definition MyVertex.h:136
void setMotherParticle(MyTrack *mother)
Set mother track.
Definition MyVertex.h:110
SmartRefVector< MyTrack > m_decayParticles
Links to all daughter particles.
Definition MyVertex.h:42
const CLID & clID() const override
Retrieve pointer to class definition structure.
Definition MyVertex.h:54
const Event * event() const
Access to the source track object (constant case)
Definition MyVertex.h:70
SmartRefVector< Collision > m_collisions
Vector of collisions this object belongs to.
Definition MyVertex.h:44
const SmartRefVector< Collision > & collisions() const
Access to collisions.
Definition MyVertex.h:130
static const CLID & classID()
Definition MyVertex.h:55
SmartRef< MyTrack > m_motherParticle
Link to mother track.
Definition MyVertex.h:40
template class KeyedContainer, KeyedContainer.h
KeyedObject()=default
Kernel objects: SmartRef.
Definition SmartRef.h:64
Kernel objects: SmartRefVector.
The stream buffer is a small object collecting object data.
KeyedContainer< MyVertex > MyVertexVector
Definition MyVertex.h:104
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1