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

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

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

Definition at line 5 of file Flags.cc.

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(), pat::helper::MultiIsolator::print(), and test().

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 }
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
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(), training_settings::idx, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.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)
uint32_t Flags::get ( const std::vector< std::string > &  str)
static
std::string Flags::maskToString ( uint32_t  bit)
static

Definition at line 19 of file Flags.cc.

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

Referenced by test().

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

Definition at line 29 of file Flags.h.

References bitToString(), maskToString(), reco::Candidate::status(), str, AlCaHLTBitMon_QueryRunRegistry::string, and test().

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

29 { return test(c.status(), mask); }
static bool test(uint32_t val, uint32_t mask)
Definition: Flags.h:28
virtual int status() const =0
status word