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>> (float &f)
 
SiPixel2DTemplateDBObjectoperator>> (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)
 
 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::SiPixel2DTemplateDBObject ( )
inline

Definition at line 18 of file SiPixel2DTemplateDBObject.h.

19  : index_(0), maxIndex_(0), numOfTempl_(1), version_(-99.9), isInvalid_(false), sVector_(0) {
20  sVector_.reserve(1000000);
21  }

References sVector_.

◆ ~SiPixel2DTemplateDBObject()

virtual SiPixel2DTemplateDBObject::~SiPixel2DTemplateDBObject ( )
inlinevirtual

Definition at line 22 of file SiPixel2DTemplateDBObject.h.

22 {}

Member Function Documentation

◆ fail()

bool SiPixel2DTemplateDBObject::fail ( )
inline

Definition at line 51 of file SiPixel2DTemplateDBObject.h.

51 { return isInvalid_; }

References isInvalid_.

◆ getTemplateID()

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

Definition at line 90 of file SiPixel2DTemplateDBObject.h.

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  }

References triggerObjects_cff::id, and templ_ID.

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

◆ getTemplateIDs()

const std::map<unsigned int, short>& SiPixel2DTemplateDBObject::getTemplateIDs ( ) const
inline

Definition at line 77 of file SiPixel2DTemplateDBObject.h.

77 { return templ_ID; }

References templ_ID.

◆ incrementIndex()

void SiPixel2DTemplateDBObject::incrementIndex ( int  i)
inline

Definition at line 67 of file SiPixel2DTemplateDBObject.h.

67 { index_ += i; }

References mps_fire::i, and index_.

◆ index()

int SiPixel2DTemplateDBObject::index ( ) const
inline

Definition at line 60 of file SiPixel2DTemplateDBObject.h.

60 { return index_; }

References index_.

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

◆ maxIndex()

int SiPixel2DTemplateDBObject::maxIndex ( ) const
inline

Definition at line 61 of file SiPixel2DTemplateDBObject.h.

61 { return maxIndex_; }

References maxIndex_.

Referenced by setMaxIndex().

◆ numOfTempl()

int SiPixel2DTemplateDBObject::numOfTempl ( ) const
inline

Definition at line 62 of file SiPixel2DTemplateDBObject.h.

62 { return numOfTempl_; }

References numOfTempl_.

Referenced by SiPixelChargeReweightingAlgorithm::init(), and setNumOfTempl().

◆ operator>>() [1/2]

SiPixel2DTemplateDBObject& SiPixel2DTemplateDBObject::operator>> ( float &  f)
inline

Definition at line 38 of file SiPixel2DTemplateDBObject.h.

38  {
39  isInvalid_ = false;
40  if (index_ <= maxIndex_) {
41  f = (*this).sVector_[index_];
42  index_++;
43  } else
44  (*this).setInvalid();
45  return *this;
46  }

References f, index_, isInvalid_, and maxIndex_.

◆ operator>>() [2/2]

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

Definition at line 28 of file SiPixel2DTemplateDBObject.h.

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  }

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

◆ push_back()

void SiPixel2DTemplateDBObject::push_back ( float  entry)
inline

Definition at line 54 of file SiPixel2DTemplateDBObject.h.

54 { sVector_.push_back(entry); }

References mps_splice::entry, and sVector_.

◆ putTemplateID()

bool SiPixel2DTemplateDBObject::putTemplateID ( const uint32_t &  detid,
short &  value 
)
inline

Definition at line 79 of file SiPixel2DTemplateDBObject.h.

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  }

References templ_ID, and relativeConstraints::value.

◆ putTemplateIDs()

void SiPixel2DTemplateDBObject::putTemplateIDs ( std::map< unsigned int, short > &  t_ID)
inline

Definition at line 76 of file SiPixel2DTemplateDBObject.h.

76 { templ_ID = t_ID; }

References templ_ID.

◆ serialize()

template<class Archive >
void SiPixel2DTemplateDBObject::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setIndex()

void SiPixel2DTemplateDBObject::setIndex ( int  index)
inline

Definition at line 55 of file SiPixel2DTemplateDBObject.h.

55 { index_ = index; }

References index(), and index_.

◆ setInvalid()

void SiPixel2DTemplateDBObject::setInvalid ( void  )
inline

Definition at line 50 of file SiPixel2DTemplateDBObject.h.

50 { isInvalid_ = true; }

References isInvalid_.

◆ setMaxIndex()

void SiPixel2DTemplateDBObject::setMaxIndex ( int  maxIndex)
inline

Definition at line 56 of file SiPixel2DTemplateDBObject.h.

56 { maxIndex_ = maxIndex; }

References maxIndex(), and maxIndex_.

◆ setNumOfTempl()

void SiPixel2DTemplateDBObject::setNumOfTempl ( int  numOfTempl)
inline

Definition at line 57 of file SiPixel2DTemplateDBObject.h.

References numOfTempl(), and numOfTempl_.

◆ setVersion()

void SiPixel2DTemplateDBObject::setVersion ( float  version)
inline

Definition at line 49 of file SiPixel2DTemplateDBObject.h.

49 { version_ = version; }

References version(), and version_.

◆ sVector()

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

Definition at line 64 of file SiPixel2DTemplateDBObject.h.

64 { return sVector_; }

References sVector_.

◆ version()

float SiPixel2DTemplateDBObject::version ( ) const
inline

Definition at line 63 of file SiPixel2DTemplateDBObject.h.

63 { return version_; }

References version_.

Referenced by validation.Sample::datasetpattern(), validation.Sample::filename(), and setVersion().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 109 of file SiPixel2DTemplateDBObject.h.

◆ cond::serialization::access

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

Definition at line 109 of file SiPixel2DTemplateDBObject.h.

◆ operator<<

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

Member Data Documentation

◆ index_

int SiPixel2DTemplateDBObject::index_
private

Definition at line 101 of file SiPixel2DTemplateDBObject.h.

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

◆ isInvalid_

bool SiPixel2DTemplateDBObject::isInvalid_
private

Definition at line 105 of file SiPixel2DTemplateDBObject.h.

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

◆ maxIndex_

int SiPixel2DTemplateDBObject::maxIndex_
private

Definition at line 102 of file SiPixel2DTemplateDBObject.h.

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

◆ numOfTempl_

int SiPixel2DTemplateDBObject::numOfTempl_
private

Definition at line 103 of file SiPixel2DTemplateDBObject.h.

Referenced by numOfTempl(), and setNumOfTempl().

◆ sVector_

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

Definition at line 106 of file SiPixel2DTemplateDBObject.h.

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

◆ templ_ID

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

◆ version_

float SiPixel2DTemplateDBObject::version_
private

Definition at line 104 of file SiPixel2DTemplateDBObject.h.

Referenced by setVersion(), and version().

mps_fire.i
i
Definition: mps_fire.py:428
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
mps_splice.entry
entry
Definition: mps_splice.py:68
SiPixel2DTemplateDBObject::index_
int index_
Definition: SiPixel2DTemplateDBObject.h:101
SiPixel2DTemplateDBObject::version
float version() const
Definition: SiPixel2DTemplateDBObject.h:63
SiPixel2DTemplateDBObject::maxIndex_
int maxIndex_
Definition: SiPixel2DTemplateDBObject.h:102
SiPixel2DTemplateDBObject::maxIndex
int maxIndex() const
Definition: SiPixel2DTemplateDBObject.h:61
SiPixel2DTemplateDBObject::version_
float version_
Definition: SiPixel2DTemplateDBObject.h:104
SiPixel2DTemplateDBObject::index
int index() const
Definition: SiPixel2DTemplateDBObject.h:60
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiPixel2DTemplateDBObject::isInvalid_
bool isInvalid_
Definition: SiPixel2DTemplateDBObject.h:105
SiPixel2DTemplateDBObject::numOfTempl_
int numOfTempl_
Definition: SiPixel2DTemplateDBObject.h:103
SiPixel2DTemplateDBObject::sVector_
std::vector< float > sVector_
Definition: SiPixel2DTemplateDBObject.h:106
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
relativeConstraints.value
value
Definition: relativeConstraints.py:53
SiPixel2DTemplateDBObject::numOfTempl
int numOfTempl() const
Definition: SiPixel2DTemplateDBObject.h:62
edm::Log
Definition: MessageLogger.h:70
SiPixel2DTemplateDBObject::templ_ID
std::map< unsigned int, short > templ_ID
Definition: SiPixel2DTemplateDBObject.h:107