#include <HcalDbService.h>
Definition at line 27 of file HcalDbService.h.
HcalDbService::HcalDbService | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 18 of file HcalDbService.cc.
: mPedestals (0), mPedestalWidths (0), mGains (0), mGainWidths (0), mQieShapeCache (0), mQIEData(0), mElectronicsMap(0), mRespCorrs(0), mL1TriggerObjects(0), mTimeCorrs(0), mLUTCorrs(0), mPFCorrs(0), mLutMetadata(0), mUpdateCalibrations (true), mUpdateCalibWidths(true) {}
void HcalDbService::buildCalibrations | ( | ) | const [private] |
Definition at line 53 of file HcalDbService.cc.
References HcalCalibrationsSet::clear(), HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestals::isADC(), makeHcalCalibration(), mCalibSet, mGains, mLUTCorrs, mPedestals, mQIEData, mRespCorrs, mTimeCorrs, convertSQLiteXML::ok, HcalCalibrationsSet::setCalibrations(), and HcalCalibrationsSet::sort().
Referenced by getHcalCalibrations().
{ // we use the set of ids for pedestals as the master list if ((!mPedestals) || (!mGains) || (!mQIEData) || (!mRespCorrs) || (!mTimeCorrs) || (!mLUTCorrs) ) return; std::vector<DetId> ids=mPedestals->getAllChannels(); bool pedsInADC = mPedestals->isADC(); // clear the calibrations set mCalibSet.clear(); // loop! HcalCalibrations tool; // std::cout << " length of id-vector: " << ids.size() << std::endl; for (std::vector<DetId>::const_iterator id=ids.begin(); id!=ids.end(); ++id) { // make bool ok=makeHcalCalibration(*id,&tool,pedsInADC); // store if (ok) mCalibSet.setCalibrations(*id,tool); // std::cout << "Hcal calibrations built... detid no. " << HcalGenericDetId(*id) << std::endl; } mCalibSet.sort(); }
void HcalDbService::buildCalibWidths | ( | ) | const [private] |
Definition at line 75 of file HcalDbService.cc.
References HcalCalibrationWidthsSet::clear(), HcalCondObjectContainer< Item >::getAllChannels(), HcalPedestalWidths::isADC(), makeHcalCalibrationWidth(), mCalibWidthSet, mGainWidths, mPedestalWidths, mQIEData, convertSQLiteXML::ok, HcalCalibrationWidthsSet::setCalibrationWidths(), and HcalCalibrationWidthsSet::sort().
Referenced by getHcalCalibrationWidths().
{ // we use the set of ids for pedestal widths as the master list if ((!mPedestalWidths) || (!mGainWidths) || (!mQIEData) ) return; std::vector<DetId> ids=mPedestalWidths->getAllChannels(); bool pedsInADC = mPedestalWidths->isADC(); // clear the calibrations set mCalibWidthSet.clear(); // loop! HcalCalibrationWidths tool; // std::cout << " length of id-vector: " << ids.size() << std::endl; for (std::vector<DetId>::const_iterator id=ids.begin(); id!=ids.end(); ++id) { // make bool ok=makeHcalCalibrationWidth(*id,&tool,pedsInADC); // store if (ok) mCalibWidthSet.setCalibrationWidths(*id,tool); // std::cout << "Hcal calibrations built... detid no. " << HcalGenericDetId(*id) << std::endl; } mCalibWidthSet.sort(); }
const HcalGain * HcalDbService::getGain | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 187 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mGains.
Referenced by HFSimParameters::fCtoGeV(), HPDIonFeedbackSim::fCtoGeV(), HcalSimParameters::fCtoGeV(), HcalRecHitsMaker::init(), and makeHcalCalibration().
const HcalGainWidth * HcalDbService::getGainWidth | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 194 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mGainWidths.
Referenced by HFSimParameters::fCtoGeV(), HPDIonFeedbackSim::fCtoGeV(), HcalSimParameters::fCtoGeV(), and makeHcalCalibrationWidth().
{ if (mGainWidths) { return mGainWidths->getValues (fId); } return 0; }
const HcalCalibrations & HcalDbService::getHcalCalibrations | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 33 of file HcalDbService.cc.
References buildCalibrations(), HcalCalibrationsSet::getCalibrations(), mCalibSet, and mUpdateCalibrations.
Referenced by HcalAmplifier::addPedestals(), HcalMonitorClient::PlotPedestalValues(), and HcaluLUTTPGCoder::update().
{ if (mUpdateCalibrations) { buildCalibrations(); mUpdateCalibrations = false; } return mCalibSet.getCalibrations(fId); }
const HcalCalibrationWidths & HcalDbService::getHcalCalibrationWidths | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 43 of file HcalDbService.cc.
References buildCalibWidths(), HcalCalibrationWidthsSet::getCalibrationWidths(), mCalibWidthSet, and mUpdateCalibWidths.
Referenced by HcalAmplifier::addPedestals().
{ if (mUpdateCalibWidths) { buildCalibWidths(); mUpdateCalibWidths = false; } return mCalibWidthSet.getCalibrationWidths(fId); }
const HcalChannelStatus * HcalDbService::getHcalChannelStatus | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 224 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mChannelQuality.
Referenced by HcaluLUTTPGCoder::update().
{ return mChannelQuality->getValues (fId); }
const HcalQIECoder * HcalDbService::getHcalCoder | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 201 of file HcalDbService.cc.
References HcalQIEData::getCoder(), and mQIEData.
Referenced by HcalAmplifier::addPedestals(), HcalCoderFactory::coder(), ZSEnergy_impl::keepMe(), HcalLedAnalysis::LedHBHEHists(), HcalLedAnalysis::LedHFHists(), HcalLedAnalysis::LedHOHists(), makeHcalCalibration(), makeHcalCalibrationWidth(), HcalMonitorClient::PlotPedestalValues(), HcalPedestalAnalysis::processEvent(), and HcaluLUTTPGCoder::update().
const HcalL1TriggerObject * HcalDbService::getHcalL1TriggerObject | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 219 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mL1TriggerObjects.
Referenced by HcaluLUTTPGCoder::update().
{ return mL1TriggerObjects->getValues (fId); }
const HcalLUTCorr * HcalDbService::getHcalLUTCorr | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 241 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mLUTCorrs.
Referenced by makeHcalCalibration().
const HcalLutMetadata * HcalDbService::getHcalLutMetadata | ( | ) | const |
Definition at line 255 of file HcalDbService.cc.
References mLutMetadata.
Referenced by HcaluLUTTPGCoder::update().
{ return mLutMetadata; }
const HcalElectronicsMap * HcalDbService::getHcalMapping | ( | ) | const |
Definition at line 215 of file HcalDbService.cc.
References mElectronicsMap.
{ return mElectronicsMap; }
const HcalPFCorr * HcalDbService::getHcalPFCorr | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 248 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mPFCorrs.
const HcalRespCorr * HcalDbService::getHcalRespCorr | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 166 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mRespCorrs.
Referenced by makeHcalCalibration().
{ if (mRespCorrs) { return mRespCorrs->getValues (fId); } return 0; }
const HcalQIEShape * HcalDbService::getHcalShape | ( | ) | const |
Definition at line 208 of file HcalDbService.cc.
References HcalQIEData::getShape(), and mQIEData.
Referenced by HcalAmplifier::addPedestals(), HcalCoderFactory::coder(), ZSEnergy_impl::keepMe(), HcalLedAnalysis::LedHBHEHists(), HcalLedAnalysis::LedHFHists(), HcalLedAnalysis::LedHOHists(), makeHcalCalibration(), makeHcalCalibrationWidth(), HcalMonitorClient::PlotPedestalValues(), HcalPedestalAnalysis::processEvent(), and HcaluLUTTPGCoder::update().
const HcalTimeCorr * HcalDbService::getHcalTimeCorr | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 234 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mTimeCorrs.
Referenced by makeHcalCalibration().
{ if (mTimeCorrs) { return mTimeCorrs->getValues (fId); } return 0; }
const HcalZSThreshold * HcalDbService::getHcalZSThreshold | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 229 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mZSThresholds.
Referenced by HcalZSAlgoRealistic::keepMe().
{ return mZSThresholds->getValues (fId); }
const HcalPedestal * HcalDbService::getPedestal | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 173 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mPedestals.
Referenced by HcalRecHitsMaker::init(), ZSEnergy_impl::keepMe(), HcalLedAnalysis::LedHBHEHists(), HcalLedAnalysis::LedHFHists(), HcalLedAnalysis::LedHOHists(), and makeHcalCalibration().
{ if (mPedestals) { return mPedestals->getValues (fId); } return 0; }
const HcalPedestalWidth * HcalDbService::getPedestalWidth | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 180 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mPedestalWidths.
Referenced by makeHcalCalibrationWidth(), and HcalMonitorClient::PlotPedestalValues().
{ if (mPedestalWidths) { return mPedestalWidths->getValues (fId); } return 0; }
bool HcalDbService::makeHcalCalibration | ( | const HcalGenericDetId & | fId, |
HcalCalibrations * | fObject, | ||
bool | pedestalInADC | ||
) | const [private] |
Definition at line 97 of file HcalDbService.cc.
References HcalQIECoder::charge(), getGain(), getHcalCoder(), getHcalLUTCorr(), getHcalRespCorr(), getHcalShape(), getHcalTimeCorr(), getPedestal(), HcalLUTCorr::getValue(), HcalRespCorr::getValue(), HcalTimeCorr::getValue(), HcalGain::getValues(), HcalPedestal::getValues(), i, and x.
Referenced by buildCalibrations().
{ if (fObject) { const HcalPedestal* pedestal = getPedestal (fId); const HcalGain* gain = getGain (fId); const HcalRespCorr* respcorr = getHcalRespCorr (fId); const HcalTimeCorr* timecorr = getHcalTimeCorr (fId); const HcalLUTCorr* lutcorr = getHcalLUTCorr (fId); if (pedestalInADC) { const HcalQIEShape* shape=getHcalShape(); const HcalQIECoder* coder=getHcalCoder(fId); if (pedestal && gain && shape && coder && respcorr && timecorr && lutcorr) { float pedTrue[4]; for (int i=0; i<4; i++) { float x=pedestal->getValues()[i]; int x1=(int)std::floor(x); int x2=(int)std::floor(x+1); // y = (y2-y1)/(x2-x1) * (x - x1) + y1 [note: x2-x1=1] float y2=coder->charge(*shape,x2,i); float y1=coder->charge(*shape,x1,i); pedTrue[i]=(y2-y1)*(x-x1)+y1; } *fObject = HcalCalibrations (gain->getValues (), pedTrue, respcorr->getValue(), timecorr->getValue(), lutcorr->getValue() ); return true; } } else { if (pedestal && gain && respcorr && timecorr && lutcorr) { *fObject = HcalCalibrations (gain->getValues (), pedestal->getValues (), respcorr->getValue(), timecorr->getValue(), lutcorr->getValue() ); return true; } } } return false; }
bool HcalDbService::makeHcalCalibrationWidth | ( | const HcalGenericDetId & | fId, |
HcalCalibrationWidths * | fObject, | ||
bool | pedestalInADC | ||
) | const [private] |
Definition at line 132 of file HcalDbService.cc.
References HcalQIECoder::charge(), getGainWidth(), getHcalCoder(), getHcalShape(), getPedestalWidth(), HcalGainWidth::getValues(), HcalPedestalWidth::getWidth(), i, and x.
Referenced by buildCalibWidths().
{ if (fObject) { const HcalPedestalWidth* pedestalwidth = getPedestalWidth (fId); const HcalGainWidth* gainwidth = getGainWidth (fId); if (pedestalInADC) { const HcalQIEShape* shape=getHcalShape(); const HcalQIECoder* coder=getHcalCoder(fId); if (pedestalwidth && gainwidth && shape && coder) { float pedTrueWidth[4]; for (int i=0; i<4; i++) { float x=pedestalwidth->getWidth(i); // assume QIE is linear in low range and use x1=0 and x2=1 // y = (y2-y1) * (x) [do not add any constant, only scale!] float y2=coder->charge(*shape,1,i); float y1=coder->charge(*shape,0,i); pedTrueWidth[i]=(y2-y1)*x; } *fObject = HcalCalibrationWidths (gainwidth->getValues (), pedTrueWidth); return true; } } else { if (pedestalwidth && gainwidth) { float pedestalWidth [4]; for (int i = 0; i < 4; i++) pedestalWidth [i] = pedestalwidth->getWidth (i); *fObject = HcalCalibrationWidths (gainwidth->getValues (), pedestalWidth); return true; } } } return false; }
void HcalDbService::setData | ( | const HcalPFCorrs * | fItem | ) | [inline] |
void HcalDbService::setData | ( | const HcalL1TriggerObjects * | fItem | ) | [inline] |
Definition at line 60 of file HcalDbService.h.
References mL1TriggerObjects.
{mL1TriggerObjects = fItem;}
void HcalDbService::setData | ( | const HcalGains * | fItem | ) | [inline] |
Definition at line 52 of file HcalDbService.h.
References mGains, and mUpdateCalibrations.
{mGains = fItem; mUpdateCalibrations = true; }
void HcalDbService::setData | ( | const HcalLUTCorrs * | fItem | ) | [inline] |
Definition at line 61 of file HcalDbService.h.
References mLUTCorrs, and mUpdateCalibrations.
{mLUTCorrs = fItem; mUpdateCalibrations = true; }
void HcalDbService::setData | ( | const HcalElectronicsMap * | fItem | ) | [inline] |
Definition at line 56 of file HcalDbService.h.
References mElectronicsMap.
{mElectronicsMap = fItem;}
void HcalDbService::setData | ( | const HcalQIEData * | fItem | ) | [inline] |
Definition at line 54 of file HcalDbService.h.
References mQIEData, mUpdateCalibrations, and mUpdateCalibWidths.
{mQIEData = fItem; mUpdateCalibrations = true; mUpdateCalibWidths = true; }
void HcalDbService::setData | ( | const HcalRespCorrs * | fItem | ) | [inline] |
Definition at line 57 of file HcalDbService.h.
References mRespCorrs, and mUpdateCalibrations.
{mRespCorrs = fItem; mUpdateCalibrations = true; }
void HcalDbService::setData | ( | const HcalChannelQuality * | fItem | ) | [inline] |
Definition at line 55 of file HcalDbService.h.
References mChannelQuality.
{mChannelQuality = fItem;}
void HcalDbService::setData | ( | const HcalZSThresholds * | fItem | ) | [inline] |
void HcalDbService::setData | ( | const HcalPedestalWidths * | fItem | ) | [inline] |
Definition at line 51 of file HcalDbService.h.
References mPedestalWidths, and mUpdateCalibWidths.
{mPedestalWidths = fItem; mUpdateCalibWidths = true; }
void HcalDbService::setData | ( | const HcalPedestals * | fItem | ) | [inline] |
Definition at line 50 of file HcalDbService.h.
References mPedestals, and mUpdateCalibrations.
{mPedestals = fItem; mUpdateCalibrations = true; }
void HcalDbService::setData | ( | const HcalGainWidths * | fItem | ) | [inline] |
Definition at line 53 of file HcalDbService.h.
References mGainWidths, and mUpdateCalibWidths.
{mGainWidths = fItem; mUpdateCalibWidths = true; }
void HcalDbService::setData | ( | const HcalTimeCorrs * | fItem | ) | [inline] |
Definition at line 58 of file HcalDbService.h.
References mTimeCorrs, and mUpdateCalibrations.
{mTimeCorrs = fItem; mUpdateCalibrations = true; }
void HcalDbService::setData | ( | const HcalLutMetadata * | fItem | ) | [inline] |
HcalCalibrationsSet HcalDbService::mCalibSet [mutable, private] |
Definition at line 88 of file HcalDbService.h.
Referenced by buildCalibrations(), and getHcalCalibrations().
HcalCalibrationWidthsSet HcalDbService::mCalibWidthSet [mutable, private] |
Definition at line 89 of file HcalDbService.h.
Referenced by buildCalibWidths(), and getHcalCalibrationWidths().
const HcalChannelQuality* HcalDbService::mChannelQuality [private] |
Definition at line 78 of file HcalDbService.h.
Referenced by getHcalChannelStatus(), and setData().
const HcalElectronicsMap* HcalDbService::mElectronicsMap [private] |
Definition at line 79 of file HcalDbService.h.
Referenced by getHcalMapping(), and setData().
const HcalGains* HcalDbService::mGains [private] |
Definition at line 74 of file HcalDbService.h.
Referenced by buildCalibrations(), getGain(), and setData().
const HcalGainWidths* HcalDbService::mGainWidths [private] |
Definition at line 75 of file HcalDbService.h.
Referenced by buildCalibWidths(), getGainWidth(), and setData().
const HcalL1TriggerObjects* HcalDbService::mL1TriggerObjects [private] |
Definition at line 82 of file HcalDbService.h.
Referenced by getHcalL1TriggerObject(), and setData().
const HcalLUTCorrs* HcalDbService::mLUTCorrs [private] |
Definition at line 84 of file HcalDbService.h.
Referenced by buildCalibrations(), getHcalLUTCorr(), and setData().
const HcalLutMetadata* HcalDbService::mLutMetadata [private] |
Definition at line 86 of file HcalDbService.h.
Referenced by getHcalLutMetadata(), and setData().
const HcalPedestals* HcalDbService::mPedestals [private] |
Definition at line 72 of file HcalDbService.h.
Referenced by buildCalibrations(), getPedestal(), and setData().
const HcalPedestalWidths* HcalDbService::mPedestalWidths [private] |
Definition at line 73 of file HcalDbService.h.
Referenced by buildCalibWidths(), getPedestalWidth(), and setData().
const HcalPFCorrs* HcalDbService::mPFCorrs [private] |
Definition at line 85 of file HcalDbService.h.
Referenced by getHcalPFCorr(), and setData().
const HcalQIEData* HcalDbService::mQIEData [private] |
Definition at line 77 of file HcalDbService.h.
Referenced by buildCalibrations(), buildCalibWidths(), getHcalCoder(), getHcalShape(), and setData().
QieShape* HcalDbService::mQieShapeCache [mutable, private] |
Definition at line 76 of file HcalDbService.h.
const HcalRespCorrs* HcalDbService::mRespCorrs [private] |
Definition at line 80 of file HcalDbService.h.
Referenced by buildCalibrations(), getHcalRespCorr(), and setData().
const HcalTimeCorrs* HcalDbService::mTimeCorrs [private] |
Definition at line 83 of file HcalDbService.h.
Referenced by buildCalibrations(), getHcalTimeCorr(), and setData().
bool HcalDbService::mUpdateCalibrations [mutable, private] |
Definition at line 90 of file HcalDbService.h.
Referenced by getHcalCalibrations(), and setData().
bool HcalDbService::mUpdateCalibWidths [mutable, private] |
Definition at line 90 of file HcalDbService.h.
Referenced by getHcalCalibrationWidths(), and setData().
const HcalZSThresholds* HcalDbService::mZSThresholds [private] |
Definition at line 81 of file HcalDbService.h.
Referenced by getHcalZSThreshold(), and setData().