GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
Viewer.hh
Go to the documentation of this file.
1#ifndef GAMR_VIEWER_VIEWER
2#define GAMR_VIEWER_VIEWER
3
4#include <tree/Tree.hh>
5
6namespace GamR {
7 namespace Viewer {
8 template <class TExpDefn, class TEvent>
9 class Viewer {
10 public:
11 TExpDefn fExpDefn;
12 ULong64_t nRawEntries;
13 ULong64_t ixEventNum;
14 TEvent *fEvent;
15 Viewer(std::vector<std::string> infile, std::string conf) : ixEventNum(0) {
16 fExpDefn.Load(infile, conf, 0);
17 nRawEntries = static_cast<ULong64_t>(fExpDefn.fRawChain->GetEntries());
18 fEvent = new TEvent();
19 ROOT::DisableImplicitMT();
20 }
21
22 int Next() {
23 if (ixEventNum == nRawEntries) { return 0; }
24 ULong64_t ixLocalNum = fExpDefn.fRawChain->LoadTree(ixEventNum);
25 fExpDefn.fRawChain->GetTree()->GetEntry(ixLocalNum);
26 fEvent->Reset();
27 fEvent->FillEvent(fExpDefn.fDetDefns);
28 ++ixEventNum;
29 return 1;
30 }
31 };
32 }
33}
34
35#endif
Viewer(std::vector< std::string > infile, std::string conf)
Definition Viewer.hh:15
TExpDefn fExpDefn
Definition Viewer.hh:11
ULong64_t nRawEntries
Definition Viewer.hh:12
ULong64_t ixEventNum
Definition Viewer.hh:13
Definition Gain.cc:19