#include <HcalCholeskyMatrices.h>
Public Member Functions | |
bool | addValues (const HcalCholeskyMatrix &myHcalCholeskyMatrix) |
const bool | exists (DetId fId) const |
std::vector< DetId > | getAllChannels () const |
const HcalCholeskyMatrix * | getValues (DetId fId, bool throwOnFail=true) const |
HcalCholeskyMatrices (const HcalTopology *topo) | |
HcalCholeskyMatrices () | |
std::string | myname () const |
~HcalCholeskyMatrices () | |
Private Member Functions | |
void | initContainer (DetId fId) |
Private Attributes | |
std::vector< HcalCholeskyMatrix > | HBcontainer |
std::vector< HcalCholeskyMatrix > | HEcontainer |
std::vector< HcalCholeskyMatrix > | HFcontainer |
std::vector< HcalCholeskyMatrix > | HOcontainer |
Definition at line 16 of file HcalCholeskyMatrices.h.
HcalCholeskyMatrices::HcalCholeskyMatrices | ( | ) | [inline] |
Definition at line 20 of file HcalCholeskyMatrices.h.
: HcalCondObjectContainerBase(0) { }
HcalCholeskyMatrices::HcalCholeskyMatrices | ( | const HcalTopology * | topo | ) |
Definition at line 3 of file HcalCholeskyMatrices.cc.
: HcalCondObjectContainerBase(topo) { }
HcalCholeskyMatrices::~HcalCholeskyMatrices | ( | ) |
Definition at line 7 of file HcalCholeskyMatrices.cc.
{ }
bool HcalCholeskyMatrices::addValues | ( | const HcalCholeskyMatrix & | myHcalCholeskyMatrix | ) |
Definition at line 74 of file HcalCholeskyMatrices.cc.
References Exception, HBcontainer, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HEcontainer, HFcontainer, HOcontainer, getHLTprescales::index, HcalCondObjectContainerBase::indexFor(), initContainer(), myname(), NULL, HcalCholeskyMatrix::rawId(), and summarizeEdmComparisonLogfiles::success.
{ bool success = false; DetId fId(myItem.rawId()); unsigned int index=indexFor(fId); HcalCholeskyMatrix* cell = NULL; if (index<0xFFFFFFFu) { if (fId.det()==DetId::Hcal) { switch (HcalSubdetector(fId.subdetId())) { case(HcalBarrel) : if (!HBcontainer.size() ) initContainer(fId); if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break; case(HcalEndcap) : if (!HEcontainer.size() ) initContainer(fId); if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break; case(HcalForward) : if (!HFcontainer.size() ) initContainer(fId); if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break; case(HcalOuter) : if (!HOcontainer.size() ) initContainer(fId); if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break; default: break; } } } if (cell!=0) { (*cell)=myItem; success = true; } if (!success) throw cms::Exception ("Filling of conditions failed") << " no valid filling possible for Conditions of type " << myname() << " for DetId " << fId.rawId(); return success; }
const bool HcalCholeskyMatrices::exists | ( | DetId | fId | ) | const |
Definition at line 59 of file HcalCholeskyMatrices.cc.
References getValues(), and HcalCholeskyMatrix::rawId().
{ const HcalCholeskyMatrix* cell = getValues(fId,false); // HcalCholeskyMatrix emptyHcalCholeskyMatrix; if (cell) // if (cell->rawId() != emptyHcalCholeskyMatrix.rawId() ) if (cell->rawId() == fId ) return true; return false; }
std::vector< DetId > HcalCholeskyMatrices::getAllChannels | ( | ) | const |
Definition at line 110 of file HcalCholeskyMatrices.cc.
References HBcontainer, HEcontainer, HFcontainer, HOcontainer, i, and HcalCholeskyMatrix::rawId().
Referenced by HcalCholeskyDecomp::analyze().
{ std::vector<DetId> channels; HcalCholeskyMatrix emptyHcalCholeskyMatrix; for (unsigned int i=0; i<HBcontainer.size(); i++) { if (emptyHcalCholeskyMatrix.rawId() != HBcontainer.at(i).rawId() ) channels.push_back( DetId(HBcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HEcontainer.size(); i++) { if (emptyHcalCholeskyMatrix.rawId() != HEcontainer.at(i).rawId() ) channels.push_back( DetId(HEcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HOcontainer.size(); i++) { if (emptyHcalCholeskyMatrix.rawId() != HOcontainer.at(i).rawId() ) channels.push_back( DetId(HOcontainer.at(i).rawId()) ); } for (unsigned int i=0; i<HFcontainer.size(); i++) { if (emptyHcalCholeskyMatrix.rawId() != HFcontainer.at(i).rawId() ) channels.push_back( DetId(HFcontainer.at(i).rawId()) ); } return channels; }
const HcalCholeskyMatrix * HcalCholeskyMatrices::getValues | ( | DetId | fId, |
bool | throwOnFail = true |
||
) | const |
Definition at line 29 of file HcalCholeskyMatrices.cc.
References DetId::det(), 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().
{ unsigned int index = indexFor(fId); const HcalCholeskyMatrix* cell = NULL; if (index<0xFFFFFFFFu) { if (fId.det()==DetId::Hcal) { switch (HcalSubdetector(fId.subdetId())) { case(HcalBarrel) : if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); case(HcalEndcap) : if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); case(HcalForward) : if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); case(HcalOuter) : if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); default: break; } } } // HcalCholeskyMatrix emptyHcalCholeskyMatrix; // if (cell->rawId() == emptyHcalCholeskyMatrix.rawId() ) if ((!cell) || (cell->rawId() != fId ) ) { if (throwOnFail) { throw cms::Exception ("Conditions not found") << "Unavailable Conditions of type " << myname() << " for cell " << fId.rawId(); } else { cell=0; } } return cell; }
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().
{ HcalCholeskyMatrix emptyItem; if (fId.det()==DetId::Hcal) { switch (HcalSubdetector(fId.subdetId())) { case(HcalBarrel) : for (unsigned int i=0; i<sizeFor(fId); i++) HBcontainer.push_back(emptyItem); break; case(HcalEndcap) : for (unsigned int i=0; i<sizeFor(fId); i++) HEcontainer.push_back(emptyItem); break; case(HcalOuter) : for (unsigned int i=0; i<sizeFor(fId); i++) HOcontainer.push_back(emptyItem); break; case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break; default: break; } } }
std::string HcalCholeskyMatrices::myname | ( | ) | const [inline] |
Definition at line 24 of file HcalCholeskyMatrices.h.
References AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by addValues(), and getValues().
{return (std::string)"HcalCholeskyMatrices";}
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().