StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Example_read_table_ntup.C
1 // $Id: Example_read_table_ntup.C,v 1.2 2000/04/12 16:13:40 kathy Exp $
2 // $Log: Example_read_table_ntup.C,v $
3 // Revision 1.2 2000/04/12 16:13:40 kathy
4 // have changed so that macro loads only table libraries needed instead of all table libraries
5 //
6 // Revision 1.1 2000/01/21 18:20:46 kathy
7 // now have macro that writes a table-based ntuple and another that reads the ntuple back in and draws from it
8 //
9 //
10 //=======================================================================
11 // owner: Kathy Turner
12 // what it does:
13 // - read a root table ntuple made from Example_read_dst_write_table_ntup.C
14 // - make plots
15 //
16 // NOTE: the NtupName is the NAME of the table that's on the ntuple!
17 //=======================================================================
18 
19 void Example_read_table_ntup(
20  const Char_t *NtupFile="globtrk_ntup.root",
21  const Char_t *NtupName="globtrk")
22 {
23 
24  cout << " Input ntup file = " << NtupFile << endl;
25  cout << " Input ntup name = " << NtupName << endl;
26 
27  gSystem->Load("StUtilities");
28  gSystem->Load("StAnalysisUtilities");
29 
30  f1 = new TFile(NtupFile);
31 
32  //cout << "List file" << endl;
33  f1.ls();
34 
35  //cout << "Print file" << endl;
36  f1.Print();
37 
38  //cout << "Print ntup" << endl;
39  //globtrk->Print();
40 
41  globtrk->Draw("x_first0:x_first1");
42 
43  globtrk->Draw("x_first0:x_first1","n_point<50 && n_fit_point<40");
44 
45  f1.Close();
46 }
47 
48 
49 
50