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

References operator<<, and alignCSCRings::s.

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
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 SiPixelTemplateDBObject::Reader::index_, createfilelist::int, SiPixelTemplateDBObject::Reader::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  }
SiPixelTemplateDBObject& SiPixelTemplateDBObject::operator>> ( float &  f)
inline

Definition at line 88 of file SiPixelTemplateDBObject.h.

References SiPixelTemplateDBObject::Reader::index_, SiPixelTemplateDBObject::Reader::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_.

Referenced by SiPixelFakeTemplateDBObjectESSource::produce().

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

References SiPixelTemplateDBObject::Reader::Reader().

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
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 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.

bool SiPixelTemplateDBObject::isInvalid_
private

Definition at line 158 of file SiPixelTemplateDBObject.h.

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