Belle II Software development
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
10using namespace Belle2;
11using namespace std;
12
14 m_trackIndexPositive(-1),
15 m_trackIndexNegative(-1),
16 m_trackFitResultIndexPositive(-1),
17 m_trackFitResultIndexNegative(-1),
18 m_fittedVertexX(0.0),
19 m_fittedVertexY(0.0),
20 m_fittedVertexZ(0.0)
21{}
22
23V0::V0(const std::pair<const Belle2::Track*, const Belle2::TrackFitResult*>& trackPairPositive,
24 const std::pair<const Belle2::Track*, const Belle2::TrackFitResult*>& trackPairNegative,
25 double vertexX, double vertexY, double vertexZ) :
26 m_trackIndexPositive(trackPairPositive.first->getArrayIndex()),
27 m_trackIndexNegative(trackPairNegative.first->getArrayIndex()),
28 m_trackFitResultIndexPositive(trackPairPositive.second->getArrayIndex()),
29 m_trackFitResultIndexNegative(trackPairNegative.second->getArrayIndex()),
30 m_fittedVertexX(vertexX),
31 m_fittedVertexY(vertexY),
32 m_fittedVertexZ(vertexZ)
33{}
34
36{
37 StoreArray<TrackFitResult> trackFitResults{};
38 const auto posParticleType = trackFitResults[m_trackFitResultIndexPositive]->getParticleType();
39 const auto negParticleType = trackFitResults[m_trackFitResultIndexNegative]->getParticleType();
40
41 if ((posParticleType == Const::pion) && (negParticleType == Const::pion)) {
42 return Const::Kshort;
43 }
44 if ((posParticleType == Const::proton) && (negParticleType == Const::pion)) {
45 return Const::Lambda;
46 }
47 if ((posParticleType == Const::pion) && (negParticleType == Const::proton)) {
48 return Const::antiLambda;
49 }
50 if ((posParticleType == Const::electron) && (negParticleType == Const::electron)) {
51 return Const::photon;
52 }
54}
The ParticleType class for identifying different particle types.
Definition: Const.h:408
static const ParticleType unspecifiedParticle
Unspecified particle, used when no other particle type fits.
Definition: Const.h:683
static const ParticleType Lambda
Lambda particle.
Definition: Const.h:679
static const ChargedStable pion
charged pion particle
Definition: Const.h:661
static const ParticleType antiLambda
Anti-Lambda particle.
Definition: Const.h:680
static const ChargedStable proton
proton particle
Definition: Const.h:663
static const ParticleType Kshort
K^0_S particle.
Definition: Const.h:677
static const ParticleType photon
photon particle
Definition: Const.h:673
static const ChargedStable electron
electron particle
Definition: Const.h:659
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:97
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:94
Const::ParticleType getV0Hypothesis() const
Get the hypothesis under which the V0 particle was created.
Definition: V0.cc:35
Abstract base class for different kinds of events.
STL namespace.