Belle II Software  release-06-02-00
BEvent.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include "masterclass/dataobjects/BEvent.h"
10 
12  m_evno{0},
13  m_nprt{0}
14 {
15  m_particles = new TClonesArray("BParticle", 500);
16 }
17 
19 {
20  delete m_particles;
21 }
22 
23 void BEvent::EventNo(int evt)
24 {
25  m_evno = evt;
26 }
27 
29 {
30  return m_evno;
31 }
32 
33 void BEvent::AddTrack(float px, float py, float pz, float e,
34  float charge, SIMPLEPID pid)
35 {
36  const TClonesArray& particles = *m_particles;
37  new(particles[m_nprt++]) BParticle(px, py, pz, e, charge, pid);
38 }
39 
41 {
42  return m_nprt;
43 }
44 
45 TClonesArray* BEvent::GetParticleList()
46 {
47  return m_particles;
48 }
49 
50 void BEvent::Clear(Option_t*)
51 {
52  m_particles->Clear();
53  m_nprt = 0;
54 }
55 
virtual void Clear(Option_t *="")
Clear the array of particles.
Definition: BEvent.cc:50
TClonesArray * GetParticleList()
Get the array of particles in the event.
Definition: BEvent.cc:45
int EventNo()
Get the current event number.
Definition: BEvent.cc:28
TClonesArray * m_particles
array of particles
Definition: BEvent.h:23
void AddTrack(float px, float py, float pz, float e, float charge, SIMPLEPID pid)
Add the track to the event.
Definition: BEvent.cc:33
int m_nprt
number of particles in the event
Definition: BEvent.h:22
~BEvent()
Default destructor.
Definition: BEvent.cc:18
int NParticles()
Get the number of particles in the event.
Definition: BEvent.cc:40
BEvent()
Default constructor.
Definition: BEvent.cc:11
int m_evno
current event number
Definition: BEvent.h:21
The Class for Masterclass particle information This class provides the data structure of the particle...
Definition: BParticle.h:18