Belle II Software  release-05-02-19
CDCDedxLikelihood.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jake Bennett, Christian Pulvermacher
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef CDCDEDXLIKELIHOOD_H
12 #define CDCDEDXLIKELIHOOD_H
13 
14 #include <framework/datastore/RelationsObject.h>
15 #include <framework/gearbox/Const.h>
16 
17 #include <cmath>
18 
19 namespace Belle2 {
26  class CDCDedxLikelihood : public RelationsObject {
27  public:
30  {
31  //for all particles
32  for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++)
33  m_cdcLogl[i] = 0.0;
34  }
35 
37  explicit CDCDedxLikelihood(const double* cdcLogl): RelationsObject()
38  {
39  //for all particles
40  for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++)
41  m_cdcLogl[i] = cdcLogl[i];
42  }
43 
52  double getLogL(const Const::ChargedStable& type) const { return m_cdcLogl[type.getIndex()]; }
53 
55  double getCDCLikelihood(const Const::ChargedStable& type) const { return exp((double)m_cdcLogl[type.getIndex()]); }
56 
57  private:
61  };
63 }
64 #endif
Belle2::Const::ChargedStable::c_SetSize
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:491
Belle2::CDCDedxLikelihood
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
Definition: CDCDedxLikelihood.h:34
Belle2::CDCDedxLikelihood::m_cdcLogl
double m_cdcLogl[Const::ChargedStable::c_SetSize]
CDC log likelihood for each particle, not including momentum prior.
Definition: CDCDedxLikelihood.h:66
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDCDedxLikelihood::getLogL
double getLogL(const Const::ChargedStable &type) const
returns unnormalised log-likelihood value for a particle hypothesis using CDC information.
Definition: CDCDedxLikelihood.h:60
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::CDCDedxLikelihood::CDCDedxLikelihood
CDCDedxLikelihood()
default constructor
Definition: CDCDedxLikelihood.h:37
Belle2::RelationsInterface
Defines interface for accessing relations of objects in StoreArray.
Definition: RelationsObject.h:102
Belle2::CDCDedxLikelihood::ClassDef
ClassDef(CDCDedxLikelihood, 1)
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
Belle2::CDCDedxLikelihood::getCDCLikelihood
double getCDCLikelihood(const Const::ChargedStable &type) const
returns exp(getCDCLikelihood(type)) with sufficient precision.
Definition: CDCDedxLikelihood.h:63