Belle II Software development
CDCDedxLikelihood.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#include <cmath>
15
16namespace Belle2 {
24 public:
27 {
28 //for all particles
29 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++)
30 m_cdcLogl[i] = 0.0;
31 }
32
34 explicit CDCDedxLikelihood(const double* cdcLogl): RelationsObject()
35 {
36 //for all particles
37 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++)
38 m_cdcLogl[i] = cdcLogl[i];
39 }
40
49 double getLogL(const Const::ChargedStable& type) const { return m_cdcLogl[type.getIndex()]; }
50
52 double getCDCLikelihood(const Const::ChargedStable& type) const { return exp((double)m_cdcLogl[type.getIndex()]); }
53
54 private:
58 };
60}
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
double getCDCLikelihood(const Const::ChargedStable &type) const
returns exp(getCDCLikelihood(type)) with sufficient precision.
CDCDedxLikelihood(const double *cdcLogl)
actually const double (&logl)[Const::ChargedStable::c_SetSize], but CINT complains.
ClassDef(CDCDedxLikelihood, 1)
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
double getLogL(const Const::ChargedStable &type) const
returns unnormalised log-likelihood value for a particle hypothesis using CDC information.
CDCDedxLikelihood()
default constructor
double m_cdcLogl[Const::ChargedStable::c_SetSize]
CDC log likelihood for each particle, not including momentum prior.
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:589
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:615
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.