30 const IInterface*
p ) :
32 m_broker(
"PerformanceBroker")
34 declareProperty(
"taggerName",
m_taggerName =
"undefined",
35 "tagging algorithm name");
36 declareProperty(
"operatingPoints", m_operatingPoints,
37 "operating points for this tagging algorithm");
39 "efficiency calibration curve for b jets");
41 "efficiency calibration curve for c jets");
43 "efficiency calibration curve for tau jets");
45 "efficiency calibration curve for light-flavour jets");
47 "scale factor calibration curve for b jets");
49 "scale factor calibration curve for c jets");
51 "scale factor calibration curve for tau jets");
53 "scale factor calibration curve for light-flavour jets");
54 declareProperty(
"PerformanceBroker",
m_broker,
55 "tool interfacing with COOL Database");
71 string::size_type
end;
73 std::vector<string> calibrationBNames;
74 if (m_EffcalibrationBName.size() > 0) {
76 end = m_EffcalibrationBName.find(
";");
77 calibrationBNames.push_back(m_EffcalibrationBName.substr(0,
end));
78 if (
end != string::npos) m_EffcalibrationBName = m_EffcalibrationBName.substr(
end+1);
79 }
while (
end != string::npos);
82 std::vector<string> calibrationCNames;
83 if (m_EffcalibrationCName.size() > 0) {
85 end = m_EffcalibrationCName.find(
";");
86 calibrationCNames.push_back(m_EffcalibrationCName.substr(0,
end));
87 if (
end != string::npos) m_EffcalibrationCName = m_EffcalibrationCName.substr(
end+1);
88 }
while (
end != string::npos);
91 std::vector<string> calibrationTNames;
92 if (m_EffcalibrationTName.size() > 0) {
94 end = m_EffcalibrationTName.find(
";");
95 calibrationTNames.push_back(m_EffcalibrationTName.substr(0,
end));
96 if (
end != string::npos) m_EffcalibrationTName = m_EffcalibrationTName.substr(
end+1);
97 }
while (
end != string::npos);
100 std::vector<string> calibrationLightNames;
101 if (m_EffcalibrationLightName.size() > 0) {
103 end = m_EffcalibrationLightName.find(
";");
104 calibrationLightNames.push_back(m_EffcalibrationLightName.substr(0,
end));
105 if (
end != string::npos) m_EffcalibrationLightName = m_EffcalibrationLightName.substr(
end+1);
106 }
while (
end != string::npos);
111 std::map<string, std::vector<string> > effNames;
112 effNames[
"B"] = calibrationBNames;
113 effNames[
"C"] = calibrationCNames;
114 effNames[
"T"] = calibrationTNames;
115 effNames[
"Light"] = calibrationLightNames;
116 setEffCalibrationNames(effNames);
119 std::map<string, string> calibrationNames;
120 calibrationNames[
"B"] = m_SFcalibrationBName;
121 calibrationNames[
"C"] = m_SFcalibrationCName;
122 calibrationNames[
"T"] = m_SFcalibrationTName;
123 calibrationNames[
"Light"] = m_SFcalibrationLightName;
124 setSFCalibrationNames(calibrationNames);
127 for (std::map<string, string>::const_iterator
it = calibrationNames.begin();
128 it != calibrationNames.end(); ++
it) {
129 for (std::vector<string>::const_iterator op = m_operatingPoints.begin();
130 op != m_operatingPoints.end(); ++op) {
131 registerObjects(
it->first, *op);
136 return StatusCode::SUCCESS;
151 string flavour(
label);
152 if (flavour ==
"N/A") flavour =
"Light";
156 string sfName(getBasename(OP, flavour,
"_SF",
true));
159 std::pair<CalibrationDataContainer*,bool> ret =
164 <<
"tagger/jetCollection/flavour/operating point = "
165 << m_taggerName <<
"/" <<
author <<
"/" << flavour <<
"/" << OP);
187 cerr <<
"getScaleFactor: error retrieving Scale factor statistical uncertainty!"
193 cerr <<
"getScaleFactor: error retrieving Scale factor parameter systematic uncertainty!"
197 double uncertainty = combinedUncertainty(
stat, resSyst);
215 string flavour(
label);
216 if (flavour ==
"N/A") flavour =
"Light";
220 string effName(getBasename(OP, flavour,
"_Eff",
false));
223 std::pair<CalibrationDataContainer*,bool> ret =
228 <<
"tagger/jetCollection/flavour/operating point = "
229 << m_taggerName <<
"/" <<
author <<
"/" << flavour <<
"/" << OP);
251 cerr <<
"getMCEfficiency: error retrieving MC efficiency statistical uncertainty!"
257 cerr <<
"getMCEfficiency: error retrieving MC efficiency parameter systematic uncertainty!"
261 double uncertainty = combinedUncertainty(
stat, resSyst);
278 double value = effResult.first*sfResult.first;
280 relative = effResult.second/effResult.first;
281 double sfRelative = sfResult.second/sfResult.first;
282 relative = std::sqrt(sfRelative*sfRelative + relative*relative);
285 <<
" MC eff=" << effResult.first);
295 const string& OP)
const
297 static const string slash(
"/");
301 string nameEff(
common); nameEff += EffCalibrationName(flavour); nameEff +=
"_Eff";
302 string nameSF(
common); nameSF += SFCalibrationName(flavour); nameSF +=
"_SF";
304 m_broker->registerHistogram(m_taggerName, nameSF);
305 m_broker->registerHistogram(m_taggerName, nameEff);
312 x.jetAuthor =
jet.jetAuthor();
313 x.jetPt =
jet.pt() * 0.001;
314 x.jetEta =
jet.eta();