Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mergefiles.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file mergefiles.C
1 int
3 {
4  TChain chain("pid_rich_small");
5 
6  TString base("eval_RICH_PID_p");
7  for ( float p = 2; p < 71; p+=2 )
8  {
9  TString file = base;
10  file += p;
11  file.Append(".root");
12 
13  cout << "Adding file: " << file << endl;
14  chain.Add( file );
15  }
16 
17  TFile *output = new TFile("output.root","RECREATE");
18  chain.CloneTree(-1,"fast");
19  output->Write();
20  delete output;
21 
22  chain.Draw("theta_mean:ptot","ptot>1","profs");
23 
24  return 1;
25 }