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
HcalCovarianceMatrices Class Reference

#include <HcalCovarianceMatrices.h>

Inheritance diagram for HcalCovarianceMatrices:
HcalCondObjectContainerBase

Public Member Functions

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

Private Member Functions

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

Private Attributes

std::vector< HcalCovarianceMatrixHBcontainer
 
std::vector< HcalCovarianceMatrixHEcontainer
 
std::vector< HcalCovarianceMatrixHFcontainer
 
std::vector< HcalCovarianceMatrixHOcontainer
 

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 17 of file HcalCovarianceMatrices.h.

Constructor & Destructor Documentation

HcalCovarianceMatrices::HcalCovarianceMatrices ( )
inline

Definition at line 21 of file HcalCovarianceMatrices.h.

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

Definition at line 5 of file HcalCovarianceMatrices.cc.

6 {
7 }
HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
HcalCovarianceMatrices::~HcalCovarianceMatrices ( )

Definition at line 9 of file HcalCovarianceMatrices.cc.

10 {
11 }

Member Function Documentation

bool HcalCovarianceMatrices::addValues ( const HcalCovarianceMatrix myHcalCovarianceMatrix)

Definition at line 79 of file HcalCovarianceMatrices.cc.

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

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

Definition at line 65 of file HcalCovarianceMatrices.cc.

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

66 {
67  const HcalCovarianceMatrix* cell = getValues(fId,false);
68 
69  // HcalCovarianceMatrix emptyHcalCovarianceMatrix;
70  if (cell)
71  // if (cell->rawId() != emptyHcalCovarianceMatrix.rawId() )
72  if (cell->rawId() == fId )
73  return true;
74 
75  return false;
76 }
uint32_t rawId() const
const HcalCovarianceMatrix * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > HcalCovarianceMatrices::getAllChannels ( ) const

Definition at line 114 of file HcalCovarianceMatrices.cc.

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

115 {
116  std::vector<DetId> channels;
117  HcalCovarianceMatrix emptyHcalCovarianceMatrix;
118  for (unsigned int i=0; i<HBcontainer.size(); i++)
119  {
120  if (emptyHcalCovarianceMatrix.rawId() != HBcontainer.at(i).rawId() )
121  channels.push_back( DetId(HBcontainer.at(i).rawId()) );
122  }
123  for (unsigned int i=0; i<HEcontainer.size(); i++)
124  {
125  if (emptyHcalCovarianceMatrix.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  {
130  if (emptyHcalCovarianceMatrix.rawId() != HOcontainer.at(i).rawId() )
131  channels.push_back( DetId(HOcontainer.at(i).rawId()) );
132  }
133  for (unsigned int i=0; i<HFcontainer.size(); i++)
134  {
135  if (emptyHcalCovarianceMatrix.rawId() != HFcontainer.at(i).rawId() )
136  channels.push_back( DetId(HFcontainer.at(i).rawId()) );
137  }
138  return channels;
139 }
int i
Definition: DBlmapReader.cc:9
uint32_t rawId() const
std::vector< HcalCovarianceMatrix > HFcontainer
std::vector< HcalCovarianceMatrix > HBcontainer
Definition: DetId.h:18
std::vector< HcalCovarianceMatrix > HOcontainer
std::vector< HcalCovarianceMatrix > HEcontainer
const HcalCovarianceMatrix * HcalCovarianceMatrices::getValues ( DetId  fId,
bool  throwOnFail = true 
) const

Definition at line 33 of file HcalCovarianceMatrices.cc.

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

Referenced by exists().

34 {
35  unsigned int index=indexFor(fId);
36 
37  const HcalCovarianceMatrix* cell = NULL;
38 
39  if (index<0xFFFFFFFFu) {
40  if (fId.det()==DetId::Hcal) {
41  switch (HcalSubdetector(fId.subdetId())) {
42  case(HcalBarrel) : if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) );
43  case(HcalEndcap) : if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) );
44  case(HcalForward) : if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) );
45  case(HcalOuter) : if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) );
46  default: break;
47  }
48  }
49  }
50 
51  // HcalCovarianceMatrix emptyHcalCovarianceMatrix;
52  // if (cell->rawId() == emptyHcalCovarianceMatrix.rawId() )
53  if ((!cell) || (cell->rawId() != fId ) ) {
54  if (throwOnFail) {
55  throw cms::Exception ("Conditions not found")
56  << "Unavailable Conditions of type " << myname() << " for cell " << fId.rawId();
57  } else {
58  cell=0;
59  }
60  }
61  return cell;
62 }
unsigned int indexFor(DetId) const
uint32_t rawId() const
#define NULL
Definition: scimark2.h:8
std::vector< HcalCovarianceMatrix > HFcontainer
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< HcalCovarianceMatrix > HBcontainer
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< HcalCovarianceMatrix > HOcontainer
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
std::string myname() const
std::vector< HcalCovarianceMatrix > HEcontainer
void HcalCovarianceMatrices::initContainer ( DetId  container)
private

Definition at line 14 of file HcalCovarianceMatrices.cc.

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

Referenced by addValues().

15 {
16  HcalCovarianceMatrix emptyItem;
17 
18 
19  if (fId.det()==DetId::Hcal) {
20  switch (HcalSubdetector(fId.subdetId())) {
21  case(HcalBarrel) : for (unsigned int i=0; i<sizeFor(fId); i++) HBcontainer.push_back(emptyItem); break;
22  case(HcalEndcap) : for (unsigned int i=0; i<sizeFor(fId); i++) HEcontainer.push_back(emptyItem); break;
23  case(HcalOuter) : for (unsigned int i=0; i<sizeFor(fId); i++) HOcontainer.push_back(emptyItem); break;
24  case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break;
25  default: break;
26  }
27 }
28 
29 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCovarianceMatrix > HFcontainer
std::vector< HcalCovarianceMatrix > HBcontainer
unsigned int sizeFor(DetId) const
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< HcalCovarianceMatrix > HOcontainer
std::vector< HcalCovarianceMatrix > HEcontainer
std::string HcalCovarianceMatrices::myname ( ) const
inline

Definition at line 25 of file HcalCovarianceMatrices.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addValues(), and getValues().

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

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 38 of file HcalCovarianceMatrices.h.

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

Definition at line 38 of file HcalCovarianceMatrices.h.

Member Data Documentation

std::vector<HcalCovarianceMatrix> HcalCovarianceMatrices::HBcontainer
private

Definition at line 33 of file HcalCovarianceMatrices.h.

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

std::vector<HcalCovarianceMatrix> HcalCovarianceMatrices::HEcontainer
private

Definition at line 34 of file HcalCovarianceMatrices.h.

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

std::vector<HcalCovarianceMatrix> HcalCovarianceMatrices::HFcontainer
private

Definition at line 36 of file HcalCovarianceMatrices.h.

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

std::vector<HcalCovarianceMatrix> HcalCovarianceMatrices::HOcontainer
private

Definition at line 35 of file HcalCovarianceMatrices.h.

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