Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SLambdaJetHunter.sys.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SLambdaJetHunter.sys.h
1 // ----------------------------------------------------------------------------
2 // 'SLambdaJetHunter.sys.h'
3 // Derek Anderson
4 // 01.25.2024
5 //
6 // A minimal analysis module to find lambda-tagged
7 // jets in pythia events.
8 // ----------------------------------------------------------------------------
9 
10 #ifndef SLAMBDAJETHUNTER_SYS_H
11 #define SLAMBDAJETHUNTER_SYS_H
12 
13 // c++ utilities
14 #include <cassert>
15 
16 // make common namespaces implicit
17 using namespace std;
18 
19 
20 
21 namespace SColdQcdCorrelatorAnalysis {
22 
23  // system methods -----------------------------------------------------------
24 
25  void SLambdaJetHunter::InitTree() {
26 
27  // print debug statement
28  if (m_config.isDebugOn) {
29  cout << "SLambdaJetHunter::InitTree() Initializing output tree" << endl;
30  }
31 
32  // TODO add remaining members
33  m_outTree = new TTree(m_config.outTreeName.data(), "A tree of lambda-tagged jets");
34  m_outTree -> Branch("EvtInfo", "GenInfo", &m_genEvtInfo, 32000, 99);
35  return;
36 
37  } // end 'InitTree()'
38 
39 
40 
41  void SLambdaJetHunter::InitOutput() {
42 
43  // print debug statement
44  if (m_config.isDebugOn) {
45  cout << "SLambdaJetHunter::InitOuput() Initializing output file" << endl;
46  }
47 
48  m_outFile = new TFile(m_config.outFileName.data(), "recreate");
49  if (!m_outFile) {
50  cerr << "PANIC: couldn't open SLambdaJetHunter output file!" << endl;
51  assert(m_outFile);
52  }
53  return;
54 
55  } // end 'InitOutput()'
56 
57 
58 
59  void SLambdaJetHunter::SaveAndCloseOutput() {
60 
61  // print debug statement
62  if (m_config.isDebugOn) {
63  cout << "SLambdaJetHunter::SaveAndCloseOuput() Saving to output file and closing" << endl;
64  }
65 
66  m_outFile -> cd();
67  m_outTree -> Write();
68  m_outFile -> Close();
69  return;
70 
71  } // end 'SaveAndCloseOutput()'
72 
73 } // end SColdQcdCorrelatorAnalysis namespace
74 
75 #endif
76 
77 // end ------------------------------------------------------------------------
78