KaliVeda
Toolkit for HIC analysis
KVPROOFSelector.h
1 
8 #ifndef KVPROOFSelector_h
9 #define KVPROOFSelector_h
10 
11 #include <KVHashList.h>
12 #include <KVNameValueList.h>
13 #include <KVString.h>
14 #include <TH1.h>
15 #include <TH2.h>
16 #include <TH3.h>
17 #include <TSelector.h>
18 #include "TProofOutputFile.h"
19 
79 class KVPROOFSelector : public TSelector {
80 
81 protected :
84 
87 
89 
92 
94 
95  void FillTH1(TH1* h1, Double_t one, Double_t two);
96  void FillTProfile(TProfile* h1, Double_t one, Double_t two, Double_t three);
97  void FillTH2(TH2* h2, Double_t one, Double_t two, Double_t three);
98  void FillTProfile2D(TProfile2D* h2, Double_t one, Double_t two, Double_t three, Double_t four);
99  void FillTH3(TH3* h3, Double_t one, Double_t two, Double_t three, Double_t four);
100 
101 public:
105  Bool_t CreateTreeFile(const Char_t* filename = "");
106 
107  virtual void ParseOptions();
108 
109  KVPROOFSelector(TTree* /*tree*/ = 0) :
111  {
112  lhisto = new KVHashList();
113  ltree = new KVHashList();
114  }
116  {
117  lhisto->Clear();
118  delete lhisto;
119  lhisto = 0;
120  ltree->Clear();
121  delete ltree;
122  ltree = 0;
123  }
125  {
127  }
128  virtual Int_t Version() const
129  {
130  return 3;
131  }
132  virtual void Begin(TTree* tree);
133  virtual void SlaveBegin(TTree* tree);
134  virtual Bool_t Process(Long64_t entry);
135  virtual void SlaveTerminate();
136  virtual void Terminate();
137 
138  /* user entry points */
139  virtual void InitAnalysis() = 0;
140  virtual Bool_t Analysis() = 0;
141  virtual void EndAnalysis() = 0;
142 
143  void AddHisto(TH1* histo);
144  void AddTree(TTree* tree);
145 
146  void FillHisto(const Char_t* sname, Double_t one, Double_t two = 1, Double_t three = 1, Double_t four = 1);
147  void FillTree(const Char_t* sname = "");
148 
149  KVHashList* GetHistoList() const;
150  KVHashList* GetTreeList() const;
151 
152  TH1* GetHisto(const Char_t* name) const;
153  TTree* GetTree(const Char_t* name) const;
154 
155  virtual void SaveHistos(const Char_t* filename = "", Option_t* option = "recreate", Bool_t onlyfilled = kFALSE);
156 
157  virtual void SetOpt(const Char_t* option, const Char_t* value);
158  virtual Bool_t IsOptGiven(const Char_t* option);
159  virtual TString GetOpt(const Char_t* option) const;
160  virtual void UnsetOpt(const Char_t* opt);
161 
162  void SetCombinedOutputFile(const TString& filename)
163  {
172  }
174  {
176  return fEventsRead;
177  }
178  static void Make(const Char_t* classname);
179 
180  ClassDef(KVPROOFSelector, 1)//General purpose class for performing parallel tasks with PROOF
181 };
182 
183 #endif
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
const char Option_t
#define ClassDef(name, id)
#define N
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Extended version of ROOT THashList.
Definition: KVHashList.h:29
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
General purpose class for running parallel tasks with PROOF.
void FillTree(const Char_t *sname="")
void FillTH1(TH1 *h1, Double_t one, Double_t two)
virtual void InitAnalysis()=0
void AddHisto(TH1 *histo)
void FillTProfile2D(TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four)
virtual void UnsetOpt(const Char_t *opt)
Removes the option 'opt' from the internal lists, as if it had never been set.
void AddTree(TTree *tree)
virtual void EndAnalysis()=0
Bool_t fDisableCreateTreeFile
used with PROOF
virtual void Terminate()
virtual Bool_t Analysis()=0
void FillTProfile(TProfile *h1, Double_t one, Double_t two, Double_t three)
KVHashList * GetHistoList() const
return the list of created trees
virtual TString GetOpt(const Char_t *option) const
KVString fCombinedOutputFile
optional name for single results file with trees and histos
void SetEventsReadInterval(Long64_t N)
void FillHisto(const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
void FillTH2(TH2 *h2, Double_t one, Double_t two, Double_t three)
TTree * GetTree(const Char_t *name) const
return the tree named tree_name
virtual void SaveHistos(const Char_t *filename="", Option_t *option="recreate", Bool_t onlyfilled=kFALSE)
virtual void ParseOptions()
virtual void SlaveBegin(TTree *tree)
virtual void SetOpt(const Char_t *option, const Char_t *value)
Set a value for an option.
KVHashList * lhisto
!
Long64_t GetCycleNumber() const
static void Make(const Char_t *classname)
Generate a new class derived from this one with given name.
TH1 * GetHisto(const Char_t *name) const
TProofOutputFile * mergeFile
for merging with PROOF
Long64_t fEventsReadInterval
interval at which to print number of events read
KVNameValueList fOptionList
parsed list of options given to TTree::Process
void FillTH3(TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
virtual Int_t Version() const
KVPROOFSelector(TTree *=0)
virtual void Begin(TTree *tree)
virtual ~KVPROOFSelector()
void SetCombinedOutputFile(const TString &filename)
Bool_t CreateTreeFile(const Char_t *filename="")
KVHashList * ltree
!
Long64_t fEventsRead
cycle number (argument 'entry' passed to Process(Long64_t))
virtual Bool_t Process(Long64_t entry)
KVHashList * GetTreeList() const
return the list of created trees
virtual Bool_t IsOptGiven(const Char_t *option)
Returns kTRUE if the option 'opt' has been set.
virtual void SlaveTerminate()
virtual void Clear(Option_t *option="")
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
long long Long64_t