CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
HcalCholeskyMatrices Class Reference

#include <HcalCholeskyMatrices.h>

Inheritance diagram for HcalCholeskyMatrices:
HcalCondObjectContainerBase

Public Member Functions

bool addValues (const HcalCholeskyMatrix &myHcalCholeskyMatrix)
 
const bool exists (DetId fId) const
 
std::vector< DetIdgetAllChannels () const
 
const HcalCholeskyMatrixgetValues (DetId fId, bool throwOnFail=true) const
 
 HcalCholeskyMatrices ()
 
 HcalCholeskyMatrices (const HcalTopology *topo)
 
std::string myname () const
 
 ~HcalCholeskyMatrices ()
 
- Public Member Functions inherited from HcalCondObjectContainerBase
int getCreatorPackedIndexVersion () const
 
void setTopo (const HcalTopology *topo)
 
const HcalTopologytopo () const
 

Private Member Functions

void initContainer (DetId fId)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< HcalCholeskyMatrixHBcontainer
 
std::vector< HcalCholeskyMatrixHEcontainer
 
std::vector< HcalCholeskyMatrixHFcontainer
 
std::vector< HcalCholeskyMatrixHOcontainer
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from HcalCondObjectContainerBase
HcalOtherSubdetector extractOther (const DetId &id) const
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase const &o)
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase &&)=default
 
 HcalCondObjectContainerBase (const HcalTopology *)
 
unsigned int indexFor (DetId) const
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase const &o)
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase &&)=default
 
unsigned int sizeFor (DetId) const
 
std::string textForId (const DetId &id) const
 
- Protected Attributes inherited from HcalCondObjectContainerBase
int packedIndexVersion_
 

Detailed Description

Definition at line 18 of file HcalCholeskyMatrices.h.

Constructor & Destructor Documentation

HcalCholeskyMatrices::HcalCholeskyMatrices ( )
inline

Definition at line 22 of file HcalCholeskyMatrices.h.

HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
HcalCholeskyMatrices::HcalCholeskyMatrices ( const HcalTopology topo)

Definition at line 4 of file HcalCholeskyMatrices.cc.

5 {
6 }
HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
HcalCholeskyMatrices::~HcalCholeskyMatrices ( )

Definition at line 8 of file HcalCholeskyMatrices.cc.

9 {
10 }

Member Function Documentation

bool HcalCholeskyMatrices::addValues ( const HcalCholeskyMatrix myHcalCholeskyMatrix)

Definition at line 80 of file HcalCholeskyMatrices.cc.

References edm::hlt::Exception, HBcontainer, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HEcontainer, HFcontainer, HOcontainer, cmsHarvester::index, HcalCondObjectContainerBase::indexFor(), initContainer(), myname(), NULL, HcalCholeskyMatrix::rawId(), and summarizeEdmComparisonLogfiles::success.

81 {
82  bool success = false;
83  DetId fId(myItem.rawId());
84  unsigned int index=indexFor(fId);
85 
86  HcalCholeskyMatrix* cell = NULL;
87 
88  if (index<0xFFFFFFFu) {
89  if (fId.det()==DetId::Hcal) {
90  switch (HcalSubdetector(fId.subdetId())) {
91  case(HcalBarrel) : if (!HBcontainer.size() ) initContainer(fId);
92  if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break;
93  case(HcalEndcap) : if (!HEcontainer.size() ) initContainer(fId);
94  if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break;
95  case(HcalForward) : if (!HFcontainer.size() ) initContainer(fId);
96  if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break;
97  case(HcalOuter) : if (!HOcontainer.size() ) initContainer(fId);
98  if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break;
99  default: break;
100  }
101  }
102  }
103 
104  if (cell!=0) {
105  (*cell)=myItem;
106  success = true;
107  }
108 
109  if (!success)
110  throw cms::Exception ("Filling of conditions failed")
111  << " no valid filling possible for Conditions of type " << myname() << " for DetId " << fId.rawId();
112  return success;
113 }
unsigned int indexFor(DetId) const
std::vector< HcalCholeskyMatrix > HOcontainer
#define NULL
Definition: scimark2.h:8
HcalSubdetector
Definition: HcalAssistant.h:31
Definition: DetId.h:18
void initContainer(DetId fId)
std::vector< HcalCholeskyMatrix > HFcontainer
std::string myname() const
std::vector< HcalCholeskyMatrix > HBcontainer
std::vector< HcalCholeskyMatrix > HEcontainer
const bool HcalCholeskyMatrices::exists ( DetId  fId) const

Definition at line 63 of file HcalCholeskyMatrices.cc.

References getValues(), and hcalEqualDetId().

64 {
65 
66  const HcalCholeskyMatrix* cell = getValues(fId,false);
67 
68  // HcalCholeskyMatrix emptyHcalCholeskyMatrix;
69  if (cell)
70  if (!hcalEqualDetId(cell,fId))
71 // (fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) == HcalDetId(fId)) ||
72 // (fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) == HcalZDCDetId(fId)) ||
73 // (fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() == fId)))
74  return true;
75 
76  return false;
77 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
const HcalCholeskyMatrix * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > HcalCholeskyMatrices::getAllChannels ( ) const

Definition at line 116 of file HcalCholeskyMatrices.cc.

References HBcontainer, HEcontainer, HFcontainer, HOcontainer, i, and HcalCholeskyMatrix::rawId().

117 {
118  std::vector<DetId> channels;
119  HcalCholeskyMatrix emptyHcalCholeskyMatrix;
120  for (unsigned int i=0; i<HBcontainer.size(); i++) {
121  if (emptyHcalCholeskyMatrix.rawId() != HBcontainer.at(i).rawId() )
122  channels.push_back( DetId(HBcontainer.at(i).rawId()) );
123  }
124  for (unsigned int i=0; i<HEcontainer.size(); i++) {
125  if (emptyHcalCholeskyMatrix.rawId() != HEcontainer.at(i).rawId() )
126  channels.push_back( DetId(HEcontainer.at(i).rawId()) );
127  }
128  for (unsigned int i=0; i<HOcontainer.size(); i++) {
129  if (emptyHcalCholeskyMatrix.rawId() != HOcontainer.at(i).rawId() )
130  channels.push_back( DetId(HOcontainer.at(i).rawId()) );
131  }
132  for (unsigned int i=0; i<HFcontainer.size(); i++) {
133  if (emptyHcalCholeskyMatrix.rawId() != HFcontainer.at(i).rawId() )
134  channels.push_back( DetId(HFcontainer.at(i).rawId()) );
135  }
136  return channels;
137 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCholeskyMatrix > HOcontainer
Definition: DetId.h:18
std::vector< HcalCholeskyMatrix > HFcontainer
uint32_t rawId() const
std::vector< HcalCholeskyMatrix > HBcontainer
std::vector< HcalCholeskyMatrix > HEcontainer
const HcalCholeskyMatrix * HcalCholeskyMatrices::getValues ( DetId  fId,
bool  throwOnFail = true 
) const

Definition at line 30 of file HcalCholeskyMatrices.cc.

References DetId::det(), edm::hlt::Exception, HBcontainer, DetId::Hcal, HcalBarrel, HcalEndcap, hcalEqualDetId(), HcalForward, HcalOuter, HEcontainer, HFcontainer, HOcontainer, cmsHarvester::index, HcalCondObjectContainerBase::indexFor(), myname(), NULL, DetId::rawId(), and DetId::subdetId().

Referenced by HcalAmplifier::addPedestals(), and exists().

31 {
32  unsigned int index = indexFor(fId);
33  const HcalCholeskyMatrix* cell = NULL;
34  if (index<0xFFFFFFFFu) {
35  if (fId.det()==DetId::Hcal) {
36  switch (HcalSubdetector(fId.subdetId())) {
37  case(HcalBarrel) : if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) );
38  case(HcalEndcap) : if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) );
39  case(HcalForward) : if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) );
40  case(HcalOuter) : if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) );
41  default: break;
42  }
43  }
44  }
45 
46  // HcalCholeskyMatrix emptyHcalCholeskyMatrix;
47  // if (cell->rawId() == emptyHcalCholeskyMatrix.rawId() )
48  if ((!cell) || (!hcalEqualDetId(cell,fId))) {
49 // (fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) != HcalDetId(fId)) ||
50 // (fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) != HcalZDCDetId(fId)) ||
51 // (fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() != fId))) {
52  if (throwOnFail) {
53  throw cms::Exception ("Conditions not found")
54  << "Unavailable Conditions of type " << myname() << " for cell " << fId.rawId();
55  } else {
56  cell=0;
57  }
58  }
59  return cell;
60 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
unsigned int indexFor(DetId) const
std::vector< HcalCholeskyMatrix > HOcontainer
#define NULL
Definition: scimark2.h:8
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HcalSubdetector
Definition: HcalAssistant.h:31
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::vector< HcalCholeskyMatrix > HFcontainer
std::string myname() const
std::vector< HcalCholeskyMatrix > HBcontainer
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
std::vector< HcalCholeskyMatrix > HEcontainer
void HcalCholeskyMatrices::initContainer ( DetId  fId)
private

Definition at line 13 of file HcalCholeskyMatrices.cc.

References DetId::det(), HBcontainer, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HEcontainer, HFcontainer, HOcontainer, i, HcalCondObjectContainerBase::sizeFor(), and DetId::subdetId().

Referenced by addValues().

14 {
15  HcalCholeskyMatrix emptyItem;
16 
17  if (fId.det()==DetId::Hcal) {
18  switch (HcalSubdetector(fId.subdetId())) {
19  case(HcalBarrel) : for (unsigned int i=0; i<sizeFor(fId); i++) HBcontainer.push_back(emptyItem); break;
20  case(HcalEndcap) : for (unsigned int i=0; i<sizeFor(fId); i++) HEcontainer.push_back(emptyItem); break;
21  case(HcalOuter) : for (unsigned int i=0; i<sizeFor(fId); i++) HOcontainer.push_back(emptyItem); break;
22  case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break;
23  default: break;
24  }
25  }
26 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCholeskyMatrix > HOcontainer
unsigned int sizeFor(DetId) const
HcalSubdetector
Definition: HcalAssistant.h:31
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::vector< HcalCholeskyMatrix > HFcontainer
std::vector< HcalCholeskyMatrix > HBcontainer
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
std::vector< HcalCholeskyMatrix > HEcontainer
std::string HcalCholeskyMatrices::myname ( ) const
inline

Definition at line 26 of file HcalCholeskyMatrices.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addValues(), and getValues().

26 {return (std::string)"HcalCholeskyMatrices";}
template<class Archive >
void HcalCholeskyMatrices::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 40 of file HcalCholeskyMatrices.h.

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

Definition at line 40 of file HcalCholeskyMatrices.h.

Member Data Documentation

std::vector<HcalCholeskyMatrix> HcalCholeskyMatrices::HBcontainer
private

Definition at line 35 of file HcalCholeskyMatrices.h.

Referenced by addValues(), getAllChannels(), getValues(), and initContainer().

std::vector<HcalCholeskyMatrix> HcalCholeskyMatrices::HEcontainer
private

Definition at line 36 of file HcalCholeskyMatrices.h.

Referenced by addValues(), getAllChannels(), getValues(), and initContainer().

std::vector<HcalCholeskyMatrix> HcalCholeskyMatrices::HFcontainer
private

Definition at line 38 of file HcalCholeskyMatrices.h.

Referenced by addValues(), getAllChannels(), getValues(), and initContainer().

std::vector<HcalCholeskyMatrix> HcalCholeskyMatrices::HOcontainer
private

Definition at line 37 of file HcalCholeskyMatrices.h.

Referenced by addValues(), getAllChannels(), getValues(), and initContainer().