CMS 3D CMS Logo

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

#include <SiPixelQualityProbabilities.h>

Public Types

typedef std::map< unsigned int, probabilityVecprobabilityMap
 
typedef std::vector< std::pair< std::string, float > > probabilityVec
 

Public Member Functions

std::vector< unsigned int > getPileUpBins () const
 
probabilityVec getProbabilities (const unsigned int puBin) const
 
const probabilityVecgetProbabilities (const unsigned int puBin)
 
const probabilityMapgetProbability_Map () const
 
double nelements (const int puBin) const
 
void print (std::ostream &os) const
 
void printAll () const
 
void setProbabilities (const unsigned int puBin, const probabilityVec &theProbabilities)
 
 SiPixelQualityProbabilities ()
 
 SiPixelQualityProbabilities (const SiPixelQualityProbabilities &rhs)
 
double size () const
 
virtual ~SiPixelQualityProbabilities ()
 

Private Member Functions

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

Private Attributes

probabilityMap m_probabilities
 

Friends

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

Detailed Description

Definition at line 10 of file SiPixelQualityProbabilities.h.

Member Typedef Documentation

Definition at line 13 of file SiPixelQualityProbabilities.h.

typedef std::vector<std::pair<std::string, float> > SiPixelQualityProbabilities::probabilityVec

Definition at line 12 of file SiPixelQualityProbabilities.h.

Constructor & Destructor Documentation

SiPixelQualityProbabilities::SiPixelQualityProbabilities ( )
inline

Definition at line 15 of file SiPixelQualityProbabilities.h.

15 {}
SiPixelQualityProbabilities::SiPixelQualityProbabilities ( const SiPixelQualityProbabilities rhs)
inline

Definition at line 16 of file SiPixelQualityProbabilities.h.

References getProbability_Map(), and m_probabilities.

const probabilityMap & getProbability_Map() const
virtual SiPixelQualityProbabilities::~SiPixelQualityProbabilities ( )
inlinevirtual

Definition at line 17 of file SiPixelQualityProbabilities.h.

References setProbabilities().

17 {}

Member Function Documentation

std::vector< unsigned int > SiPixelQualityProbabilities::getPileUpBins ( ) const

Definition at line 66 of file SiPixelQualityProbabilities.cc.

References trigObjTnPSource_cfi::bins, and m_probabilities.

Referenced by nelements().

66  {
67  std::vector<unsigned int> bins;
68  bins.reserve(m_probabilities.size());
69 
70  for (auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
71  bins.push_back(it->first);
72  }
73  return bins;
74 }
SiPixelQualityProbabilities::probabilityVec SiPixelQualityProbabilities::getProbabilities ( const unsigned int  puBin) const

Definition at line 18 of file SiPixelQualityProbabilities.cc.

References Exception, and m_probabilities.

Referenced by SiPixelDigitizerAlgorithm::chooseScenario(), and getProbability_Map().

19  {
20  probabilityMap::const_iterator it = m_probabilities.find(puBin);
21 
22  if (it != m_probabilities.end()) {
23  return it->second;
24  } else {
25  throw cms::Exception("SiPixelQualityProbabilities") << "No Probabilities are defined for PU bin " << puBin << "\n";
26  }
27 }
const SiPixelQualityProbabilities::probabilityVec & SiPixelQualityProbabilities::getProbabilities ( const unsigned int  puBin)

Definition at line 30 of file SiPixelQualityProbabilities.cc.

References Exception, and m_probabilities.

31  {
32  probabilityMap::const_iterator it = m_probabilities.find(puBin);
33 
34  if (it != m_probabilities.end()) {
35  return it->second;
36  } else {
37  throw cms::Exception("SiPixelQualityProbabilities") << "No Probabilities are defined for PU bin " << puBin << "\n";
38  }
39 }
const probabilityMap& SiPixelQualityProbabilities::getProbability_Map ( ) const
inline

Definition at line 21 of file SiPixelQualityProbabilities.h.

References getProbabilities(), and m_probabilities.

Referenced by SiPixelQualityProbabilities().

double SiPixelQualityProbabilities::nelements ( const int  puBin) const
inline

Definition at line 27 of file SiPixelQualityProbabilities.h.

References getPileUpBins(), m_probabilities, print(), and printAll().

27 { return m_probabilities.at(puBin).size(); }
void SiPixelQualityProbabilities::print ( std::ostream &  os) const

Definition at line 56 of file SiPixelQualityProbabilities.cc.

References mps_splice::entry, and m_probabilities.

Referenced by nelements(), and operator<<().

56  {
57  for (auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
58  os << "PU :" << it->first << " \n ";
59  for (const auto &entry : it->second) {
60  os << "SiPixelQuality snapshot: " << entry.first << " |probability: " << entry.second << std::endl;
61  }
62  }
63 }
void SiPixelQualityProbabilities::printAll ( ) const

Definition at line 42 of file SiPixelQualityProbabilities.cc.

References mps_splice::entry, and m_probabilities.

Referenced by nelements().

42  {
43  edm::LogVerbatim("SiPixelQualityProbabilities") << "SiPixelQualityProbabilities::printAll()";
44  edm::LogVerbatim("SiPixelQualityProbabilities") << " ================================================================"
45  "===================================================";
46  for (auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
47  edm::LogVerbatim("SiPixelQualityProbabilities") << "PU :" << it->first << " \n ";
48  for (const auto &entry : it->second) {
49  edm::LogVerbatim("SiPixelQualityProbabilities")
50  << "SiPixelQuality snapshot: " << entry.first << " |probability: " << entry.second << std::endl;
51  }
52  }
53 }
template<class Archive >
void SiPixelQualityProbabilities::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiPixelQualityProbabilities::setProbabilities ( const unsigned int  puBin,
const probabilityVec theProbabilities 
)

Definition at line 8 of file SiPixelQualityProbabilities.cc.

References m_probabilities.

Referenced by ~SiPixelQualityProbabilities().

8  {
9  if (m_probabilities.find(puBin) != m_probabilities.end()) {
10  edm::LogWarning("SiPixelQualityProbabilities") << "PU bin: " << puBin << " is already in the map!" << std::endl;
11  return;
12  } else {
13  m_probabilities.emplace(puBin, theProbabilities);
14  }
15 }
double SiPixelQualityProbabilities::size ( void  ) const
inline

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 38 of file SiPixelQualityProbabilities.h.

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

Definition at line 38 of file SiPixelQualityProbabilities.h.

Member Data Documentation

probabilityMap SiPixelQualityProbabilities::m_probabilities
private