CMS 3D CMS Logo

Public Member Functions | Private Attributes

CalibrationInterface< CategoryT, CalibDataT > Class Template Reference

#include <CalibrationInterface.h>

List of all members.

Public Member Functions

int addCategoryDefinition (const CategoryT &categoryDefinition)
int addEntry (const CategoryT &categoryDefinition, const CalibDataT &data)
 CalibrationInterface ()
const std::vector< std::pair
< CategoryT, CalibDataT > > & 
categoriesWithData () const
CalibDataT * getCalibData (int index)
CalibDataT * getCalibData (const typename CategoryT::Input &calibrationInput)
const CalibDataT * getCalibData (int index) const
const CalibDataT * getCalibData (const typename CategoryT::Input &calibrationInput) const
const CategoryT * getCategoryDefinition (int index) const
int getIndex (const typename CategoryT::Input &calibrationInput) const
void setCalibData (int index, const CalibDataT &data)
int size () const
 ~CalibrationInterface ()

Private Attributes

std::vector< std::pair
< CategoryT, CalibDataT > > 
m_categoriesWithData

Detailed Description

template<class CategoryT, class CalibDataT>
class CalibrationInterface< CategoryT, CalibDataT >

Definition at line 11 of file CalibrationInterface.h.


Constructor & Destructor Documentation

template<class CategoryT , class CalibDataT >
CalibrationInterface< CategoryT, CalibDataT >::CalibrationInterface ( )

Definition at line 50 of file CalibrationInterface.h.

{
}
template<class CategoryT , class CalibDataT >
CalibrationInterface< CategoryT, CalibDataT >::~CalibrationInterface ( )

Definition at line 55 of file CalibrationInterface.h.

{
}

Member Function Documentation

template<class CategoryT, class CalibDataT >
int CalibrationInterface< CategoryT, CalibDataT >::addCategoryDefinition ( const CategoryT &  categoryDefinition)

Definition at line 102 of file CalibrationInterface.h.

References revisionDML::addEntry().

{
 CalibDataT emptyData;
 return addEntry(categoryDefinition,emptyData);
}
template<class CategoryT, class CalibDataT>
int CalibrationInterface< CategoryT, CalibDataT >::addEntry ( const CategoryT &  categoryDefinition,
const CalibDataT &  data 
)

Definition at line 109 of file CalibrationInterface.h.

{
 std::pair<CategoryT,CalibDataT> newEntry(categoryDefinition,data);
 m_categoriesWithData.push_back(newEntry);
 return  m_categoriesWithData.size();
}
template<class CategoryT, class CalibDataT>
const std::vector<std::pair<CategoryT, CalibDataT> >& CalibrationInterface< CategoryT, CalibDataT >::categoriesWithData ( ) const [inline]

Definition at line 41 of file CalibrationInterface.h.

template<class CategoryT, class CalibDataT>
CalibDataT* CalibrationInterface< CategoryT, CalibDataT >::getCalibData ( const typename CategoryT::Input &  calibrationInput) [inline]

Definition at line 23 of file CalibrationInterface.h.

     {
      return(getCalibData(getIndex(calibrationInput)));
     }
template<class CategoryT, class CalibDataT >
CalibDataT * CalibrationInterface< CategoryT, CalibDataT >::getCalibData ( int  index)

Definition at line 92 of file CalibrationInterface.h.

References i, and edm::second().

{
 size_t ii=i;
 if(i>=0 && ii < m_categoriesWithData.size() )
  return &m_categoriesWithData[i].second;
 else
  return 0;
}
template<class CategoryT, class CalibDataT >
const CalibDataT * CalibrationInterface< CategoryT, CalibDataT >::getCalibData ( int  index) const

Definition at line 81 of file CalibrationInterface.h.

References i, and edm::second().

{
 size_t ii=i;
 if(i>=0 && ii < m_categoriesWithData.size() )
  return &m_categoriesWithData[i].second;
 else
  return 0;
}
template<class CategoryT, class CalibDataT>
const CalibDataT* CalibrationInterface< CategoryT, CalibDataT >::getCalibData ( const typename CategoryT::Input &  calibrationInput) const [inline]

Definition at line 18 of file CalibrationInterface.h.

Referenced by CalibrationInterface< T, CO >::getCalibData().

     {
      return(getCalibData(getIndex(calibrationInput)));
     }
template<class CategoryT, class CalibDataT>
const CategoryT* CalibrationInterface< CategoryT, CalibDataT >::getCategoryDefinition ( int  index) const
template<class CategoryT, class CalibDataT >
int CalibrationInterface< CategoryT, CalibDataT >::getIndex ( const typename CategoryT::Input &  calibrationInput) const

Definition at line 60 of file CalibrationInterface.h.

References newFWLiteAna::found, and i.

Referenced by CalibrationInterface< T, CO >::getCalibData().

{
   int i=0;
   int found=-1;
   for(typename std::vector<std::pair<CategoryT,CalibDataT> >::const_iterator it = m_categoriesWithData.begin();it!=m_categoriesWithData.end();it++)
   {
    
      if((*it).first.match(calibrationInput))
      {
        if(found >=0 ) 
          {
           edm::LogWarning("BTagCalibration") << "WARNING: OVERLAP in categories, using latest one" ;
          }
        
        found=i;
      }
   i++;
  }
  return found;
}
template<class CategoryT , class CalibDataT>
void CalibrationInterface< CategoryT, CalibDataT >::setCalibData ( int  index,
const CalibDataT &  data 
)

Definition at line 118 of file CalibrationInterface.h.

References runTheMatrix::data, and getHLTprescales::index.

template<class CategoryT, class CalibDataT>
int CalibrationInterface< CategoryT, CalibDataT >::size ( void  ) const [inline]

Definition at line 42 of file CalibrationInterface.h.

{return m_categoriesWithData.size(); }

Member Data Documentation

template<class CategoryT, class CalibDataT>
std::vector<std::pair<CategoryT, CalibDataT> > CalibrationInterface< CategoryT, CalibDataT >::m_categoriesWithData [private]