Belle II Software development
dEdxPDFs.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/* basf2 headers. */
12#include <framework/gearbox/Const.h>
13
14/* C++ headers. */
15#include <array>
16
17/* ROOT headers. */
18#include <TH2F.h>
19#include <TObject.h>
20
21namespace Belle2 {
31 class dEdxPDFs: public TObject {
32
33 public:
34
38 dEdxPDFs() = default;
39
45 const TH2F* getPDF(const unsigned int hypothesis, const bool truncated) const
46 {
47 return truncated ? &(m_dEdxPDFsTruncated.at(hypothesis)) : &(m_dEdxPDFs.at(hypothesis));
48 }
49
56 void setPDF(const TH2F& pdf, const unsigned int hypothesis, const bool truncated)
57 {
58 if (truncated)
59 m_dEdxPDFsTruncated.at(hypothesis) = pdf;
60 else
61 m_dEdxPDFs.at(hypothesis) = pdf;
62 }
63
64 private:
65
67 std::array<TH2F, Const::ChargedStable::c_SetSize> m_dEdxPDFs;
68
70 std::array<TH2F, Const::ChargedStable::c_SetSize> m_dEdxPDFsTruncated;
71
74
75 };
76
78}
Base class for holding the dE/dx PDFs.
Definition: dEdxPDFs.h:31
void setPDF(const TH2F &pdf, const unsigned int hypothesis, const bool truncated)
Set the dE/dx PDF for the given particle hypothesis.
Definition: dEdxPDFs.h:56
ClassDef(dEdxPDFs, 1)
Class version for the ROOT streamer.
const TH2F * getPDF(const unsigned int hypothesis, const bool truncated) const
Return the dE/dx PDF for the given particle hypothesis.
Definition: dEdxPDFs.h:45
std::array< TH2F, Const::ChargedStable::c_SetSize > m_dEdxPDFs
Array of dE/dx PDFs for each particle hypothesis.
Definition: dEdxPDFs.h:67
std::array< TH2F, Const::ChargedStable::c_SetSize > m_dEdxPDFsTruncated
Array of truncated dE/dx PDFs for each particle hypothesis.
Definition: dEdxPDFs.h:70
dEdxPDFs()=default
Default constructor.
Abstract base class for different kinds of events.