Juggler
Juggling algorithms and event processing using gaudi framework
PodioInput.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-or-later
2 // Copyright (C) 2022 Whitney Armstrong
3 
4 #ifndef JUGBASE_PODIOINPUT_H
5 #define JUGBASE_PODIOINPUT_H
6 // Gaaudi
7 #include "GaudiAlg/GaudiAlgorithm.h"
8 
9 // STL
10 #include <string>
11 #include <vector>
12 
13 // forward declarations
14 // from JugBase:
15 class PodioDataSvc;
16 
17 /** @class PodioInput JugBase/components/PodioInput.h PodioInput.h
18  *
19  * Class that allows to read ROOT files written with PodioOutput
20  *
21  * @author J. Lingemann
22  */
23 
24 class PodioInput : public GaudiAlgorithm {
25 
26 public:
27  /// Constructor.
28  PodioInput(const std::string& name, ISvcLocator* svcLoc);
29  /// Initialization of PodioInput. Acquires the data service, opens root file and creates trees.
30  virtual StatusCode initialize();
31  /// Execute. Re-creates collections that are specified to be read and sets references.
32  virtual StatusCode execute();
33  /// Finalize. Closes ROOT file.
34  virtual StatusCode finalize();
35 
36 private:
37  /// Name of collections to read. Set by option collections (this is temporary)
38  Gaudi::Property<std::vector<std::string>> m_collectionNames{this, "collections", {}, "Places of collections to read"};
39  /// Collection IDs (retrieved with CollectionIDTable from ROOT file, using collection names)
40  std::vector<int> m_collectionIDs;
41  /// Data service: needed to register objects and get collection IDs. Just an observing pointer.
42  PodioDataSvc* m_podioDataSvc;
43 };
44 
45 #endif
PodioInput::initialize
virtual StatusCode initialize()
Initialization of PodioInput. Acquires the data service, opens root file and creates trees.
Definition: PodioInput.cpp:18
PodioDataSvc
Definition: PodioDataSvc.h:26
PodioInput::PodioInput
PodioInput(const std::string &name, ISvcLocator *svcLoc)
Constructor.
Definition: PodioInput.cpp:15
PodioInput::execute
virtual StatusCode execute()
Execute. Re-creates collections that are specified to be read and sets references.
Definition: PodioInput.cpp:41
PodioInput::finalize
virtual StatusCode finalize()
Finalize. Closes ROOT file.
Definition: PodioInput.cpp:56
PodioInput
Definition: PodioInput.h:24