ATLAS Offline Software
EventSaverxAODNext.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EVENTSAVERXAODNEXT_H_
6 #define EVENTSAVERXAODNEXT_H_
7 
9 
10 // Framework include(s):
12 
13 class TFile;
14 
15 namespace top {
21  public:
23 
24  virtual ~EventSaverxAODNext();
25 
43  virtual void initialize(std::shared_ptr<top::TopConfig> config, TFile* file,
44  const std::vector<std::string>& extraBranches);
45 
46  //Keep the asg::AsgTool happy
47  virtual StatusCode initialize() {return StatusCode::SUCCESS;}
48 
49 
50  virtual void saveEventToxAOD();
51 
53  virtual void finalize();
54  private:
56  std::shared_ptr<top::TopConfig> m_config;
57 
59  TFile* m_outputFile;
60 
62 
63  // helper typedef
64  typedef std::map<std::size_t, std::map<unsigned int, unsigned int> > ThinningMap_t;
65  typedef ThinningMap_t::const_iterator ThinningMap_Itr;
66 
67  std::shared_ptr<ThinningMap_t> savePhotons(const bool saveEventObjects);
68  std::shared_ptr<ThinningMap_t> saveElectrons(const bool saveEventObjects);
69  std::shared_ptr<ThinningMap_t> saveMuons(const bool saveEventObjects);
70  std::shared_ptr<ThinningMap_t> saveTaus(const bool saveEventObjects);
71  std::shared_ptr<ThinningMap_t> saveJets(const bool saveEventObjects);
72  std::shared_ptr<ThinningMap_t> saveLargeRJets(const bool saveEventObjects);
73  std::shared_ptr<ThinningMap_t> saveTrackJets(const bool saveEventObjects);
74 
75  std::vector<unsigned int> thinObjectSelection(const std::size_t hashValue,
76  const std::vector<unsigned int>& objectList,
77  const std::shared_ptr<ThinningMap_t>& thinningMap) const;
78 
79 
81  };
82 }
83 
84 #endif
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::EventSaverxAODNext::thinObjectSelection
std::vector< unsigned int > thinObjectSelection(const std::size_t hashValue, const std::vector< unsigned int > &objectList, const std::shared_ptr< ThinningMap_t > &thinningMap) const
Definition: EventSaverxAODNext.cxx:244
top::EventSaverxAODNext::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: EventSaverxAODNext.h:47
top::EventSaverxAODNext::m_config
std::shared_ptr< top::TopConfig > m_config
We need access to the configuration file to get the container names.
Definition: EventSaverxAODNext.h:56
EventSaverBase.h
top::EventSaverxAODNext::m_outputFile
TFile * m_outputFile
We need to hold on to the output file.
Definition: EventSaverxAODNext.h:59
top::EventSaverxAODNext::ThinningMap_Itr
ThinningMap_t::const_iterator ThinningMap_Itr
Definition: EventSaverxAODNext.h:65
top::EventSaverxAODNext
Write out the selected events in xAOD format.
Definition: EventSaverxAODNext.h:20
top::EventSaverxAODNext::saveLargeRJets
std::shared_ptr< ThinningMap_t > saveLargeRJets(const bool saveEventObjects)
Definition: EventSaverxAODNext.cxx:545
top::EventSaverxAODNext::finalize
virtual void finalize()
xAOD needs to write some more stuff to the file at the end of a job
Definition: EventSaverxAODNext.cxx:653
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::EventSaverxAODNext::saveEventToxAOD
virtual void saveEventToxAOD()
Definition: EventSaverxAODNext.cxx:148
top::EventSaverxAODNext::saveTrackJets
std::shared_ptr< ThinningMap_t > saveTrackJets(const bool saveEventObjects)
Definition: EventSaverxAODNext.cxx:599
top::EventSaverxAODNext::saveElectrons
std::shared_ptr< ThinningMap_t > saveElectrons(const bool saveEventObjects)
Definition: EventSaverxAODNext.cxx:344
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::EventSaverxAODNext::saveTaus
std::shared_ptr< ThinningMap_t > saveTaus(const bool saveEventObjects)
Definition: EventSaverxAODNext.cxx:443
top::EventSaverxAODNext::ClassDef
ClassDef(top::EventSaverxAODNext, 0)
top::EventSaverxAODNext::EventSaverxAODNext
EventSaverxAODNext()
Definition: EventSaverxAODNext.cxx:29
top::EventSaverxAODNext::saveMuons
std::shared_ptr< ThinningMap_t > saveMuons(const bool saveEventObjects)
Definition: EventSaverxAODNext.cxx:396
top::EventSaverxAODNext::savePhotons
std::shared_ptr< ThinningMap_t > savePhotons(const bool saveEventObjects)
All the saveObject functions work the same way.
Definition: EventSaverxAODNext.cxx:297
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
top::EventSaverxAODNext::ThinningMap_t
std::map< std::size_t, std::map< unsigned int, unsigned int > > ThinningMap_t
Definition: EventSaverxAODNext.h:64
AsgMetadataTool.h
top::EventSaverxAODNext::~EventSaverxAODNext
virtual ~EventSaverxAODNext()
Definition: EventSaverxAODNext.cxx:36
top::EventSaverxAODNext::m_saveAllObjects
bool m_saveAllObjects
Definition: EventSaverxAODNext.h:61
top::EventSaverxAODNext::saveJets
std::shared_ptr< ThinningMap_t > saveJets(const bool saveEventObjects)
Definition: EventSaverxAODNext.cxx:490