CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DataFormats/Luminosity/src/LumiSummaryRunHeader.cc

Go to the documentation of this file.
00001 // $Id: LumiSummaryRunHeader.cc,v 1.1 2011/02/22 16:23:57 matevz Exp $
00002 
00003 #include "DataFormats/Luminosity/interface/LumiSummaryRunHeader.h"
00004 
00005 LumiSummaryRunHeader::LumiSummaryRunHeader(vstring_t& l1names, vstring_t& hltnames)
00006 {
00007   m_l1Names.swap(l1names);
00008   m_hltNames.swap(hltnames);
00009 }
00010 
00011 bool LumiSummaryRunHeader::isProductEqual(LumiSummaryRunHeader const& o) const
00012 {
00013   return m_l1Names == o.m_l1Names && m_hltNames == o.m_hltNames;
00014 }
00015 
00016 //==============================================================================
00017 
00018 void LumiSummaryRunHeader::setL1Names(const vstring_t& l1names)
00019 {
00020   m_l1Names.assign(l1names.begin(), l1names.end());
00021 }
00022 
00023 void LumiSummaryRunHeader::setHLTNames(const vstring_t& hltnames)
00024 {
00025   m_hltNames.assign(hltnames.begin(), hltnames.end());
00026 }
00027 
00028 void LumiSummaryRunHeader::swapL1Names(vstring_t& l1names)
00029 {
00030   m_l1Names.swap(l1names);
00031 }
00032 
00033 void LumiSummaryRunHeader::swapHLTNames(vstring_t& hltnames)
00034 {
00035   m_hltNames.swap(hltnames);
00036 }
00037 
00038 //==============================================================================
00039 
00040 unsigned int LumiSummaryRunHeader::getL1Index(const std::string& name) const
00041 {
00042   const unsigned int size = m_l1Names.size();
00043   for (unsigned int i = 0; i < size; ++i)
00044   {
00045     if (m_l1Names[i] == name) return i;
00046   }
00047   return -1;
00048 }
00049 
00050 unsigned int LumiSummaryRunHeader::getHLTIndex(const std::string& name) const
00051 {
00052   const unsigned int size = m_hltNames.size();
00053   for (unsigned int i = 0; i < size; ++i)
00054   {
00055     if (m_hltNames[i] == name) return i;
00056   }
00057   return -1;
00058 }