ATLAS Offline Software
EventSaverBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EVENTSAVERBASE_H_
6 #define EVENTSAVERBASE_H_
7 
8 #include <vector>
9 #include <string>
10 #include <memory>
11 
12 #include <TClass.h>
13 
14 class TFile;
15 
16 namespace top {
17  class Event;
18  class TreeManager;
19  class TopConfig;
20  class ParticleLevelEvent;
21 
27  public:
32  virtual ~EventSaverBase() {}
33 
41  virtual void initialize(std::shared_ptr<top::TopConfig> config, TFile* file,
42  const std::vector<std::string>& extraBranches) = 0;
43 
48  virtual void execute() {return;}
49 
59  virtual void saveEvent(const top::Event& /*event*/) {return;}
60  virtual void saveEventToxAOD() {return;}
61 
70  virtual void saveTruthEvent() {return;}
71 
79  virtual void saveParticleLevelEvent(const top::ParticleLevelEvent& /* plEvent */) {
80  /* Deliberately No-Op */
81  return;
82  }
83 
91  virtual void saveUpgradeEvent(const top::ParticleLevelEvent& /* plEvent */) {
92  /* Deliberately No-Op */
93  return;
94  }
95 
99  virtual void finalize() {return;}
100 
102  };
103 }
104 
105 #endif
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
Event
Definition: trigbs_orderedMerge.cxx:42
top::EventSaverBase::saveUpgradeEvent
virtual void saveUpgradeEvent(const top::ParticleLevelEvent &)
Function to save the upgrade event.
Definition: EventSaverBase.h:91
top::EventSaverBase::ClassDef
ClassDef(top::EventSaverBase, 0)
top::EventSaverBase::saveEvent
virtual void saveEvent(const top::Event &)
I guess you want to save an event sometimes to.
Definition: EventSaverBase.h:59
top::EventSaverBase::~EventSaverBase
virtual ~EventSaverBase()
Definition: EventSaverBase.h:32
top::EventSaverBase::saveTruthEvent
virtual void saveTruthEvent()
@breif Run for every event
Definition: EventSaverBase.h:70
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::EventSaverBase::initialize
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.
top::EventSaverBase::saveEventToxAOD
virtual void saveEventToxAOD()
Definition: EventSaverBase.h:60
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::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
top::EventSaverBase::EventSaverBase
EventSaverBase()
Default ctor/dtor - ROOT wants to use these, don't use fancy ctors.
Definition: EventSaverBase.h:31
top::EventSaverBase::finalize
virtual void finalize()
So you can write something at the end of the job (like metadata).
Definition: EventSaverBase.h:99
top::EventSaverBase::execute
virtual void execute()
Method to execute any calculations common for reco/particle/parton level.
Definition: EventSaverBase.h:48
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::EventSaverBase::saveParticleLevelEvent
virtual void saveParticleLevelEvent(const top::ParticleLevelEvent &)
Function to save the particle level event.
Definition: EventSaverBase.h:79