Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TreeMaker.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TreeMaker.C
1 #include <iostream>
2 
3 // --- header for this clase
4 #include <TreeMaker.h>
5 
6 // --- basic sPhenix environment stuff
8 #include <phool/getClass.h>
10 
11 using std::cout;
12 using std::endl;
13 
14 
15 
17 {
18  cout << "TreeMaker::TreeMaker called" << endl;
19  foutname = name;
20 }
21 
22 
24 {
25  cout << "TreeMaker::~TreeMaker called" << endl;
26 }
27 
28 
30 {
31  cout << "TreeMaker::Init called" << endl;
32  outfile = TFile::Open(foutname.c_str(),"RECREATE");
34  return 0;
35 }
36 
37 
39 {
40  cout << "TreeMaker::InitRun called" << endl;
41  int cn_status = CreateNode(topNode);
42  cout << "TreeMaker::InitRun : CreateNode returned " << cn_status << endl;
43  return 0;
44 }
45 
46 
47 
49 {
50 
51  // --- initialize the counters
53 
54  // --- copy the old jets/clusters and make a new container for modified jets/clusters
55  CopyAndMakeJets(topNode);
56  CopyAndMakeClusters(topNode);
57 
58  // --- get the jets and set the tree variables
59  GetTruthJets(topNode);
60  GetRecoJets(topNode);
61 
62  // --- get the clusters and do some analysis
63  GetClusters(topNode);
64 
65  // --- do some stuff with fast jet
66  UseFastJet(topNode);
67 
68  // --- fill the tree
69  tree->Fill();
70 
71  // --- all done!
72  return 0;
73 
74 }
75 
76 
77 
79 {
80  cout << "TreeMaker::End called" << endl;
81  outfile->Write();
82  outfile->Close();
83  cout << "All done! Have a nice day!" << endl;
84  return 0;
85 }
86