ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
LArDSPThresholds2Ntuple.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCalibTools/LArDSPThresholds2Ntuple.h
"
6
#include "
LArIdentifier/LArOnlineID.h
"
7
8
#include "
LArRawConditions/LArDSPThresholdsComplete.h
"
9
#include "
LArCOOLConditions/LArDSPThresholdsFlat.h
"
10
11
#include "CoralBase/Blob.h"
12
#include "
AthenaPoolUtilities/AthenaAttributeList.h
"
13
14
LArDSPThresholds2Ntuple::LArDSPThresholds2Ntuple
(
const
std::string& name, ISvcLocator* pSvcLocator):
15
LArCond2NtupleBase
(name, pSvcLocator){
16
17
declareProperty
(
"NtupleTitle"
,
m_ntTitle
=
"Gain Thresholds"
);
18
declareProperty
(
"NtupleName"
,
m_ntname
=
"DSPTHR"
);
19
declareProperty
(
"DumpFlat"
,
m_doFlat
=
false
);
20
declareProperty
(
"FlatFolder"
,
m_folder
=
""
);
21
m_ntpath
=
"/NTUPLES/FILE1/"
+
m_ntname
;
22
m_addFEBTemp
=
false
;
23
}
24
25
26
StatusCode
LArDSPThresholds2Ntuple::initialize
() {
27
28
StatusCode
sc
=
LArCond2NtupleBase::initialize
();
29
if
(
sc
!=StatusCode::SUCCESS) {
30
ATH_MSG_ERROR
(
"Base init failed"
);
31
return
StatusCode::FAILURE;
32
}
33
34
sc
=
m_nt
->addItem(
"tQThr"
,
m_tQThr
);
35
if
(
sc
!=StatusCode::SUCCESS) {
36
ATH_MSG_ERROR
(
"addItem tQThr failed"
);
37
return
StatusCode::FAILURE;
38
}
39
40
sc
=
m_nt
->addItem(
"samplesThr"
,
m_samplesThr
);
41
if
(
sc
!=StatusCode::SUCCESS) {
42
ATH_MSG_ERROR
(
"addItem samplesThr failed"
);
43
return
StatusCode::FAILURE;
44
}
45
46
sc
=
m_nt
->addItem(
"trigThr"
,
m_trigThr
);
47
if
(
sc
!=StatusCode::SUCCESS) {
48
ATH_MSG_ERROR
(
"addItem trigThr failed"
);
49
return
StatusCode::FAILURE;
50
}
51
52
return
StatusCode::SUCCESS;
53
}
54
55
LArDSPThresholds2Ntuple::~LArDSPThresholds2Ntuple
()
56
=
default
;
57
58
StatusCode
LArDSPThresholds2Ntuple::stop
() {
59
StatusCode
sc
;
60
61
const
LArDSPThresholdsComplete
*dc =
nullptr
;
62
std::unique_ptr<LArDSPThresholdsFlat> df{};
63
const
AthenaAttributeList
* attrList=
nullptr
;
64
if
(
m_doFlat
) {
65
sc
=
detStore
()->retrieve(attrList,
m_folder
);
66
if
(
sc
.isFailure()) {
67
ATH_MSG_ERROR
(
"Failed to retrieve AthenaAttributeList with key "
<<
m_folder
);
68
return
sc
;
69
}
70
71
const
coral::Blob& blob = (attrList->
coralList
())[
"tQThr"
].data<coral::Blob>();
72
if
(blob.size()<3) {
73
ATH_MSG_INFO
(
"Found empty blob, nothing to do"
);
74
return
StatusCode::SUCCESS;
75
}
76
77
df=std::make_unique< LArDSPThresholdsFlat>(attrList);
78
79
}
else
{
80
sc
=
m_detStore
->retrieve(dc);
81
if
(
sc
!=StatusCode::SUCCESS) {
82
ATH_MSG_ERROR
(
"Could not retrieve LArDSPThresholdsComplete...."
);
83
return
StatusCode::FAILURE;
84
}
85
}
86
87
for
(
const
HWIdentifier
hwid:
m_onlineId
->channel_range()) {
88
if
(
m_doFlat
) {
89
m_tQThr
=df->tQThr(hwid);
90
m_samplesThr
=df->samplesThr(hwid);
91
m_trigThr
=df->trigSumThr(hwid);
92
}
else
{
93
m_tQThr
=dc->
tQThr
(hwid);
94
m_samplesThr
=dc->
samplesThr
(hwid);
95
m_trigThr
=dc->
trigSumThr
(hwid);
96
}
97
98
fillFromIdentifier
(hwid);
99
100
sc
=
ntupleSvc
()->writeRecord(
m_nt
);
101
if
(
sc
!=StatusCode::SUCCESS) {
102
ATH_MSG_ERROR
(
"writeRecord failed"
);
103
return
StatusCode::FAILURE;
104
}
105
}
106
107
108
ATH_MSG_INFO
(
"LArDSPThresholds2Ntuple has finished."
);
109
return
StatusCode::SUCCESS;
110
111
}
// end finalize-method.
112
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
AthenaAttributeList.h
LArDSPThresholds2Ntuple.h
LArDSPThresholdsComplete.h
A LArRawConditionsContainer holding thresholds used by the DSP.
LArDSPThresholdsFlat.h
LArOnlineID.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ntupleSvc
INTupleSvc * ntupleSvc()
Definition
ServiceAccessor.h:14
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table.
Definition
PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:46
AthenaAttributeList::coralList
const coral::AttributeList & coralList() const
Definition
PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:66
HWIdentifier
Definition
HWIdentifier.h:13
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition
LArCond2NtupleBase.cxx:33
LArCond2NtupleBase::m_detStore
StoreGateSvc * m_detStore
Definition
LArCond2NtupleBase.h:84
LArCond2NtupleBase::m_ntTitle
std::string m_ntTitle
Definition
LArCond2NtupleBase.h:68
LArCond2NtupleBase::m_nt
NTuple::Tuple * m_nt
Definition
LArCond2NtupleBase.h:71
LArCond2NtupleBase::m_onlineId
const LArOnlineID_Base * m_onlineId
Definition
LArCond2NtupleBase.h:88
LArCond2NtupleBase::m_ntpath
std::string m_ntpath
Definition
LArCond2NtupleBase.h:68
LArCond2NtupleBase::fillFromIdentifier
bool fillFromIdentifier(const HWIdentifier &id)
Definition
LArCond2NtupleBase.cxx:290
LArCond2NtupleBase::m_addFEBTemp
Gaudi::Property< bool > m_addFEBTemp
Definition
LArCond2NtupleBase.h:56
LArCond2NtupleBase::LArCond2NtupleBase
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArCond2NtupleBase.cxx:15
LArDSPThresholds2Ntuple::m_trigThr
NTuple::Item< float > m_trigThr
Definition
LArDSPThresholds2Ntuple.h:29
LArDSPThresholds2Ntuple::m_doFlat
bool m_doFlat
Definition
LArDSPThresholds2Ntuple.h:25
LArDSPThresholds2Ntuple::m_tQThr
NTuple::Item< float > m_tQThr
Definition
LArDSPThresholds2Ntuple.h:27
LArDSPThresholds2Ntuple::~LArDSPThresholds2Ntuple
~LArDSPThresholds2Ntuple()
LArDSPThresholds2Ntuple::m_samplesThr
NTuple::Item< float > m_samplesThr
Definition
LArDSPThresholds2Ntuple.h:28
LArDSPThresholds2Ntuple::stop
StatusCode stop()
Definition
LArDSPThresholds2Ntuple.cxx:58
LArDSPThresholds2Ntuple::LArDSPThresholds2Ntuple
LArDSPThresholds2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArDSPThresholds2Ntuple.cxx:14
LArDSPThresholds2Ntuple::m_ntname
std::string m_ntname
Definition
LArDSPThresholds2Ntuple.h:23
LArDSPThresholds2Ntuple::initialize
StatusCode initialize()
Definition
LArDSPThresholds2Ntuple.cxx:26
LArDSPThresholds2Ntuple::m_folder
std::string m_folder
Definition
LArDSPThresholds2Ntuple.h:24
LArDSPThresholdsComplete
Definition
LArDSPThresholdsComplete.h:21
LArDSPThresholdsComplete::samplesThr
float samplesThr(const HWIdentifier chid) const
Definition
LArDSPThresholdsComplete.h:27
LArDSPThresholdsComplete::tQThr
float tQThr(const HWIdentifier chid) const
Definition
LArDSPThresholdsComplete.h:26
LArDSPThresholdsComplete::trigSumThr
float trigSumThr(const HWIdentifier chid) const
Definition
LArDSPThresholdsComplete.h:28
Generated on
for ATLAS Offline Software by
1.17.0