Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/proof:$Id$
2// Author: Sangsu Ryu 22/06/2010
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TSelEventGen
13#define ROOT_TSelEventGen
16// //
17// TSelEventGen //
18// //
19// PROOF selector for event file generation. //
20// List of files to be generated for each node is provided by client. //
21// And list of files generated is sent back. //
22// Existing files are reused if not forced to be regenerated. //
23// //
26#include <TSelector.h>
27#include <TTree.h>
28#include <TString.h>
30class TList;
31class TMacro;
33class TSelEventGen : public TSelector {
37 TString fBaseDir; // URL where the files will be written
38 //Int_t fMaxNWorkers;
39 Long64_t fNEvents; //number of events in a file
40 Int_t fNTracks; //avg or min-avg number of tracks in an event
41 Int_t fNTracksMax; //max-avg number of tracks in an event
42 Int_t fRegenerate; //force generation of cleanup files
44 TObject* fTotalGen; //events generated on this worker
45 TList* fFilesGenerated; //list of files generated
47 TMacro *fGenerateFun; //Macro with the function to generate the files
51 Long64_t GenerateFiles(const char *filename, Long64_t sizenevents);
53public :
55 TTree *fChain; //!pointer to the analyzed TTree or TChain
57// TSelEventGen(TTree *);
59 virtual ~TSelEventGen() { }
60 virtual Int_t Version() const {return 1;}
61 virtual void Begin(TTree *);
62 virtual void SlaveBegin(TTree *tree);
63 virtual void Init(TTree *tree);
64 virtual Bool_t Notify();
65 virtual Bool_t Process(Long64_t entry);
66 virtual void SetOption(const char *option) { fOption = option; }
67 virtual void SetObject(TObject *obj) { fObject = obj; }
68 virtual void SetInputList(TList *input) {fInput = input;}
69 virtual TList *GetOutputList() const { return fOutput; }
70 virtual void SlaveTerminate();
71 virtual void Terminate();
72 virtual void Print(Option_t *option="") const;
74 ClassDef(TSelEventGen,0) //PROOF selector for event file generation
79#ifdef TSelEventGen_cxx
83 // The Init() function is called when the selector needs to initialize
84 // a new tree or chain. Typically here the branch addresses of the tree
85 // will be set. It is normaly not necessary to make changes to the
86 // generated code, but the routine can be extended by the user if needed.
87 // Init() will be called many times when running with PROOF.
89 if (tree == 0) return;
90 fChain = tree;
96 // The Notify() function is called when a new file is opened. This
97 // can be either for a new TTree in a TChain or when when a new TTree
98 // is started when using PROOF. Typically here the branch pointers
99 // will be retrieved. It is normaly not necessary to make changes
100 // to the generated code, but the routine can be extended by the
101 // user if needed.
103 return kTRUE;
106#endif // #ifdef TSelEventGen_cxx
bool Bool_t
Definition: RtypesCore.h:61
long long Long64_t
Definition: RtypesCore.h:71
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
A doubly linked list.
Definition: TList.h:44
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
Mother of all ROOT objects.
Definition: TObject.h:37
Selector for event file generation.
Definition: TSelEventGen.h:33
virtual void Init(TTree *tree)
Int_t fRegenerate
Definition: TSelEventGen.h:42
virtual void Begin(TTree *)
The Begin() function is called at the start of the query.
virtual Int_t Version() const
Definition: TSelEventGen.h:60
virtual void SetOption(const char *option)
Definition: TSelEventGen.h:66
pointer to the analyzed TTree or TChain
Long64_t fNEvents
Definition: TSelEventGen.h:39
virtual void Terminate()
The Terminate() function is the last function to be called during a query.
virtual Bool_t Process(Long64_t entry)
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
TString fBaseDir
Definition: TSelEventGen.h:37
Int_t fNTracks
Definition: TSelEventGen.h:40
Long64_t GenerateFiles(const char *filename, Long64_t sizenevents)
Generate files for IO-bound run Input parameters filename: The name of the file to be generated sizen...
TTree * fChain
Definition: TSelEventGen.h:55
virtual ~TSelEventGen()
Definition: TSelEventGen.h:59
TMacro * fGenerateFun
Definition: TSelEventGen.h:47
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
virtual Bool_t Notify()
This method must be overridden to handle object notification.
virtual void SlaveBegin(TTree *tree)
The SlaveBegin() function is called after the Begin() function.
virtual void SetObject(TObject *obj)
Definition: TSelEventGen.h:67
TObject * fTotalGen
Definition: TSelEventGen.h:44
virtual TList * GetOutputList() const
Definition: TSelEventGen.h:69
virtual void SlaveTerminate()
The SlaveTerminate() function is called after all entries or objects have been processed.
virtual void SetInputList(TList *input)
Definition: TSelEventGen.h:68
TList * fFilesGenerated
Definition: TSelEventGen.h:45
Int_t fNTracksMax
Definition: TSelEventGen.h:41
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:33
TList * fInput
List of objects available during processing.
Definition: TSelector.h:43
TString fOption
Option given to TTree::Process.
Definition: TSelector.h:41
TSelectorList * fOutput
! List of objects created during processing
Definition: TSelector.h:44
TObject * fObject
! Current object if processing object (vs. TTree)
Definition: TSelector.h:42
Basic string class.
Definition: TString.h:131
A TTree represents a columnar dataset.
Definition: TTree.h:78
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:9024
Definition: tree.py:1