Belle II Software  release-08-01-10
TOPLikelihood.h
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 #pragma once
10 
11 #include <framework/datastore/RelationsObject.h>
12 #include <framework/gearbox/Const.h>
13 
14 namespace Belle2 {
26  class TOPLikelihood : public RelationsObject {
27 
28  public:
29 
34  {}
35 
40  void setFlag(int flag) {m_flag = flag;}
41 
50  void set(const Const::ChargedStable& part, int numPhot, double logL, double estPhot, double estBkg)
51  {
52  auto i = part.getIndex();
53  m_numPhot = numPhot;
54  m_logL[i] = logL;
55  m_estPhot[i] = estPhot;
56  m_estBkg = estBkg;
57  }
58 
63  int getFlag() const {return m_flag;}
64 
69  int getNphot() const {return m_numPhot;}
70 
76  float getLogL(const Const::ChargedStable& part) const
77  {
78  return m_logL[part.getIndex()];
79  }
80 
86  float getEstPhot(const Const::ChargedStable& part) const
87  {
88  return m_estPhot[part.getIndex()];
89  }
90 
95  float getEstBkg() const {return m_estBkg;}
96 
101  double getLogL_e() const {return m_logL[Const::electron.getIndex()];}
102 
107  double getLogL_mu() const {return m_logL[Const::muon.getIndex()];}
108 
113  double getLogL_pi() const {return m_logL[Const::pion.getIndex()];}
114 
119  double getLogL_K() const {return m_logL[Const::kaon.getIndex()];}
120 
125  double getLogL_p() const {return m_logL[Const::proton.getIndex()];}
126 
131  double getNphot_e() const {return m_estPhot[Const::electron.getIndex()];}
132 
137  double getNphot_mu() const {return m_estPhot[Const::muon.getIndex()];}
138 
143  double getNphot_pi() const {return m_estPhot[Const::pion.getIndex()];}
144 
149  double getNphot_K() const {return m_estPhot[Const::kaon.getIndex()];}
150 
155  double getNphot_p() const {return m_estPhot[Const::proton.getIndex()];}
156 
157  private:
158  int m_flag = 0;
159  int m_numPhot = 0;
162  float m_estBkg = 0;
166  };
167 
168 
170 } // end namespace Belle2
171 
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:580
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:606
int getIndex() const
This particle's index in the associated set.
Definition: Const.h:452
static const ChargedStable muon
muon particle
Definition: Const.h:651
static const ChargedStable pion
charged pion particle
Definition: Const.h:652
static const ChargedStable proton
proton particle
Definition: Const.h:654
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:653
static const ChargedStable electron
electron particle
Definition: Const.h:650
Defines interface for accessing relations of objects in StoreArray.
Class to store TOP log likelihoods (output of TOPReconstructor).
Definition: TOPLikelihood.h:26
float m_logL[Const::ChargedStable::c_SetSize]
log likelihoods
double getLogL_pi() const
Return pion log likelihood.
double getNphot_mu() const
Return number of expected photons for muon.
float getEstPhot(const Const::ChargedStable &part) const
Return estimated number of photons for a given particle.
Definition: TOPLikelihood.h:86
double getNphot_e() const
Return number of expected photons for electron.
double getNphot_pi() const
Return number of expected photons for pion.
void setFlag(int flag)
Sets reconstruction flag.
Definition: TOPLikelihood.h:40
ClassDef(TOPLikelihood, 2)
ClassDef.
double getNphot_p() const
Return number of expected photons for proton.
double getLogL_e() const
Return electron log likelihood.
double getNphot_K() const
Return number of expected photons for kaon.
void set(const Const::ChargedStable &part, int numPhot, double logL, double estPhot, double estBkg)
Sets other data members for a given particle hypothesis.
Definition: TOPLikelihood.h:50
double getLogL_p() const
Return proton log likelihood.
float getEstBkg() const
Return estimated number of background photons.
Definition: TOPLikelihood.h:95
int getFlag() const
Return reconstruction flag.
Definition: TOPLikelihood.h:63
float m_estBkg
estimated background
int m_numPhot
number of photons
double getLogL_mu() const
Return muon log likelihood.
int m_flag
reconstruction flag
float getLogL(const Const::ChargedStable &part) const
Return log likelihood for a given particle.
Definition: TOPLikelihood.h:76
TOPLikelihood()
default constructor
Definition: TOPLikelihood.h:33
double getLogL_K() const
Return kaon log likelihood.
int getNphot() const
Return number of detected photons.
Definition: TOPLikelihood.h:69
float m_estPhot[Const::ChargedStable::c_SetSize]
estimated number of photons
Abstract base class for different kinds of events.