|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/EventIDRange.h"
34 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
67 if (writeHandle.isValid()) {
69 return StatusCode::SUCCESS;
75 writeHandle.addDependency(cablingHdl);
80 writeHandle.addDependency(uA2MeVHdl);
84 writeHandle.addDependency(DAC2uAHdl);
88 writeHandle.addDependency(rampHdl);
94 febConfig = *configHdl;
95 if (febConfig==
nullptr) {
97 return StatusCode::FAILURE;
99 writeHandle.addDependency(configHdl);
105 larmPhysOverMCal=*mphysOverMcalHdl;
106 writeHandle.addDependency(mphysOverMcalHdl);
112 larHVScaleCorr=*HVScaleCorrHdl;
113 writeHandle.addDependency(HVScaleCorrHdl);
117 ATH_MSG_INFO(
"IOV of ADC2MeV object is " << writeHandle.getRange());
120 unsigned nNouA2MeV=0;
121 unsigned nNoDAC2uA=0;
122 unsigned nNoMphysOverMcal=0;
124 unsigned nNoHVScaleCorr=0;
128 unsigned rampPolyDeg=0;
131 while (rampPolyDeg==0 &&
it!=it_e) {
134 rampPolyDeg=larRamp->ADC2DAC(*
it,
gain).size();
140 ATH_MSG_INFO(
"Working with a ramp polynom of degree " << rampPolyDeg);
144 std::vector<float> ADC2MeV;
150 if (
cabling->isOnlineConnectedFromHash(hid)) {
152 const float& uA2MeV=laruA2MeV->UA2MEV(chid);
158 const float& DAC2uA=larDAC2uA->DAC2UA(chid);
166 float factor=uA2MeV*DAC2uA;
168 if (larHVScaleCorr) {
169 const float& HVScaleCorr = larHVScaleCorr->
HVScaleCorr(chid);
182 std::vector<float> factorGain(
m_nGains,factor);
184 if (larmPhysOverMCal) {
192 factorGain[
igain]/=mPhysOverMCal;
202 if (adc2dac.size()<2) {
207 ATH_MSG_VERBOSE(
"Ignore missing ramp for barrel presampler channel in low gain");
216 <<
" gain (" <<
igain<<
") "
217 <<
" uA2MeV (" << uA2MeV <<
") "
218 <<
" DAC2uA (" << DAC2uA <<
") "
219 <<
" factorGain (" << factorGain[
igain] <<
") "
220 <<
" adc2dac (" << adc2dac[0]<<
" " << adc2dac[1]<<
") "
223 ADC2MeV.resize(adc2dac.size());
232 ADC2MeV[0]=factorGain[
igain]*adc2dac[0];
236 for (
size_t i=1;
i<adc2dac.size();++
i) {
237 ADC2MeV[
i]=factorGain[
igain]*adc2dac[
i];
251 ATH_CHECK(writeHandle.record(std::move(lArADC2MeVObj)));
253 if (nNouA2MeV)
ATH_MSG_ERROR(
"No uA2MeV values for " << nNouA2MeV <<
" channels");
254 if (nNoDAC2uA)
ATH_MSG_ERROR(
"No DAC2uA values for " << nNouA2MeV <<
" channels");
257 ATH_MSG_ERROR(
"No Ramp values for " << nNoRamp <<
" channels * gains " );
260 ATH_MSG_WARNING(
"No Ramp values for " << nNoRamp <<
" channels * gains " );
263 if (nNoMphysOverMcal)
ATH_MSG_INFO(
"No MphysOverMcal values for " << nNoMphysOverMcal <<
" channels * gains");
264 if (nNoHVScaleCorr)
ATH_MSG_WARNING(
"No HVScaleCorr values for " << nNoHVScaleCorr <<
" channels");
267 return StatusCode::FAILURE;
269 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< ILArDAC2uA > m_lArDAC2uAKey
short lowerGainThreshold(const HWIdentifier &id) const
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
SG::ReadCondHandleKey< ILArMphysOverMcal > m_lArMphysOverMcalKey
SG::WriteCondHandleKey< LArADC2MeV > m_ADC2MeVKey
Gaudi::Property< bool > m_useFEBGainThresholds
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
const LArOnlineID_Base * m_larOnlineID
id_iterator channel_end() const
SG::ReadCondHandleKey< ILArRamp > m_lArRampKey
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
StatusCode initialize() override
id_range channel_range() const
StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< ILArHVScaleCorr > m_lArHVScaleCorrKey
::StatusCode StatusCode
StatusCode definition for legacy code.
bool set(const IdentifierHash &hid, const int gain, const std::vector< float > &adc2mev)
StatusCode initialize(bool used=true)
virtual const float & MphysOverMcal(const HWIdentifier &id, int gain) const =0
#define ATH_MSG_WARNING(x)
bool isEMBPS(const HWIdentifier id) const
Gaudi::Property< bool > m_isSuperCell
SG::ReadCondHandleKey< ILAruA2MeV > m_lAruA2MeVKey
virtual const float & HVScaleCorr(const HWIdentifier &id) const =0
SG::ReadCondHandleKey< LArFebConfig > m_febConfigKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
id_iterator channel_begin() const
Returns an iterator pointing to a channel identifier collection.
Proxy for accessing a range of float values like a vector.
Gaudi::Property< bool > m_completeDetector