ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
run_h1analysis.C
Go to the documentation of this file.
1 //
2 // macro driving the analysis
3 //
4 // can specify file name and type
5 //
6 // type == 0 : normal
7 // type = 1 : use AClic to compile selector
8 // type = 2 : use a fill list and then process the fill list
9 
10 //----------------------------------------
11 
12 void run_h1analysis(int type = 0, const char * h1dir = 0) {
13 
14  std::cout << "Run h1 analysis " << std::endl;
15 
16  // create first the chain with all the files
17 
18  TChain chain("h42");
19 
20  if (h1dir) {
21  gSystem->Setenv("H1",h1dir);
22  }
23  else
24  gSystem->Setenv("H1","http://root.cern.ch/files/h1/");
25 
26 
27  std::cout << "Creating the chain" << std::endl;
28 
29  chain.SetCacheSize(20*1024*1024);
30  chain.Add("$H1/dstarmb.root");
31  chain.Add("$H1/dstarp1a.root");
32  chain.Add("$H1/dstarp1b.root");
33  chain.Add("$H1/dstarp2.root");
34 
35  TString selectionMacro = TString(gSystem->DirName(__FILE__) ) + "/h1analysis.C";
36 
37  if (type == 0)
38  chain.Process(selectionMacro);
39  else if (type == 1) {
40  // use AClic ( add a + at the end
41  selectionMacro += "+";
42  chain.Process(selectionMacro);
43  }
44  else if (type == 2) {
45  chain.Process(selectionMacro,"fillList");
46  chain.Process(selectionMacro,"useList");
47  }
48 }
49 
50 
51 
virtual Int_t SetCacheSize(Long64_t cacheSize=-1)
Set maximum size of the file cache .
Definition: TChain.cxx:2287
Basic string class.
Definition: TString.h:137
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:980
TChain chain("h42")
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Definition: TSystem.cxx:1559
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
void run_h1analysis(int type=0, const char *h1dir=0)
int type
Definition: TGX11.cxx:120
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Process all entries in this chain, calling functions in filename.
Definition: TChain.cxx:2140
A chain is a collection of files containg TTree objects.
Definition: TChain.h:35
virtual Int_t Add(TChain *chain)
Add all files referenced by the passed chain to this chain.
Definition: TChain.cxx:210