ATLAS Offline Software
LArADC2MeV2Ntuple.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8  m_ntTitle="ADC2MeV";
9  m_ntName="ADC2MeV";
10  m_ntpath=std::string("/NTUPLES/FILE1/")+m_ntName;
11 
14 }
15 
16 
17 
19 
20  NTuple::Array<float> coeffs;
21  NTuple::Item<unsigned long> coeffIndex;
22  NTuple::Item<unsigned long> gain;
24  const LArADC2MeV* adc2MEV{*adc2MeVHdl};
25 
26  ATH_CHECK(m_nt->addItem("Xi",coeffIndex,0,3));
27  ATH_CHECK(m_nt->addItem("X",coeffIndex,coeffs));
28  ATH_CHECK(m_nt->addItem("gain",gain,0,3));
30  for (const HWIdentifier hwid: m_onlineId->channel_range()) {
31  auto adc2mevCoeff=adc2MEV->ADC2MEV(hwid,igain);
32  if (adc2mevCoeff.size()>0) {
33  fillFromIdentifier(hwid);
34  gain=igain;
35  for (coeffIndex=0;coeffIndex<adc2mevCoeff.size();coeffIndex++) {
36  coeffs[coeffIndex]=adc2mevCoeff[coeffIndex];
37  }
38  ATH_CHECK(ntupleSvc()->writeRecord(m_nt));
39  } //end if have ADC2MeV values for this cell and gain
40  }//end loop over cells
41  }//end loop over gians
42 
43  ATH_MSG_INFO( "LArADC2MeV2Ntuple has finished." );
44  return StatusCode::SUCCESS;
45 
46 }
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArADC2MeV2Ntuple::initialize
StatusCode initialize()
Definition: LArADC2MeV2Ntuple.cxx:7
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArADC2MeV2Ntuple.h
LArADC2MeV2Ntuple::m_ntName
std::string m_ntName
Definition: LArADC2MeV2Ntuple.h:28
LArADC2MeV2Ntuple::m_adc2MeVKey
SG::ReadCondHandleKey< LArADC2MeV > m_adc2MeVKey
Definition: LArADC2MeV2Ntuple.h:27
HWIdentifier
Definition: HWIdentifier.h:13
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition: LArCond2NtupleBase.cxx:33
perfmonmt-refit.coeffs
coeffs
Definition: perfmonmt-refit.py:105
LArOnlineID_Base::channel_range
id_range channel_range() const
Definition: LArOnlineID_Base.cxx:1932
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArCond2NtupleBase::m_ntpath
std::string m_ntpath
Definition: LArCond2NtupleBase.h:65
LArCond2NtupleBase::m_nt
NTuple::Tuple * m_nt
Definition: LArCond2NtupleBase.h:68
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
LArCond2NtupleBase::m_ntTitle
std::string m_ntTitle
Definition: LArCond2NtupleBase.h:65
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArCond2NtupleBase::m_onlineId
const LArOnlineID_Base * m_onlineId
Definition: LArCond2NtupleBase.h:85
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArADC2MeV
Definition: LArADC2MeV.h:21
LArCond2NtupleBase::fillFromIdentifier
bool fillFromIdentifier(const HWIdentifier &id)
Definition: LArCond2NtupleBase.cxx:288
LArADC2MeV2Ntuple::stop
virtual StatusCode stop()
Definition: LArADC2MeV2Ntuple.cxx:18
ntupleSvc
INTupleSvc * ntupleSvc()
Definition: ServiceAccessor.h:14