Belle II Software development
ECLPidLikelihood.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#include <cmath>
14
15namespace Belle2 {
23 public:
26 {
27 //for all particles
28 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++) {
29 m_logl[i] = 0.0;
30 }
31 setVariables(0, 0, 0, 0, 0, 0, 0, 0, 0);
32 }
33
35 explicit ECLPidLikelihood(const float* logl, float energy = 0, float eop = 0, float e9e25 = 0, float lat = 0, float dist = 0,
36 float trkDepth = 0, float shDepth = 0, int ncrystals = 0, int nclusters = 0): RelationsObject()
37 {
38 //for all particles
39 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++) {
40 m_logl[i] = logl[i];
41 }
42 setVariables(energy, eop, e9e25, lat, dist, trkDepth, shDepth, ncrystals, nclusters);
43 }
44
54 float getLogLikelihood(const Const::ChargedStable& type) const
55 {
56 return m_logl[type.getIndex()];
57 }
58
60 double getLikelihood(const Const::ChargedStable& type) const
61 {
62 return exp((double)m_logl[type.getIndex()]);
63 }
64
66 void setLogLikelihood(const Const::ChargedStable& type, float logl)
67 {
68 m_logl[type.getIndex()] = logl;
69 }
70
72 void setVariables(float energy, float eop, float e9e25, float lat, float dist, float trkDepth, float shDepth, int ncrystals,
73 int nclusters)
74 {
75 m_energy = energy; m_eop = eop; m_e9e25 = e9e25; m_nCrystals = ncrystals; m_nClusters = nclusters;
77 }
78
79 double energy() const { return m_energy; }
80 double eop() const { return m_eop; }
81 double e9e25() const { return m_e9e25; }
82 float lat() const { return m_lat; }
83 float dist() const { return m_dist; }
84 float trkDepth() const { return m_trkDepth; }
85 float shDepth() const { return m_shDepth; }
86 int nCrystals() const { return m_nCrystals; }
87 int nClusters() const { return m_nClusters; }
89 private:
90
93 float m_energy;
94 float m_eop;
95 float m_e9e25;
98 float m_lat;
99 float m_dist;
101 float m_shDepth;
103 // 3: Added DeltaL track match variable (GDN, increment by TF)
105 };
107}
108
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
Container for likelihoods with ECL PID (ECLChargedPIDModule)
float trkDepth() const
Track Depth.
float lat() const
Cluster LAT.
float m_shDepth
Cluster Depth.
ECLPidLikelihood()
default constructor
float m_e9e25
Ratio of energy in 3x3 matrix over energy in 5x5 matrix (should now be called E9oE21) for cluster.
double getLikelihood(const Const::ChargedStable &type) const
returns exp(getLogLikelihood(type)) with sufficient precision.
void setVariables(float energy, float eop, float e9e25, float lat, float dist, float trkDepth, float shDepth, int ncrystals, int nclusters)
Set cluster features upon which the likelihood might depend.
int nCrystals() const
Number of crystals per candidate.
float m_energy
Cluster Energy.
ECLPidLikelihood(const float *logl, float energy=0, float eop=0, float e9e25=0, float lat=0, float dist=0, float trkDepth=0, float shDepth=0, int ncrystals=0, int nclusters=0)
actually const float (&logl)[Const::ChargedStable::c_SetSize], but CINT complains.
ClassDef(ECLPidLikelihood, 3)
Build ROOT dictionary.
int nClusters() const
Number of clusters per candidate.
float m_logl[Const::ChargedStable::c_SetSize]
log likelihood for each particle, not including momentum prior
void setLogLikelihood(const Const::ChargedStable &type, float logl)
corresponding setter for m_logl.
int m_nCrystals
Number of crystals per candidate.
float dist() const
Cluster-Shower distance.
float m_eop
E/p ratio for cluster.
float m_trkDepth
Track Depth.
float shDepth() const
Cluster Depth.
float m_lat
Cluster LAT.
float getLogLikelihood(const Const::ChargedStable &type) const
returns log-likelihood value for a particle hypothesis.
float m_dist
Cluster-Shower distance.
double energy() const
Cluster energy.
double e9e25() const
Ratio of energies of the (central) 3x3 crystal matrix and outermost 5x5 matrix.
double eop() const
E/p ratio for cluster.
int m_nClusters
Number of clusters per candidate.
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.