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