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 |
virtual void | Begin (TTree *tree) |
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 | |
virtual TString | GetOpt (const Char_t *option) const |
TTree * | GetTree (const Char_t *name) const |
return the tree named tree_name | |
KVHashList * | GetTreeList () const |
return the list of created trees | |
virtual void | InitAnalysis ()=0 |
virtual Bool_t | IsOptGiven (const Char_t *option) |
Returns kTRUE if the option 'opt' has been set. | |
virtual void | ParseOptions () |
virtual Bool_t | Process (Long64_t entry) |
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. | |
virtual void | SlaveBegin (TTree *tree) |
virtual void | SlaveTerminate () |
virtual void | Terminate () |
virtual void | UnsetOpt (const Char_t *opt) |
Removes the option 'opt' from the internal lists, as if it had never been set. | |
virtual Int_t | Version () const |
Public Member Functions inherited from TSelector | |
TSelector () | |
~TSelector () override | |
virtual void | Abort (const char *why, EAbort what=kAbortProcess) |
virtual EAbort | GetAbort () const |
virtual Int_t | GetEntry (Long64_t, Int_t=0) |
virtual TList * | GetInputList () const |
const char * | GetOption () const override |
virtual TList * | GetOutputList () const |
virtual Long64_t | GetStatus () const |
virtual void | ImportOutput (TList *output) |
virtual void | Init (TTree *) |
TClass * | IsA () const override |
Bool_t | Notify () override |
virtual Bool_t | ProcessCut (Long64_t) |
virtual void | ProcessFill (Long64_t) |
virtual void | ResetAbort () |
virtual void | SetInputList (TList *input) |
virtual void | SetObject (TObject *obj) |
virtual void | SetOption (const char *option) |
virtual void | SetStatus (Long64_t status) |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
virtual | ~TObject () |
void | AbstractMethod (const char *method) const |
virtual void | AppendPad (Option_t *option="") |
virtual void | Browse (TBrowser *b) |
ULong_t | CheckedHash () |
virtual const char * | ClassName () const |
virtual void | Clear (Option_t *="") |
virtual TObject * | Clone (const char *newname="") const |
virtual Int_t | Compare (const TObject *obj) const |
virtual void | Copy (TObject &object) const |
virtual void | Delete (Option_t *option="") |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
virtual void | Draw (Option_t *option="") |
virtual void | DrawClass () const |
virtual TObject * | DrawClone (Option_t *option="") const |
virtual void | Dump () const |
virtual void | Error (const char *method, const char *msgfmt,...) const |
virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
virtual TObject * | FindObject (const char *name) const |
virtual TObject * | FindObject (const TObject *obj) const |
virtual Option_t * | GetDrawOption () const |
virtual const char * | GetIconName () const |
virtual const char * | GetName () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
virtual const char * | GetTitle () const |
virtual UInt_t | GetUniqueID () const |
virtual Bool_t | HandleTimer (TTimer *timer) |
virtual ULong_t | Hash () const |
Bool_t | HasInconsistentHash () const |
virtual void | Info (const char *method, const char *msgfmt,...) const |
virtual Bool_t | InheritsFrom (const char *classname) const |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
virtual void | Inspect () const |
void | InvertBit (UInt_t f) |
Bool_t | IsDestructed () const |
virtual Bool_t | IsEqual (const TObject *obj) const |
virtual Bool_t | IsFolder () const |
R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
virtual Bool_t | IsSortable () const |
R__ALWAYS_INLINE Bool_t | IsZombie () const |
virtual void | ls (Option_t *option="") const |
void | MayNotUse (const char *method) const |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *vp) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, void *vp) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
virtual void | Paint (Option_t *option="") |
virtual void | Pop () |
virtual void | Print (Option_t *option="") const |
virtual Int_t | Read (const char *name) |
virtual void | RecursiveRemove (TObject *obj) |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
void | SetBit (UInt_t f) |
void | SetBit (UInt_t f, Bool_t set) |
virtual void | SetDrawOption (Option_t *option="") |
virtual void | SetUniqueID (UInt_t uid) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
virtual void | UseCurrentStyle () |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const |
Static Public Member Functions | |
static void | Make (const Char_t *classname) |
Generate a new class derived from this one with given name. | |
Static Public Member Functions inherited from TSelector | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static TSelector * | GetSelector (const char *filename) |
static Bool_t | IsStandardDraw (const char *selec) |
Static Public Member Functions inherited from TObject | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Longptr_t | GetDtorOnly () |
static Bool_t | GetObjectStat () |
static void | SetDtorOnly (void *obj) |
static void | SetObjectStat (Bool_t stat) |
Public Attributes | |
TProofOutputFile * | mergeFile |
for merging with PROOF | |
TString | tree_file_name |
TFile * | writeFile |
Public Attributes inherited from TSelector | |
kAbortFile | |
kAbortProcess | |
kContinue | |
Public Attributes inherited from TObject | |
kBitMask | |
kCanDelete | |
kCannotPick | |
kHasUUID | |
kInconsistent | |
kInvalidObject | |
kIsOnHeap | |
kIsReferenced | |
kMustCleanup | |
kNoContextMenu | |
kNotDeleted | |
kObjInCanvas | |
kOverwrite | |
kSingleKey | |
kWriteDelete | |
kZombie | |
Private Member Functions | |
void | FillTH1 (TH1 *h1, Double_t one, Double_t two) |
void | FillTH2 (TH2 *h2, Double_t one, Double_t two, Double_t three) |
void | FillTH3 (TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four) |
void | FillTProfile (TProfile *h1, Double_t one, Double_t two, Double_t three) |
void | FillTProfile2D (TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four) |
Private Attributes | |
KVString | fCombinedOutputFile |
optional name for single results file with trees and histos | |
Bool_t | fDisableCreateTreeFile |
used with PROOF | |
Long64_t | fEventsRead |
cycle number (argument 'entry' passed to Process(Long64_t)) | |
Long64_t | fEventsReadInterval |
interval at which to print number of events read | |
KVNameValueList | fOptionList |
parsed list of options given to TTree::Process | |
KVHashList * | lhisto |
! | |
KVHashList * | ltree |
! | |
Additional Inherited Members | |
Public Types inherited from TSelector | |
enum | EAbort |
Public Types inherited from TObject | |
enum | EDeprecatedStatusBits |
enum | EStatusBits |
Protected Member Functions inherited from TObject | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
void | MakeZombie () |
Protected Attributes inherited from TSelector | |
EAbort | fAbort |
TList * | fInput |
TObject * | fObject |
TString | fOption |
TSelectorList * | fOutput |
Long64_t | fStatus |
Protected Attributes inherited from TObject | |
kOnlyPrepStep | |
|
inline |
Definition at line 109 of file KVPROOFSelector.h.
|
inlinevirtual |
Definition at line 115 of file KVPROOFSelector.h.
Declare a histogram to be used in analysis. This method must be called when using PROOF.
Definition at line 298 of file KVPROOFSelector.cpp.
Declare a TTree to be used in analysis. This method must be called when using PROOF.
Definition at line 316 of file KVPROOFSelector.cpp.
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.
Reimplemented from TSelector.
Definition at line 22 of file KVPROOFSelector.cpp.
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.
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.
Definition at line 368 of file KVPROOFSelector.cpp.
Definition at line 392 of file KVPROOFSelector.cpp.
|
private |
Definition at line 415 of file KVPROOFSelector.cpp.
|
private |
Definition at line 380 of file KVPROOFSelector.cpp.
|
private |
Definition at line 404 of file KVPROOFSelector.cpp.
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.
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.
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.
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.
Returns kTRUE if the option 'opt' has been set.
Definition at line 569 of file KVPROOFSelector.cpp.
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.
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.
Reimplemented from TSelector.
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.
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.
Definition at line 124 of file KVPROOFSelector.h.
Set a value for an option.
Definition at line 556 of file KVPROOFSelector.cpp.
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
Reimplemented from TSelector.
Definition at line 60 of file KVPROOFSelector.cpp.
|
virtual |
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
Reimplemented from TSelector.
Definition at line 177 of file KVPROOFSelector.cpp.
|
virtual |
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
Reimplemented from TSelector.
Definition at line 223 of file KVPROOFSelector.cpp.
Removes the option 'opt' from the internal lists, as if it had never been set.
Definition at line 597 of file KVPROOFSelector.cpp.
Reimplemented from TSelector.
Definition at line 128 of file KVPROOFSelector.h.
|
private |
optional name for single results file with trees and histos
Definition at line 88 of file KVPROOFSelector.h.
|
private |
used with PROOF
Definition at line 93 of file KVPROOFSelector.h.
|
private |
cycle number (argument 'entry' passed to Process(Long64_t))
Definition at line 82 of file KVPROOFSelector.h.
|
private |
interval at which to print number of events read
Definition at line 83 of file KVPROOFSelector.h.
|
private |
parsed list of options given to TTree::Process
Definition at line 91 of file KVPROOFSelector.h.
|
private |
!
Definition at line 85 of file KVPROOFSelector.h.
|
private |
!
Definition at line 86 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.