ATLAS Offline Software
Public Member Functions | List of all members
top::EventSaverBase Class Referenceabstract

A base class so users can write their own event saving stuff. More...

#include <EventSaverBase.h>

Inheritance diagram for top::EventSaverBase:
Collaboration diagram for top::EventSaverBase:

Public Member Functions

 EventSaverBase ()
 Default ctor/dtor - ROOT wants to use these, don't use fancy ctors. More...
 
virtual ~EventSaverBase ()
 
virtual void initialize (std::shared_ptr< top::TopConfig > config, TFile *file, const std::vector< std::string > &extraBranches)=0
 Called once at the start of the job after the file has been opened. More...
 
virtual void execute ()
 Method to execute any calculations common for reco/particle/parton level. More...
 
virtual void saveEvent (const top::Event &)
 I guess you want to save an event sometimes to. More...
 
virtual void saveEventToxAOD ()
 
virtual void saveTruthEvent ()
 @breif Run for every event More...
 
virtual void saveParticleLevelEvent (const top::ParticleLevelEvent &)
 Function to save the particle level event. More...
 
virtual void saveUpgradeEvent (const top::ParticleLevelEvent &)
 Function to save the upgrade event. More...
 
virtual void finalize ()
 So you can write something at the end of the job (like metadata). More...
 
 ClassDef (top::EventSaverBase, 0)
 

Detailed Description

A base class so users can write their own event saving stuff.

Some people, for some reason, prefer flat ntuples to xAODs.

Definition at line 26 of file EventSaverBase.h.

Constructor & Destructor Documentation

◆ EventSaverBase()

top::EventSaverBase::EventSaverBase ( )
inline

Default ctor/dtor - ROOT wants to use these, don't use fancy ctors.

Definition at line 31 of file EventSaverBase.h.

31 {}

◆ ~EventSaverBase()

virtual top::EventSaverBase::~EventSaverBase ( )
inlinevirtual

Definition at line 32 of file EventSaverBase.h.

32 {}

Member Function Documentation

◆ ClassDef()

top::EventSaverBase::ClassDef ( top::EventSaverBase  ,
 
)

◆ execute()

virtual void top::EventSaverBase::execute ( )
inlinevirtual

Method to execute any calculations common for reco/particle/parton level.

Reimplemented in top::EventSaverFlatNtuple.

Definition at line 48 of file EventSaverBase.h.

48 {return;}

◆ finalize()

virtual void top::EventSaverBase::finalize ( )
inlinevirtual

So you can write something at the end of the job (like metadata).

Reimplemented in top::EventSaverFlatNtuple, top::EventSaverxAOD, and top::EventSaverxAODNext.

Definition at line 99 of file EventSaverBase.h.

99 {return;}

◆ initialize()

virtual void top::EventSaverBase::initialize ( std::shared_ptr< top::TopConfig config,
TFile *  file,
const std::vector< std::string > &  extraBranches 
)
pure virtual

Called once at the start of the job after the file has been opened.

Parameters
configYou may need stuff from the configuration.
fileYou probably need the file if you're going to write to it.
extraBranchesSo you can write extra branches (only for xAOD).

Implemented in top::EventSaverFlatNtuple, top::EventSaverxAOD, and top::EventSaverxAODNext.

◆ saveEvent()

virtual void top::EventSaverBase::saveEvent ( const top::Event )
inlinevirtual

I guess you want to save an event sometimes to.

There are multiple ways you might want to do this All methods below are implemented with a simple return This means that you do not need to implement them in your derived class

Parameters
eventThe event in question, in the format used internally.

Reimplemented in top::EventSaverFlatNtuple, and top::EventSaverxAOD.

Definition at line 59 of file EventSaverBase.h.

59 {return;}

◆ saveEventToxAOD()

virtual void top::EventSaverBase::saveEventToxAOD ( )
inlinevirtual

Reimplemented in top::EventSaverxAODNext.

Definition at line 60 of file EventSaverBase.h.

60 {return;}

◆ saveParticleLevelEvent()

virtual void top::EventSaverBase::saveParticleLevelEvent ( const top::ParticleLevelEvent )
inlinevirtual

Function to save the particle level event.

This function has a default implementation that does ... nothing! This is deliberate since doing so does not force developers of custom EventSaver tools to implement particle level saving.

Parameters
plEventThe particle level event whose contents will be saved.

Reimplemented in top::EventSaverFlatNtuple.

Definition at line 79 of file EventSaverBase.h.

79  {
80  /* Deliberately No-Op */
81  return;
82  }

◆ saveTruthEvent()

virtual void top::EventSaverBase::saveTruthEvent ( )
inlinevirtual

@breif Run for every event

This fills, if requested, the: MC truth record PDF info TopPartons

Reimplemented in top::EventSaverFlatNtuple.

Definition at line 70 of file EventSaverBase.h.

70 {return;}

◆ saveUpgradeEvent()

virtual void top::EventSaverBase::saveUpgradeEvent ( const top::ParticleLevelEvent )
inlinevirtual

Function to save the upgrade event.

This function has a default implementation that does ... nothing! This is deliberate since doing so does not force developers of custom EventSaver tools to implement upgrade saving.

Parameters
upgradeEventThe upgrade event whose contents will be saved.

Definition at line 91 of file EventSaverBase.h.

91  {
92  /* Deliberately No-Op */
93  return;
94  }

The documentation for this class was generated from the following file: