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 9 of file CTPPSPixelGainCalibrations.h.

Member Typedef Documentation

Definition at line 11 of file CTPPSPixelGainCalibrations.h.

Constructor & Destructor Documentation

CTPPSPixelGainCalibrations::CTPPSPixelGainCalibrations ( )
inline

Definition at line 13 of file CTPPSPixelGainCalibrations.h.

13 {}
virtual CTPPSPixelGainCalibrations::~CTPPSPixelGainCalibrations ( )
inlinevirtual

Definition at line 14 of file CTPPSPixelGainCalibrations.h.

References setGainCalibration(), and setGainCalibrations().

14 {}

Member Function Documentation

const CalibMap& CTPPSPixelGainCalibrations::getCalibMap ( ) const
inline
const CTPPSPixelGainCalibration & CTPPSPixelGainCalibrations::getGainCalibration ( const uint32_t &  detid) const

Definition at line 52 of file CTPPSPixelGainCalibrations.cc.

References m_calibrations.

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

52  { // returns the object does not change the map
53  CalibMap::const_iterator it = m_calibrations.find(detid);
54  if (it == m_calibrations.end())
55  throw cms::Exception("CTPPSPixelGainCalibrations: ") <<" No gain calibrations defined for detid ";
56 
57  return it->second;
58 
59 }
template<class Archive >
void CTPPSPixelGainCalibrations::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void CTPPSPixelGainCalibrations::setGainCalibration ( const uint32_t &  DetId,
const CTPPSPixelGainCalibration PixGains 
)

Definition at line 6 of file CTPPSPixelGainCalibrations.cc.

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(), and ~CTPPSPixelGainCalibrations().

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

Definition at line 39 of file CTPPSPixelGainCalibrations.cc.

References m_calibrations.

Referenced by ~CTPPSPixelGainCalibrations().

39  {
40  m_calibrations = PixGainsCalibs;
41 }
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 43 of file CTPPSPixelGainCalibrations.cc.

References m_calibrations.

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 }
int CTPPSPixelGainCalibrations::size ( void  ) const
inline

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 30 of file CTPPSPixelGainCalibrations.h.

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

Definition at line 30 of file CTPPSPixelGainCalibrations.h.

Member Data Documentation

CalibMap CTPPSPixelGainCalibrations::m_calibrations
private