Logo ROOT  
Reference Guide
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=0 ;
45 if (fInput) {
46 TIter iter = fInput->MakeIterator() ;
47 TObject* obj ;
48 while((obj=iter.Next())) {
49 RooStudyPackage* tmp = dynamic_cast<RooStudyPackage*>(obj) ;
50 if (tmp) {
51 _pkg = tmp ;
52 }
53 }
54 }
55 if (_pkg==0) {
56 cout << "RooProofDriverSelector::SlaveBegin() no RooStudyPackage found, aborting process" << endl ;
58 } else {
59 cout << "workspace contents = " << endl ;
60 _pkg->wspace().Print() ;
61
62 // Initialize study pack
63 seed = _pkg->initRandom() ;
64 _pkg->initialize() ;
65 }
66
67}
68
70{
71 cout << "RooProofDriverSelector::Process(" << entry << ")" << endl ;
72 _pkg->runOne() ;
73 return kTRUE;
74}
75
76
78{
79 _pkg->finalize() ;
81}
82
83
84
86{
87 // Set branch addresses and branch pointers
88 if (!tree) return;
89 fChain = tree;
91 fChain->SetBranchAddress("i", &i, &b_i);
92}
93
95{
96 return kTRUE;
97}
98
long long Long64_t
Definition: RtypesCore.h:80
const Bool_t kTRUE
Definition: RtypesCore.h:100
Bool_t Process(Long64_t entry) override
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
TTree * fChain
!pointer to the analyzed TTree or TChain
Bool_t Notify() override
This method must be overridden to handle object notification.
void Init(TTree *tree) override
void SlaveBegin(TTree *tree) override
RooStudyPackage is a utility class to manage studies that consist of repeated applications of generat...
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=0) const override
Print contents of the workspace.
TObject * Next()
Definition: TCollection.h:251
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Return a list iterator.
Definition: TList.cxx:722
Mother of all ROOT objects.
Definition: TObject.h:37
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 Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:8339
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:9126
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: Common.h:18
Definition: tree.py:1