ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
StandaloneAnalysisAlgorithms
StandaloneAnalysisAlgorithms
xAODWriterAlg.h
Go to the documentation of this file.
1
// Dear emacs, this is -*- c++ -*-
2
//
3
// Copyright (C) 2002-2026 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):
14
#include "
AnaAlgorithm/AnaAlgorithm.h
"
15
#include "
SystematicsHandles/SysListHandle.h
"
16
#include "
xAODRootAccess/Event.h
"
17
#include "
xAODRootAccess/TEvent.h
"
18
#include <
AsgTools/PropertyWrapper.h
>
19
20
namespace
CP
{
21
30
class
xAODWriterAlg
final :
public
EL::AnaAlgorithm
{
31
32
public
:
34
using
EL::AnaAlgorithm::AnaAlgorithm
;
35
38
40
StatusCode
initialize
()
override
;
41
43
StatusCode
execute
(
const
EventContext& ctx)
override
;
44
46
StatusCode
finalize
()
override
;
47
49
50
private
:
52
StatusCode
setup
();
53
56
58
Gaudi::Property<std::string>
m_outputStreamName
{
this
,
"OutputStreamName"
,
"ANALYSIS"
,
"Stream name of the output file to use"
};
60
Gaudi::Property<std::vector<std::string>>
m_itemList
{
this
,
"ItemList"
, {},
"Objects to write to the output file"
};
62
Gaudi::Property<int>
m_basketSize
{
this
,
"BasketSize"
, 32000,
"(Starter) Basket size for the created branches"
};
64
Gaudi::Property<int>
m_splitLevel
{
this
,
"SplitLevel"
, 0,
"Split level for the created branches"
};
65
67
69
struct
Item
{
71
std::string
name
;
73
const
std::type_info*
type
;
75
std::string
typeName
;
76
};
// struct Item
77
79
std::unique_ptr<xAOD::TEvent>
m_event
;
80
82
bool
m_itemListInitialized
=
false
;
84
std::vector< Item >
m_writtenItemList
;
85
87
SysListHandle
m_systematicsList
{
this
};
88
89
};
// class xAODWriterAlg
90
91
}
// namespace CP
92
93
#endif
// STANDALONEANALYSISALGORITHMS_XAODWRITERALG_H
AnaAlgorithm.h
TEvent.h
Event.h
PropertyWrapper.h
SysListHandle.h
CP::SysListHandle
a class managing the property to configure the list of systematics to process
Definition
SysListHandle.h:33
CP::xAODWriterAlg
Algorithm writing an xAOD output file.
Definition
xAODWriterAlg.h:30
CP::xAODWriterAlg::m_basketSize
Gaudi::Property< int > m_basketSize
(Starter) Basket size for the created branches
Definition
xAODWriterAlg.h:62
CP::xAODWriterAlg::m_splitLevel
Gaudi::Property< int > m_splitLevel
Split level for the created branches.
Definition
xAODWriterAlg.h:64
CP::xAODWriterAlg::m_itemListInitialized
bool m_itemListInitialized
Internal flag.
Definition
xAODWriterAlg.h:82
CP::xAODWriterAlg::setup
StatusCode setup()
Function setting up the algorithm while processing the first event.
Definition
xAODWriterAlg.cxx:122
CP::xAODWriterAlg::m_event
std::unique_ptr< xAOD::TEvent > m_event
Object to write the output file with.
Definition
xAODWriterAlg.h:79
CP::xAODWriterAlg::finalize
StatusCode finalize() override
Function finalising the algorithm.
Definition
xAODWriterAlg.cxx:105
CP::xAODWriterAlg::m_writtenItemList
std::vector< Item > m_writtenItemList
Item list being written after the first event.
Definition
xAODWriterAlg.h:84
CP::xAODWriterAlg::m_itemList
Gaudi::Property< std::vector< std::string > > m_itemList
Item list to write to the output file.
Definition
xAODWriterAlg.h:60
CP::xAODWriterAlg::m_systematicsList
SysListHandle m_systematicsList
The systematic list to consider during execution.
Definition
xAODWriterAlg.h:87
CP::xAODWriterAlg::m_outputStreamName
Gaudi::Property< std::string > m_outputStreamName
Name of the output stream to write to.
Definition
xAODWriterAlg.h:58
CP::xAODWriterAlg::initialize
StatusCode initialize() override
Function initialising the algorithm.
Definition
xAODWriterAlg.cxx:23
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition
AnaAlgorithm.h:74
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition
AnaAlgorithm.cxx:40
EL::AnaAlgorithm::execute
virtual::StatusCode execute()
execute this algorithm
Definition
AnaAlgorithm.cxx:315
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::xAODWriterAlg::Item
Helper struct.
Definition
xAODWriterAlg.h:69
CP::xAODWriterAlg::Item::name
std::string name
Name of the written object.
Definition
xAODWriterAlg.h:71
CP::xAODWriterAlg::Item::type
const std::type_info * type
Type of the written object.
Definition
xAODWriterAlg.h:73
CP::xAODWriterAlg::Item::typeName
std::string typeName
Type name of the written object.
Definition
xAODWriterAlg.h:75
Generated on
for ATLAS Offline Software by
1.17.0