ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
CaloCellGroup2Ntuple.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCalibTools/CaloCellGroup2Ntuple.h
"
6
#include "
CaloIdentifier/CaloGain.h
"
7
#include "
CaloIdentifier/CaloCell_ID.h
"
8
#include "
LArIdentifier/LArOnlineID.h
"
9
#include "
StoreGate/StoreGateSvc.h
"
10
11
CaloCellGroup2Ntuple::CaloCellGroup2Ntuple
(
const
std::string& name, ISvcLocator* pSvcLocator):
12
LArCond2NtupleBase
(name, pSvcLocator) {
13
declareProperty
(
"group"
,
m_groupInit
);
14
15
m_ntTitle
=
"CaloCellGroup"
;
16
m_ntpath
=
"/NTUPLES/FILE1/CaloCellGroup"
;
17
18
19
}
20
21
CaloCellGroup2Ntuple::~CaloCellGroup2Ntuple
()
22
=
default
;
23
24
StatusCode
CaloCellGroup2Ntuple::stop
() {
25
StatusCode
sc
;
26
27
NTuple::Array<float> values;
28
NTuple::Item<long> nValues;
29
30
sc
=
m_nt
->addItem(
"nvalues"
,nValues,0,1000);
31
if
(
sc
!=StatusCode::SUCCESS)
32
{
ATH_MSG_ERROR
(
"addItem 'nvalues' failed"
);
33
return
StatusCode::FAILURE;
34
}
35
36
sc
=
m_nt
->addItem(
"values"
,nValues,values);
37
if
(
sc
!=StatusCode::SUCCESS)
38
{
ATH_MSG_ERROR
(
"addItem 'values' failed"
);
39
return
StatusCode::FAILURE;
40
}
41
42
43
44
45
const
CaloCell_ID
* caloCellId;
46
sc
=
m_detStore
->retrieve(caloCellId,
"CaloCell_ID"
);
47
if
(
sc
.isFailure()) {
48
ATH_MSG_ERROR
(
"Could not get CaloCellID helper !"
);
49
return
StatusCode::FAILURE;
50
}
51
52
bool
stat=
m_cellGroupList
.setDefinition(
dynamic_cast<
const
CaloCell_Base_ID
*
>
(caloCellId),
m_groupInit
,
msg
());
53
if
(!stat) {
54
ATH_MSG_ERROR
(
"CaloCellGroupList::setDefinition failed!"
);
55
return
StatusCode::FAILURE;
56
}
57
m_cellGroupList
.printDef();
58
59
60
SG::ReadCondHandle<LArOnOffIdMapping>
cablingHdl{
m_cablingKey
};
61
const
LArOnOffIdMapping
* cabling=*cablingHdl;
62
if
(!cabling) {
63
ATH_MSG_WARNING
(
"Do not have cabling object LArOnOffIdMapping"
);
64
return
StatusCode::FAILURE;
65
}
66
67
for
(
const
HWIdentifier
hwid:
m_onlineId
->channel_range()) {
68
if
(cabling->isOnlineConnected(hwid)) {
69
fillFromIdentifier
(hwid);
70
Identifier
id
=cabling->cnvToIdentifier(hwid);
71
const
std::vector<float>& v=
m_cellGroupList
.valuesForCell(
id
);
72
nValues=v.size();
73
for
(
size_t
i=0;i<v.size();i++)
74
values[i]=v[i];
75
//cellCounter++;
76
sc
=
ntupleSvc
()->writeRecord(
m_nt
);
77
if
(
sc
!=StatusCode::SUCCESS) {
78
ATH_MSG_ERROR
(
"writeRecord failed"
);
79
return
StatusCode::FAILURE;
80
}
81
}
//end if isConnected
82
}
//end loop over online ID
83
84
ATH_MSG_INFO
(
"CaloCellGroup2Ntuple has finished."
);
85
return
StatusCode::SUCCESS;
86
}
// end finalize-method.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
CaloCellGroup2Ntuple.h
CaloCell_ID.h
CaloGain.h
LArOnlineID.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ntupleSvc
INTupleSvc * ntupleSvc()
Definition
ServiceAccessor.h:14
StoreGateSvc.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
CaloCellGroup2Ntuple::m_cellGroupList
CaloCellGroupList m_cellGroupList
Definition
CaloCellGroup2Ntuple.h:25
CaloCellGroup2Ntuple::CaloCellGroup2Ntuple
CaloCellGroup2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition
CaloCellGroup2Ntuple.cxx:11
CaloCellGroup2Ntuple::m_groupInit
std::vector< std::string > m_groupInit
Definition
CaloCellGroup2Ntuple.h:24
CaloCellGroup2Ntuple::~CaloCellGroup2Ntuple
~CaloCellGroup2Ntuple()
CaloCellGroup2Ntuple::stop
StatusCode stop()
Definition
CaloCellGroup2Ntuple.cxx:24
CaloCell_Base_ID
Helper base class for offline cell identifiers.
Definition
CaloCell_Base_ID.h:40
CaloCell_ID
Helper class for offline cell identifiers.
Definition
CaloCell_ID.h:34
HWIdentifier
Definition
HWIdentifier.h:13
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_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition
LArCond2NtupleBase.h:92
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::LArCond2NtupleBase
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArCond2NtupleBase.cxx:15
LArOnOffIdMapping
Definition
LArOnOffIdMapping.h:20
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0