ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileRecUtils
src
TileRawChannelDumper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
12
#include "
TileRawChannelDumper.h
"
13
#include "
StoreGate/ReadHandle.h
"
14
#include <fstream>
15
16
22
TileRawChannelDumper::TileRawChannelDumper
(
const
std::string& name, ISvcLocator* svcloc)
23
:
AthReentrantAlgorithm
(name, svcloc)
24
{
25
}
26
27
31
StatusCode
TileRawChannelDumper::initialize
()
32
{
33
ATH_CHECK
(
m_contKey
.initialize() );
34
if
(!
m_altContKey
.key().empty()) {
35
ATH_CHECK
(
m_altContKey
.initialize() );
36
}
37
return
StatusCode::SUCCESS;
38
}
39
40
45
StatusCode
TileRawChannelDumper::execute
(
const
EventContext& ctx)
const
46
{
47
if
(!
m_altContKey
.key().empty()) {
48
SG::ReadHandle<TileRawChannelContainer>
altCont (
m_altContKey
, ctx);
49
*altCont;
50
}
51
52
std::string fname = std::format (
"{}{}_{:08}_{:08}.dump"
,
53
m_prefix
.value().c_str(),
54
m_contKey
.key().c_str(),
55
ctx.eventID().run_number(),
56
ctx.eventID().event_number());
57
std::ofstream
fout
(fname);
58
if
(!
fout
) {
59
ATH_MSG_ERROR
(
"Cannot open dump file: "
<< fname);
60
return
StatusCode::FAILURE;
61
}
62
63
SG::ReadHandle<TileRawChannelContainer>
cont (
m_contKey
, ctx);
64
65
fout
<<
"TileRawChannelContainer/"
<<
m_contKey
.key() <<
" "
66
<<
"run "
<< ctx.eventID().run_number() <<
" "
67
<<
"event "
<< ctx.eventID().event_number() << std::endl;
68
69
fout
<<
"Type: "
<< cont->get_type() <<
" ("
70
<<
TileFragHash::typeToString
(cont->get_type()) <<
") Units: "
71
<< cont->get_unit() <<
" ("
72
<<
TileRawChannelUnit::unitToString
(cont->get_unit())
73
<<
") BSflags: 0x"
<< std::hex << cont->get_bsflags() << std::dec
74
<< std::endl;
75
76
for
(
const
TileRawChannelCollection
* coll : *cont) {
77
fout << static_cast<std::string>
(*coll);
78
fout
<<
"\n"
;
79
}
80
81
fout
.close();
82
83
return
StatusCode::SUCCESS;
84
}
85
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
ReadHandle.h
Handle class for reading from StoreGate.
TileRawChannelDumper.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
TileFragHash::typeToString
static std::string typeToString(TYPE type)
Printable representation of a type.
Definition
TileFragHash.cxx:85
TileRawChannelCollection
Definition
TileRawChannelCollection.h:12
TileRawChannelDumper::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
TileRawChannelDumper.cxx:31
TileRawChannelDumper::m_prefix
Gaudi::Property< std::string > m_prefix
Output file name prefix.
Definition
TileRawChannelDumper.h:67
TileRawChannelDumper::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
TileRawChannelDumper.cxx:45
TileRawChannelDumper::TileRawChannelDumper
TileRawChannelDumper(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition
TileRawChannelDumper.cxx:22
TileRawChannelDumper::m_altContKey
SG::ReadHandleKey< TileRawChannelContainer > m_altContKey
Optional additional input dependency — used when we access the object produced on the side by the con...
Definition
TileRawChannelDumper.h:63
TileRawChannelDumper::m_contKey
SG::ReadHandleKey< TileRawChannelContainer > m_contKey
Handle to access input tile digits.
Definition
TileRawChannelDumper.h:58
TileRawChannelUnit::unitToString
static std::string unitToString(UNIT type)
Printable representation of a unit.
Definition
TileRawChannelUnit.cxx:14
fout
static TFile * fout
Definition
listroot.cxx:40
Generated on
for ATLAS Offline Software by
1.17.0