CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
FakeCPE::Map Class Reference

#include <FakeCPE.h>

Public Types

using LocalValues = std::pair< LocalPoint, LocalError >
 

Public Member Functions

template<typename Cluster >
void add (const Cluster &cluster, const GeomDetUnit &gd, LocalValues const &lv)
 
void clear ()
 
void error (const GeomDetUnit &gd) const
 
template<typename Cluster >
LocalValues const & get (const Cluster &cluster, const GeomDetUnit &gd) const
 

Static Public Member Functions

static uint64_t encode (const SiPixelCluster &cluster, const GeomDetUnit &det)
 
static uint64_t encode (const SiStripCluster &cluster, const GeomDetUnit &det)
 

Private Attributes

LocalValues dummy
 
std::unordered_map< uint64_t, LocalValuesm_map
 

Detailed Description

Definition at line 22 of file FakeCPE.h.

Member Typedef Documentation

◆ LocalValues

Definition at line 24 of file FakeCPE.h.

Member Function Documentation

◆ add()

template<typename Cluster >
void FakeCPE::Map::add ( const Cluster &  cluster,
const GeomDetUnit gd,
LocalValues const &  lv 
)
inline

Definition at line 30 of file FakeCPE.h.

References encode(), and m_map.

Referenced by counter.Counter::register().

30  {
31  m_map[encode(cluster, gd)] = lv;
32  }
std::unordered_map< uint64_t, LocalValues > m_map
Definition: FakeCPE.h:57
static uint64_t encode(const SiPixelCluster &cluster, const GeomDetUnit &det)
Definition: FakeCPE.h:44

◆ clear()

void FakeCPE::Map::clear ( void  )
inline

Definition at line 25 of file FakeCPE.h.

References m_map.

25 { m_map.clear(); }
std::unordered_map< uint64_t, LocalValues > m_map
Definition: FakeCPE.h:57

◆ encode() [1/2]

static uint64_t FakeCPE::Map::encode ( const SiPixelCluster cluster,
const GeomDetUnit det 
)
inlinestatic

Definition at line 44 of file FakeCPE.h.

References GeomDet::geographicalId(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), DetId::rawId(), testProducerWithPsetDescEmpty_cfi::u1, MetAnalyzer::u2, and testProducerWithPsetDescEmpty_cfi::u3.

Referenced by add(), and get().

44  {
45  uint64_t u1 = det.geographicalId().rawId();
46  uint64_t u2 = cluster.minPixelRow();
47  uint64_t u3 = cluster.minPixelCol();
48  return (u1 << 32) | (u2 << 16) | u3;
49  }
int minPixelRow() const
int minPixelCol() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
unsigned long long uint64_t
Definition: Time.h:13
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ encode() [2/2]

static uint64_t FakeCPE::Map::encode ( const SiStripCluster cluster,
const GeomDetUnit det 
)
inlinestatic

Definition at line 50 of file FakeCPE.h.

References SiStripCluster::firstStrip(), GeomDet::geographicalId(), DetId::rawId(), testProducerWithPsetDescEmpty_cfi::u1, and MetAnalyzer::u2.

50  {
51  uint64_t u1 = det.geographicalId().rawId();
52  uint64_t u2 = cluster.firstStrip();
53  return (u1 << 32) | u2;
54  }
uint16_t firstStrip() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
unsigned long long uint64_t
Definition: Time.h:13
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ error()

void FakeCPE::Map::error ( const GeomDetUnit gd) const
inline

Definition at line 26 of file FakeCPE.h.

References GeomDet::geographicalId(), and DetId::rawId().

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag(), and get().

26  {
27  edm::LogError("FakeCPE") << "hit not found in det " << gd.geographicalId().rawId();
28  }
Log< level::Error, false > LogError
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ get()

template<typename Cluster >
LocalValues const& FakeCPE::Map::get ( const Cluster &  cluster,
const GeomDetUnit gd 
) const
inline

Definition at line 35 of file FakeCPE.h.

References dummy, encode(), error(), m_map, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), PixelFakeCPE::getParameters(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), and StripFakeCPE::localParameters().

35  {
36  auto p = m_map.find(encode(cluster, gd));
37  if (p != m_map.end()) {
38  return (*p).second;
39  }
40  error(gd);
41  return dummy;
42  }
LocalValues dummy
Definition: FakeCPE.h:58
std::unordered_map< uint64_t, LocalValues > m_map
Definition: FakeCPE.h:57
void error(const GeomDetUnit &gd) const
Definition: FakeCPE.h:26
static uint64_t encode(const SiPixelCluster &cluster, const GeomDetUnit &det)
Definition: FakeCPE.h:44

Member Data Documentation

◆ dummy

LocalValues FakeCPE::Map::dummy
private

Definition at line 58 of file FakeCPE.h.

Referenced by get().

◆ m_map

std::unordered_map<uint64_t, LocalValues> FakeCPE::Map::m_map
private

Definition at line 57 of file FakeCPE.h.

Referenced by add(), clear(), and get().