CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <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 6 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(), and pat::helper::MultiIsolator::print().

6  {
7  static const std::string UNDEFINED_UNDEFINED = "Undefined/Undefined";
8  if (bit & CoreBits ) return Core::bitToString( Core::Bits(bit) );
9  else if (bit & SelectionBits ) return Selection::bitToString( Selection::Bits(bit) );
10  else if (bit & OverlapBits ) return Overlap::bitToString( Overlap::Bits(bit) );
11  else if (bit & IsolationBits ) return Isolation::bitToString( Isolation::Bits(bit) );
12  else return UNDEFINED_UNDEFINED;
13 }
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:161
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:216
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:90
static const std::string & bitToString(Bits bit)
Definition: Flags.cc:50
uint32_t Flags::get ( const std::string &  str)
static

Definition at line 28 of file Flags.cc.

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

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

28  {
29  size_t idx = str.find_first_of("/");
30  if (idx != std::string::npos) {
31  std::string set = str.substr(0, idx);
32  if (set == "Core") return Core::get( str.substr(idx+1));
33  if (set == "Overlap") return Overlap::get( str.substr(idx+1));
34  if (set == "Isolation") return Isolation::get(str.substr(idx+1));
35  if (set == "Selection") return Selection::get(str.substr(idx+1));
36  }
37  return 0;
38 }
static Bits get(int8_t bit)
Definition: Flags.cc:125
static Bits get(const std::string &str)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static Bits get(const std::string &str)
static Bits get(const std::string &str)
uint32_t Flags::get ( const std::vector< std::string > &  str)
static
std::string Flags::maskToString ( uint32_t  bit)
static

Definition at line 15 of file Flags.cc.

References bitToString(), plotBeamSpotDB::first, i, run_regression::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

15  {
17  bool first = false;
18  for (uint32_t i = 1; i != 0; i <<= 1) {
19  if ( mask & i ) {
20  if (first) { first = false; } else { ret += " + "; }
21  ret += bitToString ( mask & i );
22  }
23  }
24  return ret;
25 }
int i
Definition: DBlmapReader.cc:9
static const std::string & bitToString(uint32_t bit)
Definition: Flags.cc:6
static bool pat::Flags::test ( uint32_t  val,
uint32_t  mask 
)
inlinestatic

Definition at line 28 of file Flags.h.

Referenced by TtSemiLepSignalSelMVATrainer::analyze(), pat::SelectorByFlags::operator()(), and TtSemiLepSignalSelMVAComputer::produce().

28 { return (val & mask) == 0; }
static bool pat::Flags::test ( const reco::Candidate c,
uint32_t  mask 
)
inlinestatic

Definition at line 29 of file Flags.h.

References reco::Candidate::status(), and test().

Referenced by test().

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