ATLAS Offline Software
LArDSPConfig2Ntuple.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9 
10 #include "CoralBase/Blob.h"
12 
13 LArDSPConfig2Ntuple::LArDSPConfig2Ntuple(const std::string& name, ISvcLocator* pSvcLocator):
14  LArCond2NtupleBase(name, pSvcLocator){
15 
16  declareProperty("NtupleTitle",m_ntTitle="DSP Config");
17  declareProperty("NtupleName",m_ntname="DSPCONFIG");
18  declareProperty("Folder",m_folder);
19  m_ntpath="/NTUPLES/FILE1/"+m_ntname;
20  m_addFEBTemp=false;
21 }
22 
23 
25 
27  if (sc!=StatusCode::SUCCESS) {
28  ATH_MSG_ERROR( "Base init failed" );
29  return StatusCode::FAILURE;
30  }
31 
32  sc=m_nt->addItem("peakSample",m_peakSample);
33  if (sc!=StatusCode::SUCCESS) {
34  ATH_MSG_ERROR( "addItem peakSample failed" );
35  return StatusCode::FAILURE;
36  }
37 
38  sc=m_nt->addItem("useHGIntercept",m_useHgIntercept);
39  if (sc!=StatusCode::SUCCESS) {
40  ATH_MSG_ERROR( "addItem useHGIntercept failed" );
41  return StatusCode::FAILURE;
42  }
43 
44  sc=m_nt->addItem("useMGIntercept",m_useMgIntercept);
45  if (sc!=StatusCode::SUCCESS) {
46  ATH_MSG_ERROR( "addItem useMGIntercept failed" );
47  return StatusCode::FAILURE;
48  }
49 
50  sc=m_nt->addItem("useLGIntercept",m_useLgIntercept);
51  if (sc!=StatusCode::SUCCESS) {
52  ATH_MSG_ERROR( "addItem useLGIntercept failed" );
53  return StatusCode::FAILURE;
54  }
55 
56  return StatusCode::SUCCESS;
57 }
58 
60 = default;
61 
63  StatusCode sc;
64 
65 
66  //const LArDSPConfig *dc = 0;
67  const AthenaAttributeList* attrList=nullptr;
68  sc=detStore()->retrieve(attrList,m_folder);
69  if (sc.isFailure()) {
70  ATH_MSG_ERROR( "Failed to retrieve AthenaAttributeList with key " << m_folder );
71  return sc;
72  }
73 
74  LArDSPConfig larDSPConfig(attrList);
75 
76  for (const HWIdentifier hwid: m_onlineId->channel_range()) {
77  m_peakSample=larDSPConfig.peakSample(hwid);
78  m_useMgIntercept=larDSPConfig.useMGRampIntercept(hwid);
79  m_useHgIntercept=larDSPConfig.useHGRampIntercept(hwid);
80  m_useLgIntercept=larDSPConfig.useLGRampIntercept(hwid);
81  fillFromIdentifier(hwid);
82  //ATH_MSG_INFO("hwid: "<<hwid.getString()<<" "<<tQThr<<" : "<<samplesThr<<" : "<<trigThr);
83 
84  sc=ntupleSvc()->writeRecord(m_nt);
85  if (sc!=StatusCode::SUCCESS) {
86  ATH_MSG_ERROR( "writeRecord failed" );
87  return StatusCode::FAILURE;
88  }
89  }
90 
91  ATH_MSG_INFO( "LArDSPConfig2Ntuple has finished." );
92  return StatusCode::SUCCESS;
93 
94 }// end finalize-method.
95 
LArDSPConfig2Ntuple.h
LArDSPConfig::useMGRampIntercept
bool useMGRampIntercept(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:44
LArDSPConfig2Ntuple::initialize
StatusCode initialize()
Definition: LArDSPConfig2Ntuple.cxx:24
LArCond2NtupleBase::m_addFEBTemp
Gaudi::Property< bool > m_addFEBTemp
Definition: LArCond2NtupleBase.h:54
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
HWIdentifier
Definition: HWIdentifier.h:13
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition: LArCond2NtupleBase.cxx:33
AthenaAttributeList.h
LArCond2NtupleBase
Definition: LArCond2NtupleBase.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArDSPConfig2Ntuple::m_folder
std::string m_folder
Definition: LArDSPConfig2Ntuple.h:24
LArDSPConfig
Definition: LArDSPConfig.h:18
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArOnlineID_Base::channel_range
id_range channel_range() const
Definition: LArOnlineID_Base.cxx:1936
LArDSPConfig.h
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
LArDSPConfig2Ntuple::LArDSPConfig2Ntuple
LArDSPConfig2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArDSPConfig2Ntuple.cxx:13
LArCond2NtupleBase::m_nt
NTuple::Tuple * m_nt
Definition: LArCond2NtupleBase.h:68
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
LArDSPConfig2Ntuple::~LArDSPConfig2Ntuple
~LArDSPConfig2Ntuple()
LArDSPConfig2Ntuple::m_useLgIntercept
NTuple::Item< short > m_useLgIntercept
Definition: LArDSPConfig2Ntuple.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArCond2NtupleBase::m_ntTitle
std::string m_ntTitle
Definition: LArCond2NtupleBase.h:65
LArCond2NtupleBase::m_onlineId
const LArOnlineID_Base * m_onlineId
Definition: LArCond2NtupleBase.h:85
LArDSPConfig::useLGRampIntercept
bool useLGRampIntercept(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:50
LArDSPConfig2Ntuple::m_useHgIntercept
NTuple::Item< short > m_useHgIntercept
Definition: LArDSPConfig2Ntuple.h:27
LArDSPConfig2Ntuple::m_peakSample
NTuple::Item< short > m_peakSample
Definition: LArDSPConfig2Ntuple.h:26
LArCond2NtupleBase::fillFromIdentifier
bool fillFromIdentifier(const HWIdentifier &id)
Definition: LArCond2NtupleBase.cxx:288
LArDSPConfig2Ntuple::stop
StatusCode stop()
Definition: LArDSPConfig2Ntuple.cxx:62
LArDSPConfig2Ntuple::m_ntname
std::string m_ntname
Definition: LArDSPConfig2Ntuple.h:23
LArDSPConfig::useHGRampIntercept
bool useHGRampIntercept(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:47
LArDSPConfig2Ntuple::m_useMgIntercept
NTuple::Item< short > m_useMgIntercept
Definition: LArDSPConfig2Ntuple.h:28
ntupleSvc
INTupleSvc * ntupleSvc()
Definition: ServiceAccessor.h:14
LArDSPConfig::peakSample
uint8_t peakSample(const HWIdentifier FEBid) const
Definition: LArDSPConfig.h:55
LArOnlineID.h