ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
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
13
#include <
EventLoop/GridReportingModule.h
>
14
15
#include <
EventLoop/ModuleData.h
>
16
#include <algorithm>
17
#include <fstream>
18
19
//
20
// method implementations
21
//
22
23
namespace
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
{
40
++
m_eventsProcessed
;
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
}
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
ANA_MSG_FATAL
#define ANA_MSG_FATAL(xmsg)
Macro printing fatal messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:296
GridReportingModule.h
ModuleData.h
EL::Detail::GridReportingModule::m_files
std::vector< std::string > m_files
the list of files we processed
Definition
GridReportingModule.h:28
EL::Detail::GridReportingModule::EC_BADINPUT
static constexpr int EC_BADINPUT
the panda error code for bad input files
Definition
GridReportingModule.h:25
EL::Detail::GridReportingModule::m_eventsProcessed
unsigned m_eventsProcessed
the number of events we processed
Definition
GridReportingModule.h:31
EL::Detail
Definition
AsgComponentFactories.h:20
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition
ModuleData.h:65
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0