CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 70 of file SiPixelTemplateDBObject.h.

70 {}

Member Function Documentation

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

Definition at line 144 of file SiPixelTemplateDBObject.h.

References templ_ID.

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

145  {
146  std::map<unsigned int,short>::const_iterator id=templ_ID.find(detid);
147  if(id!=templ_ID.end()) return id->second;
148  else edm::LogError("SiPixelTemplateDBObject") << "Template ID for DetID " << detid
149  << " is not stored" << std::endl;
150  return 0;
151  }
std::map< unsigned int, short > templ_ID
const std::map<unsigned int,short>& SiPixelTemplateDBObject::getTemplateIDs ( ) const
inline

Definition at line 130 of file SiPixelTemplateDBObject.h.

References templ_ID.

130 {return templ_ID;}
std::map< unsigned int, short > templ_ID
void SiPixelTemplateDBObject::incrementIndex ( int  i)
inline

Definition at line 119 of file SiPixelTemplateDBObject.h.

References i, and index_.

Referenced by SiPixelTemplate2D::pushfile(), and SiStripTemplate::pushfile().

int SiPixelTemplateDBObject::index ( ) const
inline
int SiPixelTemplateDBObject::maxIndex ( ) const
inline
int SiPixelTemplateDBObject::numOfTempl ( ) const
inline
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( int &  i)
inline

Definition at line 76 of file SiPixelTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

77  {
78  isInvalid_ = false;
79  if(index_<=maxIndex_) {
80  i = (int) (*this).sVector_[index_];
81  index_++;
82  }
83  else
84  (*this).setInvalid();
85  return *this;
86  }
int i
Definition: DBlmapReader.cc:9
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( float &  f)
inline

Definition at line 88 of file SiPixelTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

89  {
90  isInvalid_ = false;
91  if(index_<=maxIndex_) {
92  f = (*this).sVector_[index_];
93  index_++;
94  }
95  else
96  (*this).setInvalid();
97  return *this;
98  }
double f[11][100]
void SiPixelTemplateDBObject::push_back ( float  entry)
inline

Definition at line 106 of file SiPixelTemplateDBObject.h.

References sVector_.

106 {sVector_.push_back(entry);}
list entry
Definition: mps_splice.py:62
bool SiPixelTemplateDBObject::putTemplateID ( const uint32_t &  detid,
short &  value 
)
inline

Definition at line 132 of file SiPixelTemplateDBObject.h.

References templ_ID, and relativeConstraints::value.

133  {
134  std::map<unsigned int,short>::const_iterator id=templ_ID.find(detid);
135  if(id!=templ_ID.end()){
136  edm::LogError("SiPixelTemplateDBObject") << "Template ID for DetID " << detid
137  << " is already stored. Skipping this put" << std::endl;
138  return false;
139  }
140  else templ_ID[detid] = value;
141  return true;
142  }
std::map< unsigned int, short > templ_ID
void SiPixelTemplateDBObject::putTemplateIDs ( std::map< unsigned int, short > &  t_ID)
inline

Definition at line 129 of file SiPixelTemplateDBObject.h.

References templ_ID.

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

Definition at line 65 of file SiPixelTemplateDBObject.h.

Referenced by SiPixelTemplate::pushfile().

65 { return Reader(*this);}
template<class Archive >
void SiPixelTemplateDBObject::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiPixelTemplateDBObject::setIndex ( int  index)
inline

Definition at line 107 of file SiPixelTemplateDBObject.h.

References index(), and index_.

void SiPixelTemplateDBObject::setInvalid ( void  )
inline

Definition at line 102 of file SiPixelTemplateDBObject.h.

References isInvalid_.

void SiPixelTemplateDBObject::setMaxIndex ( int  maxIndex)
inline
void SiPixelTemplateDBObject::setNumOfTempl ( int  numOfTempl)
inline
void SiPixelTemplateDBObject::setVersion ( float  version)
inline

Definition at line 101 of file SiPixelTemplateDBObject.h.

References version(), and version_.

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 162 of file SiPixelTemplateDBObject.h.

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

Definition at line 162 of file SiPixelTemplateDBObject.h.

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

Member Data Documentation

int SiPixelTemplateDBObject::index_
private

Definition at line 154 of file SiPixelTemplateDBObject.h.

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

bool SiPixelTemplateDBObject::isInvalid_
private

Definition at line 158 of file SiPixelTemplateDBObject.h.

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

int SiPixelTemplateDBObject::maxIndex_
private

Definition at line 155 of file SiPixelTemplateDBObject.h.

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

int SiPixelTemplateDBObject::numOfTempl_
private

Definition at line 156 of file SiPixelTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

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

Definition at line 159 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 157 of file SiPixelTemplateDBObject.h.

Referenced by setVersion(), and version().