Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
MySelector_0.C
Go to the documentation of this file.
1#define MySelector_cxx
2// The class definition in MySelector.h has been generated automatically
3// by the ROOT utility TTree::MakeSelector(). This class is derived
4// from the ROOT class TSelector. For more information on the TSelector
5// framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual.
6
7// The following methods are defined in this file:
8// Begin(): called every time a loop on the tree starts,
9// a convenient place to create your histograms.
10// SlaveBegin(): called after Begin(), when on PROOF called only on the
11// slave servers.
12// Process(): called for each event, in this function you decide what
13// to read and fill your histograms.
14// SlaveTerminate: called at the end of the loop on the tree, when on PROOF
15// called only on the slave servers.
16// Terminate(): called at the end of the loop on the tree,
17// a convenient place to draw/fit your histograms.
18//
19// To use this file, try the following session on your Tree T:
20//
21// Root > T->Process("MySelector.C")
22// Root > T->Process("MySelector.C","some options")
23// Root > T->Process("MySelector.C+")
24//
25
26#include "MySelector.h"
27#include <TH2.h>
28#include <TStyle.h>
29
30
31void MySelector::Begin(TTree * /*tree*/)
32{
33 // The Begin() function is called at the start of the query.
34 // When running with PROOF Begin() is only called on the client.
35 // The tree argument is deprecated (on PROOF 0 is passed).
36
37 TString option = GetOption();
38
39}
40
41void MySelector::SlaveBegin(TTree * /*tree*/)
42{
43 // The SlaveBegin() function is called after the Begin() function.
44 // When running with PROOF SlaveBegin() is called on each slave server.
45 // The tree argument is deprecated (on PROOF 0 is passed).
46
47 TString option = GetOption();
48
49}
50
52{
53 // The Process() function is called for each entry in the tree (or possibly
54 // keyed object in the case of PROOF) to be processed. The entry argument
55 // specifies which entry in the currently loaded tree is to be processed.
56 // It can be passed to either MySelector::GetEntry() or TBranch::GetEntry()
57 // to read either all or the required parts of the data. When processing
58 // keyed objects with PROOF, the object is already loaded and is available
59 // via the fObject pointer.
60 //
61 // This function should contain the "body" of the analysis. It can contain
62 // simple or elaborate selection criteria, run algorithms on the data
63 // of the event and typically fill histograms.
64 //
65 // The processing can be stopped by calling Abort().
66 //
67 // Use fStatus to set the return value of TTree::Process().
68 //
69 // The return value is currently not used.
70
71
72 return kTRUE;
73}
74
76{
77 // The SlaveTerminate() function is called after all entries or objects
78 // have been processed. When running with PROOF SlaveTerminate() is called
79 // on each slave server.
80
81}
82
84{
85 // The Terminate() function is the last function to be called during
86 // a query. It always runs on the client, it can be used to present
87 // the results graphically or save the results to file.
88
89}
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
virtual void SlaveBegin(TTree *tree)
Definition MySelector.C:41
virtual void SlaveTerminate()
Definition MySelector.C:74
virtual void Begin(TTree *tree)
Definition MySelector.C:31
virtual Bool_t Process(Long64_t entry)
The Process() function is called for each entry in the tree to be processed.
Definition MySelector.C:51
virtual void Terminate()
Definition MySelector.C:82
const char * GetOption() const override
Definition TSelector.h:57
Basic string class.
Definition TString.h:138
A TTree represents a columnar dataset.
Definition TTree.h:89