ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArTest
LArCalibTest
src
DumpCaloBadChannels.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCalibTest/DumpCaloBadChannels.h
"
6
#include "GaudiKernel/MsgStream.h"
7
#include "GaudiKernel/ThreadLocalContext.h"
8
#include "
CaloIdentifier/CaloCell_ID.h
"
9
#include "
StoreGate/StoreGateSvc.h
"
10
#include <iostream>
11
#include <fstream>
12
13
DumpCaloBadChannels::DumpCaloBadChannels
(
const
std::string & name,
14
ISvcLocator * pSvcLocator) :
15
AthAlgorithm
(name,pSvcLocator),
16
m_caloBCT
(
"CaloBadChanTool"
),
17
m_cellID
(0)
18
19
{
20
declareProperty
(
"FileName"
,
m_fileName
=
""
);
21
}
22
23
24
DumpCaloBadChannels::~DumpCaloBadChannels
() {}
25
26
27
StatusCode
DumpCaloBadChannels::initialize
() {
28
ATH_MSG_INFO
(
"in Intialize()"
);
29
ATH_CHECK
(
detStore
()->retrieve(
m_cellID
,
"CaloCell_ID"
) );
30
ATH_CHECK
(
m_caloBCT
.retrieve() );
31
return
StatusCode::SUCCESS;
32
}
33
34
35
36
37
StatusCode
DumpCaloBadChannels::finalize
() {
38
ATH_MSG_INFO
(
"in finalize()"
);
39
std::ostream *out = &(std::cout);
40
std::ofstream outfile;
41
if
(
m_fileName
.size()) {
42
outfile.open(
m_fileName
.c_str(),std::ios::out);
43
if
(outfile.is_open()) {
44
ATH_MSG_INFO
(
"Writing to file "
<<
m_fileName
);
45
out = &outfile;
46
}
47
else
48
ATH_MSG_ERROR
(
"Failed to open file "
<<
m_fileName
);
49
}
50
51
const
EventContext& ctx = Gaudi::Hive::currentContext();
52
for
(
const
Identifier
&
id
:
m_cellID
->cell_range()) {
53
CaloBadChannel
bc=
m_caloBCT
->caloStatus(ctx,
id
);
54
(*out) <<
"Chan: 0x"
<< std::hex <<
id
.get_compact() <<
": "
<< bc.
packedData
() << std::dec << std::endl;
55
}
56
57
58
if
(outfile.is_open())
59
outfile.close();
60
return
StatusCode::SUCCESS;
61
}
62
StatusCode
DumpCaloBadChannels::execute
(
const
EventContext&
/*ctx*/
) {
63
return
StatusCode::SUCCESS;
64
}
65
66
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
CaloCell_ID.h
DumpCaloBadChannels.h
StoreGateSvc.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
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
CaloBadChannel
Definition
CaloBadChannel.h:8
CaloBadChannel::packedData
BitWord packedData() const
Definition
CaloBadChannel.h:32
DumpCaloBadChannels::initialize
StatusCode initialize()
Definition
DumpCaloBadChannels.cxx:27
DumpCaloBadChannels::DumpCaloBadChannels
DumpCaloBadChannels(const std::string &name, ISvcLocator *pSvcLocator)
Definition
DumpCaloBadChannels.cxx:13
DumpCaloBadChannels::finalize
StatusCode finalize()
Definition
DumpCaloBadChannels.cxx:37
DumpCaloBadChannels::~DumpCaloBadChannels
~DumpCaloBadChannels()
Definition
DumpCaloBadChannels.cxx:24
DumpCaloBadChannels::execute
StatusCode execute(const EventContext &ctx)
Execute method.
Definition
DumpCaloBadChannels.cxx:62
DumpCaloBadChannels::m_fileName
std::string m_fileName
Definition
DumpCaloBadChannels.h:26
DumpCaloBadChannels::m_cellID
const CaloCell_ID * m_cellID
Definition
DumpCaloBadChannels.h:27
DumpCaloBadChannels::m_caloBCT
ToolHandle< ICaloBadChanTool > m_caloBCT
Definition
DumpCaloBadChannels.h:25
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0