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>> (int &i)
 
SiPixelTemplateDBObjectoperator>> (float &f)
 
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 ( )
inline
virtual SiPixelTemplateDBObject::~SiPixelTemplateDBObject ( )
inlinevirtual

Definition at line 63 of file SiPixelTemplateDBObject.h.

References operator<<, and alignCSCRings::s.

63 {}

Member Function Documentation

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

Definition at line 131 of file SiPixelTemplateDBObject.h.

References templ_ID.

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

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  }
std::map< unsigned int, short > templ_ID
const std::map<unsigned int, short>& SiPixelTemplateDBObject::getTemplateIDs ( ) const
inline

Definition at line 118 of file SiPixelTemplateDBObject.h.

References templ_ID.

118 { return templ_ID; }
std::map< unsigned int, short > templ_ID
void SiPixelTemplateDBObject::incrementIndex ( int  i)
inline
int SiPixelTemplateDBObject::index ( ) const
inline
int SiPixelTemplateDBObject::maxIndex ( ) const
inline
int SiPixelTemplateDBObject::numOfTempl ( ) const
inline
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( int &  i)
inline

Definition at line 69 of file SiPixelTemplateDBObject.h.

References SiPixelTemplateDBObject::Reader::index_, createfilelist::int, SiPixelTemplateDBObject::Reader::isInvalid_, and maxIndex_.

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  }
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( float &  f)
inline

Definition at line 79 of file SiPixelTemplateDBObject.h.

References SiPixelTemplateDBObject::Reader::index_, SiPixelTemplateDBObject::Reader::isInvalid_, and maxIndex_.

79  {
80  isInvalid_ = false;
81  if (index_ <= maxIndex_) {
82  f = (*this).sVector_[index_];
83  index_++;
84  } else
85  (*this).setInvalid();
86  return *this;
87  }
double f[11][100]
void SiPixelTemplateDBObject::push_back ( float  entry)
inline

Definition at line 95 of file SiPixelTemplateDBObject.h.

References sVector_.

Referenced by SiPixelFakeTemplateDBObjectESSource::produce().

95 { sVector_.push_back(entry); }
bool SiPixelTemplateDBObject::putTemplateID ( const uint32_t &  detid,
short &  value 
)
inline

Definition at line 120 of file SiPixelTemplateDBObject.h.

References templ_ID, and relativeConstraints::value.

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  }
std::map< unsigned int, short > templ_ID
void SiPixelTemplateDBObject::putTemplateIDs ( std::map< unsigned int, short > &  t_ID)
inline

Definition at line 117 of file SiPixelTemplateDBObject.h.

References templ_ID.

117 { templ_ID = t_ID; }
std::map< unsigned int, short > templ_ID
Reader SiPixelTemplateDBObject::reader ( ) const
inline

Definition at line 58 of file SiPixelTemplateDBObject.h.

References SiPixelTemplateDBObject::Reader::Reader().

Referenced by SiPixelTemplate::pushfile().

58 { return Reader(*this); }
template<class Archive >
void SiPixelTemplateDBObject::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiPixelTemplateDBObject::setIndex ( int  index)
inline
void SiPixelTemplateDBObject::setInvalid ( void  )
inline
void SiPixelTemplateDBObject::setMaxIndex ( int  maxIndex)
inline
void SiPixelTemplateDBObject::setNumOfTempl ( int  numOfTempl)
inline
void SiPixelTemplateDBObject::setVersion ( float  version)
inline
std::vector<float> const& SiPixelTemplateDBObject::sVector ( ) const
inline
float SiPixelTemplateDBObject::version ( ) const
inline

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 149 of file SiPixelTemplateDBObject.h.

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

Definition at line 149 of file SiPixelTemplateDBObject.h.

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

Member Data Documentation

int SiPixelTemplateDBObject::index_
private

Definition at line 141 of file SiPixelTemplateDBObject.h.

bool SiPixelTemplateDBObject::isInvalid_
private

Definition at line 145 of file SiPixelTemplateDBObject.h.

int SiPixelTemplateDBObject::maxIndex_
private

Definition at line 142 of file SiPixelTemplateDBObject.h.

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

int SiPixelTemplateDBObject::numOfTempl_
private

Definition at line 143 of file SiPixelTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

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

Definition at line 146 of file SiPixelTemplateDBObject.h.

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

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

Definition at line 144 of file SiPixelTemplateDBObject.h.

Referenced by setVersion(), and version().