ATLAS Offline Software
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 
21 namespace xAOD {
22 
31  class RDataSourceEvent final : public TEvent {
32 
33  public:
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
xAOD::RDataSourceEvent::Key_t
std::pair< std::string, const std::type_info * > Key_t
Type of the key used in the internal map of object pointers.
Definition: RDataSourceEvent.h:47
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::RDataSourceEvent::updateObjectsForEntry
void updateObjectsForEntry(Long64_t entry)
Update all objects in memory for a new event.
Definition: RDataSourceEvent.cxx:113
xAOD::RDataSourceEvent::m_objects
std::unordered_map< Key_t, const void *, key_hash > m_objects
Objects served to RDataFrame.
Definition: RDataSourceEvent.h:57
xAOD::RDataSourceEvent::key_hash::operator()
std::size_t operator()(const Key_t &key) const
Function calculating the hash for this type.
Definition: RDataSourceEvent.cxx:136
TEvent.h
xAOD::RDataSourceEvent::key_hash
Custom hash functor for use with Key_t.
Definition: RDataSourceEvent.h:50
xAOD::RDataSourceEvent::RDataSourceEvent
RDataSourceEvent()
Default constructor.
Definition: RDataSourceEvent.cxx:24
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAOD::RDataSourceEvent::columnReader
void * columnReader(std::string_view columnName, const std::type_info &typeInfo)
Get a "column reader", a pointer to a pointer to the object.
Definition: RDataSourceEvent.cxx:102
xAOD::RDataSourceEvent::columnAndTypeNames
std::vector< std::pair< std::string, std::string > > columnAndTypeNames()
Get the available columm and type names from the input.
Definition: RDataSourceEvent.cxx:30
xAOD::RDataSourceEvent
Extension to xAOD::TEvent, used by xAOD::RDataSource.
Definition: RDataSourceEvent.h:31
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:84
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37