KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
KVPROOFSelector Class Referenceabstract

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 78 of file 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
 
TH1GetHisto (const Char_t *name) const
 
KVHashListGetHistoList () const
 return the list of created trees More...
 
virtual TString GetOpt (const Char_t *option) const
 
TTreeGetTree (const Char_t *name) const
 return the tree named tree_name More...
 
KVHashListGetTreeList () 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 ()
 
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. More...
 
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. More...
 
virtual Int_t Version () const
 
- Public Member Functions inherited from TSelector
 TSelector ()
 
virtual ~TSelector ()
 
virtual void Abort (const char *why, EAbort what=kAbortProcess)
 
virtual EAbort GetAbort () const
 
virtual Int_t GetEntry (Long64_t, Int_t=0)
 
virtual TListGetInputList () const
 
virtual const char * GetOption () const
 
virtual TListGetOutputList () const
 
virtual Long64_t GetStatus () const
 
virtual void ImportOutput (TList *output)
 
virtual void Init (TTree *)
 
virtual Bool_t Notify ()
 
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)
 
- 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 TObjectClone (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 TObjectDrawClone (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=0)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () 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)
 
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)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (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)
 
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=0, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=0, 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. More...
 
- Static Public Member Functions inherited from TSelector
static TSelectorGetSelector (const char *filename)
 
static Bool_t IsStandardDraw (const char *selec)
 
- Static Public Member Functions inherited from TObject
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 

Public Attributes

TProofOutputFilemergeFile
 for merging with PROOF More...
 
TString tree_file_name
 
TFilewriteFile
 
- 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
 

Protected 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)
 
- 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

KVString fCombinedOutputFile
 optional name for single results file with trees and histos More...
 
Bool_t fDisableCreateTreeFile
 used with PROOF More...
 
Long64_t fEventsRead
 cycle number (argument 'entry' passed to Process(Long64_t)) More...
 
Long64_t fEventsReadInterval
 interval at which to print number of events read More...
 
KVNameValueList fOptionList
 parsed list of options given to TTree::Process More...
 
KVHashListlhisto
 ! More...
 
KVHashListltree
 ! More...
 
- Protected Attributes inherited from TSelector
EAbort fAbort
 
TListfInput
 
TObjectfObject
 
TString fOption
 
TSelectorListfOutput
 
Long64_t fStatus
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

Additional Inherited Members

- Public Types inherited from TSelector
enum  EAbort
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 

#include <KVPROOFSelector.h>

Inheritance diagram for KVPROOFSelector:
Inheritance graph
[legend]

Constructor & Destructor Documentation

◆ KVPROOFSelector()

KVPROOFSelector::KVPROOFSelector ( TTree = 0)
inline

Definition at line 108 of file KVPROOFSelector.h.

◆ ~KVPROOFSelector()

virtual KVPROOFSelector::~KVPROOFSelector ( )
inlinevirtual

Definition at line 114 of file KVPROOFSelector.h.

Member Function Documentation

◆ AddHisto()

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.

◆ AddTree()

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.

◆ Analysis()

virtual Bool_t KVPROOFSelector::Analysis ( )
pure virtual

◆ Begin()

void KVPROOFSelector::Begin ( TTree tree)
virtual

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.

◆ CreateTreeFile()

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.

◆ EndAnalysis()

virtual void KVPROOFSelector::EndAnalysis ( )
pure virtual

◆ FillHisto()

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.

◆ FillTH1()

void KVPROOFSelector::FillTH1 ( TH1 h1,
Double_t  one,
Double_t  two 
)
protected

Definition at line 368 of file KVPROOFSelector.cpp.

◆ FillTH2()

void KVPROOFSelector::FillTH2 ( TH2 h2,
Double_t  one,
Double_t  two,
Double_t  three 
)
protected

Definition at line 392 of file KVPROOFSelector.cpp.

◆ FillTH3()

void KVPROOFSelector::FillTH3 ( TH3 h3,
Double_t  one,
Double_t  two,
Double_t  three,
Double_t  four 
)
protected

Definition at line 415 of file KVPROOFSelector.cpp.

◆ FillTProfile()

void KVPROOFSelector::FillTProfile ( TProfile h1,
Double_t  one,
Double_t  two,
Double_t  three 
)
protected

Definition at line 380 of file KVPROOFSelector.cpp.

◆ FillTProfile2D()

void KVPROOFSelector::FillTProfile2D ( TProfile2D h2,
Double_t  one,
Double_t  two,
Double_t  three,
Double_t  four 
)
protected

Definition at line 404 of file KVPROOFSelector.cpp.

◆ FillTree()

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.

◆ GetCycleNumber()

Long64_t KVPROOFSelector::GetCycleNumber ( ) const
inline

Returns the argument 'entry' passed to Process(Long64_t entry)

Definition at line 172 of file KVPROOFSelector.h.

◆ GetHisto()

TH1 * KVPROOFSelector::GetHisto ( const Char_t name) const

Definition at line 284 of file KVPROOFSelector.cpp.

◆ GetHistoList()

KVHashList * KVPROOFSelector::GetHistoList ( ) const

return the list of created trees

Definition at line 271 of file KVPROOFSelector.cpp.

◆ GetOpt()

TString KVPROOFSelector::GetOpt ( const Char_t opt) const
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.

◆ GetTree()

TTree * KVPROOFSelector::GetTree ( const Char_t name) const

return the tree named tree_name

Definition at line 512 of file KVPROOFSelector.cpp.

◆ GetTreeList()

KVHashList * KVPROOFSelector::GetTreeList ( ) const

return the list of created trees

Definition at line 499 of file KVPROOFSelector.cpp.

◆ InitAnalysis()

virtual void KVPROOFSelector::InitAnalysis ( )
pure virtual

◆ IsOptGiven()

Bool_t KVPROOFSelector::IsOptGiven ( const Char_t option)
virtual

Returns kTRUE if the option 'opt' has been set.

Definition at line 569 of file KVPROOFSelector.cpp.

◆ Make()

void KVPROOFSelector::Make ( const Char_t classname)
static

Generate a new class derived from this one with given name.

Definition at line 644 of file KVPROOFSelector.cpp.

◆ ParseOptions()

void KVPROOFSelector::ParseOptions ( )
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.

◆ Process()

Bool_t KVPROOFSelector::Process ( Long64_t  entry)
virtual

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.

◆ SaveHistos()

void KVPROOFSelector::SaveHistos ( const Char_t filename = "",
Option_t option = "recreate",
Bool_t  onlyfilled = kFALSE 
)
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

  • if yes write in it
  • if not, create it with the corresponding option, write in it and close it just after

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.

◆ SetCombinedOutputFile()

void KVPROOFSelector::SetCombinedOutputFile ( const TString filename)
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 161 of file KVPROOFSelector.h.

◆ SetEventsReadInterval()

void KVPROOFSelector::SetEventsReadInterval ( Long64_t  N)
inline

Definition at line 123 of file KVPROOFSelector.h.

◆ SetOpt()

void KVPROOFSelector::SetOpt ( const Char_t option,
const Char_t value 
)
virtual

Set a value for an option.

Definition at line 556 of file KVPROOFSelector.cpp.

◆ SlaveBegin()

void KVPROOFSelector::SlaveBegin ( TTree tree)
virtual

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.

◆ SlaveTerminate()

void KVPROOFSelector::SlaveTerminate ( )
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.

◆ Terminate()

void KVPROOFSelector::Terminate ( )
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.

◆ UnsetOpt()

void KVPROOFSelector::UnsetOpt ( const Char_t opt)
virtual

Removes the option 'opt' from the internal lists, as if it had never been set.

Definition at line 597 of file KVPROOFSelector.cpp.

◆ Version()

virtual Int_t KVPROOFSelector::Version ( ) const
inlinevirtual

Reimplemented from TSelector.

Definition at line 127 of file KVPROOFSelector.h.

Member Data Documentation

◆ fCombinedOutputFile

KVString KVPROOFSelector::fCombinedOutputFile
protected

optional name for single results file with trees and histos

Definition at line 87 of file KVPROOFSelector.h.

◆ fDisableCreateTreeFile

Bool_t KVPROOFSelector::fDisableCreateTreeFile
protected

used with PROOF

Definition at line 92 of file KVPROOFSelector.h.

◆ fEventsRead

Long64_t KVPROOFSelector::fEventsRead
protected

cycle number (argument 'entry' passed to Process(Long64_t))

Definition at line 81 of file KVPROOFSelector.h.

◆ fEventsReadInterval

Long64_t KVPROOFSelector::fEventsReadInterval
protected

interval at which to print number of events read

Definition at line 82 of file KVPROOFSelector.h.

◆ fOptionList

KVNameValueList KVPROOFSelector::fOptionList
protected

parsed list of options given to TTree::Process

Definition at line 90 of file KVPROOFSelector.h.

◆ lhisto

KVHashList* KVPROOFSelector::lhisto
protected

!

Definition at line 84 of file KVPROOFSelector.h.

◆ ltree

KVHashList* KVPROOFSelector::ltree
protected

!

Definition at line 85 of file KVPROOFSelector.h.

◆ mergeFile

TProofOutputFile* KVPROOFSelector::mergeFile

for merging with PROOF

Definition at line 102 of file KVPROOFSelector.h.

◆ tree_file_name

TString KVPROOFSelector::tree_file_name

Definition at line 103 of file KVPROOFSelector.h.

◆ writeFile

TFile* KVPROOFSelector::writeFile

Definition at line 101 of file KVPROOFSelector.h.


The documentation for this class was generated from the following files: