AliRoot Core  3dc7879 (3dc7879)
AliTreePlayer.h
Go to the documentation of this file.
1 #ifndef ALITREEPLAYER_H
2 #define ALITREEPLAYER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 /* $Id$ */
6 
7 
68 
69 
70 class TPad;
71 #include "TTreePlayer.h"
72 #include "TTreeFormula.h"
73 
74 class AliTreeFormulaF : public TTreeFormula {
75 public:
78  AliTreeFormulaF(const char *name, const char *formula, TTree *tree, Int_t debug=0);
79  virtual Int_t Compile(const char *expression = "");
80  virtual char *PrintValue(Int_t mode = 0) const; // { PrintValue(mode, 0, ""); }
81  virtual char *PrintValue(Int_t mode, Int_t instance, const char *decform = "9.9") const;
82  virtual void UpdateFormulaLeaves();
83  virtual Int_t GetNdata(){return 1;} // TODO - support for vectors
84 public:
88  mutable TString fValue;
89  Int_t fDebug;
90  ClassDef(AliTreeFormulaF,1)
91 };
92 
93 
94 class AliTreePlayer : public TNamed {
95 public:
97  AliTreePlayer(const char *name, const char *title);
98  static TObjArray * selectMetadata(TTree * tree, TString query, Int_t verbose, TString *idList=NULL);
99  static TObjArray * selectTreeInfo(TTree* tree, TString query,Int_t verbose);
100  static Int_t selectWhatWhereOrderBy(TTree * tree, TString what, TString where, TString orderBy, Int_t firstentry, Int_t nentries, TString outputFormat, TString outputName);
101  static TString printSelectedTreeInfo(TTree*tree, TString infoType, TString regExpFriend, TString regExpTag, Int_t verbose);
102  static TObjArray * MakeHistograms(TTree * tree, TString hisString, TString defaultCut, Int_t firstEntry, Int_t lastEntry, Int_t chunkSize=-1, Int_t verbose=1);
103  static TPad * DrawHistograms(TPad * pad, TObjArray * hisArray, TString drawExpression, TObjArray *keepArray=0, Int_t verbose=0);
104  static void MakeCacheTree(TTree * tree, TString varList, TString outFile, TString outTree, TCut selection, Int_t nEntries=-1, Int_t firstEntry=0);
105 
106  template <typename T> static Long64_t BinarySearchSmaller(Long64_t n, const T *array, T value);
107  enum TStatType {kUndef=-1,kEntries, kSum, kMean, kRMS, kMedian, kLTM, kLTMRMS, kMedianLeft,kMedianRight,kMax,kMin};
108  static Int_t GetStatType(const TString &stat);
109  static void AddStatInfo(TTree* treeLeft, TTree * treeRight , const TString refQuery, Double_t deltaT,
110  const TString statString="median:medianLeft:medianRight:RMS:Mean:LTM0.60:LTMRMS0.60:Max:Min",
111  Int_t maxEntries=100000000);
112  static TTree * LoadTrees(const char *inputDataList, const char * chRegExp, const char * chNotReg, TString inputFileSelection, TString axisAlias, TString axisTitle);
128 protected:
129  ClassDef(AliTreePlayer,1) // Extension of the TTreePlayer
130 };
131 
132 
135 // function gives nearest element smaller than value (different than in the TMath::BinarySearch
136 // See TMath::BinarySearch
142 template <typename T> Long64_t AliTreePlayer::BinarySearchSmaller(Long64_t n, const T *array, T value)
143 {
144  const T* pind;
145  pind = std::lower_bound(array, array + n, value);
146  return ( pind - array - 1);
147 }
148 
149 #endif
150 
Int_t fDebug
current cache value of the formula
Definition: AliTreePlayer.h:89
TObjArray * fFormulaArray
array of format strings to draw
Definition: AliTreePlayer.h:87
#define TObjArray
TObjArray * fFormatArray
array of text inputs
Definition: AliTreePlayer.h:86
TObjArray * hisArray
void LoadTrees()
virtual char * PrintValue(Int_t mode=0) const
virtual Int_t Compile(const char *expression="")
Helper class for AliTreePlayer - formatted string to query tree Example usageExample: Construct direc...
Definition: AliTreePlayer.h:74
TStatToolkit stat
Definition: AnalyzeLaser.C:5
TObjArray * array
Definition: AnalyzeLaser.C:12
Set of functions to extend functionality of the TTreePlayer.
Definition: AliTreePlayer.h:94
TTree * tree
AliTreeFormulaF()
Default constructor.
static Long64_t BinarySearchSmaller(Long64_t n, const T *array, T value)
TObjArray * fTextArray
Definition: AliTreePlayer.h:85
virtual Int_t GetNdata()
Definition: AliTreePlayer.h:83
TString fValue
array of TFormulas
Definition: AliTreePlayer.h:88
virtual void UpdateFormulaLeaves()
Int_t debug