Skip to content
Snippets Groups Projects
Commit b25cee15 authored by Jana Schaarschmidt's avatar Jana Schaarschmidt
Browse files

Adding support to read pca bin probabilities from the second pca file

Former-commit-id: a73ed150eb087f0ed86d5589c6bc631ab328f4a8
parent 71710082
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@ public:
// return number of energy parametrization bins
virtual int n_bins() const {return 0;};
virtual std::vector<float> pcabinprob() const {return {0};};
private:
......
......@@ -33,6 +33,10 @@ class TFCSPCAEnergyParametrization:public TFCSEnergyParametrization
void P2X(TVectorD*, TVectorD* , TMatrixD* , int, double* , double* , int);
bool loadInputs(TFile* file);
bool loadInputs(TFile* file,std::string);
bool loadPCAbinProb(TFile* file);
virtual std::vector<float> pcabinprob() const override {return m_pcabinprob;};
void clean();
void Print(Option_t *option = "") const override;
......@@ -50,6 +54,8 @@ class TFCSPCAEnergyParametrization:public TFCSEnergyParametrization
std::vector<TVectorD*> m_Gauss_rms;
std::vector<std::vector<TFCS1DFunction*> > m_cumulative;
std::vector<float> m_pcabinprob;
int m_numberpcabins;
ClassDefOverride(TFCSPCAEnergyParametrization,1) //TFCSPCAEnergyParametrization
......
......@@ -170,6 +170,27 @@ void TFCSPCAEnergyParametrization::P2X(TVectorD* SigmaValues, TVectorD* MeanValu
}
}
bool TFCSPCAEnergyParametrization::loadPCAbinProb(TFile* file)
{
file->cd();
TVectorD* pcabinprobvector=(TVectorD*)gDirectory->Get("PCAbinprob");
if(!pcabinprobvector)
{
ATH_MSG_WARNING("TFCSPCAEnergyParametrization::PCAbinprob is null");
return false;
}
double* prob =pcabinprobvector->GetMatrixArray();
for(int i=0;i<pcabinprobvector->GetNoElements();i++)
m_pcabinprob.push_back(prob[i]);
return true;
}
bool TFCSPCAEnergyParametrization::loadInputs(TFile* file)
{
return loadInputs(file, "");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment