CMS 3D CMS Logo

List of all members | Classes | Public Types | Static Public Member Functions
pat::Flags Class Reference

Flags used in PAT, and static translator from flags to strings. More...

#include "DataFormats/PatCandidates/interface/Flags.h"

Classes

struct  Core
 
struct  Isolation
 
struct  Overlap
 
struct  Selection
 

Public Types

enum  CleanerFlags {
  AllBits = 0xFFFFFFFF, CoreBits = 0x0000000F, SelectionBits = 0x0000FFF0, OverlapBits = 0x00FF0000,
  IsolationBits = 0xFF000000
}
 

Static Public Member Functions

static const std::string & bitToString (uint32_t bit)
 
static uint32_t get (const std::string &str)
 
static uint32_t get (const std::vector< std::string > &str)
 
static std::string maskToString (uint32_t bit)
 
static bool test (uint32_t val, uint32_t mask)
 
static bool test (const reco::Candidate &c, uint32_t mask)
 

Detailed Description

Flags used in PAT, and static translator from flags to strings.

Author
Steven Lowette

Definition at line 19 of file Flags.h.

Member Enumeration Documentation

◆ CleanerFlags

Enumerator
AllBits 
CoreBits 
SelectionBits 
OverlapBits 
IsolationBits 

Definition at line 20 of file Flags.h.

20  {
21  AllBits = 0xFFFFFFFF,
22  CoreBits = 0x0000000F,
23  SelectionBits = 0x0000FFF0,
24  OverlapBits = 0x00FF0000,
25  IsolationBits = 0xFF000000
26 
27  };

Member Function Documentation

◆ bitToString()

const std::string & Flags::bitToString ( uint32_t  bit)
static

Definition at line 5 of file Flags.cc.

References triggerObjects_cff::bit, pat::Flags::Core::bitToString(), pat::Flags::Overlap::bitToString(), pat::Flags::Selection::bitToString(), pat::Flags::Isolation::bitToString(), CoreBits, IsolationBits, OverlapBits, SelectionBits, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by maskToString(), and pat::helper::MultiIsolator::print().

5  {
6  static const std::string UNDEFINED_UNDEFINED = "Undefined/Undefined";
7  if (bit & CoreBits)
9  else if (bit & SelectionBits)
11  else if (bit & OverlapBits)
13  else if (bit & IsolationBits)
15  else
16  return UNDEFINED_UNDEFINED;
17 }
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:190
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:255
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:104
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:59

◆ get() [1/2]

uint32_t Flags::get ( const std::string &  str)
static

Definition at line 35 of file Flags.cc.

References pat::Flags::Core::get(), pat::Flags::Overlap::get(), pat::Flags::Selection::get(), pat::Flags::Isolation::get(), heavyIonCSV_trainingSettings::idx, str, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

35  {
36  size_t idx = str.find_first_of('/');
37  if (idx != std::string::npos) {
38  std::string set = str.substr(0, idx);
39  if (set == "Core")
40  return Core::get(str.substr(idx + 1));
41  if (set == "Overlap")
42  return Overlap::get(str.substr(idx + 1));
43  if (set == "Isolation")
44  return Isolation::get(str.substr(idx + 1));
45  if (set == "Selection")
46  return Selection::get(str.substr(idx + 1));
47  }
48  return 0;
49 }
static Bits get(int8_t bit)
Definition: Flags.cc:142
static Bits get(const std::string &str)
static Bits get(const std::string &str)
static Bits get(const std::string &str)
#define str(s)

◆ get() [2/2]

uint32_t Flags::get ( const std::vector< std::string > &  str)
static

◆ maskToString()

std::string Flags::maskToString ( uint32_t  bit)
static

Definition at line 19 of file Flags.cc.

References bitToString(), dqmdumpme::first, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
21  bool first = false;
22  for (uint32_t i = 1; i != 0; i <<= 1) {
23  if (mask & i) {
24  if (first) {
25  first = false;
26  } else {
27  ret += " + ";
28  }
29  ret += bitToString(mask & i);
30  }
31  }
32  return ret;
33 }
static const std::string & bitToString(uint32_t bit)
Definition: Flags.cc:5
ret
prodAgent to be discontinued

◆ test() [1/2]

static bool pat::Flags::test ( uint32_t  val,
uint32_t  mask 
)
inlinestatic

◆ test() [2/2]

static bool pat::Flags::test ( const reco::Candidate c,
uint32_t  mask 
)
inlinestatic