CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiPixelGenErrorDBObject Class Reference

#include <SiPixelGenErrorDBObject.h>

Classes

union  char2float
 

Public Member Functions

bool fail ()
 
short getGenErrorID (const uint32_t &detid) const
 
const std::map< unsigned int, short > & getGenErrorIDs () const
 
void incrementIndex (int i)
 
int index () const
 
int maxIndex () const
 
int numOfTempl () const
 
SiPixelGenErrorDBObjectoperator>> (float &f)
 
SiPixelGenErrorDBObjectoperator>> (int &i)
 
void push_back (float entry)
 
bool putGenErrorID (const uint32_t &detid, short &value)
 
void putGenErrorIDs (std::map< unsigned int, short > &t_ID)
 
void setIndex (int index)
 
void setInvalid ()
 
void setMaxIndex (int maxIndex)
 
void setNumOfTempl (int numOfTempl)
 
void setVersion (float version)
 
 SiPixelGenErrorDBObject ()
 
std::vector< float > sVector () const
 
float version () const
 
virtual ~SiPixelGenErrorDBObject ()
 

Private Member Functions

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

Private Attributes

int index_
 
bool isInvalid_
 
int maxIndex_
 
int numOfTempl_
 
std::vector< float > sVector_
 
std::map< unsigned int, short > templ_ID
 
float version_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 
std::ostream & operator<< (std::ostream &s, const SiPixelGenErrorDBObject &dbobject)
 

Detailed Description

Definition at line 16 of file SiPixelGenErrorDBObject.h.

Constructor & Destructor Documentation

◆ SiPixelGenErrorDBObject()

SiPixelGenErrorDBObject::SiPixelGenErrorDBObject ( )
inline

Definition at line 18 of file SiPixelGenErrorDBObject.h.

18  : index_(0), maxIndex_(0), numOfTempl_(1), version_(-99.9), isInvalid_(false), sVector_(0) {
19  sVector_.reserve(1000000);
20  }

References sVector_.

◆ ~SiPixelGenErrorDBObject()

virtual SiPixelGenErrorDBObject::~SiPixelGenErrorDBObject ( )
inlinevirtual

Definition at line 21 of file SiPixelGenErrorDBObject.h.

21 {}

Member Function Documentation

◆ fail()

bool SiPixelGenErrorDBObject::fail ( )
inline

Definition at line 50 of file SiPixelGenErrorDBObject.h.

50 { return isInvalid_; }

References isInvalid_.

◆ getGenErrorID()

short SiPixelGenErrorDBObject::getGenErrorID ( const uint32_t &  detid) const
inline

Definition at line 89 of file SiPixelGenErrorDBObject.h.

89  {
90  std::map<unsigned int, short>::const_iterator id = templ_ID.find(detid);
91  if (id != templ_ID.end())
92  return id->second;
93  else
94  edm::LogError("SiPixelGenErrorDBObject") << "GenError ID for DetID " << detid << " is not stored" << std::endl;
95  return 0;
96  }

References triggerObjects_cff::id, and templ_ID.

Referenced by PixelCPEBase::fillDetParams().

◆ getGenErrorIDs()

const std::map<unsigned int, short>& SiPixelGenErrorDBObject::getGenErrorIDs ( ) const
inline

Definition at line 76 of file SiPixelGenErrorDBObject.h.

76 { return templ_ID; }

References templ_ID.

◆ incrementIndex()

void SiPixelGenErrorDBObject::incrementIndex ( int  i)
inline

Definition at line 66 of file SiPixelGenErrorDBObject.h.

66 { index_ += i; }

References mps_fire::i, and index_.

◆ index()

int SiPixelGenErrorDBObject::index ( ) const
inline

Definition at line 59 of file SiPixelGenErrorDBObject.h.

59 { return index_; }

References index_.

Referenced by BeautifulSoup.PageElement::insert(), and setIndex().

◆ maxIndex()

int SiPixelGenErrorDBObject::maxIndex ( ) const
inline

Definition at line 60 of file SiPixelGenErrorDBObject.h.

60 { return maxIndex_; }

References maxIndex_.

Referenced by setMaxIndex().

◆ numOfTempl()

int SiPixelGenErrorDBObject::numOfTempl ( ) const
inline

Definition at line 61 of file SiPixelGenErrorDBObject.h.

61 { return numOfTempl_; }

References numOfTempl_.

Referenced by setNumOfTempl().

◆ operator>>() [1/2]

SiPixelGenErrorDBObject& SiPixelGenErrorDBObject::operator>> ( float &  f)
inline

Definition at line 37 of file SiPixelGenErrorDBObject.h.

37  {
38  isInvalid_ = false;
39  if (index_ <= maxIndex_) {
40  f = (*this).sVector_[index_];
41  index_++;
42  } else
43  (*this).setInvalid();
44  return *this;
45  }

References f, index_, isInvalid_, and maxIndex_.

◆ operator>>() [2/2]

SiPixelGenErrorDBObject& SiPixelGenErrorDBObject::operator>> ( int &  i)
inline

Definition at line 27 of file SiPixelGenErrorDBObject.h.

27  {
28  isInvalid_ = false;
29  if (index_ <= maxIndex_) {
30  i = (int)(*this).sVector_[index_];
31  index_++;
32  } else
33  (*this).setInvalid();
34  return *this;
35  }

References mps_fire::i, index_, createfilelist::int, isInvalid_, and maxIndex_.

◆ push_back()

void SiPixelGenErrorDBObject::push_back ( float  entry)
inline

Definition at line 53 of file SiPixelGenErrorDBObject.h.

53 { sVector_.push_back(entry); }

References mps_splice::entry, and sVector_.

◆ putGenErrorID()

bool SiPixelGenErrorDBObject::putGenErrorID ( const uint32_t &  detid,
short &  value 
)
inline

Definition at line 78 of file SiPixelGenErrorDBObject.h.

78  {
79  std::map<unsigned int, short>::const_iterator id = templ_ID.find(detid);
80  if (id != templ_ID.end()) {
81  edm::LogError("SiPixelGenErrorDBObject")
82  << "GenError ID for DetID " << detid << " is already stored. Skipping this put" << std::endl;
83  return false;
84  } else
85  templ_ID[detid] = value;
86  return true;
87  }

References templ_ID, and relativeConstraints::value.

◆ putGenErrorIDs()

void SiPixelGenErrorDBObject::putGenErrorIDs ( std::map< unsigned int, short > &  t_ID)
inline

Definition at line 75 of file SiPixelGenErrorDBObject.h.

75 { templ_ID = t_ID; }

References templ_ID.

◆ serialize()

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

◆ setIndex()

void SiPixelGenErrorDBObject::setIndex ( int  index)
inline

Definition at line 54 of file SiPixelGenErrorDBObject.h.

54 { index_ = index; }

References index(), and index_.

◆ setInvalid()

void SiPixelGenErrorDBObject::setInvalid ( void  )
inline

Definition at line 49 of file SiPixelGenErrorDBObject.h.

49 { isInvalid_ = true; }

References isInvalid_.

◆ setMaxIndex()

void SiPixelGenErrorDBObject::setMaxIndex ( int  maxIndex)
inline

Definition at line 55 of file SiPixelGenErrorDBObject.h.

55 { maxIndex_ = maxIndex; }

References maxIndex(), and maxIndex_.

◆ setNumOfTempl()

void SiPixelGenErrorDBObject::setNumOfTempl ( int  numOfTempl)
inline

Definition at line 56 of file SiPixelGenErrorDBObject.h.

References numOfTempl(), and numOfTempl_.

◆ setVersion()

void SiPixelGenErrorDBObject::setVersion ( float  version)
inline

Definition at line 48 of file SiPixelGenErrorDBObject.h.

48 { version_ = version; }

References version(), and version_.

◆ sVector()

std::vector<float> SiPixelGenErrorDBObject::sVector ( ) const
inline

Definition at line 63 of file SiPixelGenErrorDBObject.h.

63 { return sVector_; }

References sVector_.

◆ version()

float SiPixelGenErrorDBObject::version ( ) const
inline

Definition at line 62 of file SiPixelGenErrorDBObject.h.

62 { return version_; }

References version_.

Referenced by validation.Sample::datasetpattern(), validation.Sample::filename(), and setVersion().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 107 of file SiPixelGenErrorDBObject.h.

◆ cond::serialization::access

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

Definition at line 107 of file SiPixelGenErrorDBObject.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const SiPixelGenErrorDBObject dbobject 
)
friend

Member Data Documentation

◆ index_

int SiPixelGenErrorDBObject::index_
private

Definition at line 99 of file SiPixelGenErrorDBObject.h.

Referenced by incrementIndex(), index(), operator>>(), and setIndex().

◆ isInvalid_

bool SiPixelGenErrorDBObject::isInvalid_
private

Definition at line 103 of file SiPixelGenErrorDBObject.h.

Referenced by fail(), operator>>(), and setInvalid().

◆ maxIndex_

int SiPixelGenErrorDBObject::maxIndex_
private

Definition at line 100 of file SiPixelGenErrorDBObject.h.

Referenced by maxIndex(), operator>>(), and setMaxIndex().

◆ numOfTempl_

int SiPixelGenErrorDBObject::numOfTempl_
private

Definition at line 101 of file SiPixelGenErrorDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

◆ sVector_

std::vector<float> SiPixelGenErrorDBObject::sVector_
private

Definition at line 104 of file SiPixelGenErrorDBObject.h.

Referenced by push_back(), SiPixelGenErrorDBObject(), and sVector().

◆ templ_ID

std::map<unsigned int, short> SiPixelGenErrorDBObject::templ_ID
private

◆ version_

float SiPixelGenErrorDBObject::version_
private

Definition at line 102 of file SiPixelGenErrorDBObject.h.

Referenced by setVersion(), and version().

mps_fire.i
i
Definition: mps_fire.py:428
SiPixelGenErrorDBObject::maxIndex
int maxIndex() const
Definition: SiPixelGenErrorDBObject.h:60
SiPixelGenErrorDBObject::version_
float version_
Definition: SiPixelGenErrorDBObject.h:102
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
mps_splice.entry
entry
Definition: mps_splice.py:68
SiPixelGenErrorDBObject::numOfTempl_
int numOfTempl_
Definition: SiPixelGenErrorDBObject.h:101
SiPixelGenErrorDBObject::templ_ID
std::map< unsigned int, short > templ_ID
Definition: SiPixelGenErrorDBObject.h:105
SiPixelGenErrorDBObject::version
float version() const
Definition: SiPixelGenErrorDBObject.h:62
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiPixelGenErrorDBObject::numOfTempl
int numOfTempl() const
Definition: SiPixelGenErrorDBObject.h:61
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
relativeConstraints.value
value
Definition: relativeConstraints.py:53
SiPixelGenErrorDBObject::maxIndex_
int maxIndex_
Definition: SiPixelGenErrorDBObject.h:100
SiPixelGenErrorDBObject::index_
int index_
Definition: SiPixelGenErrorDBObject.h:99
SiPixelGenErrorDBObject::sVector_
std::vector< float > sVector_
Definition: SiPixelGenErrorDBObject.h:104
SiPixelGenErrorDBObject::index
int index() const
Definition: SiPixelGenErrorDBObject.h:59
SiPixelGenErrorDBObject::isInvalid_
bool isInvalid_
Definition: SiPixelGenErrorDBObject.h:103
edm::Log
Definition: MessageLogger.h:70