CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes | Friends

SiPixelTemplateDBObject Class Reference

#include <SiPixelTemplateDBObject.h>

List of all members.

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>> (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)
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]

Definition at line 16 of file SiPixelTemplateDBObject.h.

References sVector_.

                                 :index_(0),maxIndex_(0),numOfTempl_(1),version_(-99.9),isInvalid_(false),sVector_(0) {
                sVector_.reserve(1000000);
        }
virtual SiPixelTemplateDBObject::~SiPixelTemplateDBObject ( ) [inline, virtual]

Definition at line 19 of file SiPixelTemplateDBObject.h.

{}

Member Function Documentation

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

Definition at line 93 of file SiPixelTemplateDBObject.h.

References templ_ID.

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

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

Definition at line 79 of file SiPixelTemplateDBObject.h.

References templ_ID.

{return templ_ID;}
void SiPixelTemplateDBObject::incrementIndex ( int  i) [inline]
int SiPixelTemplateDBObject::index ( ) const [inline]
int SiPixelTemplateDBObject::maxIndex ( ) const [inline]

Definition at line 62 of file SiPixelTemplateDBObject.h.

References maxIndex_.

Referenced by setMaxIndex().

{return maxIndex_;}
int SiPixelTemplateDBObject::numOfTempl ( ) const [inline]
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( float &  f) [inline]

Definition at line 37 of file SiPixelTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

                {
                        isInvalid_ = false;
                        if(index_<=maxIndex_) {
                                f = (*this).sVector_[index_];
                                index_++;
                        }
                        else
                                (*this).setInvalid();
                        return *this;
                }
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( int &  i) [inline]

Definition at line 25 of file SiPixelTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

                {
                        isInvalid_ = false;
                        if(index_<=maxIndex_) {
                                i = (int) (*this).sVector_[index_];
                                index_++;
                        }
                        else
                                (*this).setInvalid();
                        return *this;
                }
void SiPixelTemplateDBObject::push_back ( float  entry) [inline]

Definition at line 55 of file SiPixelTemplateDBObject.h.

References sVector_.

{sVector_.push_back(entry);}
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.

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

Definition at line 78 of file SiPixelTemplateDBObject.h.

References templ_ID.

{templ_ID = t_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_.

{isInvalid_ = true;}
void SiPixelTemplateDBObject::setMaxIndex ( int  maxIndex) [inline]

Definition at line 57 of file SiPixelTemplateDBObject.h.

References maxIndex(), and maxIndex_.

void SiPixelTemplateDBObject::setNumOfTempl ( int  numOfTempl) [inline]

Definition at line 58 of file SiPixelTemplateDBObject.h.

References numOfTempl(), and numOfTempl_.

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]
float SiPixelTemplateDBObject::version ( ) const [inline]

Definition at line 64 of file SiPixelTemplateDBObject.h.

References version_.

Referenced by setVersion().

{return version_;}

Friends And Related Function Documentation

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

Member Data Documentation

Definition at line 103 of file SiPixelTemplateDBObject.h.

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

Definition at line 107 of file SiPixelTemplateDBObject.h.

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

Definition at line 104 of file SiPixelTemplateDBObject.h.

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

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]

Definition at line 106 of file SiPixelTemplateDBObject.h.

Referenced by setVersion(), and version().