The Gaudi Framework
master (57817a18)
Toggle main menu visibility
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
13
#include <
GaudiKernel/KeyedContainer.h
>
14
#include <
GaudiKernel/KeyedObject.h
>
15
#include <
GaudiKernel/SmartRefVector.h
>
16
#include <
GaudiTestSuite/Event.h
>
17
#include <
GaudiTestSuite/MyTrack.h
>
18
19
namespace
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
;
38
SmartRef<Event>
m_event
;
40
SmartRef<MyTrack>
m_motherParticle
;
42
SmartRefVector<MyTrack>
m_decayParticles
;
44
SmartRefVector<Collision>
m_collisions
;
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
104
typedef
KeyedContainer<MyVertex>
MyVertexVector
;
105
107
inline
const
MyTrack
*
MyVertex::motherParticle
()
const
{
return
m_motherParticle
; }
108
110
inline
void
MyVertex::setMotherParticle
(
MyTrack
* mother ) {
m_motherParticle
= mother; }
111
113
inline
const
SmartRefVector<MyTrack>
&
MyVertex::decayParticles
()
const
{
return
m_decayParticles
; }
114
116
inline
void
MyVertex::addDecayParticle
(
MyTrack
* p ) {
m_decayParticles
.push_back(
SmartRef<MyTrack>
( p ) ); }
117
119
inline
void
MyVertex::removeDecayParticle
(
MyTrack
* p ) {
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
130
inline
const
SmartRefVector<Collision>
&
MyVertex::collisions
()
const
{
return
m_collisions
; }
131
133
inline
void
MyVertex::addCollision
(
Collision
* c ) {
m_collisions
.push_back(
SmartRef<Collision>
( c ) ); }
134
136
inline
void
MyVertex::removeCollision
(
Collision
* c ) {
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
CLID
unsigned int CLID
Class ID definition.
Definition
ClassID.h:16
Event.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
KeyedContainer.h
KeyedObject.h
MyTrack.h
SmartRefVector.h
Gaudi::TestSuite::Collision
Definition
Collision.h:26
Gaudi::TestSuite::Event
Essential information of the event used in examples It can be identified by "/Event".
Definition
Event.h:37
Gaudi::TestSuite::MyTrack
Definition
MyTrack.h:45
Gaudi::TestSuite::MyVertex::setEvent
void setEvent(Event *evt)
Access to event object.
Definition
MyVertex.h:72
Gaudi::TestSuite::MyVertex::addDecayParticle
void addDecayParticle(MyTrack *track)
Add decay particle.
Definition
MyVertex.h:116
Gaudi::TestSuite::MyVertex::MyVertex
MyVertex()
Standard constructor.
Definition
MyVertex.cpp:27
Gaudi::TestSuite::MyVertex::addCollision
void addCollision(Collision *vtx)
Add collision.
Definition
MyVertex.h:133
Gaudi::TestSuite::MyVertex::motherParticle
const MyTrack * motherParticle() const
Mother track.
Definition
MyVertex.h:107
Gaudi::TestSuite::MyVertex::m_y
float m_y
Definition
MyVertex.h:36
Gaudi::TestSuite::MyVertex::y
float y() const
Accessors: Retrieve y-component of the track momentum.
Definition
MyVertex.h:59
Gaudi::TestSuite::MyVertex::decayParticles
const SmartRefVector< MyTrack > & decayParticles() const
Access to decay particles.
Definition
MyVertex.h:113
Gaudi::TestSuite::MyVertex::m_event
SmartRef< Event > m_event
Link to Top level event.
Definition
MyVertex.h:38
Gaudi::TestSuite::MyVertex::setZ
void setZ(float z)
Accessors: Update z-component of the track momentum.
Definition
MyVertex.h:67
Gaudi::TestSuite::MyVertex::removeDecayParticle
void removeDecayParticle(MyTrack *vtx)
Remove decay vertex.
Definition
MyVertex.h:119
Gaudi::TestSuite::MyVertex::m_x
float m_x
The vertex location.
Definition
MyVertex.h:36
Gaudi::TestSuite::MyVertex::x
float x() const
Accessors: Retrieve x-component of the track momentum.
Definition
MyVertex.h:57
Gaudi::TestSuite::MyVertex::z
float z() const
Accessors: Retrieve z-component of the track momentum.
Definition
MyVertex.h:61
Gaudi::TestSuite::MyVertex::setX
void setX(float x)
Accessors: Update x-component of the track momentum.
Definition
MyVertex.h:63
Gaudi::TestSuite::MyVertex::setY
void setY(float y)
Accessors: Update y-component of the track momentum.
Definition
MyVertex.h:65
Gaudi::TestSuite::MyVertex::removeCollision
void removeCollision(Collision *vtx)
Remove collision.
Definition
MyVertex.h:136
Gaudi::TestSuite::MyVertex::setMotherParticle
void setMotherParticle(MyTrack *mother)
Set mother track.
Definition
MyVertex.h:110
Gaudi::TestSuite::MyVertex::m_decayParticles
SmartRefVector< MyTrack > m_decayParticles
Links to all daughter particles.
Definition
MyVertex.h:42
Gaudi::TestSuite::MyVertex::m_z
float m_z
Definition
MyVertex.h:36
Gaudi::TestSuite::MyVertex::clID
const CLID & clID() const override
Retrieve pointer to class definition structure.
Definition
MyVertex.h:54
Gaudi::TestSuite::MyVertex::event
const Event * event() const
Access to the source track object (constant case).
Definition
MyVertex.h:70
Gaudi::TestSuite::MyVertex::m_collisions
SmartRefVector< Collision > m_collisions
Vector of collisions this object belongs to.
Definition
MyVertex.h:44
Gaudi::TestSuite::MyVertex::collisions
const SmartRefVector< Collision > & collisions() const
Access to collisions.
Definition
MyVertex.h:130
Gaudi::TestSuite::MyVertex::classID
static const CLID & classID()
Definition
MyVertex.h:55
Gaudi::TestSuite::MyVertex::m_motherParticle
SmartRef< MyTrack > m_motherParticle
Link to mother track.
Definition
MyVertex.h:40
KeyedContainer
template class KeyedContainer, KeyedContainer.h
Definition
KeyedContainer.h:61
KeyedObject< int >::KeyedObject
KeyedObject()=default
SmartRef
Kernel objects: SmartRef.
Definition
SmartRef.h:64
SmartRefVector
Kernel objects: SmartRefVector.
Definition
SmartRefVector.h:66
StreamBuffer
The stream buffer is a small object collecting object data.
Definition
StreamBuffer.h:48
Gaudi::TestSuite
Definition
ConditionAccessorHolder.h:21
Gaudi::TestSuite::MyVertexVector
KeyedContainer< MyVertex > MyVertexVector
Definition
MyVertex.h:104
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
GaudiTestSuite
include
GaudiTestSuite
MyVertex.h
Generated on
for The Gaudi Framework by
1.17.0