File indexing completed on 2023-03-17 10:50:41
0001 #include "DataFormats/METReco/interface/HcalCaloFlagTool.h"
0002 #include <cstring>
0003 #include <cstdio>
0004
0005 HcalCaloFlagTool::HcalCaloFlagTool(const std::string& releaseName)
0006 : releaseName_(releaseName), standardFormat_(false), major_(0), minor_(0), patch_(0), subpatch_(0) {
0007 int fields = sscanf(releaseName.c_str(), "CMSSW_%d_%d_%d_%d", &major_, &minor_, &patch_, &subpatch_);
0008 if (fields >= 3)
0009 standardFormat_ = true;
0010 }
0011
0012 std::string HcalCaloFlagTool::getFieldName(HcalSubdetector sd, int bit) const { return ""; }
0013
0014 int HcalCaloFlagTool::getFieldWidth(HcalSubdetector sd, int bit) const { return 0; }
0015
0016 int HcalCaloFlagTool::getFieldStart(HcalSubdetector sd, const std::string& field) const { return 0; }
0017
0018 int HcalCaloFlagTool::getFieldWidth(HcalSubdetector sd, const std::string& field) const { return 0; }
0019
0020 bool HcalCaloFlagTool::hasField(HcalSubdetector sd, const std::string& field) const {
0021 if (standardFormat_) {
0022 if (major_ < 3)
0023 return false;
0024 }
0025 return getFieldWidth(sd, field) > 0;
0026 }
0027
0028 bool HcalCaloFlagTool::hasField(HcalSubdetector sd, int bit) const {
0029 if (standardFormat_) {
0030 if (major_ < 3)
0031 return false;
0032 }
0033 return getFieldWidth(sd, bit) > 0;
0034 }