ATLAS Offline Software
EventSaverxAOD.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EVENTSAVERXAOD_H_
6 #define EVENTSAVERXAOD_H_
7 
9 
10 // Framework include(s):
11 #include "AsgTools/AsgTool.h"
12 
13 class TFile;
14 
15 namespace top {
21  public:
27 
28  virtual ~EventSaverxAOD();
29 
47  virtual void initialize(std::shared_ptr<top::TopConfig> config, TFile* file,
48  const std::vector<std::string>& extraBranches);
49 
50  //Keep the asg::AsgTool happy
51  virtual StatusCode initialize() {return StatusCode::SUCCESS;}
52 
71  virtual void saveEvent(const top::Event& event);
72 
74  virtual void finalize();
75  private:
77  const std::string m_prefix;
78 
80  std::shared_ptr<top::TopConfig> m_config;
81 
83  TFile* m_outputFile;
84 
86  };
87 }
88 
89 #endif
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::EventSaverxAOD::m_outputFile
TFile * m_outputFile
We need to hold on to the output file.
Definition: EventSaverxAOD.h:83
EventSaverBase.h
top::EventSaverxAOD::EventSaverxAOD
EventSaverxAOD()
Kept simple, set the output container prefix (so they have a different name to the input containers).
Definition: EventSaverxAOD.cxx:20
top::EventSaverxAOD::finalize
virtual void finalize()
xAOD needs to write some more stuff to the file at the end of a job
Definition: EventSaverxAOD.cxx:208
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::EventSaverxAOD
Write out the selected events in xAOD format.
Definition: EventSaverxAOD.h:20
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
top::EventSaverBase
A base class so users can write their own event saving stuff.
Definition: EventSaverBase.h:26
file
TFile * file
Definition: tile_monitor.h:29
top::EventSaverxAOD::saveEvent
virtual void saveEvent(const top::Event &event)
Save an event.
Definition: EventSaverxAOD.cxx:64
top::EventSaverxAOD::m_config
std::shared_ptr< top::TopConfig > m_config
We need access to the configuration file to get the container names.
Definition: EventSaverxAOD.h:80
top::EventSaverxAOD::~EventSaverxAOD
virtual ~EventSaverxAOD()
Definition: EventSaverxAOD.cxx:27
top::EventSaverxAOD::ClassDef
ClassDef(top::EventSaverxAOD, 0)
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::EventSaverxAOD::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: EventSaverxAOD.h:51
AsgTool.h
top::EventSaverxAOD::m_prefix
const std::string m_prefix
Name to prepend to the output containers.
Definition: EventSaverxAOD.h:77