#include <CalibFormats/HcalObjects/interface/HcalDbService.h>
Definition at line 26 of file HcalDbService.h.
HcalDbService::HcalDbService | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 19 of file HcalDbService.cc.
00020 : 00021 mQieShapeCache (0), 00022 mPedestals (0), 00023 mPedestalWidths (0), 00024 mGains (0), 00025 mGainWidths (0), 00026 mQIEData(0), 00027 mElectronicsMap(0), 00028 mRespCorrs(0), 00029 mPedestalInADC(cfg.getUntrackedParameter<bool>("PedestalInADC",false)) 00030 {}
void HcalDbService::buildCalibrations | ( | ) | [private] |
Definition at line 65 of file HcalDbService.cc.
References HcalCalibrationsSet::clear(), id, makeHcalCalibration(), mCalibSet, mGains, mPedestals, mQIEData, mRespCorrs, HcalCalibrationsSet::setCalibrations(), and HcalCalibrationsSet::sort().
Referenced by setData().
00065 { 00066 // we use the set of ids for pedestals as the master list 00067 if ((!mPedestals) || (!mGains) || (!mQIEData) || (!mRespCorrs)) return; 00068 std::vector<DetId> ids=mPedestals->getAllChannels(); 00069 // clear the calibrations set 00070 mCalibSet.clear(); 00071 // loop! 00072 HcalCalibrations tool; 00073 00074 // std::cout << " length of id-vector: " << ids.size() << std::endl; 00075 for (std::vector<DetId>::const_iterator id=ids.begin(); id!=ids.end(); ++id) { 00076 // make 00077 bool ok=makeHcalCalibration(*id,&tool); 00078 // store 00079 if (ok) mCalibSet.setCalibrations(*id,tool); 00080 // std::cout << "Hcal calibrations built... detid no. " << HcalGenericDetId(*id) << std::endl; 00081 } 00082 mCalibSet.sort(); 00083 }
const HcalGain * HcalDbService::getGain | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 139 of file HcalDbService.cc.
References mGains.
Referenced by HFSimParameters::fCtoGeV(), HcalSimParameters::fCtoGeV(), HcalRecHitsMaker::init(), and makeHcalCalibration().
const HcalGainWidth * HcalDbService::getGainWidth | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 146 of file HcalDbService.cc.
References mGainWidths.
Referenced by HFSimParameters::fCtoGeV(), HcalSimParameters::fCtoGeV(), and makeHcalCalibrationWidth().
00146 { 00147 if (mGainWidths) { 00148 return mGainWidths->getValues (fId); 00149 } 00150 return 0; 00151 }
const HcalCalibrations& HcalDbService::getHcalCalibrations | ( | const HcalGenericDetId & | fId | ) | const [inline] |
Definition at line 31 of file HcalDbService.h.
References HcalCalibrationsSet::getCalibrations(), and mCalibSet.
Referenced by HcalDeadCellMonitor::createMaps(), HcalHotCellMonitor::createMaps(), HcalMTCCMonitor::dumpDigi(), HcalPedestalMonitor::fillDBValues(), HcalLaserMonitor::processEvent(), HcalLEDMonitor::processEvent(), HcalPedestalMonitor::processEvent(), HcalMTCCMonitor::processEvent(), HcalDeadCellMonitor::processEvent_digi(), HcalHotCellMonitor::processEvent_pedestal(), and HcaluLUTTPGCoder::update().
00031 { return mCalibSet.getCalibrations(fId); }
const HcalQIECoder * HcalDbService::getHcalCoder | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 153 of file HcalDbService.cc.
References HcalQIEData::getCoder(), and mQIEData.
Referenced by HcalCoderFactory::coder(), HcalDeadCellMonitor::createMaps(), HcalHotCellMonitor::createMaps(), HcalMTCCMonitor::dumpDigi(), HcalPedestalMonitor::fillDBValues(), ZSEnergy_impl::keepMe(), makeHcalCalibration(), makeHcalCalibrationWidth(), HcalLaserMonitor::processEvent(), HcalPedestalAnalysis::processEvent(), HcalMTCCMonitor::processEvent(), HcalPedestalMonitor::processEvent(), HcalDeadCellMonitor::processEvent_digi(), HcalHotCellMonitor::processEvent_pedestal(), and HcaluLUTTPGCoder::update().
00153 { 00154 if (mQIEData) { 00155 return mQIEData->getCoder (fId); 00156 } 00157 return 0; 00158 }
const HcalElectronicsMap * HcalDbService::getHcalMapping | ( | ) | const |
Definition at line 166 of file HcalDbService.cc.
References mElectronicsMap.
00166 { 00167 return mElectronicsMap; 00168 }
const HcalRespCorr * HcalDbService::getHcalRespCorr | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 118 of file HcalDbService.cc.
References HcalCondObjectContainer< Item >::getValues(), and mRespCorrs.
Referenced by makeHcalCalibration().
00118 { 00119 if (mRespCorrs) { 00120 return mRespCorrs->getValues (fId); 00121 } 00122 return 0; 00123 }
const HcalQIEShape * HcalDbService::getHcalShape | ( | ) | const |
Definition at line 160 of file HcalDbService.cc.
References HcalQIEData::getShape(), and mQIEData.
Referenced by HcalCoderFactory::coder(), HcalDeadCellMonitor::createMaps(), HcalHotCellMonitor::createMaps(), HcalPedestalMonitor::fillDBValues(), ZSEnergy_impl::keepMe(), makeHcalCalibration(), makeHcalCalibrationWidth(), HcalLaserMonitor::processEvent(), HcalPedestalAnalysis::processEvent(), HcalMTCCMonitor::processEvent(), HcalPedestalMonitor::processEvent(), HcalDeadCellMonitor::processEvent_digi(), HcalHotCellMonitor::processEvent_pedestal(), and HcaluLUTTPGCoder::update().
const HcalPedestal * HcalDbService::getPedestal | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 125 of file HcalDbService.cc.
References mPedestals.
Referenced by HcalAmplifier::amplify(), HcalRecHitsMaker::init(), ZSEnergy_impl::keepMe(), and makeHcalCalibration().
00125 { 00126 if (mPedestals) { 00127 return mPedestals->getValues (fId); 00128 } 00129 return 0; 00130 }
const HcalPedestalWidth * HcalDbService::getPedestalWidth | ( | const HcalGenericDetId & | fId | ) | const |
Definition at line 132 of file HcalDbService.cc.
References mPedestalWidths.
Referenced by HcalAmplifier::amplify(), HcalDeadCellMonitor::createMaps(), HcalHotCellMonitor::createMaps(), HcalPedestalMonitor::fillDBValues(), and makeHcalCalibrationWidth().
00132 { 00133 if (mPedestalWidths) { 00134 return mPedestalWidths->getValues (fId); 00135 } 00136 return 0; 00137 }
bool HcalDbService::makeHcalCalibration | ( | const HcalGenericDetId & | fId, | |
HcalCalibrations * | fObject | |||
) | const [private] |
Definition at line 32 of file HcalDbService.cc.
References HcalQIECoder::charge(), getGain(), getHcalCoder(), getHcalRespCorr(), getHcalShape(), getPedestal(), HcalRespCorr::getValue(), HcalGain::getValues(), HcalPedestal::getValues(), i, int, mPedestalInADC, pedestal, and x.
Referenced by buildCalibrations().
00032 { 00033 if (fObject) { 00034 const HcalPedestal* pedestal = getPedestal (fId); 00035 const HcalGain* gain = getGain (fId); 00036 const HcalRespCorr* respcorr = getHcalRespCorr (fId); 00037 00038 if (mPedestalInADC) { 00039 const HcalQIEShape* shape=getHcalShape(); 00040 const HcalQIECoder* coder=getHcalCoder(fId); 00041 if (pedestal && gain && shape && coder && respcorr) { 00042 float pedTrue[4]; 00043 for (int i=0; i<4; i++) { 00044 float x=pedestal->getValues()[i]; 00045 int x1=(int)std::floor(pedTrue[i]); 00046 int x2=(int)std::floor(pedTrue[i]+1); 00047 // y = (y2-y1)/(x2-x1) * (x - x1) + y1 [note: x2-x1=1] 00048 float y2=coder->charge(*shape,x2,i); 00049 float y1=coder->charge(*shape,x1,i); 00050 pedTrue[i]=(y2-y1)*(x-x1)+y1; 00051 } 00052 *fObject = HcalCalibrations (gain->getValues (), pedTrue, respcorr->getValue() ); 00053 return true; 00054 } 00055 } else { 00056 if (pedestal && gain && respcorr) { 00057 *fObject = HcalCalibrations (gain->getValues (), pedestal->getValues (), respcorr->getValue() ); 00058 return true; 00059 } 00060 } 00061 } 00062 return false; 00063 }
bool HcalDbService::makeHcalCalibrationWidth | ( | const HcalGenericDetId & | fId, | |
HcalCalibrationWidths * | fObject | |||
) | const |
Definition at line 85 of file HcalDbService.cc.
References HcalQIECoder::charge(), getGainWidth(), getHcalCoder(), getHcalShape(), getPedestalWidth(), HcalGainWidth::getValues(), HcalPedestalWidth::getWidth(), i, mPedestalInADC, pedestal, and x.
Referenced by HcalDeadCellMonitor::processEvent_digi(), and HcalHotCellMonitor::processEvent_pedestal().
00085 { 00086 if (fObject) { 00087 const HcalPedestalWidth* pedestal = getPedestalWidth (fId); 00088 const HcalGainWidth* gain = getGainWidth (fId); 00089 if (mPedestalInADC) { 00090 const HcalQIEShape* shape=getHcalShape(); 00091 const HcalQIECoder* coder=getHcalCoder(fId); 00092 if (pedestal && gain && shape && coder) { 00093 float pedTrueWidth[4]; 00094 for (int i=0; i<4; i++) { 00095 float x=pedestal->getWidth(i); 00096 // assume QIE is linear in low range and use x1=0 and x2=1 00097 // y = (y2-y1) * (x) [do not add any constant, only scale!] 00098 float y2=coder->charge(*shape,1,i); 00099 float y1=coder->charge(*shape,0,i); 00100 pedTrueWidth[i]=(y2-y1)*x; 00101 } 00102 *fObject = HcalCalibrationWidths (gain->getValues (), pedTrueWidth); 00103 return true; 00104 } 00105 } else { 00106 if (pedestal && gain) { 00107 float pedestalWidth [4]; 00108 for (int i = 0; i < 4; i++) pedestalWidth [i] = pedestal->getWidth (i); 00109 *fObject = HcalCalibrationWidths (gain->getValues (), pedestalWidth); 00110 return true; 00111 } 00112 } 00113 } 00114 return false; 00115 }
void HcalDbService::setData | ( | const HcalZSThresholds * | fItem | ) | [inline] |
Definition at line 50 of file HcalDbService.h.
References mZSThresholds.
00050 {mZSThresholds = fItem;}
void HcalDbService::setData | ( | const HcalRespCorrs * | fItem | ) | [inline] |
void HcalDbService::setData | ( | const HcalElectronicsMap * | fItem | ) | [inline] |
Definition at line 48 of file HcalDbService.h.
References mElectronicsMap.
00048 {mElectronicsMap = fItem;}
void HcalDbService::setData | ( | const HcalChannelQuality * | fItem | ) | [inline] |
Definition at line 47 of file HcalDbService.h.
References mChannelQuality.
00047 {mChannelQuality = fItem;}
void HcalDbService::setData | ( | const HcalQIEData * | fItem | ) | [inline] |
Definition at line 46 of file HcalDbService.h.
References buildCalibrations(), and mQIEData.
00046 {mQIEData = fItem; buildCalibrations(); }
void HcalDbService::setData | ( | const HcalGainWidths * | fItem | ) | [inline] |
void HcalDbService::setData | ( | const HcalPedestalWidths * | fItem | ) | [inline] |
Definition at line 43 of file HcalDbService.h.
References mPedestalWidths.
00043 {mPedestalWidths = fItem;}
void HcalDbService::setData | ( | const HcalPedestals * | fItem | ) | [inline] |
Definition at line 42 of file HcalDbService.h.
References buildCalibrations(), and mPedestals.
00042 {mPedestals = fItem; buildCalibrations(); }
HcalCalibrationsSet HcalDbService::mCalibSet [private] |
Definition at line 66 of file HcalDbService.h.
Referenced by buildCalibrations(), and getHcalCalibrations().
const HcalChannelQuality* HcalDbService::mChannelQuality [private] |
const HcalElectronicsMap* HcalDbService::mElectronicsMap [private] |
const HcalGains* HcalDbService::mGains [private] |
Definition at line 58 of file HcalDbService.h.
Referenced by buildCalibrations(), getGain(), and setData().
const HcalGainWidths* HcalDbService::mGainWidths [private] |
bool HcalDbService::mPedestalInADC [private] |
Definition at line 65 of file HcalDbService.h.
Referenced by makeHcalCalibration(), and makeHcalCalibrationWidth().
const HcalPedestals* HcalDbService::mPedestals [private] |
Definition at line 56 of file HcalDbService.h.
Referenced by buildCalibrations(), getPedestal(), and setData().
const HcalPedestalWidths* HcalDbService::mPedestalWidths [private] |
const HcalQIEData* HcalDbService::mQIEData [private] |
Definition at line 60 of file HcalDbService.h.
Referenced by buildCalibrations(), getHcalCoder(), getHcalShape(), and setData().
QieShape* HcalDbService::mQieShapeCache [mutable, private] |
Definition at line 55 of file HcalDbService.h.
const HcalRespCorrs* HcalDbService::mRespCorrs [private] |
Definition at line 63 of file HcalDbService.h.
Referenced by buildCalibrations(), getHcalRespCorr(), and setData().
const HcalZSThresholds* HcalDbService::mZSThresholds [private] |