ATLAS Offline Software
Loading...
Searching...
No Matches
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"
14#include <fstream>
15
16
22TileL2Dumper::TileL2Dumper (const std::string& name, ISvcLocator* svcloc)
23 : AthReentrantAlgorithm (name, svcloc)
24{
25}
26
27
32{
33 ATH_CHECK( m_contKey.initialize() );
34 return StatusCode::SUCCESS;
35}
36
37
42StatusCode 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
56
57 fout << "TileL2Container/" << m_contKey.key() << " "
58 << "run " << ctx.eventID().run_number() << " "
59 << "event " << ctx.eventID().event_number() << std::endl;
60
62
63 fout.close();
64
65 return StatusCode::SUCCESS;
66}
67
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
Handle class for reading from StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
TileL2Dumper(const std::string &name, ISvcLocator *svcloc)
Constructor.
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Gaudi::Property< std::string > m_prefix
Output file name prefix.
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
SG::ReadHandleKey< TileL2Container > m_contKey
Handle to access input tile digits.
static TFile * fout
Definition listroot.cxx:40