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
11
12// RNTuple include(s):
13#include <ROOT/RNTupleModel.hxx>
14#include <ROOT/RNTupleWriter.hxx>
15#include <TFile.h>
16
17// Local include(s):
19
20#include <string>
21#include <vector>
22#include <memory>
23#include <unordered_map>
24
25namespace CP {
26
29
30 public:
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
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
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
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.
virtual StatusCode finalize() override
Function executed during algo finalization.
std::unique_ptr< ROOT::RNTupleModel > m_model
std::unique_ptr< TFile > m_outputFile
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.