ATLAS Offline Software
xAODWriterAlg.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 //
3 // Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 //
5 #ifndef STANDALONEANALYSISALGORITHMS_XAODWRITERALG_H
6 #define STANDALONEANALYSISALGORITHMS_XAODWRITERALG_H
7 
8 // System include(s):
9 #include <string>
10 #include <vector>
11 #include <typeinfo>
12 
13 // Core include(s):
16 #include "xAODRootAccess/TEvent.h"
18 
19 namespace CP {
20 
29  class xAODWriterAlg final : public EL::AnaAlgorithm {
30 
31  public:
34 
37 
39  StatusCode initialize() override;
40 
42  StatusCode execute() override;
43 
45  StatusCode finalize() override;
46 
48 
49  private:
51  StatusCode setup();
52 
55 
57  Gaudi::Property<std::string> m_outputStreamName {this, "OutputStreamName", "ANALYSIS", "Stream name of the output file to use"};
59  Gaudi::Property<std::vector<std::string>> m_itemList {this, "ItemList", {}, "Objects to write to the output file"};
61  Gaudi::Property<int> m_basketSize {this, "BasketSize", 32000, "(Starter) Basket size for the created branches"};
63  Gaudi::Property<int> m_splitLevel {this, "SplitLevel", 0, "Split level for the created branches"};
64 
66 
68  struct Item {
70  std::string name;
72  const std::type_info* type;
74  std::string typeName;
75  }; // struct Item
76 
79 
81  bool m_itemListInitialized = false;
83  std::vector< Item > m_writtenItemList;
84 
87 
88  }; // class xAODWriterAlg
89 
90 } // namespace CP
91 
92 #endif // STANDALONEANALYSISALGORITHMS_XAODWRITERALG_H
CP::xAODWriterAlg::setup
StatusCode setup()
Function setting up the algorithm while processing the first event.
Definition: xAODWriterAlg.cxx:113
CP::xAODWriterAlg::initialize
StatusCode initialize() override
Function initialising the algorithm.
Definition: xAODWriterAlg.cxx:21
PropertyWrapper.h
CP::SysListHandle
a class managing the property to configure the list of systematics to process
Definition: SysListHandle.h:33
CP::xAODWriterAlg::m_writtenItemList
std::vector< Item > m_writtenItemList
Item list being written after the first event.
Definition: xAODWriterAlg.h:83
CP::xAODWriterAlg::m_basketSize
Gaudi::Property< int > m_basketSize
(Starter) Basket size for the created branches
Definition: xAODWriterAlg.h:61
SysListHandle.h
CP::xAODWriterAlg::Item::typeName
std::string typeName
Type name of the written object.
Definition: xAODWriterAlg.h:74
CP::xAODWriterAlg::m_itemListInitialized
bool m_itemListInitialized
Internal flag.
Definition: xAODWriterAlg.h:81
CP::xAODWriterAlg::m_event
xAOD::TEvent m_event
Object to write the output file with.
Definition: xAODWriterAlg.h:78
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition: AnaAlgorithm.cxx:40
CP::xAODWriterAlg::Item::type
const std::type_info * type
Type of the written object.
Definition: xAODWriterAlg.h:72
AnaAlgorithm.h
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition: AnaAlgorithm.h:73
CP::xAODWriterAlg::m_splitLevel
Gaudi::Property< int > m_splitLevel
Split level for the created branches.
Definition: xAODWriterAlg.h:63
CP::xAODWriterAlg::Item
Helper struct.
Definition: xAODWriterAlg.h:68
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TEvent.h
CP::xAODWriterAlg::Item::name
std::string name
Name of the written object.
Definition: xAODWriterAlg.h:70
CP::xAODWriterAlg
Algorithm writing an xAOD output file.
Definition: xAODWriterAlg.h:29
CP::xAODWriterAlg::m_outputStreamName
Gaudi::Property< std::string > m_outputStreamName
Name of the output stream to write to.
Definition: xAODWriterAlg.h:57
CP::xAODWriterAlg::m_systematicsList
SysListHandle m_systematicsList
The systematic list to consider during execution.
Definition: xAODWriterAlg.h:86
CP::xAODWriterAlg::execute
StatusCode execute() override
Function executing the algorithm.
Definition: xAODWriterAlg.cxx:48
CP::xAODWriterAlg::m_itemList
Gaudi::Property< std::vector< std::string > > m_itemList
Item list to write to the output file.
Definition: xAODWriterAlg.h:59
CP::xAODWriterAlg::finalize
StatusCode finalize() override
Function finalising the algorithm.
Definition: xAODWriterAlg.cxx:96
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:84