![]() |
KaliVeda
Toolkit for HIC analysis
|
General purpose class for running parallel tasks with PROOF.
This class has been automatically generated on Fri Apr 1 10:33:24 2011 by ROOT version 5.29/01 from TTree events/events found on file: events.root
Generate a class derived from this one using static method
KVPROOFSelector::Make("MySelector");
then you can use PROOF in order to run tasks in parallel:
TProof::Open(""); // open PROOFLite session gProof->Process("MySelector.cpp+", [ncycles], "[options]");
This will execute MySelector::Process(Long64_t) ncycles times.
USING TREES & HISTOGRAMS TO SAVE DATA
HISTOS & TREES IN SAME FILE If you want all results of your analysis to be written in a single file containing both histos and trees, put the following in the list of options: CombinedOutputFile=myResults.root or call method SetCombinedOutputFile("myResults.root") in your InitAnalysis(); do not call SaveHistos() in EndAnalysis(), and make sure you call CreateTreeFile() without giving a name (the resulting intermediate file will have a default name allowing it to be found at the end of the analysis)
Definition at line 79 of file KVPROOFSelector.h.
#include <KVPROOFSelector.h>

Public Member Functions | |
| KVPROOFSelector (TTree *=0) | |
| virtual | ~KVPROOFSelector () |
| void | AddHisto (TH1 *histo) |
| void | AddTree (TTree *tree) |
| virtual Bool_t | Analysis ()=0 |
| void | Begin (TTree *tree) override |
| Bool_t | CreateTreeFile (const Char_t *filename="") |
| virtual void | EndAnalysis ()=0 |
| void | FillHisto (const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1) |
| void | FillTree (const Char_t *sname="") |
| Long64_t | GetCycleNumber () const |
| TH1 * | GetHisto (const Char_t *name) const |
| KVHashList * | GetHistoList () const |
| return the list of created trees More... | |
| virtual TString | GetOpt (const Char_t *option) const |
| TTree * | GetTree (const Char_t *name) const |
| return the tree named tree_name More... | |
| KVHashList * | GetTreeList () const |
| return the list of created trees More... | |
| virtual void | InitAnalysis ()=0 |
| virtual Bool_t | IsOptGiven (const Char_t *option) |
| Returns kTRUE if the option 'opt' has been set. More... | |
| virtual void | ParseOptions () |
| Bool_t | Process (Long64_t entry) override |
| virtual void | SaveHistos (const Char_t *filename="", Option_t *option="recreate", Bool_t onlyfilled=kFALSE) |
| void | SetCombinedOutputFile (const TString &filename) |
| void | SetEventsReadInterval (Long64_t N) |
| virtual void | SetOpt (const Char_t *option, const Char_t *value) |
| Set a value for an option. More... | |
| void | SlaveBegin (TTree *tree) override |
| void | SlaveTerminate () override |
| void | Terminate () override |
| virtual void | UnsetOpt (const Char_t *opt) |
| Removes the option 'opt' from the internal lists, as if it had never been set. More... | |
| Int_t | Version () const override |
Static Public Member Functions | |
| static void | Make (const Char_t *classname) |
| Generate a new class derived from this one with given name. More... | |
Public Attributes | |
| TProofOutputFile * | mergeFile |
| for merging with PROOF More... | |
| TString | tree_file_name |
| TFile * | writeFile |
|
inline |
Definition at line 109 of file KVPROOFSelector.h.
|
inlinevirtual |
Definition at line 115 of file KVPROOFSelector.h.
| void KVPROOFSelector::AddHisto | ( | TH1 * | histo | ) |
Declare a histogram to be used in analysis. This method must be called when using PROOF.
Definition at line 298 of file KVPROOFSelector.cpp.
| void KVPROOFSelector::AddTree | ( | TTree * | tree | ) |
Declare a TTree to be used in analysis. This method must be called when using PROOF.
Definition at line 316 of file KVPROOFSelector.cpp.
|
pure virtual |
|
override |
Need to parse options here for use in Terminate Also, on PROOF, any KVDataAnalyser instance has to be passed to the workers via the TSelector input list.
Definition at line 22 of file KVPROOFSelector.cpp.
| Bool_t KVPROOFSelector::CreateTreeFile | ( | const Char_t * | filename = "" | ) |
For PROOF: This method must be called before creating any user TTree in InitAnalysis(). If no filename is given, default name="TreeFileFrom[name of selector class].root"
Definition at line 101 of file KVPROOFSelector.cpp.
|
pure virtual |
| void KVPROOFSelector::FillHisto | ( | const Char_t * | histo_name, |
| Double_t | one, | ||
| Double_t | two = 1, |
||
| Double_t | three = 1, |
||
| Double_t | four = 1 |
||
| ) |
Find in the list, if there is an histogram named "sname" If not print an error message If yes redirect to the right method according to its closest mother class to fill it
Definition at line 335 of file KVPROOFSelector.cpp.
| void KVPROOFSelector::FillTree | ( | const Char_t * | tree_name = "" | ) |
Filltree method, the tree named tree_name has to be declared with AddTTree(TTree*) method
if no sname="", all trees in the list is filled
Definition at line 529 of file KVPROOFSelector.cpp.
|
inline |
Returns the argument 'entry' passed to Process(Long64_t entry)
Definition at line 173 of file KVPROOFSelector.h.
| TH1 * KVPROOFSelector::GetHisto | ( | const Char_t * | name | ) | const |
Definition at line 284 of file KVPROOFSelector.cpp.
| KVHashList * KVPROOFSelector::GetHistoList | ( | ) | const |
return the list of created trees
Definition at line 271 of file KVPROOFSelector.cpp.
|
virtual |
Returns the value of the option Only use after checking existence of option with IsOptGiven(const Char_t* opt)
Definition at line 583 of file KVPROOFSelector.cpp.
| TTree * KVPROOFSelector::GetTree | ( | const Char_t * | name | ) | const |
return the tree named tree_name
Definition at line 512 of file KVPROOFSelector.cpp.
| KVHashList * KVPROOFSelector::GetTreeList | ( | ) | const |
return the list of created trees
Definition at line 499 of file KVPROOFSelector.cpp.
|
pure virtual |
|
virtual |
Returns kTRUE if the option 'opt' has been set.
Definition at line 569 of file KVPROOFSelector.cpp.
|
static |
Generate a new class derived from this one with given name.
Definition at line 644 of file KVPROOFSelector.cpp.
|
virtual |
Analyse comma-separated list of options given to TTree::Process and store all "option=value" pairs in fOptionList. Options can then be accessed using IsOptGiven(), GetOptString(), etc. This method is called by SlaveBegin
Definition at line 612 of file KVPROOFSelector.cpp.
|
override |
Processing will abort cleanly if static flag fCleanAbort has been set by some external controlling process.
Use fStatus to set the return value of TTree::Process().
The return value is currently not used.
Definition at line 141 of file KVPROOFSelector.cpp.
|
virtual |
Write in file all histograms declared with AddHisto(TH1*) This method works with PROOF.
If no filename is specified, set default name : HistoFileFrom[KVEvenSelector::GetName()].root
If a filename is specified, search in gROOT->GetListOfFiles() if this file has been already opened
onlyfilled flag allow to write all (onlyfilled=kFALSE, default) or only histograms (onlyfilled=kTRUE) those have been filled
Definition at line 439 of file KVPROOFSelector.cpp.
|
inline |
Call in InitAnalysis() to set the name of the single output file containing all histograms and TTrees produced by analysis. This is equivalent to running the analysis with option CombinedOutputFile=[filename] but setting this option in InitAnalysis() will not work. Note that if this method is not called/the option is not given, histograms and TTrees will be written in separate files.
Definition at line 162 of file KVPROOFSelector.h.
|
inline |
Definition at line 124 of file KVPROOFSelector.h.
|
virtual |
Set a value for an option.
Definition at line 556 of file KVPROOFSelector.cpp.
|
override |
The SlaveBegin() function is called after the Begin() function. When running with PROOF SlaveBegin() is called on each slave server. The tree argument is deprecated (on PROOF 0 is passed).
ParseOptions : Manage options passed as arguments
Called user method InitAnalysis where users can create trees or histos using the appropiate methods : CreateTrees and CreateMethods
Test the presence or not of such histo or tree to manage it properly
Definition at line 60 of file KVPROOFSelector.cpp.
|
override |
The SlaveTerminate() function is called after all entries or objects have been processed. When running with PROOF SlaveTerminate() is called on each slave server. if tree have been defined in the CreateTrees method manage the merge of them in ProofLite session
Definition at line 177 of file KVPROOFSelector.cpp.
|
override |
The Terminate() function is the last function to be called during a query. It always runs on the client, it can be used to present the results graphically or save the results to file.
This method call the user defined EndAnalysis where user can do what she wants
Definition at line 223 of file KVPROOFSelector.cpp.
|
virtual |
Removes the option 'opt' from the internal lists, as if it had never been set.
Definition at line 597 of file KVPROOFSelector.cpp.
|
inlineoverride |
Definition at line 128 of file KVPROOFSelector.h.
| TProofOutputFile* KVPROOFSelector::mergeFile |
for merging with PROOF
Definition at line 103 of file KVPROOFSelector.h.
| TString KVPROOFSelector::tree_file_name |
Definition at line 104 of file KVPROOFSelector.h.
| TFile* KVPROOFSelector::writeFile |
Definition at line 102 of file KVPROOFSelector.h.