Belle II Software  release-08-01-10
KLMLikelihoodParameters.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 #pragma once
9 
10 /* KLM headers. */
11 #include <klm/muid/MuidElementNumbers.h>
12 
13 /* ROOT headers. */
14 #include <TObject.h>
15 
16 /* C++ headers. */
17 #include <map>
18 
19 namespace Belle2 {
28  class KLMLikelihoodParameters : public TObject {
29 
30  public:
31 
36  {
37  }
38 
43  {
44  }
45 
53  void setLongitudinalPDF(int hypothesis, int outcome, int lastLayer, const std::vector<double>& params)
54  {
55  const int id = MuidElementNumbers::getLongitudinalID(hypothesis, outcome, lastLayer);
56  setLongitudinalPDF(id, params);
57  }
58 
66  void setTransversePDF(int hypothesis, int detector, int degreesOfFreedom, const std::vector<double>& params)
67  {
68  int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
69  setTransversePDF(id, params);
70  }
71 
79  void setTransverseThreshold(int hypothesis, int detector, int degreesOfFreedom, const double threshold)
80  {
81  int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
82  setTransverseThreshold(id, threshold);
83  }
84 
92  void setTransverseScaleX(int hypothesis, int detector, int degreesOfFreedom, const double scaleX)
93  {
94  int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
95  setTransverseScaleX(id, scaleX);
96  }
97 
105  void setTransverseScaleY(int hypothesis, int detector, int degreesOfFreedom, const double scaleY)
106  {
107  int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
108  setTransverseScaleY(id, scaleY);
109  }
110 
117  const std::vector<double>& getLongitudinalPDF(int hypothesis, int outcome, int lastLayer) const
118  {
119  const int id = MuidElementNumbers::getLongitudinalID(hypothesis, outcome, lastLayer);
120  return getLongitudinalPDF(id);
121  }
122 
129  const std::vector<double>& getTransversePDF(int hypothesis, int detector, int degreesOfFreedom) const
130  {
131  const int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
132  return getTransversePDF(id);
133  }
134 
141  double getTransverseThreshold(int hypothesis, int detector, int degreesOfFreedom) const
142  {
143  const int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
144  return getTransverseThreshold(id);
145  }
146 
153  double getTransverseScaleX(int hypothesis, int detector, int degreesOfFreedom) const
154  {
155  const int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
156  return getTransverseScaleX(id);
157  }
158 
165  double getTransverseScaleY(int hypothesis, int detector, int degreesOfFreedom) const
166  {
167  const int id = MuidElementNumbers::getTransverseID(hypothesis, detector, degreesOfFreedom);
168  return getTransverseScaleY(id);
169  }
170 
171  private:
172 
178  void setLongitudinalPDF(const int id, const std::vector<double>& params)
179  {
180  m_LongitudinalPDF.insert(std::pair<int, std::vector<double>>(id, params));
181  }
182 
188  void setTransversePDF(const int id, const std::vector<double>& params)
189  {
190  m_TransversePDF.insert(std::pair<int, std::vector<double>>(id, params));
191  }
192 
198  void setTransverseThreshold(const int id, const double threshold)
199  {
200  m_TransverseThreshold.insert(std::pair<int, double>(id, threshold));
201  }
202 
208  void setTransverseScaleX(const int id, const double scaleX)
209  {
210  m_TransverseScaleX.insert(std::pair<int, double>(id, scaleX));
211  }
212 
218  void setTransverseScaleY(const int id, const double scaleY)
219  {
220  m_TransverseScaleY.insert(std::pair<int, double>(id, scaleY));
221  }
222 
227  const std::vector<double>& getLongitudinalPDF(const int id) const;
228 
233  const std::vector<double>& getTransversePDF(const int id) const;
234 
239  double getTransverseThreshold(const int id) const;
240 
245  double getTransverseScaleX(const int id) const;
246 
251  double getTransverseScaleY(const int id) const;
252 
254  std::map<int, std::vector<double>> m_LongitudinalPDF;
255 
257  std::map<int, std::vector<double>> m_TransversePDF;
258 
260  std::map<int, double> m_TransverseThreshold;
261 
263  std::map<int, double> m_TransverseScaleX;
264 
266  std::map<int, double> m_TransverseScaleY;
267 
270 
271  };
272 
274 }
Database object used to store the parameters for KLM likelihood computation.
void setTransverseThreshold(int hypothesis, int detector, int degreesOfFreedom, const double threshold)
Set the transverse probability density function (analytical): threshold for specific hypothesis,...
std::map< int, std::vector< double > > m_TransversePDF
Transverse probability density function.
void setTransversePDF(int hypothesis, int detector, int degreesOfFreedom, const std::vector< double > &params)
Set the transverse probability density function for specific hypothesis, detector and degrees of free...
const std::vector< double > & getLongitudinalPDF(int hypothesis, int outcome, int lastLayer) const
Get the longitudinal probability density function for specific hypothesis, outcome and last layer.
double getTransverseThreshold(int hypothesis, int detector, int degreesOfFreedom) const
Get the transverse probability density function (analytical): threshold for specific hypothesis,...
std::map< int, double > m_TransverseScaleY
Transverse probability density function (analytical): vertical scale.
void setTransverseScaleY(const int id, const double scaleY)
Set the transverse probability density function (analytical): vertical scale for a given identifier.
void setTransverseScaleY(int hypothesis, int detector, int degreesOfFreedom, const double scaleY)
Set the transverse probability density function (analytical): vertical scale for specific hypothesis,...
double getTransverseScaleY(int hypothesis, int detector, int degreesOfFreedom) const
Get the transverse probability density function (analytical): vertical scale for specific hypothesis,...
std::map< int, std::vector< double > > m_LongitudinalPDF
Longitudinal probability density function.
void setTransverseScaleX(const int id, const double scaleX)
Set the transverse probability density function (analytical): horizontal scale for a given identifier...
void setTransverseThreshold(const int id, const double threshold)
Set the transverse probability density function (analytical): threshold for a given identifier.
std::map< int, double > m_TransverseScaleX
Transverse probability density function (analytical): horizontal scale.
ClassDef(KLMLikelihoodParameters, 1)
Class version.
void setLongitudinalPDF(const int id, const std::vector< double > &params)
Set the longitudinal probability density function for a given identifier.
void setLongitudinalPDF(int hypothesis, int outcome, int lastLayer, const std::vector< double > &params)
Set the longitudinal probability density function for specific hypothesis, outcome and last layer.
std::map< int, double > m_TransverseThreshold
Transverse probability density function (analytical): threshold.
double getTransverseScaleX(int hypothesis, int detector, int degreesOfFreedom) const
Get the transverse probability density function (analytical): horizontal scale for specific hypothesi...
void setTransverseScaleX(int hypothesis, int detector, int degreesOfFreedom, const double scaleX)
Set the transverse probability density function (analytical): horizontal scale for specific hypothesi...
void setTransversePDF(const int id, const std::vector< double > &params)
Set the transverse probability density function for a given identifier.
const std::vector< double > & getTransversePDF(int hypothesis, int detector, int degreesOfFreedom) const
Get the transverse probability density function for specific hypothesis, detector and degrees of free...
static int getLongitudinalID(int hypothesis, int outcome, int lastLayer)
Get the unique longitudinal identifier for given hypothesis, outcome and last layer crossed.
static int getTransverseID(int hypothesis, int detector, int degreesOfFreedom)
Get the unique transverse identifier for given hypothesis, detector and degrees of freedom.
Abstract base class for different kinds of events.