Belle II Software  release-05-02-19
Cluster.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Torben Ferber *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef CLUSTER_H
12 #define CLUSTER_H
13 
14 #include <framework/datastore/RelationsObject.h>
15 #include <framework/gearbox/Const.h>
16 
17 namespace Belle2 {
29  class Cluster : public RelationsObject {
30 
31  public:
32 
36  Cluster();
37 
45  const Const::Cluster& cluster,
46  float logl);
47 
53  bool isAvailable(Const::ClusterDetectorSet set) const {return m_detectors.contains(set);}
54 
61  float getLogL(const Const::Cluster& cluster,
63 
71  float getDeltaLogL(const Const::Cluster& c1,
72  const Const::Cluster& c2,
74  {
75  return getLogL(c1, set) - getLogL(c2, set);
76  }
77 
86  double getProbability(const Const::Cluster& c1,
87  const Const::Cluster& c2,
89  {
90  return getProbability(c1, c2, 1.0, set);
91  }
92 
101  double getProbability(const Const::Cluster& c1,
102  const Const::Cluster& c2,
103  double ratio,
105 
106 
115  double getProbability(const Const::Cluster& cluster,
116  const double* fractions = 0,
118 
126  Const::Cluster getMostLikely(const double* fractions = 0,
132  void printArray() const;
133 
137  std::string getInfoHTML() const;
138 
139  private:
140 
141  Const::DetectorSet m_detectors;
150  void probability(double probabilities[],
151  const double* fractions,
152  Const::ClusterDetectorSet detSet) const;
153 
154 
155  ClassDef(Cluster, 1);
157  };
158 
160 } // end namespace Belle2
161 
162 #endif
Belle2::Const::ClusterDetectorSet
RestrictedDetectorSet< ClusterDetectors > ClusterDetectorSet
Typedef for set of VXD detectors.
Definition: Const.h:268
Belle2::Const::RestrictedDetectorSet::set
static DetectorSet set()
Accessor for the set of valid detector IDs.
Definition: Const.h:209
Belle2::Cluster::printArray
void printArray() const
Prints the content of a private array of log likelihoods.
Definition: Cluster.cc:160
Belle2::Cluster::probability
void probability(double probabilities[], const double *fractions, Const::ClusterDetectorSet detSet) const
Calculate likelihood probabilities.
Definition: Cluster.cc:120
Belle2::Cluster::m_logl
float m_logl[Const::ClusterDetectors::c_size][Const::Cluster::c_SetSize]
log likelihoods
Definition: Cluster.h:150
Belle2::Cluster::Cluster
Cluster()
Default constructor: log likelihoods and flags set to 0.
Definition: Cluster.cc:21
Belle2::Cluster::ClassDef
ClassDef(Cluster, 1)
Initial version.
Belle2::Cluster::getInfoHTML
std::string getInfoHTML() const
Return HTML Info of cluster Likelihoods.
Definition: Cluster.cc:210
Belle2::Cluster::m_detectors
Const::DetectorSet m_detectors
set of detectors with cluster information
Definition: Cluster.h:149
Belle2::Cluster::getLogL
float getLogL(const Const::Cluster &cluster, Const::ClusterDetectorSet set=Const::ClusterDetectorSet::set()) const
Return log likelihood for a given detector set and particle.
Definition: Cluster.cc:51
Belle2::Const::EDetector
EDetector
Enum for identifying the detector components (detector and subdetector).
Definition: Const.h:44
Belle2::Cluster::getMostLikely
Const::Cluster getMostLikely(const double *fractions=0, Const::ClusterDetectorSet set=Const::ClusterDetectorSet::set()) const
Return most likely particle among clusterSet; if prior fractions not given equal prior probabilities ...
Definition: Cluster.cc:103
Belle2::Cluster::isAvailable
bool isAvailable(Const::ClusterDetectorSet set) const
Check whether cluster information from a given set of detectors is available.
Definition: Cluster.h:61
Belle2::Cluster::setLogLikelihood
void setLogLikelihood(Const::EDetector det, const Const::Cluster &cluster, float logl)
Set log likelihood for a given detector and particle.
Definition: Cluster.cc:31
Belle2::Const::Cluster::c_SetSize
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:528
Belle2::Const::RestrictedDetectorSet
A class for sets of detector IDs whose content is limited to restricted set of valid detector IDs.
Definition: Const.h:172
Belle2::Cluster::getProbability
double getProbability(const Const::Cluster &c1, const Const::Cluster &c2, Const::ClusterDetectorSet set=Const::ClusterDetectorSet::set()) const
Return combined likelihood probability for a cluster being c1 and not c2, assuming equal prior probab...
Definition: Cluster.h:94
Belle2::Cluster
Class to collect log likelihoods from Clusters from ECL and KLM aimed for output to mdst includes fun...
Definition: Cluster.h:37
Belle2::Const::Cluster
Provides a type-safe way to pass members of the clusterSet set.
Definition: Const.h:502
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Const::ClusterDetectors::c_size
static const size_t c_size
Number of PID detectors, temporary workaround.
Definition: Const.h:265
Belle2::Cluster::getDeltaLogL
float getDeltaLogL(const Const::Cluster &c1, const Const::Cluster &c2, Const::ClusterDetectorSet set=Const::ClusterDetectorSet::set()) const
Return log likelihood difference for a given detector set and clusters.
Definition: Cluster.h:79
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::Const::DetectorSet::contains
bool contains(const DetectorSet &set) const
Check whether this set contains another set.
Definition: Const.h:116