HighLAND
MiniTreeConverter.hxx
1 /*
2  converter for MiniTree input format (direct dump of analysis data classes)
3 
4  A. Cervera May 2015
5 */
6 
7 
8 #ifndef MiniTreeConverter_h
9 #define MiniTreeConverter_h
10 
11 #include "BaseDataClasses.hxx"
12 #include "InputConverter.hxx"
13 #include <TClonesArray.h>
14 
16 
17  public:
18  MiniTreeConverter(bool readRooTrackerVtx=false);
19  virtual ~MiniTreeConverter();
20 
21  virtual bool Initialize();
22  Int_t GetSpill(Long64_t& entry, AnaSpillC*& spill);
23  Int_t GetEvent(Long64_t& entry, AnaEventC*& event);
24 
25  // Create the appropriate spill instance
26  virtual AnaSpillB* MakeSpill() { return new AnaSpillB(); }
27 
28 
29  // Create an AnaEVentB from a Spill and a Bunch
30  AnaEventB* MakeEvent(AnaSpillB& spill, AnaBunchB& bunch);
31 
32  /// Record the POT for the current spill, based on information in the AnaBeam
33  /// member of the current AnaSpill.
34  void IncrementPOTBySpill();
35 
36  bool AddFileToTChain(const std::string& inputString);
37 
38  // TODO. Assume for the moment 20% more events that entries in the MiniTree.
39  Int_t GetNEvents(Int_t entries=-1);
40 
41 protected:
42 
43  bool _useCorrectedValues;
44 
45  bool _readRooTrackerVtx;
46 
47  bool _firstFile;
48  std::string _currentfilename;
49  Int_t _currentBunch;
50 
51  AnaSpillB* _spill;
52 
53  /// The accumulated POT
55 
56 
57  TChain *minitree;
58  TChain *GRooTrackerVTX;
59  TChain *NRooTrackerVTX;
60 
61  bool fGenie;
62  bool fNeut;
63 
64  // the current RooTrackerVtx entry
65  Long64_t _entry_roo;
66 
67  protected:
68 
69  // Genie and Neut Tracker Vertex
70  Int_t RunID;
71  Int_t SubrunID;
72  Int_t EventID;
73  Int_t NNVtx;
74  TClonesArray *NVtx;
75  Int_t NGVtx;
76  TClonesArray *GVtx;
77 };
78 
79 #endif
80 
81 
virtual bool Initialize()
Int_t GetEvent(Long64_t &entry, AnaEventC *&event)
Double_t _POTSincePreviousSavedSpill
The accumulated POT.
Int_t GetNEvents(Int_t entries=-1)
Return the total number of events for a given number of entries in the tree.
Int_t GetSpill(Long64_t &entry, AnaSpillC *&spill)
bool AddFileToTChain(const std::string &inputString)
Add the file specified to fChain, and any friend chains that were set up.