CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalCaloFlagTool Class Reference

Provides interpretation of flag bits with understanding of CMSSW version dependence. More...

#include <HcalCaloFlagTool.h>

Public Member Functions

std::string getFieldName (HcalSubdetector sd, int bit) const
 
int getFieldStart (HcalSubdetector sd, const std::string &field) const
 
int getFieldWidth (HcalSubdetector sd, int bit) const
 
int getFieldWidth (HcalSubdetector sd, const std::string &field) const
 
bool hasField (HcalSubdetector sd, const std::string &field) const
 
bool hasField (HcalSubdetector sd, int bit) const
 
 HcalCaloFlagTool (const std::string &releaseName)
 

Private Attributes

int major_
 
int minor_
 
int patch_
 
std::string releaseName_
 
bool standardFormat_
 
int subpatch_
 

Detailed Description

Provides interpretation of flag bits with understanding of CMSSW version dependence.

Definition at line 12 of file HcalCaloFlagTool.h.

Constructor & Destructor Documentation

◆ HcalCaloFlagTool()

HcalCaloFlagTool::HcalCaloFlagTool ( const std::string &  releaseName)

Definition at line 5 of file HcalCaloFlagTool.cc.

References l1GtPatternGenerator_cfi::fields, major_, minor_, patch_, standardFormat_, and subpatch_.

6  : releaseName_(releaseName), standardFormat_(false), major_(0), minor_(0), patch_(0), subpatch_(0) {
7  int fields = sscanf(releaseName.c_str(), "CMSSW_%d_%d_%d_%d", &major_, &minor_, &patch_, &subpatch_);
8  if (fields >= 3)
9  standardFormat_ = true;
10 }
std::string releaseName_

Member Function Documentation

◆ getFieldName()

std::string HcalCaloFlagTool::getFieldName ( HcalSubdetector  sd,
int  bit 
) const

Definition at line 12 of file HcalCaloFlagTool.cc.

12 { return ""; }

◆ getFieldStart()

int HcalCaloFlagTool::getFieldStart ( HcalSubdetector  sd,
const std::string &  field 
) const

Definition at line 16 of file HcalCaloFlagTool.cc.

16 { return 0; }

◆ getFieldWidth() [1/2]

int HcalCaloFlagTool::getFieldWidth ( HcalSubdetector  sd,
int  bit 
) const

Definition at line 14 of file HcalCaloFlagTool.cc.

Referenced by hasField().

14 { return 0; }

◆ getFieldWidth() [2/2]

int HcalCaloFlagTool::getFieldWidth ( HcalSubdetector  sd,
const std::string &  field 
) const

Definition at line 18 of file HcalCaloFlagTool.cc.

18 { return 0; }

◆ hasField() [1/2]

bool HcalCaloFlagTool::hasField ( HcalSubdetector  sd,
const std::string &  field 
) const

Definition at line 20 of file HcalCaloFlagTool.cc.

References getFieldWidth(), major_, and standardFormat_.

20  {
21  if (standardFormat_) {
22  if (major_ < 3)
23  return false;
24  }
25  return getFieldWidth(sd, field) > 0;
26 }
int getFieldWidth(HcalSubdetector sd, int bit) const

◆ hasField() [2/2]

bool HcalCaloFlagTool::hasField ( HcalSubdetector  sd,
int  bit 
) const

Definition at line 28 of file HcalCaloFlagTool.cc.

References triggerObjects_cff::bit, getFieldWidth(), major_, and standardFormat_.

28  {
29  if (standardFormat_) {
30  if (major_ < 3)
31  return false;
32  }
33  return getFieldWidth(sd, bit) > 0;
34 }
int getFieldWidth(HcalSubdetector sd, int bit) const

Member Data Documentation

◆ major_

int HcalCaloFlagTool::major_
private

Definition at line 25 of file HcalCaloFlagTool.h.

Referenced by hasField(), and HcalCaloFlagTool().

◆ minor_

int HcalCaloFlagTool::minor_
private

Definition at line 25 of file HcalCaloFlagTool.h.

Referenced by HcalCaloFlagTool().

◆ patch_

int HcalCaloFlagTool::patch_
private

Definition at line 25 of file HcalCaloFlagTool.h.

Referenced by HcalCaloFlagTool().

◆ releaseName_

std::string HcalCaloFlagTool::releaseName_
private

Definition at line 23 of file HcalCaloFlagTool.h.

◆ standardFormat_

bool HcalCaloFlagTool::standardFormat_
private

Definition at line 24 of file HcalCaloFlagTool.h.

Referenced by hasField(), and HcalCaloFlagTool().

◆ subpatch_

int HcalCaloFlagTool::subpatch_
private

Definition at line 25 of file HcalCaloFlagTool.h.

Referenced by HcalCaloFlagTool().