ATLAS Offline Software
Loading...
Searching...
No Matches
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
12 ATH_CHECK(m_adc2MeVKey.initialize());
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));
29 for(long igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN; igain++) {
30 for (const HWIdentifier hwid: m_onlineId->channel_range()) {
31 auto adc2mevCoeff=adc2MEV->ADC2MEV(hwid,igain);
32 if (adc2mevCoeff.size()>0) {
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
INTupleSvc * ntupleSvc()
virtual StatusCode stop()
SG::ReadCondHandleKey< LArADC2MeV > m_adc2MeVKey
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition LArADC2MeV.h:32
const LArOnlineID_Base * m_onlineId
bool fillFromIdentifier(const HWIdentifier &id)
@ LARNGAIN
Definition CaloGain.h:19
@ LARHIGHGAIN
Definition CaloGain.h:18