Project
Loading...
Searching...
No Matches
EventReader.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef ALICEO2_FOCAL_EVENTREADER_H
12#define ALICEO2_FOCAL_EVENTREADER_H
13
14#include <memory>
15#include <vector>
16#include <TTreeReader.h>
21
22namespace o2::focal
23{
24
26{
27 public:
28 EventReader() = default;
29 EventReader(TTree* eventTree);
30 ~EventReader() = default;
31
32 bool hasNext() const;
34
35 private:
36 void init(TTree* eventTree);
37 void nextTimeframe();
38
39 bool mHasEntryLoaded = false;
40 bool mTreeReaderHasNext = true;
41 int mEntryInTF = 0;
42 std::unique_ptr<TTreeReader> mTreeReader;
43 std::unique_ptr<TTreeReaderValue<std::vector<PadLayerEvent>>> mPadBranch;
44 std::unique_ptr<TTreeReaderValue<std::vector<PixelHit>>> mPixelHitBranch;
45 std::unique_ptr<TTreeReaderValue<std::vector<PixelChipRecord>>> mPixelChipBranch;
46 std::unique_ptr<TTreeReaderValue<std::vector<TriggerRecord>>> mTriggerBranch;
47
48 ClassDefNV(EventReader, 1);
49};
50
51} // namespace o2::focal
52
53#endif // ALICEO2_FOCAL_EVENTREADER_H