CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/RecoLocalCalo/HcalRecAlgos/src/HcalCaloFlagLabels.cc

Go to the documentation of this file.
00001 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalCaloFlagLabels.h"
00002 #include <string.h>
00003 #include <cstdio>
00004 
00005 HcalCaloFlagTool::HcalCaloFlagTool(const std::string& releaseName) : 
00006   releaseName_(releaseName),
00007   standardFormat_(false),
00008   major_(0),
00009   minor_(0),
00010   patch_(0),
00011   subpatch_(0)
00012 {
00013   int fields=sscanf(releaseName.c_str(),"CMSSW_%d_%d_%d_%d",&major_,&minor_,&patch_,&subpatch_);
00014   if (fields>=3) standardFormat_=true;
00015 }
00016 
00017 std::string HcalCaloFlagTool::getFieldName(HcalSubdetector sd, int bit) const {
00018   return "";
00019 }
00020 
00021 int HcalCaloFlagTool::getFieldWidth(HcalSubdetector sd, int bit) const {
00022   return 0;
00023 }
00024 
00025 int HcalCaloFlagTool::getFieldStart(HcalSubdetector sd, const std::string& field) const {
00026   return 0;
00027 }
00028 
00029 int HcalCaloFlagTool::getFieldWidth(HcalSubdetector sd, const std::string& field) const {
00030   return 0;
00031 }
00032 
00033 bool HcalCaloFlagTool::hasField(HcalSubdetector sd, const std::string& field) const {
00034   if (standardFormat_) {
00035     if (major_<3) return false;
00036   } 
00037   return getFieldWidth(sd,field)>0;
00038 }
00039 
00040 bool HcalCaloFlagTool::hasField(HcalSubdetector sd, int bit) const {
00041   if (standardFormat_) {
00042     if (major_<3) return false;
00043   } 
00044   return getFieldWidth(sd,bit)>0;
00045 }