ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileRecUtils
src
TileMuonReceiverDumper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*
5
*/
12
13
14
#include "
TileMuonReceiverDumper.h
"
15
#include "
StoreGate/ReadHandle.h
"
16
#include "
CxxUtils/StrFormat.h
"
17
#include <fstream>
18
19
25
TileMuonReceiverDumper::TileMuonReceiverDumper
(
const
std::string& name,
26
ISvcLocator* svcloc)
27
:
AthReentrantAlgorithm
(name, svcloc)
28
{
29
}
30
31
35
StatusCode
TileMuonReceiverDumper::initialize
()
36
{
37
ATH_CHECK
(
m_contKey
.initialize() );
38
return
StatusCode::SUCCESS;
39
}
40
41
46
StatusCode
TileMuonReceiverDumper::execute
(
const
EventContext& ctx)
const
47
{
48
std::string fname =
CxxUtils::strformat
(
"%s%s_%08u_%08lu.dump"
,
49
m_prefix
.value().c_str(),
50
m_contKey
.key().c_str(),
51
ctx.eventID().run_number(),
52
ctx.eventID().event_number());
53
std::ofstream
fout
(fname);
54
if
(!
fout
) {
55
ATH_MSG_ERROR
(
"Cannot open dump file: "
<< fname);
56
return
StatusCode::FAILURE;
57
}
58
59
SG::ReadHandle<TileMuonReceiverContainer>
cont (
m_contKey
, ctx);
60
61
fout
<<
"TileMuonReceiverContainer/"
<<
m_contKey
.key() <<
" "
62
<<
"run "
<< ctx.eventID().run_number() <<
" "
63
<<
"event "
<< ctx.eventID().event_number() << std::endl;
64
65
fout << static_cast<std::string>
(*cont) <<
"\n"
;
66
67
fout
.close();
68
69
return
StatusCode::SUCCESS;
70
}
71
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:33
ReadHandle.h
Handle class for reading from StoreGate.
StrFormat.h
Provide helper functions to create formatted strings.
TileMuonReceiverDumper.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
TileMuonReceiverDumper::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
TileMuonReceiverDumper.cxx:46
TileMuonReceiverDumper::m_contKey
SG::ReadHandleKey< TileMuonReceiverContainer > m_contKey
Handle to access input tile digits.
Definition
TileMuonReceiverDumper.h:58
TileMuonReceiverDumper::m_prefix
Gaudi::Property< std::string > m_prefix
Output file name prefix.
Definition
TileMuonReceiverDumper.h:62
TileMuonReceiverDumper::TileMuonReceiverDumper
TileMuonReceiverDumper(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition
TileMuonReceiverDumper.cxx:25
TileMuonReceiverDumper::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
TileMuonReceiverDumper.cxx:35
fout
static TFile * fout
Definition
listroot.cxx:40
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition
StrFormat.cxx:49
Generated on
for ATLAS Offline Software by
1.17.0