13 for (
unsigned int varIndex = 0; varIndex < vars.size(); ++varIndex) {
14 auto quarkEntry =
findEntry(QGLParamsColl.
data, eta, pt, rho, 0, varIndex);
15 auto gluonEntry =
findEntry(QGLParamsColl.
data, eta, pt, rho, 1, varIndex);
16 if (!quarkEntry || !gluonEntry)
19 int binQ = quarkEntry->histogram.findBin(vars[varIndex]);
20 float Qi = quarkEntry->histogram.binContent(binQ);
22 int binG = gluonEntry->histogram.findBin(vars[varIndex]);
23 float Gi = gluonEntry->histogram.binContent(binG);
42 myParameters.
Rho = rho;
44 myParameters.
Eta = fabs(eta);
48 auto myDataObject = data.begin();
49 while (!(myParameters == myDataObject->category)) {
51 if (myDataObject == data.end()) {
53 <<
"Jet passed qgValidRange criteria, but no category found with rho=" << rho <<
", pt=" << pt
54 <<
", eta=" << eta <<
"\nPlease contact cms-qg-workinggroup@cern.ch" << std::endl;
58 return &*myDataObject;
66 if (pt < qgValidRange.
PtMin)
68 if (pt > qgValidRange.
PtMax)
70 if (rho < qgValidRange.
RhoMin)
72 if (rho > qgValidRange.
RhoMax)
74 if (fabs(eta) < qgValidRange.
EtaMin)
76 if (fabs(eta) > qgValidRange.
EtaMax)
83 float x = (x0 -
min) / (max - min);
89 float x1 = tanh(a * atanh(2. * x - 1.) + b) / 2. + .5;
95 return x1 * (max -
min) + min;
105 if (qgValue < 0 || qgValue > 1)
109 myParameters.
Rho = rho;
110 myParameters.
Pt =
pt;
111 myParameters.
Eta = fabs(eta);
112 myParameters.
QGIndex = qgIndex;
115 auto myDataObject = QGLSystematicsColl.
data.begin();
116 while (!(myParameters == myDataObject->systCategory)) {
118 if (myDataObject == QGLSystematicsColl.
data.end())
121 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...
float systematicSmearing(const QGLikelihoodSystematicsObject &QGLParamsColl, float pt, float eta, float rho, float qgValue, int qgIndex) const
QGLikelihoodCategory qgValidRange
std::vector< Entry > data
QGLikelihoodObject containing valid range and entries with category and histogram (mean is not used a...
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.
float computeQGLikelihood(const 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...
char data[epos_bytes_allocation]
std::vector< Entry > data
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
Log< level::Warning, false > LogWarning