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
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
 
void setTopo (const HcalTopology *topo)
 
const HcalTopologytopo () const
 

Private Member Functions

void initContainer (DetId fId)
 

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 16 of file HcalCholeskyMatrices.h.

Constructor & Destructor Documentation

HcalCholeskyMatrices::HcalCholeskyMatrices ( )
inline

Definition at line 20 of file HcalCholeskyMatrices.h.

HcalCholeskyMatrices::HcalCholeskyMatrices ( const HcalTopology topo)

Definition at line 3 of file HcalCholeskyMatrices.cc.

4 {
5 }
HcalCondObjectContainerBase(const HcalTopology *)
HcalCholeskyMatrices::~HcalCholeskyMatrices ( )

Definition at line 7 of file HcalCholeskyMatrices.cc.

8 {
9 }

Member Function Documentation

bool HcalCholeskyMatrices::addValues ( const HcalCholeskyMatrix myHcalCholeskyMatrix)

Definition at line 74 of file HcalCholeskyMatrices.cc.

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

75 {
76  bool success = false;
77  DetId fId(myItem.rawId());
78  unsigned int index=indexFor(fId);
79 
80  HcalCholeskyMatrix* cell = NULL;
81 
82  if (index<0xFFFFFFFu) {
83  if (fId.det()==DetId::Hcal) {
84  switch (HcalSubdetector(fId.subdetId())) {
85  case(HcalBarrel) : if (!HBcontainer.size() ) initContainer(fId);
86  if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break;
87  case(HcalEndcap) : if (!HEcontainer.size() ) initContainer(fId);
88  if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break;
89  case(HcalForward) : if (!HFcontainer.size() ) initContainer(fId);
90  if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break;
91  case(HcalOuter) : if (!HOcontainer.size() ) initContainer(fId);
92  if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break;
93  default: break;
94  }
95  }
96  }
97 
98  if (cell!=0) {
99  (*cell)=myItem;
100  success = true;
101  }
102 
103  if (!success)
104  throw cms::Exception ("Filling of conditions failed")
105  << " no valid filling possible for Conditions of type " << myname() << " for DetId " << fId.rawId();
106  return success;
107 }
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 59 of file HcalCholeskyMatrices.cc.

References getValues(), and HcalCholeskyMatrix::rawId().

60 {
61 
62  const HcalCholeskyMatrix* cell = getValues(fId,false);
63 
64  // HcalCholeskyMatrix emptyHcalCholeskyMatrix;
65  if (cell)
66  // if (cell->rawId() != emptyHcalCholeskyMatrix.rawId() )
67  if (cell->rawId() == fId )
68  return true;
69 
70  return false;
71 }
uint32_t rawId() const
const HcalCholeskyMatrix * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > HcalCholeskyMatrices::getAllChannels ( ) const

Definition at line 110 of file HcalCholeskyMatrices.cc.

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

111 {
112  std::vector<DetId> channels;
113  HcalCholeskyMatrix emptyHcalCholeskyMatrix;
114  for (unsigned int i=0; i<HBcontainer.size(); i++)
115  {
116  if (emptyHcalCholeskyMatrix.rawId() != HBcontainer.at(i).rawId() )
117  channels.push_back( DetId(HBcontainer.at(i).rawId()) );
118  }
119  for (unsigned int i=0; i<HEcontainer.size(); i++)
120  {
121  if (emptyHcalCholeskyMatrix.rawId() != HEcontainer.at(i).rawId() )
122  channels.push_back( DetId(HEcontainer.at(i).rawId()) );
123  }
124  for (unsigned int i=0; i<HOcontainer.size(); i++)
125  {
126  if (emptyHcalCholeskyMatrix.rawId() != HOcontainer.at(i).rawId() )
127  channels.push_back( DetId(HOcontainer.at(i).rawId()) );
128  }
129  for (unsigned int i=0; i<HFcontainer.size(); i++)
130  {
131  if (emptyHcalCholeskyMatrix.rawId() != HFcontainer.at(i).rawId() )
132  channels.push_back( DetId(HFcontainer.at(i).rawId()) );
133  }
134  return channels;
135 }
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 29 of file HcalCholeskyMatrices.cc.

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

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

30 {
31  unsigned int index = indexFor(fId);
32  const HcalCholeskyMatrix* cell = NULL;
33  if (index<0xFFFFFFFFu) {
34  if (fId.det()==DetId::Hcal) {
35  switch (HcalSubdetector(fId.subdetId())) {
36  case(HcalBarrel) : if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) );
37  case(HcalEndcap) : if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) );
38  case(HcalForward) : if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) );
39  case(HcalOuter) : if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) );
40  default: break;
41  }
42  }
43  }
44 
45  // HcalCholeskyMatrix emptyHcalCholeskyMatrix;
46  // if (cell->rawId() == emptyHcalCholeskyMatrix.rawId() )
47  if ((!cell) || (cell->rawId() != fId ) ) {
48  if (throwOnFail) {
49  throw cms::Exception ("Conditions not found")
50  << "Unavailable Conditions of type " << myname() << " for cell " << fId.rawId();
51  } else {
52  cell=0;
53  }
54  }
55  return cell;
56 }
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
uint32_t rawId() 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 12 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().

13 {
14  HcalCholeskyMatrix emptyItem;
15 
16  if (fId.det()==DetId::Hcal) {
17  switch (HcalSubdetector(fId.subdetId())) {
18  case(HcalBarrel) : for (unsigned int i=0; i<sizeFor(fId); i++) HBcontainer.push_back(emptyItem); break;
19  case(HcalEndcap) : for (unsigned int i=0; i<sizeFor(fId); i++) HEcontainer.push_back(emptyItem); break;
20  case(HcalOuter) : for (unsigned int i=0; i<sizeFor(fId); i++) HOcontainer.push_back(emptyItem); break;
21  case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break;
22  default: break;
23  }
24 }
25 }
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 24 of file HcalCholeskyMatrices.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addValues(), and getValues().

24 {return (std::string)"HcalCholeskyMatrices";}

Member Data Documentation

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

Definition at line 33 of file HcalCholeskyMatrices.h.

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

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

Definition at line 34 of file HcalCholeskyMatrices.h.

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

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

Definition at line 36 of file HcalCholeskyMatrices.h.

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

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

Definition at line 35 of file HcalCholeskyMatrices.h.

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