Belle II Software  release-08-01-10
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 #include <iostream>
11 
13  m_evno{0},
14  m_nprt{0}
15 {
16  m_particles = new TClonesArray("BParticle", 500);
17 }
18 
20 {
21  delete m_particles;
22 }
23 
24 void BEvent::EventNo(int evt)
25 {
26  m_evno = evt;
27 }
28 
30 {
31  return m_evno;
32 }
33 
34 void BEvent::AddTrack(float px, float py, float pz, float e,
35  float charge, SIMPLEPID pid)
36 {
37  new ((*m_particles)[m_nprt++]) BParticle(px, py, pz, e, charge, pid);
38 }
39 
40 void BEvent::AddTrack(float px, float py, float pz, float e,
41  float charge, SIMPLEPID pid,
42  float logL_e, float logL_mu, float logL_pi, float logL_k, float logL_p, float logL_d)
43 {
44  new ((*m_particles)[m_nprt++]) BParticle(px, py, pz, e, charge, pid, logL_e, logL_mu, logL_pi, logL_k, logL_p, logL_d);
45 }
46 
48 {
49  return m_nprt;
50 }
51 
52 TClonesArray* BEvent::GetParticleList()
53 {
54  return m_particles;
55 }
56 
57 void BEvent::Clear(Option_t*)
58 {
59  m_particles->Clear();
60  m_nprt = 0;
61 }
62 
virtual void Clear(Option_t *="")
Clear the array of particles.
Definition: BEvent.cc:57
TClonesArray * GetParticleList()
Get the array of particles in the event.
Definition: BEvent.cc:52
int EventNo()
Get the current event number.
Definition: BEvent.cc:29
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:34
int m_nprt
number of particles in the event
Definition: BEvent.h:22
~BEvent()
Default destructor.
Definition: BEvent.cc:19
int NParticles()
Get the number of particles in the event.
Definition: BEvent.cc:47
BEvent()
Default constructor.
Definition: BEvent.cc:12
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