50 TVectorT<float>* tVector =
nullptr;
51 f->GetObject(
name, tVector);
54 for (
int i = 0;
i < tVector->GetNoElements(); ++
i)
55 vector.push_back((*tVector)[
i]);
62 th1->GetNbinsX(), th1->GetXaxis()->GetBinLowEdge(1), th1->GetXaxis()->GetBinUpEdge(th1->GetNbinsX()));
63 for (
int ibin = 0; ibin <= th1->GetNbinsX() + 1; ++ibin)
70 std::map<std::vector<int>, TH1*>& pdfs,
71 std::vector<int>& binNumbers,
73 if (!pdfs[binNumbers])
75 std::vector<int> neighbour = binNumbers;
77 if (--(neighbour[
index]) < 0)
79 }
while (!pdfs[neighbour]);
80 if (TString(pdfs[binNumbers]->GetTitle()) != TString(pdfs[neighbour]->GetTitle()))
101 pdfs.erase(binNumbers);
114 std::map<TString, std::vector<float>> gridOfBins;
115 for (TString binVariable : {
"eta",
"pt",
"rho"}) {
117 edm::LogError(
"NoBins") <<
"Missing bin information for " << binVariable <<
" in input file" << std::endl;
125 std::map<std::vector<int>, TH1*> pdfs;
127 for (TString
type : {
"gluon",
"quark"}) {
128 int qgIndex = (
type ==
"gluon");
129 for (TString likelihoodVar : {
"mult",
"ptD",
"axis2"}) {
131 (likelihoodVar ==
"mult"
133 : (likelihoodVar ==
"ptD" ? 1 : 2));
134 for (
int i = 0;
i < (
int)gridOfBins[
"eta"].
size() - 1; ++
i) {
135 for (
int j = 0;
j < (
int)gridOfBins[
"pt"].
size() - 1; ++
j) {
136 for (
int k = 0;
k < (
int)gridOfBins[
"rho"].
size() - 1; ++
k) {
139 category.EtaMax = gridOfBins[
"eta"][
i + 1];
141 category.PtMax = gridOfBins[
"pt"][
j + 1];
143 category.RhoMax = gridOfBins[
"rho"][
k + 1];
148 TString::Format(likelihoodVar +
"/" + likelihoodVar +
"_" +
type +
"_eta%d_pt%d_rho%d",
i,
j,
k);
149 TH1* pdf = (TH1*)
f->Get(
key);
151 edm::LogError(
"NoPDF") <<
"Could not found pdf with key " <<
key <<
" in input file" << std::endl;
155 std::vector<int> binNumbers = {qgIndex, varIndex,
i,
j,
k};
156 pdfs[binNumbers] = pdf;
161 for (
int k = 0;
k < (
int)gridOfBins[
"rho"].
size() - 1; ++
k) {
162 std::vector<int> binNumbers = {qgIndex, varIndex,
i,
j,
k};
166 for (
int j = 0;
j < (
int)gridOfBins[
"pt"].
size() - 1; ++
j) {
167 for (
int k = 0;
k < (
int)gridOfBins[
"rho"].
size() - 1; ++
k) {
168 std::vector<int> binNumbers = {qgIndex, varIndex,
i,
j,
k};
188 "%6d) var=%1d\t\tqg=%1d\t\teta={%5.2f,%5.2f}\t\tpt={%8.2f,%8.2f}\t\trho={%6.2f,%8.2f}",
202 payload->qgValidRange.EtaMin = gridOfBins[
"eta"].front();
203 payload->qgValidRange.EtaMax = gridOfBins[
"eta"].back();
204 payload->qgValidRange.PtMin = gridOfBins[
"pt"].front();
205 payload->qgValidRange.PtMax = gridOfBins[
"pt"].back();
206 payload->qgValidRange.RhoMin = gridOfBins[
"rho"].front();
207 payload->qgValidRange.RhoMax = gridOfBins[
"rho"].back();
208 payload->qgValidRange.QGIndex = -1;
209 payload->qgValidRange.VarIndex = -1;
212 edm::LogInfo(
"UserOutput") <<
"Opening PoolDBOutputService" << std::endl;
215 if (
s.isAvailable()) {
216 edm::LogInfo(
"UserOutput") <<
"Setting up payload with " <<
payload->data.size() <<
" entries and tag "