forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MySelector.h
90 lines (74 loc) · 3.07 KB
/
MySelector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Fri Apr 17 11:53:41 2015 by ROOT version 6.03/03
// from TTree cond_data/Example N-Tuple
// found on file: conductivity_experiment.root
//////////////////////////////////////////////////////////
#ifndef MySelector_h
#define MySelector_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
#include <TSelector.h>
// Header file for the classes stored in the TTree if any.
class MySelector : public TSelector {
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
// Fixed size dimensions of array or collections stored in the TTree if any.
// Declaration of leaf types
Float_t Potential;
Float_t Current;
Float_t Temperature;
Float_t Pressure;
// List of branches
TBranch *b_Potential; //!
TBranch *b_Current; //!
TBranch *b_Temperature; //!
TBranch *b_Pressure; //!
MySelector(TTree * /*tree*/ =0) : fChain(0) { }
virtual ~MySelector() { }
virtual Int_t Version() const { return 2; }
virtual void Begin(TTree *tree);
virtual void SlaveBegin(TTree *tree);
virtual void Init(TTree *tree);
virtual Bool_t Notify();
virtual Bool_t Process(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
virtual void SetOption(const char *option) { fOption = option; }
virtual void SetObject(TObject *obj) { fObject = obj; }
virtual void SetInputList(TList *input) { fInput = input; }
virtual TList *GetOutputList() const { return fOutput; }
virtual void SlaveTerminate();
virtual void Terminate();
ClassDef(MySelector,0);
};
#endif
#ifdef MySelector_cxx
void MySelector::Init(TTree *tree)
{
// The Init() function is called when the selector needs to initialize
// a new tree or chain. Typically here the branch addresses and branch
// pointers of the tree will be set.
// It is normally not necessary to make changes to the generated
// code, but the routine can be extended by the user if needed.
// Init() will be called many times when running on PROOF
// (once per file to be processed).
// Set branch addresses and branch pointers
if (!tree) return;
fChain = tree;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("Potential", &Potential, &b_Potential);
fChain->SetBranchAddress("Current", &Current, &b_Current);
fChain->SetBranchAddress("Temperature", &Temperature, &b_Temperature);
fChain->SetBranchAddress("Pressure", &Pressure, &b_Pressure);
}
Bool_t MySelector::Notify()
{
// The Notify() function is called when a new file is opened. This
// can be either for a new TTree in a TChain or when when a new TTree
// is started when using PROOF. It is normally not necessary to make changes
// to the generated code, but the routine can be extended by the
// user if needed. The return value is currently not used.
return kTRUE;
}
#endif // #ifdef MySelector_cxx