ATLAS Offline Software
Loading...
Searching...
No Matches
RDataSourceEvent.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef XAODDATASOURCE_RDATASOURCEEVENT_H
6#define XAODDATASOURCE_RDATASOURCEEVENT_H
7
8// xAOD include(s).
10
11// ROOT include(s).
12#include <ROOT/RStringView.hxx>
13
14// System include(s).
15#include <string>
16#include <vector>
17#include <utility>
18#include <typeinfo>
19#include <unordered_map>
20
21namespace xAOD {
22
31 class RDataSourceEvent final : public TEvent {
32
33 public:
34 // Inherit the base class's constructor(s).
35 using TEvent::TEvent;
36
38 std::vector< std::pair< std::string, std::string > > columnAndTypeNames();
40 void* columnReader( std::string_view columnName,
41 const std::type_info& typeInfo );
43 void updateObjectsForEntry( Long64_t entry );
44
45 private:
47 typedef std::pair< std::string, const std::type_info* > Key_t;
48
50 class key_hash {
51 public:
53 std::size_t operator()( const Key_t& key ) const;
54 };
55
57 std::unordered_map< Key_t, const void*, key_hash > m_objects;
58
59 }; // class RDataSourceEvent
60
61} // namespace xAOD
62
63#endif // XAODDATASOURCE_RDATASOURCEEVENT_H
Custom hash functor for use with Key_t.
std::size_t operator()(const Key_t &key) const
Function calculating the hash for this type.
Extension to xAOD::TEvent, used by xAOD::RDataSource.
void updateObjectsForEntry(Long64_t entry)
Update all objects in memory for a new event.
std::pair< std::string, const std::type_info * > Key_t
Type of the key used in the internal map of object pointers.
void * columnReader(std::string_view columnName, const std::type_info &typeInfo)
Get a "column reader", a pointer to a pointer to the object.
std::vector< std::pair< std::string, std::string > > columnAndTypeNames()
Get the available columm and type names from the input.
TEvent(EAuxMode mode=kClassAccess)
Default constructor.
std::unordered_map< Key_t, const void *, key_hash > m_objects
Objects served to RDataFrame.
TEvent(EAuxMode mode=kClassAccess)
Default constructor.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.