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
 
bool putSlopeAndOffset (const uint32_t &, float &, float &)
 
void putSlopeAndOffset (std::map< unsigned int, VCal > &vcal)
 
 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 55 of file SiPixelVCal.cc.

55  {
56  std::map<uint32_t, float> offsets;
57  std::transform(m_vcal.begin(),
58  m_vcal.end(),
59  std::inserter(offsets, offsets.end()),
60  [](std::pair<uint32_t, SiPixelVCal::VCal> vcalentry) -> std::pair<uint32_t, float> {
61  return std::make_pair(vcalentry.first, vcalentry.second.offset);
62  });
63  return offsets;
64 }

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

◆ getAllSlopes()

SiPixelVCal::mapToDetId SiPixelVCal::getAllSlopes ( ) const

Definition at line 44 of file SiPixelVCal.cc.

44  {
45  std::map<uint32_t, float> slopes;
46  std::transform(m_vcal.begin(),
47  m_vcal.end(),
48  std::inserter(slopes, slopes.end()),
49  [](std::pair<uint32_t, SiPixelVCal::VCal> vcalentry) -> std::pair<uint32_t, float> {
50  return std::make_pair(vcalentry.first, vcalentry.second.slope);
51  });
52  return slopes;
53 }

References m_vcal, and HcalDetIdTransform::transform().

◆ getOffset()

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

Definition at line 35 of file SiPixelVCal.cc.

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

References triggerObjects_cff::id, and m_vcal.

◆ getSlope()

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

Definition at line 26 of file SiPixelVCal.cc.

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

References triggerObjects_cff::id, and m_vcal.

◆ getSlopeAndOffset() [1/2]

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

Definition at line 23 of file SiPixelVCal.h.

23 { return m_vcal; }

References m_vcal.

◆ getSlopeAndOffset() [2/2]

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

Definition at line 16 of file SiPixelVCal.cc.

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

References triggerObjects_cff::id, and m_vcal.

◆ putSlopeAndOffset() [1/2]

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

Definition at line 4 of file SiPixelVCal.cc.

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

References m_vcal.

◆ putSlopeAndOffset() [2/2]

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

Definition at line 22 of file SiPixelVCal.h.

22 { m_vcal = vcal; }

References m_vcal.

◆ 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
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
SiPixelVCal::m_vcal
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
unpackBuffers-CaloStage1.offsets
offsets
Definition: unpackBuffers-CaloStage1.py:127
edm::Log
Definition: MessageLogger.h:70