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 (const reco::Candidate &c, uint32_t mask)
 
static bool test (uint32_t val, 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.

5  {
6  static const std::string UNDEFINED_UNDEFINED = "Undefined/Undefined";
7  if (bit & CoreBits)
8  return Core::bitToString(Core::Bits(bit));
9  else if (bit & SelectionBits)
11  else if (bit & OverlapBits)
13  else if (bit & IsolationBits)
15  else
16  return UNDEFINED_UNDEFINED;
17 }

References 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().

◆ get() [1/2]

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

Definition at line 35 of file Flags.cc.

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 }

References pat::Flags::Core::get(), pat::Flags::Overlap::get(), pat::Flags::Selection::get(), pat::Flags::Isolation::get(), heavyIonCSV_trainingSettings::idx, Selector< T >::set(), str, and AlCaHLTBitMon_QueryRunRegistry::string.

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

◆ 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.

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 }

References bitToString(), first, mps_fire::i, runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ test() [1/2]

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

Definition at line 29 of file Flags.h.

29 { return test(c.status(), mask); }

References c, and test().

Referenced by edmIntegrityCheck.IntegrityCheck::report(), edmIntegrityCheck.IntegrityCheck::structured(), and test().

◆ test() [2/2]

static bool pat::Flags::test ( uint32_t  val,
uint32_t  mask 
)
inlinestatic
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
pat::Flags::Overlap::Bits
Bits
Definition: Flags.h:54
mps_fire.i
i
Definition: mps_fire.py:428
pat::Flags::Isolation::bitToString
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:255
pat::Flags::AllBits
Definition: Flags.h:21
pat::Flags::Core::get
static Bits get(const std::string &str)
pat::Flags::Isolation::Bits
Bits
Definition: Flags.h:97
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
pat::Flags::Core::bitToString
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:59
pat::Flags::bitToString
static const std::string & bitToString(uint32_t bit)
Definition: Flags.cc:5
pat::Flags::test
static bool test(uint32_t val, uint32_t mask)
Definition: Flags.h:28
str
#define str(s)
Definition: TestProcessor.cc:52
pat::Flags::CoreBits
Definition: Flags.h:22
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
pat::Flags::Core::Bits
Bits
Definition: Flags.h:38
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pat::Flags::SelectionBits
Definition: Flags.h:23
pat::Flags::Selection::bitToString
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:104
pat::Flags::Isolation::get
static Bits get(const std::string &str)
pat::Flags::IsolationBits
Definition: Flags.h:25
pat::Flags::Selection::Bits
Bits
Definition: Flags.h:74
pat::Flags::Overlap::bitToString
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:190
pat::Flags::OverlapBits
Definition: Flags.h:24
heppy_batch.val
val
Definition: heppy_batch.py:351
pat::Flags::Selection::get
static Bits get(int8_t bit)
Definition: Flags.cc:142
pat::Flags::Overlap::get
static Bits get(const std::string &str)
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
pat::Flags::get
static uint32_t get(const std::string &str)
Definition: Flags.cc:35