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
 
const probabilityVecgetProbabilities (const unsigned int puBin)
 
probabilityVec getProbabilities (const unsigned int puBin) const
 
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

◆ probabilityMap

Definition at line 13 of file SiPixelQualityProbabilities.h.

◆ probabilityVec

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

Definition at line 12 of file SiPixelQualityProbabilities.h.

Constructor & Destructor Documentation

◆ SiPixelQualityProbabilities() [1/2]

SiPixelQualityProbabilities::SiPixelQualityProbabilities ( )
inline

Definition at line 15 of file SiPixelQualityProbabilities.h.

15 {}

◆ SiPixelQualityProbabilities() [2/2]

SiPixelQualityProbabilities::SiPixelQualityProbabilities ( const SiPixelQualityProbabilities rhs)
inline

Definition at line 16 of file SiPixelQualityProbabilities.h.

References getProbability_Map(), and m_probabilities.

◆ ~SiPixelQualityProbabilities()

virtual SiPixelQualityProbabilities::~SiPixelQualityProbabilities ( )
inlinevirtual

Definition at line 17 of file SiPixelQualityProbabilities.h.

17 {}

Member Function Documentation

◆ getPileUpBins()

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

Definition at line 66 of file SiPixelQualityProbabilities.cc.

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 }

References trigObjTnPSource_cfi::bins, and m_probabilities.

◆ getProbabilities() [1/2]

const SiPixelQualityProbabilities::probabilityVec & SiPixelQualityProbabilities::getProbabilities ( const unsigned int  puBin)

Definition at line 30 of file SiPixelQualityProbabilities.cc.

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 }

References Exception, and m_probabilities.

◆ getProbabilities() [2/2]

SiPixelQualityProbabilities::probabilityVec SiPixelQualityProbabilities::getProbabilities ( const unsigned int  puBin) const

Definition at line 18 of file SiPixelQualityProbabilities.cc.

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 }

References Exception, and m_probabilities.

Referenced by SiPixelDigitizerAlgorithm::chooseScenario().

◆ getProbability_Map()

const probabilityMap& SiPixelQualityProbabilities::getProbability_Map ( ) const
inline

Definition at line 21 of file SiPixelQualityProbabilities.h.

21 { return m_probabilities; }

References m_probabilities.

Referenced by SiPixelQualityProbabilities().

◆ nelements()

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

Definition at line 27 of file SiPixelQualityProbabilities.h.

27 { return m_probabilities.at(puBin).size(); }

References m_probabilities.

◆ print()

void SiPixelQualityProbabilities::print ( std::ostream &  os) const

Definition at line 56 of file SiPixelQualityProbabilities.cc.

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 }

References mps_splice::entry, and m_probabilities.

Referenced by operator<<().

◆ printAll()

void SiPixelQualityProbabilities::printAll ( ) const

Definition at line 42 of file SiPixelQualityProbabilities.cc.

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 }

References mps_splice::entry, and m_probabilities.

◆ serialize()

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

◆ setProbabilities()

void SiPixelQualityProbabilities::setProbabilities ( const unsigned int  puBin,
const probabilityVec theProbabilities 
)

Definition at line 8 of file SiPixelQualityProbabilities.cc.

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 }

References m_probabilities.

◆ size()

double SiPixelQualityProbabilities::size ( void  ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 38 of file SiPixelQualityProbabilities.h.

◆ cond::serialization::access

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

Definition at line 38 of file SiPixelQualityProbabilities.h.

Member Data Documentation

◆ m_probabilities

probabilityMap SiPixelQualityProbabilities::m_probabilities
private
mps_splice.entry
entry
Definition: mps_splice.py:68
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SiPixelQualityProbabilities::getProbability_Map
const probabilityMap & getProbability_Map() const
Definition: SiPixelQualityProbabilities.h:21
SiPixelQualityProbabilities::m_probabilities
probabilityMap m_probabilities
Definition: SiPixelQualityProbabilities.h:36
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20