12#include <framework/gearbox/Unit.h>
13#include <analysis/dbobjects/PIDPriorsTable.h>
14#include <analysis/dbobjects/PIDPriors.h>
22 std::vector<float> xEdges;
23 std::vector<float> yEdges;
25 auto& xaxis = *(priorHistogram->GetXaxis());
26 for (
int i = xaxis.GetFirst(); i <= xaxis.GetLast(); ++i) {
27 xEdges.push_back(xaxis.GetBinLowEdge(i));
29 xEdges.push_back(xaxis.GetBinUpEdge(xaxis.GetLast()));
31 auto& yaxis = *(priorHistogram->GetYaxis());
32 for (
int i = yaxis.GetFirst(); i <= yaxis.GetLast(); ++i) {
33 yEdges.push_back(yaxis.GetBinLowEdge(i));
35 yEdges.push_back(yaxis.GetBinUpEdge(yaxis.GetLast()));
38 std::vector<float> prior;
39 std::vector<float> error;
41 for (
int ix = 0; ix < (int)xEdges.size() - 1; ix++) {
42 for (
int iy = 0; iy < (int)yEdges.size() - 1; iy++) {
43 prior.push_back(priorHistogram->GetBinContent(ix + 1, iy + 1));
44 error.push_back(priorHistogram->GetBinError(ix + 1, iy + 1));
59 TH2F* priorHistogram =
static_cast<TH2F*
>(counts->Clone());
61 priorHistogram->Sumw2();
62 priorHistogram->Divide(normalization);
Provides a type-safe way to pass members of the chargedStableSet set.
int getIndex() const
This particle's index in the associated 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.