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 24 of file FakeCPE.h.

Member Typedef Documentation

Definition at line 26 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 { m_map[encode(cluster,gd)] = lv; }
static uint64_t encode(const SiPixelCluster &cluster, const GeomDetUnit &det)
Definition: FakeCPE.h:40
std::unordered_map< uint64_t, LocalValues > m_map
Definition: FakeCPE.h:53
void FakeCPE::Map::clear ( void  )
inline

Definition at line 27 of file FakeCPE.h.

References m_map.

27 {m_map.clear();}
std::unordered_map< uint64_t, LocalValues > m_map
Definition: FakeCPE.h:53
static uint64_t FakeCPE::Map::encode ( const SiPixelCluster cluster,
const GeomDetUnit det 
)
inlinestatic

Definition at line 40 of file FakeCPE.h.

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

Referenced by add(), and get().

40  {
41  uint64_t u1 = det.geographicalId().rawId();
42  uint64_t u2 = cluster.minPixelRow();
43  uint64_t u3 = cluster.minPixelCol();
44  return (u1<<32) | (u2<<16) | u3;
45  }
int minPixelCol() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int minPixelRow() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
unsigned long long uint64_t
Definition: Time.h:15
static uint64_t FakeCPE::Map::encode ( const SiStripCluster cluster,
const GeomDetUnit det 
)
inlinestatic

Definition at line 46 of file FakeCPE.h.

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

46  {
47  uint64_t u1 = det.geographicalId().rawId();
48  uint64_t u2 = cluster.firstStrip();
49  return (u1<<32) | u2;
50  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
uint16_t firstStrip() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
unsigned long long uint64_t
Definition: Time.h:15
void FakeCPE::Map::error ( const GeomDetUnit gd) const
inline

Definition at line 28 of file FakeCPE.h.

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

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

28 {edm::LogError("FakeCPE") << "hit not found in det " << gd.geographicalId().rawId(); }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
template<typename Cluster >
LocalValues const& FakeCPE::Map::get ( const Cluster &  cluster,
const GeomDetUnit gd 
) const
inline

Definition at line 33 of file FakeCPE.h.

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

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

33  {
34  auto p = m_map.find(encode(cluster,gd));
35  if (p!=m_map.end()) { return (*p).second; }
36  error(gd);
37  return dummy;
38  }
LocalValues dummy
Definition: FakeCPE.h:54
void error(const GeomDetUnit &gd) const
Definition: FakeCPE.h:28
static uint64_t encode(const SiPixelCluster &cluster, const GeomDetUnit &det)
Definition: FakeCPE.h:40
std::unordered_map< uint64_t, LocalValues > m_map
Definition: FakeCPE.h:53

Member Data Documentation

LocalValues FakeCPE::Map::dummy
private

Definition at line 54 of file FakeCPE.h.

Referenced by get().

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

Definition at line 53 of file FakeCPE.h.

Referenced by add(), clear(), get(), and FakeCPE::map().