CMS 3D CMS Logo

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

#include <CTPPSPixelGainCalibrations.h>

Public Types

typedef std::map< uint32_t, CTPPSPixelGainCalibrationCalibMap
 

Public Member Functions

 CTPPSPixelGainCalibrations ()
 
const CalibMapgetCalibMap () const
 
const CTPPSPixelGainCalibrationgetGainCalibration (const uint32_t &detid) const
 
void setGainCalibration (const uint32_t &DetId, const CTPPSPixelGainCalibration &PixGains)
 
void setGainCalibration (const uint32_t &DetId, const std::vector< float > &peds, const std::vector< float > &gains)
 
void setGainCalibrations (const CalibMap &PixGainsCalibs)
 
void setGainCalibrations (const std::vector< uint32_t > &detidlist, const std::vector< std::vector< float >> &peds, const std::vector< std::vector< float >> &gains)
 
int size () const
 
virtual ~CTPPSPixelGainCalibrations ()
 

Private Member Functions

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

Private Attributes

CalibMap m_calibrations
 

Friends

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

Detailed Description

Definition at line 8 of file CTPPSPixelGainCalibrations.h.

Member Typedef Documentation

◆ CalibMap

Definition at line 10 of file CTPPSPixelGainCalibrations.h.

Constructor & Destructor Documentation

◆ CTPPSPixelGainCalibrations()

CTPPSPixelGainCalibrations::CTPPSPixelGainCalibrations ( )
inline

Definition at line 12 of file CTPPSPixelGainCalibrations.h.

12 {}

◆ ~CTPPSPixelGainCalibrations()

virtual CTPPSPixelGainCalibrations::~CTPPSPixelGainCalibrations ( )
inlinevirtual

Definition at line 13 of file CTPPSPixelGainCalibrations.h.

13 {}

Member Function Documentation

◆ getCalibMap()

const CalibMap& CTPPSPixelGainCalibrations::getCalibMap ( ) const
inline

Definition at line 22 of file CTPPSPixelGainCalibrations.h.

22 { return m_calibrations; }

References m_calibrations.

Referenced by CTPPSPixGainCalibsESAnalyzer::analyze().

◆ getGainCalibration()

const CTPPSPixelGainCalibration & CTPPSPixelGainCalibrations::getGainCalibration ( const uint32_t &  detid) const

Definition at line 52 of file CTPPSPixelGainCalibrations.cc.

53  { // returns the object does not change the map
54  CalibMap::const_iterator it = m_calibrations.find(detid);
55  if (it == m_calibrations.end())
56  throw cms::Exception("CTPPSPixelGainCalibrations: ") << " No gain calibrations defined for detid ";
57 
58  return it->second;
59 }

References m_calibrations.

Referenced by CTPPSPixGainCalibsESAnalyzer::analyze(), RPixDetClusterizer::calibrate(), and RPixDummyROCSimulator::ConvertChargeToHits().

◆ serialize()

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

◆ setGainCalibration() [1/2]

void CTPPSPixelGainCalibrations::setGainCalibration ( const uint32_t &  DetId,
const CTPPSPixelGainCalibration PixGains 
)

Definition at line 5 of file CTPPSPixelGainCalibrations.cc.

5  {
6  if (detid != PixGains.getDetId()) { // if no detid set in the pixgains
7  CTPPSPixelGainCalibration newPixGains = PixGains; //maybe the copy works?
8  newPixGains.setIndexes(detid); //private accessor, only friend class can use it
9  edm::LogInfo("CTPPSPixelGainCalibrations")
10  << "newPixGains detId = " << newPixGains.getDetId() << " ; iBegin = " << newPixGains.getIBegin()
11  << " ; iEnd = " << newPixGains.getIEnd() << " ; nCols = " << newPixGains.getNCols()
12  << " ; nRows =" << newPixGains.getNRows();
13 
14  int npix = newPixGains.getIEnd();
15  //bool dead,noisy;
16  if (npix != 0)
17  edm::LogInfo("CTPPSPixelGainCalibrations")
18  << "newPixGains Ped[0] = " << newPixGains.getPed(0) << " ; Gain[0] = " << newPixGains.getGain(0)
19  << " ; dead = " << newPixGains.isDead(0) << " ; noisy = " << newPixGains.isNoisy(0);
20  else
21  edm::LogError("CTPPSPixelGainCalibrations")
22  << "looks like setting gain calibrations did not work, npix is " << npix;
23 
24  m_calibrations[detid] = newPixGains;
25  }
26 
27  else
28  m_calibrations[detid] = PixGains;
29 }

References CTPPSPixelGainCalibration::getDetId(), CTPPSPixelGainCalibration::getGain(), CTPPSPixelGainCalibration::getIBegin(), CTPPSPixelGainCalibration::getIEnd(), CTPPSPixelGainCalibration::getNCols(), CTPPSPixelGainCalibration::getNRows(), CTPPSPixelGainCalibration::getPed(), CTPPSPixelGainCalibration::isDead(), CTPPSPixelGainCalibration::isNoisy(), m_calibrations, and CTPPSPixelGainCalibration::setIndexes().

Referenced by WriteCTPPSPixGainCalibrations::fillDB().

◆ setGainCalibration() [2/2]

void CTPPSPixelGainCalibrations::setGainCalibration ( const uint32_t &  DetId,
const std::vector< float > &  peds,
const std::vector< float > &  gains 
)

Definition at line 31 of file CTPPSPixelGainCalibrations.cc.

33  {
34  m_calibrations[detid] = CTPPSPixelGainCalibration(detid, peds, gains);
35 }

References m_calibrations.

◆ setGainCalibrations() [1/2]

void CTPPSPixelGainCalibrations::setGainCalibrations ( const CalibMap PixGainsCalibs)

Definition at line 37 of file CTPPSPixelGainCalibrations.cc.

37  {
38  m_calibrations = PixGainsCalibs;
39 }

References m_calibrations.

◆ setGainCalibrations() [2/2]

void CTPPSPixelGainCalibrations::setGainCalibrations ( const std::vector< uint32_t > &  detidlist,
const std::vector< std::vector< float >> &  peds,
const std::vector< std::vector< float >> &  gains 
)

Definition at line 41 of file CTPPSPixelGainCalibrations.cc.

43  {
44  int nids = detidlist.size();
45  for (int detid = 0; detid < nids; ++detid) {
46  const std::vector<float>& pedsvec = peds[detid];
47  const std::vector<float>& gainsvec = gains[detid];
48  m_calibrations[detid] = CTPPSPixelGainCalibration(detid, pedsvec, gainsvec);
49  }
50 }

References m_calibrations.

◆ size()

int CTPPSPixelGainCalibrations::size ( void  ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 31 of file CTPPSPixelGainCalibrations.h.

◆ cond::serialization::access

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

Definition at line 31 of file CTPPSPixelGainCalibrations.h.

Member Data Documentation

◆ m_calibrations

CalibMap CTPPSPixelGainCalibrations::m_calibrations
private
CTPPSPixelGainCalibration::getIBegin
uint32_t getIBegin() const
Definition: CTPPSPixelGainCalibration.h:78
CTPPSPixelGainCalibration::getNCols
uint32_t getNCols() const
Definition: CTPPSPixelGainCalibration.h:77
CTPPSPixelGainCalibration::getDetId
uint32_t getDetId() const
Definition: CTPPSPixelGainCalibration.h:76
edm::LogInfo
Definition: MessageLogger.h:254
CTPPSPixelGainCalibration::setIndexes
void setIndexes(const uint32_t &detId)
Definition: CTPPSPixelGainCalibration.cc:105
CTPPSPixelGainCalibrations::m_calibrations
CalibMap m_calibrations
Definition: CTPPSPixelGainCalibrations.h:29
CTPPSPixelGainCalibration::isDead
bool isDead(const uint32_t ipix) const
Definition: CTPPSPixelGainCalibration.h:73
CTPPSPixelGainCalibration
Definition: CTPPSPixelGainCalibration.h:27
CTPPSPixelGainCalibration::getGain
float getGain(const int &col, const int &row) const
Definition: CTPPSPixelGainCalibration.cc:136
CTPPSPixelGainCalibration::getNRows
uint32_t getNRows() const
Definition: CTPPSPixelGainCalibration.h:80
edm::LogError
Definition: MessageLogger.h:183
CTPPSPixelGainCalibration::getPed
float getPed(const int &col, const int &row) const
Definition: CTPPSPixelGainCalibration.cc:122
CTPPSPixelGainCalibration::getIEnd
uint32_t getIEnd() const
Definition: CTPPSPixelGainCalibration.h:79
cms::Exception
Definition: Exception.h:70
CTPPSPixelGainCalibration::isNoisy
bool isNoisy(const uint32_t ipix) const
Definition: CTPPSPixelGainCalibration.h:74