Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooProofDriverSelector.cxx
Go to the documentation of this file.
1#define RooProofDriverSelector_cxx
2// The class definition in RooProofDriverSelector.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("RooProofDriverSelector.C")
22// Root > T->Process("RooProofDriverSelector.C","some options")
23// Root > T->Process("RooProofDriverSelector.C+")
24//
25
27#include "RooDataSet.h"
28#include "RooWorkspace.h"
29#include "RooAbsPdf.h"
30#include "RooRealVar.h"
31#include "RooFitResult.h"
32#include "TRandom.h"
33#include "RooRandom.h"
34#include "RooAbsStudy.h"
35#include "RooStudyPackage.h"
36#include "RooGlobalFunc.h"
37
38using namespace RooFit;
39using namespace std;
40
42{
43 // Retrieve study pack
44 _pkg=nullptr ;
45 if (fInput) {
46 for (auto * tmp : dynamic_range_cast<RooStudyPackage*>(*fInput)) {
47 if (tmp) {
48 _pkg = tmp ;
49 }
50 }
51 }
52 if (_pkg==nullptr) {
53 cout << "RooProofDriverSelector::SlaveBegin() no RooStudyPackage found, aborting process" << endl ;
55 } else {
56 cout << "workspace contents = " << endl ;
57 _pkg->wspace().Print() ;
58
59 // Initialize study pack
60 seed = _pkg->initRandom() ;
61 _pkg->initialize() ;
62 }
63
64}
65
67{
68 cout << "RooProofDriverSelector::Process(" << entry << ")" << endl ;
69 _pkg->runOne() ;
70 return true;
71}
72
73
75{
76 _pkg->finalize() ;
78}
79
80
81
83{
84 // Set branch addresses and branch pointers
85 if (!tree) return;
86 fChain = tree;
88 fChain->SetBranchAddress("i", &i, &b_i);
89}
90
92{
93 return true;
94}
95
long long Long64_t
Definition RtypesCore.h:80
TTree * fChain
!pointer to the analyzed TTree or TChain
void Init(TTree *tree) override
void SlaveBegin(TTree *tree) override
bool Process(Long64_t entry) override
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
bool Notify() override
This method must be overridden to handle object notification (the base implementation is no-op).
Int_t initRandom()
Choose random seed for this process in case pass a definite seed to have it deterministic use also wo...
RooWorkspace & wspace()
void finalize()
Finalize all studies.
void initialize()
Make iterator over copy of studies attached to workspace.
void exportData(TList *olist, Int_t seqno)
void Print(Option_t *opts=nullptr) const override
Print contents of the workspace.
TList * fInput
List of objects available during processing.
Definition TSelector.h:41
@ kAbortProcess
Definition TSelector.h:34
TSelectorList * fOutput
! List of objects created during processing
Definition TSelector.h:42
Long64_t fStatus
Selector status.
Definition TSelector.h:37
A TTree represents a columnar dataset.
Definition TTree.h:79
virtual void SetMakeClass(Int_t make)
Set all the branches in this TTree to be in decomposed object mode (also known as MakeClass mode).
Definition TTree.cxx:9164
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
Definition TTree.cxx:8377
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition JSONIO.h:26
Definition tree.py:1