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

◆ 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.

References isotrackApplyRegressor::bins, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and m_probabilities.

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 }

◆ getProbabilities() [1/2]

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

Definition at line 18 of file SiPixelQualityProbabilities.cc.

References Exception, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and m_probabilities.

Referenced by SiPixelDigitizerAlgorithm::chooseScenario().

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 }

◆ getProbabilities() [2/2]

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

Definition at line 30 of file SiPixelQualityProbabilities.cc.

References Exception, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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 }

◆ getProbability_Map()

const probabilityMap& SiPixelQualityProbabilities::getProbability_Map ( ) const
inline

◆ nelements()

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

Definition at line 27 of file SiPixelQualityProbabilities.h.

References m_probabilities.

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

◆ print()

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

Definition at line 56 of file SiPixelQualityProbabilities.cc.

References mps_splice::entry, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, m_probabilities, and l1tGTMenu_BTagSeeds_cff::os.

Referenced by 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 }

◆ printAll()

void SiPixelQualityProbabilities::printAll ( ) const

Definition at line 42 of file SiPixelQualityProbabilities.cc.

References mps_splice::entry, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and m_probabilities.

Referenced by SiPixelQualityProbabilitiesTestReader::analyze().

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 }
Log< level::Info, true > LogVerbatim

◆ 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.

References m_probabilities.

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 }
Log< level::Warning, false > LogWarning

◆ 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