1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#ifndef QGLikelihoodObject_h
#define QGLikelihoodObject_h
#include "CondFormats/PhysicsToolsObjects/interface/Histogram.h"
#include "CondFormats/Serialization/interface/Serializable.h"
#include <vector>
/// Category structure: ranges associated with QGLikelihood histograms
struct QGLikelihoodCategory {
float RhoMin, RhoMax, PtMin, PtMax, EtaMin, EtaMax;
int QGIndex, VarIndex;
COND_SERIALIZABLE;
};
/// Parameters structure
struct QGLikelihoodParameters {
float Rho, Pt, Eta;
int QGIndex, VarIndex;
};
/// QGLikelihoodObject containing valid range and entries with category and histogram (mean is not used anymore, only for backward backward compatibility with older DB constructs)
struct QGLikelihoodObject {
typedef PhysicsTools::Calibration::HistogramF Histogram;
struct Entry {
QGLikelihoodCategory category;
Histogram histogram;
float mean;
COND_SERIALIZABLE;
};
QGLikelihoodCategory qgValidRange;
std::vector<Entry> data;
COND_SERIALIZABLE;
};
/// QGLikelihoodSystematicsObject containing the parameters for the systematic smearing
struct QGLikelihoodSystematicsObject {
struct Entry {
QGLikelihoodCategory systCategory;
float a, b, lmin, lmax;
COND_SERIALIZABLE;
};
std::vector<Entry> data;
COND_SERIALIZABLE;
};
/// Test if parameters are compatible with category
inline bool operator==(const QGLikelihoodParameters& lhs, const QGLikelihoodCategory& rhs) {
if (lhs.QGIndex != rhs.QGIndex)
return false;
if (lhs.VarIndex != rhs.VarIndex)
return false;
if (lhs.Eta < rhs.EtaMin)
return false;
if (lhs.Eta > rhs.EtaMax)
return false;
if (lhs.Rho < rhs.RhoMin)
return false;
if (lhs.Rho > rhs.RhoMax)
return false;
if (lhs.Pt < rhs.PtMin)
return false;
if (lhs.Pt > rhs.PtMax)
return false;
return true;
}
#endif
|