14 for (
unsigned int varIndex = 0; varIndex < vars.size(); ++varIndex) {
15 auto quarkEntry =
findEntry(QGLParamsColl->
data, eta, pt, rho, 0, varIndex);
16 auto gluonEntry =
findEntry(QGLParamsColl->
data, eta, pt, rho, 1, varIndex);
17 if (!quarkEntry || !gluonEntry)
20 int binQ = quarkEntry->histogram.findBin(vars[varIndex]);
21 float Qi = quarkEntry->histogram.binContent(binQ);
23 int binG = gluonEntry->histogram.findBin(vars[varIndex]);
24 float Gi = gluonEntry->histogram.binContent(binG);
43 myParameters.
Rho = rho;
45 myParameters.
Eta = fabs(eta);
49 auto myDataObject = data.begin();
50 while (!(myParameters == myDataObject->category)) {
52 if (myDataObject == data.end()) {
54 <<
"Jet passed qgValidRange criteria, but no category found with rho=" << rho <<
", pt=" << pt
55 <<
", eta=" << eta <<
"\nPlease contact cms-qg-workinggroup@cern.ch" << std::endl;
59 return &*myDataObject;
67 if (pt < qgValidRange.
PtMin)
69 if (pt > qgValidRange.
PtMax)
71 if (rho < qgValidRange.
RhoMin)
73 if (rho > qgValidRange.
RhoMax)
75 if (fabs(eta) < qgValidRange.
EtaMin)
77 if (fabs(eta) > qgValidRange.
EtaMax)
84 float x = (x0 -
min) / (max - min);
90 float x1 = tanh(a * atanh(2. * x - 1.) + b) / 2. + .5;
96 return x1 * (max -
min) + min;
106 if (qgValue < 0 || qgValue > 1)
110 myParameters.
Rho = rho;
111 myParameters.
Pt =
pt;
112 myParameters.
Eta = fabs(eta);
113 myParameters.
QGIndex = qgIndex;
116 auto myDataObject = QGLSystematicsColl->
data.begin();
117 while (!(myParameters == myDataObject->systCategory)) {
119 if (myDataObject == QGLSystematicsColl->
data.end())
122 return smearingFunction(qgValue, myDataObject->a, myDataObject->b, myDataObject->lmin, myDataObject->lmax);
bool isValidRange(float pt, float rho, float eta, const QGLikelihoodCategory &qgValidRange) const
Check the valid range of this qg tagger.
float smearingFunction(float x0, float a, float b, float min, float max) const
Return the smeared qgLikelihood value, given input x0 and parameters a, b, min and max...
QGLikelihoodCategory qgValidRange
float systematicSmearing(edm::ESHandle< QGLikelihoodSystematicsObject > &QGLParamsColl, float pt, float eta, float rho, float qgValue, int qgIndex) const
std::vector< Entry > data
float computeQGLikelihood(edm::ESHandle< QGLikelihoodObject > &QGLParamsColl, float pt, float eta, float rho, std::vector< float > vars) const
Compute likelihood for a jet using the QGLikelihoodObject information and a set of variables...
Category structure: ranges associated with QGLikelihood histograms.
const QGLikelihoodObject::Entry * findEntry(std::vector< QGLikelihoodObject::Entry > const &data, float eta, float pt, float rho, int qgIndex, int varIndex) const
Find matching entry in vector for a given eta, pt, rho, qgIndex and varIndex.
char data[epos_bytes_allocation]
std::vector< Entry > data