/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/io/include/RAT/DSReader.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/io/include/RAT/DSReader.hh Source File
Ratpac-two
DSReader.hh
1 #ifndef __RAT_DSReader___
2 #define __RAT_DSReader___
3 
4 #include <TChain.h>
5 #include <TObject.h>
6 #include <TTree.h>
7 
8 #include <RAT/DS/Root.hh>
9 #include <string>
10 
11 namespace RAT {
12 
13 // Convenience class for ROOT scripts
14 class DSReader : public TObject {
15  public:
16  DSReader(const char *filename);
17  virtual ~DSReader();
18 
19  void Add(const char *filename);
20  void SetBranchStatus(const char *bname, bool status = 1) { T.SetBranchStatus(bname, status); };
21 
22  TTree *GetT() { return &T; };
23  TTree *GetRunT() { return &runT; };
24  DS::Root *GetDS() { return ds; };
25  Long64_t GetTotal() { return total; };
26 
27  // Load event. Returns ds (which will now point to specified event)
28  DS::Root *GetEvent(Long64_t num) {
29  next = num + 1;
30  T.GetEntry(num);
31  return ds;
32  };
33  DS::Root *NextEvent();
34 
35  ClassDef(DSReader, 0);
36 
37  protected:
38  TChain T;
39  TChain runT;
40  DS::Root *ds;
41  Long64_t next;
42  Long64_t total;
43 };
44 
45 } // namespace RAT
46 
47 #endif
Definition: DSReader.hh:14
Definition: Root.hh:39
Definition: CCCrossSecMessenger.hh:29