FairRoot/PandaRoot
Functions
production/scripts/merge.C File Reference

Go to the source code of this file.

Functions

int merge (TString ntp="", TString fout="", TString f1="", TString f2="", TString f3="", TString f4="", TString f5="")
 

Function Documentation

int merge ( TString  ntp = "",
TString  fout = "",
TString  f1 = "",
TString  f2 = "",
TString  f3 = "",
TString  f4 = "",
TString  f5 = "" 
)

Definition at line 1 of file production/scripts/merge.C.

References f1, f2, f3, f4, and n.

2 {
3  if (ntp=="" || fout=="" || f1=="")
4  {
5  cout <<"\nmerge : merges a TTree with certain name from different files to one.\n\n";
6  cout <<"USAGE: merge(TString ntp, TString outfile, TString filepattern 1, ... TString filepattern 5)\n\n";
7  cout <<" ntp : name of the TTree.\n";
8  cout <<" outfile : output file name.\n";
9  cout <<" filepattern 1 : 1st file pattern.\n";
10  cout <<" filepattern 2 : 2nd file pattern (optional).\n";
11  cout <<" ...\n";
12  cout <<" filepattern 2 : 5th file pattern (optional).\n\n";
13 
14  return 0;
15  }
16 
17  TChain n(ntp);
18 
19  n.Add(f1);
20  if (f2!="") n.Add(f2);
21  if (f3!="") n.Add(f3);
22  if (f4!="") n.Add(f4);
23  if (f5!="") n.Add(f5);
24 
25  n.Merge(fout);
26 
27  return 0;
28 }
TF1 * f1
Definition: reco_analys2.C:50
int n
TFile * f4
TFile * f3
TFile * f2