ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
AsgAnalysisAlgorithms
RNtupleTreeMakerAlg.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef ASGANALYSISALGORITHMS_RNTUPLETREEMAKERALG_H
5
#define ASGANALYSISALGORITHMS_RNTUPLETREEMAKERALG_H
6
7
#include "
AnaAlgorithm/AnaAlgorithm.h
"
8
#include "
AsgTools/PropertyWrapper.h
"
9
#include "
AsgTools/ToolHandle.h
"
10
#include "
PATInterfaces/SystematicSet.h
"
11
12
// RNTuple include(s):
13
#include <ROOT/RNTupleModel.hxx>
14
#include <ROOT/RNTupleWriter.hxx>
15
#include <TFile.h>
16
17
// Local include(s):
18
#include "
AsgAnalysisAlgorithms/RNtupleFieldHelpers.h
"
19
20
#include <string>
21
#include <vector>
22
#include <memory>
23
#include <unordered_map>
24
25
namespace
CP
{
26
28
class
RNtupleTreeMakerAlg
:
public
EL::AnaAlgorithm
{
29
30
public
:
32
using
EL::AnaAlgorithm::AnaAlgorithm
;
33
35
virtual
StatusCode
initialize
()
override
;
36
38
virtual
StatusCode
execute
(
const
EventContext& ctx)
override
;
39
41
virtual
StatusCode
finalize
()
override
;
42
43
private
:
45
StatusCode
setupTree
();
46
49
50
Gaudi::Property<std::string>
m_modelName
{
51
this
,
"TreeName"
,
"physics"
,
"Name of the RNTuple model/tree"
};
52
53
Gaudi::Property<std::string>
m_outputStreamName
{
54
this
,
"OutputStreamName"
,
"ANALYSIS"
,
"Name of the output stream"
};
55
56
Gaudi::Property<std::vector<std::string>>
m_branches
{
57
this
,
"Branches"
, {},
"List of branches to create (format: Object.Var -> BranchName)"
};
58
59
Gaudi::Property<std::vector<std::string>>
m_nonContainers
{
60
this
,
"NonContainers"
, {},
"List of objects to treat as non-containers"
};
61
63
65
ServiceHandle<ISystematicsSvc>
m_systematicsService
{
66
this
,
"SystematicsSvc"
,
"SystematicsSvc"
,
"Systematics service"
};
67
70
71
std::unique_ptr<ROOT::RNTupleModel>
m_model
;
72
std::unique_ptr<ROOT::RNTupleWriter>
m_writer
;
73
74
CP::RNtupleFieldHelpers::ProcessorList
m_processorList
{
this
};
75
76
bool
m_isInitialized
=
false
;
77
78
#ifndef XAOD_STANDALONE
79
std::unique_ptr<TFile>
m_outputFile
;
80
#endif
81
83
84
};
// class RNtupleTreeMakerAlg
85
86
}
// namespace CP
87
88
#endif
// ASGANALYSISALGORITHMS_RNTUPLETREEMAKERALG_H
AnaAlgorithm.h
PropertyWrapper.h
RNtupleFieldHelpers.h
SystematicSet.h
ToolHandle.h
CP::RNtupleFieldHelpers::ProcessorList
Definition
RNtupleFieldHelpers.h:181
CP::RNtupleTreeMakerAlg
Algorithm that creates an RNTuple (instead of TTree).
Definition
RNtupleTreeMakerAlg.h:28
CP::RNtupleTreeMakerAlg::m_nonContainers
Gaudi::Property< std::vector< std::string > > m_nonContainers
Definition
RNtupleTreeMakerAlg.h:59
CP::RNtupleTreeMakerAlg::m_branches
Gaudi::Property< std::vector< std::string > > m_branches
Definition
RNtupleTreeMakerAlg.h:56
CP::RNtupleTreeMakerAlg::m_outputStreamName
Gaudi::Property< std::string > m_outputStreamName
Definition
RNtupleTreeMakerAlg.h:53
CP::RNtupleTreeMakerAlg::setupTree
StatusCode setupTree()
Function setting up the internal data structures on the first event.
Definition
RNtupleTreeMakerAlg.cxx:88
CP::RNtupleTreeMakerAlg::m_isInitialized
bool m_isInitialized
Definition
RNtupleTreeMakerAlg.h:76
CP::RNtupleTreeMakerAlg::m_modelName
Gaudi::Property< std::string > m_modelName
Definition
RNtupleTreeMakerAlg.h:50
CP::RNtupleTreeMakerAlg::m_processorList
CP::RNtupleFieldHelpers::ProcessorList m_processorList
Definition
RNtupleTreeMakerAlg.h:74
CP::RNtupleTreeMakerAlg::m_writer
std::unique_ptr< ROOT::RNTupleWriter > m_writer
Definition
RNtupleTreeMakerAlg.h:72
CP::RNtupleTreeMakerAlg::initialize
virtual StatusCode initialize() override
Function executed during algorithm initialization.
Definition
RNtupleTreeMakerAlg.cxx:18
CP::RNtupleTreeMakerAlg::m_systematicsService
ServiceHandle< ISystematicsSvc > m_systematicsService
Service handle for systematics.
Definition
RNtupleTreeMakerAlg.h:65
CP::RNtupleTreeMakerAlg::finalize
virtual StatusCode finalize() override
Function executed during algo finalization.
Definition
RNtupleTreeMakerAlg.cxx:77
CP::RNtupleTreeMakerAlg::m_model
std::unique_ptr< ROOT::RNTupleModel > m_model
Definition
RNtupleTreeMakerAlg.h:71
CP::RNtupleTreeMakerAlg::m_outputFile
std::unique_ptr< TFile > m_outputFile
Definition
RNtupleTreeMakerAlg.h:79
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
ServiceHandle
Definition
ClusterMakerTool.h:36
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
Generated on
for ATLAS Offline Software by
1.17.0