1 #ifndef CALIBRATION_INTERFACE_H
2 #define CALIBRATION_INTERFACE_H
11 template <
class CategoryT,
class CalibDataT>
33 int addEntry(
const CategoryT& categoryDefinition,
const CalibDataT&
data);
44 template <
class CategoryT,
class CalibDataT>
47 template <
class CategoryT,
class CalibDataT>
50 template <
class CategoryT,
class CalibDataT>
54 for (
typename std::vector<std::pair<CategoryT, CalibDataT> >::const_iterator it = m_categoriesWithData.begin();
55 it != m_categoriesWithData.end();
57 if ((*it).first.match(calibrationInput)) {
59 edm::LogWarning(
"BTagCalibration") <<
"WARNING: OVERLAP in categories, using latest one";
68 template <
class CategoryT,
class CalibDataT>
71 if (i >= 0 && ii < m_categoriesWithData.size())
72 return &m_categoriesWithData[i].
second;
77 template <
class CategoryT,
class CalibDataT>
80 if (i >= 0 && ii < m_categoriesWithData.size())
81 return &m_categoriesWithData[i].
second;
86 template <
class CategoryT,
class CalibDataT>
89 return addEntry(categoryDefinition, emptyData);
92 template <
class CategoryT,
class CalibDataT>
94 std::pair<CategoryT, CalibDataT> newEntry(categoryDefinition, data);
95 m_categoriesWithData.push_back(newEntry);
96 return m_categoriesWithData.size();
99 template <
class CategoryT,
class CalibDataT>
101 m_categoriesWithData[
index].second =
data;
int getIndex(const typename CategoryT::Input &calibrationInput) const
U second(std::pair< T, U > const &p)
void setCalibData(int index, const CalibDataT &data)
const std::vector< std::pair< CategoryT, CalibDataT > > & categoriesWithData() const
std::vector< std::pair< CategoryT, CalibDataT > > m_categoriesWithData
const CalibDataT * getCalibData(const typename CategoryT::Input &calibrationInput) const
CalibDataT * getCalibData(const typename CategoryT::Input &calibrationInput)
int addEntry(const CategoryT &categoryDefinition, const CalibDataT &data)
const CategoryT * getCategoryDefinition(int index) const
char data[epos_bytes_allocation]
int addCategoryDefinition(const CategoryT &categoryDefinition)
Log< level::Warning, false > LogWarning