ATLAS Offline Software
Loading...
Searching...
No Matches
GridReportingModule.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8
9//
10// includes
11//
12
14
16#include <algorithm>
17#include <fstream>
18
19//
20// method implementations
21//
22
23namespace EL
24{
25 namespace Detail
26 {
27 StatusCode GridReportingModule ::
28 onNewInputFile (ModuleData& data)
29 {
30 if (std::find (m_files.begin(), m_files.end(), data.m_inputFileUrl) == m_files.end())
31 m_files.push_back (data.m_inputFileUrl);
32 return StatusCode::SUCCESS;
33 }
34
35
36
37 StatusCode GridReportingModule ::
38 onExecute (ModuleData& /*data*/)
39 {
41 return StatusCode::SUCCESS;
42 }
43
44
45
46 StatusCode GridReportingModule ::
47 postFileClose (ModuleData& /*data*/)
48 {
49 // createJobSummary
50 std::ofstream summaryfile("../AthSummary.txt");
51 if (summaryfile.is_open()) {
52 unsigned int nFiles = m_files.size();
53 summaryfile << "Files read: " << nFiles << std::endl;
54 for (auto& file : m_files)
55 summaryfile << " " << file << std::endl;
56 summaryfile << "Events Read: " << m_eventsProcessed << std::endl;
57 summaryfile.close();
58 }
59 else {
60 ANA_MSG_WARNING ("Failed to write summary file.");
61 }
62 return StatusCode::SUCCESS;
63 }
64
65
66
67 void GridReportingModule ::
68 reportInputFailure (ModuleData& /*data*/)
69 {
70 ANA_MSG_FATAL ("encountered input error");
71 exit (EC_BADINPUT);
72 }
73 }
74}
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
#define ANA_MSG_FATAL(xmsg)
Macro printing fatal messages.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::vector< std::string > m_files
the list of files we processed
static constexpr int EC_BADINPUT
the panda error code for bad input files
unsigned m_eventsProcessed
the number of events we processed
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
the data the EventLoop core classes are sharing with the Module implementation
Definition ModuleData.h:64
TFile * file