Project
Loading...
Searching...
No Matches
AODInputFile.h
Go to the documentation of this file.
1// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FRAMEWORK_AODINPUTFILE_H_
13#define O2_FRAMEWORK_AODINPUTFILE_H_
14
17#include <cstdint>
18#include <map>
19#include <memory>
20#include <string>
21#include <vector>
22
23class TFile;
24
25namespace o2::framework
26{
27
32 struct Key {
33 std::string name;
34 std::string className;
35 };
36
37 virtual ~AODInputFile() = default;
38 virtual std::string name() const = 0;
39 virtual uint64_t size() const = 0;
40 virtual uint64_t bytesRead() const = 0;
41 virtual uint64_t readCalls() const = 0;
43 virtual std::vector<Key> topLevelKeys() = 0;
45 virtual std::vector<std::string> keysIn(std::string const& dir) = 0;
47 virtual std::map<std::string, std::string> parentFiles() = 0;
48 virtual std::map<std::string, std::string> metaData() = 0;
49 virtual std::shared_ptr<VirtualRootFileSystemBase> filesystem() = 0;
51 virtual std::string monitoringDetails() const { return ""; }
53 virtual void setReadOrder(std::vector<std::string> const& dfs) {}
54};
55
59 std::string url;
60 std::string se;
61};
62
66std::vector<GridReplica> gridReplicas(std::string const& lfn);
67
71std::shared_ptr<AODInputFile> openNativeAOD(std::string const& filename, RootObjectReadingFactory& factory, o2::aod::native::Options const& options);
72
75{
76 public:
79 static std::shared_ptr<RootAODInputFile> open(std::string const& name, RootObjectReadingFactory& factory, TFile* external = nullptr);
80
81 std::string name() const override;
82 uint64_t size() const override;
83 uint64_t bytesRead() const override;
84 uint64_t readCalls() const override;
85 std::vector<Key> topLevelKeys() override;
86 std::vector<std::string> keysIn(std::string const& dir) override;
87 std::map<std::string, std::string> parentFiles() override;
88 std::map<std::string, std::string> metaData() override;
89 std::shared_ptr<VirtualRootFileSystemBase> filesystem() override { return mFilesystem; }
90 std::string monitoringDetails() const override;
91
92 private:
93 RootAODInputFile(TFile* file, std::shared_ptr<TFileFileSystem> filesystem);
94 std::map<std::string, std::string> readStringMap(char const* key);
95
96 TFile* mFile;
97 std::shared_ptr<TFileFileSystem> mFilesystem;
98};
99
100} // namespace o2::framework
101
102#endif // O2_FRAMEWORK_AODINPUTFILE_H_
StringRef key
An AO2D read with ROOT.
uint64_t size() const override
std::shared_ptr< VirtualRootFileSystemBase > filesystem() override
std::map< std::string, std::string > metaData() override
std::string monitoringDetails() const override
Extra key=value pairs for the file monitoring metrics, starting with a comma.
std::map< std::string, std::string > parentFiles() override
DF_<n> to parent file path. Empty if the file has no parentFiles.
std::string name() const override
uint64_t readCalls() const override
uint64_t bytesRead() const override
std::vector< std::string > keysIn(std::string const &dir) override
Names of the keys inside the top-level directory dir, empty if there is none.
static std::shared_ptr< RootAODInputFile > open(std::string const &name, RootObjectReadingFactory &factory, TFile *external=nullptr)
std::vector< Key > topLevelKeys() override
Top-level keys, in the order the file lists them, all cycles.
GLuint const GLchar * name
Definition glcorearb.h:781
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::shared_ptr< AODInputFile > openNativeAOD(std::string const &filename, RootObjectReadingFactory &factory, o2::aod::native::Options const &options)
std::vector< GridReplica > gridReplicas(std::string const &lfn)
std::string filename()
virtual std::map< std::string, std::string > parentFiles()=0
DF_<n> to parent file path. Empty if the file has no parentFiles.
virtual std::string name() const =0
virtual uint64_t readCalls() const =0
virtual void setReadOrder(std::vector< std::string > const &dfs)
The DF_<n> names in the order they will be read, for readers which read ahead.
virtual std::map< std::string, std::string > metaData()=0
virtual std::vector< std::string > keysIn(std::string const &dir)=0
Names of the keys inside the top-level directory dir, empty if there is none.
virtual std::vector< Key > topLevelKeys()=0
Top-level keys, in the order the file lists them, all cycles.
virtual uint64_t bytesRead() const =0
virtual uint64_t size() const =0
virtual std::shared_ptr< VirtualRootFileSystemBase > filesystem()=0
virtual std::string monitoringDetails() const
Extra key=value pairs for the file monitoring metrics, starting with a comma.
virtual ~AODInputFile()=default