12#include <analysis/dbobjects/PIDPriorsTable.h>
13#include <analysis/dbobjects/PIDPriors.h>
19 auto index = particle.getIndex();
21 std::vector<float> xEdges;
22 std::vector<float> yEdges;
24 auto& xaxis = *(priorHistogram->GetXaxis());
25 for (
int i = xaxis.GetFirst(); i <= xaxis.GetLast(); ++i) {
26 xEdges.push_back(xaxis.GetBinLowEdge(i));
28 xEdges.push_back(xaxis.GetBinUpEdge(xaxis.GetLast()));
30 auto& yaxis = *(priorHistogram->GetYaxis());
31 for (
int i = yaxis.GetFirst(); i <= yaxis.GetLast(); ++i) {
32 yEdges.push_back(yaxis.GetBinLowEdge(i));
34 yEdges.push_back(yaxis.GetBinUpEdge(yaxis.GetLast()));
37 std::vector<float> prior;
38 std::vector<float> error;
40 for (
int ix = 0; ix < (int)xEdges.size() - 1; ix++) {
41 for (
int iy = 0; iy < (int)yEdges.size() - 1; iy++) {
42 prior.push_back(priorHistogram->GetBinContent(ix + 1, iy + 1));
43 error.push_back(priorHistogram->GetBinError(ix + 1, iy + 1));
58 TH2F* priorHistogram =
static_cast<TH2F*
>(counts->Clone());
60 priorHistogram->Sumw2();
61 priorHistogram->Divide(normalization);
Provides a type-safe way to pass members of the chargedStableSet set.
void setErrorsTable(const std::vector< float > &errors)
Sets the priors error table from a 2D std::vector.
void setBinEdges(const std::vector< float > &binEdgesX, const std::vector< float > &binEdgesY)
Sets the bin edges arrays.
void setPriorsTable(const std::vector< float > &priors)
Sets the priors table from a 2D std::vector.
PIDPriorsTable m_priors[Const::ChargedStable::c_SetSize]
The array of PIDPiorsTable, one per particle species.
void setPriors(const Const::ChargedStable &particle, const PIDPriorsTable &table)
Sets the prior table for a particle species from a PIDPriorsTable object.
Abstract base class for different kinds of events.