Go to the documentation of this file.00001 #include "CondFormats/L1TObjects/interface/L1RPCHsbConfig.h"
00002 #include "FWCore/Utilities/interface/Exception.h"
00003
00004 L1RPCHsbConfig::L1RPCHsbConfig()
00005 {
00006
00007 }
00008
00009
00010 L1RPCHsbConfig::~L1RPCHsbConfig(){
00011
00012
00013
00014 }
00015
00016
00017 void L1RPCHsbConfig::setHsbMask(int hsb, std::vector<int> mask ) {
00018
00019 if (getMaskSize() != int(mask.size()) ) {
00020 throw cms::Exception("L1RPCHsbConfig::setHsbMask")
00021 << "Wrong size of hsb mask "
00022 << mask.size() << " " << getMaskSize()
00023 << "\n";
00024
00025 }
00026
00027
00028 if (hsb != 0 && hsb != 1) {
00029 throw cms::Exception("L1RPCHsbConfig::getHsbMask")
00030 << "Wrong hsb index: " << hsb << "\n";
00031 }
00032 if ( hsb == 0 ){
00033 for (int i = 0 ; i < getMaskSize() ; ++i ) {m_hsb0[i] = mask[i];}
00034 }
00035
00036 if ( hsb == 1 ){
00037 for (int i = 0 ; i < getMaskSize() ; ++i ) {m_hsb1[i] = mask[i];}
00038 }
00039 }
00040
00041
00042 int L1RPCHsbConfig::getHsbMask(int hsb, int input) const {
00043
00044 if (input < 0 || input >= int(sizeof(m_hsb0)/(sizeof( m_hsb0[0] )) ) )
00045 {
00046 throw cms::Exception("L1RPCHsbConfig::getHsbMask")
00047 << "Wrong hsb input index: " << input << "\n";
00048 }
00049 if (hsb==0) {
00050 return m_hsb0[input];
00051 } else if (hsb==1) {
00052 return m_hsb1[input];
00053 } else {
00054 throw cms::Exception("L1RPCHsbConfig::getHsbMask")
00055 << "Wrong hsb index: " << hsb << "\n";
00056 }
00057
00058 return -1;
00059 }