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
SiPixel2DTemplateDBObject Class Reference

#include <SiPixel2DTemplateDBObject.h>

Classes

union  char2float
 

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
 
SiPixel2DTemplateDBObjectoperator>> (int &i)
 
SiPixel2DTemplateDBObjectoperator>> (float &f)
 
void push_back (float entry)
 
bool putTemplateID (const uint32_t &detid, short &value)
 
void putTemplateIDs (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)
 
 SiPixel2DTemplateDBObject ()
 
std::vector< float > sVector () const
 
float version () const
 
virtual ~SiPixel2DTemplateDBObject ()
 

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

Detailed Description

Definition at line 16 of file SiPixel2DTemplateDBObject.h.

Constructor & Destructor Documentation

SiPixel2DTemplateDBObject::SiPixel2DTemplateDBObject ( )
inline
virtual SiPixel2DTemplateDBObject::~SiPixel2DTemplateDBObject ( )
inlinevirtual

Definition at line 21 of file SiPixel2DTemplateDBObject.h.

21 {}

Member Function Documentation

bool SiPixel2DTemplateDBObject::fail ( )
inline

Definition at line 54 of file SiPixel2DTemplateDBObject.h.

References isInvalid_.

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

Definition at line 95 of file SiPixel2DTemplateDBObject.h.

References templ_ID.

96  {
97  std::map<unsigned int,short>::const_iterator id=templ_ID.find(detid);
98  if(id!=templ_ID.end()) return id->second;
99  else edm::LogError("SiPixel2DTemplateDBObject") << "2Dtemplate ID for DetID " << detid
100  << " is not stored" << std::endl;
101  return 0;
102  }
std::map< unsigned int, short > templ_ID
const std::map<unsigned int,short>& SiPixel2DTemplateDBObject::getTemplateIDs ( ) const
inline

Definition at line 81 of file SiPixel2DTemplateDBObject.h.

References templ_ID.

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

Definition at line 70 of file SiPixel2DTemplateDBObject.h.

References i, and index_.

int SiPixel2DTemplateDBObject::index ( ) const
inline

Definition at line 63 of file SiPixel2DTemplateDBObject.h.

References index_.

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

int SiPixel2DTemplateDBObject::maxIndex ( ) const
inline

Definition at line 64 of file SiPixel2DTemplateDBObject.h.

References maxIndex_.

Referenced by setMaxIndex().

int SiPixel2DTemplateDBObject::numOfTempl ( ) const
inline

Definition at line 65 of file SiPixel2DTemplateDBObject.h.

References numOfTempl_.

Referenced by setNumOfTempl().

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

Definition at line 27 of file SiPixel2DTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

28  {
29  isInvalid_ = false;
30  if(index_<=maxIndex_) {
31  i = (int) (*this).sVector_[index_];
32  index_++;
33  }
34  else
35  (*this).setInvalid();
36  return *this;
37  }
int i
Definition: DBlmapReader.cc:9
SiPixel2DTemplateDBObject& SiPixel2DTemplateDBObject::operator>> ( float &  f)
inline

Definition at line 39 of file SiPixel2DTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

40  {
41  isInvalid_ = false;
42  if(index_<=maxIndex_) {
43  f = (*this).sVector_[index_];
44  index_++;
45  }
46  else
47  (*this).setInvalid();
48  return *this;
49  }
double f[11][100]
void SiPixel2DTemplateDBObject::push_back ( float  entry)
inline

Definition at line 57 of file SiPixel2DTemplateDBObject.h.

References sVector_.

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

Definition at line 83 of file SiPixel2DTemplateDBObject.h.

References cond::rpcobgas::detid, templ_ID, and relativeConstraints::value.

84  {
85  std::map<unsigned int,short>::const_iterator id=templ_ID.find(detid);
86  if(id!=templ_ID.end()){
87  edm::LogError("SiPixel2DTemplateDBObject") << "2Dtemplate ID for DetID " << detid
88  << " is already stored. Skipping this put" << std::endl;
89  return false;
90  }
91  else templ_ID[detid] = value;
92  return true;
93  }
std::map< unsigned int, short > templ_ID
void SiPixel2DTemplateDBObject::putTemplateIDs ( std::map< unsigned int, short > &  t_ID)
inline

Definition at line 80 of file SiPixel2DTemplateDBObject.h.

References templ_ID.

80 {templ_ID = t_ID;}
std::map< unsigned int, short > templ_ID
template<class Archive >
void SiPixel2DTemplateDBObject::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiPixel2DTemplateDBObject::setIndex ( int  index)
inline
void SiPixel2DTemplateDBObject::setInvalid ( void  )
inline

Definition at line 53 of file SiPixel2DTemplateDBObject.h.

References isInvalid_.

void SiPixel2DTemplateDBObject::setMaxIndex ( int  maxIndex)
inline
void SiPixel2DTemplateDBObject::setNumOfTempl ( int  numOfTempl)
inline
void SiPixel2DTemplateDBObject::setVersion ( float  version)
inline
std::vector<float> SiPixel2DTemplateDBObject::sVector ( ) const
inline

Definition at line 67 of file SiPixel2DTemplateDBObject.h.

References sVector_.

67 {return sVector_;}
float SiPixel2DTemplateDBObject::version ( ) const
inline

Definition at line 66 of file SiPixel2DTemplateDBObject.h.

References version_.

Referenced by setVersion().

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 113 of file SiPixel2DTemplateDBObject.h.

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

Definition at line 113 of file SiPixel2DTemplateDBObject.h.

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

Member Data Documentation

int SiPixel2DTemplateDBObject::index_
private

Definition at line 105 of file SiPixel2DTemplateDBObject.h.

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

bool SiPixel2DTemplateDBObject::isInvalid_
private

Definition at line 109 of file SiPixel2DTemplateDBObject.h.

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

int SiPixel2DTemplateDBObject::maxIndex_
private

Definition at line 106 of file SiPixel2DTemplateDBObject.h.

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

int SiPixel2DTemplateDBObject::numOfTempl_
private

Definition at line 107 of file SiPixel2DTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

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

Definition at line 110 of file SiPixel2DTemplateDBObject.h.

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

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

Definition at line 108 of file SiPixel2DTemplateDBObject.h.

Referenced by setVersion(), and version().