ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileRecUtils
src
TileL2Dumper.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 "
TileL2Dumper.h
"
13
#include "
StoreGate/ReadHandle.h
"
14
#include <fstream>
15
16
22
TileL2Dumper::TileL2Dumper
(
const
std::string& name, ISvcLocator* svcloc)
23
:
AthReentrantAlgorithm
(name, svcloc)
24
{
25
}
26
27
31
StatusCode
TileL2Dumper::initialize
()
32
{
33
ATH_CHECK
(
m_contKey
.initialize() );
34
return
StatusCode::SUCCESS;
35
}
36
37
42
StatusCode
TileL2Dumper::execute
(
const
EventContext& ctx)
const
43
{
44
std::string fname = std::format (
"{}{}_{:08}_{:08}.dump"
,
45
m_prefix
.value().c_str(),
46
m_contKey
.key().c_str(),
47
ctx.eventID().run_number(),
48
ctx.eventID().event_number());
49
std::ofstream
fout
(fname);
50
if
(!
fout
) {
51
ATH_MSG_ERROR
(
"Cannot open dump file: "
<< fname);
52
return
StatusCode::FAILURE;
53
}
54
55
SG::ReadHandle<TileL2Container>
cont (
m_contKey
, ctx);
56
57
fout
<<
"TileL2Container/"
<<
m_contKey
.key() <<
" "
58
<<
"run "
<< ctx.eventID().run_number() <<
" "
59
<<
"event "
<< ctx.eventID().event_number() << std::endl;
60
61
fout << static_cast<std::string>
(*cont) <<
"\n"
;
62
63
fout
.close();
64
65
return
StatusCode::SUCCESS;
66
}
67
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.
TileL2Dumper.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
TileL2Dumper::TileL2Dumper
TileL2Dumper(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition
TileL2Dumper.cxx:22
TileL2Dumper::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
TileL2Dumper.cxx:42
TileL2Dumper::m_prefix
Gaudi::Property< std::string > m_prefix
Output file name prefix.
Definition
TileL2Dumper.h:62
TileL2Dumper::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
TileL2Dumper.cxx:31
TileL2Dumper::m_contKey
SG::ReadHandleKey< TileL2Container > m_contKey
Handle to access input tile digits.
Definition
TileL2Dumper.h:58
fout
static TFile * fout
Definition
listroot.cxx:40
Generated on
for ATLAS Offline Software by
1.17.0