ATLAS Offline Software
REvent.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 #ifndef XAODROOTACCESS_REVENT_H
3 #define XAODROOTACCESS_REVENT_H
4 
5 // Local include(s).
6 #include "xAODRootAccess/Event.h"
7 
8 // ROOT include(s).
9 #include <ROOT/RNTupleReader.hxx>
10 
11 // System include(s).
12 #include <memory>
13 #include <string_view>
14 
15 namespace xAOD::Experimental {
16 
17 // Forward declaration(s).
18 class RObjectManager;
19 
27 
28 class REvent : public Event {
29 
30  public:
32  REvent();
33 
35  virtual ~REvent();
36 
39 
41  StatusCode readFrom(std::string_view fileName);
42 
44 
47 
49  ::Long64_t getEntries() const;
51  ::Int_t getEntry(::Long64_t entry, ::Int_t getall = 0);
52 
54 
55  private:
58 
60  bool hasInput() const override;
62  bool hasOutput() const override;
63 
65  StatusCode getNames(const std::string& targetClassName,
66  std::vector<std::string>& vkeys,
67  bool metadata) const override;
68 
70  StatusCode connectObject(const std::string& key, bool silent) override;
72  StatusCode connectMetaObject(const std::string& key, bool silent) override;
74  StatusCode connectAux(const std::string& prefix, bool standalone) override;
77  StatusCode connectMetaAux(const std::string& prefix,
78  bool standalone) override;
79 
82  bool metadata) override;
83 
85  StatusCode record(void* obj, const std::string& typeName,
86  const std::string& key, bool overwrite, bool metadata,
87  bool isOwner) override;
89  StatusCode recordAux(TVirtualManager& mgr, const std::string& key,
90  bool metadata) override;
91 
93 
96 
99  ROOT::RNTupleReader& ntupleReader);
100 
102  std::unique_ptr<ROOT::RNTupleReader> m_eventReader;
106  std::unique_ptr<ROOT::RNTupleReader> m_metaReader;
107 
109  ::Long64_t m_entry;
110 
111 }; // class REvent
112 
113 } // namespace xAOD::Experimental
114 
115 #endif // XAODROOTACCESS_REVENT_H
xAOD::Experimental::REvent
Tool for accessing xAOD files outside of Athena, version RNTuple.
Definition: REvent.h:28
xAOD::Experimental::REvent::connectObject
StatusCode connectObject(const std::string &key, bool silent) override
Function setting up access to a particular object.
Definition: REvent.cxx:352
xAOD::Experimental::REvent::setAuxStore
StatusCode setAuxStore(const std::string &key, Details::IObjectManager &mgr, bool metadata) override
Function connecting a DV object to its auxiliary store.
Definition: REvent.cxx:723
xAOD::Experimental::REvent::connectMetaAux
StatusCode connectMetaAux(const std::string &prefix, bool standalone) override
Function setting up access to a set of auxiliary branches for a metadata object.
Definition: REvent.cxx:648
L1CaloPhase1Monitoring.standalone
standalone
Definition: L1CaloPhase1Monitoring.py:139
xAOD::Experimental::REvent::connectMetaObject
StatusCode connectMetaObject(const std::string &key, bool silent) override
Function setting up access to a particular metadata object.
Definition: REvent.cxx:490
xAOD::Experimental::REvent::getEntries
::Long64_t getEntries() const
Get how many entries are available from the current input file(s)
Definition: REvent.cxx:252
xAOD::Experimental::RObjectManager
Manager for EDM objects created by ROOT.
Definition: RObjectManager.h:30
xAOD::Experimental
Definition: REvent.cxx:67
xAOD::Experimental::REvent::hasOutput
bool hasOutput() const override
Check if an output file is connected to the object.
Definition: REvent.cxx:322
xAOD::Experimental::REvent::m_inputNTupleIsMissing
bool m_inputNTupleIsMissing
Whether the input has an event RNTuple or not.
Definition: REvent.h:104
xAOD::TVirtualManager
Interface class for the "manager classes".
Definition: TVirtualManager.h:24
xAOD::Experimental::REvent::getEntry
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
Definition: REvent.cxx:278
xAOD::Experimental::REvent::connectAux
StatusCode connectAux(const std::string &prefix, bool standalone) override
Function setting up access to a set of auxiliary branches.
Definition: REvent.cxx:576
xAOD::Experimental::REvent::recordAux
StatusCode recordAux(TVirtualManager &mgr, const std::string &key, bool metadata) override
Record an auxiliary store into a connected output file.
Definition: REvent.cxx:838
xAOD::Experimental::REvent::readFrom
StatusCode readFrom(std::string_view fileName)
Set up the reading of an input file.
Definition: REvent.cxx:90
python.checkMetadata.metadata
metadata
Definition: checkMetadata.py:175
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
xAOD::Experimental::REvent::REvent
REvent()
Default constructor.
Definition: REvent.cxx:73
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xAOD::Experimental::REvent::setUpDynamicStore
StatusCode setUpDynamicStore(RObjectManager &mgr, ROOT::RNTupleReader &ntupleReader)
event uses RNTupleReader:
Definition: REvent.cxx:943
Event.h
xAOD::Experimental::REvent::hasInput
bool hasInput() const override
Check if an input file is connected to the object.
Definition: REvent.cxx:317
xAOD::Experimental::REvent::~REvent
virtual ~REvent()
Destructor.
Definition: REvent.cxx:75
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAOD::Experimental::REvent::m_entry
::Long64_t m_entry
The entry to look at from the input tree.
Definition: REvent.h:109
xAOD::Experimental::REvent::record
StatusCode record(void *obj, const std::string &typeName, const std::string &key, bool overwrite, bool metadata, bool isOwner) override
Record an object into a connected output file.
Definition: REvent.cxx:831
python.trfDecorators.silent
def silent(func)
Redirect stdout/err to /dev/null Useful wrapper to get rid of ROOT verbosity...
Definition: trfDecorators.py:24
xAOD::Experimental::REvent::m_metaReader
std::unique_ptr< ROOT::RNTupleReader > m_metaReader
The metadata reader.
Definition: REvent.h:106
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
xAOD::Experimental::REvent::initStats
StatusCode initStats()
Function to initialise the statistics for all Tree content.
Definition: REvent.cxx:850
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
xAOD::Details::IObjectManager
Manager for EDM objects created by ROOT.
Definition: IObjectManager.h:20
xAOD::Event
Base class for the event (xAOD::TEvent and xAOD::REvent) classes.
Definition: Event.h:59
python.PyAthena.obj
obj
Definition: PyAthena.py:132
xAOD::Experimental::REvent::m_eventReader
std::unique_ptr< ROOT::RNTupleReader > m_eventReader
The main event data reader.
Definition: REvent.h:102
xAOD::Experimental::REvent::getNames
StatusCode getNames(const std::string &targetClassName, std::vector< std::string > &vkeys, bool metadata) const override
Function determining the list keys associated with a type name.
Definition: REvent.cxx:327
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37