5#ifndef XAODDATASOURCE_RDATASOURCE_H
6#define XAODDATASOURCE_RDATASOURCE_H
15#include <ROOT/RDataSource.hxx>
16#include <ROOT/RStringView.hxx>
22#include <unordered_map>
40 std::string_view treeName =
"CollectionTree" );
42 RDataSource(
const std::vector< std::string >& fileNames,
43 std::string_view treeName =
"CollectionTree" );
54 virtual void SetNSlots(
unsigned int slots )
override final;
59 InitSlot(
unsigned int slot, ULong64_t firstEntry ) override final;
62 virtual
void FinalizeSlot(
unsigned int slot ) override final;
64 virtual
void Finalize() override final;
79 SetEntry(
unsigned int slot, ULong64_t entry ) override final;
97 const std::type_info& typeInfo ) override final;
Extension to xAOD::TEvent, used by xAOD::RDataSource.
std::vector< std::string > m_fileNames
Files to read.
RDataSource(std::string_view fileNameGlob, std::string_view treeName="CollectionTree")
Constructor with the file name pattern.
std::vector< std::pair< ULong64_t, ULong64_t > > EntryRanges_t
Type describing the entry ranges of the input file(s)
TEvent::EAuxMode m_auxmode
Auxiliary access mode.
~RDataSource()
Destructor.
void readInputMetadata()
Fill the metadata variables.
Bool_t m_verboseOutput
Whether verbose output should be printed or not.
virtual void InitSlot(unsigned int slot, ULong64_t firstEntry) override final
Initialize one of the slots/threads.
void setVerboseOutput(Bool_t value=kTRUE)
Set whether verbose output should be printed (for debugging)
virtual std::string GetTypeName(std::string_view column) const override final
Get the type name of a given column/object.
void setAuxMode(TEvent::EAuxMode mode)
Set the auxiliary access mode.
virtual Record_t GetColumnReadersImpl(std::string_view column, const std::type_info &typeInfo) override final
Return the type-erased vector of pointers to pointers to column values.
std::vector< std::unique_ptr< TStore > > m_stores
In-memory whiteboards used during the event loop.
virtual void FinalizeSlot(unsigned int slot) override final
Close the input file reading in one of the slots/threads.
virtual void Finalize() override final
Finalize the data source, after the event loop.
std::unordered_map< std::string, std::string > m_classNameMap
The object name -> class name map.
virtual bool SetEntry(unsigned int slot, ULong64_t entry) override final
Set which entry a give slot/thread should be processing.
virtual const std::vector< std::string > & GetColumnNames() const override final
Get the column/object names for the input file(s)
std::vector< std::unique_ptr< RDataSourceEvent > > m_events
Event objects performing the file I/O.
TEvent::EAuxMode auxMode() const
Get the auxiliary access mode.
std::vector< std::string > m_columnNames
Names of the columns/objects on the input.
virtual void SetNSlots(unsigned int slots) override final
Set the number of threads/slots that the data source should use.
EntryRanges_t m_entryRanges
Optimal entry ranges to split the processing into.
std::string m_treeName
Name of the event tree in the input files.
virtual EntryRanges_t GetEntryRanges() override final
Get the entry ranges in the input file(s)
std::vector< std::unique_ptr< TChain > > m_chains
Chains used in the file I/O.
virtual void Initialize() override final
Initialize the data source, before the start of the event loop.
virtual bool HasColumn(std::string_view name) const override final
Check if the dataset has a certain column/object.
Bool_t isVerboseOutput() const
Check whether verbose output is set up to be printed.
Tool for accessing xAOD files outside of Athena.
A relatively simple transient store for objects created in analysis.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.