Belle II Software  release-05-02-19
V0.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Heck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <mdst/dataobjects/V0.h>
11 
12 using namespace Belle2;
13 using namespace std;
14 
16  m_trackIndexPositive(-1),
17  m_trackIndexNegative(-1),
18  m_trackFitResultIndexPositive(-1),
19  m_trackFitResultIndexNegative(-1)
20 {}
21 
22 V0::V0(const std::pair<const Belle2::Track*, const Belle2::TrackFitResult*>& trackPairPositive,
23  const std::pair<const Belle2::Track*, const Belle2::TrackFitResult*>& trackPairNegative) :
24  m_trackIndexPositive(trackPairPositive.first->getArrayIndex()),
25  m_trackIndexNegative(trackPairNegative.first->getArrayIndex()),
26  m_trackFitResultIndexPositive(trackPairPositive.second->getArrayIndex()),
27  m_trackFitResultIndexNegative(trackPairNegative.second->getArrayIndex())
28 {}
29 
31 {
32  StoreArray<TrackFitResult> trackFitResults;
33  const auto posParticleType = trackFitResults[m_trackFitResultIndexPositive]->getParticleType();
34  const auto negParticleType = trackFitResults[m_trackFitResultIndexNegative]->getParticleType();
35 
36  if ((posParticleType == Const::pion) && (negParticleType == Const::pion)) {
37  return Const::Kshort;
38  }
39  if ((posParticleType == Const::proton) && (negParticleType == Const::pion)) {
40  return Const::Lambda;
41  }
42  if ((posParticleType == Const::pion) && (negParticleType == Const::proton)) {
43  return Const::antiLambda;
44  }
45  if ((posParticleType == Const::electron) && (negParticleType == Const::electron)) {
46  return Const::photon;
47  }
49 }
Belle2::Const::photon
static const ParticleType photon
photon particle
Definition: Const.h:547
Belle2::Const::unspecifiedParticle
static const ParticleType unspecifiedParticle
Unspecified particle, used when no other particle type fits.
Definition: Const.h:556
Belle2::Const::Kshort
static const ParticleType Kshort
K^0_S particle.
Definition: Const.h:550
Belle2::Const::electron
static const ChargedStable electron
electron particle
Definition: Const.h:533
Belle2::V0::V0
V0()
Constructor without arguments; needed for I/O.
Definition: V0.cc:15
Belle2::V0::m_trackFitResultIndexNegative
short m_trackFitResultIndexNegative
Points to the new TrackFitResult of the positive Track.
Definition: V0.h:90
Belle2::Const::pion
static const ChargedStable pion
charged pion particle
Definition: Const.h:535
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Const::antiLambda
static const ParticleType antiLambda
Anti-Lambda particle.
Definition: Const.h:553
Belle2::Const::ParticleType
The ParticleType class for identifying different particle types.
Definition: Const.h:284
Belle2::Const::proton
static const ChargedStable proton
proton particle
Definition: Const.h:537
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::V0::m_trackFitResultIndexPositive
short m_trackFitResultIndexPositive
Points to the new TrackFitResult of the positive Track.
Definition: V0.h:87
Belle2::V0::getV0Hypothesis
Const::ParticleType getV0Hypothesis() const
Get the hypothesis under which the V0 particle was created.
Definition: V0.cc:30
Belle2::Const::Lambda
static const ParticleType Lambda
Lambda particle.
Definition: Const.h:552