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 Attributes | Friends
SiPixelTemplateDBObject Class Reference

#include <SiPixelTemplateDBObject.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
 
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)
 
void setIndex (int index)
 
void setInvalid ()
 
void setMaxIndex (int maxIndex)
 
void setNumOfTempl (int numOfTempl)
 
void setVersion (float version)
 
 SiPixelTemplateDBObject ()
 
std::vector< float > sVector () const
 
float version () const
 
virtual ~SiPixelTemplateDBObject ()
 

Private Attributes

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

Friends

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

Detailed Description

Definition at line 14 of file SiPixelTemplateDBObject.h.

Constructor & Destructor Documentation

SiPixelTemplateDBObject::SiPixelTemplateDBObject ( )
inline
virtual SiPixelTemplateDBObject::~SiPixelTemplateDBObject ( )
inlinevirtual

Definition at line 19 of file SiPixelTemplateDBObject.h.

19 {}

Member Function Documentation

bool SiPixelTemplateDBObject::fail ( )
inline

Definition at line 52 of file SiPixelTemplateDBObject.h.

References isInvalid_.

Referenced by SiPixelTemplate::pushfile().

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

Definition at line 93 of file SiPixelTemplateDBObject.h.

References templ_ID.

Referenced by PixelCPETemplateReco::localPosition(), and PixelCPEGeneric::localPosition().

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

Definition at line 79 of file SiPixelTemplateDBObject.h.

References templ_ID.

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

Definition at line 68 of file SiPixelTemplateDBObject.h.

References i, and index_.

Referenced by SiPixelTemplate::pushfile().

int SiPixelTemplateDBObject::index ( ) const
inline

Definition at line 61 of file SiPixelTemplateDBObject.h.

References index_.

Referenced by SiPixelTemplate::pushfile(), and setIndex().

int SiPixelTemplateDBObject::maxIndex ( ) const
inline

Definition at line 62 of file SiPixelTemplateDBObject.h.

References maxIndex_.

Referenced by setMaxIndex().

int SiPixelTemplateDBObject::numOfTempl ( ) const
inline

Definition at line 63 of file SiPixelTemplateDBObject.h.

References numOfTempl_.

Referenced by SiPixelTemplate::pushfile(), and setNumOfTempl().

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

Definition at line 25 of file SiPixelTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

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

Definition at line 37 of file SiPixelTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

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

Definition at line 55 of file SiPixelTemplateDBObject.h.

References sVector_.

55 {sVector_.push_back(entry);}
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
bool SiPixelTemplateDBObject::putTemplateID ( const uint32_t &  detid,
short &  value 
)
inline

Definition at line 81 of file SiPixelTemplateDBObject.h.

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

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

Definition at line 78 of file SiPixelTemplateDBObject.h.

References templ_ID.

78 {templ_ID = t_ID;}
std::map< unsigned int, short > templ_ID
void SiPixelTemplateDBObject::setIndex ( int  index)
inline

Definition at line 56 of file SiPixelTemplateDBObject.h.

References index(), and index_.

void SiPixelTemplateDBObject::setInvalid ( void  )
inline

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

References version(), and version_.

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

Definition at line 65 of file SiPixelTemplateDBObject.h.

References sVector_.

Referenced by SiPixelTemplate::pushfile().

65 {return sVector_;}
float SiPixelTemplateDBObject::version ( ) const
inline

Definition at line 64 of file SiPixelTemplateDBObject.h.

References version_.

Referenced by setVersion().

Friends And Related Function Documentation

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

Member Data Documentation

int SiPixelTemplateDBObject::index_
private

Definition at line 103 of file SiPixelTemplateDBObject.h.

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

bool SiPixelTemplateDBObject::isInvalid_
private

Definition at line 107 of file SiPixelTemplateDBObject.h.

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

int SiPixelTemplateDBObject::maxIndex_
private

Definition at line 104 of file SiPixelTemplateDBObject.h.

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

int SiPixelTemplateDBObject::numOfTempl_
private

Definition at line 105 of file SiPixelTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

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

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

Referenced by setVersion(), and version().