CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
LocalValues
m_map
 

Detailed Description

Definition at line 22 of file FakeCPE.h.

Member Typedef Documentation

Definition at line 24 of file FakeCPE.h.

Member Function Documentation

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
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
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(), MetAnalyzer::u1, and MetAnalyzer::u2.

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 minPixelCol() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int minPixelRow() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
unsigned long long uint64_t
Definition: Time.h:13
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(), MetAnalyzer::u1, and MetAnalyzer::u2.

50  {
51  uint64_t u1 = det.geographicalId().rawId();
52  uint64_t u2 = cluster.firstStrip();
53  return (u1 << 32) | u2;
54  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
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
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 get().

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

LocalValues FakeCPE::Map::dummy
private

Definition at line 58 of file FakeCPE.h.

Referenced by get().

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