ATLAS Offline Software
RNTCollectionCursor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RNTCOLLECTIONCURSOR_H
6 #define RNTCOLLECTIONCURSOR_H
7 
9 
13 
14 #include <memory>
15 
16 #include "RVersion.h"
17 
18 #if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 35, 0 )
19 namespace ROOT {
20  class REntry;
21  class RNTupleReader;
22 }
23 #else
24 namespace ROOT::Experimental {
25  class REntry;
26  class RNTupleReader;
27 }
28 namespace ROOT {
29  using REntry = ROOT::Experimental::REntry;
30  using RNTupleReader = ROOT::Experimental::RNTupleReader;
31 }
32 #endif
33 
34 namespace pool {
35  namespace RootCollection {
36 
44  {
45  public:
46 
49  const pool::CollectionRowBuffer& collectionRowBuffer,
50  ROOT::RNTupleReader* reader );
51 
52 
54  virtual bool next() override;
55 
57  virtual const pool::CollectionRowBuffer& currentRow() const override;
58 
60  virtual std::size_t size() override;
61 
63  virtual bool seek(std::size_t position) override;
64 
66  virtual const Token& eventRef() const override;
67 
69  virtual void close() override;
70 
72 
73  protected:
74 
76 
77  ROOT::RNTupleReader* m_RNTReader;
78 
80  std::unique_ptr< ROOT::REntry > m_RNTEntry;
81 
84 
86  std::vector< std::pair< Token*, std::string > > m_tokens;
87 
88  std::size_t m_idx;
89  bool m_dummyRef;
90  };
91  }
92 }
93 
94 #endif
pool::RootCollection::RNTCollectionCursor::next
virtual bool next() override
Advances the cursor to the next row of the query result set.
pool::RootCollection::RNTCollectionCursor::size
virtual std::size_t size() override
Return the size of the collection.
pool::RootCollection::RNTCollectionCursor::seek
virtual bool seek(std::size_t position) override
Seeks the cursor to a given position in the collection.
ICollectionCursor.h
pool
pool namespace
Definition: libname.h:15
pool::RootCollection::RNTCollectionCursor::eventRef
virtual const Token & eventRef() const override
Returns the event reference Token for the current row.
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
CollectionRowBuffer.h
pool::RootCollection::RNTCollectionCursor::m_idx
std::size_t m_idx
Definition: RNTCollectionCursor.h:88
pool::RootCollection::RNTCollectionCursor::~RNTCollectionCursor
virtual ~RNTCollectionCursor()
pool::ICollectionCursor
Definition: ICollectionCursor.h:22
pool::CollectionRowBuffer
Definition: CollectionRowBuffer.h:31
pool::RootCollection::RNTCollectionCursor::m_description
const ICollectionDescription & m_description
Definition: RNTCollectionCursor.h:75
pool::RootCollection::RNTCollectionCursor
Definition: RNTCollectionCursor.h:44
pool::RootCollection::RNTCollectionCursor::m_RNTReader
ROOT::RNTupleReader * m_RNTReader
Definition: RNTCollectionCursor.h:77
pool::RootCollection::RNTCollectionCursor::m_collectionRowBuffer
pool::CollectionRowBuffer m_collectionRowBuffer
Row buffer containing Tokens and Attributes selected by query.
Definition: RNTCollectionCursor.h:83
pool::RootCollection::RNTCollectionCursor::currentRow
virtual const pool::CollectionRowBuffer & currentRow() const override
Returns the selected Tokens and Attributes for the current row of the query result set.
pool::RootCollection::RNTCollectionCursor::m_RNTEntry
std::unique_ptr< ROOT::REntry > m_RNTEntry
RNtuple row with Field addresses set to collectionRowBuffer attributes.
Definition: RNTCollectionCursor.h:80
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
ICollectionDescription.h
pool::RootCollection::RNTCollectionCursor::RNTCollectionCursor
RNTCollectionCursor(const pool::ICollectionDescription &description, const pool::CollectionRowBuffer &collectionRowBuffer, ROOT::RNTupleReader *reader)
Token.h
This file contains the class definition for the Token class (migrated from POOL).
ROOT
Selection rules: declare transient members.
Definition: DataVector.h:580
pool::RootCollection::RNTCollectionCursor::close
virtual void close() override
Cleanup.
pool::RootCollection::RNTCollectionCursor::m_tokens
std::vector< std::pair< Token *, std::string > > m_tokens
"Token rowBuffer" for reading Tokens as strings and converting them later
Definition: RNTCollectionCursor.h:86
pool::ICollectionDescription
Definition: ICollectionDescription.h:25
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88
pool::RootCollection::RNTCollectionCursor::m_dummyRef
bool m_dummyRef
Definition: RNTCollectionCursor.h:89