CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiPixelVCal Class Reference

#include <SiPixelVCal.h>

Classes

struct  VCal
 

Public Types

using mapToDetId = std::map< uint32_t, float >
 

Public Member Functions

mapToDetId getAllOffsets () const
 
mapToDetId getAllSlopes () const
 
float getOffset (const uint32_t &) const
 
float getSlope (const uint32_t &) const
 
const std::map< unsigned int, VCal > & getSlopeAndOffset () const
 
VCal getSlopeAndOffset (const uint32_t &) const
 
void putSlopeAndOffset (std::map< unsigned int, VCal > &vcal)
 
bool putSlopeAndOffset (const uint32_t &, float &, float &)
 
 SiPixelVCal ()
 
 ~SiPixelVCal ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::map< unsigned int, VCalm_vcal
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 9 of file SiPixelVCal.h.

Member Typedef Documentation

◆ mapToDetId

using SiPixelVCal::mapToDetId = std::map<uint32_t, float>

Definition at line 14 of file SiPixelVCal.h.

Constructor & Destructor Documentation

◆ SiPixelVCal()

SiPixelVCal::SiPixelVCal ( )
inline

Definition at line 11 of file SiPixelVCal.h.

11 {};

◆ ~SiPixelVCal()

SiPixelVCal::~SiPixelVCal ( )
inline

Definition at line 12 of file SiPixelVCal.h.

12 {};

Member Function Documentation

◆ getAllOffsets()

SiPixelVCal::mapToDetId SiPixelVCal::getAllOffsets ( ) const

Definition at line 57 of file SiPixelVCal.cc.

References m_vcal, unpackBuffers-CaloStage1::offsets, and HcalDetIdTransform::transform().

57  {
58  std::map<uint32_t, float> offsets;
59  std::transform(m_vcal.begin(),
60  m_vcal.end(),
61  std::inserter(offsets, offsets.end()),
62  [](std::pair<uint32_t, SiPixelVCal::VCal> vcalentry) -> std::pair<uint32_t, float> {
63  return std::make_pair(vcalentry.first, vcalentry.second.offset);
64  });
65  return offsets;
66 }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ getAllSlopes()

SiPixelVCal::mapToDetId SiPixelVCal::getAllSlopes ( ) const

Definition at line 46 of file SiPixelVCal.cc.

References m_vcal, and HcalDetIdTransform::transform().

46  {
47  std::map<uint32_t, float> slopes;
48  std::transform(m_vcal.begin(),
49  m_vcal.end(),
50  std::inserter(slopes, slopes.end()),
51  [](std::pair<uint32_t, SiPixelVCal::VCal> vcalentry) -> std::pair<uint32_t, float> {
52  return std::make_pair(vcalentry.first, vcalentry.second.slope);
53  });
54  return slopes;
55 }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ getOffset()

float SiPixelVCal::getOffset ( const uint32_t &  pixid) const

Definition at line 37 of file SiPixelVCal.cc.

References l1ctLayer2EG_cff::id, and m_vcal.

37  {
38  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
39  if (id != m_vcal.end())
40  return id->second.offset;
41  else
42  edm::LogError("SiPixelVCal") << "SiPixelVCal offset for pixid " << pixid << " is not stored" << std::endl;
43  return -60.;
44 }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39

◆ getSlope()

float SiPixelVCal::getSlope ( const uint32_t &  pixid) const

Definition at line 28 of file SiPixelVCal.cc.

References l1ctLayer2EG_cff::id, and m_vcal.

28  {
29  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
30  if (id != m_vcal.end())
31  return id->second.slope;
32  else
33  edm::LogError("SiPixelVCal") << "SiPixelVCal slope for pixid " << pixid << " is not stored" << std::endl;
34  return 47.;
35 }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39

◆ getSlopeAndOffset() [1/2]

const std::map<unsigned int, VCal>& SiPixelVCal::getSlopeAndOffset ( ) const
inline

Definition at line 23 of file SiPixelVCal.h.

References m_vcal.

Referenced by SiPixelVCalReader::analyze().

23 { return m_vcal; }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39

◆ getSlopeAndOffset() [2/2]

SiPixelVCal::VCal SiPixelVCal::getSlopeAndOffset ( const uint32_t &  pixid) const

Definition at line 18 of file SiPixelVCal.cc.

References l1ctLayer2EG_cff::id, and m_vcal.

18  {
19  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
20  if (id != m_vcal.end())
21  return id->second;
22  else
23  edm::LogError("SiPixelVCal") << "SiPixelVCal for pixid " << pixid << " is not stored" << std::endl;
24  VCal vcal_default;
25  return vcal_default;
26 }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39

◆ putSlopeAndOffset() [1/2]

void SiPixelVCal::putSlopeAndOffset ( std::map< unsigned int, VCal > &  vcal)
inline

Definition at line 22 of file SiPixelVCal.h.

References m_vcal.

Referenced by SiPixelVCalDB::analyze().

22 { m_vcal = vcal; }
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39

◆ putSlopeAndOffset() [2/2]

bool SiPixelVCal::putSlopeAndOffset ( const uint32_t &  pixid,
float &  slopeValue,
float &  offsetValue 
)

Definition at line 6 of file SiPixelVCal.cc.

References m_vcal.

6  {
7  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
8  if (id != m_vcal.end()) {
9  edm::LogError("SiPixelVCal") << "SiPixelVCal for pixid " << pixid << " is already stored. Skipping this put"
10  << std::endl;
11  return false;
12  } else {
13  m_vcal[pixid] = {slopeValue, offsetValue};
14  }
15  return true;
16 }
Log< level::Error, false > LogError
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39

◆ serialize()

template<class Archive >
void SiPixelVCal::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 41 of file SiPixelVCal.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 41 of file SiPixelVCal.h.

Member Data Documentation

◆ m_vcal

std::map<unsigned int, VCal> SiPixelVCal::m_vcal
private