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

◆ 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(), dqmdumpme::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 HltBtagPostValidation_cff::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:355
pat::Flags::Overlap::Bits
Bits
Definition: Flags.h:54
mps_fire.i
i
Definition: mps_fire.py:355
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)
training_settings.idx
idx
Definition: training_settings.py:16
dqmdumpme.first
first
Definition: dqmdumpme.py:55
pat::Flags::Isolation::Bits
Bits
Definition: Flags.h:97
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:48
pat::Flags::CoreBits
Definition: Flags.h:22
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
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
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)
pat::Flags::get
static uint32_t get(const std::string &str)
Definition: Flags.cc:35