ATLAS Offline Software
EventCountModule.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 
15 #include <EventLoop/ModuleData.h>
16 #include <TH1.h>
17 #include <TList.h>
18 
19 //
20 // method implementations
21 //
22 
23 namespace EL
24 {
25  namespace Detail
26  {
29  {
30  auto eventCount = std::make_unique<TH1D>
31  ("EventLoop_EventCount", "number of events per algorithm",
32  data.m_algs.size()+1, 0, data.m_algs.size()+1);
33  eventCount->SetDirectory (nullptr);
34 
35  for (std::size_t iter = 0; iter != data.m_algs.size(); ++ iter)
36  eventCount->Fill (iter, data.m_algs[iter].m_executeCount);
37 
38  // count the number of events that passed all algorithms without
39  // skipping
40  if (data.m_algs.size() > 0)
41  {
42  eventCount->Fill (data.m_algs.size(), data.m_algs.back().m_executeCount - data.m_algs.back().m_skipCount);
43  } else
44  {
45  eventCount->Fill (data.m_algs.size(), data.m_eventsProcessed);
46  }
47 
48  data.addOutput (std::move (eventCount));
49  return StatusCode::SUCCESS;
50  }
51  }
52 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EventCountModule.h
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition: ModuleData.h:64
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
EL::Detail::EventCountModule::postFinalize
virtual StatusCode postFinalize(ModuleData &data) override
actions after algorithms have been finalized
Definition: EventCountModule.cxx:28
xAOD::DiTauJetParameters::Detail
Detail
Definition: DiTauDefs.h:38
ModuleData.h