ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
10// RNTuple include(s):
11#include <ROOT/RNTupleModel.hxx>
12#include <ROOT/RNTupleWriter.hxx>
13#include <TFile.h>
14
15// Local include(s):
17
18#include <string>
19#include <vector>
20#include <memory>
21
22namespace CP {
23
26
27 public:
30
32 virtual StatusCode initialize() override;
33
35 virtual StatusCode execute(const EventContext& ctx) override;
36
38 virtual StatusCode finalize() override;
39
40 private:
42 StatusCode setupTree();
43
46
47 Gaudi::Property<std::string> m_modelName {
48 this, "TreeName", "physics", "Name of the RNTuple model/tree"};
49
50 Gaudi::Property<std::string> m_outputStreamName {
51 this, "OutputStreamName", "ANALYSIS", "Name of the output stream"};
52
53 Gaudi::Property<std::vector<std::string>> m_branches {
54 this, "Branches", {}, "List of branches to create (format: Object.Var -> BranchName)"};
55
56 Gaudi::Property<std::vector<std::string>> m_nonContainers {
57 this, "NonContainers", {}, "List of objects to treat as non-containers"};
58
59 Gaudi::Property<std::size_t> m_approxZippedClusterSize {
60 this, "ApproxZippedClusterSize", 0,
61 "Target compressed cluster size in bytes (0 = ROOT default)"};
62
63 Gaudi::Property<std::size_t> m_maxUnzippedClusterSize {
64 this, "MaxUnzippedClusterSize", 0,
65 "Maximum uncompressed cluster size in bytes, bounds the write buffer memory (0 = ROOT default)"};
66
68
71 this, "SystematicsSvc", "SystematicsSvc", "Systematics service"};
72
75
76 std::unique_ptr<ROOT::RNTupleModel> m_model;
77 std::unique_ptr<ROOT::RNTupleWriter> m_writer;
78
80
81 bool m_isInitialized = false;
82
84
85 }; // class RNtupleTreeMakerAlg
86
87} // namespace CP
88
89#endif // ASGANALYSISALGORITHMS_RNTUPLETREEMAKERALG_H
Algorithm that creates an RNTuple (instead of TTree).
Gaudi::Property< std::vector< std::string > > m_nonContainers
Gaudi::Property< std::vector< std::string > > m_branches
Gaudi::Property< std::string > m_outputStreamName
StatusCode setupTree()
Function setting up the internal data structures on the first event.
Gaudi::Property< std::string > m_modelName
CP::RNtupleFieldHelpers::ProcessorList m_processorList
std::unique_ptr< ROOT::RNTupleWriter > m_writer
virtual StatusCode initialize() override
Function executed during algorithm initialization.
ServiceHandle< ISystematicsSvc > m_systematicsService
Service handle for systematics.
Gaudi::Property< std::size_t > m_maxUnzippedClusterSize
virtual StatusCode finalize() override
Function executed during algo finalization.
std::unique_ptr< ROOT::RNTupleModel > m_model
Gaudi::Property< std::size_t > m_approxZippedClusterSize
the (new) base class for EventLoop algorithms
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
virtual::StatusCode execute()
execute this algorithm
Select isolated Photons, Electrons and Muons.