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 70 of file SiPixelQualityProbabilities.cc.

References create_public_pileup_plots::bins, and m_probabilities.

Referenced by nelements().

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

Definition at line 19 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.

30  {
31  probabilityMap::const_iterator it = m_probabilities.find(puBin);
32 
33  if (it != m_probabilities.end()){
34  return it->second;
35  } else {
36  throw cms::Exception("SiPixelQualityProbabilities")<< "No Probabilities are defined for PU bin " << puBin << "\n";
37  }
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 57 of file SiPixelQualityProbabilities.cc.

References mps_splice::entry, and m_probabilities.

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

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

Definition at line 43 of file SiPixelQualityProbabilities.cc.

References mps_splice::entry, and m_probabilities.

Referenced by nelements().

43  {
44 
45  edm::LogVerbatim("SiPixelQualityProbabilities")<<"SiPixelQualityProbabilities::printAll()";
46  edm::LogVerbatim("SiPixelQualityProbabilities")<<" ===================================================================================================================";
47  for(auto it = m_probabilities.begin(); it != m_probabilities.end() ; ++it){
48  edm::LogVerbatim("SiPixelQualityProbabilities")<< "PU :"<< it->first << " \n ";
49  for (const auto &entry : it->second){
50  edm::LogVerbatim("SiPixelQualityProbabilities")<<"SiPixelQuality snapshot: " << entry.first << " |probability: " << entry.second << std::endl;
51  }
52  }
53 
54 }
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 
10  if( m_probabilities.find(puBin) != m_probabilities.end()){
11  edm::LogWarning("SiPixelQualityProbabilities") << "PU bin: " << puBin <<" is already in the map!"<<std::endl;
12  return;
13  } else {
14  m_probabilities.emplace(puBin,theProbabilities);
15  }
16 }
double SiPixelQualityProbabilities::size ( void  ) const
inline

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 39 of file SiPixelQualityProbabilities.h.

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

Definition at line 39 of file SiPixelQualityProbabilities.h.

Member Data Documentation

probabilityMap SiPixelQualityProbabilities::m_probabilities
private