ATLAS Offline Software
Loading...
Searching...
No Matches
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
13LArDSPConfig2Ntuple::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);
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
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
static Double_t sc
INTupleSvc * ntupleSvc()
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
An AttributeList represents a logical row of attributes in a metadata table.
const LArOnlineID_Base * m_onlineId
bool fillFromIdentifier(const HWIdentifier &id)
Gaudi::Property< bool > m_addFEBTemp
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
NTuple::Item< short > m_useMgIntercept
LArDSPConfig2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
NTuple::Item< short > m_useHgIntercept
NTuple::Item< short > m_peakSample
NTuple::Item< short > m_useLgIntercept
bool useLGRampIntercept(const HWIdentifier FEBid) const
bool useMGRampIntercept(const HWIdentifier FEBid) const
uint8_t peakSample(const HWIdentifier FEBid) const
bool useHGRampIntercept(const HWIdentifier FEBid) const