Belle II Software  release-06-01-15
V0.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 #include <mdst/dataobjects/V0.h>
9 
10 using namespace Belle2;
11 using namespace std;
12 
14  m_trackIndexPositive(-1),
15  m_trackIndexNegative(-1),
16  m_trackFitResultIndexPositive(-1),
17  m_trackFitResultIndexNegative(-1)
18 {}
19 
20 V0::V0(const std::pair<const Belle2::Track*, const Belle2::TrackFitResult*>& trackPairPositive,
21  const std::pair<const Belle2::Track*, const Belle2::TrackFitResult*>& trackPairNegative) :
22  m_trackIndexPositive(trackPairPositive.first->getArrayIndex()),
23  m_trackIndexNegative(trackPairNegative.first->getArrayIndex()),
24  m_trackFitResultIndexPositive(trackPairPositive.second->getArrayIndex()),
25  m_trackFitResultIndexNegative(trackPairNegative.second->getArrayIndex())
26 {}
27 
29 {
30  StoreArray<TrackFitResult> trackFitResults{};
31  const auto posParticleType = trackFitResults[m_trackFitResultIndexPositive]->getParticleType();
32  const auto negParticleType = trackFitResults[m_trackFitResultIndexNegative]->getParticleType();
33 
34  if ((posParticleType == Const::pion) && (negParticleType == Const::pion)) {
35  return Const::Kshort;
36  }
37  if ((posParticleType == Const::proton) && (negParticleType == Const::pion)) {
38  return Const::Lambda;
39  }
40  if ((posParticleType == Const::pion) && (negParticleType == Const::proton)) {
41  return Const::antiLambda;
42  }
43  if ((posParticleType == Const::electron) && (negParticleType == Const::electron)) {
44  return Const::photon;
45  }
47 }
The ParticleType class for identifying different particle types.
Definition: Const.h:289
static const ParticleType unspecifiedParticle
Unspecified particle, used when no other particle type fits.
Definition: Const.h:563
static const ParticleType Lambda
Lambda particle.
Definition: Const.h:559
static const ChargedStable pion
charged pion particle
Definition: Const.h:542
static const ParticleType antiLambda
Anti-Lambda particle.
Definition: Const.h:560
static const ChargedStable proton
proton particle
Definition: Const.h:544
static const ParticleType Kshort
K^0_S particle.
Definition: Const.h:557
static const ParticleType photon
photon particle
Definition: Const.h:554
static const ChargedStable electron
electron particle
Definition: Const.h:540
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
short m_trackFitResultIndexNegative
Points to the new TrackFitResult of the positive Track.
Definition: V0.h:80
V0()
Constructor without arguments; needed for I/O.
Definition: V0.cc:13
short m_trackFitResultIndexPositive
Points to the new TrackFitResult of the positive Track.
Definition: V0.h:77
Const::ParticleType getV0Hypothesis() const
Get the hypothesis under which the V0 particle was created.
Definition: V0.cc:28
Abstract base class for different kinds of events.