CMS 3D CMS Logo

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 22 of file SiPixel2DTemplateDBObject.h.

References operator<<, and alignCSCRings::s.

22 {}

Member Function Documentation

bool SiPixel2DTemplateDBObject::fail ( )
inline

Definition at line 51 of file SiPixel2DTemplateDBObject.h.

References isInvalid_.

Referenced by SiPixelTemplate2D::pushfile().

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

Definition at line 90 of file SiPixel2DTemplateDBObject.h.

References templ_ID.

Referenced by PixelCPEClusterRepair::fill2DTemplIDs(), and SiPixelDigitizerAlgorithm::hitSignalReweight().

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

Definition at line 77 of file SiPixel2DTemplateDBObject.h.

References templ_ID.

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

Definition at line 67 of file SiPixel2DTemplateDBObject.h.

References mps_fire::i, and index_.

Referenced by SiPixelTemplate2D::pushfile().

int SiPixel2DTemplateDBObject::index ( ) const
inline
int SiPixel2DTemplateDBObject::maxIndex ( ) const
inline

Definition at line 61 of file SiPixel2DTemplateDBObject.h.

References maxIndex_.

Referenced by setMaxIndex().

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

Definition at line 28 of file SiPixel2DTemplateDBObject.h.

References index_, createfilelist::int, isInvalid_, and maxIndex_.

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

Definition at line 38 of file SiPixel2DTemplateDBObject.h.

References index_, isInvalid_, and maxIndex_.

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

Definition at line 54 of file SiPixel2DTemplateDBObject.h.

References sVector_.

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

Definition at line 79 of file SiPixel2DTemplateDBObject.h.

References templ_ID, and relativeConstraints::value.

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

Definition at line 76 of file SiPixel2DTemplateDBObject.h.

References templ_ID.

76 { 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 50 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 64 of file SiPixel2DTemplateDBObject.h.

References sVector_.

Referenced by SiPixelTemplate2D::pushfile().

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

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 109 of file SiPixel2DTemplateDBObject.h.

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

Definition at line 109 of file SiPixel2DTemplateDBObject.h.

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

Member Data Documentation

int SiPixel2DTemplateDBObject::index_
private

Definition at line 101 of file SiPixel2DTemplateDBObject.h.

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

bool SiPixel2DTemplateDBObject::isInvalid_
private

Definition at line 105 of file SiPixel2DTemplateDBObject.h.

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

int SiPixel2DTemplateDBObject::maxIndex_
private

Definition at line 102 of file SiPixel2DTemplateDBObject.h.

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

int SiPixel2DTemplateDBObject::numOfTempl_
private

Definition at line 103 of file SiPixel2DTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

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

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

Referenced by setVersion(), and version().