CMS 3D CMS Logo

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

#include <SiPixelTemplateDBObject.h>

Classes

union  char2float
 
struct  Reader
 

Public Member Functions

bool fail ()
 
short getTemplateID (const uint32_t &detid) const
 
const std::map< unsigned int, short > & getTemplateIDs () const
 
void incrementIndex (int i)
 
int index () const
 
int maxIndex () const
 
int numOfTempl () const
 
SiPixelTemplateDBObjectoperator>> (float &f)
 
SiPixelTemplateDBObjectoperator>> (int &i)
 
void push_back (float entry)
 
bool putTemplateID (const uint32_t &detid, short &value)
 
void putTemplateIDs (std::map< unsigned int, short > &t_ID)
 
Reader reader () const
 
void setIndex (int index)
 
void setInvalid ()
 
void setMaxIndex (int maxIndex)
 
void setNumOfTempl (int numOfTempl)
 
void setVersion (float version)
 
 SiPixelTemplateDBObject ()
 
std::vector< float > const & sVector () const
 
float version () const
 
virtual ~SiPixelTemplateDBObject ()
 

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 SiPixelTemplateDBObject &dbobject)
 

Detailed Description

Definition at line 16 of file SiPixelTemplateDBObject.h.

Constructor & Destructor Documentation

◆ SiPixelTemplateDBObject()

SiPixelTemplateDBObject::SiPixelTemplateDBObject ( )
inline

Definition at line 60 of file SiPixelTemplateDBObject.h.

60  : index_(0), maxIndex_(0), numOfTempl_(1), version_(-99.9), isInvalid_(false), sVector_(0) {
61  sVector_.reserve(1000000);
62  }

References sVector_.

◆ ~SiPixelTemplateDBObject()

virtual SiPixelTemplateDBObject::~SiPixelTemplateDBObject ( )
inlinevirtual

Definition at line 63 of file SiPixelTemplateDBObject.h.

63 {}

Member Function Documentation

◆ fail()

bool SiPixelTemplateDBObject::fail ( )
inline

Definition at line 92 of file SiPixelTemplateDBObject.h.

92 { return isInvalid_; }

References isInvalid_.

◆ getTemplateID()

short SiPixelTemplateDBObject::getTemplateID ( const uint32_t &  detid) const
inline

Definition at line 131 of file SiPixelTemplateDBObject.h.

131  {
132  std::map<unsigned int, short>::const_iterator id = templ_ID.find(detid);
133  if (id != templ_ID.end())
134  return id->second;
135  else
136  edm::LogError("SiPixelTemplateDBObject") << "Template ID for DetID " << detid << " is not stored" << std::endl;
137  return 0;
138  }

References triggerObjects_cff::id, and templ_ID.

Referenced by PixelCPEBase::fillDetParams(), PixelCPETemplateReco::localPosition(), PixelTemplateSmearerBase::smearHit(), and PixelTemplateSmearerBase::smearMergeGroup().

◆ getTemplateIDs()

const std::map<unsigned int, short>& SiPixelTemplateDBObject::getTemplateIDs ( ) const
inline

Definition at line 118 of file SiPixelTemplateDBObject.h.

118 { return templ_ID; }

References templ_ID.

◆ incrementIndex()

void SiPixelTemplateDBObject::incrementIndex ( int  i)
inline

Definition at line 108 of file SiPixelTemplateDBObject.h.

108 { index_ += i; }

References mps_fire::i, and index_.

◆ index()

int SiPixelTemplateDBObject::index ( ) const
inline

Definition at line 101 of file SiPixelTemplateDBObject.h.

101 { return index_; }

References index_.

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

◆ maxIndex()

int SiPixelTemplateDBObject::maxIndex ( ) const
inline

Definition at line 102 of file SiPixelTemplateDBObject.h.

102 { return maxIndex_; }

References maxIndex_.

Referenced by SiPixelTemplateDBObject::Reader::operator>>(), and setMaxIndex().

◆ numOfTempl()

int SiPixelTemplateDBObject::numOfTempl ( ) const
inline

Definition at line 103 of file SiPixelTemplateDBObject.h.

103 { return numOfTempl_; }

References numOfTempl_.

Referenced by SiPixelTemplateDBObject::Reader::numOfTempl(), and setNumOfTempl().

◆ operator>>() [1/2]

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

Definition at line 79 of file SiPixelTemplateDBObject.h.

79  {
80  isInvalid_ = false;
81  if (index_ <= maxIndex_) {
82  f = (*this).sVector_[index_];
83  index_++;
84  } else
85  (*this).setInvalid();
86  return *this;
87  }

References f, index_, isInvalid_, and maxIndex_.

◆ operator>>() [2/2]

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

Definition at line 69 of file SiPixelTemplateDBObject.h.

69  {
70  isInvalid_ = false;
71  if (index_ <= maxIndex_) {
72  i = (int)(*this).sVector_[index_];
73  index_++;
74  } else
75  (*this).setInvalid();
76  return *this;
77  }

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

◆ push_back()

void SiPixelTemplateDBObject::push_back ( float  entry)
inline

Definition at line 95 of file SiPixelTemplateDBObject.h.

95 { sVector_.push_back(entry); }

References mps_splice::entry, and sVector_.

◆ putTemplateID()

bool SiPixelTemplateDBObject::putTemplateID ( const uint32_t &  detid,
short &  value 
)
inline

Definition at line 120 of file SiPixelTemplateDBObject.h.

120  {
121  std::map<unsigned int, short>::const_iterator id = templ_ID.find(detid);
122  if (id != templ_ID.end()) {
123  edm::LogError("SiPixelTemplateDBObject")
124  << "Template ID for DetID " << detid << " is already stored. Skipping this put" << std::endl;
125  return false;
126  } else
127  templ_ID[detid] = value;
128  return true;
129  }

References templ_ID, and relativeConstraints::value.

◆ putTemplateIDs()

void SiPixelTemplateDBObject::putTemplateIDs ( std::map< unsigned int, short > &  t_ID)
inline

Definition at line 117 of file SiPixelTemplateDBObject.h.

117 { templ_ID = t_ID; }

References templ_ID.

◆ reader()

Reader SiPixelTemplateDBObject::reader ( ) const
inline

Definition at line 58 of file SiPixelTemplateDBObject.h.

58 { return Reader(*this); }

Referenced by SiPixelTemplate::pushfile().

◆ serialize()

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

◆ setIndex()

void SiPixelTemplateDBObject::setIndex ( int  index)
inline

Definition at line 96 of file SiPixelTemplateDBObject.h.

96 { index_ = index; }

References index(), and index_.

◆ setInvalid()

void SiPixelTemplateDBObject::setInvalid ( void  )
inline

Definition at line 91 of file SiPixelTemplateDBObject.h.

91 { isInvalid_ = true; }

References isInvalid_.

◆ setMaxIndex()

void SiPixelTemplateDBObject::setMaxIndex ( int  maxIndex)
inline

Definition at line 97 of file SiPixelTemplateDBObject.h.

97 { maxIndex_ = maxIndex; }

References maxIndex(), and maxIndex_.

◆ setNumOfTempl()

void SiPixelTemplateDBObject::setNumOfTempl ( int  numOfTempl)
inline

Definition at line 98 of file SiPixelTemplateDBObject.h.

References numOfTempl(), and numOfTempl_.

◆ setVersion()

void SiPixelTemplateDBObject::setVersion ( float  version)
inline

Definition at line 90 of file SiPixelTemplateDBObject.h.

90 { version_ = version; }

References version(), and version_.

◆ sVector()

std::vector<float> const& SiPixelTemplateDBObject::sVector ( ) const
inline

◆ version()

float SiPixelTemplateDBObject::version ( ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 149 of file SiPixelTemplateDBObject.h.

◆ cond::serialization::access

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

Definition at line 149 of file SiPixelTemplateDBObject.h.

◆ operator<<

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

Member Data Documentation

◆ index_

int SiPixelTemplateDBObject::index_
private

Definition at line 141 of file SiPixelTemplateDBObject.h.

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

◆ isInvalid_

bool SiPixelTemplateDBObject::isInvalid_
private

Definition at line 145 of file SiPixelTemplateDBObject.h.

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

◆ maxIndex_

int SiPixelTemplateDBObject::maxIndex_
private

Definition at line 142 of file SiPixelTemplateDBObject.h.

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

◆ numOfTempl_

int SiPixelTemplateDBObject::numOfTempl_
private

Definition at line 143 of file SiPixelTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

◆ sVector_

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

Definition at line 146 of file SiPixelTemplateDBObject.h.

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

◆ templ_ID

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

◆ version_

float SiPixelTemplateDBObject::version_
private

Definition at line 144 of file SiPixelTemplateDBObject.h.

Referenced by setVersion(), and version().

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